From 822bbd5b9a015141d6ca17d19df8b8a8600f220b Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Fri, 17 Jun 2016 13:40:23 +0200 Subject: [PATCH] Fuzz (invisibility) adjustments --- src/r_draw_rgba.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/r_draw_rgba.cpp b/src/r_draw_rgba.cpp index 491c6ab98..bdbcd1250 100644 --- a/src/r_draw_rgba.cpp +++ b/src/r_draw_rgba.cpp @@ -584,8 +584,8 @@ class DrawFuzzColumnRGBACommand : public DrawerCommand int _yh; BYTE *_destorg; int _pitch; - int fuzzpos; - int fuzzviewheight; + int _fuzzpos; + int _fuzzviewheight; public: DrawFuzzColumnRGBACommand() @@ -595,8 +595,8 @@ public: _yh = dc_yh; _destorg = dc_destorg; _pitch = dc_pitch; - fuzzpos = ::fuzzpos; - fuzzviewheight = ::fuzzviewheight; + _fuzzpos = fuzzpos; + _fuzzviewheight = fuzzviewheight; } void Execute(DrawerThread *thread) override @@ -609,8 +609,8 @@ public: _yl = 1; // .. and high. - if (_yh > fuzzviewheight) - _yh = fuzzviewheight; + if (_yh > _fuzzviewheight) + _yh = _fuzzviewheight; count = thread->count_for_thread(_yl, _yh - _yl + 1); @@ -622,7 +622,7 @@ public: int pitch = _pitch * thread->num_cores; int fuzzstep = thread->num_cores; - int fuzz = (fuzzpos + thread->skipped_by_thread(_yl)) % FUZZTABLE; + int fuzz = (_fuzzpos + thread->skipped_by_thread(_yl)) % FUZZTABLE; while (count > 0) { @@ -640,9 +640,9 @@ public: uint32_t bg_green = (bg >> 8) & 0xff; uint32_t bg_blue = (bg) & 0xff; - uint32_t red = bg_red * 3 / 4; - uint32_t green = bg_green * 3 / 4; - uint32_t blue = bg_blue * 3 / 4; + uint32_t red = bg_red * 7 / 8; + uint32_t green = bg_green * 7 / 8; + uint32_t blue = bg_blue * 7 / 8; *dest = 0xff000000 | (red << 16) | (green << 8) | blue; dest += pitch; @@ -3896,7 +3896,13 @@ void R_FillRevSubClampColumn_rgba() void R_DrawFuzzColumn_rgba() { DrawerCommandQueue::QueueCommand(); - fuzzpos = (fuzzpos + dc_yh - dc_yl) % FUZZTABLE; + + if (dc_yl == 0) + dc_yl = 1; + if (dc_yh > fuzzviewheight) + dc_yh = fuzzviewheight; + + fuzzpos = (fuzzpos + dc_yh - dc_yl + 1) % FUZZTABLE; } void R_DrawAddColumn_rgba()