f2fb53cee26769cbd95f03f96e9e4e87d3405cbf
[rocksndiamonds.git] / src / game_sp / vb_types.h
1 // ----------------------------------------------------------------------------
2 // vb_types.h
3 // ----------------------------------------------------------------------------
4
5 #ifndef VB_TYPES_H
6 #define VB_TYPES_H
7
8 #include "../libgame/types.h"
9
10
11 #if 0
12 typedef unsigned char boolean;
13 #endif
14
15 typedef double currency;
16
17 #if 0
18 #if !defined(PLATFORM_WIN32)
19 typedef unsigned char byte;
20 #endif
21 #endif
22
23 typedef int Variant;
24
25 typedef struct
26 {
27   int hWnd;
28 } Object;
29
30 #ifndef HAS_RECT
31 typedef struct
32 {
33   int left;
34   int top;
35   int right;
36   int bottom;
37 } RECT;
38 #define HAS_RECT
39 #endif
40
41 typedef struct
42 {
43   char *Path;
44 } vb_App;
45
46 typedef struct
47 {
48   void (*Assert)(boolean);
49   void (*Print)(char *);
50 } vb_Debug;
51
52 typedef struct
53 {
54   int Number;
55   void (*Raise)(int, char *, char *);
56 } vb_Err;
57
58 typedef struct
59 {
60   int Width;
61   int Height;
62
63   int ScaleWidth;
64   int ScaleHeight;
65   int ScaleMode;
66
67   int Orientation;
68
69   int TwipsPerPixelX;
70   int TwipsPerPixelY;
71
72   int hWnd;
73
74   int (*ScaleX)(int, int, int);
75   int (*ScaleY)(int, int, int);
76 } vb_Generic_Device;
77
78 typedef vb_Generic_Device vb_Screen;
79
80 typedef vb_Generic_Device Form;
81 typedef vb_Generic_Device Picture;
82 typedef vb_Generic_Device IPicture;
83 typedef vb_Generic_Device Printer;
84
85 typedef struct
86 {
87   int lCaps;
88 } vb_Caps;
89
90 typedef struct
91 {
92   int LWidth;
93   int LHeight;
94   int lFlags;
95   vb_Caps ddsCaps;
96 } DDSURFACEDESC2;
97
98 typedef struct
99 {
100   void (*SetHWnd)(long);
101 } DirectDrawClipper;
102
103 typedef struct
104 {
105   boolean (*isLost)(void);
106   void (*GetSurfaceDesc)(DDSURFACEDESC2);
107   void (*SetClipper)(DirectDrawClipper);
108   // long (*Blt)(RECT, DirectDrawSurface7, RECT, int);
109   long (*Blt)(RECT, void *, RECT, int);
110   void (*BltColorFill)(RECT, int);
111 } DirectDrawSurface7;
112
113 typedef struct
114 {
115   DirectDrawSurface7 (*CreateSurface)(DDSURFACEDESC2);
116   DirectDrawSurface7 (*CreateSurfaceFromFile)(char *, DDSURFACEDESC2);
117   void (*SetCooperativeLevel)(int, int);
118   DirectDrawClipper (*CreateClipper)(int);
119   void (*RestoreAllSurfaces)(void);
120 } DirectDraw7;
121
122 typedef struct
123 {
124   int lFlags;
125 } DSBUFFERDESC;
126
127 typedef struct
128 {
129   int nFormatTag;
130   int nChannels;
131   int lSamplesPerSec;
132   int nBitsPerSample;
133   int nBlockAlign;
134   int lAvgBytesPerSec;
135 } WAVEFORMATEX;
136
137 typedef struct
138 {
139   int (*GetStatus)(void);
140   void (*Play)(int);
141 } DirectSoundBuffer;
142
143 typedef struct
144 {
145   void (*SetCooperativeLevel)(long, int);
146   DirectSoundBuffer (*CreateSoundBufferFromFile)(char *, DSBUFFERDESC, WAVEFORMATEX);
147 } DirectSound;
148
149 typedef struct
150 {
151   DirectDraw7 (*DirectDrawCreate)(char *);
152   DirectSound (*DirectSoundCreate)(char *);
153   void (*GetWindowRect)(long, RECT);
154 } DirectX7;
155
156 typedef struct
157 {
158   int Left;
159   int Top;
160   void (*RefreshMarker)(void);
161 } MarkerObject;
162
163 typedef struct
164 {
165   void (*DelayMS)(long, boolean);
166   double (*TickDiffUS)(double);
167   double (*TickNow)();
168 } TickCountObject;
169
170 typedef struct
171 {
172   int Caption;
173   void (*Refresh)(void);
174 } MainForm_lblCount;
175
176 typedef struct
177 {
178   boolean Checked;
179   boolean Enabled;
180 } MainForm_men;
181
182 typedef struct
183 {
184   int Width;
185   int Height;
186   void (*Line)(int, int, int, int, int, int);
187 } MainForm_picPane;
188
189 typedef struct
190 {
191   MainForm_lblCount lblInfoCount;
192   MainForm_lblCount lblRedDiskCount;
193   void (*DisplayLevel)(void);
194   void (*DrawField)(int, int);
195   MainForm_men menGravOn;
196   MainForm_men menZonkOn;
197   MainForm_men menEnOn;
198   MainForm_men menGravOff;
199   MainForm_men menZonkOff;
200   MainForm_men menEnOff;
201   MainForm_men menRemSP;
202   MainForm_men menSP;
203   char *Caption;
204   boolean PanelVisible;
205   void (*ShowKey)(int);
206   void (*SaveSnapshot)(int);
207   void (*menStop_Click)(void);
208   MainForm_picPane picPane;
209   char *lblFrameCount;
210   void (*SetDisplayRegion)(void);
211 } MainFormObject;
212
213 typedef struct
214 {
215   int DestXOff;
216   int DestYOff;
217   void *Surface;
218
219   void (*Cls)();
220   void (*Blt)();
221   void (*ScrollTo)(int, int);
222   void (*ScrollTowards)(int, int, double);
223   void (*SoftScrollTo)(int, int, long, int);
224
225 } DDScrollBuffer;
226
227 typedef struct
228 {
229   int DestXOff;
230   int DestYOff;
231   void *DestinationSurface;
232   void *Surface;
233
234   void (*Cls)();
235   void (*BltEx)(int, int, int);
236 } DDSpriteBuffer;
237
238 typedef struct
239 {
240   void (*CreateAtSize)(long, long, long);
241   void (*Let_Palette)(long, long);
242   void (*Let_ColorIndex)(long, long, long);
243 } BitMapObject;
244
245 struct DemoBufferObject
246 {
247   int Size;
248   byte CheckSumByte;
249   void (*SetSubBuffer)(struct DemoBufferObject *);
250   void (*AddDemoKey)(int);
251   boolean (*Serialize)(FILE *);
252 };
253 typedef struct DemoBufferObject DemoBufferObject;
254
255 typedef struct
256 {
257   int (*Read)(char *ValName, int Default);
258   void (*Save)(char *ValName, int Val);
259 } SettingsObject;
260
261 typedef struct
262 {
263   int left;
264   int top;
265   int ListIndex;
266   char (*List)(int);
267 } cmbFileObject;
268
269 typedef struct
270 {
271   int Width;
272   int Height;
273   boolean Visible;
274   void (*Move)(int, int, int);
275 } shpProgressObject;
276
277 typedef struct
278 {
279   int left;
280   int Top;
281   int Width;
282   int Height;
283 } lblFrameCountObject;
284
285 typedef struct
286 {
287   boolean Checked;
288 } menBorderObject;
289
290 typedef struct
291 {
292   boolean Checked;
293 } menPanelObject;
294
295 typedef struct
296 {
297   boolean Checked;
298 } menAutoScrollObject;
299
300 #endif /* VB_TYPES_H */