From 993b971107be43cac2d4d5ce7560c6d81b255a76 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 22 Mar 2012 22:46:23 +0000 Subject: [PATCH] editor: Factor out 'rainbow' drawing code and use bytesperline instead of xdimen. git-svn-id: https://svn.eduke32.com/eduke32@2513 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/engine.c | 40 ++++++++++++++++++------------ 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 43d9282d1..64bd31710 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -196,6 +196,7 @@ inline int32_t getscreenvdisp(int32_t bz, int32_t zoome); void screencoords(int32_t *xres, int32_t *yres, int32_t x, int32_t y, int32_t zoome); static void scansector(int16_t sectnum); +static void draw_rainbow_background(void); int16_t editstatus = 0; @@ -983,19 +984,7 @@ void yax_drawrooms(void (*ExtAnalyzeSprites)(void), int32_t horiz, int16_t sectn if (getrendermode()==0) { begindrawing(); - { - const int32_t dimenprod = xdimen*ydimen; - char *const p = (char *)frameplace; - - j = 0; - for (i=0; i= xdimen) - j = 0; - } - } + draw_rainbow_background(); enddrawing(); } #ifdef USE_OPENGL @@ -1122,8 +1111,28 @@ void yax_drawrooms(void (*ExtAnalyzeSprites)(void), int32_t horiz, int16_t sectn #endif } -#endif +#endif // defined YAX_ENABLE +// must have writable frame buffer, i.e. done begindrawing() +static void draw_rainbow_background(void) +{ + int32_t i, j; + const int32_t dimenprod = bytesperline*ydimen; + char *const p = (char *)frameplace; + + j = 0; + for (i=0; i= xdimen) + { + while (j < bytesperline) + i++, j++; + j = 0; + } + } +} // // setslope // @@ -8300,8 +8309,7 @@ void drawrooms(int32_t daposx, int32_t daposy, int32_t daposz, if (!g_nodraw) #endif if (numyaxbunches==0) - for (i=0; i