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

Function DemoPlaybackFile

Descent3/demofile.cpp:700–735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

698int DemoFrameCount = 0;
699
700int DemoPlaybackFile(char *filename) {
701 is_multi_demo = false;
702 mprintf(0, "Playing back demo file!\n");
703 MultiBuildMatchTables();
704 if (FindArg("-makemovie")) {
705 Demo_make_movie = true;
706 }
707
708 if (FindArg("-fastdemo")) {
709 Demo_play_fast = true;
710 }
711 Demo_first_frame = true;
712 for (int i = 0; i < MAX_OBJECTS; i++) {
713 Demo_obj_map[i] = i;
714 }
715
716 if (Demo_flags == DF_RECORDING) {
717 DemoToggleRecording();
718 }
719 Demo_cfp = cfopen(filename, "rb");
720
721 if (Demo_cfp == NULL) {
722 DoMessageBox(TXT_ERROR, TXT_CANTLOAD, MSGBOX_OK, UICOL_WINDOW_TITLE, UICOL_TEXT_NORMAL);
723 return 0;
724 }
725
726 Demo_flags = DF_PLAYBACK;
727 FrameDemoDelta = FrameCount;
728 if (!DemoReadHeader()) {
729 Demo_flags = DF_NONE;
730 DoMessageBox(TXT_ERROR, TXT_BADDEMOFILE, MSGBOX_OK, UICOL_WINDOW_TITLE, UICOL_TEXT_NORMAL);
731 return 0;
732 }
733
734 return 1;
735}
736
737extern bool IsRestoredGame;
738int DemoReadHeader() {

Callers 2

GameSequencerFunction · 0.85
DemoPlayAutoDemoFunction · 0.85

Calls 6

MultiBuildMatchTablesFunction · 0.85
DemoToggleRecordingFunction · 0.85
cfopenFunction · 0.85
DoMessageBoxFunction · 0.85
DemoReadHeaderFunction · 0.85
FindArgFunction · 0.70

Tested by

no test coverage detected