Fix true color light calculation bug for decals

This commit is contained in:
Magnus Norddahl 2016-06-02 16:52:41 +02:00
parent 47f32d03cd
commit 41537a50ab
3 changed files with 10 additions and 10 deletions

View file

@ -416,7 +416,7 @@ void R_FillAddColumn_RGBA_C()
dest = (uint32_t*)dc_dest;
int pitch = dc_pitch;
uint32_t fg = shade_pal_index(dc_color, calc_light_multiplier(0));
uint32_t fg = shade_pal_index(dc_color, calc_light_multiplier(dc_light));
uint32_t fg_red = (fg >> 24) & 0xff;
uint32_t fg_green = (fg >> 16) & 0xff;
uint32_t fg_blue = fg & 0xff;
@ -481,7 +481,7 @@ void R_FillAddClampColumn_RGBA()
dest = (uint32_t*)dc_dest;
int pitch = dc_pitch;
uint32_t fg = shade_pal_index(dc_color, calc_light_multiplier(0));
uint32_t fg = shade_pal_index(dc_color, calc_light_multiplier(dc_light));
uint32_t fg_red = (fg >> 24) & 0xff;
uint32_t fg_green = (fg >> 16) & 0xff;
uint32_t fg_blue = fg & 0xff;
@ -545,7 +545,7 @@ void R_FillSubClampColumn_RGBA()
dest = (uint32_t*)dc_dest;
int pitch = dc_pitch;
uint32_t fg = shade_pal_index(dc_color, calc_light_multiplier(0));
uint32_t fg = shade_pal_index(dc_color, calc_light_multiplier(dc_light));
uint32_t fg_red = (fg >> 24) & 0xff;
uint32_t fg_green = (fg >> 16) & 0xff;
uint32_t fg_blue = fg & 0xff;
@ -609,7 +609,7 @@ void R_FillRevSubClampColumn_RGBA()
dest = (uint32_t*)dc_dest;
int pitch = dc_pitch;
uint32_t fg = shade_pal_index(dc_color, calc_light_multiplier(0));
uint32_t fg = shade_pal_index(dc_color, calc_light_multiplier(dc_light));
uint32_t fg_red = (fg >> 24) & 0xff;
uint32_t fg_green = (fg >> 16) & 0xff;
uint32_t fg_blue = fg & 0xff;

View file

@ -413,7 +413,7 @@ void rt_shaded1col_RGBA_c (int hx, int sx, int yl, int yh)
source = &dc_temp_rgba[yl*4 + hx];
pitch = dc_pitch;
uint32_t fg = shade_pal_index(dc_color, calc_light_multiplier(0));
uint32_t fg = shade_pal_index(dc_color, calc_light_multiplier(dc_light));
uint32_t fg_red = (fg >> 16) & 0xff;
uint32_t fg_green = (fg >> 8) & 0xff;
uint32_t fg_blue = fg & 0xff;
@ -455,7 +455,7 @@ void rt_shaded4cols_RGBA_c (int sx, int yl, int yh)
source = &dc_temp_rgba[yl*4];
pitch = dc_pitch;
uint32_t fg = shade_pal_index(dc_color, calc_light_multiplier(0));
uint32_t fg = shade_pal_index(dc_color, calc_light_multiplier(dc_light));
uint32_t fg_red = (fg >> 16) & 0xff;
uint32_t fg_green = (fg >> 8) & 0xff;
uint32_t fg_blue = fg & 0xff;

View file

@ -416,7 +416,7 @@ void R_DrawVisSprite (vissprite_t *vis)
{ // For shaded sprites, R_SetPatchStyle sets a dc_colormap to an alpha table, but
// it is the brightest one. We need to get back to the proper light level for
// this sprite.
dc_colormap += vis->ColormapNum << COLORMAPSHIFT;
R_SetColorMapLight(dc_colormap, 0, vis->ColormapNum << FRACBITS);
}
if (mode != DontDraw)
@ -2704,9 +2704,9 @@ void R_DrawParticle_RGBA(vissprite_t *vis)
uint32_t bg_green = (*dest >> 8) & 0xff;
uint32_t bg_blue = (*dest) & 0xff;
uint32_t red = (fg_red + bg_red * alpha) / 256;
uint32_t green = (fg_green + bg_green * alpha) / 256;
uint32_t blue = (fg_blue + bg_blue * alpha) / 256;
uint32_t red = (fg_red + bg_red * inv_alpha) / 256;
uint32_t green = (fg_green + bg_green * inv_alpha) / 256;
uint32_t blue = (fg_blue + bg_blue * inv_alpha) / 256;
*dest = 0xff000000 | (red << 16) | (green << 8) | blue;
dest += spacing;