From 82601e881b8296a0cb4ed6ae44c99976a5c30fda Mon Sep 17 00:00:00 2001 From: MPC Date: Mon, 17 Dec 2018 17:57:53 -0300 Subject: [PATCH] fix my fucking code --- src/v_video.c | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/v_video.c b/src/v_video.c index 796e6465f..2a5eca9d0 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -881,6 +881,7 @@ void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) { UINT8 *dest; INT32 u, v; + UINT8 *fadetable; UINT32 alphalevel = 0; if (rendermode == render_none) @@ -965,23 +966,20 @@ void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) c &= 255; - if (!alphalevel) { - for (v = 0; v < h; v++, dest += vid.width) { - for (u = 0; u < w; u++) { - dest[u] = consolebgmap[dest[u]]; - } - } - } else { // mpc 12-04-2018 - const UINT8 *fadetable = ((UINT8 *)transtables + ((alphalevel-1)<y) ? y : x - w = clip(w,vid.width); - h = clip(h,vid.height); - for (v = 0; v < h; v++, dest += vid.width) { - for (u = 0; u < w; u++) { - dest[u] = fadetable[consolebgmap[dest[u]]]; - } - } - } + // Jimita (12-04-2018) + w = min(w, vid.width); + h = min(h, vid.height); + if (alphalevel) // Use fadetable + fadetable = ((UINT8 *)transtables + ((alphalevel-1)<