Skip to content

Commit

Permalink
remove .wad extension from WAD name in default savegame name
Browse files Browse the repository at this point in the history
This saves some precious 4 bytes from the savegame name.
  • Loading branch information
fabiangreffrath committed Jun 24, 2019
1 parent 1c6affd commit 6e746bd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/doom/m_menu.c
Expand Up @@ -643,9 +643,18 @@ static void SetDefaultSaveName(int slot)
}
else
{
char *wadname = M_StringDuplicate(W_WadNameForLump(maplumpinfo));
char *ext = strrchr(wadname, '.');

if (ext != NULL)
{
*ext = '\0';
}

M_snprintf(savegamestrings[itemOn], SAVESTRINGSIZE,
"%s (%s)", maplumpinfo->name,
W_WadNameForLump(maplumpinfo));
wadname);
free(wadname);
}
M_ForceUppercase(savegamestrings[itemOn]);
joypadSave = false;
Expand Down

4 comments on commit 6e746bd

@SoDOOManiac
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is already worth merging into Crispy :)

@fabiangreffrath
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I posted to the wrong window.

Anyway, I would like to get this right in Choco first.

@SoDOOManiac
Copy link
Contributor

@SoDOOManiac SoDOOManiac commented on 6e746bd Jun 24, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no controller/joystick so I can't test auto-naming in Choco.

@fabiangreffrath
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge this into Crispy tomorrow.

Please sign in to comment.