Wing Commander
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
dib.c
Go to the documentation of this file.
1/**
2 * @file
3 * @ingroup graphics
4 * @brief DirectDraw back end: frame buffer, palette and screen updates.
5 *
6 * Address range 431f00-43390f. The named DirectDraw routines are followed by
7 * DirectDrawResultToText and its compiler-generated switch tables.
8 * ThrottleFrameAndDrawFps belongs here: it uses this unit's statics
9 * szFrameRateLabel and fSampledFps, and its 1000.0 constant follows the
10 * unit's DirectDraw GUIDs in .rdata.
11 */
12#include "wc1.h"
13#include <sys/stat.h>
14
15static LPDIRECTDRAW2 pDirectDraw2 = 0; /* 0x0046b1a4 */
16static LPDIRECTDRAWSURFACE pPrimarySurface = 0; /* 0x0046b1a8 */
17static LPDIRECTDRAWSURFACE pSecondarySurface = 0; /* 0x0046b1ac */
18static LPDIRECTDRAWPALETTE pDirectDrawPalette = 0; /* 0x0046b1b0 */
19static int nDIBCascadeLevel = -1; /* 0x0046b1b4 */
20int nFrameIntervalMs = 62; /* 0x0046b1b8 */
21static int nFrameDeadlineMs = 0; /* 0x0046b1bc */
22/* Nothing in the shipped executable references this zero word. */
23static int DAT_0046b1c0 = 0; /* 0x0046b1c0 */
24static int nPreviousFrameTimeMs = 0; /* 0x0046b1c4 */
25static int bSpaceFlightFrameTiming = 0; /* 0x0046b1c8 */
26static float fSpaceFlightFrameRate = 20.0f; /* 0x0046b1cc */
27static float fCinematicFrameRate = 16.0f; /* 0x0046b1d0 */
28/* Nothing in the shipped executable references this zero word either. */
29static int DAT_0046b1d4 = 0; /* 0x0046b1d4 */
30
31/* DirectDraw's SDK identifiers occur in this order before the frame-timing
32 * constants. The original SDK also emitted the unused class/interface IDs. */
33const GUID CLSID_DirectDraw = {
34 0xd7b70ee0, 0x4340, 0x11cf,
35 { 0xb0, 0x63, 0x00, 0x20, 0xaf, 0xc2, 0xcd, 0x35 }
36}; /* 0x004630e8 */
38 0x593817a0, 0x7db3, 0x11cf,
39 { 0xa2, 0xde, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56 }
40}; /* 0x004630f8 */
41const GUID IID_IDirectDraw = {
42 0x6c14db80, 0xa733, 0x11ce,
43 { 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60 }
44}; /* 0x00463108 */
45const GUID guidDirectDraw2 = {
46 0xb3a6f3e0, 0x2b43, 0x11cf,
47 { 0xa2, 0xde, 0x00, 0xaa, 0x00, 0xb9, 0x33, 0x56 }
48}; /* 0x00463118 */
50 0x6c14db81, 0xa733, 0x11ce,
51 { 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60 }
52}; /* 0x00463128 */
54 0x57805885, 0x6eec, 0x11cf,
55 { 0x94, 0x41, 0xa8, 0x23, 0x03, 0xc1, 0x0e, 0x27 }
56}; /* 0x00463138 */
58 0x6c14db84, 0xa733, 0x11ce,
59 { 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60 }
60}; /* 0x00463148 */
62 0x6c14db85, 0xa733, 0x11ce,
63 { 0xa5, 0x21, 0x00, 0x20, 0xaf, 0x0b, 0xe5, 0x60 }
64}; /* 0x00463158 */
65
66/* Frame buffers, DirectDraw window and palette state, and frame-rate text.
67 * CL places these statics by identifier hash, so their spellings reproduce
68 * the original order. The unused entries are unreferenced original storage;
69 * the window handle is also read by the SDL event adapter. Group the frame
70 * dimensions and image pointer first; this preserves the native operand
71 * order as well as the hash-ordered storage. */
72static unsigned int nDIBFrameHeight; /* 0x00476650 */
73static unsigned int nDIBFrameWidth; /* 0x0047664c */
74static unsigned char *pDIBImage; /* 0x00476648 */
75static unsigned char szFrameRateLabel[32]; /* 0x00476620 */
76static unsigned int DAT_00476640; /* 0x00476640 */
77static unsigned int DAT_00476644; /* 0x00476644 */
78static unsigned char abDIBPixelBackup[0xfa00]; /* 0x00476658 */
79static int DAT_00486058; /* 0x00486058 */
80static int nUnusedDIBData; /* 0x0048605c */
81static int nDIBSlamTotal; /* 0x00486060 */
82static int nUnusedDIBValue; /* 0x00486064 */
83static unsigned char abUnusedDIBArea[12]; /* 0x00486068 */
84/* These two names share a hash key; CL places the later declaration first. */
85static char szDIBFailureString[0x98]; /* 0x00486078 */
86static
87HWND hDIBParentWindow; /* 0x00486074 */
88static unsigned char abDIBPaletteQuads[1024]; /* 0x00486110 */
89static float fSampledFps; /* 0x00486510 */
90static int nUnusedDIBLevel; /* 0x00486514 */
91static int bPendingDIBSlam; /* 0x00486518 */
92static unsigned char abUnusedDIBRect[8]; /* 0x00486520 */
93static char szSpaceFlightFpsCapMessage[0x80]; /* 0x00486528 */
94
95/* Linker commons defined here; LINK orders them by identifier hash. */
96signed char cCurrentNavPtIdx; /* 0x0059c86c */
97short asObjectFlipArray[SPACE_OBJECT_COUNT]; /* 0x0059c870 */
98short nEyeRollTargetValue; /* 0x0059c8f0 */
100short nCurrentHazardFieldTotal; /* 0x0059c90c */
101signed char acPreviousAttackers[16]; /* 0x0059c910 */
102signed char acViableTargetList[16]; /* 0x0059c920 */
103short asActionCounts[10]; /* 0x0059c930 */
104short nEyeYawGoalValue; /* 0x0059c944 */
108signed char aShipWeaponsTable[10][0x47]; /* 0x0059cab0 */
109
110/* DIBreInstall calls DIBcascade before its definition. */
111int DIBcascade(int mode, int *reportedResult);
112
113/* Function start: 0x431F00 */
115{
116 DWORD now;
117
118 if (bShowFrameRate != 0) {
119 sprintf((char *)szFrameRateLabel, "%f",
121 TextOutA(dc, 0, 0, (char *)szFrameRateLabel,
122 strlen((char *)szFrameRateLabel));
123 }
124
126 pDIBImage) {
127 while (timeGetTime() < (DWORD)nFrameDeadlineMs) {
128 Sleep(0);
130 }
131 } else {
132 while (timeGetTime() < (DWORD)nFrameDeadlineMs)
133 Sleep(0);
134 }
135
136 if (bShowFrameRate != 0) {
137 if (nPreviousFrameTimeMs != 0) {
138 now = timeGetTime();
140 1000.0f / ((float)now - nPreviousFrameTimeMs);
141 }
142 nPreviousFrameTimeMs = timeGetTime();
143 sprintf((char *)szFrameRateLabel, "%f",
145 TextOutA(dc, 0, 0, (char *)szFrameRateLabel,
146 strlen((char *)szFrameRateLabel));
147 }
148
149 nFrameDeadlineMs = timeGetTime() + nFrameIntervalMs;
150}
151
152/* Function start: 0x432050 */
153void ReportSpaceFlightMaxFps(float adjustment)
154{
155 double frameRate;
156
157 frameRate = fSpaceFlightFrameRate;
158 frameRate += adjustment;
159 fSpaceFlightFrameRate = frameRate;
160 if (fSpaceFlightFrameRate < 8.0)
162 else if (fSpaceFlightFrameRate > 32.0)
163 fSpaceFlightFrameRate = 32.0f;
165 "Space Flight Max FPS : %.1f",
166 (double)fSpaceFlightFrameRate);
170}
171
172/* Function start: 0x4320E0 */
174{
177 (long)(1000.0 / fSpaceFlightFrameRate);
179}
180
181/* Function start: 0x432110 */
183{
186 (long)(1000.0 / fCinematicFrameRate);
188}
189
190/* Function start: 0x432140 */
191void DIBerror(const char *tag, int hr)
192{
193 FILE *errorFile;
194 char *text = DirectDrawResultToText(hr);
195
196 sprintf(szDIBFailureString, "ERROR: %s - (%s)", tag, text);
199 IDirectDraw2_RestoreDisplayMode(pDirectDraw2);
200 IDirectDraw2_Release(pDirectDraw2);
201 OutputDebugStringA(szDIBFailureString);
202 SetWindowPos(hDIBParentWindow, HWND_BOTTOM, 0, 0, 320, 200,
203 SWP_SHOWWINDOW);
204 errorFile = fopen("direct.err", "wt+");
205 fprintf(errorFile, szDIBFailureString);
206 fclose(errorFile);
207 MessageBoxA(0, szDIBFailureString, "DirectDraw Error",
208 MB_ICONERROR);
209 exit(1);
210}
211
212/* Function start: 0x432230 */
214{
217 IDirectDraw2_RestoreDisplayMode(pDirectDraw2);
218 IDirectDraw2_Release(pDirectDraw2);
219 SetWindowPos(hDIBParentWindow, HWND_BOTTOM, 0, 0, 320, 200,
220 SWP_SHOWWINDOW);
221}
222
223/* Function start: 0x4322B0 */
224void DIBreInstall(void)
225{
226 int err;
227
229 IDirectDraw2_SetCooperativeLevel(
231 if (DIBcascade(-2, &err) == 0)
232 DIBerror("DIBreInstall DIBcascade Failure", err);
233 } else {
234 nDIBCascadeLevel = -1;
235 }
236 DIBslam();
237 DIBslamReal();
238}
239
240/* Function start: 0x432310 */
241void DIBinstall(HWND window)
242{
243 LPDIRECTDRAW directDraw;
244 HRESULT result;
245 int cascadeResult;
246
247 hDIBParentWindow = window;
248 result = DirectDrawCreate(0, &directDraw, 0);
249 if (result != DD_OK)
250 DIBerror("DIBInstall Create", result);
251
252 result = IDirectDraw_QueryInterface(
253 directDraw, &guidDirectDraw2,
254 (void **)&pDirectDraw2);
255 if (result != DD_OK)
256 DIBerror("DIBInstall Unable to acquire DirectDraw2 interface", result);
257
259 result = IDirectDraw2_SetCooperativeLevel(
261 else
262 result = IDirectDraw2_SetCooperativeLevel(
264 if (result != DD_OK)
265 DIBerror("DIBmakeInstall SetCooperativeLevel", result);
266
268 cascadeResult = DIBcascade(-1, 0);
269 if (cascadeResult == 0)
270 DIBerror("DIBinstall DIBcascade Failure", result);
271 } else {
272 nDIBCascadeLevel = -1;
273 }
274
275 hDIBParentWindow = window;
276 memset(abDIBPaletteQuads, 0,
277 sizeof(abDIBPaletteQuads));
278 memset(abDIBPixelBackup, 0,
279 sizeof(abDIBPixelBackup));
280 DIBmakeDIB();
281 bPendingDIBSlam = 1;
282 nDIBSlamTotal = 0;
283}
284
285/* Function start: 0x432410 */
286int DIBcascade(int mode, int *reportedResult)
287{
288 DDSURFACEDESC surface;
289 HRESULT result;
290
291 for (;;) {
292 if (mode != -2) {
293 if (mode == -1)
295 else
297 }
298
299 switch (nDIBCascadeLevel) {
300 case 0:
301 result = pDirectDraw2->lpVtbl->SetDisplayMode(
302 pDirectDraw2, 320, 200, 8, 0, 0);
303 if (reportedResult != 0)
304 *reportedResult = result;
305 if (result != DD_OK) {
306 reportedResult = 0;
307 mode = 0;
308 continue;
309 }
310 OutputDebugStringA("320x200 achieved...testing\n");
311 break;
312 case 1:
313 result = pDirectDraw2->lpVtbl->SetDisplayMode(
314 pDirectDraw2, 640, 400, 8, 0, 0);
315 if (reportedResult != 0)
316 *reportedResult = result;
317 if (result != DD_OK) {
318 reportedResult = 0;
319 mode = 0;
320 continue;
321 }
322 OutputDebugStringA("640x400 achieved...testing\n");
323 break;
324 case 2:
325 result = pDirectDraw2->lpVtbl->SetDisplayMode(
326 pDirectDraw2, 640, 480, 8, 0, 0);
327 if (reportedResult != 0)
328 *reportedResult = result;
329 if (result != DD_OK) {
330 reportedResult = 0;
331 mode = 0;
332 continue;
333 }
334 OutputDebugStringA("640x480 achieved...testing\n");
335 break;
336 default:
337 return 0;
338 }
339
340 if (mode == -2) {
341 if (pSecondarySurface != 0) {
342 result = IDirectDrawSurface_Restore(
344 if (reportedResult != 0)
345 *reportedResult = result;
346 if (result != DD_OK)
347 DIBerror("DIBcascade Unable to restore surface (secondary)",
348 result);
349 }
350
351 result = IDirectDrawSurface_Restore(
353 if (reportedResult != 0)
354 *reportedResult = result;
355 if (result != DD_OK)
356 DIBerror("DIBcascade Unable to restore surface", result);
357
358 result = IDirectDrawSurface_SetPalette(
361 if (result != DD_OK)
362 DIBerror("DIBcascade CreatePalette", result);
363 return 1;
364 }
365
366 OutputDebugStringA(" acquiring surface:");
367 memset(&surface, 0, sizeof(surface));
368 surface.dwSize = sizeof(surface);
369 surface.dwFlags = DDSD_CAPS;
370 surface.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
371 result = IDirectDraw2_CreateSurface(
372 pDirectDraw2, &surface,
373 &pPrimarySurface, 0);
374 if (reportedResult != 0)
375 *reportedResult = result;
376 if (result != DD_OK) {
377 OutputDebugStringA(" failed\n");
378 mode = 0;
379 IDirectDraw2_RestoreDisplayMode(pDirectDraw2);
380 reportedResult = 0;
381 continue;
382 }
383
384 OutputDebugStringA(" successful\n locking surface:");
385 result = IDirectDrawSurface_Lock(
386 pPrimarySurface, 0, &surface,
387 DDLOCK_WAIT, 0);
388 if (reportedResult != 0)
389 *reportedResult = result;
390 if (result != DD_OK) {
391 OutputDebugStringA(" failed\n");
392 mode = 0;
393 IDirectDrawSurface_Release(pPrimarySurface);
394 IDirectDraw2_RestoreDisplayMode(pDirectDraw2);
395 reportedResult = 0;
396 continue;
397 }
398
399 IDirectDrawSurface_Unlock(
400 pPrimarySurface, surface.lpSurface);
401 IDirectDrawSurface_Release(
403 pPrimarySurface = 0;
404 OutputDebugStringA(" successful\n");
405 return 1;
406 }
407}
408
409/* Function start: 0x432680 */
410/* Full teardown: destroy the DIB, release its surfaces, restore the display
411 * mode and release DirectDraw itself. */
412void DIBunInstall(void)
413{
417 IDirectDraw2_RestoreDisplayMode(pDirectDraw2);
418 IDirectDraw2_Release(pDirectDraw2);
419}
420
421/* Function start: 0x4326E0 */
422void DIBmakeDIB(void)
423{
424 DDSURFACEDESC surface;
425 unsigned char entries[0x400];
426 HRESULT result;
427 int offset;
428
429 memset(&surface, 0, sizeof(surface));
430 surface.dwSize = sizeof(surface);
431 surface.dwFlags = DDSD_CAPS;
432 surface.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_MODEX;
433 result = IDirectDraw2_CreateSurface(
434 pDirectDraw2, &surface,
435 &pPrimarySurface, 0);
436 if (result != DD_OK)
437 DIBerror("DIBmakeDIB CreateSurface (primary)", result);
438
439 DAT_00486058 = 8;
440 offset = 0;
441 do {
442 entries[offset] = abDIBPaletteQuads[offset + 2];
443 entries[offset + 1] = abDIBPaletteQuads[offset + 1];
444 entries[offset + 2] = abDIBPaletteQuads[offset];
445 entries[offset + 3] = 0;
446 offset += 4;
447 } while (offset < 0x400);
448
449 result = IDirectDraw2_CreatePalette(
450 pDirectDraw2, DDPCAPS_8BIT, (LPPALETTEENTRY)entries,
452 if (result != DD_OK)
453 DIBerror("DIBmakeDIB CreatePalette", result);
454
455 result = IDirectDrawSurface_SetPalette(
458 if (result != DD_OK)
459 DIBerror("DIBmakeDIB CreatePalette", result);
460
461 if (nDIBCascadeLevel > 0) {
462 memset(&surface, 0, sizeof(surface));
463 surface.dwSize = sizeof(surface);
464 surface.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
465 surface.dwWidth = 320;
466 surface.dwHeight = 200;
467 surface.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
468 result = IDirectDraw2_CreateSurface(
469 pDirectDraw2, &surface,
471 if (result != DD_OK)
472 DIBerror("DIBmakeDIB CreateSurface (secondary)", result);
473 }
474
475 DAT_00476644 = 0;
476 DAT_00476640 = 0;
477 nDIBFrameWidth = 320;
478 nDIBFrameHeight = 200;
479 pDIBImage = malloc(64000);
484}
485
486/* Function start: 0x4328A0 */
488{
489 int result;
490
493 if (nDIBCascadeLevel > 0) {
494 result = IDirectDrawSurface_Release(pSecondarySurface);
495 if (result != 0)
496 DIBerror("DIBdestroyDIB secondary->Release", result);
498 }
499 if (pPrimarySurface != 0) {
500 result = IDirectDrawSurface_Release(pPrimarySurface);
501 if (result != 0)
502 DIBerror("DIBdestroyDIB primary->Release", result);
503 pPrimarySurface = 0;
504 }
505 if (pDIBImage != 0)
506 free(pDIBImage);
507 DAT_00476640 = 0;
508 DAT_00476644 = 0;
509 pDIBImage = 0;
510}
511
512/* Function start: 0x432960 */
513void DIBslam(void)
514{
515 bPendingDIBSlam = 1;
516}
517
518/* Function start: 0x432970 */
519void DIBslamReal(void)
520{
521 DDSURFACEDESC surface;
522 unsigned char *destination;
523 unsigned char *source;
524 RECT destinationRect;
525 RECT sourceRect;
526 HRESULT result;
527 int row;
528 HDC dc;
529
531 if (bPendingDIBSlam != 0) {
532 memset(&surface, 0, sizeof(surface));
533 surface.dwSize = sizeof(surface);
534
536 pDIBImage) {
539 }
540
541 if (nDIBCascadeLevel > 0) {
542 result = IDirectDrawSurface_Lock(
544 0, &surface, DDLOCK_WAIT, 0);
545 } else {
546 result = IDirectDrawSurface_Lock(
548 0, &surface, DDLOCK_WAIT, 0);
549 }
550 if (result != DD_OK) {
551 if (result == DDERR_SURFACELOST) {
552 if (nDIBCascadeLevel > 0) {
553 result = IDirectDrawSurface_Restore(
555 if (result != DD_OK)
556 DIBerror("DIBslamReal Unable to restore surface (secondary)",
557 result);
558 }
559 result = IDirectDrawSurface_Restore(
561 if (result != DD_OK)
562 DIBerror("DIBslamReal Unable to restore surface (primary)",
563 result);
564
565 if (nDIBCascadeLevel > 0) {
566 result = IDirectDrawSurface_Lock(
568 0, &surface, DDLOCK_WAIT, 0);
569 } else {
570 result = IDirectDrawSurface_Lock(
572 0, &surface, DDLOCK_WAIT, 0);
573 }
574 if (result != DD_OK)
575 DIBerror("DIBslamReal Unable to lock restored surface",
576 result);
577 } else {
578 IDirectDrawSurface_Unlock(
579 pPrimarySurface, surface.lpSurface);
580 DIBerror("DIBslamReal secondary->Lock", result);
581 }
582 }
583
584 destination = surface.lpSurface;
585 source = pDIBImage;
586 if (nDIBCascadeLevel <= 0) {
587 IDirectDraw2_WaitForVerticalBlank(
588 pDirectDraw2, DDWAITVB_BLOCKBEGIN, 0);
589 }
590 row = 0;
591 if ((int)nDIBFrameHeight > 0) {
592 do {
593 memcpy(destination, source, nDIBFrameWidth);
594 destination += surface.lPitch;
595 source += nDIBFrameWidth;
596 row++;
597 } while ((int)nDIBFrameHeight > row);
598 }
599
600 if (nDIBCascadeLevel > 0) {
601 IDirectDrawSurface_Unlock(
602 pSecondarySurface, surface.lpSurface);
603 } else {
604 IDirectDrawSurface_Unlock(
605 pPrimarySurface, surface.lpSurface);
606 }
607
609 pDIBImage)
611
612 if (nDIBCascadeLevel > 0) {
613 destinationRect.left = 0;
614 destinationRect.top = 0;
615 destinationRect.right = 639;
616 destinationRect.bottom = 399;
617 sourceRect.left = 0;
618 sourceRect.top = 0;
619 sourceRect.right = 319;
620 sourceRect.bottom = 199;
621 if (nDIBCascadeLevel == 2) {
622 destinationRect.top = 40;
623 destinationRect.bottom = 439;
624 }
625
626 result = IDirectDrawSurface_Blt(
627 pPrimarySurface, &destinationRect,
628 pSecondarySurface, &sourceRect,
629 DDBLT_WAIT, 0);
630 if (result != DD_OK) {
631 if (result == DDERR_SURFACELOST) {
632 result = IDirectDrawSurface_Restore(
634 if (result != DD_OK)
635 DIBerror("DIBslamReal (BLIT) Unable to restore surface (primary)",
636 result);
637 result = IDirectDrawSurface_Restore(
639 if (result != DD_OK)
640 DIBerror("DIBslamReal (BLIT) Unable to restore surface (secondary)",
641 result);
642 result = IDirectDrawSurface_Blt(
643 pPrimarySurface, &destinationRect,
644 pSecondarySurface, &sourceRect,
645 DDBLT_WAIT, 0);
646 if (result != DD_OK)
647 DIBerror("DIBslamReal (BLIT) Unable to blit to restored surface (primary)",
648 result);
649 } else {
650 DIBerror("DIBslamReal primary->Blt", result);
651 }
652 }
653 }
654 bPendingDIBSlam = 0;
655 }
656
659 dc = GetDC(hDIBParentWindow);
661 ReleaseDC(hDIBParentWindow, dc);
662}
663
664/* Function start: 0x432C60 */
665void DIBupdate(int left, int top, int right, int bottom)
666{
667 unsigned char *destination;
668 unsigned char *source;
669 DDSURFACEDESC surface;
670 int width;
671 int height;
672 HRESULT result;
673 int destinationOffset;
674 int sourceOffset;
675
676 if (nDIBCascadeLevel > 0)
677 return;
678 if (left < 0)
679 left = 0;
680 else if (left > 319)
681 return;
682 if (right < 0)
683 return;
684 if (right > 319)
685 right = 319;
686 if (top < 0)
687 top = 0;
688 else if (top > 199)
689 return;
690 if (bottom < 0)
691 return;
692 if (bottom > 199)
693 bottom = 199;
694
695 width = right - left + 1;
696 height = bottom - top + 1;
697 memset(&surface, 0, sizeof(surface));
698 surface.dwSize = sizeof(surface);
699 result = IDirectDrawSurface_Lock(
700 pPrimarySurface, 0, &surface,
701 DDLOCK_WAIT, 0);
702 if (result != DD_OK) {
703 IDirectDrawSurface_Unlock(
704 pPrimarySurface, surface.lpSurface);
705 DIBerror("DIBupdate primary->Lock", result);
706 }
707
708 destinationOffset = surface.lPitch * top;
709 destinationOffset += left;
710 destination = (unsigned char *)surface.lpSurface + destinationOffset;
711 sourceOffset = nDIBFrameWidth * top;
712 sourceOffset += left;
713 source = pDIBImage + sourceOffset;
714 IDirectDraw2_WaitForVerticalBlank(
715 pDirectDraw2, DDWAITVB_BLOCKBEGIN, 0);
716 while (height > 0) {
717 memcpy(destination, source, width);
718 destination += surface.lPitch;
719 source += nDIBFrameWidth;
720 height--;
721 }
722 IDirectDrawSurface_Unlock(
723 pPrimarySurface, surface.lpSurface);
724}
725
726/* Function start: 0x432DE0 */
727unsigned char *GetDIBPixelBuffer(void)
728{
729 return pDIBImage;
730}
731
732/* Function start: 0x432DF0 */
733/* Empty, and nothing in the shipped executable calls it, so its purpose
734 * cannot be recovered; it sits between the DIB accessors. */
736{
737}
738
739/* Function start: 0x432E00 */
741{
742 return hDIBParentWindow;
743}
744
745/* Function start: 0x432E10 */
746/* Nothing in the shipped executable calls this. */
747unsigned int GetDIBWidth(void)
748{
749 return nDIBFrameWidth;
750}
751
752/* Function start: 0x432E20 */
753/* Nothing in the shipped executable calls this. */
754unsigned int GetDIBHeight(void)
755{
756 return nDIBFrameHeight;
757}
758
759/* Function start: 0x432E30 */
760void CachePaletteEntryFromWords(short index, short *rgb)
761{
762 awPaletteRgbWordsList[index * 3] =
763 abDIBPaletteQuads[index * 4 + 2] = (unsigned char)rgb[0];
764 awPaletteRgbWordsList[index * 3 + 1] =
765 abDIBPaletteQuads[index * 4 + 1] = (unsigned char)rgb[1];
766 awPaletteRgbWordsList[index * 3 + 2] =
767 abDIBPaletteQuads[index * 4] = (unsigned char)rgb[2];
768 abDIBPaletteQuads[index * 4 + 3] = 1;
769}
770
771/* Function start: 0x432EA0 */
773{
774 unsigned char entries[0x400];
775 int offset = 0;
776 HRESULT result;
777
778 do {
779 entries[offset] = abDIBPaletteQuads[offset + 2];
780 entries[offset + 1] = abDIBPaletteQuads[offset + 1];
781 entries[offset + 2] = abDIBPaletteQuads[offset];
782 entries[offset + 3] = 0;
783 offset += 4;
784 } while (offset < 0x400);
785
786 result = IDirectDrawPalette_SetEntries(
787 pDirectDrawPalette, 0, 0, 256,
788 (LPPALETTEENTRY)entries);
789 if (result != DD_OK)
790 DIBerror("DIBramPalette SetEntries", result);
791}
792
793/* Function start: 0x432F10 */
794void DIBsetPalette(short index, short *rgb)
795{
796 PALETTEENTRY entry;
797 HRESULT result;
798
799 if (abDIBPaletteQuads[index * 4 + 2] != rgb[0] ||
800 abDIBPaletteQuads[index * 4 + 1] != rgb[1] ||
801 abDIBPaletteQuads[index * 4] != rgb[2]) {
802 abDIBPaletteQuads[index * 4 + 2] = (unsigned char)rgb[0];
803 awPaletteRgbWordsList[index * 3] = abDIBPaletteQuads[index * 4 + 2];
804 abDIBPaletteQuads[index * 4 + 1] = (unsigned char)rgb[1];
805 awPaletteRgbWordsList[index * 3 + 1] = abDIBPaletteQuads[index * 4 + 1];
806 abDIBPaletteQuads[index * 4] = (unsigned char)rgb[2];
807 awPaletteRgbWordsList[index * 3 + 2] = abDIBPaletteQuads[index * 4];
808 abDIBPaletteQuads[index * 4 + 3] = 1;
809
810 /* SDL_PORT consumes this cache on the next normal frame submission.
811 A DirectDraw palette entry update did not blit or wait for vertical
812 blank, so flight fades must not submit additional SDL frames. */
813 entry.peRed = (unsigned char)awPaletteRgbWordsList[index * 3];
814 entry.peGreen = (unsigned char)awPaletteRgbWordsList[index * 3 + 1];
815 entry.peBlue = (unsigned char)awPaletteRgbWordsList[index * 3 + 2];
816 entry.peFlags = 0;
817 result = IDirectDrawPalette_SetEntries(
818 pDirectDrawPalette, 0, index, 1, &entry);
819 if (result != DD_OK)
820 DIBerror("DIBsetPalette SetEntries", result);
821
822 result = IDirectDrawSurface_SetPalette(
825 if (result != DD_OK)
826 DIBerror("DIBmakeDIB CreatePalette", result);
827 }
828}
829
830/* Function start: 0x433020 */
831void GetPaletteEntryAsWords(short i, short *rgb)
832{
833 int k = i * 4;
834
835 rgb[0] = abDIBPaletteQuads[k + 2];
836 rgb[1] = abDIBPaletteQuads[k + 1];
837 rgb[2] = abDIBPaletteQuads[k];
838}
839
840/* Function start: 0x433060 */
841void DIBwholePaletteFromTriplets(unsigned char *palette)
842{
843 unsigned char entries[0x400];
844 int offset = 0;
845 int error;
846
847 IDirectDraw2_WaitForVerticalBlank(
848 pDirectDraw2, DDWAITVB_BLOCKBEGIN, 0);
849 do {
850 unsigned char value = palette[0];
851
852 palette = palette + 3;
853 abDIBPaletteQuads[offset + 2] = value;
854 entries[offset] = value;
855 value = palette[-2];
856 abDIBPaletteQuads[offset + 1] = value;
857 entries[offset + 1] = value;
858 value = palette[-1];
859 abDIBPaletteQuads[offset] = value;
860 entries[offset + 2] = value;
861 entries[offset + 3] = 0;
862 abDIBPaletteQuads[offset + 3] = 4;
863 offset = offset + 4;
864 } while (offset < 0x400);
865
866 error = IDirectDrawPalette_SetEntries(
867 pDirectDrawPalette, 0, 0, 0x100,
868 (LPPALETTEENTRY)entries);
869 if (error != 0)
870 DIBerror("DIBsetWholePalette SetEntries", error);
871
872 error = IDirectDrawSurface_SetPalette(
874 if (error != 0)
875 DIBerror("DIBmakeDIB CreatePalette", error);
876}
877
878/* Function start: 0x433120 */
879void DIBwholePaletteFromWords(short *palette)
880{
881 unsigned char entries[0x400];
882 int offset = 0;
883 int error;
884
885 IDirectDraw2_WaitForVerticalBlank(
886 pDirectDraw2, DDWAITVB_BLOCKBEGIN, 0);
887 do {
888 unsigned char value = (unsigned char)palette[0];
889
890 palette = palette + 3;
891 abDIBPaletteQuads[offset + 2] = value;
892 entries[offset] = value;
893 value = (unsigned char)palette[-2];
894 abDIBPaletteQuads[offset + 1] = value;
895 entries[offset + 1] = value;
896 value = (unsigned char)palette[-1];
897 abDIBPaletteQuads[offset] = value;
898 entries[offset + 2] = value;
899 entries[offset + 3] = 0;
900 abDIBPaletteQuads[offset + 3] = 4;
901 offset = offset + 4;
902 } while (offset < 0x400);
903
904 error = IDirectDrawPalette_SetEntries(
905 pDirectDrawPalette, 0, 0, 0x100,
906 (LPPALETTEENTRY)entries);
907 if (error != 0)
908 DIBerror("DIBsetWholePalette SetEntries", error);
909
910 error = IDirectDrawSurface_SetPalette(
912 if (error != 0)
913 DIBerror("DIBmakeDIB CreatePalette", error);
914}
915
916/* Function start: 0x4331E0 */
918{
919 IDirectDraw2_WaitForVerticalBlank(
920 pDirectDraw2, DDWAITVB_BLOCKBEGIN, 0);
921}
922
923/* Function start: 0x4331F0 */
924char *DirectDrawResultToText(int result)
925{
926 switch (result) {
927 case DDERR_ALREADYINITIALIZED:
928 return "DDERR_ALREADYINITIALIZED";
929 case DDERR_CANNOTATTACHSURFACE:
930 return "DDERR_CANNOTATTACHSURFACE";
931 case DDERR_CANNOTDETACHSURFACE:
932 return "DDERR_CANNOTDETACHSURFACE";
933 case DDERR_CURRENTLYNOTAVAIL:
934 return "DDERR_CURRENTLYNOTAVAIL";
935 case DDERR_EXCEPTION:
936 return "DDERR_EXCEPTION";
937 case DDERR_GENERIC:
938 return "DDERR_GENERIC";
939 case DDERR_HEIGHTALIGN:
940 return "DDERR_HEIGHTALIGN";
941 case DDERR_INCOMPATIBLEPRIMARY:
942 return "DDERR_INCOMPATIBLEPRIMARY";
943 case DDERR_INVALIDCAPS:
944 return "DDERR_INVALIDCAPS";
945 case DDERR_INVALIDCLIPLIST:
946 return "DDERR_INVALIDCLIPLIST";
947 case DDERR_INVALIDMODE:
948 return "DDERR_INVALIDMODE";
949 case DDERR_INVALIDOBJECT:
950 return "DDERR_INVALIDOBJECT";
951 case DDERR_INVALIDPARAMS:
952 return "DDERR_INVALIDPARAMS";
953 case DDERR_INVALIDPIXELFORMAT:
954 return "DDERR_INVALIDPIXELFORMAT";
955 case DDERR_INVALIDRECT:
956 return "DDERR_INVALIDRECT";
957 case DDERR_LOCKEDSURFACES:
958 return "DDERR_LOCKEDSURFACES";
959 case DDERR_NO3D:
960 return "DDERR_NO3D";
961 case DDERR_NOALPHAHW:
962 return "DDERR_NOALPHAHW";
963 case DDERR_NOCLIPLIST:
964 return "DDERR_NOCLIPLIST";
965 case DDERR_NOCOLORCONVHW:
966 return "DDERR_NOCOLORCONVHW";
967 case DDERR_NOCOOPERATIVELEVELSET:
968 return "DDERR_NOCOOPERATIVELEVELSET";
969 case DDERR_NOCOLORKEY:
970 return "DDERR_NOCOLORKEY";
971 case DDERR_NOCOLORKEYHW:
972 return "DDERR_NOCOLORKEYHW";
973 case DDERR_NODIRECTDRAWSUPPORT:
974 return "DDERR_NODIRECTDRAWSUPPORT";
975 case DDERR_NOEXCLUSIVEMODE:
976 return "DDERR_NOEXCLUSIVEMODE";
977 case DDERR_NOFLIPHW:
978 return "DDERR_NOFLIPHW";
979 case DDERR_NOGDI:
980 return "DDERR_NOGDI";
981 case DDERR_NOMIRRORHW:
982 return "DDERR_NOMIRRORHW";
983 case DDERR_NOTFOUND:
984 return "DDERR_NOTFOUND";
985 case DDERR_NOOVERLAYHW:
986 return "DDERR_NOOVERLAYHW";
987 case DDERR_NORASTEROPHW:
988 return "DDERR_NORASTEROPHW";
989 case DDERR_NOROTATIONHW:
990 return "DDERR_NOROTATIONHW";
991 case DDERR_NOSTRETCHHW:
992 return "DDERR_NOSTRETCHHW";
993 case DDERR_NOT4BITCOLOR:
994 return "DDERR_NOT4BITCOLOR";
995 case DDERR_NOT4BITCOLORINDEX:
996 return "DDERR_NOT4BITCOLORINDEX";
997 case DDERR_NOT8BITCOLOR:
998 return "DDERR_NOT8BITCOLOR";
999 case DDERR_NOTEXTUREHW:
1000 return "DDERR_NOTEXTUREHW";
1001 case DDERR_NOVSYNCHW:
1002 return "DDERR_NOVSYNCHW";
1003 case DDERR_NOZBUFFERHW:
1004 return "DDERR_NOZBUFFERHW";
1005 case DDERR_NOZOVERLAYHW:
1006 return "DDERR_NOZOVERLAYHW";
1007 case DDERR_OUTOFCAPS:
1008 return "DDERR_OUTOFCAPS";
1009 case DDERR_OUTOFMEMORY:
1010 return "DDERR_OUTOFMEMORY";
1011 case DDERR_OUTOFVIDEOMEMORY:
1012 return "DDERR_OUTOFVIDEOMEMORY";
1013 case DDERR_OVERLAYCANTCLIP:
1014 return "DDERR_OVERLAYCANTCLIP";
1015 case DDERR_OVERLAYCOLORKEYONLYONEACTIVE:
1016 return "DDERR_OVERLAYCOLORKEYONLYONEACTIVE";
1017 case DDERR_PALETTEBUSY:
1018 return "DDERR_PALETTEBUSY";
1019 case DDERR_COLORKEYNOTSET:
1020 return "DDERR_COLORKEYNOTSET";
1021 case DDERR_SURFACEALREADYATTACHED:
1022 return "DDERR_SURFACEALREADYATTACHED";
1023 case DDERR_SURFACEALREADYDEPENDENT:
1024 return "DDERR_SURFACEALREADYDEPENDENT";
1025 case DDERR_SURFACEBUSY:
1026 return "DDERR_SURFACEBUSY";
1027 case DDERR_CANTLOCKSURFACE:
1028 return "DDERR_CANTLOCKSURFACE";
1029 case DDERR_SURFACEISOBSCURED:
1030 return "DDERR_SURFACEISOBSCURED";
1031 case DDERR_SURFACELOST:
1032 return "DDERR_SURFACELOST";
1033 case DDERR_SURFACENOTATTACHED:
1034 return "DDERR_SURFACENOTATTACHED";
1035 case DDERR_TOOBIGHEIGHT:
1036 return "DDERR_TOOBIGHEIGHT";
1037 case DDERR_TOOBIGSIZE:
1038 return "DDERR_TOOBIGSIZE";
1039 case DDERR_TOOBIGWIDTH:
1040 return "DDERR_TOOBIGWIDTH";
1041 case DDERR_UNSUPPORTED:
1042 return "DDERR_UNSUPPORTED";
1043 case DDERR_UNSUPPORTEDFORMAT:
1044 return "DDERR_UNSUPPORTEDFORMAT";
1045 case DDERR_UNSUPPORTEDMASK:
1046 return "DDERR_UNSUPPORTEDMASK";
1047 case DDERR_VERTICALBLANKINPROGRESS:
1048 return "DDERR_VERTICALBLANKINPROGRESS";
1049 case DDERR_WASSTILLDRAWING:
1050 return "DDERR_WASSTILLDRAWING";
1051 case DDERR_XALIGN:
1052 return "DDERR_XALIGN";
1053 case DDERR_INVALIDDIRECTDRAWGUID:
1054 return "DDERR_INVALIDDIRECTDRAWGUID";
1055 case DDERR_DIRECTDRAWALREADYCREATED:
1056 return "DDERR_DIRECTDRAWALREADYCREATED";
1057 case DDERR_NODIRECTDRAWHW:
1058 return "DDERR_NODIRECTDRAWHW";
1059 case DDERR_PRIMARYSURFACEALREADYEXISTS:
1060 return "DDERR_PRIMARYSURFACEALREADYEXISTS";
1061 case DDERR_NOEMULATION:
1062 return "DDERR_NOEMULATION";
1063 case DDERR_REGIONTOOSMALL:
1064 return "DDERR_REGIONTOOSMALL";
1065 case DDERR_CLIPPERISUSINGHWND:
1066 return "DDERR_CLIPPERISUSINGHWND";
1067 case DDERR_NOCLIPPERATTACHED:
1068 return "DDERR_NOCLIPPERATTACHED";
1069 case DDERR_NOHWND:
1070 return "DDERR_NOHWND";
1071 case DDERR_HWNDSUBCLASSED:
1072 return "DDERR_HWNDSUBCLASSED";
1073 case DDERR_HWNDALREADYSET:
1074 return "DDERR_HWNDALREADYSET";
1075 case DDERR_NOPALETTEATTACHED:
1076 return "DDERR_NOPALETTEATTACHED";
1077 case DDERR_NOPALETTEHW:
1078 return "DDERR_NOPALETTEHW";
1079 case DDERR_BLTFASTCANTCLIP:
1080 return "DDERR_BLTFASTCANTCLIP";
1081 case DDERR_NOBLTHW:
1082 return "DDERR_NOBLTHW";
1083 case DDERR_NODDROPSHW:
1084 return "DDERR_NODDROPSHW";
1085 case DDERR_OVERLAYNOTVISIBLE:
1086 return "DDERR_OVERLAYNOTVISIBLE";
1087 case DDERR_NOOVERLAYDEST:
1088 return "DDERR_NOOVERLAYDEST";
1089 case DDERR_INVALIDPOSITION:
1090 return "DDERR_INVALIDPOSITION";
1091 case DDERR_NOTAOVERLAYSURFACE:
1092 return "DDERR_NOTAOVERLAYSURFACE";
1093 case DDERR_EXCLUSIVEMODEALREADYSET:
1094 return "DDERR_EXCLUSIVEMODEALREADYSET";
1095 case DDERR_NOTFLIPPABLE:
1096 return "DDERR_NOTFLIPPABLE";
1097 case DDERR_CANTDUPLICATE:
1098 return "DDERR_CANTDUPLICATE";
1099 case DDERR_NOTLOCKED:
1100 return "DDERR_NOTLOCKED";
1101 case DDERR_CANTCREATEDC:
1102 return "DDERR_CANTCREATEDC";
1103 case DDERR_NODC:
1104 return "DDERR_NODC";
1105 case DDERR_WRONGMODE:
1106 return "DDERR_WRONGMODE";
1107 case DDERR_IMPLICITLYCREATED:
1108 return "DDERR_IMPLICITLYCREATED";
1109 case DDERR_NOTPALETTIZED:
1110 return "DDERR_NOTPALETTIZED";
1111 case DDERR_UNSUPPORTEDMODE:
1112 return "DDERR_UNSUPPORTEDMODE";
1113 case DDERR_NOMIPMAPHW:
1114 return "DDERR_NOMIPMAPHW";
1115 case DDERR_INVALIDSURFACETYPE:
1116 return "DDERR_INVALIDSURFACETYPE";
1117 case DDERR_DCALREADYCREATED:
1118 return "DDERR_DCALREADYCREATED";
1119 case DDERR_CANTPAGELOCK:
1120 return "DDERR_CANTPAGELOCK";
1121 case DDERR_CANTPAGEUNLOCK:
1122 return "DDERR_CANTPAGEUNLOCK";
1123 case DDERR_NOTPAGELOCKED:
1124 return "DDERR_NOTPAGELOCKED";
1125 }
1126 return "<undefined>";
1127}
1128
static unsigned char abDIBPixelBackup[0xfa00]
Definition dib.c:78
static unsigned int DAT_00476640
Definition dib.c:76
void DIBpixelBufferHook(void)
Definition dib.c:735
static int DAT_0046b1d4
Definition dib.c:29
static HWND hDIBParentWindow
Definition dib.c:87
static int nUnusedDIBValue
Definition dib.c:82
const GUID IID_IDirectDrawSurface2
Definition dib.c:53
static unsigned char * pDIBImage
Definition dib.c:74
static int nFrameDeadlineMs
Definition dib.c:21
static unsigned int nDIBFrameHeight
Definition dib.c:72
static LPDIRECTDRAWSURFACE pPrimarySurface
Definition dib.c:16
static char szDIBFailureString[0x98]
Definition dib.c:85
const GUID IID_IDirectDrawPalette
Definition dib.c:57
static unsigned int nDIBFrameWidth
Definition dib.c:73
static unsigned char abDIBPaletteQuads[1024]
Definition dib.c:88
static unsigned int DAT_00476644
Definition dib.c:77
static LPDIRECTDRAW2 pDirectDraw2
Definition dib.c:15
static int DAT_00486058
Definition dib.c:79
const GUID IID_IDirectDrawClipper
Definition dib.c:61
static unsigned char szFrameRateLabel[32]
Definition dib.c:75
static int bPendingDIBSlam
Definition dib.c:91
static int nUnusedDIBLevel
Definition dib.c:90
static int nDIBCascadeLevel
Definition dib.c:19
static float fSampledFps
Definition dib.c:89
unsigned int GetDIBWidth(void)
Definition dib.c:747
static unsigned char abUnusedDIBRect[8]
Definition dib.c:92
static int nPreviousFrameTimeMs
Definition dib.c:24
const GUID IID_IDirectDraw
Definition dib.c:41
static LPDIRECTDRAWPALETTE pDirectDrawPalette
Definition dib.c:18
static int bSpaceFlightFrameTiming
Definition dib.c:25
static char szSpaceFlightFpsCapMessage[0x80]
Definition dib.c:93
const GUID CLSID_DirectDraw
Definition dib.c:33
static LPDIRECTDRAWSURFACE pSecondarySurface
Definition dib.c:17
const GUID CLSID_DirectDrawClipper
Definition dib.c:37
static unsigned char abUnusedDIBArea[12]
Definition dib.c:83
const GUID IID_IDirectDrawSurface
Definition dib.c:49
static int DAT_0046b1c0
Definition dib.c:23
static int nDIBSlamTotal
Definition dib.c:81
static float fCinematicFrameRate
Definition dib.c:27
static int nUnusedDIBData
Definition dib.c:80
unsigned int GetDIBHeight(void)
Definition dib.c:754
static float fSpaceFlightFrameRate
Definition dib.c:26
short asObjScreenScalesArray[SPACE_OBJECT_COUNT]
Definition dib.c:105
signed char acViableTargetList[16]
Definition dib.c:102
signed char aShipWeaponsTable[10][0x47]
Definition dib.c:108
int nFrameIntervalMs
Definition dib.c:20
const GUID guidDirectDraw2
Definition dib.c:45
short asObjAfterburnerVelocities[SPACE_OBJECT_COUNT]
Definition dib.c:106
int bShowFrameRate
Definition winmain.c:36
MouseCursorState stMouseCursorState
Definition strdos.c:19
int bDirectDrawModeCascadeEnabled
Definition winmain.c:37
short nEyeRollTargetValue
Definition dib.c:98
Viewport stScreenView
Definition launch.c:50
short awPaletteRgbWordsList[0x300]
Definition winmain.c:58
CampaignState stCampaignState
Definition dib.c:107
short nEyeYawGoalValue
Definition dib.c:104
short asObjectFlipArray[SPACE_OBJECT_COUNT]
Definition dib.c:97
signed char acPreviousAttackers[16]
Definition dib.c:101
short nCurrentHazardFieldTotal
Definition dib.c:100
signed char cCurrentNavPtIdx
Definition dib.c:96
short asActionCounts[10]
Definition dib.c:103
FixedVector vPreviousStarFieldMotion
Definition dib.c:99
Viewport * viewport
Definition wc1base.h:110
unsigned char * pixels
Definition wc1base.h:74
unsigned char * allocation
Definition wc1base.h:80
Umbrella header for the game core.
#define COM_RELEASE(surface)
Definition wc1base.h:34
void RefreshMouseCursorDisplay(void)
Definition eventmgr.c:525
void DIBslam(void)
Definition dib.c:513
void DIBwholePaletteFromWords(short *palette)
Definition dib.c:879
HWND GetDIBWindowHandle(void)
Definition dib.c:740
void RestoreMouseCursorBackground(void)
Definition eventmgr.c:494
void SetSpaceFlightFrameTiming(void)
Definition dib.c:173
void DIBramPalette(void)
Definition dib.c:772
void DIBunInstall(void)
Definition dib.c:412
void ReportSpaceFlightMaxFps(float adjustment)
Definition dib.c:153
void ThrottleFrameAndDrawFps(HDC dc)
Definition dib.c:114
void DIBslamReal(void)
Definition dib.c:519
void DIBinstall(HWND window)
Definition dib.c:241
void DIBreInstall(void)
Definition dib.c:224
void DIBpositionWindow(void)
Definition dib.c:213
char * DirectDrawResultToText(int result)
Definition dib.c:924
void DrawMouseCursor(void)
Definition eventmgr.c:465
void DIBmakeDIB(void)
Definition dib.c:422
void DIBsetPalette(short index, short *rgb)
Definition dib.c:794
int DIBcascade(int mode, int *reportedResult)
Definition dib.c:286
void CaptureMouseCursorBackground(void)
Definition eventmgr.c:432
void ServiceSoundSystem(void)
Definition sound.c:334
unsigned char * GetDIBPixelBuffer(void)
Definition dib.c:727
void DIBdestroyDIB(void)
Definition dib.c:487
void UpdateStreamerStoppedFlag(void)
Definition gr.c:1341
void CachePaletteEntryFromWords(short index, short *rgb)
Definition dib.c:760
void DIBwholePaletteFromTriplets(unsigned char *palette)
Definition dib.c:841
void SetHudMessageText(char *text, unsigned short colour, unsigned short duration)
Definition cockpt.c:2218
void GetPaletteEntryAsWords(short i, short *rgb)
Definition dib.c:831
void DIBupdate(int left, int top, int right, int bottom)
Definition dib.c:665
void DIBwaitForVerticalBlank(void)
Definition dib.c:917
void DIBerror(const char *tag, int hr)
Definition dib.c:191
void SetCinematicFrameTiming(void)
Definition dib.c:182
#define SPACE_OBJECT_COUNT
Definition wcdata.h:1004