From 66864ebee51089dfa1aaabfaebad96554fc3c1d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Deuc=D0=B5?= <shurd@sasktel.net> Date: Fri, 10 Jan 2025 16:57:18 -0500 Subject: [PATCH] Save moving the "new" row Previously, we actually moved one more line back than we had to. This only moves lines back that need to remain where they were. This shaves another couple seconds off the benchmark. --- src/conio/bitmap_con.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/conio/bitmap_con.c b/src/conio/bitmap_con.c index ff0fabbe90..8f63b2a783 100644 --- a/src/conio/bitmap_con.c +++ b/src/conio/bitmap_con.c @@ -1400,13 +1400,12 @@ bitmap_movetext_screen(int x, int y, int tox, int toy, int direction, int height direction = 1; else direction = -1; - height = vstat.rows - height; + height = vstat.rows - (height + (y - toy)); // If everything was moved, there's no lines to move back - if (height <= y - toy) + if (height <= 0) return; - int otoy = toy; - toy = vstat.rows - (y - toy); - y = toy - (y - otoy); + toy = vstat.rows - (height - 1); + y = toy - (height); } int maxpos = screena.screenwidth * screena.screenheight; -- GitLab