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.
22 #define DESCENT_VIEWPORT_WIDTH 640
23 #define DESCENT_VIEWPORT_HEIGHT 480
24 #define DESCENT_RENDER_WIDTH 320
25 #define DESCENT_RENDER_HEIGHT 200
30 #define WIN32_LEAN_AND_MEAN
34 #include "win\winapp.h"
39 #undef DEFAULT_PALETTE
42 #define WINAPP_NAME "Descent II"
44 typedef struct GAME_CONTEXT {
49 typedef struct SCREEN_CONTEXT {
54 typedef struct PALETTE {
57 PALETTEENTRY entries[256];
60 typedef struct RGBBITMAPINFO {
61 BITMAPINFOHEADER bmiHeader;
70 #define MSG_SHUTDOWN 1
74 typedef struct WinJoystickDesc {
89 extern HWND _hAppWnd; // Descent Window
90 extern HINSTANCE _hAppInstance;
91 extern int _DDraw; // Direct X Implementation
92 extern BOOL _AppActive;
93 extern BOOL SOS_DLLInit;
94 extern BOOL _RedrawScreen;
95 extern SCREEN_CONTEXT _SCRContext;
98 extern dd_grs_canvas *dd_VR_offscreen_buffer;
99 extern dd_grs_canvas dd_VR_screen_pages[2];
100 extern dd_grs_canvas dd_VR_render_buffer[2];
101 extern dd_grs_canvas dd_VR_render_sub_buffer[2];
107 extern HPALETTE _hAppPalette; // Application Palette
112 extern RECT ViewportRect; // Viewport rect for window
113 extern char *_OffscreenCanvasBits; // Pointer to DIB Bits.
114 extern fix WinFrameTime; // Time per frame
115 extern int Platform_system; // Tells us the platform
120 extern void WinDelay(int msecs);
123 extern void WErrorPrint(char *msg);
124 extern dd_grs_canvas *get_current_game_screen();
125 extern BOOL SOSInit();
126 extern void SOSUnInit();
129 #define MOUSE_DEFAULT_CURSOR 1
130 #define MOUSE_WAIT_CURSOR 2
132 extern void LoadCursorWin(int cursor);
133 extern void ShowCursorW();
134 extern void HideCursorW();
138 #define CanvasWidth(C) ((C).bmiHeader.biWidth)
139 #define CanvasHeight(C) (((C).bmiHeader.biHeight > 0) ? \
140 (C).bmiHeader.biHeight : -(C).bmiHeader.biHeight)
142 #define DebugMessageBox(c) (MessageBox(NULL,c,"Message",MB_OK))
144 #define DEFINE_SCREEN(fn) (_SCRContext.bkg_filename = fn)
146 #define WINNT_PLATFORM 1
147 #define WIN95_PLATFORM 0