mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
Added recordmap for recording demos from console
recordmap <filename> <map name> Starts a new game from the specified map recording to the specified filename
This commit is contained in:
parent
31611c17d5
commit
eceb37aa64
5 changed files with 60 additions and 0 deletions
|
@ -61,6 +61,7 @@ typedef enum
|
||||||
ga_loadlevel,
|
ga_loadlevel,
|
||||||
ga_newgame,
|
ga_newgame,
|
||||||
ga_newgame2,
|
ga_newgame2,
|
||||||
|
ga_recordgame,
|
||||||
ga_loadgame,
|
ga_loadgame,
|
||||||
ga_loadgamehidecon,
|
ga_loadgamehidecon,
|
||||||
ga_loadgameplaydemo,
|
ga_loadgameplaydemo,
|
||||||
|
|
|
@ -1338,6 +1338,7 @@ CCMD (endgame)
|
||||||
{
|
{
|
||||||
gameaction = ga_fullconsole;
|
gameaction = ga_fullconsole;
|
||||||
demosequence = -1;
|
demosequence = -1;
|
||||||
|
G_CheckDemoStatus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -136,6 +136,8 @@ extern int consoleplayer;
|
||||||
// Disable save/end game?
|
// Disable save/end game?
|
||||||
extern bool usergame;
|
extern bool usergame;
|
||||||
|
|
||||||
|
extern FString newdemoname;
|
||||||
|
extern FString newdemomap;
|
||||||
extern bool demoplayback;
|
extern bool demoplayback;
|
||||||
extern bool demorecording;
|
extern bool demorecording;
|
||||||
extern int demover;
|
extern int demover;
|
||||||
|
|
|
@ -162,6 +162,8 @@ int consoleplayer; // player taking events
|
||||||
int gametic;
|
int gametic;
|
||||||
|
|
||||||
CVAR(Bool, demo_compress, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
|
CVAR(Bool, demo_compress, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG);
|
||||||
|
FString newdemoname;
|
||||||
|
FString newdemomap;
|
||||||
FString demoname;
|
FString demoname;
|
||||||
bool demorecording;
|
bool demorecording;
|
||||||
bool demoplayback;
|
bool demoplayback;
|
||||||
|
@ -1048,6 +1050,10 @@ void G_Ticker ()
|
||||||
case ga_loadlevel:
|
case ga_loadlevel:
|
||||||
G_DoLoadLevel (-1, false);
|
G_DoLoadLevel (-1, false);
|
||||||
break;
|
break;
|
||||||
|
case ga_recordgame:
|
||||||
|
G_CheckDemoStatus();
|
||||||
|
G_RecordDemo(newdemoname);
|
||||||
|
G_BeginRecording(newdemomap);
|
||||||
case ga_newgame2: // Silence GCC (see above)
|
case ga_newgame2: // Silence GCC (see above)
|
||||||
case ga_newgame:
|
case ga_newgame:
|
||||||
G_DoNewGame ();
|
G_DoNewGame ();
|
||||||
|
@ -2434,6 +2440,16 @@ void G_DeferedPlayDemo (const char *name)
|
||||||
|
|
||||||
CCMD (playdemo)
|
CCMD (playdemo)
|
||||||
{
|
{
|
||||||
|
if (netgame)
|
||||||
|
{
|
||||||
|
Printf("End your current netgame first!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (demorecording)
|
||||||
|
{
|
||||||
|
Printf("End your current demo first!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (argv.argc() > 1)
|
if (argv.argc() > 1)
|
||||||
{
|
{
|
||||||
G_DeferedPlayDemo (argv[1]);
|
G_DeferedPlayDemo (argv[1]);
|
||||||
|
|
|
@ -199,6 +199,46 @@ CCMD (map)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
|
CCMD(recordmap)
|
||||||
|
{
|
||||||
|
if (netgame)
|
||||||
|
{
|
||||||
|
Printf("You cannot record a new game while in a netgame.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (argv.argc() > 2)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (!P_CheckMapData(argv[2]))
|
||||||
|
{
|
||||||
|
Printf("No map %s\n", argv[2]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
G_DeferedInitNew(argv[2]);
|
||||||
|
gameaction = ga_recordgame;
|
||||||
|
newdemoname = argv[1];
|
||||||
|
newdemomap = argv[2];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (CRecoverableError &error)
|
||||||
|
{
|
||||||
|
if (error.GetMessage())
|
||||||
|
Printf("%s", error.GetMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Printf("Usage: recordmap <filename> <map name>\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
CCMD (open)
|
CCMD (open)
|
||||||
{
|
{
|
||||||
if (netgame)
|
if (netgame)
|
||||||
|
|
Loading…
Reference in a new issue