From 7d4b9c2d331dd5d9d24c357a4180be57b1cc9168 Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 3 Jan 2020 16:14:52 -0800 Subject: [PATCH] Yet another translucency function --- src/v_video.c | 8 ++++++++ src/v_video.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/src/v_video.c b/src/v_video.c index c3321ee54..40326ed86 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1764,6 +1764,14 @@ void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) } } +void V_DrawFillMaybeFade (INT32 x, INT32 y, INT32 w, INT32 h, INT32 c, UINT8 strength) +{ + if (strength > 9) + V_DrawFill(x, y, w, h, c); + else + V_DrawFadeFill(x, y, w, h, c, ( c & 255 ), strength); +} + // // If color is 0x00 to 0xFF, draw transtable (strength range 0-9). // Else, use COLORMAP lump (strength range 0-31). diff --git a/src/v_video.h b/src/v_video.h index e6ecebe62..6c0840ce3 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -180,6 +180,8 @@ void V_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatnum); void V_DrawFadeScreen(UINT16 color, UINT8 strength); // available to lua over my dead body, which will probably happen in this heat void V_DrawFadeFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c, UINT16 color, UINT8 strength); +/* Do you ever hate life? */ +void V_DrawFillMaybeFade(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c, UINT8 strength); void V_DrawFadeConsBack(INT32 plines); void V_DrawPromptBack(INT32 boxheight, INT32 color);