diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 17672b4ea..f79cddab2 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -7541,7 +7541,18 @@ static void G_MoveEffectors(void) //STATNUM 3 gamelights[gamelightcount&(PR_MAXLIGHTS-1)].radius = 0; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].angle = SA; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].horiz = SH; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = SS; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].minshade = sprite[i].xoffset; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].maxshade = sprite[i].yoffset; + + if (CS & 2) + { + if (CS & 512) + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = 2; + else + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = 1; + } else + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = 0; + if (gamelightcount < PR_MAXLIGHTS) gamelightcount++; break; @@ -7565,11 +7576,22 @@ static void G_MoveEffectors(void) //STATNUM 3 gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[1] = hictinting[PL].g; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[2] = hictinting[PL].b; } - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].radius = 256; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].faderadius = 200; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].radius = (256-(SS+128))<<1; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].faderadius = gamelights[gamelightcount&(PR_MAXLIGHTS-1)].radius * 0.75; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].angle = SA; gamelights[gamelightcount&(PR_MAXLIGHTS-1)].horiz = SH; - gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = SS; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].minshade = sprite[i].xoffset; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].maxshade = sprite[i].yoffset; + + if (CS & 2) + { + if (CS & 512) + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = 2; + else + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = 1; + } else + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = 0; + if (gamelightcount < PR_MAXLIGHTS) gamelightcount++; break; diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 9c4eca09d..99b6680aa 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -49,7 +49,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #endif -#define BUILDDATE " 20090313" +#define BUILDDATE " 20090426" #define VERSION " 1.2.0devel" static int32_t floor_over_floor; @@ -9786,53 +9786,76 @@ void ExtAnalyzeSprites(void) { if (sprite[i].picnum == SECTOREFFECTOR && sprite[i].lotag == 49) { - gamelights[gamelightcount].sector = SECT; - gamelights[gamelightcount].x = SX; - gamelights[gamelightcount].y = SY; - gamelights[gamelightcount].z = SZ; - gamelights[gamelightcount].range = SHT; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].sector = SECT; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = SX; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].y = SY; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].z = SZ; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].range = SHT; if ((sprite[i].xvel | sprite[i].yvel | sprite[i].zvel) != 0) { - gamelights[gamelightcount].color[0] = sprite[i].xvel; - gamelights[gamelightcount].color[1] = sprite[i].yvel; - gamelights[gamelightcount].color[2] = sprite[i].zvel; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[0] = sprite[i].xvel; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[1] = sprite[i].yvel; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[2] = sprite[i].zvel; } else { - gamelights[gamelightcount].color[0] = hictinting[PL].r; - gamelights[gamelightcount].color[1] = hictinting[PL].g; - gamelights[gamelightcount].color[2] = hictinting[PL].b; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[0] = hictinting[PL].r; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[1] = hictinting[PL].g; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[2] = hictinting[PL].b; } - gamelights[gamelightcount].radius = 0; - gamelights[gamelightcount].angle = SA; - gamelights[gamelightcount].horiz = SH; - gamelights[gamelightcount].priority = SS; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].radius = 0; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].angle = SA; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].horiz = SH; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].minshade = sprite[i].xoffset; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].maxshade = sprite[i].yoffset; +// gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = SS; + + if (CS & 2) + { + if (CS & 512) + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = 2; + else + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = 1; + } else + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = 0; + gamelightcount++; } if (sprite[i].picnum == SECTOREFFECTOR && sprite[i].lotag == 50) { - gamelights[gamelightcount].sector = SECT; - gamelights[gamelightcount].x = SX; - gamelights[gamelightcount].y = SY; - gamelights[gamelightcount].z = SZ; - gamelights[gamelightcount].range = SHT; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].sector = SECT; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].x = SX; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].y = SY; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].z = SZ; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].range = SHT; if ((sprite[i].xvel | sprite[i].yvel | sprite[i].zvel) != 0) { - gamelights[gamelightcount].color[0] = sprite[i].xvel; - gamelights[gamelightcount].color[1] = sprite[i].yvel; - gamelights[gamelightcount].color[2] = sprite[i].zvel; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[0] = sprite[i].xvel; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[1] = sprite[i].yvel; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[2] = sprite[i].zvel; } else { - gamelights[gamelightcount].color[0] = hictinting[PL].r; - gamelights[gamelightcount].color[1] = hictinting[PL].g; - gamelights[gamelightcount].color[2] = hictinting[PL].b; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[0] = hictinting[PL].r; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[1] = hictinting[PL].g; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].color[2] = hictinting[PL].b; } - gamelights[gamelightcount].radius = 256; - gamelights[gamelightcount].faderadius = 200; - gamelights[gamelightcount].angle = SA; - gamelights[gamelightcount].horiz = SH; - gamelights[gamelightcount].priority = SS; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].radius = (256-(SS+128))<<1; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].faderadius = gamelights[gamelightcount&(PR_MAXLIGHTS-1)].radius * 0.75; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].angle = SA; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].horiz = SH; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].minshade = sprite[i].xoffset; + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].maxshade = sprite[i].yoffset; + + if (CS & 2) + { + if (CS & 512) + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = 2; + else + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = 1; + } else + gamelights[gamelightcount&(PR_MAXLIGHTS-1)].priority = 0; + gamelightcount++; } } diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index f590a142b..ec0a1c6a9 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -6086,6 +6086,9 @@ int32_t A_Spawn(int32_t j, int32_t pn) break; case SECTOREFFECTOR__STATIC: + sp->cstat |= 32768; + sp->xrepeat = sp->yrepeat = 0; + switch (sp->lotag) { @@ -6097,8 +6100,6 @@ int32_t A_Spawn(int32_t j, int32_t pn) } sp->yvel = sector[sect].extra; - sp->cstat |= 32768; - sp->xrepeat = sp->yrepeat = 0; switch (sp->lotag) { diff --git a/polymer/eduke32/source/global.c b/polymer/eduke32/source/global.c index 76b4d20e8..1f66ea0b5 100644 --- a/polymer/eduke32/source/global.c +++ b/polymer/eduke32/source/global.c @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //------------------------------------------------------------------------- #include "duke3d.h" -const char *s_buildDate = "20090424"; +const char *s_buildDate = "20090426"; char *MusicPtr = NULL; int32_t g_musicSize; diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 33c6add03..fb4f81395 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -975,7 +975,7 @@ static inline void prelevel(char g) case LOCATORS__STATIC: case MASTERSWITCH__STATIC: case RESPAWN__STATIC: - sprite[i].cstat = 0; + sprite[i].cstat &= ~(1|256); break; } i = nexti;