diff --git a/src/doom/r_draw.c b/src/doom/r_draw.c index f3f11120bd..c0288814ce 100644 --- a/src/doom/r_draw.c +++ b/src/doom/r_draw.c @@ -565,7 +565,9 @@ void R_DrawTranslatedColumn (void) // used with PLAY sprites. // Thus the "green" ramp of the player 0 sprite // is mapped to gray, red, black/indigo. - *dest = dc_colormap[0][dc_translation[dc_source[frac>>FRACBITS]]]; + // [crispy] brightmaps + const byte source = dc_source[frac>>FRACBITS]; + *dest = dc_colormap[dc_brightmap[source]][dc_translation[source]]; dest += SCREENWIDTH; frac += fracstep; @@ -615,8 +617,10 @@ void R_DrawTranslatedColumnLow (void) // used with PLAY sprites. // Thus the "green" ramp of the player 0 sprite // is mapped to gray, red, black/indigo. - *dest = dc_colormap[0][dc_translation[dc_source[frac>>FRACBITS]]]; - *dest2 = dc_colormap[0][dc_translation[dc_source[frac>>FRACBITS]]]; + // [crispy] brightmaps + const byte source = dc_source[frac>>FRACBITS]; + *dest = dc_colormap[dc_brightmap[source]][dc_translation[source]]; + *dest2 = dc_colormap[dc_brightmap[source]][dc_translation[source]]; dest += SCREENWIDTH; dest2 += SCREENWIDTH; @@ -652,11 +656,13 @@ void R_DrawTLColumn (void) do { + // [crispy] brightmaps + const byte source = dc_source[frac>>FRACBITS]; #ifndef CRISPY_TRUECOLOR // actual translucency map lookup taken from boom202s/R_DRAW.C:255 - *dest = tranmap[(*dest<<8)+dc_colormap[0][dc_source[frac>>FRACBITS]]]; + *dest = tranmap[(*dest<<8)+dc_colormap[dc_brightmap[source]][source]]; #else - const pixel_t destrgb = dc_colormap[0][dc_source[frac>>FRACBITS]]; + const pixel_t destrgb = dc_colormap[dc_brightmap[source]][source]; *dest = blendfunc(*dest, destrgb); #endif dest += SCREENWIDTH; @@ -699,11 +705,13 @@ void R_DrawTLColumnLow (void) do { + // [crispy] brightmaps + const byte source = dc_source[frac>>FRACBITS]; #ifndef CRISPY_TRUECOLOR - *dest = tranmap[(*dest<<8)+dc_colormap[0][dc_source[frac>>FRACBITS]]]; - *dest2 = tranmap[(*dest2<<8)+dc_colormap[0][dc_source[frac>>FRACBITS]]]; + *dest = tranmap[(*dest<<8)+dc_colormap[dc_brightmap[source]][source]]; + *dest2 = tranmap[(*dest2<<8)+dc_colormap[dc_brightmap[source]][source]]; #else - const pixel_t destrgb = dc_colormap[0][dc_source[frac>>FRACBITS]]; + const pixel_t destrgb = dc_colormap[dc_brightmap[source]][source]; *dest = blendfunc(*dest, destrgb); *dest2 = blendfunc(*dest2, destrgb); #endif diff --git a/src/heretic/r_draw.c b/src/heretic/r_draw.c index d5df44e9d8..7625cbec49 100644 --- a/src/heretic/r_draw.c +++ b/src/heretic/r_draw.c @@ -91,7 +91,7 @@ void R_DrawColumn(void) do { // [crispy] brightmaps - const byte source = dc_source[frac>>FRACBITS]; + const byte source = dc_source[frac >> FRACBITS]; *dest = dc_colormap[dc_brightmap[source]][source]; dest += SCREENWIDTH; if ((frac += fracstep) >= heightmask) @@ -213,12 +213,14 @@ void R_DrawTLColumn(void) do { + // [crispy] brightmaps + const byte source = dc_source[frac >> FRACBITS]; #ifndef CRISPY_TRUECOLOR *dest = tinttable[((*dest) << 8) + - dc_colormap[0][dc_source[frac >> FRACBITS]]]; + dc_colormap[dc_brightmap[source]][source]]; #else - const pixel_t destrgb = dc_colormap[0][dc_source[frac >> FRACBITS]]; + const pixel_t destrgb = dc_colormap[dc_brightmap[source]][source]; *dest = blendfunc(*dest, destrgb); #endif dest += SCREENWIDTH; @@ -230,12 +232,14 @@ void R_DrawTLColumn(void) { do { + // [crispy] brightmaps + const byte source = dc_source[(frac >> FRACBITS) & heightmask]; #ifndef CRISPY_TRUECOLOR *dest = tinttable[((*dest) << 8) + - dc_colormap[0][dc_source[(frac >> FRACBITS) & heightmask]]]; + dc_colormap[dc_brightmap[source]][source]]; #else - const pixel_t destrgb = dc_colormap[0][dc_source[(frac >> FRACBITS) & heightmask]]; + const pixel_t destrgb = dc_colormap[dc_brightmap[source]][source]; *dest = blendfunc(*dest, destrgb); #endif @@ -279,7 +283,9 @@ void R_DrawTranslatedColumn(void) do { - *dest = dc_colormap[0][dc_translation[dc_source[frac >> FRACBITS]]]; + // [crispy] brightmaps + const byte source = dc_source[frac>>FRACBITS]; + *dest = dc_colormap[dc_brightmap[source]][dc_translation[source]]; dest += SCREENWIDTH; frac += fracstep; } @@ -308,11 +314,12 @@ void R_DrawTranslatedTLColumn(void) do { + // [crispy] brightmaps + byte src = dc_translation[dc_source[frac >> FRACBITS]]; #ifndef CRISPY_TRUECOLOR *dest = tinttable[((*dest) << 8) + - dc_colormap[0][dc_translation - [dc_source[frac >> FRACBITS]]]]; + dc_colormap[dc_brightmap[src]][src]]; #else const pixel_t destrgb = dc_colormap[0][dc_translation[dc_source[frac >> FRACBITS]]]; *dest = blendfunc(*dest, destrgb); diff --git a/src/hexen/r_draw.c b/src/hexen/r_draw.c index 3e81515b68..d9dc69bdc4 100644 --- a/src/hexen/r_draw.c +++ b/src/hexen/r_draw.c @@ -208,8 +208,10 @@ void R_DrawTLColumn(void) do { + // [crispy] brightmaps + const byte source = dc_source[frac >> FRACBITS]; *dest = tinttable[*dest + - (dc_colormap[0][dc_source[frac >> FRACBITS]] << + (dc_colormap[dc_brightmap[source]][source] << 8)]; dest += SCREENWIDTH; if ((frac += fracstep) >= heightmask) @@ -220,8 +222,10 @@ void R_DrawTLColumn(void) { do { + // [crispy] brightmaps + const byte source = dc_source[(frac >> FRACBITS) & heightmask]; *dest = tinttable[*dest + - (dc_colormap[0][dc_source[(frac >> FRACBITS) & heightmask]] << + (dc_colormap[dc_brightmap[source]][source] << 8)]; dest += SCREENWIDTH; frac += fracstep; @@ -274,8 +278,10 @@ void R_DrawAltTLColumn(void) do { + // [crispy] brightmaps + const byte source = dc_source[frac >> FRACBITS]; *dest = tinttable[((*dest) << 8) - + dc_colormap[0][dc_source[frac >> FRACBITS]]]; + + dc_colormap[dc_brightmap[source]][source]]; dest += SCREENWIDTH; if ((frac += fracstep) >= heightmask) frac -= heightmask; @@ -285,8 +291,10 @@ void R_DrawAltTLColumn(void) { do { + // [crispy] brightmaps + const byte source = dc_source[(frac >> FRACBITS) & heightmask]; *dest = tinttable[((*dest) << 8) - + dc_colormap[0][dc_source[(frac >> FRACBITS) & heightmask]]]; + + dc_colormap[dc_brightmap[source]][source]]; dest += SCREENWIDTH; frac += fracstep; } while (count--); @@ -326,7 +334,9 @@ void R_DrawTranslatedColumn(void) do { - *dest = dc_colormap[0][dc_translation[dc_source[frac >> FRACBITS]]]; + // [crispy] brightmaps + const byte source = dc_source[frac >> FRACBITS]; + *dest = dc_colormap[dc_brightmap[source]][dc_translation[source]]; dest += SCREENWIDTH; frac += fracstep; } @@ -361,10 +371,11 @@ void R_DrawTranslatedTLColumn(void) do { + // [crispy] brightmaps + byte src = dc_translation[dc_source[frac >> FRACBITS]]; *dest = tinttable[((*dest) << 8) + - dc_colormap[0][dc_translation - [dc_source[frac >> FRACBITS]]]]; + dc_colormap[dc_brightmap[src]][src]]; dest += SCREENWIDTH; frac += fracstep; }