Wing Commander
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
view.c
Go to the documentation of this file.
1/**
2 * @file
3 * @ingroup graphics
4 * @brief Scripted views, constellation effects and cockpit target rendering.
5 *
6 * Address range 42cdb0-42e31f. The packet and viewport helpers stay in this
7 * contiguous unit provisionally.
8 */
9#include "wc1.h"
10#include <sys/stat.h>
11#include <sys/utime.h>
12
13short nScriptedViewObject = -1; /* 0x0046a8d0 */
14int bScriptedView = 0; /* 0x0046a8d4 */
15static short asConstellationVelocity[16] = { /* 0x0046a8d8 */
16 8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1
17};
18static short asConstellationFrame[16] = { /* 0x0046a8f8 */
19 0, 16, 16, 0, 4, 4, 20, 20, 24, 8, 8, 24, 28, 12, 12, 28
20};
21static short nConstellationDirection = -1; /* 0x0046a918 */
22
23
24/* Linker commons defined here; LINK orders them by identifier hash. */
25const char *pszCommMenuHeading; /* 0x0059e490 */
26char szCommMenuHeadingBuf[0x40]; /* 0x0059e4a0 */
27const char *apszCommMenuChoiceTextTable[7]; /* 0x0059e4e0 */
28int anInputButton2PressTime[2]; /* 0x0059e500 */
29short asInputButton1DoubleClicksList[2]; /* 0x0059e508 */
30short asInputBtn1ChangedTable[2]; /* 0x0059e50c */
31short asInputButton2ChangedTable[2]; /* 0x0059e510 */
32short asPreviousInputButtons[2]; /* 0x0059e514 */
33int anInputButton1PressTimes[2]; /* 0x0059e518 */
34
35/* Function start: 0x42CDB0 */
36unsigned int parse_view_script(void)
37{
38 FixedVector vector;
39 short obj;
40 short missionIndex;
41
42 if (*pCurrentViewScriptPtr == 13)
43 goto done;
44 for (;;) {
45 if (*pCurrentViewScriptPtr == -1) {
46 bScriptedView = 0;
48 return 0;
49 }
50 if (*pCurrentViewScriptPtr == 14)
51 break;
52 switch (*pCurrentViewScriptPtr++) {
53 case 0:
55 (int)*pCurrentViewScriptPtr++ << 8;
57 (int)*pCurrentViewScriptPtr++ << 8;
59 (int)*pCurrentViewScriptPtr++ << 8;
60 break;
61 case 1:
65 break;
66 case 2:
68 (int)*pCurrentViewScriptPtr++ << 8,
69 &aShipVelocity[61]);
70 break;
71 case 3:
74 break;
75 case 4:
77 (short)-*pCurrentViewScriptPtr++;
79 break;
80 case 5:
83 break;
84 case 6:
87 break;
88 case 7:
90 (short)-*pCurrentViewScriptPtr++;
92 break;
93 case 8:
96 break;
97 case 9:
98 copy_frame(61, 63);
103 (int)*pCurrentViewScriptPtr++ << 8,
104 &vector);
105 AddFixedVectors(&aShipVelocity[61], &vector,
106 &aShipVelocity[61]);
107 break;
108 case 10:
109 aShipVelocity[61] =
111 break;
112 case 11:
114 break;
115 case 12:
118 break;
119 case 15:
122 &vector);
123 aShipFwdVec[61] = vector;
124 fix_objects_ijk(61);
125 break;
126 case 16:
127 obj = 0;
128 missionIndex = *pCurrentViewScriptPtr;
129 while (obj < 10) {
130 if (nShipMissionIndices[obj] == missionIndex) {
132 break;
133 }
134 obj++;
135 }
137 break;
138 }
139 if (*pCurrentViewScriptPtr == 13)
140 return 0;
141 }
143done:
144 return 0;
145}
146
147/* Function start: 0x42D1C0 */
148unsigned int update_scripted_view(void)
149{
150 short counter;
151 int command;
152
153 command = *pCurrentViewScriptPtr;
154 switch (command) {
155 case 13:
160 }
161 break;
162 case 14:
163 counter = asObjectCounterArray[61];
165 if (counter < 1) {
168 }
169 break;
170 }
171 return 0;
172}
173
174/* Function start: 0x42D230 */
175void initialize_scripted_view(const short *script)
176{
177 bScriptedView = 1;
179 init_ijk(61);
180 pCurrentViewScriptPtr = script;
182 asObjectCollisionRadius[61] = 100;
183}
184
185/* Function start: 0x42D270 */
186unsigned int InitializeFireworks(void)
187{
188 short i = 0;
189
190 do {
191 aFireworksList[i].frame = -1;
192 i = i + 1;
193 } while (i < 0x1e);
194 return 0;
195}
196
197/* Function start: 0x42D2A0 */
198short TheEndFireWorks(Viewport *viewport, short count)
199{
200 short index;
201 short emptyCount;
202
203 emptyCount = 0;
204 index = count;
205 while (--index >= 0) {
206 if (aFireworksList[index].frame == -1) {
207 emptyCount++;
208 } else {
210 viewport, aFireworksList[index].x,
211 aFireworksList[index].y,
213 (short)(aFireworksList[index].frame +
214 aFireworksList[index].variant * 8));
215 if (aFireworksList[index].frame++ == 7) {
216 aFireworksList[index].frame = -1;
218 aFireworksList[index].soundHandle, index);
219 } else if (aFireworksList[index].frame == 1) {
221 ((unsigned int (__cdecl *)(
222 const unsigned char *, int, int, short, short,
223 int))SoundFxTick)(
225 0, 127,
226 (signed char)(
227 127 -
228 (int)aFireworksList[index].x *
229 127 / 319),
230 index, 1);
231 }
232 }
233 }
234 return emptyCount;
235}
236
237/* Function start: 0x42D390 */
239 short direction,
240 short density)
241{
242 short viewportHeight;
243 unsigned short starHeight;
244 short index;
245 short randomIndex;
246 short width;
247 int population;
248
249 pConstellationViewportPtr = viewport;
250 nConstellationDirection = direction;
251 width = (short)(viewport->right - viewport->left);
252 viewportHeight = (short)(viewport->bottom - viewport->top);
253 population = density;
254 nViewConstellationStarCount = (short)(population * 10 / 16);
255 population *= 16;
256 nConstellationParticleTotal = (short)(population / 16);
257 index = 0;
258 if (index < nViewConstellationStarCount) {
259 starHeight = viewportHeight;
260 do {
262 RandomInRange(0, width);
264 RandomInRange(0, starHeight);
266 (short)(RandomInRange(0, 5) + 32);
267 index++;
268 } while (index < nViewConstellationStarCount);
269 }
270 for (index = 0; index < nConstellationParticleTotal; index++) {
271 randomIndex = RandomInRange(0, 15);
274 RandomInRange(0, width));
277 RandomInRange(0, viewportHeight));
279 (short)(asConstellationVelocity[randomIndex] *
282 (short)(asConstellationFrame[randomIndex] +
283 RandomInRange(0, 3));
284 }
285 return 0;
286}
287
288/* Function start: 0x42D500 */
289unsigned int DrawConstellationField(void)
290{
291 short height;
292 short index;
293 short randomIndex;
294 short speed;
295
296 height = (short)(pConstellationViewportPtr->bottom -
299 for (index = 0;
301 index++) {
306 aConstellationStarsTable[index].frame);
307 }
308 for (index = 0;
310 index++) {
315 aConstellationParticlesList[index].frame);
316 aConstellationParticlesList[index].x = (short)(
318 aConstellationParticlesList[index].velocity);
319 aConstellationParticlesList[index].frame = (short)(
320 (aConstellationParticlesList[index].frame & 0xfc) +
321 (aConstellationParticlesList[index].frame + 1) % 4);
322 if (nConstellationDirection < 0) {
323 if (aConstellationParticlesList[index].x <
325 randomIndex = RandomInRange(0, 15);
326 speed = asConstellationVelocity[randomIndex];
327 aConstellationParticlesList[index].x = (short)(
329 RandomInRange(0, speed));
330 aConstellationParticlesList[index].y = (short)(
332 RandomInRange(0, height));
333 aConstellationParticlesList[index].velocity = (short)-speed;
335 (short)(asConstellationFrame[randomIndex] +
336 RandomInRange(0, 3));
337 }
338 } else {
339 if (aConstellationParticlesList[index].x >
341 randomIndex = RandomInRange(0, 15);
343 asConstellationVelocity[randomIndex];
344 aConstellationParticlesList[index].x = (short)(
346 RandomInRange(0, speed));
347 aConstellationParticlesList[index].y = (short)(
349 RandomInRange(0, height));
351 (short)(asConstellationFrame[randomIndex] +
352 RandomInRange(0, 3));
353 }
354 }
355 }
356 return 0;
357}
358
359static unsigned char *pPacketDecompressionWorkspace = 0; /* 0x0046a91c */
360static unsigned short wPacketDecompressionInputSizeOverride = 0; /* 0x0046a920 */
361static unsigned short wPacketCompressionFormatFlags = 0; /* 0x0046a924 */
362/* 0x0046a928 */
364 { 12, -20, 29, 20 },
365 { -11, 1, 11, 20 },
366 { -11, -20, 11, 0 },
367 { -29, -20, -12, 20 }
368};
369
370/* Function start: 0x42D730 */
371short __stdcall OpenPacketSection(const char *filename, short section,
372 PacketSectionHandle *handle)
373{
374 unsigned int sectionEntry;
375 unsigned int sectionEnd;
376 int sectionIndex;
377 int directoryOffset;
378 unsigned int directorySize;
379 short compression;
380 short sectionCount;
381 short file;
382
383 {
384 unsigned int fileSize;
385
386 file = OpenDataFileOrDie(filename);
387 if (file == -1)
388 goto failed;
389 if (ReadDataFileAtOffset(file, 0, 4, &fileSize) == 0)
390 goto failed;
391 if (ReadDataFileAtOffset(file, 4, 4, &directorySize) == 0)
392 goto failed;
393 sectionCount = (short)(directorySize >> 2) - 1;
394 if (section >= sectionCount) {
395 nPacketError = 3;
396 goto failed;
397 }
398 sectionIndex = (int)section;
399 directoryOffset = sectionIndex * 4 + 4;
400 if (ReadDataFileAtOffset(file, directoryOffset, 4,
401 &sectionEntry) == 0)
402 goto failed;
403 compression = (short)(sectionEntry >> 24) & 0xff;
404 handle->finalSection = 0;
405 sectionEntry &= 0x00ffffff;
406 if (sectionCount - sectionIndex == 1) {
407 handle->finalSection = 1;
408 sectionEnd = fileSize;
409 } else {
410 directoryOffset += 4;
411 if (ReadDataFileAtOffset(file, directoryOffset, 4,
412 &sectionEnd) == 0)
413 goto failed;
414 /* Discard the next directory entry's compression byte. */
415 ((unsigned char *)&sectionEnd)[3] = 0;
416 }
417 }
418 {
419 unsigned int sectionSize;
420
421 sectionSize = sectionEnd - sectionEntry;
422 if (SeekDataFile(file, sectionEntry, 0) != 0) {
423 handle->file = file;
424 handle->sectionCount = sectionCount;
425 handle->compression = compression;
426 handle->dataOffset = sectionEntry;
427 handle->position = 0;
428 handle->dataSize = *(volatile unsigned int *)&sectionSize;
429 return 1;
430 }
431 }
432failed:
433 CloseDataFile((unsigned short)file);
434 return 0;
435}
436
437/* Function start: 0x42D870 */
439{
440 CloseDataFile(handle->file);
441}
442
443/* Function start: 0x42D880 */
444void * __stdcall DecompressPacketSection(
445 PacketSectionHandle *handle, void *destination, unsigned short flags,
446 void *decompressionWorkspace)
447{
448 unsigned int allocationSize;
449 void *packet;
450 void *workspace;
451 void *largeScratch;
452 void *smallScratch;
453 unsigned char fallbackAllocations;
454
455 fallbackAllocations = 0;
456 packet = 0;
459 if ((handle->compression & 0xc0) != 0) {
460 nPacketError = 6;
461 return 0;
462 }
463 } else if (handle->compression != 1) {
464 nPacketError = 6;
465 return 0;
466 }
467
468 if (decompressionWorkspace == 0 &&
471 decompressionWorkspace = pPacketDecompressionWorkspace;
472 }
473 if (decompressionWorkspace == 0) {
474 largeScratch = AllocateTaggedMemory(0x3020, 0);
475 smallScratch = AllocateTaggedMemory(0x410, 0);
476 if (largeScratch == 0 || smallScratch == 0) {
477 if (largeScratch != 0)
478 ReleasePacketHandle(largeScratch);
479 if (smallScratch != 0)
480 ReleasePacketHandle(smallScratch);
481 fallbackAllocations = 1;
482 largeScratch = AllocateTaggedMemory(0x3000, 0x22);
483 if (largeScratch == 0) {
484 nPacketError = 1;
485 return 0;
486 }
487 smallScratch = AllocateTaggedMemory(0x400, 0x22);
488 if (smallScratch == 0) {
489 ReleasePacketHandle(largeScratch);
490 nPacketError = 2;
491 return 0;
492 }
493 }
494 workspace = IdentityHandle(largeScratch);
495 pPktDecompInput = IdentityHandle(smallScratch);
497 } else {
498 workspace = IdentityHandle(decompressionWorkspace);
500 allocationSize = 0x3020;
502 ((PacketDecompressionWorkspace *)decompressionWorkspace)->input;
508 }
513 (short)(unsigned int)workspace;
514 if (workspace != 0)
516
517 if (SeekPacketSection(handle, 0, 0) == -1) {
518 nPacketError = 5;
519 return 0;
520 }
521 if (destination == 0) {
522 if (ReadPacketSectionData(handle, (void *)&allocationSize, 4) != 0) {
524 allocationSize, flags);
525 if (pLastPacketAllocation == 0)
526 nPacketError = 4;
527 }
528 } else {
529 if (SeekPacketSection(handle, 4, 0) == -1) {
530 nPacketError = 5;
531 return 0;
532 }
533 pLastPacketAllocation = destination;
534 }
535
536 if (nPacketError == 0) {
537 packet = pLastPacketAllocation;
539 handle, pPktDecompInput,
541 packet = 0;
543 if (packet != 0)
545 }
546 if (decompressionWorkspace == 0) {
547 /* DOS near and far frees both map to ReleasePacketHandle in Win32. */
548 if (fallbackAllocations != 0) {
549 ReleasePacketHandle(smallScratch);
550 ReleasePacketHandle(largeScratch);
551 } else {
552 ReleasePacketHandle(smallScratch);
553 ReleasePacketHandle(largeScratch);
554 }
555 }
556 return packet;
557}
558
559/* Function start: 0x42DB70 */
561{
562 short v = nVideoMode;
563
564 if (nVideoMode == -1)
565 v = 0x13;
566 return v;
567}
568
569/* Formatted VDU text callee of the target display below. */
570void DrawFormattedText(const char *format, ...);
571
572/* Function start: 0x42DB90 */
574{
575 short target;
576 ObjectTypeData *typeData;
577 enum ObjectType objectType;
578 signed char rating;
579 short x;
580 short y;
581 short frame;
582 short *maximumArmor;
583 short armor;
584 Viewport targetViewport;
585
588 "", 2);
589 if (nTargetLockMode != 0) {
590 DrawFormattedText("%F%s%F",
591 (unsigned int)cRedColour,
592 " LOCKED TARGET",
593 (unsigned int)cDefaultTextColour);
594 } else {
595 DrawFormattedText("%F%s",
596 (unsigned int)cDefaultTextColour,
597 " AUTO TARGETTING");
598 }
599 target = acShipTargetTable[0];
600 if (target != -1 &&
601 (aeObjectClass[target] < OBJECT_CLASS_SHIP ||
602 aeSpecialManeuvers[target] ==
604 target = -1;
605 acShipTargetTable[0] = -1;
606 }
607 cTargetDisplayObject = (signed char)target;
608 DrawFormattedText("\nTarget:");
609 if (target == -1) {
610 DrawFormattedText(" None");
611 return;
612 }
613 objectType = aeObjectTypeList[target];
614 typeData = &aObjectTypeData[objectType];
615 rating = acShipRating[target];
616 if (rating >= 0 && rating <= 7) {
618 " %s",
619 apWingmanPilotsList[rating]->callsign);
620 } else if (rating >= 9 && rating <= 12) {
622 " %s",
623 apszKilrathiAceNames[rating - 9]);
624 } else {
625 DrawFormattedText(" %s",
626 typeData->displayName);
627 }
628 DrawFormattedText("\nRange : ");
630 if (asObjectScreenXList[target] == (short)0x8001) {
632 return;
633 }
634
635 x = (short)(stRightVduViewport.left + 0x25);
636 y = (short)(stRightVduViewport.top + 0x26);
637 frame = (short)((aasShipShield[target][1] * 6) /
638 typeData->shieldAft);
639 frame = (short)((3 - MinShort(frame, 3)) * 2);
640 if (frame < 6)
643
644 targetViewport = stRightVduViewport;
645 maximumArmor = &typeData->armorFront;
646 for (armor = 0; armor < 4; armor++) {
647 targetViewport.left =
648 (short)(aTargetArmorClipRects[armor].left + x);
649 targetViewport.top =
650 (short)(aTargetArmorClipRects[armor].top + y);
651 targetViewport.right =
652 (short)(aTargetArmorClipRects[armor].right + x);
653 targetViewport.bottom =
654 (short)(aTargetArmorClipRects[armor].bottom + y);
655 if (aasShipArmor[target][armor] >
656 (short)(maximumArmor[armor] >> 1)) {
657 DrawSpriteDefault(&targetViewport, x, y,
658 typeData->shape, 0);
659 } else {
660 DrawSpriteDefault(&targetViewport, x, y,
661 typeData->shape, 1);
662 }
663 }
664
665 DrawSpriteDefault(&stRightVduViewport, x, y, typeData->shape, 2);
666 frame = (short)((aasShipShield[target][0] * 6) /
667 typeData->shieldFore);
668 frame = (short)((3 - MinShort(frame, 3)) * 2);
669 if (frame < 6)
672 (short)(frame + 1));
673}
674
675/* VDU mode callee of the range readout below. */
676void set_new_vdu(short vdu);
677
678/* Function start: 0x42DEA0 */
680{
681 short target;
682
683 target = acShipTargetTable[0];
684 if (
685 aeSpecialManeuvers[target] ==
687 acShipTargetTable[0] = -1;
689 return;
690 }
691 if (target != -1 &&
693 acShipTargetTable[0] = -1;
694 target = -1;
695 }
696 if (cTargetDisplayObject != target ||
697 (short)(nRenderedSpaceFrame % 8) == 0) {
698 set_new_vdu(1);
700 }
701 if (target == -1)
702 return;
703
704 if (asObjectScreenXList[target] != (short)0x8001) {
705 if (asObjDistancesTable[target] > 30000 ||
706 asObjDistancesTable[target] < 0)
707 strcpy(szTxtWorkspaceBuffer, "TOO FAR");
708 else
709 strcpy(szTxtWorkspaceBuffer + strlen(
710 itoa(asObjDistancesTable[target],
711 szTxtWorkspaceBuffer, 10)), " m");
712 } else {
713 strcpy(szTxtWorkspaceBuffer, "----- m");
714 }
716 if (nTargetLockCountdown == 0) {
717 if (bTargetLockAcquired == 1) {
719 return;
720 }
721 } else if (bTargetLockReadoutDirty != 0) {
724 (short)(stRightVduViewport.bottom - 6),
727 (short)cBlackColour);
729 }
730}
731
732/* Debug-console callee of the display-mode check below. */
733void SystemDebugPrintf(const char *format, ...);
734
735/* Function start: 0x42E020 */
736void LogDisplayMode(const char *mode)
737{
738 SystemDebugPrintf("display_mode == '%s'\n", mode);
741 exit(1);
742}
743
744/* Function start: 0x42E050 */
745short __stdcall CalcRectangleArea(const Viewport *viewport)
746{
747 short height;
748 short width;
749
750 if (nVideoMode != 0x13)
751 LogDisplayMode("not MCGA");
752 height = (short)(viewport->bottom - viewport->top + 1);
753 width = (short)(viewport->right - viewport->left + 1);
754 return (short)(height * width);
755}
756
757/* Function start: 0x42E090 */
758unsigned short __stdcall AllocateViewport(Viewport *viewport,
759 short clearColour, short flags)
760{
761 unsigned short top;
762 short left;
763 unsigned short width;
764 unsigned short height;
765 unsigned short row;
766 short offset;
767 int rowCount;
768
769 top = viewport->top;
770 height = viewport->bottom - top + 1;
771 width = viewport->right - viewport->left + 1;
772 left = viewport->left;
774 if (nVideoMode != 0x13)
775 LogDisplayMode("not MCGA");
777 (unsigned int)width * height, (unsigned short)(flags + 2));
779 nViewAllocTotal++] = viewport->allocation;
780 if (viewport->allocation == 0)
781 return 0;
782 viewport->pixels = viewport->allocation;
783
784 offset = 0;
786 (top + (unsigned int)height) * sizeof(unsigned short) + 4,
787 0);
788 if (viewport->rowOffsets == 0) {
789 if (nVideoMode != 0x13)
791 return 0;
792 }
793
794 rowCount = height + 2;
795 for (row = 0; (int)row < rowCount; row++) {
796 viewport->rowOffsets[top + row] = offset - left;
797 offset += width;
798 }
799 if (clearColour != -1)
800 ClearViewport(viewport, clearColour);
801 return 1;
802}
803
804/* Function start: 0x42E1D0 */
806 const ShortRect *rectangle, ShortPoint *position, short corner,
807 struct Shape *shape, short frame)
808{
809 ShortRect frameBounds;
810 short x;
811 short y;
812
813 switch (corner) {
814 case 0:
815 x = rectangle->left;
816 y = rectangle->top;
817 break;
818 case 1:
819 x = rectangle->right;
820 y = rectangle->top;
821 break;
822 case 2:
823 x = rectangle->left;
824 y = rectangle->bottom;
825 break;
826 case 3:
827 x = rectangle->right;
828 y = rectangle->bottom;
829 break;
830 }
831
832 GetShapeFrameBounds(&frameBounds.left, x, y, shape, frame);
833 position->x = x;
834 position->y = y;
835 switch (corner) {
836 case 0:
837 position->x = (short)(x * 2 - frameBounds.left);
838 position->y = (short)(y * 2 - frameBounds.top);
839 return;
840 case 1:
841 position->x = (short)(x * 2 - frameBounds.right);
842 position->y = (short)(y * 2 - frameBounds.top);
843 return;
844 case 2:
845 position->x = (short)(x * 2 - frameBounds.left);
846 position->y = (short)(y * 2 - frameBounds.bottom);
847 return;
848 case 3:
849 position->x = (short)(x * 2 - frameBounds.right);
850 position->y = (short)(y * 2 - frameBounds.bottom);
851 return;
852 }
853}
signed char acShipRating[16]
Definition joycal.c:25
short asPreviousInputButtons[2]
Definition view.c:32
int anInputButton1PressTimes[2]
Definition view.c:33
short nConstellationParticleTotal
Definition launch.c:44
unsigned char cRedColour
Definition init.c:16
TextContext stRightVduTxtContext
Definition targ.c:12
short asInputButton1DoubleClicksList[2]
Definition view.c:29
Viewport stRightVduViewport
Definition timer.c:14
short nRenderedSpaceFrame
Definition input.c:22
short nEyePitchRate
Definition game.c:16
ObjectTypeData aObjectTypeData[OBJECT_TYPE_COUNT]
Definition objdata.c:86
void * pLastPacketAllocation
Definition install.c:17
unsigned char cBlackColour
Definition init.c:12
short nVideoMode
Definition video.c:12
short nPacketError
Definition mono.c:15
char szTxtWorkspaceBuffer[256]
Definition screens.c:164
short nEyeRollRate
Definition game.c:22
int bTargetLockAcquired
Definition game.c:92
short nPacketDecompressPending
Definition mathfp.c:13
short nPktDecompressSourceFile
Definition eventmgr.c:28
const short * pCurrentViewScriptPtr
Definition launch.c:45
int anInputButton2PressTime[2]
Definition view.c:28
short nTargetLockCountdown
Definition game.c:79
ConstellationParticle aConstellationParticlesList[16]
Definition launch.c:42
enum ObjectClass aeObjectClass[SPACE_OBJECT_COUNT]
Definition video.c:21
struct Shape * pCurrentConstellationShape
Definition timer.c:20
unsigned char aabSoundEffectDescriptors[37][8]
Definition music.c:40
short nEyePitchTargetValue
Definition input.c:23
short aasShipArmor[10][4]
Definition comm.c:53
short nViewConstellationStarCount
Definition launch.c:41
int nViewAllocTotal
Definition gameflow.c:25
short nPacketDecompressInputPositionValue
Definition strdos.c:16
FixedVector aShipVelocity[SPACE_OBJECT_COUNT]
Definition smart.c:21
int bScriptedView
Definition view.c:14
short nCurrentPacketDecompressScratchSegment
Definition mathfp.c:15
char szCommMenuHeadingBuf[0x40]
Definition view.c:26
short asObjectCollisionRadius[64]
Definition ending.c:27
unsigned short wPacketDecompressInputSize
Definition mathfp.c:14
const char * apszKilrathiAceNames[4]
Definition comm.c:19
short aasShipShield[10][2]
Definition input.c:19
unsigned char cPrimaryViewBufferColour
Definition init.c:27
int nAllocateViewportCallsValue
Definition install.c:16
short nEyeRollTargetValue
Definition dib.c:98
unsigned char cDefaultTextColour
Definition init.c:24
struct Shape * pFireworkShape
Definition install.c:19
short nScriptedViewObject
Definition view.c:13
unsigned short asObjDistancesTable[SPACE_OBJECT_COUNT]
Definition data.c:253
PilotRecord * apWingmanPilotsList[8]
Definition gr.c:1533
short asObjectCounterArray[SPACE_OBJECT_COUNT]
Definition game.c:547
short bTargetLockReadoutDirty
Definition game.c:76
short asInputButton2ChangedTable[2]
Definition view.c:31
short asObjectScreenXList[SPACE_OBJECT_COUNT]
Definition screen.c:21
short nEyeYawGoalValue
Definition dib.c:104
int nPacketDecompressResult
Definition strdos.c:21
const char * pszCommMenuHeading
Definition view.c:25
enum ObjectType aeObjectTypeList[SPACE_OBJECT_COUNT]
Definition data.c:255
void * pPktDecompInput
Definition strdos.c:17
signed char cTargetDisplayObject
Definition game.c:85
unsigned char * apViewportAllocations[128]
Definition gameflow.c:26
FireworkState aFireworksList[30]
Definition install.c:18
Viewport * pConstellationViewportPtr
Definition launch.c:40
struct Shape * pCockpitIndicatorShape
Definition timer.c:19
short nShipMissionIndices[10]
Definition game.c:559
FixedVector aShipPositionsArray[SPACE_OBJECT_COUNT]
Definition game.c:556
FixedVector aShipFwdVec[64]
Definition smart.c:17
const char * apszCommMenuChoiceTextTable[7]
Definition view.c:27
signed char acShipTargetTable[16]
Definition joycal.c:30
short nEyeYawRate
Definition game.c:19
ConstellationStar aConstellationStarsTable[10]
Definition install.c:20
short nTargetLockMode
Definition game.c:95
enum SpecialManeuver aeSpecialManeuvers[12]
Definition game.c:549
short asInputBtn1ChangedTable[2]
Definition view.c:30
short frame
Definition wcdata.h:338
int soundHandle
Definition wcdata.h:342
short shieldFore
Definition wcdata.h:387
short shieldAft
Definition wcdata.h:388
struct Shape * shape
Definition wcdata.h:394
short armorFront
Definition wcdata.h:389
const char * displayName
Definition wcdata.h:369
unsigned int dataOffset
Definition wcdata.h:757
unsigned int dataSize
Definition wcdata.h:759
unsigned int position
Definition wcdata.h:758
short y
Definition wcdata.h:416
short x
Definition wcdata.h:415
short top
Definition wcdata.h:441
short left
Definition wcdata.h:440
short right
Definition wcdata.h:442
short bottom
Definition wcdata.h:443
unsigned char * pixels
Definition wc1base.h:74
short right
Definition wc1base.h:78
short bottom
Definition wc1base.h:79
unsigned char * allocation
Definition wc1base.h:80
unsigned short * rowOffsets
Definition wc1base.h:75
short left
Definition wc1base.h:76
short top
Definition wc1base.h:77
static ShortRect aTargetArmorClipRects[4]
Definition view.c:363
static short asConstellationVelocity[16]
Definition view.c:15
static short nConstellationDirection
Definition view.c:21
static unsigned short wPacketDecompressionInputSizeOverride
Definition view.c:360
static unsigned char * pPacketDecompressionWorkspace
Definition view.c:359
static unsigned short wPacketCompressionFormatFlags
Definition view.c:361
static short asConstellationFrame[16]
Definition view.c:18
Umbrella header for the game core.
void SystemDebugPrintf(const char *fmt,...)
Definition pilot.cpp:182
void * AllocateTaggedMemory(int size, unsigned short flags)
Definition ending.c:31
short __stdcall OpenPacketSection(const char *filename, short section, PacketSectionHandle *handle)
Definition view.c:371
void __stdcall CloseDataFileByHandle(PacketSectionHandle *p)
Definition view.c:438
void DrawCockpitReadout(signed char slot, const char *text)
Definition cockpt.c:352
unsigned int GetPacketDecompressionResult(void *)
Definition eventmgr.c:674
char PumpMessagesDuringWait(void)
Definition pilot.cpp:188
void fix_objects_ijk(short obj)
Definition geom.c:596
short __stdcall ReadPacketSectionData(PacketSectionHandle *handle, void *destination, unsigned int length)
Definition killbrd.c:894
void show_target_disp(void)
Definition view.c:573
unsigned short __stdcall AllocateViewport(Viewport *viewport, short clearColour, short flags)
Definition view.c:758
unsigned int InitializeFireworks(void)
Definition view.c:186
int __stdcall SeekDataFile(unsigned short fd, int offset, unsigned int origin)
Definition mono.c:79
short __stdcall CalcRectangleArea(const Viewport *viewport)
Definition view.c:745
void alter_pitch(short angle, short obj)
Definition geom.c:619
unsigned int force_view(int view, short obj)
Definition spc.c:464
void AddFixedVectors(const FixedVector *left, const FixedVector *right, FixedVector *sum)
Definition geom.c:296
void *__stdcall IdentityHandle(void *v)
Definition mathfp.c:164
unsigned int SoundFxTick(void)
Definition music.c:707
void alter_roll(short angle, short obj)
Definition geom.c:635
int __stdcall SeekPacketSection(PacketSectionHandle *handle, int offset, short origin)
Definition geom.c:34
unsigned int DrawConstellationField(void)
Definition view.c:289
void DrawSpriteDefault(Viewport *viewport, short x, short y, struct Shape *shape, short frame)
Definition gr.c:660
void init_ijk(short obj)
Definition geom.c:568
int __stdcall ReadDataFileAtOffset(unsigned short fd, int offset, unsigned int length, void *data)
Definition mono.c:61
short MinShort(short a, short b)
Definition mathutil.c:20
void __stdcall AlignSpriteFrameToRectCorner(const ShortRect *rectangle, ShortPoint *position, short corner, struct Shape *shape, short frame)
Definition view.c:805
void InvalidateVduMode(short i)
Definition cockpt.c:764
void __stdcall CloseDataFile(unsigned short fd)
Definition mono.c:23
void initialize_scripted_view(const short *script)
Definition view.c:175
void copy_frame(short source, short destination)
Definition geom.c:585
void alter_yaw(short angle, short obj)
Definition geom.c:627
void EraseCockpitReadoutRegion(Viewport *viewport, short left, short top, short right, short bottom, short colour)
Definition cockpt.c:253
short __stdcall OpenDataFileOrDie(const char *path)
Definition winsys.c:297
void ClearDebugPauseFlags(void)
Definition pilot.cpp:229
void ScaleFixedVector(const FixedVector *vector, int scale, FixedVector *result)
Definition geom.c:322
short TheEndFireWorks(Viewport *viewport, short count)
Definition view.c:198
void FinishPacketDecompressionHook(void)
Definition eventmgr.c:1194
void zero_vector(FixedVector *vector)
Definition geom.c:280
unsigned int update_scripted_view(void)
Definition view.c:148
unsigned int parse_view_script(void)
Definition view.c:36
void ClearViewport(Viewport *viewport, short colour)
Definition gr.c:963
short __stdcall GetShapeFrameBounds(short *bounds, short x, short y, struct Shape *shape, short frame)
Definition mathfp.c:195
void set_new_vdu(short vdu)
Definition cockpt.c:739
unsigned int InitializeCockpitReadout(signed char slot, TextContext *context)
Definition cockpt.c:341
short GetTargetColourIndex(void)
Definition view.c:560
void DrawTargetRangeReadout(void)
Definition view.c:679
void ReleasePacketHandle(void *handle)
Definition ending.c:50
void ComputeVectorDelta(const FixedVector *from, const FixedVector *to, FixedVector *delta)
Definition geom.c:314
unsigned int DrawTextAt(TextContext *context, short x, short y, const char *text, unsigned char alignment)
Definition disk.c:239
void FlushSoundEffectsAndLog(int soundHandle, short fadeTicks)
Definition music.c:714
short __stdcall RandomInRange(short lo, short hi)
Definition mathfp.c:49
unsigned int InitializeConstellationField(Viewport *viewport, short direction, short density)
Definition view.c:238
void DrawFormattedText(const char *format,...)
Definition cockpt.c:197
void LogDisplayMode(const char *mode)
Definition view.c:736
void *__stdcall DecompressPacketSection(PacketSectionHandle *handle, void *destination, unsigned short flags, void *decompressionWorkspace)
Definition view.c:444
ObjectType
Definition wcdata.h:54
@ SPECIAL_MANEUVER_UNKNOWN_9
Definition wcdata.h:268
@ OBJECT_CLASS_SHIP
Definition wcdata.h:50