From 6f86c11058ba2980aa85a4756d1bd6425ad8c81b Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sun, 25 Dec 2016 07:56:09 +0100 Subject: [PATCH] DrawWallAdd1Pal cannot do dynamic lights --- src/r_draw.cpp | 4 +++- src/r_draw_pal.cpp | 12 ++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/r_draw.cpp b/src/r_draw.cpp index f629c027d..ae039d642 100644 --- a/src/r_draw.cpp +++ b/src/r_draw.cpp @@ -669,8 +669,10 @@ namespace swrenderer { if (r_swtruecolor) DrawerCommandQueue::QueueCommand(); - else + else if (drawerargs::dc_num_lights == 0) DrawerCommandQueue::QueueCommand(); + else + DrawerCommandQueue::QueueCommand(); } void R_DrawWallAddCol4() diff --git a/src/r_draw_pal.cpp b/src/r_draw_pal.cpp index 630255340..a6b6a7946 100644 --- a/src/r_draw_pal.cpp +++ b/src/r_draw_pal.cpp @@ -387,10 +387,6 @@ namespace swrenderer uint8_t *dest = _dest; int bits = _fracbits; int pitch = _pitch; - TriLight *dynlights = _dynlights; - int num_dynlights = _num_dynlights; - float viewpos_z = _viewpos_z; - float step_viewpos_z = _step_viewpos_z; uint32_t *fg2rgb = _srcblend; uint32_t *bg2rgb = _destblend; @@ -403,8 +399,6 @@ namespace swrenderer frac += fracstep * thread->skipped_by_thread(_dest_y); fracstep *= thread->num_cores; pitch *= thread->num_cores; - viewpos_z += step_viewpos_z * thread->skipped_by_thread(_dest_y); - step_viewpos_z *= thread->num_cores; if (!r_blendmethod) { @@ -413,14 +407,13 @@ namespace swrenderer uint8_t pix = source[frac >> bits]; if (pix != 0) { - uint8_t lit = num_dynlights != 0 ? AddLights(dynlights, num_dynlights, viewpos_z, colormap[pix], pix) : colormap[pix]; + uint8_t lit = colormap[pix]; uint32_t fg = fg2rgb[lit]; uint32_t bg = bg2rgb[*dest]; fg = (fg + bg) | 0x1f07c1f; *dest = RGB32k.All[fg & (fg >> 15)]; } - viewpos_z += step_viewpos_z; frac += fracstep; dest += pitch; } while (--count); @@ -433,14 +426,13 @@ namespace swrenderer uint8_t pix = source[frac >> bits]; if (pix != 0) { - uint8_t lit = num_dynlights != 0 ? AddLights(dynlights, num_dynlights, viewpos_z, colormap[pix], pix) : colormap[pix]; + uint8_t lit = colormap[pix]; uint32_t r = MIN(GPalette.BaseColors[lit].r + GPalette.BaseColors[*dest].r, 255); uint32_t g = MIN(GPalette.BaseColors[lit].g + GPalette.BaseColors[*dest].g, 255); uint32_t b = MIN(GPalette.BaseColors[lit].b + GPalette.BaseColors[*dest].b, 255); *dest = RGB256k.RGB[r>>2][g>>2][b>>2]; } - viewpos_z += step_viewpos_z; frac += fracstep; dest += pitch; } while (--count);