diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 8e3e13bc9..4289fda85 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -4438,7 +4438,7 @@ static inline void polymer_culllight(int16_t lighti) drawingstate[light->sector] = 1; prlights[lighti].planecnt = 0; - Bmemset(prlights[lighti].myplanes, 0, sizeof(intptr_t) * (PR_MAXLIGHTS<<1)); +// Bmemset(prlights[lighti].myplanes, 0, sizeof(intptr_t) * (PR_MAXLIGHTS<<1)); sectorqueue[0] = light->sector; @@ -4452,16 +4452,16 @@ static inline void polymer_culllight(int16_t lighti) j = 0; if (polymer_planeinlight(&s->floor, light)) { - // this lets us skip the polymer_planeinlight check for the ceiling when we know it will pass - // I doubt this saves us much but it might be faster on complex sectors than the loop - if (!light->radius && - ((light->z - getceilzofslope(light->sector, light->x, light->y)) >> 4) < light->range) - j++; + // this lets us skip the polymer_planeinlight check for the ceiling when we know the result already + // I doubt this saves us much but it might be faster on complex sectors than the planeinlight loop + if (!light->radius && ((light->z - getceilzofslope(light->sector, light->x, light->y)) >> 4) < light->range) + j = 1; + else j = 2; polymer_addplanelight(&s->floor, lighti); } - if (j /*|| polymer_planeinlight(&s->ceil, light)*/) { + if (j == 1 || (j == 0 && polymer_planeinlight(&s->ceil, light))) { polymer_addplanelight(&s->ceil, lighti); } diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index 7031a5b10..0d1d31e57 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -3367,8 +3367,7 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp) glinfo.extensions = (char *)bglGetString(GL_EXTENSIONS); // GL driver blacklist - if (!forcegl) - { + if (!Bstrcmp(glinfo.vendor,"Microsoft Corporation")) err = 1; else if (!Bstrcmp(glinfo.vendor,"SiS")) err = 1; else if (!Bstrcmp(glinfo.vendor,"3Dfx Interactive Inc.")) err = 1; @@ -3382,8 +3381,15 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp) err = 0; else err = 1; } - - if (err) +#ifdef POLYMER + else + { + if (!Bstrcmp(glinfo.vendor,"ATI Technologies Inc.")) + pr_atiworkaround = 1; + else pr_atiworkaround = 0; + } +#endif + if (!forcegl && err) { OSD_Printf("Unsupported OpenGL driver detected. GL modes will be unavailable. Use -forcegl to override.\n"); wm_msgbox("Unsupported OpenGL driver", "Unsupported OpenGL driver detected. GL modes will be unavailable."); @@ -3394,7 +3400,6 @@ static int32_t SetupOpenGL(int32_t width, int32_t height, int32_t bitspp) getvalidmodes(); return TRUE; } - } glinfo.maxanisotropy = 1.0; glinfo.bgra = 0; diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 68f416a30..94faf174f 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -601,7 +601,7 @@ inline void G_AddGameLight(int32_t radius, int32_t srcsprite, int32_t zoffset, i mylight.color[1] = (color>>8)&255; mylight.color[2] = (color>>16)&255; mylight.radius = radius; - ActorExtra[srcsprite].maxrange = mylight.range = range; + ActorExtra[srcsprite].lightmaxrange = mylight.range = range; mylight.priority = priority; @@ -612,11 +612,11 @@ inline void G_AddGameLight(int32_t radius, int32_t srcsprite, int32_t zoffset, i } s->z -= zoffset; - if (range > ActorExtra[srcsprite].maxrange || + if (range > ActorExtra[srcsprite].lightmaxrange || Bmemcmp(&sprite[srcsprite], ActorExtra[srcsprite].lightptr, sizeof(int32_t) * 3)) { - if (range > ActorExtra[srcsprite].maxrange) - ActorExtra[srcsprite].maxrange = range; + if (range > ActorExtra[srcsprite].lightmaxrange) + ActorExtra[srcsprite].lightmaxrange = range; Bmemcpy(ActorExtra[srcsprite].lightptr, &sprite[srcsprite], sizeof(int32_t) * 3); ActorExtra[srcsprite].lightptr->sector = s->sectnum; diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index a90d52ff4..09824b0e5 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -546,11 +546,13 @@ typedef struct { char cgg; char filler; projectile_t projectile; -#ifdef POLYMER int16_t lightId; int16_t lightcount; // how many tics until light is killed - int16_t maxrange; + int16_t lightmaxrange; +#ifdef POLYMER _prlight *lightptr; +#else + void *lightptr; #endif } ActorData_t;