mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-29 15:32:54 +00:00
Fix true color light calculation bug for decals
This commit is contained in:
parent
47f32d03cd
commit
41537a50ab
3 changed files with 10 additions and 10 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue