From c4ee58cfab4b61ac0c87b9136903c1f05e703aee Mon Sep 17 00:00:00 2001 From: fickleheart Date: Tue, 9 Apr 2019 23:00:39 -0500 Subject: [PATCH] Only calculate vfx every other row to try to improve performance --- src/v_video.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/v_video.c b/src/v_video.c index 83bfff730..59522cb38 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1219,8 +1219,8 @@ void V_DrawVhsEffect(boolean rewind) static fixed_t upbary = 100, downbary = 150; UINT8 *buf = screens[0], *tmp = screens[4]; - UINT16 x, y; - UINT32 pos = 0; + UINT16 y; + UINT32 x, pos = 0; UINT8 *normalmapstart = ((UINT8 *)transtables + (8< vid.height) downbary = -barsize; - for (y = 0; y < vid.height; y++) + for (y = 0; y < vid.height; y+=2) { thismapstart = normalmapstart; offs = 0; @@ -1260,9 +1260,9 @@ void V_DrawVhsEffect(boolean rewind) // lazy way to avoid crashes if (y == 0 && offs < 0) offs = 0; - else if (y == vid.height-1 && offs > 0) offs = 0; + else if (y >= vid.height-2 && offs > 0) offs = 0; - for (x = 0; x < vid.rowbytes; x++, pos++) + for (x = pos+vid.rowbytes*2; pos < x; pos++) { tmp[pos] = thismapstart[buf[pos+offs]]; #ifdef HQ_VHS