]> icculus.org git repositories - btb/d2x.git/blob - main/desw.h
typo
[btb/d2x.git] / main / desw.h
1 /*
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.
12 */
13
14
15
16 #ifndef _DESW_H
17 #define _DESW_H
18
19
20 #ifdef WINDOWS
21
22 #define DESCENT_VIEWPORT_WIDTH  640
23 #define DESCENT_VIEWPORT_HEIGHT 480
24 #define DESCENT_RENDER_WIDTH            320
25 #define DESCENT_RENDER_HEIGHT           200
26
27
28 #define WIN95
29 #define _WIN32
30 #define WIN32_LEAN_AND_MEAN
31 #include <windows.h>
32
33 #include "win\dd.h"
34 #include "win\winapp.h"
35 #include "pstypes.h"
36 #include "fix.h"
37 #include "gr.h"
38
39 #undef  DEFAULT_PALETTE
40
41
42 #define WINAPP_NAME "Descent II"
43
44 typedef struct GAME_CONTEXT {
45         BOOL paused;
46         BOOL active;
47 };
48
49 typedef struct SCREEN_CONTEXT {
50         char *bkg_filename;
51 } SCREEN_CONTEXT;
52
53
54 typedef struct PALETTE {
55         WORD version;
56         WORD num_entries;
57         PALETTEENTRY entries[256];
58 } PALETTE;
59
60 typedef struct RGBBITMAPINFO {
61         BITMAPINFOHEADER        bmiHeader;
62         RGBQUAD                         rgb[256];
63 } RGBBITMAPINFO;
64
65
66
67 //      Other Structures
68
69 #define MSG_QUIT        0
70 #define MSG_SHUTDOWN 1
71 #define MSG_NORMAL 2
72
73
74 typedef struct WinJoystickDesc {
75         char title[32];
76         char cal_ztitle[16];
77         char cal_rtitle[16];
78         char cal_utitle[16];
79         char cal_vtitle[16];
80         char cal_zmsg[6][16];
81         char cal_rmsg[6][16];
82         char cal_umsg[6][16];
83         char cal_vmsg[6][16];
84 } WinJoystickDesc;
85
86
87 //      Globals
88
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;
96
97
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];
102
103
104
105 //      WinG Stuff
106
107 extern HPALETTE _hAppPalette;                                   // Application Palette
108
109
110 //      Other Globals
111
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
116
117
118 //      Functions
119
120 extern void WinDelay(int msecs);
121
122 //      misc functions
123 extern void WErrorPrint(char *msg);
124 extern dd_grs_canvas *get_current_game_screen();
125 extern BOOL SOSInit();
126 extern void SOSUnInit();
127
128
129 #define MOUSE_DEFAULT_CURSOR 1
130 #define MOUSE_WAIT_CURSOR 2
131
132 extern void LoadCursorWin(int cursor);
133 extern void ShowCursorW();
134 extern void HideCursorW();
135
136
137 //      Macros
138 #define CanvasWidth(C) ((C).bmiHeader.biWidth)
139 #define CanvasHeight(C) (((C).bmiHeader.biHeight > 0) ? \
140                                                         (C).bmiHeader.biHeight : -(C).bmiHeader.biHeight)
141
142 #define DebugMessageBox(c) (MessageBox(NULL,c,"Message",MB_OK))
143
144 #define DEFINE_SCREEN(fn) (_SCRContext.bkg_filename = fn)
145
146 #define WINNT_PLATFORM 1
147 #define WIN95_PLATFORM 0
148
149
150 #endif
151
152
153 #endif