Make Freedoom its own mission pack and add "freedoom-all" autoloads. (#2184)

* Make the Freedoom IWADs their own mission pack and add support for the freedoom-all autoload directory.

* Add freedoom1-all and freedoom2-all directories.

* Space after comma.
This commit is contained in:
MelodicSpaceship 2025-02-06 04:46:30 -08:00 committed by GitHub
parent f91cec4e26
commit 1a8b2adbc0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 72 additions and 30 deletions

View File

@ -88,6 +88,12 @@ static const char *rekkr_skills[] =
"Scrapper", "Brawler", "Fighter", "Wrecker", "BERSERKER"
};
static const char *freedoom_skills[] =
{
"Please don't kill me!", "Will this hurt?", "Bring on the pain.",
"Extreme carnage.", "MAYHEM!",
};
static const char *gamemodes[] = { "Co-operative", "Deathmatch",
"Deathmatch 2.0", "Deathmatch 3.0" };
@ -292,6 +298,9 @@ static void UpdateSkillButton(void)
case pack_rekkr:
skillbutton->values = rekkr_skills;
break;
case pack_freedoom:
skillbutton->values = freedoom_skills;
break;
default:
skillbutton->values = doom_skills;
break;

View File

@ -28,26 +28,26 @@
#include "m_misc.h"
static const iwad_t iwads[] = {
{"doom2.wad", doom2, commercial, "DOOM II: Hell on Earth" },
{"plutonia.wad", pack_plut, commercial, "Final DOOM: Plutonia Experiment"},
{"tnt.wad", pack_tnt, commercial, "Final DOOM: TNT - Evilution" },
{"doom2.wad", doom2, commercial, "DOOM II: Hell on Earth" },
{"plutonia.wad", pack_plut, commercial, "Final DOOM: Plutonia Experiment"},
{"tnt.wad", pack_tnt, commercial, "Final DOOM: TNT - Evilution" },
// "doom.wad" may be retail or registered
{"doom.wad", doom, indetermined, "DOOM" },
{"doom.wad", doom, registered, "DOOM Registered" },
{"doom.wad", doom, retail, "The Ultimate DOOM" },
{"doom.wad", doom, indetermined, "DOOM" },
{"doom.wad", doom, registered, "DOOM Registered" },
{"doom.wad", doom, retail, "The Ultimate DOOM" },
// "doomu.wad" alias to allow retail wad to coexist with registered in the same folder
{"doomu.wad", doom, retail, "The Ultimate DOOM" },
{"doom1.wad", doom, shareware, "DOOM Shareware" },
{"doom2f.wad", doom2, commercial, "DOOM II: L'Enfer sur Terre" },
{"freedoom2.wad", doom2, commercial, "Freedoom: Phase 2" },
{"freedoom1.wad", doom, retail, "Freedoom: Phase 1" },
{"freedm.wad", doom2, commercial, "FreeDM" },
{"chex.wad", pack_chex, retail, "Chex Quest" },
{"chex3v.wad", pack_chex3v, retail, "Chex Quest 3: Vanilla Edition" },
{"chex3d2.wad", pack_chex3v, commercial, "Chex Quest 3: Modding Edition" },
{"hacx.wad", pack_hacx, commercial, "HACX: Twitch n' Kill" },
{"rekkrsa.wad", pack_rekkr, retail, "REKKR" },
{"rekkrsl.wad", pack_rekkr, retail, "REKKR: Sunken Land" },
{"doomu.wad", doom, retail, "The Ultimate DOOM" },
{"doom1.wad", doom, shareware, "DOOM Shareware" },
{"doom2f.wad", doom2, commercial, "DOOM II: L'Enfer sur Terre" },
{"freedoom2.wad", pack_freedoom, commercial, "Freedoom: Phase 2" },
{"freedoom1.wad", pack_freedoom, retail, "Freedoom: Phase 1" },
{"freedm.wad", pack_freedoom, commercial, "FreeDM" },
{"chex.wad", pack_chex, retail, "Chex Quest" },
{"chex3v.wad", pack_chex3v, retail, "Chex Quest 3: Vanilla Edition" },
{"chex3d2.wad", pack_chex3v, commercial, "Chex Quest 3: Modding Edition" },
{"hacx.wad", pack_hacx, commercial, "HACX: Twitch n' Kill" },
{"rekkrsa.wad", pack_rekkr, retail, "REKKR" },
{"rekkrsl.wad", pack_rekkr, retail, "REKKR: Sunken Land" },
};
static const char *const gamemode_str[] = {

View File

@ -1344,8 +1344,9 @@ static void AutoLoadWADs(const char *path)
static void LoadIWadBase(void)
{
GameMission_t local_gamemission =
D_GetGameMissionByIWADName(M_BaseName(wadfiles[0]));
GameMode_t local_gamemode;
GameMission_t local_gamemission;
D_GetModeAndMissionByIWADName(M_BaseName(wadfiles[0]), &local_gamemode, &local_gamemission);
if (local_gamemission < pack_chex)
{
@ -1360,13 +1361,26 @@ static void LoadIWadBase(void)
{
W_AddBaseDir("doom2-all");
}
else if (local_gamemission == pack_freedoom)
{
W_AddBaseDir("freedoom-all");
if (local_gamemode == commercial)
{
W_AddBaseDir("freedoom2-all");
}
else
{
W_AddBaseDir("freedoom1-all");
}
}
W_AddBaseDir(M_BaseName(wadfiles[0]));
}
static void AutoloadIWadDir(void (*AutoLoadFunc)(const char *path))
{
GameMission_t local_gamemission =
D_GetGameMissionByIWADName(M_BaseName(wadfiles[0]));
GameMode_t local_gamemode;
GameMission_t local_gamemission;
D_GetModeAndMissionByIWADName(M_BaseName(wadfiles[0]), &local_gamemode, &local_gamemission);
for (int i = 0; i < array_size(autoload_paths); ++i)
{
@ -1397,6 +1411,24 @@ static void AutoloadIWadDir(void (*AutoLoadFunc)(const char *path))
AutoLoadFunc(dir);
free(dir);
}
else if (local_gamemission == pack_freedoom)
{
dir = GetAutoloadDir(autoload_paths[i], "freedoom-all", true);
AutoLoadFunc(dir);
free(dir);
if (local_gamemode == commercial)
{
dir = GetAutoloadDir(autoload_paths[i], "freedoom2-all", true);
AutoLoadFunc(dir);
free(dir);
}
else
{
dir = GetAutoloadDir(autoload_paths[i], "freedoom1-all", true);
AutoLoadFunc(dir);
free(dir);
}
}
}
// auto-loaded files per IWAD

View File

@ -33,14 +33,15 @@ typedef enum {
// Mission packs - might be useful for TC stuff?
typedef enum {
doom, // DOOM 1
doom2, // DOOM 2
pack_tnt, // TNT mission pack
pack_plut, // Plutonia pack
pack_chex, // Chex Quest
pack_hacx, // Hacx
pack_rekkr, // Rekkr
pack_chex3v, // Chex Quest 3: Vanilla Edition
doom, // DOOM 1
doom2, // DOOM 2
pack_tnt, // TNT mission pack
pack_plut, // Plutonia pack
pack_chex, // Chex Quest
pack_hacx, // Hacx
pack_rekkr, // Rekkr
pack_chex3v, // Chex Quest 3: Vanilla Edition
pack_freedoom, // Freedoom
none
} GameMission_t;