| 698 | int DemoFrameCount = 0; |
| 699 | |
| 700 | int 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 | |
| 737 | extern bool IsRestoredGame; |
| 738 | int DemoReadHeader() { |
no test coverage detected