From 701c69fecc2b3d0acff1c0627b4d96170d3a4e77 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Thu, 15 Sep 2011 17:03:50 +0000 Subject: [PATCH] misc. cleanup: - remove 'imageSize' global which was always yres*bytesperline and only used once - some clearbuf() -> Bmemset() because I find the latter easier to read - remove some clearbufs to 0 of some global arrays on init git-svn-id: https://svn.eduke32.com/eduke32@2023 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/baselayer.h | 2 +- polymer/eduke32/build/src/engine.c | 8 ++++---- polymer/eduke32/build/src/sdlayer.c | 5 +---- polymer/eduke32/build/src/winlayer.c | 4 ---- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/polymer/eduke32/build/include/baselayer.h b/polymer/eduke32/build/include/baselayer.h index bca606b43..e935b0e04 100644 --- a/polymer/eduke32/build/include/baselayer.h +++ b/polymer/eduke32/build/include/baselayer.h @@ -31,7 +31,7 @@ extern int32_t startwin_idle(void *); // video extern int32_t r_usenewaspect, newaspect_enable; extern uint32_t r_screenxy; -extern int32_t xres, yres, bpp, fullscreen, bytesperline, imageSize; +extern int32_t xres, yres, bpp, fullscreen, bytesperline; extern intptr_t frameplace; extern char offscreenrendering; diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 53c3c280f..b7911255b 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -7655,12 +7655,13 @@ int32_t initengine(void) searchit = 0; searchstat = -1; for (i=0; i>5),0L); clearbuf(&show2dsprite[0],(int32_t)((MAXSPRITES+3)>>5),0L); clearbuf(&show2dwall[0],(int32_t)((MAXWALLS+3)>>5),0L); +*/ // automapping = 0; totalclock = 0; @@ -7971,7 +7972,7 @@ void drawrooms(int32_t daposx, int32_t daposy, int32_t daposz, while ((numbunches > 0) && (numhits > 0)) { - clearbuf(&tempbuf[0],(int32_t)((numbunches+3)>>2),0L); + Bmemset(tempbuf, 0, numbunches); tempbuf[0] = 1; closest = 0; //Almost works, but not quite :( @@ -13242,8 +13243,7 @@ void clearallviews(int32_t dacol) #endif begindrawing(); //{{{ - //clearbufbyte((void*)frameplace,imageSize,0L); - Bmemset((void *)frameplace,dacol,imageSize); + Bmemset((void *)frameplace,dacol,bytesperline*yres); enddrawing(); //}}} //nextpage(); diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index 44dca2ddf..0418643ad 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -60,7 +60,7 @@ char quitevent=0, appactive=1, novideo=0; // video static SDL_Surface *sdl_surface; -int32_t xres=-1, yres=-1, bpp=0, fullscreen=0, bytesperline, imageSize; +int32_t xres=-1, yres=-1, bpp=0, fullscreen=0, bytesperline; intptr_t frameplace=0; int32_t lockcount=0; char modechange=1; @@ -1266,7 +1266,6 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs) bpp = c; fullscreen = fs; //bytesperline = sdl_surface->pitch; - //imageSize = bytesperline*yres; numpages = c>8?2:1; frameplace = 0; lockcount = 0; @@ -1320,7 +1319,6 @@ void begindrawing(void) if (offscreenrendering) return; frameplace = 0; bytesperline = 0; - imageSize = 0; modechange = 0; return; } @@ -1337,7 +1335,6 @@ void begindrawing(void) if (sdl_surface->pitch != bytesperline || modechange) { bytesperline = sdl_surface->pitch; - imageSize = bytesperline*yres; setvlinebpl(bytesperline); j = 0; diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index 4c7d90e10..f71c302a1 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -111,7 +111,6 @@ int32_t yres=-1; int32_t fullscreen=0; int32_t bpp=0; int32_t bytesperline=0; -int32_t imageSize=0; int32_t lockcount=0; int32_t glcolourdepth=32; int32_t vsync=0; @@ -1935,7 +1934,6 @@ void begindrawing(void) if (offscreenrendering) return; frameplace = 0; bytesperline = 0; - imageSize = 0; modechange = 0; return; } @@ -1960,7 +1958,6 @@ void begindrawing(void) bytesperline = xres|1; } - imageSize = bytesperline*yres; setvlinebpl(bytesperline); { @@ -3230,7 +3227,6 @@ static BOOL CreateAppWindow(int32_t modenum) // bytesperline is set when framebuffer is locked //bytesperline = width; - //imageSize = bytesperline*yres; modechange = 1; OSD_ResizeDisplay(xres,yres);