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