From ff0f0ee3472f69ec3133162a6965de535d7f95c3 Mon Sep 17 00:00:00 2001 From: Alug Date: Tue, 22 Oct 2024 01:15:52 +0200 Subject: [PATCH] make those not look terrible thx --- src/v_video.c | 62 +++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/src/v_video.c b/src/v_video.c index ffb213e56..d8624db5c 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1112,7 +1112,7 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) if (x >= vid.width || y >= vid.height) return; // off the screen - + if (x < 0) { w += x; @@ -1126,7 +1126,7 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) if (w <= 0 || h <= 0) return; // zero width/height wouldn't draw anything - + if (x + w > vid.width) w = vid.width-x; if (y + h > vid.height) @@ -1149,7 +1149,7 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) } c &= 255; - + if (alphalevel) { const UINT8 *fadetable = ((UINT8 *)transtables + ((alphalevel-1)< 1440) && (cv_highreshudscale.value > 1)) ? 3 : 1); - + UINT8 updistort = vid.dupx<<(rewind ? 5 : 3); updistort *= (((vid.height > 1440) && (cv_highreshudscale.value > 1)) ? 3 : 1); @@ -2499,7 +2499,7 @@ void V_DrawThinStringAtFixed(fixed_t x, fixed_t y, INT32 option, const char *str default: break; } - + charflags = (option & V_CHARCOLORMASK); colormap = V_GetStringColormap(charflags); @@ -3266,18 +3266,19 @@ void V_DoPostProcessor(INT32 view, player_t *player, INT32 param) } /* - * Unoptimized version - * for (x = 0; x < vid.width*vid.bpp; x++) - * { - * newpix = (x + sine); - * - * if (newpix < 0) - * newpix = 0; - * else if (newpix >= vid.width) - * newpix = vid.width-1; - * - * tmpscrwater[y*vid.width + x] = srcscr[y*vid.width+newpix]; // *(transme + (srcscr[y*vid.width+x]<<8) + srcscr[y*vid.width+newpix]); - }*/ + Unoptimized version + for (x = 0; x < vid.width*vid.bpp; x++) + { + newpix = (x + sine); + + if (newpix < 0) + newpix = 0; + else if (newpix >= vid.width) + newpix = vid.width-1; + + tmpscr[y*vid.width + x] = srcscr[y*vid.width+newpix]; // *(transme + (srcscr[y*vid.width+x]<<8) + srcscr[y*vid.width+newpix]); + }*/ + disStart += 22;//the offset into the displacement map, increment each game loop disStart &= FINEMASK; //clip it to FINEMASK } @@ -3288,21 +3289,18 @@ void V_DoPostProcessor(INT32 view, player_t *player, INT32 param) } /*if (player->postimgflags & POSTIMG_MOTION) // Motion Blur! - * { - * INT32 x, y; - * - * // TODO: Add a postimg_param so that we can pick the translucency level... - * UINT8 *transme = transtables + ((param-1)<postimgflags & POSTIMG_HEAT) // Heat wave {