2 THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
3 SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
4 END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
5 ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
6 IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
7 SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
8 FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
9 CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
10 AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
11 COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
24 #define DESCENT_VIEWPORT_WIDTH 640
25 #define DESCENT_VIEWPORT_HEIGHT 480
26 #define DESCENT_RENDER_WIDTH 320
27 #define DESCENT_RENDER_HEIGHT 200
32 #define WIN32_LEAN_AND_MEAN
36 #include "win/winapp.h"
41 #undef D2_DEFAULT_PALETTE
44 #define WINAPP_NAME "Descent II"
46 typedef struct GAME_CONTEXT {
51 typedef struct SCREEN_CONTEXT {
56 typedef struct PALETTE {
59 PALETTEENTRY entries[256];
62 typedef struct RGBBITMAPINFO {
63 BITMAPINFOHEADER bmiHeader;
72 #define MSG_SHUTDOWN 1
76 typedef struct WinJoystickDesc {
91 extern HWND _hAppWnd; // Descent Window
92 extern HINSTANCE _hAppInstance;
93 extern int _DDraw; // Direct X Implementation
94 extern BOOL _AppActive;
95 extern BOOL SOS_DLLInit;
96 extern BOOL _RedrawScreen;
97 extern SCREEN_CONTEXT _SCRContext;
100 extern dd_grs_canvas *dd_VR_offscreen_buffer;
101 extern dd_grs_canvas dd_VR_screen_pages[2];
102 extern dd_grs_canvas dd_VR_render_buffer[2];
103 extern dd_grs_canvas dd_VR_render_sub_buffer[2];
109 extern HPALETTE _hAppPalette; // Application Palette
114 extern RECT ViewportRect; // Viewport rect for window
115 extern char *_OffscreenCanvasBits; // Pointer to DIB Bits.
116 extern fix WinFrameTime; // Time per frame
117 extern int Platform_system; // Tells us the platform
122 extern void WinDelay(int msecs);
125 extern void WErrorPrint(char *msg);
126 extern dd_grs_canvas *get_current_game_screen();
127 extern BOOL SOSInit();
128 extern void SOSUnInit();
131 #define MOUSE_DEFAULT_CURSOR 1
132 #define MOUSE_WAIT_CURSOR 2
134 extern void LoadCursorWin(int cursor);
135 extern void ShowCursorW();
136 extern void HideCursorW();
140 #define CanvasWidth(C) ((C).bmiHeader.biWidth)
141 #define CanvasHeight(C) (((C).bmiHeader.biHeight > 0) ? \
142 (C).bmiHeader.biHeight : -(C).bmiHeader.biHeight)
144 #define DebugMessageBox(c) (MessageBox(NULL,c,"Message",MB_OK))
146 #define DEFINE_SCREEN(fn) (_SCRContext.bkg_filename = fn)
148 #define WINNT_PLATFORM 1
149 #define WIN95_PLATFORM 0