From f65c651ffd5ed1764fb288a5ff47f61fd6ed863d Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Mon, 19 Jun 2017 04:12:57 -0400 Subject: [PATCH 1/6] - applied Maulotaur obituary text from https://forum.zdoom.org/viewtopic.php?f=2&t=56959 --- wadsrc/static/language.enu | 2 ++ wadsrc/static/zscript/raven/minotaur.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index a0db82897..9da0f473a 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -711,6 +711,8 @@ OB_IRONLICH = "%o was devastated by an ironlich."; OB_IRONLICHHIT = "%o got up-close and personal with an ironlich."; OB_BONEKNIGHT = "%o was axed by an undead warrior."; OB_BONEKNIGHTHIT = "%o was slain by an undead warrior."; +OB_MINOTAUR = "%o was blasted into cinders by a Maulotaur."; +OB_MINOTAURHIT = "%o was pulped by a Maulotaur."; OB_MUMMY = "%o was smashed by a golem."; OB_MUMMYLEADER = "%o was shrieked to death by a nitrogolem."; OB_SNAKE = "%o was rattled by an ophidian."; diff --git a/wadsrc/static/zscript/raven/minotaur.txt b/wadsrc/static/zscript/raven/minotaur.txt index 243500f4e..1738bc3f6 100644 --- a/wadsrc/static/zscript/raven/minotaur.txt +++ b/wadsrc/static/zscript/raven/minotaur.txt @@ -28,6 +28,8 @@ class Minotaur : Actor ActiveSound "minotaur/active"; DropItem "ArtiSuperHealth", 51; DropItem "PhoenixRodAmmo", 84, 10; + Obituary "$OB_MINOTAUR"; + HitObituary "$OB_MINOTAURHIT"; } States From 8af76b96d8a98f0d09b5169d69570821248322b3 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 19 Jun 2017 20:36:28 +0200 Subject: [PATCH 2/6] - Fix clearfog crash --- src/swrenderer/line/r_renderdrawsegment.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/swrenderer/line/r_renderdrawsegment.cpp b/src/swrenderer/line/r_renderdrawsegment.cpp index b32520707..47fa2fb76 100644 --- a/src/swrenderer/line/r_renderdrawsegment.cpp +++ b/src/swrenderer/line/r_renderdrawsegment.cpp @@ -126,6 +126,7 @@ namespace swrenderer bool wrap = (curline->linedef->flags & ML_WRAP_MIDTEX) || (curline->sidedef->Flags & WALLF_WRAP_MIDTEX); // [RH] Draw fog partition + bool renderwall = true; bool notrelevant = false; if (ds->bFogBoundary) { @@ -135,17 +136,17 @@ namespace swrenderer RenderFogBoundary renderfog; renderfog.Render(Thread, x1, x2, mceilingclip, mfloorclip, wallshade, rw_light, rw_lightstep, basecolormap); - if (!ds->maskedtexturecol) - { - if (!(ds->bFakeBoundary && !(ds->bFakeBoundary & 4)) || visible) - notrelevant = RenderWall(ds, x1, x2, walldrawerargs, columndrawerargs, visible, basecolormap, wallshade, wrap); - } + if (ds->maskedtexturecol == nullptr) + renderwall = false; } - else if (!(ds->bFakeBoundary && !(ds->bFakeBoundary & 4)) || visible) + else if ((ds->bFakeBoundary && !(ds->bFakeBoundary & 4)) || !visible) { - notrelevant = RenderWall(ds, x1, x2, walldrawerargs, columndrawerargs, visible, basecolormap, wallshade, wrap); + renderwall = false; } + if (renderwall) + notrelevant = RenderWall(ds, x1, x2, walldrawerargs, columndrawerargs, visible, basecolormap, wallshade, wrap); + if (ds->bFakeBoundary & 3) { RenderFakeWallRange(ds, x1, x2, wallshade); From 7e292fbfece37edc25d8898672a3cc6c09d6359d Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Mon, 19 Jun 2017 15:01:27 -0400 Subject: [PATCH 3/6] - Partially fixed the 3d floors + fogboundary issue. There's still an issue when a sprite appears in front of a fog boundary, but because this is already a huge visual improvement I am going to go ahead and push this. --- src/swrenderer/scene/r_translucent_pass.cpp | 4 ++++ src/swrenderer/segments/r_drawsegment.cpp | 1 + src/swrenderer/segments/r_drawsegment.h | 1 + 3 files changed, 6 insertions(+) diff --git a/src/swrenderer/scene/r_translucent_pass.cpp b/src/swrenderer/scene/r_translucent_pass.cpp index 6afa2fcc9..2e15a0a21 100644 --- a/src/swrenderer/scene/r_translucent_pass.cpp +++ b/src/swrenderer/scene/r_translucent_pass.cpp @@ -163,8 +163,12 @@ namespace swrenderer if (ds->fake) continue; if (ds->maskedtexturecol != nullptr || ds->bFogBoundary) { + if (renew && ds->bRenewDrawn) + continue; RenderDrawSegment renderer(Thread); renderer.Render(ds, ds->x1, ds->x2); + if (renew && ds->bFogBoundary) + ds->bRenewDrawn = true; } } } diff --git a/src/swrenderer/segments/r_drawsegment.cpp b/src/swrenderer/segments/r_drawsegment.cpp index 6d8d50707..846800e03 100644 --- a/src/swrenderer/segments/r_drawsegment.cpp +++ b/src/swrenderer/segments/r_drawsegment.cpp @@ -85,6 +85,7 @@ namespace swrenderer void DrawSegmentList::Push(DrawSegment *segment) { + segment->bRenewDrawn = false; Segments.Push(segment); } diff --git a/src/swrenderer/segments/r_drawsegment.h b/src/swrenderer/segments/r_drawsegment.h index 5480ac4f2..26751b2e6 100644 --- a/src/swrenderer/segments/r_drawsegment.h +++ b/src/swrenderer/segments/r_drawsegment.h @@ -39,6 +39,7 @@ namespace swrenderer uint8_t silhouette; // 0=none, 1=bottom, 2=top, 3=both uint8_t bFogBoundary; uint8_t bFakeBoundary; // for fake walls + bool bRenewDrawn; int shade; bool foggy; From e290274fb769a6059656842c8cf8d8398436a0c5 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Mon, 19 Jun 2017 17:19:44 -0400 Subject: [PATCH 4/6] - fixed: Now fully fixed the 3d floor + fog boundary issue. - Revert "- Partially fixed the 3d floors + fogboundary issue. There's still an issue when a sprite appears in front of a fog boundary, but because this is already a huge visual improvement I am going to go ahead and push this." This reverts commit 7e292fbfece37edc25d8898672a3cc6c09d6359d. --- src/swrenderer/scene/r_translucent_pass.cpp | 6 ++---- src/swrenderer/segments/r_drawsegment.cpp | 1 - src/swrenderer/segments/r_drawsegment.h | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/swrenderer/scene/r_translucent_pass.cpp b/src/swrenderer/scene/r_translucent_pass.cpp index 2e15a0a21..a8ba85d25 100644 --- a/src/swrenderer/scene/r_translucent_pass.cpp +++ b/src/swrenderer/scene/r_translucent_pass.cpp @@ -163,12 +163,10 @@ namespace swrenderer if (ds->fake) continue; if (ds->maskedtexturecol != nullptr || ds->bFogBoundary) { - if (renew && ds->bRenewDrawn) - continue; RenderDrawSegment renderer(Thread); renderer.Render(ds, ds->x1, ds->x2); - if (renew && ds->bFogBoundary) - ds->bRenewDrawn = true; + if (renew && ds->bFogBoundary) // don't draw fogboundary again + ds->bFogBoundary = false; } } } diff --git a/src/swrenderer/segments/r_drawsegment.cpp b/src/swrenderer/segments/r_drawsegment.cpp index 846800e03..6d8d50707 100644 --- a/src/swrenderer/segments/r_drawsegment.cpp +++ b/src/swrenderer/segments/r_drawsegment.cpp @@ -85,7 +85,6 @@ namespace swrenderer void DrawSegmentList::Push(DrawSegment *segment) { - segment->bRenewDrawn = false; Segments.Push(segment); } diff --git a/src/swrenderer/segments/r_drawsegment.h b/src/swrenderer/segments/r_drawsegment.h index 26751b2e6..5480ac4f2 100644 --- a/src/swrenderer/segments/r_drawsegment.h +++ b/src/swrenderer/segments/r_drawsegment.h @@ -39,7 +39,6 @@ namespace swrenderer uint8_t silhouette; // 0=none, 1=bottom, 2=top, 3=both uint8_t bFogBoundary; uint8_t bFakeBoundary; // for fake walls - bool bRenewDrawn; int shade; bool foggy; From cc9fa8a6f5d8d1ca82ee1cc7aa29e7c6ce23f590 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Mon, 19 Jun 2017 23:46:07 -0400 Subject: [PATCH 5/6] - fixed: Prevent /0 errors when calculating console scale, which could happen in certain rare situations. --- src/v_draw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v_draw.cpp b/src/v_draw.cpp index b60c17616..2377e8f7d 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -94,7 +94,7 @@ int GetUIScale(int altval) int vmax = screen->GetHeight() / 200; int hmax = screen->GetWidth() / 320; int max = MAX(vmax, hmax); - return MIN(scaleval, max); + return MAX(1,MIN(scaleval, max)); } // [RH] Stretch values to make a 320x200 image best fit the screen From f909b82074c73e03dcf8055237b03c4a975f3d88 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 20 Jun 2017 09:10:19 +0200 Subject: [PATCH 6/6] - fixed: Blood translations did not properly treat color 0 as transparent. --- src/gl/scene/gl_sprite.cpp | 1 - src/r_data/r_translate.cpp | 6 ++++-- src/r_data/r_translate.h | 2 -- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gl/scene/gl_sprite.cpp b/src/gl/scene/gl_sprite.cpp index c49845688..bc8275ddd 100644 --- a/src/gl/scene/gl_sprite.cpp +++ b/src/gl/scene/gl_sprite.cpp @@ -79,7 +79,6 @@ EXTERN_CVAR (Float, transsouls) extern TArray sprites; extern TArray SpriteFrames; -extern TArray BloodTranslationColors; enum HWRenderStyle { diff --git a/src/r_data/r_translate.cpp b/src/r_data/r_translate.cpp index 2b8849b68..d8bff43d4 100644 --- a/src/r_data/r_translate.cpp +++ b/src/r_data/r_translate.cpp @@ -726,7 +726,7 @@ int FRemapTable::StoreTranslation(int slot) // //---------------------------------------------------------------------------- -TArray BloodTranslationColors; +static TArray BloodTranslationColors; int CreateBloodTranslation(PalEntry color) { @@ -754,7 +754,9 @@ int CreateBloodTranslation(PalEntry color) I_Error("Too many blood colors"); } FRemapTable *trans = new FRemapTable; - for (i = 0; i < 256; i++) + trans->Palette[0] = 0; + trans->Remap[0] = 0; + for (i = 1; i < 256; i++) { int bright = MAX(MAX(GPalette.BaseColors[i].r, GPalette.BaseColors[i].g), GPalette.BaseColors[i].b); PalEntry pe = PalEntry(255, color.r*bright/255, color.g*bright/255, color.b*bright/255); diff --git a/src/r_data/r_translate.h b/src/r_data/r_translate.h index f3c2c55c3..7c8f821b0 100644 --- a/src/r_data/r_translate.h +++ b/src/r_data/r_translate.h @@ -108,8 +108,6 @@ void R_GetPlayerTranslation (int color, const struct FPlayerColorSet *colorset, extern const uint8_t IcePalette[16][3]; -extern TArray BloodTranslationColors; - int CreateBloodTranslation(PalEntry color); int R_FindCustomTranslation(FName name);