diff options
author | Simon Howard | 2011-09-20 21:53:05 +0000 |
---|---|---|
committer | Simon Howard | 2011-09-20 21:53:05 +0000 |
commit | 76a7eebc335c6f57da589ee66971b850f0ec4c50 (patch) | |
tree | 4dead04fe9b054d58f4b5a6a9265a260f741d003 /src/doom/d_main.c | |
parent | b8d2d8bb8b3cf1b5475e8c9be292248f140b2126 (diff) | |
download | chocolate-doom-76a7eebc335c6f57da589ee66971b850f0ec4c50.tar.gz chocolate-doom-76a7eebc335c6f57da589ee66971b850f0ec4c50.tar.bz2 chocolate-doom-76a7eebc335c6f57da589ee66971b850f0ec4c50.zip |
Add dedicated pack_chex and pack_hacx values for the Chex Quest and Hacx
IWADs.
Subversion-branch: /branches/v2-branch
Subversion-revision: 2390
Diffstat (limited to 'src/doom/d_main.c')
-rw-r--r-- | src/doom/d_main.c | 66 |
1 files changed, 11 insertions, 55 deletions
diff --git a/src/doom/d_main.c b/src/doom/d_main.c index b425d11a..beb15019 100644 --- a/src/doom/d_main.c +++ b/src/doom/d_main.c @@ -721,7 +721,7 @@ void D_IdentifyVersion(void) // Make sure gamemode is set up correctly - if (gamemission == doom) + if (logical_gamemission == doom) { // Doom 1. But which version? @@ -754,7 +754,7 @@ void D_SetGameDescription(void) { gamedescription = "Unknown"; - if (gamemission == doom) + if (logical_gamemission == doom) { // Doom 1. But which version? @@ -777,39 +777,15 @@ void D_SetGameDescription(void) { // Doom 2 of some kind. But which mission? - if (gamemission == doom2) + if (logical_gamemission == doom2) gamedescription = GetGameName("DOOM 2: Hell on Earth"); - else if (gamemission == pack_plut) + else if (logical_gamemission == pack_plut) gamedescription = GetGameName("DOOM 2: Plutonia Experiment"); - else if (gamemission == pack_tnt) + else if (logical_gamemission == pack_tnt) gamedescription = GetGameName("DOOM 2: TNT - Evilution"); } } -// Check if the IWAD file is the Chex Quest IWAD. -// Returns true if this is chex.wad. - -static boolean CheckChex(char *iwadname) -{ - char *chex_iwadname = "chex.wad"; - - return (strlen(iwadname) > strlen(chex_iwadname) - && !strcasecmp(iwadname + strlen(iwadname) - strlen(chex_iwadname), - chex_iwadname)); -} - -// Check if the IWAD file is the Hacx IWAD. -// Returns true if this is hacx.wad. - -static boolean CheckHacx(char *iwadname) -{ - char *hacx_iwadname = "hacx.wad"; - - return (strlen(iwadname) > strlen(hacx_iwadname) - && !strcasecmp(iwadname + strlen(iwadname) - strlen(hacx_iwadname), - hacx_iwadname)); -} - // print title for every printed line char title[128]; @@ -933,15 +909,15 @@ static void InitGameVersion(void) { // Determine automatically - if (CheckChex(iwadfile)) + if (gamemission == pack_chex) { // chex.exe - identified by iwad filename gameversion = exe_chex; } - else if (CheckHacx(iwadfile)) + else if (gamemission == pack_hacx) { - // hacx exe: identified by iwad filename + // hacx.exe: identified by iwad filename gameversion = exe_hacx; } @@ -981,7 +957,8 @@ static void InitGameVersion(void) // EXEs prior to the Final Doom exes do not support Final Doom. - if (gameversion < exe_final && gamemode == commercial) + if (gameversion < exe_final && gamemode == commercial + && (gamemission == pack_tnt || gamemission == pack_plut)) { gamemission = doom2; } @@ -1087,27 +1064,6 @@ static void LoadHacxDeh(void) } } -// Figure out what IWAD name to use for savegames. - -static char *SaveGameIWADName(void) -{ - // Chex quest hack - - if (gameversion == exe_chex) - { - return "chex.wad"; - } - - // Hacx hack - - if (gameversion == exe_hacx) - { - return "hacx.wad"; - } - - return D_SaveGameIWADName(gamemission); -} - // // D_DoomMain // @@ -1422,7 +1378,7 @@ void D_DoomMain (void) LoadChexDeh(); LoadHacxDeh(); D_SetGameDescription(); - savegamedir = M_GetSaveGameDir(SaveGameIWADName()); + savegamedir = M_GetSaveGameDir(D_SaveGameIWADName(gamemission)); // Check for -file in shareware if (modifiedgame) |