@@ -42,6 +42,10 @@ static uint32_t blendAddLUT[512][512]; // Additive blending
42
42
static uint32_t blendOverLUT [512 ][512 ]; // Overlay blending
43
43
static uint32_t blendOverAltLUT [512 ][512 ]; // Overlay "alt" blending
44
44
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
+
45
49
// [JN] Different blending alpha values for different games
46
50
#define OVERLAY_ALPHA_TRANMAP 168 // Doom: TRANMAP, 66% opacity
47
51
#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
176
180
// [crispy] TRANMAP blending emulation, used for Doom
177
181
const uint32_t I_BlendOverTranmap (const uint32_t bg , const uint32_t fg )
178
182
{
179
- return I_BlendOver (bg , fg , 0xA8 ); // 168 (66% opacity)
183
+ return I_BlendOverFunc (bg , fg , 0xA8 ); // 168 (66% opacity)
180
184
}
181
185
182
186
// [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)
203
207
return I_BlendOver (bg , fg , 0x40 ); // 64 (25% opacity)
204
208
}
205
209
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
+
206
227
#endif
0 commit comments