MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / TelComMain

Function TelComMain

Descent3/TelCom.cpp:592–766  ·  view source on GitHub ↗

This is the main loop for the active TelCom...think of it as a void main(void)

Source from the content-addressed store, hash-verified

590
591// This is the main loop for the active TelCom...think of it as a void main(void)
592void TelComMain(bool ingame, bool SelectShip) {
593 // Initialize sound system
594 TelcomInitSounds();
595
596 // Initialize screens
597 InitAllScreens();
598
599 // Initialize the Effects
600 EfxInit();
601
602 // Initialize the Telcom Render Engine
603 TelcomRenderInit();
604
605 // Initialize the TelCom System Event Manager
606 TelComInitEventManager();
607 TelcomRenderSetScreen(DUMMY_SCREEN);
608
609 // kinda a quick hack...it may stay only if there is no way to enter the briefings directly from the game
610 bool noescape = false;
611 if (!ingame)
612 noescape = true;
613
614 Telcom_system.state = TCS_POWERON;
615
616 TelcomCreateStartupScreen();
617
618 TelcomStartSound(TCSND_STARTUP);
619 TelcomStartSound(TCSND_RUNNING);
620 TelcomStopSound(TCSND_STARTUP);
621
622 // #ifdef DEMO
623 // Telcom_system.current_status = TS_MISSION;
624 // #endif
625
626 // initialize this to -1 so we get events right away
627 Telcom_mouse_last_effect = -1;
628
629 // if we are coming from the game into the main menu, then any system we select, when
630 // we exit should take us back to main menu
631 bool return_to_main_menu = false;
632 if (ingame && Telcom_system.current_status == TS_MAINMENU) {
633 return_to_main_menu = true;
634 }
635
636 while (Telcom_system.state != TCS_POWEROFF) {
637
638 TelComEnableSystemKey(TCSYS_MAXKEYS, true);
639
640 switch (Telcom_system.current_status) {
641 case TS_MISSION:
642 // if we are in briefings, then show the briefing
643 if (Current_level->flags & LVLFLAG_BRIEFING) {
644 // determine the correct language of briefing to look at
645 char basefilename[_MAX_FNAME];
646 char briefingname[_MAX_FNAME];
647 char extension[_MAX_FNAME];
648 const char *tag[] = {"", "_GER", "_SPN", "_ITN", "_FRN"};
649 bool ok_to_go = false;

Callers 1

TelComShowFunction · 0.85

Calls 15

TelcomInitSoundsFunction · 0.85
InitAllScreensFunction · 0.85
EfxInitFunction · 0.85
TelcomRenderInitFunction · 0.85
TelComInitEventManagerFunction · 0.85
TelcomRenderSetScreenFunction · 0.85
TelcomStartSoundFunction · 0.85
TelcomStopSoundFunction · 0.85
TelComEnableSystemKeyFunction · 0.85
Localization_GetLanguageFunction · 0.85
cfexistFunction · 0.85

Tested by

no test coverage detected