From 8cd5bb68d0e2826446aa62f950fdd0f250c24077 Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 14 Apr 2009 04:20:37 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@1317 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/mdsprite.c | 4 +-- polymer/eduke32/build/src/polymer.c | 20 ++++++++++++--- polymer/eduke32/build/src/polymost.c | 3 ++- polymer/eduke32/source/actors.c | 38 ++++++++++++++++++++++++++++ polymer/eduke32/source/game.c | 4 +++ polymer/eduke32/source/player.c | 14 +++++----- 6 files changed, 69 insertions(+), 14 deletions(-) diff --git a/polymer/eduke32/build/src/mdsprite.c b/polymer/eduke32/build/src/mdsprite.c index 0aed4cd33..8b2436626 100644 --- a/polymer/eduke32/build/src/mdsprite.c +++ b/polymer/eduke32/build/src/mdsprite.c @@ -93,8 +93,8 @@ void freeallmodels() { bglDeleteBuffersARB(allocvbos, indexvbos); bglDeleteBuffersARB(allocvbos, vertvbos); - free(indexvbos); - free(vertvbos); +// free(indexvbos); +// free(vertvbos); allocvbos = 0; } } diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index 5c506020a..85c5fcff8 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -2839,6 +2839,7 @@ static void polymer_drawmdsprite(spritetype *tspr) color[0] *= (float)hictinting[tspr->pal].r / 255.0; color[1] *= (float)hictinting[tspr->pal].g / 255.0; color[2] *= (float)hictinting[tspr->pal].b / 255.0; + if (hictinting[MAXPALOOKUPS-1].r != 255 || hictinting[MAXPALOOKUPS-1].g != 255 || hictinting[MAXPALOOKUPS-1].b != 255) { color[0] *= (float)hictinting[MAXPALOOKUPS-1].r / 255.0; @@ -3164,13 +3165,24 @@ static void polymer_getbuildmaterial(_prmaterial* material, int16_t tile material->diffusemodulation[2] = ((float)(numpalookups-min(max(shade*shadescale,0),numpalookups)))/((float)numpalookups); - if (pth && (pth->flags & 2) && (pth->palnum != pal)) + if (pth && (pth->flags & 2)) { - material->diffusemodulation[0] *= (float)hictinting[pal].r / 255.0; - material->diffusemodulation[1] *= (float)hictinting[pal].g / 255.0; - material->diffusemodulation[2] *= (float)hictinting[pal].b / 255.0; + if (pth->palnum != pal) + { + material->diffusemodulation[0] *= (float)hictinting[pal].r / 255.0; + material->diffusemodulation[1] *= (float)hictinting[pal].g / 255.0; + material->diffusemodulation[2] *= (float)hictinting[pal].b / 255.0; + } + + if (hictinting[MAXPALOOKUPS-1].r != 255 || hictinting[MAXPALOOKUPS-1].g != 255 || hictinting[MAXPALOOKUPS-1].b != 255) + { + material->diffusemodulation[0] *= (float)hictinting[MAXPALOOKUPS-1].r / 255.0; + material->diffusemodulation[1] *= (float)hictinting[MAXPALOOKUPS-1].g / 255.0; + material->diffusemodulation[2] *= (float)hictinting[MAXPALOOKUPS-1].b / 255.0; + } } + // PR_BIT_SPECULAR_MAP if (hicfindsubst(tilenum, 101, 0)) { diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 82545b861..6303bc1a8 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -696,6 +696,8 @@ void polymost_glreset() if (polymosttext) bglDeleteTextures(1,&polymosttext); polymosttext=0; + freevbos(); + memset(gltexcachead,0,sizeof(gltexcachead)); glox1 = -1; @@ -737,7 +739,6 @@ void polymost_glreset() } firstcacheindex.next = NULL; } - freevbos(); } // one-time initialization of OpenGL for polymost diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 70f18d391..0e313b12d 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -592,6 +592,44 @@ static void G_MoveZombieActors(void) { if (x < 30000) { + switch (DynamicTileMap[s->picnum]) + { + case FLOORFLAME__STATIC: + case FIREBARREL__STATIC: + case FIREVASE__STATIC: + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z, 4096, 255+(80<<8),0); + break; + case ATOMICHEALTH__STATIC: + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z, 2048, 128+(128<<8)+(255<<16),0); + break; + + case FIRE__STATIC: + case FIRE2__STATIC: + if (ActorExtra[i].floorz - ActorExtra[i].ceilingz < 128) break; + if (s->z > ActorExtra[i].floorz+2048) break; + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z, 64 * s->xrepeat, 255+(80<<8),0); + break; + case BURNING__STATIC: + case BURNING2__STATIC: + if (ActorExtra[i].floorz - ActorExtra[i].ceilingz < 128) break; + if (s->z > ActorExtra[i].floorz + 2048) break; + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z, 64 * s->xrepeat, 255+(80<<8),0); + break; + + case EXPLOSION2__STATIC: + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z, 4096, 255+(80<<8),0); + break; + case FORCERIPPLE__STATIC: + // case TRANSPORTERSTAR__STATIC: + case TRANSPORTERBEAM__STATIC: + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z, 2048, 80+(80<<8)+(255<<16),0); + break; + case SHRINKEREXPLOSION__STATIC: + G_AddGameLight(0, s->sectnum, s->x, s->y, s->z, 2048, 128+(255<<8)+(128<<16),0); + break; + + } + ActorExtra[i].timetosleep++; if (ActorExtra[i].timetosleep >= (x>>8)) { diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index c2d093b01..cac7441b8 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -7369,6 +7369,8 @@ PALONLY: case TECHSWITCH__STATIC: case ACCESSSWITCH__STATIC: case ACCESSSWITCH2__STATIC: + if (!inside(t->x+((sintable[(t->ang+512)&2047])>>9), t->y+((sintable[(t->ang)&2047])>>9), t->sectnum)) + break; framelights[framelightcount & (PR_MAXLIGHTS-1)].radius = 0; framelights[framelightcount & (PR_MAXLIGHTS-1)].sector = t->sectnum; @@ -7408,6 +7410,8 @@ PALONLY: case TECHSWITCH__STATIC: case ACCESSSWITCH__STATIC: case ACCESSSWITCH2__STATIC: + if (!inside(t->x+((sintable[(t->ang+512)&2047])>>9), t->y+((sintable[(t->ang)&2047])>>9), t->sectnum)) + break; framelights[framelightcount & (PR_MAXLIGHTS-1)].radius = 0; framelights[framelightcount & (PR_MAXLIGHTS-1)].sector = t->sectnum; diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 033dad219..10ea7f333 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -354,11 +354,11 @@ int32_t A_Shoot(int32_t i,int32_t atwith) case RPG__STATIC: case MORTER__STATIC: G_AddGameLight(0, s->sectnum, s->x+((sintable[(s->ang+512)&2047])>>7), - s->y+((sintable[(s->ang)&2047])>>7), s->z-PHEIGHT, 4096, 255+(80<<8),0); + s->y+((sintable[(s->ang)&2047])>>7), s->z-PHEIGHT, 4096, 255+(80<<8),0); gamelights[gamelightcount&(PR_MAXLIGHTS-1)].sector = s->sectnum; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = s->x+((sintable[(s->ang+512)&2047])>>7); - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].y = s->y+((sintable[(s->ang)&2047])>>7); + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = s->x+((sintable[(s->ang+512)&2047])>>4); + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].y = s->y+((sintable[(s->ang)&2047])>>4); gamelights[gamelightcount&(PR_MAXLIGHTS-1)].z = s->z-PHEIGHT; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].range = 8192; @@ -2151,11 +2151,11 @@ void P_FireWeapon(DukePlayer_t *p) p->visibility = 0; G_AddGameLight(0, s->sectnum, s->x+((sintable[(p->ang+512)&2047])>>7), s->y+((sintable[(p->ang)&2047])>>7), - s->z-PHEIGHT, 4096, aplWeaponFlashColor[p->curr_weapon][snum],0); + s->z-PHEIGHT, 4096, aplWeaponFlashColor[p->curr_weapon][snum],0); gamelights[gamelightcount&(PR_MAXLIGHTS-1)].sector = s->sectnum; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = s->x+((sintable[(p->ang+512)&2047])>>7); - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].y = s->y+((sintable[(p->ang)&2047])>>7); + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = s->x+((sintable[(p->ang+512)&2047])>>4); + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].y = s->y+((sintable[(p->ang)&2047])>>4); gamelights[gamelightcount&(PR_MAXLIGHTS-1)].z = s->z-PHEIGHT; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].range = 8192; @@ -2169,7 +2169,7 @@ void P_FireWeapon(DukePlayer_t *p) gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[1] = (aplWeaponFlashColor[p->curr_weapon][snum]>>8)&255; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[2] = (aplWeaponFlashColor[p->curr_weapon][snum]>>16)&255;; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = 2; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = 1; if (gamelightcount < PR_MAXLIGHTS) gamelightcount++;