rnd-20100224-1-src
[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 } MyRECT;
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)(MyRECT, DirectDrawSurface7, MyRECT, int);
109   long (*Blt)(MyRECT, void *, MyRECT, int);
110   void (*BltColorFill)(MyRECT, 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 #if 0
128
129 typedef struct
130 {
131   int nFormatTag;
132   int nChannels;
133   int lSamplesPerSec;
134   int nBitsPerSample;
135   int nBlockAlign;
136   int lAvgBytesPerSec;
137 } WAVEFORMATEX;
138
139 typedef struct
140 {
141   int (*GetStatus)(void);
142   void (*Play)(int);
143 } DirectSoundBuffer;
144
145 typedef struct
146 {
147   void (*SetCooperativeLevel)(long, int);
148   DirectSoundBuffer (*CreateSoundBufferFromFile)(char *, DSBUFFERDESC, WAVEFORMATEX);
149 } DirectSound;
150
151 typedef struct
152 {
153   DirectDraw7 (*DirectDrawCreate)(char *);
154   DirectSound (*DirectSoundCreate)(char *);
155   void (*GetWindowRect)(long, MyRECT);
156 } DirectX7;
157
158 #endif
159
160 typedef struct
161 {
162   int Left;
163   int Top;
164   void (*RefreshMarker)(void);
165 } MarkerObject;
166
167 typedef struct
168 {
169   void (*DelayMS)(long, boolean);
170   double (*TickDiffUS)(double);
171   double (*TickNow)();
172 } TickCountObject;
173
174 typedef struct
175 {
176   int Caption;
177   void (*Refresh)(void);
178 } MainForm_lblCount;
179
180 typedef struct
181 {
182   boolean Checked;
183   boolean Enabled;
184 } MainForm_men;
185
186 typedef struct
187 {
188   int Width;
189   int Height;
190   void (*Line)(int, int, int, int, int, int);
191 } MainForm_picPane;
192
193 typedef struct
194 {
195   MainForm_lblCount lblInfoCount;
196   MainForm_lblCount lblRedDiskCount;
197   void (*DisplayLevel)(void);
198   void (*DrawField)(int, int);
199   MainForm_men menGravOn;
200   MainForm_men menZonkOn;
201   MainForm_men menEnOn;
202   MainForm_men menGravOff;
203   MainForm_men menZonkOff;
204   MainForm_men menEnOff;
205   MainForm_men menRemSP;
206   MainForm_men menSP;
207   char *Caption;
208   boolean PanelVisible;
209   void (*ShowKey)(int);
210   void (*SaveSnapshot)(int);
211   void (*menStop_Click)(void);
212   MainForm_picPane picPane;
213   char *lblFrameCount;
214   void (*SetDisplayRegion)(void);
215 } MainFormObject;
216
217 typedef struct
218 {
219   int DestXOff;
220   int DestYOff;
221   void *Surface;
222
223   void (*Cls)();
224   void (*Blt)();
225   void (*ScrollTo)(int, int);
226   void (*ScrollTowards)(int, int, double);
227   void (*SoftScrollTo)(int, int, long, int);
228
229 } DDScrollBuffer;
230
231 typedef struct
232 {
233   int DestXOff;
234   int DestYOff;
235   void *DestinationSurface;
236   void *Surface;
237
238   void (*Cls)();
239   // void (*BltEx)(int, int, int);
240   void (*BltImg)(int, int, int, int);
241 } DDSpriteBuffer;
242
243 typedef struct
244 {
245   void (*CreateAtSize)(long, long, long);
246   void (*Let_Palette)(long, long);
247   void (*Let_ColorIndex)(long, long, long);
248 } BitMapObject;
249
250 struct DemoBufferObject
251 {
252   int Size;
253   byte CheckSumByte;
254   void (*SetSubBuffer)(struct DemoBufferObject *);
255   void (*AddDemoKey)(int);
256   boolean (*Serialize)(FILE *);
257 };
258 typedef struct DemoBufferObject DemoBufferObject;
259
260 typedef struct
261 {
262   int (*Read)(char *ValName, int Default);
263   void (*Save)(char *ValName, int Val);
264 } SettingsObject;
265
266 typedef struct
267 {
268   int left;
269   int top;
270   int ListIndex;
271   char (*List)(int);
272 } cmbFileObject;
273
274 typedef struct
275 {
276   int Width;
277   int Height;
278   boolean Visible;
279   void (*Move)(int, int, int);
280 } shpProgressObject;
281
282 typedef struct
283 {
284   int left;
285   int Top;
286   int Width;
287   int Height;
288 } lblFrameCountObject;
289
290 typedef struct
291 {
292   boolean Checked;
293 } menBorderObject;
294
295 typedef struct
296 {
297   boolean Checked;
298 } menPanelObject;
299
300 typedef struct
301 {
302   boolean Checked;
303 } menAutoScrollObject;
304
305 #endif /* VB_TYPES_H */