@@ -42,6 +42,10 @@ static uint32_t blendAddLUT[512][512]; // Additive blending
4242static uint32_t blendOverLUT [512 ][512 ]; // Overlay blending
4343static uint32_t blendOverAltLUT [512 ][512 ]; // Overlay "alt" blending
4444
45+ const uint32_t (* I_BlendAddFunc ) (const uint32_t bg_i , const uint32_t fg_i );
46+ const uint32_t (* I_BlendOverFunc ) (const uint32_t bg_i , const uint32_t fg_i , const int amount );
47+ //const uint32_t (*I_BlendOverAltFunc) (const uint32_t bg_i, const uint32_t fg_i);
48+
4549// [JN] Different blending alpha values for different games
4650#define OVERLAY_ALPHA_TRANMAP 168 // Doom: TRANMAP, 66% opacity
4751#define OVERLAY_ALPHA_TINTTAB 96 // Raven: TINTTAB, 38% opacity
@@ -176,7 +180,7 @@ const uint32_t I_BlendOverLow (const uint32_t bg_i, const uint32_t fg_i, const i
176180// [crispy] TRANMAP blending emulation, used for Doom
177181const uint32_t I_BlendOverTranmap (const uint32_t bg , const uint32_t fg )
178182{
179- return I_BlendOver (bg , fg , 0xA8 ); // 168 (66% opacity)
183+ return I_BlendOverFunc (bg , fg , 0xA8 ); // 168 (66% opacity)
180184}
181185
182186// [crispy] TINTTAB blending emulation, used for Heretic and Hexen
@@ -203,4 +207,21 @@ const uint32_t I_BlendOverAltXlatab (const uint32_t bg, const uint32_t fg)
203207 return I_BlendOver (bg , fg , 0x40 ); // 64 (25% opacity)
204208}
205209
210+ // [JN] Set pointers to blending functions.
211+ void R_InitBlendQuality (void )
212+ {
213+ if (crispy -> blendquality )
214+ {
215+ I_BlendAddFunc = I_BlendAdd ;
216+ I_BlendOverFunc = I_BlendOver ;
217+ // I_BlendOverAltFunc = I_BlendOverAlt;
218+ }
219+ else
220+ {
221+ I_BlendAddFunc = I_BlendAddLow ;
222+ I_BlendOverFunc = I_BlendOverLow ;
223+ // I_BlendOverAltFunc = I_BlendOverAltLow;
224+ }
225+ }
226+
206227#endif
0 commit comments