diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 38d5a3b90..8ceec8604 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -534,7 +534,7 @@ int32_t qloadkvx(int32_t voxindex, const char *filename); int32_t allocatepermanenttile(int16_t tilenume, int32_t xsiz, int32_t ysiz); void copytilepiece(int32_t tilenume1, int32_t sx1, int32_t sy1, int32_t xsiz, int32_t ysiz, int32_t tilenume2, int32_t sx2, int32_t sy2); void makepalookup(int32_t palnum, char *remapbuf, int8_t r, int8_t g, int8_t b, char dastat); -void setvgapalette(void); +//void setvgapalette(void); void setbasepaltable(uint8_t **basepaltable, uint8_t basepalcount); void setbrightness(char dabrightness, uint8_t dapalid, char noapply); void setpalettefade(char r, char g, char b, char offset); diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 351c31408..571ea7020 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -12995,7 +12995,7 @@ void makepalookup(int32_t palnum, char *remapbuf, int8_t r, int8_t g, int8_t b, } } - +#if 0 void setvgapalette(void) { int32_t i; @@ -13008,6 +13008,7 @@ void setvgapalette(void) } setpalette(0,256); } +#endif // // setbasepaltable @@ -13097,9 +13098,9 @@ static inline palette_t getpal(int32_t col) p.b = britable[curbrightness][ curpalette[col].b ]; p.g = britable[curbrightness][ curpalette[col].g ]; p.r = britable[curbrightness][ curpalette[col].r ]; -#ifdef __APPLE__ +//#ifdef __APPLE__ p.f = 0; // make gcc on osx happy -#endif +//#endif return p; } } @@ -13966,6 +13967,8 @@ void drawcircle16(int32_t x1, int32_t y1, int32_t r, int32_t eccen, char col) intptr_t p; int32_t xp, yp, xpbpl, ypbpl, d, de, dse, patc=0; + uint32_t uxres = xres, uydim16 = ydim16; + if (r < 0) r = -r; if (x1+r < 0 || x1-r >= xres) return; if (y1+r < 0 || y1-r >= ydim16) return; @@ -13993,14 +13996,14 @@ void drawcircle16(int32_t x1, int32_t y1, int32_t r, int32_t eccen, char col) if (drawlinepat & pow2long[(patc++)&31]) { - if ((uint32_t)y1 < (uint32_t)ydim16 && (uint32_t)(x1+r) < (uint32_t)xres) - drawpixel_safe((char *)(p+r), col); // a - if ((uint32_t)x1 < (uint32_t)xres && (uint32_t)(y1+r) < (uint32_t)ydim16) - drawpixel_safe((char *)(p+(r*bytesperline)), col); // b - if ((uint32_t)y1 < (uint32_t)ydim16 && (uint32_t)(x1-r) < (uint32_t)xres) - drawpixel_safe((char *)(p-r), col); // c - if ((uint32_t)x1 < (uint32_t)xres && (uint32_t)(y1-r) < (uint32_t)ydim16) - drawpixel_safe((char *)(p-(r*bytesperline)), col); // d + if ((uint32_t)y1 < uydim16 && (uint32_t)(x1+r) < uxres) + drawpixel((char *)(p+r), col); // a + if ((uint32_t)x1 < uxres && (uint32_t)(y1+r) < uydim16) + drawpixel((char *)(p+(r*bytesperline)), col); // b + if ((uint32_t)y1 < uydim16 && (uint32_t)(x1-r) < uxres) + drawpixel((char *)(p-r), col); // c + if ((uint32_t)x1 < uxres && (uint32_t)(y1-r) < uydim16) + drawpixel((char *)(p-(r*bytesperline)), col); // d } do @@ -14025,21 +14028,21 @@ void drawcircle16(int32_t x1, int32_t y1, int32_t r, int32_t eccen, char col) xpbpl = xp*bytesperline; if (drawlinepat & pow2long[(patc++)&31]) { - if ((uint32_t)(x1+yp) < (uint32_t)xres && (uint32_t)(y1+xp) < (uint32_t)ydim16) + if ((uint32_t)(x1+yp) < uxres && (uint32_t)(y1+xp) < uydim16) drawpixel_safe((char *)(p+yp+xpbpl), col); // 1 - if ((uint32_t)(x1+xp) < (uint32_t)xres && (uint32_t)(y1+yp) < (uint32_t)ydim16) + if ((uint32_t)(x1+xp) < uxres && (uint32_t)(y1+yp) < uydim16) drawpixel_safe((char *)(p+xp+ypbpl), col); // 2 - if ((uint32_t)(x1-xp) < (uint32_t)xres && (uint32_t)(y1+yp) < (uint32_t)ydim16) + if ((uint32_t)(x1-xp) < uxres && (uint32_t)(y1+yp) < uydim16) drawpixel_safe((char *)(p-xp+ypbpl), col); // 3 - if ((uint32_t)(x1-yp) < (uint32_t)xres && (uint32_t)(y1+xp) < (uint32_t)ydim16) + if ((uint32_t)(x1-yp) < uxres && (uint32_t)(y1+xp) < uydim16) drawpixel_safe((char *)(p-yp+xpbpl), col); // 4 - if ((uint32_t)(x1-yp) < (uint32_t)xres && (uint32_t)(y1-xp) < (uint32_t)ydim16) + if ((uint32_t)(x1-yp) < uxres && (uint32_t)(y1-xp) < uydim16) drawpixel_safe((char *)(p-yp-xpbpl), col); // 5 - if ((uint32_t)(x1-xp) < (uint32_t)xres && (uint32_t)(y1-yp) < (uint32_t)ydim16) + if ((uint32_t)(x1-xp) < uxres && (uint32_t)(y1-yp) < uydim16) drawpixel_safe((char *)(p-xp-ypbpl), col); // 6 - if ((uint32_t)(x1+xp) < (uint32_t)xres && (uint32_t)(y1-yp) < (uint32_t)ydim16) + if ((uint32_t)(x1+xp) < uxres && (uint32_t)(y1-yp) < uydim16) drawpixel_safe((char *)(p+xp-ypbpl), col); // 7 - if ((uint32_t)(x1+yp) < (uint32_t)xres && (uint32_t)(y1-xp) < (uint32_t)ydim16) + if ((uint32_t)(x1+yp) < uxres && (uint32_t)(y1-xp) < uydim16) drawpixel_safe((char *)(p+yp-xpbpl), col); // 8 } } @@ -14069,70 +14072,6 @@ void drawcircle16(int32_t x1, int32_t y1, int32_t r, int32_t eccen, char col) } } -#if 0 -// -// qsetmode640350 -// -void qsetmode640350(void) -{ - if (qsetmode != 350) - { - if (setvideomode(640, 350, 8, fullscreen) < 0) - { - //fprintf(stderr, "Couldn't set 640x350 video mode for some reason.\n"); - return; - } - - xdim = xres; - ydim = yres; - -// setvgapalette(); - - ydim16 = 350; - halfxdim16 = 320; - midydim16 = 146; - - begindrawing(); //{{{ - clearbuf((char *)frameplace, (bytesperline*350L) >> 2, 0); - enddrawing(); //}}} - } - - qsetmode = 350; -} - - -// -// qsetmode640480 -// -void qsetmode640480(void) -{ - if (qsetmode != 480) - { - if (setvideomode(640, 480, 8, fullscreen) < 0) - { - //fprintf(stderr, "Couldn't set 640x480 video mode for some reason.\n"); - return; - } - - xdim = xres; - ydim = yres; - -// setvgapalette(); - - ydim16 = 336; - halfxdim16 = 320; - midydim16 = 200; - - begindrawing(); //{{{ - clearbuf((char *)(frameplace + (336l*bytesperline)), (bytesperline*144L) >> 2, 0x08080808l); - clearbuf((char *)frameplace, (bytesperline*336L) >> 2, 0L); - enddrawing(); //}}} - } - - qsetmode = 480; -} -#endif - // // qsetmodeany // @@ -14149,15 +14088,12 @@ void qsetmodeany(int32_t daxdim, int32_t daydim) xdim = xres; ydim = yres; -// setvgapalette(); - ydim16 = yres - STATUS2DSIZ2; halfxdim16 = xres >> 1; midydim16 = ydim16 >> 1; // scale(200,yres,480); begindrawing(); //{{{ - clearbuf((char *)(frameplace + (ydim16*bytesperline)), (bytesperline*STATUS2DSIZ2) >> 2, 0x08080808l); - clearbuf((char *)frameplace, (ydim16*bytesperline) >> 2, 0L); + Bmemset((char *)frameplace, 0, yres*bytesperline); enddrawing(); //}}} } @@ -14173,13 +14109,11 @@ void clear2dscreen(void) int32_t clearsz; begindrawing(); //{{{ - if (qsetmode == 350) clearsz = 350; + if (ydim16 <= yres-STATUS2DSIZ2) + clearsz = yres - STATUS2DSIZ2; else - { - if (ydim16 <= yres-STATUS2DSIZ2) clearsz = yres - STATUS2DSIZ2; - else clearsz = yres; - } - clearbuf((char *)frameplace, (bytesperline*clearsz) >> 2, 0); + clearsz = yres; + Bmemset((char *)frameplace, 0, bytesperline*clearsz); enddrawing(); //}}} } diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 7498bf122..8b6a5dcfc 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -677,6 +677,9 @@ void polymost_glreset() } polymost_cachesync(); +#ifdef DEBUGGINGAIDS + OSD_Printf("polymost_glreset()\n"); +#endif } // one-time initialization of OpenGL for polymost @@ -855,6 +858,9 @@ void invalidatecache(void) { int32_t i; +#ifdef DEBUGGINGAIDS + OSD_Printf("invalidatecache()\n"); +#endif r_downsizevar = r_downsize; // update the cvar representation when the menu changes r_downsize polymost_glreset(); @@ -1993,7 +1999,10 @@ void drawpoly(double *dpx, double *dpy, int32_t n, int32_t method) // backup of the n for possible redrawing of fullbright int32_t n_ = n, method_ = method; - if (method == -1 || g_nodraw) return; + if (method == -1) return; +#ifdef YAX_ENABLE + if (g_nodraw) return; +#endif if (n == 3) { diff --git a/polymer/eduke32/build/src/sdlayer.c b/polymer/eduke32/build/src/sdlayer.c index 837422fe6..ab0c12021 100644 --- a/polymer/eduke32/build/src/sdlayer.c +++ b/polymer/eduke32/build/src/sdlayer.c @@ -990,7 +990,7 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs) } attributes[] = { -#if 0 +# if 0 { SDL_GL_RED_SIZE, 8 }, { SDL_GL_GREEN_SIZE, 8 }, { SDL_GL_BLUE_SIZE, 8 }, @@ -1002,14 +1002,14 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs) { SDL_GL_ACCUM_BLUE_SIZE, 0 }, { SDL_GL_ACCUM_ALPHA_SIZE, 0 }, { SDL_GL_DEPTH_SIZE, 24 }, -#endif +# endif { SDL_GL_DOUBLEBUFFER, 1 }, { SDL_GL_MULTISAMPLEBUFFERS, glmultisample > 0 }, { SDL_GL_MULTISAMPLESAMPLES, glmultisample }, { SDL_GL_STENCIL_SIZE, 1 }, -#if (SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION < 3) +# if (SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION < 3) { SDL_GL_SWAP_CONTROL, vsync }, -#endif +# endif }; if (nogl) return -1; @@ -1034,7 +1034,7 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs) /* HACK: changing SDL GL attribs only works before surface creation, so we have to create a new surface in a different format first to force the surface we WANT to be recreated instead of reused. */ -#if (SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION < 3) +# if (SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION < 3) if (vsync != ovsync) { if (sdl_surface) @@ -1045,7 +1045,7 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs) } ovsync = vsync; } -#endif +# endif sdl_surface = SDL_SetVideoMode(x, y, c, SDL_OPENGL | ((fs&1)?SDL_FULLSCREEN:0)); if (!sdl_surface) { @@ -1062,7 +1062,7 @@ int32_t setvideomode(int32_t x, int32_t y, int32_t c, int32_t fs) while (multisamplecheck--); } else -#endif +#endif // defined USE_OPENGL { initprintf("Setting video mode %dx%d (%d-bpp %s)\n", x,y,c, ((fs&1) ? "fullscreen" : "windowed")); @@ -1648,9 +1648,9 @@ int32_t handleevents(void) } break; */ -// #print "Using SDL 1.3" +// #warning "Using SDL 1.3" #else // SDL 1.3 ^^^ | vvv SDL 1.2 -// #print "Using SDL 1.2" +// #warning "Using SDL 1.2" case SDL_KEYDOWN: case SDL_KEYUP: code = keytranslation[ev.key.keysym.sym];