git-svn-id: https://svn.eduke32.com/eduke32@1317 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2009-04-14 04:20:37 +00:00
parent 3d7a6a3572
commit 8cd5bb68d0
6 changed files with 69 additions and 14 deletions

View file

@ -93,8 +93,8 @@ void freeallmodels()
{ {
bglDeleteBuffersARB(allocvbos, indexvbos); bglDeleteBuffersARB(allocvbos, indexvbos);
bglDeleteBuffersARB(allocvbos, vertvbos); bglDeleteBuffersARB(allocvbos, vertvbos);
free(indexvbos); // free(indexvbos);
free(vertvbos); // free(vertvbos);
allocvbos = 0; allocvbos = 0;
} }
} }

View file

@ -2839,6 +2839,7 @@ static void polymer_drawmdsprite(spritetype *tspr)
color[0] *= (float)hictinting[tspr->pal].r / 255.0; color[0] *= (float)hictinting[tspr->pal].r / 255.0;
color[1] *= (float)hictinting[tspr->pal].g / 255.0; color[1] *= (float)hictinting[tspr->pal].g / 255.0;
color[2] *= (float)hictinting[tspr->pal].b / 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) 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; 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] = material->diffusemodulation[2] =
((float)(numpalookups-min(max(shade*shadescale,0),numpalookups)))/((float)numpalookups); ((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; if (pth->palnum != pal)
material->diffusemodulation[1] *= (float)hictinting[pal].g / 255.0; {
material->diffusemodulation[2] *= (float)hictinting[pal].b / 255.0; 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 // PR_BIT_SPECULAR_MAP
if (hicfindsubst(tilenum, 101, 0)) if (hicfindsubst(tilenum, 101, 0))
{ {

View file

@ -696,6 +696,8 @@ void polymost_glreset()
if (polymosttext) bglDeleteTextures(1,&polymosttext); if (polymosttext) bglDeleteTextures(1,&polymosttext);
polymosttext=0; polymosttext=0;
freevbos();
memset(gltexcachead,0,sizeof(gltexcachead)); memset(gltexcachead,0,sizeof(gltexcachead));
glox1 = -1; glox1 = -1;
@ -737,7 +739,6 @@ void polymost_glreset()
} }
firstcacheindex.next = NULL; firstcacheindex.next = NULL;
} }
freevbos();
} }
// one-time initialization of OpenGL for polymost // one-time initialization of OpenGL for polymost

View file

@ -592,6 +592,44 @@ static void G_MoveZombieActors(void)
{ {
if (x < 30000) 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++; ActorExtra[i].timetosleep++;
if (ActorExtra[i].timetosleep >= (x>>8)) if (ActorExtra[i].timetosleep >= (x>>8))
{ {

View file

@ -7369,6 +7369,8 @@ PALONLY:
case TECHSWITCH__STATIC: case TECHSWITCH__STATIC:
case ACCESSSWITCH__STATIC: case ACCESSSWITCH__STATIC:
case ACCESSSWITCH2__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)].radius = 0;
framelights[framelightcount & (PR_MAXLIGHTS-1)].sector = t->sectnum; framelights[framelightcount & (PR_MAXLIGHTS-1)].sector = t->sectnum;
@ -7408,6 +7410,8 @@ PALONLY:
case TECHSWITCH__STATIC: case TECHSWITCH__STATIC:
case ACCESSSWITCH__STATIC: case ACCESSSWITCH__STATIC:
case ACCESSSWITCH2__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)].radius = 0;
framelights[framelightcount & (PR_MAXLIGHTS-1)].sector = t->sectnum; framelights[framelightcount & (PR_MAXLIGHTS-1)].sector = t->sectnum;

View file

@ -354,11 +354,11 @@ int32_t A_Shoot(int32_t i,int32_t atwith)
case RPG__STATIC: case RPG__STATIC:
case MORTER__STATIC: case MORTER__STATIC:
G_AddGameLight(0, s->sectnum, s->x+((sintable[(s->ang+512)&2047])>>7), 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)].sector = s->sectnum;
gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = s->x+((sintable[(s->ang+512)&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])>>7); 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)].z = s->z-PHEIGHT;
gamelights[gamelightcount&(PR_MAXLIGHTS-1)].range = 8192; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].range = 8192;
@ -2151,11 +2151,11 @@ void P_FireWeapon(DukePlayer_t *p)
p->visibility = 0; p->visibility = 0;
G_AddGameLight(0, s->sectnum, s->x+((sintable[(p->ang+512)&2047])>>7), s->y+((sintable[(p->ang)&2047])>>7), 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)].sector = s->sectnum;
gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = s->x+((sintable[(p->ang+512)&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])>>7); 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)].z = s->z-PHEIGHT;
gamelights[gamelightcount&(PR_MAXLIGHTS-1)].range = 8192; 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[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)].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) if (gamelightcount < PR_MAXLIGHTS)
gamelightcount++; gamelightcount++;