diff --git a/src/c_cmds.c b/src/c_cmds.c index b86cc4aa85..c35dc3aaaf 100644 --- a/src/c_cmds.c +++ b/src/c_cmds.c @@ -4020,7 +4020,7 @@ static bool map_cmd_func1(char *cmd, char *parms) M_StringCopy(wadname, leafname(lumpinfo[i]->wadfile->path), sizeof(wadname)); replaced = (W_CheckMultipleLumps(mapcmdlump) > 1 && !chex && !FREEDOOM); pwad = (lumpinfo[i]->wadfile->type == PWAD); - M_StringCopy(mapinfoname, P_GetMapName((mapcmdepisode - 1) * 10 + mapcmdmap), sizeof(mapinfoname)); + M_StringCopy(mapinfoname, P_GetMapName(mapcmdepisode, mapcmdmap), sizeof(mapinfoname)); switch (gamemission) { @@ -4237,7 +4237,7 @@ static void maplist_cmd_func2(char *cmd, char *parms) M_StringCopy(wadname, leafname(lumpinfo[i]->wadfile->path), sizeof(wadname)); replaced = (W_CheckMultipleLumps(lump) > 1 && !chex && !FREEDOOM); pwad = (lumpinfo[i]->wadfile->type == PWAD); - M_StringCopy(mapinfoname, P_GetMapName(--ep * 10 + (--map) + 1), sizeof(mapinfoname)); + M_StringCopy(mapinfoname, P_GetMapName(--ep, --map), sizeof(mapinfoname)); switch (gamemission) { @@ -4591,13 +4591,12 @@ static void mapstats_cmd_func2(char *cmd, char *parms) /* 59 */ { JR, "", "", "", "" } }; - const int i = (gamemission == doom ? gameepisode * 10 : 0) + gamemap; - const char *author = P_GetMapAuthor(i); + const char *author = P_GetMapAuthor(gameepisode, gamemap); if (*author) C_TabbedOutput(tabs, "Author\t%s", author); - else if (canmodify && *authors[i][gamemission]) - C_TabbedOutput(tabs, "Author\t%s", authors[i][gamemission]); + else if (canmodify && *authors[gameepisode][gamemission]) + C_TabbedOutput(tabs, "Author\t%s", authors[gameepisode][gamemission]); else if (REKKR) C_TabbedOutput(tabs, "Author\tMatthew Little"); } @@ -4859,8 +4858,8 @@ static void mapstats_cmd_func2(char *cmd, char *parms) { int lumps; char namebuf[9]; - const char *musicartist = P_GetMapMusicComposer((gameepisode - 1) * 10 + gamemap); - const char *musictitle = P_GetMapMusicTitle((gameepisode - 1) * 10 + gamemap); + const char *musicartist = P_GetMapMusicComposer(gameepisode, gamemap); + const char *musictitle = P_GetMapMusicTitle(gameepisode, gamemap); const Mix_MusicType musictype = Mix_GetMusicType(NULL); temp = uppercase(mus_playing->name1); diff --git a/src/f_finale.c b/src/f_finale.c index 5cff11630c..6cc21e4bb1 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -107,8 +107,8 @@ static void F_ConsoleFinaleText(void) // void F_StartFinale(void) { - char *intertext = P_GetInterText(gamemap); - char *intersecret = P_GetInterSecretText(gamemap); + char *intertext = P_GetInterText(gameepisode, gamemap); + char *intersecret = P_GetInterSecretText(gameepisode, gamemap); viewactive = false; automapactive = false; @@ -121,8 +121,8 @@ void F_StartFinale(void) if (*intertext || (*intersecret && secretexit)) { - char *interbackdrop = P_GetInterBackrop(gamemap); - int mus = P_GetInterMusic(gamemap); + char *interbackdrop = P_GetInterBackrop(gameepisode, gamemap); + int mus = P_GetInterMusic(gameepisode, gamemap); if (!secretexit) { @@ -152,7 +152,7 @@ void F_StartFinale(void) else S_ChangeMusic((gamemode == commercial ? mus_read_m : mus_victor), true, false, false); } - else if (P_GetMapEndCast(gamemap)) + else if (P_GetMapEndCast(gameepisode, gamemap)) { gameaction = ga_nothing; gamestate = GS_FINALE; @@ -307,16 +307,16 @@ void F_Ticker(void) if (finalecount > FixedMul((fixed_t)strlen(finaletext) * FRACUNIT, TextSpeed()) + (midstage ? NEWTEXTWAIT : TEXTWAIT) || (midstage && acceleratestage)) { - if (P_GetMapEndCast(gamemap)) + if (P_GetMapEndCast(gameepisode, gamemap)) F_StartCast(); - else if (P_GetMapEndBunny(gamemap)) + else if (P_GetMapEndBunny(gameepisode, gamemap)) { finalecount = 0; finalestage = F_STAGE_ARTSCREEN; wipegamestate = GS_NONE; S_StartMusic(mus_bunny); } - else if (P_GetMapEndGame(gamemap)) + else if (P_GetMapEndGame(gameepisode, gamemap)) { finalecount = 0; finalestage = F_STAGE_ARTSCREEN; @@ -988,7 +988,7 @@ static void F_BunnyScroll(void) // static void F_ArtScreenDrawer(void) { - const int lumpnum = P_GetMapEndPic(gamemap); + const int lumpnum = P_GetMapEndPic(gameepisode, gamemap); if (lumpnum > 0) { @@ -997,7 +997,7 @@ static void F_ArtScreenDrawer(void) else V_DrawPatch(0, 0, 0, W_CacheLumpNum(lumpnum)); } - else if (P_GetMapEndBunny(gamemap) || gameepisode == 3) + else if (P_GetMapEndBunny(gameepisode, gamemap) || gameepisode == 3) F_BunnyScroll(); else { diff --git a/src/g_game.c b/src/g_game.c index 8048485b24..20ffc889da 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -579,9 +579,8 @@ static void G_ResetPlayer(void) // void G_DoLoadLevel(void) { - int ep; - const int map = (gameepisode - 1) * 10 + gamemap; - bool resetplayer; + int ep; + bool resetplayer; HU_DrawDisk(); @@ -622,8 +621,10 @@ void G_DoLoadLevel(void) freeze = false; + ep = (gamemode == commercial ? (gamemission == pack_nerve ? 2 : 1) : gameepisode); + // [BH] Reset player's health, armor, weapons and ammo on pistol start - if ((resetplayer = (pistolstart || P_GetMapPistolStart(map)))) + if ((resetplayer = (pistolstart || P_GetMapPistolStart(ep, gamemap)))) G_ResetPlayer(); if (viewplayer->cheats & CF_CHOPPERS) @@ -653,13 +654,12 @@ void G_DoLoadLevel(void) // died. P_FreeSecNodeList(); - ep = (gamemode == commercial ? (gamemission == pack_nerve ? 2 : 1) : gameepisode); P_MapName(ep, gamemap); P_SetupLevel(ep, gamemap); // [BH] Reset player's health, armor, weapons and ammo on pistol start - if (resetplayer && map != 1) + if (resetplayer && gamemap != 1) { if (M_StringCompare(playername, playername_default)) C_Warning(0, "You now have 100%% health, no armor, and only a pistol with 50 bullets."); @@ -1253,7 +1253,7 @@ void G_SecretExitLevel(void) int G_GetParTime(void) { - const int par = P_GetMapPar((gameepisode - 1) * 10 + gamemap); + const int par = P_GetMapPar(gameepisode, gamemap); if (par) return par; @@ -1278,9 +1278,8 @@ int G_GetParTime(void) static void G_DoCompleted(void) { - const int map = (gameepisode - 1) * 10 + gamemap; - const int nextmap = P_GetMapNext(map); - const int secretnextmap = P_GetMapSecretNext(map); + const int nextmap = P_GetMapNext(gameepisode, gamemap); + const int secretnextmap = P_GetMapSecretNext(gameepisode, gamemap); P_LookForFriends(); @@ -1448,8 +1447,8 @@ static void G_DoCompleted(void) // void G_WorldDone(void) { - const char *intertext = P_GetInterText(gamemap); - const char *intersecrettext = P_GetInterSecretText(gamemap); + const char *intertext = P_GetInterText(gameepisode, gamemap); + const char *intersecrettext = P_GetInterSecretText(gameepisode, gamemap); gameaction = ga_worlddone; @@ -1462,7 +1461,7 @@ void G_WorldDone(void) return; } - if (P_GetMapEndCast(gamemap)) + if (P_GetMapEndCast(gameepisode, gamemap)) { F_StartFinale(); return; diff --git a/src/p_enemy.c b/src/p_enemy.c index 792d0d8bbe..496bf60269 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -1958,9 +1958,8 @@ void A_Explode(mobj_t *actor, player_t *player, pspdef_t *psp) // void A_BossDeath(mobj_t *actor, player_t *player, pspdef_t *psp) { - line_t junk = { 0 }; - const int map = (gameepisode - 1) * 10 + gamemap; - int numbossactions = P_GetNumBossActions(map); + line_t junk = { 0 }; + int numbossactions = P_GetNumBossActions(gameepisode, gamemap); // numbossactions == 0 means to use the defaults. // numbossactions == -1 means to do nothing. @@ -1976,7 +1975,7 @@ void A_BossDeath(mobj_t *actor, player_t *player, pspdef_t *psp) return; // no one left alive, so do not end game for (i = 0; i < numbossactions; i++) - if (P_GetBossAction(map, i)->type == actor->type) + if (P_GetBossAction(gameepisode, gamemap, i)->type == actor->type) break; if (i >= numbossactions) @@ -1994,7 +1993,7 @@ void A_BossDeath(mobj_t *actor, player_t *player, pspdef_t *psp) for (i = 0; i < numbossactions; i++) { - bossaction_t *bossaction = P_GetBossAction(map, i); + bossaction_t *bossaction = P_GetBossAction(gameepisode, gamemap, i); if (bossaction->type == actor->type) { diff --git a/src/p_map.c b/src/p_map.c index d890f8db5b..500b613e70 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -219,7 +219,7 @@ bool P_TeleportMove(mobj_t *thing, const fixed_t x, const fixed_t y, const fixed const sector_t *newsec; const fixed_t radius = thing->radius; - telefrag = (thing->player || boss || P_GetAllowMonsterTelefrags((gameepisode - 1) * 10 + gamemap)); + telefrag = (thing->player || boss || P_GetAllowMonsterTelefrags(gameepisode, gamemap)); // kill anything occupying the position tmthing = thing; diff --git a/src/p_setup.c b/src/p_setup.c index 0f109c95ee..aa5295608b 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -239,7 +239,7 @@ bool skipblstart; // MaxW: Skip initial blocklist shor static int rejectlump = -1; // cph - store reject lump num if cached const byte *rejectmatrix; // cph - const* -static mapinfo_t mapinfo[MAXMAPINFO]; +static mapinfo_t mapinfo[10][100]; static char *mapcmdnames[] = { @@ -2855,7 +2855,7 @@ char automaptitle[512]; void P_MapName(int ep, int map) { bool mapnumonly = false; - const char *mapinfoname = trimwhitespace(P_GetMapName((ep - 1) * 10 + map)); + const char *mapinfoname = trimwhitespace(P_GetMapName(ep, map)); switch (gamemission) { @@ -3264,10 +3264,8 @@ void P_SetupLevel(int ep, int map) massacre = false; - map = (ep - 1) * 10 + map; - - P_GetMapLiquids(map); - P_GetMapNoLiquids(map); + P_GetMapLiquids(ep, map); + P_GetMapNoLiquids(ep, map); P_SetLiquids(); P_LoadThings(map, lumpnum + ML_THINGS); @@ -3293,15 +3291,15 @@ void P_SetupLevel(int ep, int map) if (gamemode != shareware) S_ParseMusInfo(lumpname); - compat_corpsegibs = (compat_corpsegibs_global != -1 ? compat_corpsegibs_global : mapinfo[map].compat_corpsegibs); - compat_floormove = (compat_floormove_global != -1 ? compat_floormove_global : mapinfo[map].compat_floormove); - compat_light = (compat_light_global != -1 ? compat_light_global : mapinfo[map].compat_light); - compat_limitpain = (compat_limitpain_global != -1 ? compat_limitpain_global : mapinfo[map].compat_limitpain); - compat_nopassover = (compat_nopassover_global != -1 ? compat_nopassover_global : mapinfo[map].compat_nopassover); - compat_stairs = (compat_stairs_global != -1 ? compat_stairs_global : mapinfo[map].compat_stairs); - compat_useblocking = (compat_useblocking_global != -1 ? compat_useblocking_global : mapinfo[map].compat_useblocking); - compat_zombie = (compat_zombie_global != -1 ? compat_zombie_global : mapinfo[map].compat_zombie); - nograduallighting = (nograduallighting_global != -1 ? nograduallighting_global : mapinfo[map].nograduallighting); + compat_corpsegibs = (compat_corpsegibs_global != -1 ? compat_corpsegibs_global : mapinfo[ep][map].compat_corpsegibs); + compat_floormove = (compat_floormove_global != -1 ? compat_floormove_global : mapinfo[ep][map].compat_floormove); + compat_light = (compat_light_global != -1 ? compat_light_global : mapinfo[ep][map].compat_light); + compat_limitpain = (compat_limitpain_global != -1 ? compat_limitpain_global : mapinfo[ep][map].compat_limitpain); + compat_nopassover = (compat_nopassover_global != -1 ? compat_nopassover_global : mapinfo[ep][map].compat_nopassover); + compat_stairs = (compat_stairs_global != -1 ? compat_stairs_global : mapinfo[ep][map].compat_stairs); + compat_useblocking = (compat_useblocking_global != -1 ? compat_useblocking_global : mapinfo[ep][map].compat_useblocking); + compat_zombie = (compat_zombie_global != -1 ? compat_zombie_global : mapinfo[ep][map].compat_zombie); + nograduallighting = (nograduallighting_global != -1 ? nograduallighting_global : mapinfo[ep][map].nograduallighting); } static int liquidlumps; @@ -3309,41 +3307,42 @@ static int noliquidlumps; static void P_InitMapInfo(void) { - for (int i = 0; i < MAXMAPINFO; i++) - { - mapinfo[i].author[0] = '\0'; - mapinfo[i].endbunny = false; - mapinfo[i].endcast = false; - mapinfo[i].endgame = false; - mapinfo[i].endpic = 0; - mapinfo[i].enterpic = 0; - mapinfo[i].exitpic = 0; - mapinfo[i].cluster = 0; - mapinfo[i].interbackdrop[0] = '\0'; - mapinfo[i].intermusic = 0; - mapinfo[i].intertext[0] = '\0'; - mapinfo[i].intertextsecret[0] = '\0'; - - for (int j = 0; j < NUMLIQUIDS; j++) + for (int i = 0; i < 10; i++) + for (int j = 0; j < 100; j++) { - mapinfo[i].liquid[j] = -1; - mapinfo[i].noliquid[j] = -1; - } + mapinfo[i][j].author[0] = '\0'; + mapinfo[i][j].endbunny = false; + mapinfo[i][j].endcast = false; + mapinfo[i][j].endgame = false; + mapinfo[i][j].endpic = 0; + mapinfo[i][j].enterpic = 0; + mapinfo[i][j].exitpic = 0; + mapinfo[i][j].cluster = 0; + mapinfo[i][j].interbackdrop[0] = '\0'; + mapinfo[i][j].intermusic = 0; + mapinfo[i][j].intertext[0] = '\0'; + mapinfo[i][j].intertextsecret[0] = '\0'; + + for (int k = 0; k < NUMLIQUIDS; k++) + { + mapinfo[i][j].liquid[k] = -1; + mapinfo[i][j].noliquid[k] = -1; + } - mapinfo[i].music = 0; - mapinfo[i].musicartist[0] = '\0'; - mapinfo[i].musictitle[0] = '\0'; - mapinfo[i].name[0] = '\0'; - mapinfo[i].next = 0; - mapinfo[i].nojump = false; - mapinfo[i].nomouselook = false; - mapinfo[i].par = 0; - mapinfo[i].pistolstart = false; - mapinfo[i].secretnext = 0; - mapinfo[i].sky1texture = 0; - mapinfo[i].sky1scrolldelta = 0; - mapinfo[i].titlepatch = 0; - } + mapinfo[i][j].music = 0; + mapinfo[i][j].musicartist[0] = '\0'; + mapinfo[i][j].musictitle[0] = '\0'; + mapinfo[i][j].name[0] = '\0'; + mapinfo[i][j].next = 0; + mapinfo[i][j].nojump = false; + mapinfo[i][j].nomouselook = false; + mapinfo[i][j].par = 0; + mapinfo[i][j].pistolstart = false; + mapinfo[i][j].secretnext = 0; + mapinfo[i][j].sky1texture = 0; + mapinfo[i][j].sky1scrolldelta = 0; + mapinfo[i][j].titlepatch = 0; + } } static void P_ParseMapString(const char *string, int *map, int *ep) @@ -3514,7 +3513,7 @@ static bool P_ParseMapInfo(const char *scriptname) } } - info = &mapinfo[map]; + info = &mapinfo[ep][map]; if (SC_GetString() && !SC_Compare("LOOKUP")) M_StringCopy(info->name, sc_String, sizeof(info->name)); @@ -4058,143 +4057,143 @@ static bool P_ParseMapInfo(const char *scriptname) return true; } -char *P_GetMapAuthor(const int map) +char *P_GetMapAuthor(const int ep, const int map) { - return (MAPINFO >= 0 && mapinfo[map].author[0] ? mapinfo[map].author : (((E1M4B || *speciallumpname) && map == 4) + return (MAPINFO >= 0 && mapinfo[ep][map].author[0] ? mapinfo[ep][map].author : (((E1M4B || *speciallumpname) && map == 4) || ((E1M8B || *speciallumpname) && map == 8) || (onehumanity && map == 1) ? s_AUTHOR_ROMERO : "")); } -int P_GetNumBossActions(const int map) +int P_GetNumBossActions(const int ep, const int map) { - return mapinfo[map].numbossactions; + return mapinfo[ep][map].numbossactions; } -bossaction_t *P_GetBossAction(const int map, const int i) +bossaction_t *P_GetBossAction(const int ep, const int map, const int i) { - return &mapinfo[map].bossactions[i]; + return &mapinfo[ep][map].bossactions[i]; } -char *P_GetInterBackrop(const int map) +char *P_GetInterBackrop(const int ep, const int map) { - return mapinfo[map].interbackdrop; + return mapinfo[ep][map].interbackdrop; } -int P_GetInterMusic(const int map) +int P_GetInterMusic(const int ep, const int map) { - return mapinfo[map].intermusic; + return mapinfo[ep][map].intermusic; } -char *P_GetInterText(const int map) +char *P_GetInterText(const int ep, const int map) { - return mapinfo[map].intertext; + return mapinfo[ep][map].intertext; } -char *P_GetInterSecretText(const int map) +char *P_GetInterSecretText(const int ep, const int map) { - return mapinfo[map].intertextsecret; + return mapinfo[ep][map].intertextsecret; } -bool P_GetMapEndBunny(const int map) +bool P_GetMapEndBunny(const int ep, const int map) { - return mapinfo[map].endbunny; + return mapinfo[ep][map].endbunny; } -bool P_GetMapEndCast(const int map) +bool P_GetMapEndCast(const int ep, const int map) { - return mapinfo[map].endcast; + return mapinfo[ep][map].endcast; } -bool P_GetMapEndGame(const int map) +bool P_GetMapEndGame(const int ep, const int map) { - return mapinfo[map].endgame; + return mapinfo[ep][map].endgame; } -int P_GetMapEndPic(const int map) +int P_GetMapEndPic(const int ep, const int map) { - return mapinfo[map].endpic; + return mapinfo[ep][map].endpic; } -int P_GetMapEnterPic(const int map) +int P_GetMapEnterPic(const int ep, const int map) { - return mapinfo[map].enterpic; + return mapinfo[ep][map].enterpic; } -int P_GetMapExitPic(const int map) +int P_GetMapExitPic(const int ep, const int map) { - return mapinfo[map].exitpic; + return mapinfo[ep][map].exitpic; } -void P_GetMapLiquids(const int map) +void P_GetMapLiquids(const int ep, const int map) { for (int i = 0; i < liquidlumps; i++) - terraintypes[mapinfo[map].liquid[i]] = LIQUID; + terraintypes[mapinfo[ep][map].liquid[i]] = LIQUID; } -int P_GetMapMusic(const int map) +int P_GetMapMusic(const int ep, const int map) { - return mapinfo[map].music; + return mapinfo[ep][map].music; } -char *P_GetMapMusicComposer(const int map) +char *P_GetMapMusicComposer(const int ep, const int map) { - return mapinfo[map].musicartist; + return mapinfo[ep][map].musicartist; } -char *P_GetMapMusicTitle(const int map) +char *P_GetMapMusicTitle(const int ep, const int map) { - return mapinfo[map].musictitle; + return mapinfo[ep][map].musictitle; } -char *P_GetMapName(const int map) +char *P_GetMapName(const int ep, const int map) { - return (MAPINFO >= 0 && !sigil ? mapinfo[map].name : ((E1M4B || *speciallumpname) && map == 4 ? s_HUSTR_E1M4B : + return (MAPINFO >= 0 && !sigil ? mapinfo[ep][map].name : ((E1M4B || *speciallumpname) && map == 4 ? s_HUSTR_E1M4B : ((E1M8B || *speciallumpname) && map == 8 ? s_HUSTR_E1M8B : ""))); } -int P_GetMapNext(const int map) +int P_GetMapNext(const int ep, const int map) { - return mapinfo[map].next; + return mapinfo[ep][map].next; } -void P_GetMapNoLiquids(const int map) +void P_GetMapNoLiquids(const int ep, const int map) { for (int i = 0; i < noliquidlumps; i++) - terraintypes[mapinfo[map].noliquid[i]] = SOLID; + terraintypes[mapinfo[ep][map].noliquid[i]] = SOLID; } -int P_GetMapPar(const int map) +int P_GetMapPar(const int ep, const int map) { - return mapinfo[map].par; + return mapinfo[ep][map].par; } -bool P_GetMapPistolStart(const int map) +bool P_GetMapPistolStart(const int ep, const int map) { - return mapinfo[map].pistolstart; + return mapinfo[ep][map].pistolstart; } -int P_GetMapSecretNext(const int map) +int P_GetMapSecretNext(const int ep, const int map) { - return mapinfo[map].secretnext; + return mapinfo[ep][map].secretnext; } -int P_GetMapSky1Texture(const int map) +int P_GetMapSky1Texture(const int ep, const int map) { - return mapinfo[map].sky1texture; + return mapinfo[ep][map].sky1texture; } -int P_GetMapSky1ScrollDelta(const int map) +int P_GetMapSky1ScrollDelta(const int ep, const int map) { - return mapinfo[map].sky1scrolldelta; + return mapinfo[ep][map].sky1scrolldelta; } -int P_GetMapTitlePatch(const int map) +int P_GetMapTitlePatch(const int ep, const int map) { - return mapinfo[map].titlepatch; + return mapinfo[ep][map].titlepatch; } -int P_GetAllowMonsterTelefrags(int map) +int P_GetAllowMonsterTelefrags(const int ep, const int map) { - return mapinfo[map].allowmonstertelefrags; + return mapinfo[ep][map].allowmonstertelefrags; } // diff --git a/src/p_setup.h b/src/p_setup.h index 6b8a8f9c64..f1000218fe 100644 --- a/src/p_setup.h +++ b/src/p_setup.h @@ -71,30 +71,30 @@ void P_MapName(int ep, int map); // Called by startup code. void P_Init(void); -char *P_GetMapAuthor(const int map); -int P_GetNumBossActions(const int map); -bossaction_t *P_GetBossAction(const int map, const int i); -char *P_GetInterBackrop(const int map); -int P_GetInterMusic(const int map); -char *P_GetInterText(const int map); -char *P_GetInterSecretText(const int map); -bool P_GetMapEndBunny(const int map); -bool P_GetMapEndCast(const int map); -bool P_GetMapEndGame(const int map); -int P_GetMapEndPic(const int map); -int P_GetMapEnterPic(const int map); -int P_GetMapExitPic(const int map); -void P_GetMapLiquids(const int map); -int P_GetMapMusic(const int map); -char *P_GetMapMusicComposer(const int map); -char *P_GetMapMusicTitle(const int map); -char *P_GetMapName(const int map); -int P_GetMapNext(const int map); -void P_GetMapNoLiquids(const int map); -int P_GetMapPar(const int map); -bool P_GetMapPistolStart(const int map); -int P_GetMapSecretNext(const int map); -int P_GetMapSky1Texture(const int map); -int P_GetMapSky1ScrollDelta(const int map); -int P_GetMapTitlePatch(const int map); -int P_GetAllowMonsterTelefrags(int map); +char *P_GetMapAuthor(const int ep, const int map); +int P_GetNumBossActions(const int ep, const int map); +bossaction_t *P_GetBossAction(const int ep, const int map, const int i); +char *P_GetInterBackrop(const int ep, const int map); +int P_GetInterMusic(const int ep, const int map); +char *P_GetInterText(const int ep, const int map); +char *P_GetInterSecretText(const int ep, const int map); +bool P_GetMapEndBunny(const int ep, const int map); +bool P_GetMapEndCast(const int ep, const int map); +bool P_GetMapEndGame(const int ep, const int map); +int P_GetMapEndPic(const int ep, const int map); +int P_GetMapEnterPic(const int ep, const int map); +int P_GetMapExitPic(const int ep, const int map); +void P_GetMapLiquids(const int ep, const int map); +int P_GetMapMusic(const int ep, const int map); +char *P_GetMapMusicComposer(const int ep, const int map); +char *P_GetMapMusicTitle(const int ep, const int map); +char *P_GetMapName(const int ep, const int map); +int P_GetMapNext(const int ep, const int map); +void P_GetMapNoLiquids(const int ep, const int map); +int P_GetMapPar(const int ep, const int map); +bool P_GetMapPistolStart(const int ep, const int map); +int P_GetMapSecretNext(const int ep, const int map); +int P_GetMapSky1Texture(const int ep, const int map); +int P_GetMapSky1ScrollDelta(const int ep, const int map); +int P_GetMapTitlePatch(const int ep, const int map); +int P_GetAllowMonsterTelefrags(const int ep, const int map); diff --git a/src/r_sky.c b/src/r_sky.c index bbb8905741..401afacbf3 100644 --- a/src/r_sky.c +++ b/src/r_sky.c @@ -54,11 +54,9 @@ bool canmouselook = false; void R_InitSkyMap(void) { - const int map = (gameepisode - 1) * 10 + gamemap; - skyflatnum = R_FlatNumForName(SKYFLATNAME); terraintypes[skyflatnum] = SKY; - skytexture = P_GetMapSky1Texture(map); + skytexture = P_GetMapSky1Texture(gameepisode, gamemap); canmouselook = ((mouselook || keyboardmouselook || mousemouselook != -1 || autotilt || (weaponrecoil && r_screensize == r_screensize_max)) && !nomouselook); @@ -111,7 +109,7 @@ void R_InitSkyMap(void) } } - skyscrolldelta = P_GetMapSky1ScrollDelta(map); + skyscrolldelta = P_GetMapSky1ScrollDelta(gameepisode, gamemap); if (canmouselook) { diff --git a/src/s_sound.c b/src/s_sound.c index c1262c4c05..cce1486ae4 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -608,7 +608,7 @@ void S_ChangeMusic(musicnum_t musicnum, bool looping, bool allowrestart, bool ma else music->lumpnum = W_CheckNumForName(namebuf); } - else if (mapstart && (mapinfomusic = P_GetMapMusic((gameepisode - 1) * 10 + gamemap)) > 0) + else if (mapstart && (mapinfomusic = P_GetMapMusic(gameepisode, gamemap)) > 0) music->lumpnum = mapinfomusic; else if (!music->lumpnum) music->lumpnum = W_CheckNumForName(namebuf); diff --git a/src/wi_stuff.c b/src/wi_stuff.c index 3deda25825..1c5b923c93 100644 --- a/src/wi_stuff.c +++ b/src/wi_stuff.c @@ -368,7 +368,7 @@ static void WI_DrawLF(void) { const int x = (VANILLAWIDTH - SHORT(finished->width)) / 2; int y = WI_TITLEY; - const int titlepatch = P_GetMapTitlePatch(wbs->epsd * 10 + wbs->last + 1); + const int titlepatch = P_GetMapTitlePatch(wbs->epsd, wbs->last + 1); // draw if (titlepatch > 0) @@ -426,7 +426,7 @@ static void WI_DrawEL(void) { const int x = (VANILLAWIDTH - SHORT(entering->width)) / 2; int y = WI_TITLEY; - const int titlepatch = P_GetMapTitlePatch(wbs->epsd * 10 + wbs->next + 1); + const int titlepatch = P_GetMapTitlePatch(wbs->epsd, wbs->next + 1); // draw "Entering" if (SHORT(entering->height) < VANILLAHEIGHT) @@ -735,7 +735,7 @@ static void WI_UpdateShowNextLoc(void) static void WI_DrawShowNextLoc(void) { - if (P_GetMapEndGame(gamemap) || P_GetMapEndCast(gamemap)) + if (P_GetMapEndGame(gameepisode, gamemap) || P_GetMapEndCast(gameepisode, gamemap)) return; WI_SlamBackground(); @@ -1268,8 +1268,8 @@ static void WI_InitVariables(wbstartstruct_t *wbstartstruct) wbs = wbstartstruct; - enterpic = P_GetMapEnterPic(wbs->next + 1); - exitpic = P_GetMapExitPic(gamemap); + enterpic = P_GetMapEnterPic(wbs->epsd, wbs->next + 1); + exitpic = P_GetMapExitPic(gameepisode, gamemap); acceleratestage = false; cnt = 0;