From 15741da0a486b4724cca4eb19acf15c3d26275d6 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 28 Nov 2021 20:18:41 +0000 Subject: [PATCH] Improve some of the efficiency loss in F_DoWipe compared to K.S.'s 2.1 code by seperating out some of the loops. --- src/f_wipe.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/f_wipe.c b/src/f_wipe.c index ddc719e6d..db343d050 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -299,16 +299,23 @@ static void F_DoWipe(fademask_t *fademask, lighttable_t *fadecolormap, boolean r e = e_base + relativepos; draw_rowstogo = draw_rowend - draw_rowstart; - while (draw_rowstogo--) + if (fadecolormap) { - if (fadecolormap != NULL) + if (reverse) + s = e; + while (draw_rowstogo--) + *w++ = fadecolormap[ ( m << 8 ) + *s++ ]; + } + else while (draw_rowstogo--) + { + /*if (fadecolormap != NULL) { if (reverse) *w++ = fadecolormap[ ( m << 8 ) + *e++ ]; else *w++ = fadecolormap[ ( m << 8 ) + *s++ ]; } - else + else*/ *w++ = transtbl[ ( *e++ << 8 ) + *s++ ]; }