- cutscene recorder subreplay selection

This commit is contained in:
Ilya Shurumov 2020-08-31 15:14:48 +06:00
parent 9c6ff3c594
commit 7af575daec
2 changed files with 9 additions and 6 deletions

View File

@ -2569,7 +2569,7 @@ int redriver2_main(int argc, char** argv)
{
if (argc-i < 3)
{
printWarning("Example: -recordcutscene <mission_number> <base_mission> <player_id>");
printWarning("Example: -recordcutscene <mission_number> <subindex> <base_mission>");
return 0;
}
@ -2578,17 +2578,17 @@ int redriver2_main(int argc, char** argv)
gInFrontend = 0;
AttractMode = 0;
int player_id = atoi(argv[i+3]);
int subindx = atoi(argv[i+2]);
extern int LoadCutsceneAsReplay(int subindex);
extern int gCutsceneAsReplay;
extern int gCutsceneAsReplay_PlayerId;
gCutsceneAsReplay = atoi(argv[i + 1]); // acts as cutscene mission
gCurrentMissionNumber = atoi(argv[i + 2]); // acts as base mission. Some mission requires other base
gCutsceneAsReplay_PlayerId = atoi(argv[i + 3]);
gCurrentMissionNumber = atoi(argv[i + 3]); // acts as base mission. Some mission requires other base
gCutsceneAsReplay_PlayerId = 0;
if (LoadCutsceneAsReplay(0))
if (LoadCutsceneAsReplay(subindx))
{
CurrentGameMode = GAMEMODE_REPLAY;
gLoadedReplay = 1;

View File

@ -190,6 +190,7 @@ int SaveReplayToBuffer(char *buffer)
// write each stream data
#ifdef CUTSCENE_RECORDER
extern int gCutsceneAsReplay;
int numStreams = gCutsceneAsReplay ? NumReplayStreams : NumPlayers;
for (int i = 0; i < numStreams; i++)
@ -340,7 +341,9 @@ int LoadCutsceneAsReplay(int subindex)
LoadfileSeg(filename, _other_buffer, offset, size);
return LoadReplayFromBuffer(_other_buffer);
int result = LoadReplayFromBuffer(_other_buffer);
return result;
}
}