This is called from the DarkForcesMain
| 1071 | |
| 1072 | // This is called from the DarkForcesMain |
| 1073 | void loadReplay() |
| 1074 | { |
| 1075 | startCommonReplayStates(); |
| 1076 | |
| 1077 | // Start replaying with the first event |
| 1078 | inputMapping_setReplayCounter(1); |
| 1079 | |
| 1080 | serializeDemo(&s_replayFile, false); |
| 1081 | |
| 1082 | // Setup frame rate for replay playback |
| 1083 | handleFrameRate(); |
| 1084 | |
| 1085 | // Load the timing and seeds |
| 1086 | loadInitTime(); |
| 1087 | restoreReplaySeed(); |
| 1088 | |
| 1089 | // Initialize Demo Playback |
| 1090 | setDemoPlayback(true); |
| 1091 | |
| 1092 | // Reset the eye |
| 1093 | TFE_DarkForces::player_clearEyeObject(); |
| 1094 | |
| 1095 | // Ensure you always load the first agent. |
| 1096 | s_agentId = 0; |
| 1097 | |
| 1098 | if (shouldLogReplay()) |
| 1099 | { |
| 1100 | TFE_System::logClose(); |
| 1101 | if (replayLogCounter == 0) |
| 1102 | { |
| 1103 | TFE_System::logOpen("replay.log"); |
| 1104 | } |
| 1105 | else |
| 1106 | { |
| 1107 | char logPath[256]; |
| 1108 | sprintf(logPath, "replay_%d.log", replayLogCounter); |
| 1109 | TFE_System::logOpen(logPath); |
| 1110 | } |
| 1111 | replayLogCounter++; |
| 1112 | TFE_System::logTimeToggle(); |
| 1113 | } |
| 1114 | } |
| 1115 | |
| 1116 | void restoreAgent() |
| 1117 | { |
no test coverage detected