mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-25 05:48:03 -04:00
adapt Chocolate Doom's gameversion concept
This will be helpful to fix some Final or Ultimate only demo desyncing issues.
This commit is contained in:
parent
e6910bf07d
commit
5ce7ef8211
@ -990,6 +990,77 @@ void IdentifyVersion (void)
|
||||
I_Error("IWAD not found\n");
|
||||
}
|
||||
|
||||
// [FG] emulate a specific version of Doom
|
||||
|
||||
static struct
|
||||
{
|
||||
const char *description;
|
||||
const char *cmdline;
|
||||
GameVersion_t version;
|
||||
} gameversions[] = {
|
||||
{"Doom 1.9", "1.9", exe_doom_1_9},
|
||||
{"Ultimate Doom", "ultimate", exe_ultimate},
|
||||
{"Final Doom", "final", exe_final},
|
||||
{ NULL, NULL, 0},
|
||||
};
|
||||
|
||||
static void InitGameVersion(void)
|
||||
{
|
||||
int i, p;
|
||||
|
||||
p = M_CheckParm("-gameversion");
|
||||
|
||||
if (p && p < myargc-1)
|
||||
{
|
||||
for (i=0; gameversions[i].description != NULL; ++i)
|
||||
{
|
||||
if (!strcmp(myargv[p+1], gameversions[i].cmdline))
|
||||
{
|
||||
gameversion = gameversions[i].version;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (gameversions[i].description == NULL)
|
||||
{
|
||||
printf("Supported game versions:\n");
|
||||
|
||||
for (i=0; gameversions[i].description != NULL; ++i)
|
||||
{
|
||||
printf("\t%s (%s)\n", gameversions[i].cmdline,
|
||||
gameversions[i].description);
|
||||
}
|
||||
|
||||
I_Error("Unknown game version '%s'", myargv[p+1]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Determine automatically
|
||||
|
||||
if (gamemode == shareware || gamemode == registered ||
|
||||
(gamemode == commercial && gamemission == doom2))
|
||||
{
|
||||
// original
|
||||
gameversion = exe_doom_1_9;
|
||||
}
|
||||
else if (gamemode == retail)
|
||||
{
|
||||
gameversion = exe_ultimate;
|
||||
}
|
||||
else if (gamemode == commercial)
|
||||
{
|
||||
// Final Doom: tnt or plutonia
|
||||
// Defaults to emulating the first Final Doom executable,
|
||||
// which has the crash in the demo loop; however, having
|
||||
// this as the default should mean that it plays back
|
||||
// most demos correctly.
|
||||
|
||||
gameversion = exe_final;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// killough 5/3/98: old code removed
|
||||
|
||||
//
|
||||
@ -1397,6 +1468,9 @@ void D_DoomMain(void)
|
||||
|
||||
IdentifyVersion();
|
||||
|
||||
// [FG] emulate a specific version of Doom
|
||||
InitGameVersion();
|
||||
|
||||
modifiedgame = false;
|
||||
|
||||
// killough 10/98: process all command-line DEH's first
|
||||
|
@ -73,6 +73,15 @@ typedef enum {
|
||||
unknown
|
||||
} Language_t;
|
||||
|
||||
// [FG] emulate a specific version of Doom
|
||||
|
||||
typedef enum
|
||||
{
|
||||
exe_doom_1_9, // Doom 1.9: for shareware, registered and commercial
|
||||
exe_ultimate, // Ultimate Doom (retail)
|
||||
exe_final, // Final Doom
|
||||
} GameVersion_t;
|
||||
|
||||
// [FG] support the BFG Edition IWADs
|
||||
extern int bfgedition;
|
||||
|
||||
|
@ -30,6 +30,9 @@
|
||||
GameMode_t gamemode = indetermined;
|
||||
GameMission_t gamemission = doom;
|
||||
|
||||
// [FG] emulate a specific version of Doom
|
||||
GameVersion_t gameversion = exe_doom_1_9;
|
||||
|
||||
// Language.
|
||||
Language_t language = english;
|
||||
|
||||
|
@ -60,6 +60,9 @@ extern int screenblocks; // killough 11/98
|
||||
extern GameMode_t gamemode;
|
||||
extern GameMission_t gamemission;
|
||||
|
||||
// [FG] emulate a specific version of Doom
|
||||
extern GameVersion_t gameversion;
|
||||
|
||||
// Set if homebrew PWAD stuff has been added.
|
||||
extern boolean modifiedgame;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user