From 03a2b9dc2ec80491a6a4dae46ecf26e1316f9733 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 2 Feb 2019 23:44:09 +0700 Subject: [PATCH 1/5] added am_showkeys_always --- src/am_map.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/am_map.cpp b/src/am_map.cpp index 95d978054..a5c615758 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -83,6 +83,7 @@ CVAR (Bool, am_customcolors, true, CVAR_ARCHIVE); CVAR (Int, am_map_secrets, 1, CVAR_ARCHIVE); CVAR (Int, am_drawmapback, 1, CVAR_ARCHIVE); CVAR (Bool, am_showkeys, true, CVAR_ARCHIVE); +CVAR (Bool, am_showkeys_always, false, CVAR_ARCHIVE); CVAR (Int, am_showtriggerlines, 0, CVAR_ARCHIVE); CVAR (Int, am_showthingsprites, 0, CVAR_ARCHIVE); @@ -3056,7 +3057,7 @@ void AM_drawThings () // That is the case for all default keys, however. if (t->IsKindOf(NAME_Key)) { - if (G_SkillProperty(SKILLP_EasyKey)) + if (G_SkillProperty(SKILLP_EasyKey) || am_showkeys_always) { // Already drawn by AM_drawKeys(), so don't draw again color.Index = -1; @@ -3283,7 +3284,7 @@ void AM_Drawer (int bottom) AM_drawWalls(allmap); AM_drawPlayers(); - if (G_SkillProperty(SKILLP_EasyKey)) + if (G_SkillProperty(SKILLP_EasyKey) || am_showkeys_always) AM_drawKeys(); if ((am_cheat >= 2 && am_cheat != 4) || allthings) AM_drawThings(); From 4af80fa43bac06a9782e5007a178c58585e9a881 Mon Sep 17 00:00:00 2001 From: Nemrtvi <26684396+Nemrtvi@users.noreply.github.com> Date: Sat, 2 Feb 2019 08:52:51 +0100 Subject: [PATCH 2/5] =?UTF-8?q?Fixed=20=E2=80=9CFinished:=E2=80=9D=20and?= =?UTF-8?q?=20=E2=80=9CNow=20entering=E2=80=9D=20in=20Heretic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The text file gzdoom/wadsrc/static/zscript/statscreen/statscreen.txt is set to use strings called “$ENTERING” and “$FINISHED”, located in the language files, in intermission screens between levels in Heretic. However, these strings are named incorrectly in the language files, instead being written as “$WI_ENTERING” and “$WI_FINISHED” for some reason I’m unaware of. After renaming the original script, the ingame text shows up through what is written in the language files, as intended. On a miscellaneous note: in GZDoom, the text between levels in Heretic says “Entering:”. In the DOS version, it says “Now entering:”. This is accurately reflected in the English language file, though, and thus faithful to the original when displayed ingame. --- wadsrc/static/zscript/statscreen/statscreen.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wadsrc/static/zscript/statscreen/statscreen.txt b/wadsrc/static/zscript/statscreen/statscreen.txt index a8d8e25ed..5679d8e85 100644 --- a/wadsrc/static/zscript/statscreen/statscreen.txt +++ b/wadsrc/static/zscript/statscreen/statscreen.txt @@ -224,7 +224,7 @@ class StatusScreen abstract play version("2.5") if (y < (NG_STATSY - finished.mFont.GetHeight()*3/4) * CleanYfac) { // don't draw 'finished' if the level name is too tall - y = DrawPatchText(y, finished, "$FINISHED"); + y = DrawPatchText(y, finished, "$WI_FINISHED"); } return y; } @@ -243,7 +243,7 @@ class StatusScreen abstract play version("2.5") { int y = TITLEY * CleanYfac; - y = DrawPatchText(y, entering, "$ENTERING"); + y = DrawPatchText(y, entering, "$WI_ENTERING"); y += entering.mFont.GetHeight() * CleanYfac / 4; DrawName(y, wbs.LName1, lnametexts[1]); } From 2cff43ba9075c8f8ed02ad23b340cf5015bea030 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 3 Feb 2019 08:22:47 +0100 Subject: [PATCH 3/5] - fixed: The HUD model code did not account for placeholder sprites. --- src/hwrenderer/scene/hw_weapon.cpp | 2 +- src/r_data/models/models.cpp | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/hwrenderer/scene/hw_weapon.cpp b/src/hwrenderer/scene/hw_weapon.cpp index 787bf539e..2dd495063 100644 --- a/src/hwrenderer/scene/hw_weapon.cpp +++ b/src/hwrenderer/scene/hw_weapon.cpp @@ -513,7 +513,7 @@ void HWDrawInfo::PreparePlayerSprites(sector_t * viewsector, area_t in_area) for (DPSprite *psp = player->psprites; psp != nullptr && psp->GetID() < PSP_TARGETCENTER; psp = psp->GetNext()) { if (!psp->GetState()) continue; - FSpriteModelFrame *smf = playermo->player->ReadyWeapon ? FindModelFrame(playermo->player->ReadyWeapon->GetClass(), psp->GetState()->sprite, psp->GetState()->GetFrame(), false) : nullptr; + FSpriteModelFrame *smf = playermo->player->ReadyWeapon ? FindModelFrame(playermo->player->ReadyWeapon->GetClass(), psp->GetSprite(), psp->GetFrame(), false) : nullptr; // This is an 'either-or' proposition. This maybe needs some work to allow overlays with weapon models but as originally implemented this just won't work. if (smf && !hudModelStep) continue; if (!smf && hudModelStep) continue; diff --git a/src/r_data/models/models.cpp b/src/r_data/models/models.cpp index e75d9d030..f8eb8cf9b 100644 --- a/src/r_data/models/models.cpp +++ b/src/r_data/models/models.cpp @@ -180,7 +180,7 @@ void FModelRenderer::RenderModel(float x, float y, float z, FSpriteModelFrame *s void FModelRenderer::RenderHUDModel(DPSprite *psp, float ofsX, float ofsY) { AActor * playermo = players[consoleplayer].camera; - FSpriteModelFrame *smf = FindModelFrame(playermo->player->ReadyWeapon->GetClass(), psp->GetState()->sprite, psp->GetState()->GetFrame(), false); + FSpriteModelFrame *smf = FindModelFrame(playermo->player->ReadyWeapon->GetClass(), psp->GetSprite(), psp->GetFrame(), false); // [BB] No model found for this sprite, so we can't render anything. if (smf == nullptr) @@ -922,11 +922,10 @@ bool IsHUDModelForPlayerAvailable (player_t * player) DPSprite *psp = player->FindPSprite(PSP_WEAPON); - if (psp == nullptr || psp->GetState() == nullptr) + if (psp == nullptr) return false; - FState* state = psp->GetState(); - FSpriteModelFrame *smf = FindModelFrame(player->ReadyWeapon->GetClass(), state->sprite, state->GetFrame(), false); + FSpriteModelFrame *smf = FindModelFrame(player->ReadyWeapon->GetClass(), psp->GetSprite(), psp->GetFrame(), false); return ( smf != nullptr ); } From 2fd1276d28fa1d55e9f678b17fae6bd6a5bd59b4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 3 Feb 2019 08:59:37 +0100 Subject: [PATCH 4/5] - fixed: Instead of mapping Hexen's BLANK texture to the null texture, make its actual use type that of a null texture. The software renderer does not have any safeguards against such a mapping and crashes on it. This code was a quick hack from ancient times from when ZDoom did not have robust texture management and some recent changes ran afoul of this very special exception. --- src/textures/texturemanager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/textures/texturemanager.cpp b/src/textures/texturemanager.cpp index 1c535f4df..27dc4d696 100644 --- a/src/textures/texturemanager.cpp +++ b/src/textures/texturemanager.cpp @@ -1051,13 +1051,14 @@ void FTextureManager::Init() // The Hexen scripts use BLANK as a blank texture, even though it's really not. // I guess the Doom renderer must have clipped away the line at the bottom of - // the texture so it wasn't visible. I'll just map it to 0, so it really is blank. + // the texture so it wasn't visible. Change its use type to a blank null texture to really make it blank. if (gameinfo.gametype == GAME_Hexen) { FTextureID tex = CheckForTexture ("BLANK", ETextureType::Wall, false); if (tex.Exists()) { - SetTranslation (tex, 0); + auto texture = GetTexture(tex, false); + texture->UseType = ETextureType::Null; } } From 25071e26e58fe3eab24cc12b655a47ed5ac008d8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 3 Feb 2019 09:11:33 +0100 Subject: [PATCH 5/5] - fixed: The CheckEnvironmant call in PlayerThink can already invalidate the PlayerPawn so even the calls to CheckUndoMorph and CheckUse need to get the pawn through the PlayerInfo. --- wadsrc/static/zscript/shared/player.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wadsrc/static/zscript/shared/player.txt b/wadsrc/static/zscript/shared/player.txt index 3e3bd2e56..5bc9d3818 100644 --- a/wadsrc/static/zscript/shared/player.txt +++ b/wadsrc/static/zscript/shared/player.txt @@ -1635,10 +1635,11 @@ class PlayerPawn : Actor if (!(player.cheats & CF_PREDICTING)) { CheckEnvironment(); - CheckUse(); - CheckUndoMorph(); + // Note that after this point the PlayerPawn may have changed due to getting unmorphed or getting its skull popped so 'self' is no longer safe to use. + // This also must not read mo into a local variable because several functions in this block can change the attached PlayerPawn. + player.mo.CheckUse(); + player.mo.CheckUndoMorph(); // Cycle psprites. - // Note that after this point the PlayerPawn may have changed due to getting unmorphed so 'self' is no longer safe to use. player.mo.TickPSprites(); // Other Counters if (player.damagecount) player.damagecount--;