Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Show a message when demo recording starts. #517

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion prboom2/src/d_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,7 @@ static char *GetAutoloadDir(const char *base, const char *iwadname, dboolean cre
return result;
}

static const char *BaseName(const char *filename)
const char *BaseName(const char *filename)
{
char *basename;

Expand Down
1 change: 1 addition & 0 deletions prboom2/src/d_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ void D_DoomMain(void);
void D_AddFile (const char *file, wad_source_t source);

void AddIWAD(const char *iwad);
const char *BaseName(const char *filename);

/* cph - MBF-like wad/deh/bex autoload code */
/* proff 2001/7/1 - added prboom.wad as last entry so it's always loaded and
Expand Down
14 changes: 13 additions & 1 deletion prboom2/src/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ dboolean demorecording;
dboolean demoplayback;
dboolean democontinue = false;
char democontinuename[PATH_MAX];
char* demo_filename = NULL;
dboolean singledemo; // quit after playing a demo from cmdline
wbstartstruct_t wminfo; // parms for world map / intermission
dboolean haswolflevels = false;// jff 4/18/98 wolf levels present
Expand Down Expand Up @@ -3086,10 +3087,18 @@ void G_WriteDemoTiccmd (ticcmd_t* cmd)
void G_RecordDemo (const char* name)
{
char *demoname;
int demoname_len;
usergame = false;
demoname = malloc(strlen(name)+4+1);
demoname_len = strlen(name)+4+1;
demoname = malloc(demoname_len);
AddDefaultExtension(strcpy(demoname, name), ".lmp"); // 1/18/98 killough
demorecording = true;

if (demoname)
{
free(demo_filename);
demo_filename = strdup(BaseName(demoname));
}

// the original name chosen for the demo
if (!orig_demoname)
Expand Down Expand Up @@ -3576,6 +3585,7 @@ void G_BeginRecording (void)

R_DemoEx_ResetMLook();

doom_printf("Demo recording: %s", demo_filename ? demo_filename : "(unknown)");
free(demostart);
}

Expand Down Expand Up @@ -4512,6 +4522,8 @@ void G_ReadDemoContinueTiccmd (ticcmd_t* cmd)
{
demo_continue_p = NULL;
democontinue = false;
if (demo_filename)
doom_printf("Continuing demo recording: %s", demo_filename);
// Sometimes this bit is not available
if ((demo_compatibility && !prboom_comp[PC_ALLOW_SSG_DIRECT].state) ||
(cmd->buttons & BT_CHANGE) == 0)
Expand Down