From 24b994d9524977979def4b4adbd902b8cc4bd5e9 Mon Sep 17 00:00:00 2001 From: terminx Date: Sat, 6 Jul 2019 16:30:23 +0000 Subject: [PATCH] One of those stupid optimizations you notice the potential for when scrolling through code looking for something git-svn-id: https://svn.eduke32.com/eduke32@7756 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/a-c.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/build/src/a-c.cpp b/source/build/src/a-c.cpp index 7d6bc0018..887ddcab8 100644 --- a/source/build/src/a-c.cpp +++ b/source/build/src/a-c.cpp @@ -690,21 +690,22 @@ void tspritevline(int32_t bx, int32_t by, bssize_t cnt, intptr_t bufplc, intptr_ } void setupdrawslab(int32_t dabpl, intptr_t pal) -{ bpl = dabpl; gpal = (char *)pal; } +{ + bpl = dabpl; + gpal = (char *)pal; +} void drawslab(int32_t dx, int32_t v, int32_t dy, int32_t vi, intptr_t vptr, intptr_t p) { - int32_t x; - - while (dy > 0) + do { - char c = gpal[(int32_t)(*(char *)((v>>16)+vptr))]; - for (x=0; x < dx; x++) + char const c = gpal[(int32_t)(*(char *)((v>>16)+vptr))]; + for (int x=0; x < dx; x++) ((char*)p)[x] = c; p += bpl; v += vi; - dy--; } + while (--dy); } #if 0