Wing Commander
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
music.c
Go to the documentation of this file.
1/**
2 * @file
3 * @ingroup audio
4 * @brief Music state machine and the streaming music script.
5 *
6 * Address range 42e320-42efbf. The routines print their own names:
7 * StopMusic, FadeMusic, SetMusicOn and others.
8 */
9#include "wc1.h"
10#include <limits.h>
11
12/* The DAT_ words in this block are zero-initialized original data that
13 * nothing in the shipped executable references. */
14short nMusicPlaybackMode = 0; /* 0x0046a9f8 */
15static int bMusicCommandSuppressed = 0; /* 0x0046a9fc */
16static int DAT_0046aa00 = 0; /* 0x0046aa00 */
17short nMusicTrackComplete = 1; /* 0x0046aa04 */
18static int DAT_0046aa08 = 0; /* 0x0046aa08 */
19static short nMusicWaitForInput = 1; /* 0x0046aa0c */
20short nFuneralSequenceActive = 0; /* 0x0046aa10 */
21int nCurrentMusicTrack = -1; /* 0x0046aa14 */
22static int nMusicStreamSet = -1; /* 0x0046aa18 */
23static int DAT_0046aa1c = 0; /* 0x0046aa1c */
24static int DAT_0046aa20 = 0; /* 0x0046aa20 */
25int nInFlightMusicSlotA = -1; /* 0x0046aa24 */
26static int DAT_0046aa28 = 0; /* 0x0046aa28 */
27int nInFlightMusicSlotB = -1; /* 0x0046aa2c */
28int nWaitForMusicEnabled = 1; /* 0x0046aa30 */
29int nFlightSoundEffectsEnabled = 1; /* 0x0046aa34 */
30int nInitialFlightMusicPending = 1; /* 0x0046aa38 */
31int nCombatMusicActive = 0; /* 0x0046aa3c */
32int nInFlightMusicActive = 0; /* 0x0046aa40 */
33static int DAT_0046aa44 = 0; /* 0x0046aa44 */
34static short nPassingShipSoundObject = -1; /* 0x0046aa48 */
35static short nPassingShipSoundCountdown = 0; /* 0x0046aa4c */
36
37/* Legacy sound records; the last byte is the sequential effect index.
38 * Only the final record is still passed to SoundFxTick in this port. */
39/* 0x0046aa50 */
40unsigned char aabSoundEffectDescriptors[37][8] = {
41 { 0x00, 0x01, 0x40, 0x40, 0x3c, 0x00, 0x00, 0x00 },
42 { 0x02, 0x02, 0x40, 0x40, 0x01, 0x00, 0x00, 0x01 },
43 { 0x00, 0x27, 0x40, 0x40, 0x3c, 0x00, 0x00, 0x02 },
44 { 0x00, 0x04, 0x40, 0x40, 0x3c, 0x00, 0x00, 0x03 },
45 { 0x00, 0x07, 0x40, 0x40, 0x06, 0x00, 0x00, 0x04 },
46 { 0x00, 0x08, 0x40, 0x40, 0x1e, 0x00, 0x00, 0x05 },
47 { 0x00, 0x09, 0x40, 0x40, 0x0a, 0x00, 0x00, 0x06 },
48 { 0x00, 0x0a, 0x40, 0x40, 0x3c, 0x00, 0x00, 0x07 },
49 { 0x00, 0x0b, 0x40, 0x40, 0x06, 0x00, 0x00, 0x08 },
50 { 0x00, 0x0c, 0x40, 0x40, 0x0a, 0x00, 0x00, 0x09 },
51 { 0x04, 0x0d, 0x40, 0x40, 0x3c, 0x00, 0x00, 0x0a },
52 { 0x04, 0x0e, 0x40, 0x40, 0x3c, 0x00, 0x00, 0x0b },
53 { 0x00, 0x0f, 0x40, 0x40, 0x06, 0x00, 0x00, 0x0c },
54 { 0x08, 0x13, 0x40, 0x40, 0x3c, 0x00, 0x00, 0x0d },
55 { 0x04, 0x14, 0x40, 0x40, 0x3c, 0x00, 0x00, 0x0e },
56 { 0x00, 0x15, 0x40, 0x40, 0x3c, 0x00, 0x00, 0x0f },
57 { 0x04, 0x16, 0x40, 0x40, 0x3c, 0x00, 0x00, 0x10 },
58 { 0x02, 0x17, 0x54, 0x40, 0x06, 0x00, 0x39, 0x11 },
59 { 0x00, 0x18, 0x40, 0x40, 0x3c, 0x00, 0x00, 0x12 },
60 { 0x02, 0x29, 0x18, 0x40, 0x02, 0x00, 0x7f, 0x13 },
61 { 0x00, 0x2a, 0x40, 0x40, 0x28, 0x00, 0x00, 0x14 },
62 { 0x00, 0x2b, 0x40, 0x40, 0x28, 0x00, 0x00, 0x15 },
63 { 0x00, 0x2d, 0x40, 0x40, 0x05, 0x00, 0x00, 0x16 },
64 { 0x00, 0x2e, 0x40, 0x40, 0x05, 0x00, 0x00, 0x17 },
65 { 0x00, 0x2f, 0x40, 0x40, 0x05, 0x00, 0x00, 0x18 },
66 { 0x00, 0x30, 0x40, 0x40, 0x28, 0x00, 0x00, 0x19 },
67 { 0x00, 0x40, 0x40, 0x40, 0x28, 0x00, 0x00, 0x1a },
68 { 0x00, 0x7d, 0x40, 0x40, 0x28, 0x00, 0x00, 0x1b },
69 { 0x00, 0x3e, 0x40, 0x40, 0x28, 0x00, 0x00, 0x1c },
70 { 0x00, 0x3f, 0x40, 0x40, 0x28, 0x00, 0x00, 0x1d },
71 { 0x00, 0x6a, 0x40, 0x40, 0x3c, 0x00, 0x00, 0x1e },
72 { 0x08, 0x6b, 0x40, 0x40, 0x28, 0x00, 0x00, 0x1f },
73 { 0x00, 0x6d, 0x40, 0x40, 0x3c, 0x00, 0x00, 0x20 },
74 { 0x00, 0x6e, 0x40, 0x40, 0x50, 0x00, 0x00, 0x21 },
75 { 0x00, 0x6f, 0x40, 0x40, 0x28, 0x00, 0x00, 0x22 },
76 { 0x00, 0x70, 0x40, 0x40, 0x3c, 0x00, 0x00, 0x23 },
77 { 0x00, 0x80, 0x40, 0x40, 0x3c, 0x00, 0x00, 0x24 }
78};
79
80/* The SDL audio adapter also uses this filename buffer. */
81static
82char szSfxWavePath[0xc8]; /* 0x00476558 */
83
84
85/* Linker commons defined here; LINK orders them by identifier hash. */
86unsigned short awObjectScales[SPACE_OBJECT_COUNT]; /* 0x0059de40 */
87signed char acVduModeStackDepth[16]; /* 0x0059dec0 */
88signed char acShipSpawnNavPt[16]; /* 0x0059ded0 */
90short nCurrentNavigationPoint; /* 0x0059df60 */
91int nJoystickCalibrationMinimumY; /* 0x0059df64 */
92int nJoystickCalibrationMinimumX; /* 0x0059df68 */
93int nJoystickCalibrationMaximumX; /* 0x0059df6c */
94int nJoystickCalibrationMaxY; /* 0x0059df70 */
95unsigned short awPalEntryAllocation[256]; /* 0x0059df80 */
96struct Shape *apCommunicationPortraitShapesTable[16]; /* 0x0059e180 */
97char szHudMessageBuf[0x60]; /* 0x0059e1c0 */
98char *aapszPilotSpeeches[14][11]; /* 0x0059e220 */
99signed char abCommMenuChoiceCommands[7]; /* 0x0059e488 */
100
101/* Function start: 0x42E320 */
102void FadeMusic(void)
103{
104 SoundDebugPrintf("FadeMusic\n");
105}
106
107/* Function start: 0x42E330 */
108void SetMusicOn(short enabled)
109{
110 SoundDebugPrintf("SetMusicOn %d\n", (int)enabled);
111}
112
113/* Function start: 0x42E350 */
114void StopMusic(short unused)
115{
116 (void)unused;
117 SoundDebugPrintf("StopMusic ");
120 SoundDebugPrintf("\n");
121}
122
123/* Function start: 0x42E380 */
124void SetMusBreakpt(int first, int second)
125{
126 (void)first;
127 (void)second;
128 SoundDebugPrintf("SetMusBreakpt\n");
129}
130
131/* Function start: 0x42E390 */
133{
134}
135
136/* Function start: 0x42E3A0 */
138{
140 SoundDebugPrintf("FlushSoundEffect\n");
141}
142
143/* Function start: 0x42E3C0 */
145{
147 SoundDebugPrintf("FlushSoundEffects\n");
148}
149
150/* Function start: 0x42E3E0 */
152{
153}
154
155/* Function start: 0x42E3F0 */
157{
158 const char *streamName;
159 int streamSet;
160
161 switch (track) {
162 case 0:
163 case 2:
164 case 3:
165 case 4:
166 case 5:
167 case 6:
168 case 7:
169 case 8:
170 case 9:
171 case 10:
172 case 11:
173 case 12:
174 case 13:
175 case 14:
176 case 15:
177 case 16:
178 case 17:
179 case 18:
180 case 27:
181 case 31:
182 case 32:
183 streamSet = 2;
184 break;
185 case 1:
186 SoundDebugPrintf("being tailed");
187 streamSet = 2;
188 break;
189 case 19:
190 SoundDebugPrintf("ofx music");
191 break;
192 case 20:
193 case 21:
194 case 22:
195 case 23:
196 case 24:
197 case 25:
198 case 26:
199 case 30:
200 case 35:
201 streamSet = 0;
202 break;
203 case 28:
204 case 29:
205 case 33:
206 case 34:
207 case 36:
208 case 37:
209 case 38:
210 case 39:
211 case 40:
212 streamSet = 1;
213 break;
214 default:
215 streamSet = -1;
216 break;
217 }
218
219 if (streamSet == nMusicStreamSet)
220 return;
221 if (streamSet == -1) {
222 if (nMusicStreamSet >= 0)
224 return;
225 }
226
227 switch (streamSet) {
228 case 0:
229 streamName = "preflite.str";
230 break;
231 case 1:
232 streamName = "posflite.str";
233 break;
234 case 2:
235 streamName = "mission.str";
237 break;
238 default:
239 streamName = 0;
240 break;
241 }
242
243 if (streamName != 0) {
244 Streamer_open(streamName);
245 nMusicStreamSet = streamSet;
246 } else {
248 nMusicStreamSet = -1;
249 }
250}
251
252/* Function start: 0x42E520 */
254{
255 switch (track) {
256 case 0:
257 return 5;
258 case 1:
259 SoundDebugPrintf("being tailed");
260 return 7;
261 case 2:
262 return 7;
263 case 3:
264 return 8;
265 case 4:
266 return 9;
267 case 5:
268 return 6;
269 case 6:
270 return 15;
271 case 7:
272 return 13;
273 case 8:
274 return 16;
275 case 9:
276 return 14;
277 case 10:
278 return 17;
279 case 11:
280 return 18;
281 case 12:
282 return 10;
283 case 13:
284 return 12;
285 case 14:
286 return 11;
287 case 15:
288 return 4;
289 case 16:
290 return 3;
291 case 17:
292 return 1;
293 case 18:
294 return 2;
295 case 19:
296 SoundDebugPrintf("ofx music");
297 default:
298 return -1;
299 case 20:
300 return 1;
301 case 21:
302 return 4;
303 case 22:
304 return 3;
305 case 23:
306 return -1;
307 case 24:
308 return 5;
309 case 25:
310 return 6;
311 case 26:
312 return 7;
313 case 27:
314 return -1;
315 case 28:
316 return -1;
317 case 29:
318 return 0;
319 case 30:
320 return 0;
321 case 31:
322 return 19;
323 case 32:
324 return 20;
325 case 33:
326 return 2;
327 case 34:
328 return 1;
329 case 35:
330 return 2;
331 case 36:
332 return 3;
333 case 37:
334 return 4;
335 case 38:
336 return 5;
337 case 39:
338 return 7;
339 case 40:
340 return 6;
341 }
342}
343
344/* Function start: 0x42E6F0 */
345int ProcessMusicScriptCommand(int track, int command, short enabled)
346{
347 int streamerCommand;
348
349 if (track == -1 || bMusicCommandSuppressed != 0)
350 return 0;
351 if (command == 4) {
352 SoundDebugPrintf("queue_stop\n");
353 StopMusic(enabled);
355 return;
356 }
357
358 SoundDebugPrintf("track_%02d ", track);
359 if ((nCurrentMusicTrack == 25 && track == 25) ||
360 (nCurrentMusicTrack == 38 && track == 38) ||
361 (nCurrentMusicTrack == 39 && track == 39) ||
362 (nCurrentMusicTrack == 40 && track == 40)) {
363 SoundDebugPrintf("skipping for QA\n");
364 return;
365 }
366
367 nCurrentMusicTrack = track;
369 if (nMusicStreamSet == 2) {
370 if ((track >= 0 && track <= 5) ||
371 (track >= 12 && track <= 18)) {
372 SoundDebugPrintf("flight_intensity %d ", track);
373 SetStreamerIntensity((unsigned char)track);
374 } else {
375 SoundDebugPrintf("flight_trigger %d ", track);
376 Streamer_trigger(track);
377 }
378 } else {
379 /* A compiled-out trace: nothing references its literal at
380 * 0x0046ac98, which precedes the live one below. */
381 if (0)
382 SoundDebugPrintf(" queue_start ");
383 switch (command) {
384 case 0:
385 SoundDebugPrintf(" queue_start ");
386 streamerCommand = MapMusicTrackToStreamerCommand(track);
387 Streamer_trigger(streamerCommand);
388 break;
389 case 1:
390 SoundDebugPrintf(" queue_break ");
391 streamerCommand = MapMusicTrackToStreamerCommand(track);
392 ForceStreamerTrigger(streamerCommand);
393 break;
394 case 2:
395 SoundDebugPrintf(" queue_switch ");
396 streamerCommand = MapMusicTrackToStreamerCommand(track);
397 Streamer_trigger(streamerCommand);
398 break;
399 case 3:
400 SoundDebugPrintf(" queue_interrupt ");
401 streamerCommand = MapMusicTrackToStreamerCommand(track);
402 ForceStreamerTrigger(streamerCommand);
403 break;
404 }
405 }
406 SoundDebugPrintf("\n");
407 return 1;
408}
409
410/* Function start: 0x42E880 */
411unsigned int spacetrack(int track, int mode, short enabled)
412{
413 if (nMusicPlaybackMode != 0 && nMusicPlaybackMode != 3)
414 ProcessMusicScriptCommand(track, mode, enabled);
415 return 1;
416}
417
418/* Function start: 0x42E8B0 */
420{
421 if (nMusicPlaybackMode != 0 && nMusicPlaybackMode != 3)
422 StopMusic(0);
423}
424
425/* Function start: 0x42E8D0 */
426unsigned short GetMusicMode(void)
427{
428 if (nMusicPlaybackMode != 0 && nMusicPlaybackMode != 3 &&
430 return 1;
431 return 0;
432}
433
434/* Function start: 0x42E900 */
436{
437 if (nMusicPlaybackMode != 0 && nMusicPlaybackMode != 3) {
438 if (nWaitForMusicEnabled == 0) {
439 StopMusic(0);
440 return;
441 }
442 SetMusBreakpt(0, 0);
443 do {
444 if (nMusicTrackComplete != 0)
445 return;
446 } while (bEscapePressedFlag == 0 && CheckEscaped() == 0);
447 StopMusic(0);
448 }
449}
450
451/* Function start: 0x42E970 */
453{
454 if (nMusicPlaybackMode != 0 && nMusicPlaybackMode != 3) {
455 if (nWaitForMusicEnabled == 0) {
457 return;
458 }
459 for (;;) {
461 return;
462 if (bEscapePressedFlag != 0 || CheckEscaped() != 0)
463 break;
464 }
465 StopMusic(0);
466 }
467}
468
469/* Flight-music callees declared locally, as in the leaked WINGLEADER
470 * modules; their parameter names are part of the measured context. */
471int report_kilrathi_rout(int mode);
472short __stdcall RandomInRange(short lo, short hi);
473unsigned int triumph(short obj);
474int missile_on_tail(short obj);
475int any_enemy_tail(short obj);
476int is_ship_tailing_player_target(short obj);
477int calculate_damage_level(void);
478
479/* Function start: 0x42E9E0 */
480void new_space_music_changes(short attacker, short victim)
481{
482 if (nInFlightMusicActive != 0 &&
483 nTrainSimActive == 0) {
484 if (aeShipSide[victim] == SIDE_KILRATHI) {
485 if (report_kilrathi_rout(1) == 0) {
486 spacetrack(10, 1, 0);
487 return;
488 }
489 if (attacker == 0) {
490 if (acShipRating[victim] == -1 &&
491 RandomInRange(0, 3) != 0) {
492 spacetrack(6, 3, 0);
493 return;
494 }
495 spacetrack(9, 3, 0);
496 return;
497 }
498 } else {
499 if (nYourWingman == victim) {
500 spacetrack(8, 3, 0);
501 return;
502 }
503 if (aeShipSide[victim] == SIDE_IMPERIAL) {
504 if ((aeShipMissionType[0] ==
508 nShipMissionIndices[victim] ==
510 spacetrack(11, 3, 0);
511 return;
512 }
513 spacetrack(7, 3, 0);
514 }
515 }
516 }
517}
518
519/* Function start: 0x42EAD0 */
520int changetrack(void)
521{
522 int track;
523
524 switch (aeShipMissionType[0]) {
526 track = 18;
527 break;
529 track = 17;
530 break;
533 track = 16;
534 break;
535 default:
536 track = 15;
537 break;
538 }
541 if (triumph(0) != 0) {
543 return 13;
544 return 14;
545 }
546 track = 12;
547 }
548 return track;
549}
550
551/* Function start: 0x42EB60 */
552void gametrack(void)
553{
554 int track;
555 short damage;
556
557 track = -1;
558 if (nInFlightMusicActive != 0) {
559 if (nTrainSimActive != 0) {
560 int currentTrack;
561 int streamSet;
562
563 streamSet = nMusicStreamSet;
564 if (streamSet != 0 ||
565 (currentTrack = nCurrentMusicTrack) != 20) {
566 spacetrack(20, 1, 0);
567 currentTrack = nCurrentMusicTrack;
568 streamSet = nMusicStreamSet;
569 }
570 SoundDebugPrintf("%d %d\n", streamSet, currentTrack);
571 return;
572 }
573 if (nCombatMusicActive != 0) {
574 if ((nCurrentSpaceFrameValue & 0xf) == 0 ||
575 nMusicTrackComplete != 0) {
578 if (missile_on_tail(0) != 0) {
579 track = 3;
580 } else if (any_enemy_tail(0) != 0) {
581 track = 1;
582 } else if (is_ship_tailing_player_target(0) != 0) {
583 track = 2;
584 } else {
585 damage = (short)calculate_damage_level();
586 if (damage >= 2)
587 track = 4;
588 else
589 track = damage == 1 ? 5 : 0;
590 }
591 if (report_kilrathi_rout(1) == 0)
593 }
594 } else if ((nCurrentSpaceFrameValue & 0xf) == 0 ||
595 nMusicTrackComplete != 0) {
596 track = changetrack();
597 if (report_kilrathi_rout(2) != 0)
599 }
600 spacetrack(track, 1, 0);
601 }
602}
603
604/* Function start: 0x42ECB0 */
605void servicetrack(void)
606{
607 short object;
608 FixedVector futurePosition;
609 FixedVector travel;
610
611 gametrack();
613 for (object = 0; object < SPACE_OBJECT_COUNT; object++) {
614 if (object == nPassingShipSoundObject) {
615 if (aeObjectClass[object] !=
617 aeObjectClass[object] !=
620 }
621 switch (aeObjectClass[object]) {
623 if (asObjDistancesTable[object] == 0 &&
624 (unsigned short)
625 asPreviousObjectDistance[object] < 50 &&
627 PlaySfxWaveFileByNumber(6, object, 0);
628 break;
631 if (asObjectScreenXList[object] != (short)0x8001 &&
632 asObjDistancesTable[object] < 0x55a) {
633 if (nPassingShipSoundObject == -1) {
635 0x1400, &travel);
637 &travel, &futurePosition);
640 &futurePosition, &travel);
643 &aShipPositionsArray[object],
644 &futurePosition);
645 if (dot_product(&travel, &futurePosition) < 0xdd) {
652 PlaySfxWaveFileByNumber(2, object, 0);
653 }
654 }
655 } else if (object ==
660 }
661 }
662 break;
663 }
664 }
665 }
666}
667
668/* Function start: 0x42EE80 */
675
676/* Function start: 0x42EEA0 */
682
683/* Function start: 0x42EEB0 */
689
690/* Function start: 0x42EEC0 */
691/* Nothing in the shipped executable calls this routine. */
698
699/* Function start: 0x42EEE0 */
701{
703 SetMusicOn(1);
704}
705
706/* Function start: 0x42EF00 */
707unsigned int SoundFxTick(void)
708{
709 WriteDebugString("soundFX\n");
710 return 0;
711}
712
713/* Function start: 0x42EF10 */
714void FlushSoundEffectsAndLog(int soundHandle, short fadeTicks)
715{
716 (void)fadeTicks;
718 return;
719 /* Unreachable: only its wave-name literal survives, at 0x0046ad04. */
720 sprintf(szSfxWavePath, "sfx%02i.wav", soundHandle - 1);
721}
722
723/* Function start: 0x42EF20 */
724void sound_effect(void)
725{
726 WriteDebugString("sound_effect");
727 return;
728 /* Unreachable: only its wave-name literal survives, at 0x0046ad20. */
729 sprintf(szSfxWavePath, "sfx%02i.wav", 0);
730}
731
732/* Function start: 0x42EF30 */
733void PlaySfxWaveFileByNumber(int soundNumber, int sourceObject, int looping)
734{
735 FixedVector delta;
736 int distance;
737
738 if (sourceObject != -1) {
739 long magnitude;
740
742 &aShipPositionsArray[sourceObject],
743 &delta);
744 magnitude = Vector_magnitude(&delta);
745 distance = magnitude;
746 if (magnitude > 32000)
747 distance = 32000;
748 } else {
749 distance = 32000;
750 }
751 if (distance >= 10) {
752 aiSoundEffectSourceActiveArray[sourceObject] = 1;
753 sprintf(szSfxWavePath, "sfx%02i.wav",
754 soundNumber - 1);
755 playWAVE(szSfxWavePath, looping, distance);
756 }
757}
void(__cdecl *pIxFree)(void *)
unsigned char bEscapePressedFlag
Definition mathfp.c:24
signed char acShipRating[16]
Definition joycal.c:25
int nJoystickCalibrationMinimumY
Definition music.c:91
int nInFlightMusicSlotB
Definition music.c:27
short anShipMissionShips[16]
Definition comm.c:57
signed char acShipSpawnNavPt[16]
Definition music.c:88
enum Side aeShipSide[12]
Definition ending.c:22
int bAfterburnerSfxEnabled
Definition ship.c:64
int nJoystickCalibrationMinimumX
Definition music.c:92
unsigned short awPalEntryAllocation[256]
Definition music.c:95
char szHudMessageBuf[0x60]
Definition music.c:97
signed char acVduModeStackDepth[16]
Definition music.c:87
int nFlightSoundEffectsEnabled
Definition music.c:29
short asShipAccumulatedDmg[SPACE_OBJECT_COUNT]
Definition music.c:89
int nCombatMusicActive
Definition music.c:31
short nMusicTrackComplete
Definition music.c:17
enum ShipMissionType aeShipMissionType[12]
Definition game.c:550
short nFuneralSequenceActive
Definition music.c:20
enum ObjectClass aeObjectClass[SPACE_OBJECT_COUNT]
Definition video.c:21
short nYourWingman
Definition game.c:61
unsigned char aabSoundEffectDescriptors[37][8]
Definition music.c:40
signed char abCommMenuChoiceCommands[7]
Definition music.c:99
int nJoystickCalibrationMaxY
Definition music.c:94
int nInFlightMusicActive
Definition music.c:32
FixedVector aShipVelocity[SPACE_OBJECT_COUNT]
Definition smart.c:21
int nPassingShipAudioCooldown
Definition install.c:15
short asPreviousObjectDistance[SPACE_OBJECT_COUNT]
Definition video.c:20
unsigned short asObjDistancesTable[SPACE_OBJECT_COUNT]
Definition data.c:253
int aiSoundEffectSourceActiveArray[0x40]
Definition install.c:13
short nMusicPlaybackMode
Definition music.c:14
signed char cCurrentObjective
Definition game.c:37
short asObjectScreenXList[SPACE_OBJECT_COUNT]
Definition screen.c:21
short nCurrentSpaceFrameValue
Definition data.c:249
MissionObjective aMissionObjectivesArray[MISSION_OBJECTIVE_COUNT]
Definition screen.c:24
unsigned short awObjectScales[SPACE_OBJECT_COUNT]
Definition music.c:86
int nTrainSimActive
Definition trainsim.c:31
int nCurrentMusicTrack
Definition music.c:21
short nCurrentNavigationPoint
Definition music.c:90
int nWaitForMusicEnabled
Definition music.c:28
short nShipMissionIndices[10]
Definition game.c:559
FixedVector aShipPositionsArray[SPACE_OBJECT_COUNT]
Definition game.c:556
int nCurrentDamageAlarmSfxHandle
Definition spc.c:23
int nInFlightMusicSlotA
Definition music.c:25
struct Shape * apCommunicationPortraitShapesTable[16]
Definition music.c:96
char * aapszPilotSpeeches[14][11]
Definition music.c:98
int nInitialFlightMusicPending
Definition music.c:30
int nJoystickCalibrationMaximumX
Definition music.c:93
static int nMusicStreamSet
Definition music.c:22
static int DAT_0046aa20
Definition music.c:24
static short nPassingShipSoundObject
Definition music.c:34
void DisableMusicForScene(void)
Definition music.c:692
static int DAT_0046aa08
Definition music.c:18
static int DAT_0046aa00
Definition music.c:16
static int DAT_0046aa28
Definition music.c:26
static short nPassingShipSoundCountdown
Definition music.c:35
static int DAT_0046aa1c
Definition music.c:23
static int DAT_0046aa44
Definition music.c:33
static char szSfxWavePath[0xc8]
Definition music.c:82
static short nMusicWaitForInput
Definition music.c:19
static int bMusicCommandSuppressed
Definition music.c:15
Umbrella header for the game core.
void SoundDebugPrintf(const char *fmt,...)
Definition mono.c:382
void ForceStreamerTrigger(int trigger)
Definition gr.c:1452
int any_enemy_tail(short obj)
Definition logic.c:512
void SceneLeaveHook()
Definition music.c:151
void wait_for_end_of_music(void)
Definition music.c:435
void FadeMusic(void)
Definition music.c:102
void ClearStreamerTrigger(void)
Definition gr.c:1419
void sound_effect(void)
Definition music.c:724
void ResetSoundStateForFlight(void)
Definition music.c:684
int dot_product(const FixedVector *left, const FixedVector *right)
Definition geom.c:441
int missile_on_tail(short obj)
Definition logic.c:562
long Vector_magnitude(const FixedVector *vector)
Definition mathfp.c:132
void ResetSoundStateForScene(void)
Definition music.c:677
void AddFixedVectors(const FixedVector *left, const FixedVector *right, FixedVector *sum)
Definition geom.c:296
void SetStreamerIntensity(unsigned char intensity)
Definition gr.c:1442
void EnableMusicForScene(void)
Definition music.c:700
unsigned int SoundFxTick(void)
Definition music.c:707
void playWAVE(const char *filename, int looping, int volume)
Definition sound.c:215
unsigned int spacetrack(int track, int mode, short enabled)
Definition music.c:411
void WaitForMusicOrInput(void)
Definition music.c:452
void StopMusicUnlessSuppressed(void)
Definition music.c:419
void SetMusicOn(short enabled)
Definition music.c:108
unsigned int triumph(short obj)
Definition logic.c:1328
unsigned short GetMusicMode(void)
Definition music.c:426
void Streamer_close(void)
Definition gr.c:1479
void SetMusBreakpt(int first, int second)
Definition music.c:124
void Streamer_open(const char *streamName)
Definition gr.c:1370
void stop_all_sounds(void)
Definition sound.c:276
void gametrack(void)
Definition music.c:552
int report_kilrathi_rout(int mode)
Definition logic.c:391
void ResetSoundState(void)
Definition music.c:669
void ScaleFixedVector(const FixedVector *vector, int scale, FixedVector *result)
Definition geom.c:322
void SelectFlightMusicTrack(int track)
Definition music.c:156
void PaletteFadeHook(void)
Definition music.c:132
void new_space_music_changes(short attacker, short victim)
Definition music.c:480
void StopMusic(short unused)
Definition music.c:114
void PlaySfxWaveFileByNumber()
int calculate_damage_level(void)
Definition main.c:2123
int changetrack(void)
Definition music.c:520
void ComputeVectorDelta(const FixedVector *from, const FixedVector *to, FixedVector *delta)
Definition geom.c:314
void FlushSoundEffectsAndLog(int soundHandle, short fadeTicks)
Definition music.c:714
void FlushSoundEffect(void)
Definition music.c:137
int ProcessMusicScriptCommand(int track, int command, short enabled)
Definition music.c:345
short CheckEscaped(void)
Definition disk.c:442
void WriteDebugString(const char *s)
Definition winsys.c:141
void servicetrack(void)
Definition music.c:605
void Streamer_trigger(int trigger)
Definition gr.c:1426
void FlushSoundEffects(void)
Definition music.c:144
int is_ship_tailing_player_target(short obj)
Definition logic.c:552
short __stdcall RandomInRange(short lo, short hi)
Definition mathfp.c:49
int MapMusicTrackToStreamerCommand(int track)
Definition music.c:253
void Streamer_stop(void)
Definition gr.c:1400
@ MISSION_TYPE_PATROL
Definition wcdata.h:122
@ MISSION_TYPE_ESCORT
Definition wcdata.h:123
@ MISSION_TYPE_RENDEZVOUS
Definition wcdata.h:131
@ MISSION_TYPE_DEFEND
Definition wcdata.h:125
@ MISSION_TYPE_STRIKE
Definition wcdata.h:124
#define EYE_OBJECT
Definition wcdata.h:1006
@ SIDE_IMPERIAL
Definition wcdata.h:174
@ SIDE_KILRATHI
Definition wcdata.h:175
@ OBJECTIVE_HOME_BASE
Definition wcdata.h:139
#define SPACE_OBJECT_COUNT
Definition wcdata.h:1004
@ OBJECT_CLASS_SHIP
Definition wcdata.h:50
@ OBJECT_CLASS_CAPITAL_SHIP
Definition wcdata.h:51
@ OBJECT_CLASS_ASTEROID
Definition wcdata.h:47