From 14ce530e8933d937d660f14bb213b3396be2a4b3 Mon Sep 17 00:00:00 2001 From: Pedro Beirao Date: Thu, 14 Nov 2024 00:21:47 +0000 Subject: [PATCH 01/13] Heretic umapinfo: levelname --- prboom2/src/dsda/mapinfo/u.c | 2 +- prboom2/src/heretic/in_lude.c | 10 +++++++++- prboom2/src/umapinfo.cpp | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/prboom2/src/dsda/mapinfo/u.c b/prboom2/src/dsda/mapinfo/u.c index 466d746dd..e9f4c7e43 100644 --- a/prboom2/src/dsda/mapinfo/u.c +++ b/prboom2/src/dsda/mapinfo/u.c @@ -499,7 +499,7 @@ int dsda_UPrepareFinale(int* result) { void dsda_ULoadMapInfo(void) { int p; - if (dsda_Flag(dsda_arg_nomapinfo) || dsda_UseMapinfo() || raven) + if (dsda_Flag(dsda_arg_nomapinfo) || dsda_UseMapinfo() || hexen) return; p = -1; diff --git a/prboom2/src/heretic/in_lude.c b/prboom2/src/heretic/in_lude.c index f6369dba4..cf053c686 100644 --- a/prboom2/src/heretic/in_lude.c +++ b/prboom2/src/heretic/in_lude.c @@ -34,6 +34,7 @@ #include "g_game.h" #include "dsda/exhud.h" +#include "dsda/mapinfo.h" #include "heretic/def.h" #include "heretic/dstrings.h" @@ -153,6 +154,9 @@ static yahpt_t YAHspot[3][9] = { static const char *NameForMap(int map) { + extern const char *lf_levelname; + if (lf_levelname) return lf_levelname; + const char *name = LevelNames[(gameepisode - 1) * 9 + map - 1]; if (strlen(name) < 7) @@ -527,6 +531,7 @@ void IN_Drawer(void) { case -1: case 0: // draw stats + dsda_PrepareFinished(); IN_DrawStatBack(); switch (gametype) { @@ -669,7 +674,7 @@ void IN_DrawYAH(void) void IN_DrawSingleStats(void) { const char *prev_level_name = NameForMap(prevmap); - const char *next_level_name = NameForMap(nextmap); + int x; static int sounds; @@ -758,6 +763,8 @@ void IN_DrawSingleStats(void) IN_DrTextB("TOTAL", 85, 140); IN_DrawTime(155, 140, totalHours, totalMinutes, totalSeconds); + const char *next_level_name = NameForMap(nextmap); + x = 160 - MN_TextAWidth("NOW ENTERING:") / 2; MN_DrTextA("NOW ENTERING:", x, 160); x = 160 - MN_TextBWidth(next_level_name) / 2; @@ -1057,6 +1064,7 @@ void IN_DrTextB(const char *text, int x, int y) } else { + if (c > 90) c -= 32; int lump = FontBLump + c - 33; V_DrawShadowedNumPatch(x, y, lump); x += R_NumPatchWidth(lump) - 1; diff --git a/prboom2/src/umapinfo.cpp b/prboom2/src/umapinfo.cpp index 6f6546bac..a4410926c 100644 --- a/prboom2/src/umapinfo.cpp +++ b/prboom2/src/umapinfo.cpp @@ -305,7 +305,7 @@ static int ParseStandardProperty(Scanner &scanner, MapEntry *mape) if (alttext) Z_Free(alttext); } } - else if (!stricmp(pname, "bossaction")) + else if (!stricmp(pname, "bossaction") && !raven) { scanner.MustGetToken(TK_Identifier); int special, tag; From 1cd07b4cd480c66d050c9034ddb22e9b9a18e399 Mon Sep 17 00:00:00 2001 From: Pedro Beirao Date: Thu, 14 Nov 2024 01:29:22 +0000 Subject: [PATCH 02/13] Heretic umapinfo: author --- prboom2/src/heretic/in_lude.c | 51 ++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 19 deletions(-) diff --git a/prboom2/src/heretic/in_lude.c b/prboom2/src/heretic/in_lude.c index cf053c686..84b9cd7d0 100644 --- a/prboom2/src/heretic/in_lude.c +++ b/prboom2/src/heretic/in_lude.c @@ -34,6 +34,7 @@ #include "g_game.h" #include "dsda/exhud.h" +#include "dsda/font.h" #include "dsda/mapinfo.h" #include "heretic/def.h" @@ -673,26 +674,38 @@ void IN_DrawYAH(void) void IN_DrawSingleStats(void) { + extern const char *lf_author; + const char *prev_level_name = NameForMap(prevmap); int x; static int sounds; // [crispy] offset the stats for Ep.4 and up, to make room for level time - int yoffset = 0; - if (gamemode == retail && gameepisode > 3) + int yoffset = 3; + + x = 160 - MN_TextBWidth(prev_level_name) / 2; + IN_DrTextB(prev_level_name, x, yoffset); + yoffset += 20; + + if (lf_author) { - yoffset = 20; + x = 160 - MN_TextAWidth(lf_author) / 2; + MN_DrTextA(lf_author, x, yoffset); + yoffset += (5 * hud_font.height / 4); } - IN_DrTextB("KILLS", 50, 65 - yoffset); - IN_DrTextB("ITEMS", 50, 90 - yoffset); - IN_DrTextB("SECRETS", 50, 115 - yoffset); - - x = 160 - MN_TextBWidth(prev_level_name) / 2; - IN_DrTextB(prev_level_name, x, 3); x = 160 - MN_TextAWidth("FINISHED") / 2; - MN_DrTextA("FINISHED", x, 25); + MN_DrTextA("FINISHED", x, yoffset); + + if (gamemode == retail && gameepisode > 3) + { + yoffset += 20; + } + + IN_DrTextB("KILLS", 50, yoffset + 25); + IN_DrTextB("ITEMS", 50, yoffset + 50); + IN_DrTextB("SECRETS", 50, yoffset + 75); dsda_DrawExIntermission(); @@ -706,9 +719,9 @@ void IN_DrawSingleStats(void) S_StartVoidSound(heretic_sfx_dorcls); sounds++; } - IN_DrawNumber(players[consoleplayer].killcount, 200, 65 - yoffset, 3); - V_DrawShadowedNamePatch(237, 65 - yoffset, "FONTB15"); - IN_DrawNumber(totalkills, 248, 65 - yoffset, 3); + IN_DrawNumber(players[consoleplayer].killcount, 200, yoffset + 25, 3); + V_DrawShadowedNamePatch(237, yoffset + 25, "FONTB15"); + IN_DrawNumber(totalkills, 248, yoffset + 25, 3); if (intertime < 60) { return; @@ -718,9 +731,9 @@ void IN_DrawSingleStats(void) S_StartVoidSound(heretic_sfx_dorcls); sounds++; } - IN_DrawNumber(players[consoleplayer].itemcount, 200, 90 - yoffset, 3); - V_DrawShadowedNamePatch(237, 90 - yoffset, "FONTB15"); - IN_DrawNumber(totalitems, 248, 90 - yoffset, 3); + IN_DrawNumber(players[consoleplayer].itemcount, 200, yoffset + 50, 3); + V_DrawShadowedNamePatch(237, yoffset + 50, "FONTB15"); + IN_DrawNumber(totalitems, 248, yoffset + 50, 3); if (intertime < 90) { return; @@ -730,9 +743,9 @@ void IN_DrawSingleStats(void) S_StartVoidSound(heretic_sfx_dorcls); sounds++; } - IN_DrawNumber(players[consoleplayer].secretcount, 200, 115 - yoffset, 3); - V_DrawShadowedNamePatch(237, 115 - yoffset, "FONTB15"); - IN_DrawNumber(totalsecret, 248, 115 - yoffset, 3); + IN_DrawNumber(players[consoleplayer].secretcount, 200, yoffset + 75, 3); + V_DrawShadowedNamePatch(237, yoffset + 75, "FONTB15"); + IN_DrawNumber(totalsecret, 248, yoffset + 75, 3); if (intertime < 150) { return; From 009b92c6ffef8360b85518adced0773cb3cdb885 Mon Sep 17 00:00:00 2001 From: Pedro Beirao Date: Thu, 14 Nov 2024 17:11:10 +0000 Subject: [PATCH 03/13] Heretic umapinfo: fix entering levelname --- prboom2/src/heretic/in_lude.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/prboom2/src/heretic/in_lude.c b/prboom2/src/heretic/in_lude.c index 84b9cd7d0..64b008899 100644 --- a/prboom2/src/heretic/in_lude.c +++ b/prboom2/src/heretic/in_lude.c @@ -36,6 +36,7 @@ #include "dsda/exhud.h" #include "dsda/font.h" #include "dsda/mapinfo.h" +#include "dsda/mapinfo/u.h" #include "heretic/def.h" #include "heretic/dstrings.h" @@ -155,9 +156,6 @@ static yahpt_t YAHspot[3][9] = { static const char *NameForMap(int map) { - extern const char *lf_levelname; - if (lf_levelname) return lf_levelname; - const char *name = LevelNames[(gameepisode - 1) * 9 + map - 1]; if (strlen(name) < 7) @@ -532,7 +530,6 @@ void IN_Drawer(void) { case -1: case 0: // draw stats - dsda_PrepareFinished(); IN_DrawStatBack(); switch (gametype) { @@ -594,7 +591,12 @@ void IN_DrawStatBack(void) void IN_DrawOldLevel(void) { + const char *level_name = NameForMap(prevmap); + + extern const char *lf_levelname; + if (lf_levelname) level_name = lf_levelname; + int i; int x; @@ -640,6 +642,10 @@ void IN_DrawOldLevel(void) void IN_DrawYAH(void) { const char *level_name = NameForMap(nextmap); + + extern const char *el_levelname; + if (el_levelname) level_name = el_levelname; + int i; int x; @@ -674,10 +680,15 @@ void IN_DrawYAH(void) void IN_DrawSingleStats(void) { - extern const char *lf_author; + dsda_PrepareFinished(); const char *prev_level_name = NameForMap(prevmap); + extern const char *lf_levelname; + if (lf_levelname) prev_level_name = lf_levelname; + + extern const char *lf_author; + int x; static int sounds; @@ -756,6 +767,13 @@ void IN_DrawSingleStats(void) sounds++; } + dsda_PrepareEntering(); + + const char *next_level_name = NameForMap(nextmap); + + extern const char *el_levelname; + if (el_levelname) next_level_name = el_levelname; + // [crispy] ignore "now entering" if it's the final intermission if (gamemode != retail || gameepisode <= 3 || finalintermission) { @@ -776,8 +794,6 @@ void IN_DrawSingleStats(void) IN_DrTextB("TOTAL", 85, 140); IN_DrawTime(155, 140, totalHours, totalMinutes, totalSeconds); - const char *next_level_name = NameForMap(nextmap); - x = 160 - MN_TextAWidth("NOW ENTERING:") / 2; MN_DrTextA("NOW ENTERING:", x, 160); x = 160 - MN_TextBWidth(next_level_name) / 2; @@ -795,6 +811,10 @@ void IN_DrawSingleStats(void) void IN_DrawCoopStats(void) { const char *level_name = NameForMap(prevmap); + + extern const char *lf_levelname; + if (lf_levelname) level_name = lf_levelname; + int i; int x; int ypos; From b71e9a7cf3505a86c2abcf6261a9d18de24bec16 Mon Sep 17 00:00:00 2001 From: Pedro Beirao Date: Thu, 14 Nov 2024 23:38:02 +0000 Subject: [PATCH 04/13] Heretic umapinfo: exitpic enterpic --- prboom2/src/heretic/in_lude.c | 100 ++++++++++++++++++---------------- prboom2/src/wi_stuff.c | 8 +-- 2 files changed, 56 insertions(+), 52 deletions(-) diff --git a/prboom2/src/heretic/in_lude.c b/prboom2/src/heretic/in_lude.c index 64b008899..addc4e820 100644 --- a/prboom2/src/heretic/in_lude.c +++ b/prboom2/src/heretic/in_lude.c @@ -112,6 +112,15 @@ static const char *KillersText[] = { "K", "I", "L", "L", "E", "R", "S" }; extern const char *LevelNames[]; +extern const char *lf_levelname; +extern const char *lf_levelpic; +extern const char *lf_author; +extern const char *exitpic; +extern const char *el_levelname; +extern const char *el_levelpic; +extern const char *el_author; +extern const char *enterpic; + typedef struct { int x; @@ -167,15 +176,22 @@ static const char *NameForMap(int map) static void IN_DrawInterpic(void) { - char name[9]; + // e6y: wide-res + V_ClearBorder(); - if (gameepisode < 1 || gameepisode > 3) return; + if (enterpic) + { + V_DrawNamePatch(0, 0, 0, enterpic, CR_DEFAULT, VPT_STRETCH); + } + else + { + if (gameepisode < 1 || gameepisode > 3) return; - snprintf(name, sizeof(name), "MAPE%d", gameepisode); + const char name[9]; + snprintf(name, sizeof(name), "MAPE%d", gameepisode); - // e6y: wide-res - V_ClearBorder(); - V_DrawNamePatch(0, 0, 0, name, CR_DEFAULT, VPT_STRETCH); + V_DrawNamePatch(0, 0, 0, name, CR_DEFAULT, VPT_STRETCH); + } } static void IN_DrawBeenThere(int i) @@ -530,6 +546,7 @@ void IN_Drawer(void) { case -1: case 0: // draw stats + dsda_PrepareFinished(); IN_DrawStatBack(); switch (gametype) { @@ -580,7 +597,15 @@ void IN_DrawStatBack(void) { // e6y: wide-res V_ClearBorder(); - V_DrawBackground("FLOOR16", 0); + + if (exitpic) + { + V_DrawNamePatch(0, 0, 0, exitpic, CR_DEFAULT, VPT_STRETCH); + } + else + { + V_DrawBackground("FLOOR16", 0); + } } //======================================================================== @@ -591,23 +616,19 @@ void IN_DrawStatBack(void) void IN_DrawOldLevel(void) { - const char *level_name = NameForMap(prevmap); - - extern const char *lf_levelname; if (lf_levelname) level_name = lf_levelname; - int i; - int x; - - x = 160 - MN_TextBWidth(level_name) / 2; + int x = 160 - MN_TextBWidth(level_name) / 2; IN_DrTextB(level_name, x, 3); x = 160 - MN_TextAWidth("FINISHED") / 2; MN_DrTextA("FINISHED", x, 25); + if (exitpic) return; + if (prevmap == 9) { - for (i = 0; i < nextmap - 1; i++) + for (int i = 0; i < nextmap - 1; i++) { IN_DrawBeenThere(i); } @@ -618,7 +639,7 @@ void IN_DrawOldLevel(void) } else { - for (i = 0; i < prevmap - 1; i++) + for (int i = 0; i < prevmap - 1; i++) { IN_DrawBeenThere(i); } @@ -642,14 +663,9 @@ void IN_DrawOldLevel(void) void IN_DrawYAH(void) { const char *level_name = NameForMap(nextmap); - - extern const char *el_levelname; if (el_levelname) level_name = el_levelname; - int i; - int x; - - x = 160 - MN_TextAWidth("NOW ENTERING:") / 2; + int x = 160 - MN_TextAWidth("NOW ENTERING:") / 2; MN_DrTextA("NOW ENTERING:", x, 10); x = 160 - MN_TextBWidth(level_name) / 2; IN_DrTextB(level_name, x, 20); @@ -658,7 +674,9 @@ void IN_DrawYAH(void) { prevmap = nextmap - 1; } - for (i = 0; i < prevmap; i++) + if (enterpic) return; + + for (int i = 0; i < prevmap; i++) { IN_DrawBeenThere(i); } @@ -680,15 +698,9 @@ void IN_DrawYAH(void) void IN_DrawSingleStats(void) { - dsda_PrepareFinished(); - const char *prev_level_name = NameForMap(prevmap); - - extern const char *lf_levelname; if (lf_levelname) prev_level_name = lf_levelname; - - extern const char *lf_author; - + int x; static int sounds; @@ -769,11 +781,6 @@ void IN_DrawSingleStats(void) dsda_PrepareEntering(); - const char *next_level_name = NameForMap(nextmap); - - extern const char *el_levelname; - if (el_levelname) next_level_name = el_levelname; - // [crispy] ignore "now entering" if it's the final intermission if (gamemode != retail || gameepisode <= 3 || finalintermission) { @@ -794,6 +801,9 @@ void IN_DrawSingleStats(void) IN_DrTextB("TOTAL", 85, 140); IN_DrawTime(155, 140, totalHours, totalMinutes, totalSeconds); + const char *next_level_name = NameForMap(nextmap); + if (el_levelname) next_level_name = el_levelname; + x = 160 - MN_TextAWidth("NOW ENTERING:") / 2; MN_DrTextA("NOW ENTERING:", x, 160); x = 160 - MN_TextBWidth(next_level_name) / 2; @@ -811,26 +821,20 @@ void IN_DrawSingleStats(void) void IN_DrawCoopStats(void) { const char *level_name = NameForMap(prevmap); - - extern const char *lf_levelname; if (lf_levelname) level_name = lf_levelname; - int i; - int x; - int ypos; - - static int sounds; + int x = 160 - MN_TextBWidth(level_name) / 2; + IN_DrTextB(level_name, x, 3); + x = 160 - MN_TextAWidth("FINISHED") / 2; + MN_DrTextA("FINISHED", x, 25); IN_DrTextB("KILLS", 95, 35); IN_DrTextB("BONUS", 155, 35); IN_DrTextB("SECRET", 232, 35); - x = 160 - MN_TextBWidth(level_name) / 2; - IN_DrTextB(level_name, x, 3); - x = 160 - MN_TextAWidth("FINISHED") / 2; - MN_DrTextA("FINISHED", x, 25); - ypos = 50; - for (i = 0; i < g_maxplayers; i++) + static int sounds; + int ypos = 50; + for (int i = 0; i < g_maxplayers; i++) { if (playeringame[i]) { diff --git a/prboom2/src/wi_stuff.c b/prboom2/src/wi_stuff.c index 978271ea8..a13304eb0 100644 --- a/prboom2/src/wi_stuff.c +++ b/prboom2/src/wi_stuff.c @@ -386,7 +386,7 @@ static const char bstar[] = {"STFDEAD0"}; // "red P[1..g_maxplayers]" static const char facebackp[] = {"STPB0"}; -static const char *exitpic, *enterpic; +const char *exitpic, *enterpic; // // CODE @@ -2175,15 +2175,15 @@ void WI_initVariables(wbstartstruct_t* wbstartstruct) // void WI_Start(wbstartstruct_t* wbstartstruct) { + exitpic = dsda_ExitPic(); + enterpic = dsda_EnterPic(); + if (heretic) return IN_Start(wbstartstruct); if (hexen) return Hexen_IN_Start(wbstartstruct); WI_initVariables(wbstartstruct); WI_loadData(); - exitpic = dsda_ExitPic(); - enterpic = dsda_EnterPic(); - if (deathmatch) WI_initDeathmatchStats(); else if (netgame) From c68d6b7cb9bee262be459c64e14c1a22d7586f0c Mon Sep 17 00:00:00 2001 From: Pedro Beirao Date: Thu, 14 Nov 2024 23:44:17 +0000 Subject: [PATCH 05/13] Heretic umapinfo: move stats up in gameepisode > 3 --- prboom2/src/heretic/in_lude.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prboom2/src/heretic/in_lude.c b/prboom2/src/heretic/in_lude.c index addc4e820..41d77a09b 100644 --- a/prboom2/src/heretic/in_lude.c +++ b/prboom2/src/heretic/in_lude.c @@ -723,7 +723,7 @@ void IN_DrawSingleStats(void) if (gamemode == retail && gameepisode > 3) { - yoffset += 20; + yoffset -= 20; } IN_DrTextB("KILLS", 50, yoffset + 25); From 219888900259e98b2884ba1c5f21d17fc419509d Mon Sep 17 00:00:00 2001 From: Pedro Beirao Date: Fri, 15 Nov 2024 13:22:09 +0000 Subject: [PATCH 06/13] Heretic umapinfo: partime --- prboom2/src/heretic/in_lude.c | 45 +++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/prboom2/src/heretic/in_lude.c b/prboom2/src/heretic/in_lude.c index 41d77a09b..cbf8119be 100644 --- a/prboom2/src/heretic/in_lude.c +++ b/prboom2/src/heretic/in_lude.c @@ -92,6 +92,10 @@ static int totalHours; static int totalMinutes; static int totalSeconds; +static int parHours; +static int parMinutes; +static int parSeconds; + static int slaughterboy; // in DM, the player with the most kills static int killPercent[MAX_MAXPLAYERS]; @@ -317,6 +321,13 @@ void IN_InitStats(void) totalMinutes = count / 60; count -= totalMinutes * 60; totalSeconds = count; + + count = wbs->partime / 35; + parHours = count / 3600; + count -= parHours * 3600; + parMinutes = count / 60; + count -= parMinutes * 60; + parSeconds = count; } else if (netgame && !deathmatch) { @@ -784,22 +795,11 @@ void IN_DrawSingleStats(void) // [crispy] ignore "now entering" if it's the final intermission if (gamemode != retail || gameepisode <= 3 || finalintermission) { - IN_DrTextB("TIME", 85, 150); - IN_DrawTime(155, 150, hours, minutes, seconds); - - // [crispy] Show total time on intermission - IN_DrTextB("TOTAL", 85, 170); - IN_DrawTime(155, 170, totalHours, totalMinutes, totalSeconds); + yoffset = 30; } else { - // [crispy] show the level time for Ep.4 and up - IN_DrTextB("TIME", 85, 120); - IN_DrawTime(155, 120, hours, minutes, seconds); - - // [crispy] Show total time on intermission - IN_DrTextB("TOTAL", 85, 140); - IN_DrawTime(155, 140, totalHours, totalMinutes, totalSeconds); + yoffset = 0; const char *next_level_name = NameForMap(nextmap); if (el_levelname) next_level_name = el_levelname; @@ -810,6 +810,25 @@ void IN_DrawSingleStats(void) IN_DrTextB(next_level_name, x, 170); skipintermission = false; } + + if (wbs->modified_partime) + { + IN_DrTextB("TIME", 8, 120 + yoffset); + IN_DrawTime(55, 120 + yoffset, hours, minutes, seconds); + IN_DrTextB("TOTAL", 8, 140 + yoffset); + IN_DrawTime(55, 140 + yoffset, totalHours, totalMinutes, totalSeconds); + + IN_DrTextB("PAR", 170, 120 + yoffset); + IN_DrawTime(218, 120 + yoffset, parHours, parMinutes, parSeconds); + } + else + { + IN_DrTextB("TIME", 85, 120 + yoffset); + IN_DrawTime(155, 120 + yoffset, hours, minutes, seconds); + IN_DrTextB("TOTAL", 85, 140 + yoffset); + IN_DrawTime(155, 140 + yoffset, totalHours, totalMinutes, totalSeconds); + } + } //======================================================================== From 6d9b2d376dbaf60bba2f7e62b817df007acd4aee Mon Sep 17 00:00:00 2001 From: Pedro Beirao Date: Fri, 15 Nov 2024 13:39:43 +0000 Subject: [PATCH 07/13] Heretic umapinfo: enterpic default handling --- prboom2/src/heretic/in_lude.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/prboom2/src/heretic/in_lude.c b/prboom2/src/heretic/in_lude.c index cbf8119be..6d877bb0e 100644 --- a/prboom2/src/heretic/in_lude.c +++ b/prboom2/src/heretic/in_lude.c @@ -187,6 +187,10 @@ static void IN_DrawInterpic(void) { V_DrawNamePatch(0, 0, 0, enterpic, CR_DEFAULT, VPT_STRETCH); } + else if (exitpic) + { + V_DrawNamePatch(0, 0, 0, exitpic, CR_DEFAULT, VPT_STRETCH); + } else { if (gameepisode < 1 || gameepisode > 3) return; @@ -685,7 +689,7 @@ void IN_DrawYAH(void) { prevmap = nextmap - 1; } - if (enterpic) return; + if (enterpic || exitpic) return; for (int i = 0; i < prevmap; i++) { From 0887330464760d01f06e66c2d2cc23011368a174 Mon Sep 17 00:00:00 2001 From: Pedro Beirao Date: Fri, 15 Nov 2024 19:35:50 +0000 Subject: [PATCH 08/13] Heretic umapinfo: endgame --- prboom2/src/heretic/in_lude.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/prboom2/src/heretic/in_lude.c b/prboom2/src/heretic/in_lude.c index 6d877bb0e..16c94e172 100644 --- a/prboom2/src/heretic/in_lude.c +++ b/prboom2/src/heretic/in_lude.c @@ -239,7 +239,10 @@ static void IN_InitVariables(wbstartstruct_t* wbstartstruct) prevmap = wbs->last + 1; nextmap = wbs->next + 1; - finalintermission = (prevmap == 8); + int behaviour; + dsda_ShowNextLocBehaviour(&behaviour); + + finalintermission = (behaviour == WI_SHOW_NEXT_DONE); } //======================================================================== @@ -326,12 +329,15 @@ void IN_InitStats(void) count -= totalMinutes * 60; totalSeconds = count; - count = wbs->partime / 35; - parHours = count / 3600; - count -= parHours * 3600; - parMinutes = count / 60; - count -= parMinutes * 60; - parSeconds = count; + if (wbs->modified_partime) + { + count = wbs->partime / 35; + parHours = count / 3600; + count -= parHours * 3600; + parMinutes = count / 60; + count -= parMinutes * 60; + parSeconds = count; + } } else if (netgame && !deathmatch) { @@ -584,7 +590,7 @@ void IN_Drawer(void) } break; case 2: // going to the next level - if (gameepisode < 4) + if (gameepisode < 4 && !finalintermission) { IN_DrawInterpic(); IN_DrawYAH(); From 319c7f24fc01fe8a6bec8a3adffa38ec0e437dac Mon Sep 17 00:00:00 2001 From: Pedro Beirao Date: Sat, 16 Nov 2024 13:07:58 +0000 Subject: [PATCH 09/13] Heretic umapinfo: finale --- prboom2/src/heretic/f_finale.c | 33 ++++++++++++++++++++++++++------- prboom2/src/heretic/in_lude.c | 5 ++--- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/prboom2/src/heretic/f_finale.c b/prboom2/src/heretic/f_finale.c index dabba154f..a1c735996 100644 --- a/prboom2/src/heretic/f_finale.c +++ b/prboom2/src/heretic/f_finale.c @@ -22,20 +22,21 @@ #include "sounds.h" #include "dsda/palette.h" +#include "dsda/mapinfo.h" #include "heretic/def.h" #include "heretic/dstrings.h" #include "heretic/f_finale.h" -static int finalestage; // 0 = text, 1 = art screen -static int finalecount; - #define TEXTSPEED 3 #define TEXTWAIT 250 -static const char *finaletext; -static const char *finaleflat; +extern int finalestage; // 0 = text, 1 = art screen +extern int finalecount; +extern const char *finaletext; +extern const char *finaleflat; +extern dboolean finalintermission; static int FontABaseLump; @@ -77,10 +78,23 @@ void Heretic_F_StartFinale(void) break; } + FontABaseLump = W_GetNumForName("FONTA_S") + 1; + + int mnum, muslump; + dsda_InterMusic(&mnum, &muslump); + if (muslump >= 0) + { + S_ChangeMusInfoMusic(muslump, true); + } + else + { + S_ChangeMusic(heretic_mus_cptd, true); + } + + dsda_StartFinale(); + finalestage = 0; finalecount = 0; - FontABaseLump = W_GetNumForName("FONTA_S") + 1; - S_ChangeMusic(heretic_mus_cptd, true); } dboolean F_BlockingInput(void) @@ -258,6 +272,11 @@ void Heretic_F_Drawer(void) Heretic_F_TextWrite(); else { + if (!finalintermission) + { + gameaction = ga_worlddone; + return; + } switch (gameepisode) { case 1: diff --git a/prboom2/src/heretic/in_lude.c b/prboom2/src/heretic/in_lude.c index 16c94e172..dcdf9d031 100644 --- a/prboom2/src/heretic/in_lude.c +++ b/prboom2/src/heretic/in_lude.c @@ -75,7 +75,7 @@ static int prevmap; static int nextmap; static dboolean intermission; static dboolean skipintermission; -static dboolean finalintermission; +dboolean finalintermission; static int interstate = 0; static int intertime = -1; static int oldintertime = 0; @@ -241,8 +241,7 @@ static void IN_InitVariables(wbstartstruct_t* wbstartstruct) int behaviour; dsda_ShowNextLocBehaviour(&behaviour); - - finalintermission = (behaviour == WI_SHOW_NEXT_DONE); + finalintermission = (behaviour & WI_SHOW_NEXT_DONE); } //======================================================================== From 4d0679b5448bc35af4e8cb3658c8daf0634f0ce9 Mon Sep 17 00:00:00 2001 From: Pedro Beirao Date: Sat, 16 Nov 2024 17:46:32 +0000 Subject: [PATCH 10/13] Heretic umapinfo: disable not implemented keys --- prboom2/src/umapinfo.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/prboom2/src/umapinfo.cpp b/prboom2/src/umapinfo.cpp index a4410926c..9ef971e7d 100644 --- a/prboom2/src/umapinfo.cpp +++ b/prboom2/src/umapinfo.cpp @@ -197,7 +197,7 @@ static int ParseStandardProperty(Scanner &scanner, MapEntry *mape) return 0; } } - else if (!stricmp(pname, "levelpic")) + else if (!stricmp(pname, "levelpic") && !raven) { ParseLumpName(scanner, mape->levelpic); } @@ -213,13 +213,13 @@ static int ParseStandardProperty(Scanner &scanner, MapEntry *mape) { ParseLumpName(scanner, mape->endpic); } - else if (!stricmp(pname, "endcast")) + else if (!stricmp(pname, "endcast") && !raven) { scanner.MustGetToken(TK_BoolConst); if (scanner.boolean) strcpy(mape->endpic, "$CAST"); else strcpy(mape->endpic, "-"); } - else if (!stricmp(pname, "endbunny")) + else if (!stricmp(pname, "endbunny") && !raven) { scanner.MustGetToken(TK_BoolConst); if (scanner.boolean) strcpy(mape->endpic, "$BUNNY"); @@ -239,7 +239,7 @@ static int ParseStandardProperty(Scanner &scanner, MapEntry *mape) { ParseLumpName(scanner, mape->enterpic); } - else if (!stricmp(pname, "nointermission")) + else if (!stricmp(pname, "nointermission") && !raven) { scanner.MustGetToken(TK_BoolConst); mape->nointermission = scanner.boolean; From e7a386d78cbee6f898adb27d39012d892c154144 Mon Sep 17 00:00:00 2001 From: Pedro Beirao Date: Sat, 16 Nov 2024 17:53:53 +0000 Subject: [PATCH 11/13] Heretic umapinfo: endpic --- prboom2/src/f_finale.c | 10 ++++++---- prboom2/src/heretic/f_finale.c | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/prboom2/src/f_finale.c b/prboom2/src/f_finale.c index c03bdb6d4..3d4fab3e0 100644 --- a/prboom2/src/f_finale.c +++ b/prboom2/src/f_finale.c @@ -64,6 +64,7 @@ int finalecount; const char* finaletext; const char* finaleflat; const char* finalepatch; +const char* endpic; // defines for the end mission display text // phares @@ -88,6 +89,11 @@ void F_StartFinale (void) int mnum; int muslump; + finaletext = NULL; + finaleflat = NULL; + finalepatch = NULL; + endpic = NULL; + if (heretic) return Heretic_F_StartFinale(); if (hexen) return Hexen_F_StartFinale(); @@ -98,10 +104,6 @@ void F_StartFinale (void) // killough 3/28/98: clear accelerative text flags acceleratestage = midstage = 0; - finaletext = NULL; - finaleflat = NULL; - finalepatch = NULL; - dsda_InterMusic(&mnum, &muslump); if (muslump >= 0) diff --git a/prboom2/src/heretic/f_finale.c b/prboom2/src/heretic/f_finale.c index a1c735996..bdd545173 100644 --- a/prboom2/src/heretic/f_finale.c +++ b/prboom2/src/heretic/f_finale.c @@ -36,6 +36,8 @@ extern int finalestage; // 0 = text, 1 = art screen extern int finalecount; extern const char *finaletext; extern const char *finaleflat; +extern const char* finalepatch; +extern const char* endpic; extern dboolean finalintermission; static int FontABaseLump; @@ -162,7 +164,14 @@ void Heretic_F_TextWrite(void) // // erase the entire screen to a tiled background // - V_DrawBackground(finaleflat, 0); + if (finalepatch) + { + V_DrawNamePatch(0, 0, 0, finalepatch, CR_DEFAULT, VPT_STRETCH); + } + else + { + V_DrawBackground(finaleflat, 0); + } // // draw some of the text onto the screen @@ -277,6 +286,11 @@ void Heretic_F_Drawer(void) gameaction = ga_worlddone; return; } + if (endpic) + { + V_DrawNamePatch(0, 0, 0, endpic, CR_DEFAULT, VPT_STRETCH); + return; + } switch (gameepisode) { case 1: From b3a89a286a2ede7cd4201f6b9d558eaf0999b499 Mon Sep 17 00:00:00 2001 From: Pedro Beirao Date: Sat, 16 Nov 2024 18:39:43 +0000 Subject: [PATCH 12/13] Heretic umapinfo: enable nointermission --- prboom2/src/umapinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prboom2/src/umapinfo.cpp b/prboom2/src/umapinfo.cpp index 9ef971e7d..83d59c658 100644 --- a/prboom2/src/umapinfo.cpp +++ b/prboom2/src/umapinfo.cpp @@ -239,7 +239,7 @@ static int ParseStandardProperty(Scanner &scanner, MapEntry *mape) { ParseLumpName(scanner, mape->enterpic); } - else if (!stricmp(pname, "nointermission") && !raven) + else if (!stricmp(pname, "nointermission")) { scanner.MustGetToken(TK_BoolConst); mape->nointermission = scanner.boolean; From 1084edd6186478c95df7886a34e133430fba82a2 Mon Sep 17 00:00:00 2001 From: Pedro Beirao Date: Sat, 16 Nov 2024 19:31:46 +0000 Subject: [PATCH 13/13] Heretic umapinfo: define endpic --- prboom2/src/dsda/mapinfo/u.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/prboom2/src/dsda/mapinfo/u.c b/prboom2/src/dsda/mapinfo/u.c index e9f4c7e43..5d197ea46 100644 --- a/prboom2/src/dsda/mapinfo/u.c +++ b/prboom2/src/dsda/mapinfo/u.c @@ -219,6 +219,7 @@ extern int finalecount; extern const char* finaletext; extern const char* finaleflat; extern const char* finalepatch; +extern const char* endpic; extern int acceleratestage; extern int midstage; @@ -246,6 +247,8 @@ int dsda_UStartFinale(void) { if (!finaleflat) finaleflat = "FLOOR4_8"; // use a single fallback for all maps. + + endpic = gamemapinfo->endpic; return true; }