Commit 687000e2 authored by Richard Gobeille's avatar Richard Gobeille

Duke3d: savegame format update WIP

parent 02d5b61e
......@@ -702,10 +702,10 @@ int32_t block_deletesprite = 0;
#ifdef POLYMER
static void A_DeleteLight(int32_t s)
{
if (actor[s].lightId >= 0)
polymer_deletelight(actor[s].lightId);
actor[s].lightId = -1;
actor[s].lightptr = NULL;
if (practor[s].lightId >= 0)
polymer_deletelight(practor[s].lightId);
practor[s].lightId = -1;
practor[s].lightptr = NULL;
}
void G_Polymer_UnInit(void)
......@@ -736,7 +736,7 @@ void A_DeleteSprite(int spriteNum)
}
#ifdef POLYMER
if (actor[spriteNum].lightptr != NULL && videoGetRenderMode() == REND_POLYMER)
if (practor[spriteNum].lightptr != NULL && videoGetRenderMode() == REND_POLYMER)
A_DeleteLight(spriteNum);
#endif
......@@ -930,7 +930,7 @@ void G_AddGameLight(int lightRadius, int spriteNum, int zOffset, int lightRange,
if (videoGetRenderMode() != REND_POLYMER || pr_lighting != 1)
return;
if (actor[spriteNum].lightptr == NULL)
if (practor[spriteNum].lightptr == NULL)
{
#pragma pack(push, 1)
_prlight mylight;
......@@ -945,7 +945,7 @@ void G_AddGameLight(int lightRadius, int spriteNum, int zOffset, int lightRange,
mylight.color[1] = (lightColor >> 8) & 255;
mylight.color[2] = (lightColor >> 16) & 255;
mylight.radius = lightRadius;
actor[spriteNum].lightmaxrange = mylight.range = lightRange;
practor[spriteNum].lightmaxrange = mylight.range = lightRange;
mylight.priority = lightPrio;
mylight.tilenum = 0;
......@@ -953,33 +953,33 @@ void G_AddGameLight(int lightRadius, int spriteNum, int zOffset, int lightRange,
mylight.publicflags.emitshadow = 1;
mylight.publicflags.negative = 0;
actor[spriteNum].lightId = polymer_addlight(&mylight);
if (actor[spriteNum].lightId >= 0)
actor[spriteNum].lightptr = &prlights[actor[spriteNum].lightId];
practor[spriteNum].lightId = polymer_addlight(&mylight);
if (practor[spriteNum].lightId >= 0)
practor[spriteNum].lightptr = &prlights[practor[spriteNum].lightId];
return;
}
s->z -= zOffset;
if (lightRange<actor[spriteNum].lightmaxrange>> 1)
actor[spriteNum].lightmaxrange = 0;
if (lightRange<practor[spriteNum].lightmaxrange>> 1)
practor[spriteNum].lightmaxrange = 0;
if (lightRange > actor[spriteNum].lightmaxrange || lightPrio != actor[spriteNum].lightptr->priority ||
Bmemcmp(&sprite[spriteNum], actor[spriteNum].lightptr, sizeof(int32_t) * 3))
if (lightRange > practor[spriteNum].lightmaxrange || lightPrio != practor[spriteNum].lightptr->priority ||
Bmemcmp(&sprite[spriteNum], practor[spriteNum].lightptr, sizeof(int32_t) * 3))
{
if (lightRange > actor[spriteNum].lightmaxrange)
actor[spriteNum].lightmaxrange = lightRange;
if (lightRange > practor[spriteNum].lightmaxrange)
practor[spriteNum].lightmaxrange = lightRange;
Bmemcpy(actor[spriteNum].lightptr, &sprite[spriteNum], sizeof(int32_t) * 3);
actor[spriteNum].lightptr->sector = s->sectnum;
actor[spriteNum].lightptr->flags.invalidate = 1;
Bmemcpy(practor[spriteNum].lightptr, &sprite[spriteNum], sizeof(int32_t) * 3);
practor[spriteNum].lightptr->sector = s->sectnum;
practor[spriteNum].lightptr->flags.invalidate = 1;
}
actor[spriteNum].lightptr->priority = lightPrio;
actor[spriteNum].lightptr->range = lightRange;
actor[spriteNum].lightptr->color[0] = lightColor & 255;
actor[spriteNum].lightptr->color[1] = (lightColor >> 8) & 255;
actor[spriteNum].lightptr->color[2] = (lightColor >> 16) & 255;
practor[spriteNum].lightptr->priority = lightPrio;
practor[spriteNum].lightptr->range = lightRange;
practor[spriteNum].lightptr->color[0] = lightColor & 255;
practor[spriteNum].lightptr->color[1] = (lightColor >> 8) & 255;
practor[spriteNum].lightptr->color[2] = (lightColor >> 16) & 255;
s->z += zOffset;
......@@ -8414,7 +8414,7 @@ static void G_DoEffectorLights(void) // STATNUM 14
if (!A_CheckSpriteFlags(i, SFLAG_NOLIGHT) && videoGetRenderMode() == REND_POLYMER &&
!(A_CheckSpriteFlags(i, SFLAG_USEACTIVATOR) && sector[sprite[i].sectnum].lotag & 16384))
{
if (actor[i].lightptr == NULL)
if (practor[i].lightptr == NULL)
{
#pragma pack(push,1)
_prlight mylight;
......@@ -8444,33 +8444,33 @@ static void G_DoEffectorLights(void) // STATNUM 14
else
mylight.priority = PR_LIGHT_PRIO_MAX;
actor[i].lightId = polymer_addlight(&mylight);
if (actor[i].lightId >= 0)
actor[i].lightptr = &prlights[actor[i].lightId];
practor[i].lightId = polymer_addlight(&mylight);
if (practor[i].lightId >= 0)
practor[i].lightptr = &prlights[practor[i].lightId];
break;
}
if (Bmemcmp(&sprite[i], actor[i].lightptr, sizeof(int32_t) * 3))
if (Bmemcmp(&sprite[i], practor[i].lightptr, sizeof(int32_t) * 3))
{
Bmemcpy(actor[i].lightptr, &sprite[i], sizeof(int32_t) * 3);
actor[i].lightptr->sector = sprite[i].sectnum;
actor[i].lightptr->flags.invalidate = 1;
Bmemcpy(practor[i].lightptr, &sprite[i], sizeof(int32_t) * 3);
practor[i].lightptr->sector = sprite[i].sectnum;
practor[i].lightptr->flags.invalidate = 1;
}
if (SHT(i) != actor[i].lightptr->range)
if (SHT(i) != practor[i].lightptr->range)
{
actor[i].lightptr->range = SHT(i);
actor[i].lightptr->flags.invalidate = 1;
practor[i].lightptr->range = SHT(i);
practor[i].lightptr->flags.invalidate = 1;
}
if ((sprite[i].xvel != actor[i].lightptr->color[0]) ||
(sprite[i].yvel != actor[i].lightptr->color[1]) ||
(sprite[i].zvel != actor[i].lightptr->color[2]))
if ((sprite[i].xvel != practor[i].lightptr->color[0]) ||
(sprite[i].yvel != practor[i].lightptr->color[1]) ||
(sprite[i].zvel != practor[i].lightptr->color[2]))
{
actor[i].lightptr->color[0] = sprite[i].xvel;
actor[i].lightptr->color[1] = sprite[i].yvel;
actor[i].lightptr->color[2] = sprite[i].zvel;
practor[i].lightptr->color[0] = sprite[i].xvel;
practor[i].lightptr->color[1] = sprite[i].yvel;
practor[i].lightptr->color[2] = sprite[i].zvel;
}
if ((int)!!(CS(i) & 128) != actor[i].lightptr->publicflags.negative) {
actor[i].lightptr->publicflags.negative = !!(CS(i) & 128);
if ((int)!!(CS(i) & 128) != practor[i].lightptr->publicflags.negative) {
practor[i].lightptr->publicflags.negative = !!(CS(i) & 128);
}
}
break;
......@@ -8480,7 +8480,7 @@ static void G_DoEffectorLights(void) // STATNUM 14
if (!A_CheckSpriteFlags(i, SFLAG_NOLIGHT) && videoGetRenderMode() == REND_POLYMER &&
!(A_CheckSpriteFlags(i, SFLAG_USEACTIVATOR) && sector[sprite[i].sectnum].lotag & 16384))
{
if (actor[i].lightptr == NULL)
if (practor[i].lightptr == NULL)
{
#pragma pack(push,1)
_prlight mylight;
......@@ -8512,60 +8512,60 @@ static void G_DoEffectorLights(void) // STATNUM 14
else
mylight.priority = PR_LIGHT_PRIO_MAX;
actor[i].lightId = polymer_addlight(&mylight);
if (actor[i].lightId >= 0)
practor[i].lightId = polymer_addlight(&mylight);
if (practor[i].lightId >= 0)
{
actor[i].lightptr = &prlights[actor[i].lightId];
practor[i].lightptr = &prlights[practor[i].lightId];
// Hack in case polymer_addlight tweaked the horiz value
if (actor[i].lightptr->horiz != SH(i))
SH(i) = actor[i].lightptr->horiz;
if (practor[i].lightptr->horiz != SH(i))
SH(i) = practor[i].lightptr->horiz;
}
break;
}
if (Bmemcmp(&sprite[i], actor[i].lightptr, sizeof(int32_t) * 3))
if (Bmemcmp(&sprite[i], practor[i].lightptr, sizeof(int32_t) * 3))
{
Bmemcpy(actor[i].lightptr, &sprite[i], sizeof(int32_t) * 3);
actor[i].lightptr->sector = sprite[i].sectnum;
actor[i].lightptr->flags.invalidate = 1;
Bmemcpy(practor[i].lightptr, &sprite[i], sizeof(int32_t) * 3);
practor[i].lightptr->sector = sprite[i].sectnum;
practor[i].lightptr->flags.invalidate = 1;
}
if (SHT(i) != actor[i].lightptr->range)
if (SHT(i) != practor[i].lightptr->range)
{
actor[i].lightptr->range = SHT(i);
actor[i].lightptr->flags.invalidate = 1;
practor[i].lightptr->range = SHT(i);
practor[i].lightptr->flags.invalidate = 1;
}
if ((sprite[i].xvel != actor[i].lightptr->color[0]) ||
(sprite[i].yvel != actor[i].lightptr->color[1]) ||
(sprite[i].zvel != actor[i].lightptr->color[2]))
if ((sprite[i].xvel != practor[i].lightptr->color[0]) ||
(sprite[i].yvel != practor[i].lightptr->color[1]) ||
(sprite[i].zvel != practor[i].lightptr->color[2]))
{
actor[i].lightptr->color[0] = sprite[i].xvel;
actor[i].lightptr->color[1] = sprite[i].yvel;
actor[i].lightptr->color[2] = sprite[i].zvel;
practor[i].lightptr->color[0] = sprite[i].xvel;
practor[i].lightptr->color[1] = sprite[i].yvel;
practor[i].lightptr->color[2] = sprite[i].zvel;
}
if (((256-(SS(i)+128))<<1) != actor[i].lightptr->radius)
if (((256-(SS(i)+128))<<1) != practor[i].lightptr->radius)
{
actor[i].lightptr->radius = (256-(SS(i)+128))<<1;
actor[i].lightptr->faderadius = (int16_t)(actor[i].lightptr->radius * 0.75f);
actor[i].lightptr->flags.invalidate = 1;
practor[i].lightptr->radius = (256-(SS(i)+128))<<1;
practor[i].lightptr->faderadius = (int16_t)(practor[i].lightptr->radius * 0.75f);
practor[i].lightptr->flags.invalidate = 1;
}
if (SA(i) != actor[i].lightptr->angle)
if (SA(i) != practor[i].lightptr->angle)
{
actor[i].lightptr->angle = SA(i);
actor[i].lightptr->flags.invalidate = 1;
practor[i].lightptr->angle = SA(i);
practor[i].lightptr->flags.invalidate = 1;
}
if (SH(i) != actor[i].lightptr->horiz)
if (SH(i) != practor[i].lightptr->horiz)
{
actor[i].lightptr->horiz = SH(i);
actor[i].lightptr->flags.invalidate = 1;
practor[i].lightptr->horiz = SH(i);
practor[i].lightptr->flags.invalidate = 1;
}
if ((int)!(CS(i) & 64) != actor[i].lightptr->publicflags.emitshadow) {
actor[i].lightptr->publicflags.emitshadow = !(CS(i) & 64);
if ((int)!(CS(i) & 64) != practor[i].lightptr->publicflags.emitshadow) {
practor[i].lightptr->publicflags.emitshadow = !(CS(i) & 64);
}
if ((int)!!(CS(i) & 128) != actor[i].lightptr->publicflags.negative) {
actor[i].lightptr->publicflags.negative = !!(CS(i) & 128);
if ((int)!!(CS(i) & 128) != practor[i].lightptr->publicflags.negative) {
practor[i].lightptr->publicflags.negative = !!(CS(i) & 128);
}
actor[i].lightptr->tilenum = actor[i].picnum;
practor[i].lightptr->tilenum = actor[i].picnum;
}
break;
......@@ -8585,14 +8585,14 @@ static void A_DoLight(int spriteNum)
(pSprite->picnum != SECTOREFFECTOR && ((pSprite->cstat & 32768) || pSprite->yrepeat < 4)) ||
A_CheckSpriteFlags(spriteNum, SFLAG_NOLIGHT) || (A_CheckSpriteFlags(spriteNum, SFLAG_USEACTIVATOR) && sector[pSprite->sectnum].lotag & 16384))
{
if (actor[spriteNum].lightptr != NULL)
if (practor[spriteNum].lightptr != NULL)
A_DeleteLight(spriteNum);
}
else
{
if (actor[spriteNum].lightptr != NULL && actor[spriteNum].lightcount)
if (practor[spriteNum].lightptr != NULL && practor[spriteNum].lightcount)
{
if (!(--actor[spriteNum].lightcount))
if (!(--practor[spriteNum].lightcount))
A_DeleteLight(spriteNum);
}
......@@ -8628,7 +8628,7 @@ static void A_DoLight(int spriteNum)
{
if ((pSprite->cstat & 32768) || A_CheckSpriteFlags(spriteNum, SFLAG_NOLIGHT))
{
if (actor[spriteNum].lightptr != NULL)
if (practor[spriteNum].lightptr != NULL)
A_DeleteLight(spriteNum);
break;
}
......@@ -8713,7 +8713,7 @@ static void A_DoLight(int spriteNum)
break;
case EXPLOSION2__STATIC:
if (!actor[spriteNum].lightcount)
if (!practor[spriteNum].lightcount)
{
// XXX: This block gets CODEDUP'd too much.
int32_t x = ((sintable[(pSprite->ang+512)&2047])>>6);
......@@ -8787,7 +8787,7 @@ static void A_DoLight(int spriteNum)
pSprite->y -= y;
G_AddGameLight(0, spriteNum, ((pSprite->yrepeat*tilesiz[pSprite->picnum].y)<<1), 8 * pSprite->yrepeat, 240+(160<<8)+(80<<16),PR_LIGHT_PRIO_LOW_GAME);
actor[spriteNum].lightcount = 1;
practor[spriteNum].lightcount = 1;
pSprite->x += x;
pSprite->y += y;
......
......@@ -125,24 +125,29 @@ typedef struct
{
int32_t t_data[10]; // 40b sometimes used to hold offsets to con code
int32_t flags; // 4b
vec3_t bpos; // 12b
int32_t floorz, ceilingz; // 8b
vec2_t lastv; // 8b
int16_t picnum, ang, extra, owner; // 8b
int16_t movflag, tempang, timetosleep; // 6b
int16_t stayput; // 2b
uint8_t cgg, lasttransport; // 2b
// NOTE: 'dispicnum' is updated every frame, not in sync with game tics!
int16_t dispicnum; // 2b
uint32_t flags; // 4b
vec3_t bpos; // 12b
int32_t floorz, ceilingz; // 8b
vec2_t lastv; // 8b
int16_t picnum, ang; // 4b
int16_t extra, owner; // 4b
int16_t movflag, tempang; // 4b
int16_t timetosleep, stayput; // 4b
uint16_t florhit, lzsum; // 4b
int16_t dispicnum; // 2b NOTE: updated every frame, not in sync with game tics!
uint8_t cgg, lasttransport; // 2b
} actor_t;
EDUKE32_STATIC_ASSERT(sizeof(actor_t) == 96);
#ifdef POLYMER
int16_t lightId, lightmaxrange; // 4b
typedef struct
{
_prlight *lightptr; // 4b/8b aligned on 96 bytes
uint8_t lightcount, filler[3];
int16_t lightId, lightmaxrange; // 4b
uint8_t lightcount, filler[3]; // 4b
} practor_t;
#endif
} actor_t;
// note: fields in this struct DO NOT have to be in this order,
// however if you add something to this struct, please make sure
......@@ -298,7 +303,7 @@ typedef struct
} tiledata_t;
enum sflags_t
enum sflags_t : unsigned int
{
SFLAG_SHADOW = 0x00000001,
SFLAG_NVG = 0x00000002,
......@@ -331,11 +336,14 @@ enum sflags_t
SFLAG_DAMAGEEVENT = 0x04000000,
SFLAG_NOWATERSECTOR = 0x08000000,
SFLAG_QUEUEDFORDELETE = 0x10000000,
SFLAG_RESERVED = 0x20000000,
SFLAG_RESERVED2 = 0x40000000,
SFLAG_RESERVED3 = 0x80000000,
};
// Custom projectiles "workslike" flags.
// XXX: Currently not predefined from CON.
enum pflags_t
enum pflags_t : unsigned int
{
PROJECTILE_HITSCAN = 0x00000001,
PROJECTILE_RPG = 0x00000002,
......@@ -366,6 +374,9 @@ enum pflags_t
extern tiledata_t g_tile[MAXTILES];
extern actor_t actor[MAXSPRITES];
#ifdef POLYMER
extern practor_t practor[MAXSPRITES];
#endif
extern int32_t block_deletesprite;
extern int32_t g_noEnemies;
extern int32_t otherp;
......
......@@ -57,7 +57,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#endif
// increase by 3, because atomic GRP adds 1, and Shareware adds 2
#define BYTEVERSION_EDUKE32 339
#define BYTEVERSION_EDUKE32 342
//#define BYTEVERSION_13 27
//#define BYTEVERSION_14 116
......
......@@ -1357,10 +1357,11 @@ int32_t A_InsertSprite(int16_t whatsect,int32_t s_x,int32_t s_y,int32_t s_z,int1
a.stayput = -1;
a.extra = -1;
a.owner = s_ow;
#ifdef POLYMER
a.lightId = -1;
practor[newSprite].lightId = -1;
#endif
a.owner = s_ow;
G_InitActor(newSprite, s_pn, 1);
......@@ -1451,10 +1452,11 @@ int A_Spawn(int spriteNum, int tileNum)
a.floorz = sector[s.sectnum].floorz;
a.ceilingz = sector[s.sectnum].ceilingz;
a.stayput = a.extra = -1;
a.stayput = a.extra = -1;
a.florhit = a.lzsum = 0;
#ifdef POLYMER
a.lightId = -1;
practor[newSprite].lightId = -1;
#endif
if ((s.cstat & 48)
......@@ -2675,7 +2677,7 @@ int A_Spawn(int spriteNum, int tileNum)
if (pSprite->yrepeat > 32)
{
G_AddGameLight(0, newSprite, ((pSprite->yrepeat*tilesiz[pSprite->picnum].y)<<1), 32768, 255+(95<<8),PR_LIGHT_PRIO_MAX_GAME);
pActor->lightcount = 2;
practor[newSprite].lightcount = 2;
}
fallthrough__;
#endif
......@@ -4204,8 +4206,13 @@ PALONLY:
if (G_TileHasActor(pSprite->picnum))
{
if ((unsigned)scrofs_action + ACTION_PARAM_COUNT > (unsigned)g_scriptSize)
if ((unsigned)scrofs_action + ACTION_PARAM_COUNT > (unsigned)g_scriptSize || apScript[scrofs_action + ACTION_PARAM_COUNT] != CON_ACTION)
{
if (scrofs_action)
OSD_Printf("Sprite %d tile %d: invalid action at offset %d\n", i, pSprite->picnum, scrofs_action);
goto skip;
}
int32_t viewtype = apScript[scrofs_action + ACTION_VIEWTYPE];
uint16_t const action_flags = apScript[scrofs_action + ACTION_FLAGS];
......@@ -4264,6 +4271,8 @@ PALONLY:
t->picnum += frameOffset + apScript[scrofs_action + ACTION_STARTFRAME] + viewtype*curframe;
// XXX: t->picnum can be out-of-bounds by bad user code.
Bassert((unsigned)t->picnum < MAXTILES);
if (viewtype > 0)
while (tilesiz[t->picnum].x == 0 && t->picnum > 0)
t->picnum -= l; //Hack, for actors
......
......@@ -77,7 +77,7 @@ enum GametypeFlags_t {
};
// logo control
enum LogoFlags_t {
enum LogoFlags_t : unsigned int {
LOGO_ENABLED = 0x00000001,
LOGO_PLAYANIM = 0x00000002,
LOGO_PLAYMUSIC = 0x00000004,
......
......@@ -54,7 +54,6 @@ char g_scriptFileName[BMAX_PATH] = "(none)"; // file we're currently compiling
int32_t g_totalLines;
int32_t g_lineNumber;
uint32_t g_scriptcrc;
char g_szBuf[1024];
static char *textptr;
......@@ -136,7 +135,6 @@ static hashtable_t *const tables[] = {
static hashtable_t *const tables_free[] = {
&h_iter,
&h_keywords,
&h_labels,
};
static tokenmap_t const vm_keywords[] =
......@@ -1960,7 +1958,6 @@ static void C_Include(const char *confile)
kclose(fp);
mptr[len] = 0;
g_scriptcrc = Bcrc32(mptr, len, g_scriptcrc);
if (*textptr == '"') // skip past the closing quote if it's there so we don't screw up the next line
textptr++;
......@@ -6348,9 +6345,6 @@ void C_Compile(const char *fileName)
kread(kFile, (char *)textptr, kFileLen);
kclose(kFile);
g_scriptcrc = Bcrc32(NULL, 0, 0L);
g_scriptcrc = Bcrc32(textptr, kFileLen, g_scriptcrc);
Xfree(apScript);
apScript = (intptr_t *)Xcalloc(1, g_scriptSize * sizeof(intptr_t));
......
......@@ -6536,8 +6536,9 @@ void G_SaveMapState(void)
for (native_t i=g_gameVarCount-1; i>=0; i--)
{
if (aGameVars[i].flags & GAMEVAR_NORESET)
if (aGameVars[i].flags & SAVEGAMEMAPSTATEVARSKIPMASK)
continue;
if (aGameVars[i].flags & GAMEVAR_PERPLAYER)
{
if (!save->vars[i])
......@@ -6556,7 +6557,7 @@ void G_SaveMapState(void)
for (native_t i=g_gameArrayCount-1; i>=0; i--)
{
if ((aGameArrays[i].flags & GAMEARRAY_RESTORE) == 0)
if (aGameArrays[i].flags & SAVEGAMEMAPSTATEARRAYSKIPMASK)
continue;
save->arraysiz[i] = aGameArrays[i].size;
......@@ -6650,8 +6651,9 @@ void G_RestoreMapState(void)
for (native_t i=g_gameVarCount-1; i>=0; i--)
{
if (aGameVars[i].flags & GAMEVAR_NORESET)
if (aGameVars[i].flags & SAVEGAMEMAPSTATEVARSKIPMASK)
continue;
if (aGameVars[i].flags & GAMEVAR_PERPLAYER)
{
if (!pSavedState->vars[i])
......@@ -6670,7 +6672,7 @@ void G_RestoreMapState(void)
for (native_t i=g_gameArrayCount-1; i>=0; i--)
{
if ((aGameArrays[i].flags & GAMEARRAY_RESTORE) == 0)
if (aGameArrays[i].flags & SAVEGAMEMAPSTATEARRAYSKIPMASK)
continue;
aGameArrays[i].size = pSavedState->arraysiz[i];
......
This diff is collapsed.
......@@ -35,6 +35,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define GV_FLAG_ARRAY (MAXGAMEVARS<<2)
#define GV_FLAG_STRUCT (MAXGAMEVARS<<3)
#define SAVEGAMEVARSKIPMASK (GAMEVAR_READONLY|GAMEVAR_SPECIAL)
#define SAVEGAMEARRAYSKIPMASK (GAMEARRAY_READONLY|GAMEARRAY_SYSTEM)
#define SAVEGAMEMAPSTATEVARSKIPMASK (GAMEVAR_NORESET|SAVEGAMEVARSKIPMASK)
#define SAVEGAMEMAPSTATEARRAYSKIPMASK (SAVEGAMEARRAYSKIPMASK|~GAMEARRAY_RESTORE)
// store global game definitions
enum GamevarFlags_t
{
......
......@@ -65,6 +65,9 @@ enum DUKE3D_GLOBALFLAGS {
G_EXTERN DukeStatus_t sbar;
G_EXTERN actor_t actor[MAXSPRITES];
#ifdef POLYMER
G_EXTERN practor_t practor[MAXSPRITES];
#endif
// g_tile: tile-specific data THAT DOES NOT CHANGE during the course of a game
G_EXTERN tiledata_t g_tile[MAXTILES];
G_EXTERN animwalltype animwall[MAXANIMWALLS];
......
......@@ -815,11 +815,11 @@ void onvideomodechange(int32_t newmode)
while (i < MAXSPRITES)
{
if (actor[i].lightptr)
if (practor[i].lightptr)
{
polymer_deletelight(actor[i].lightId);
actor[i].lightptr = NULL;
actor[i].lightId = -1;
polymer_deletelight(practor[i].lightId);
practor[i].lightptr = NULL;
practor[i].lightId = -1;
}
i++;
}
......
......@@ -865,7 +865,7 @@ static int A_ShootCustom(int const spriteNum, int const projecTile, int shootAng
pSprite->x += x;
pSprite->y += y;
G_AddGameLight(0, spriteNum, PHEIGHT, 8192, pProj->flashcolor, PR_LIGHT_PRIO_MAX_GAME);
actor[spriteNum].lightcount = 2;
practor[spriteNum].lightcount = 2;
pSprite->x -= x;
pSprite->y -= y;
}
......@@ -1714,7 +1714,7 @@ int A_ShootWithZvel(int const spriteNum, int const projecTile, int const forceZv
pSprite->x += v.x;
pSprite->y += v.y;
G_AddGameLight(0, spriteNum, PHEIGHT, 8192, 255 + (95 << 8), PR_LIGHT_PRIO_MAX_GAME);
actor[spriteNum].lightcount = 2;
practor[spriteNum].lightcount = 2;
pSprite->x -= v.x;
pSprite->y -= v.y;