Remove redundant netarchive-related sector vars as they're not used anymore.
Replace lump-based difference checks for sectors in P_NetArchiveWorld(), now it uses the mapload-created copy instead.
This commit is contained in:
parent
eadf953957
commit
bb54597552
|
@ -782,10 +782,10 @@ static void P_NetArchiveWorld(void)
|
||||||
|
|
||||||
// reload the map just to see difference
|
// reload the map just to see difference
|
||||||
virtres_t* virt = vres_GetMap(lastloadedmaplumpnum);
|
virtres_t* virt = vres_GetMap(lastloadedmaplumpnum);
|
||||||
mapsector_t *ms = (mapsector_t*) vres_Find(virt, "SECTORS")->data;
|
|
||||||
mapsidedef_t *msd = (mapsidedef_t*) vres_Find(virt, "SIDEDEFS")->data;
|
mapsidedef_t *msd = (mapsidedef_t*) vres_Find(virt, "SIDEDEFS")->data;
|
||||||
maplinedef_t *mld = (maplinedef_t*) vres_Find(virt, "LINEDEFS")->data;
|
maplinedef_t *mld = (maplinedef_t*) vres_Find(virt, "LINEDEFS")->data;
|
||||||
const sector_t *ss = sectors;
|
const sector_t *ss = sectors;
|
||||||
|
const sector_t *spawnss = spawnsectors;
|
||||||
UINT8 diff, diff2, diff3;
|
UINT8 diff, diff2, diff3;
|
||||||
|
|
||||||
// initialize colormap vars because paranoia
|
// initialize colormap vars because paranoia
|
||||||
|
@ -794,45 +794,45 @@ static void P_NetArchiveWorld(void)
|
||||||
WRITEUINT32(save_p, ARCHIVEBLOCK_WORLD);
|
WRITEUINT32(save_p, ARCHIVEBLOCK_WORLD);
|
||||||
put = save_p;
|
put = save_p;
|
||||||
|
|
||||||
for (i = 0; i < numsectors; i++, ss++, ms++)
|
for (i = 0; i < numsectors; i++, ss++, spawnss++)
|
||||||
{
|
{
|
||||||
diff = diff2 = diff3 = 0;
|
diff = diff2 = diff3 = 0;
|
||||||
if (ss->floorheight != SHORT(ms->floorheight)<<FRACBITS)
|
if (ss->floorheight != spawnss->floorheight)
|
||||||
diff |= SD_FLOORHT;
|
diff |= SD_FLOORHT;
|
||||||
if (ss->ceilingheight != SHORT(ms->ceilingheight)<<FRACBITS)
|
if (ss->ceilingheight != spawnss->ceilingheight)
|
||||||
diff |= SD_CEILHT;
|
diff |= SD_CEILHT;
|
||||||
//
|
//
|
||||||
// flats
|
// flats
|
||||||
//
|
//
|
||||||
if (ss->floorpic != P_CheckLevelFlat(ms->floorpic))
|
if (ss->floorpic != spawnss->floorpic)
|
||||||
diff |= SD_FLOORPIC;
|
diff |= SD_FLOORPIC;
|
||||||
if (ss->ceilingpic != P_CheckLevelFlat(ms->ceilingpic))
|
if (ss->ceilingpic != spawnss->ceilingpic)
|
||||||
diff |= SD_CEILPIC;
|
diff |= SD_CEILPIC;
|
||||||
|
|
||||||
if (ss->lightlevel != SHORT(ms->lightlevel))
|
if (ss->lightlevel != spawnss->lightlevel)
|
||||||
diff |= SD_LIGHT;
|
diff |= SD_LIGHT;
|
||||||
if (ss->special != SHORT(ms->special))
|
if (ss->special != spawnss->special)
|
||||||
diff |= SD_SPECIAL;
|
diff |= SD_SPECIAL;
|
||||||
|
|
||||||
if (ss->floor_xoffs != ss->spawn_flr_xoffs)
|
if (ss->floor_xoffs != spawnss->floor_xoffs)
|
||||||
diff2 |= SD_FXOFFS;
|
diff2 |= SD_FXOFFS;
|
||||||
if (ss->floor_yoffs != ss->spawn_flr_yoffs)
|
if (ss->floor_yoffs != spawnss->floor_yoffs)
|
||||||
diff2 |= SD_FYOFFS;
|
diff2 |= SD_FYOFFS;
|
||||||
if (ss->ceiling_xoffs != ss->spawn_ceil_xoffs)
|
if (ss->ceiling_xoffs != spawnss->ceiling_xoffs)
|
||||||
diff2 |= SD_CXOFFS;
|
diff2 |= SD_CXOFFS;
|
||||||
if (ss->ceiling_yoffs != ss->spawn_ceil_yoffs)
|
if (ss->ceiling_yoffs != spawnss->ceiling_yoffs)
|
||||||
diff2 |= SD_CYOFFS;
|
diff2 |= SD_CYOFFS;
|
||||||
if (ss->floorpic_angle != ss->spawn_flrpic_angle)
|
if (ss->floorpic_angle != spawnss->floorpic_angle)
|
||||||
diff2 |= SD_FLOORANG;
|
diff2 |= SD_FLOORANG;
|
||||||
if (ss->ceilingpic_angle != ss->spawn_flrpic_angle)
|
if (ss->ceilingpic_angle != spawnss->ceilingpic_angle)
|
||||||
diff2 |= SD_CEILANG;
|
diff2 |= SD_CEILANG;
|
||||||
|
|
||||||
if (ss->tag != SHORT(ms->tag))
|
if (ss->tag != spawnss->tag)
|
||||||
diff2 |= SD_TAG;
|
diff2 |= SD_TAG;
|
||||||
if (ss->nexttag != ss->spawn_nexttag || ss->firsttag != ss->spawn_firsttag)
|
if (ss->nexttag != spawnss->nexttag || ss->firsttag != spawnss->firsttag)
|
||||||
diff3 |= SD_TAGLIST;
|
diff3 |= SD_TAGLIST;
|
||||||
|
|
||||||
if (ss->extra_colormap != ss->spawn_extra_colormap)
|
if (ss->extra_colormap != spawnss->extra_colormap)
|
||||||
diff3 |= SD_COLORMAP;
|
diff3 |= SD_COLORMAP;
|
||||||
|
|
||||||
// Check if any of the sector's FOFs differ from how they spawned
|
// Check if any of the sector's FOFs differ from how they spawned
|
||||||
|
|
|
@ -669,11 +669,9 @@ static void P_LoadRawSectors(UINT8 *data)
|
||||||
ss->ceilingpic = P_AddLevelFlat(ms->ceilingpic, foundflats);
|
ss->ceilingpic = P_AddLevelFlat(ms->ceilingpic, foundflats);
|
||||||
|
|
||||||
ss->lightlevel = SHORT(ms->lightlevel);
|
ss->lightlevel = SHORT(ms->lightlevel);
|
||||||
ss->spawn_lightlevel = SHORT(ms->lightlevel);
|
|
||||||
ss->special = SHORT(ms->special);
|
ss->special = SHORT(ms->special);
|
||||||
ss->tag = SHORT(ms->tag);
|
ss->tag = SHORT(ms->tag);
|
||||||
ss->nexttag = ss->firsttag = -1;
|
ss->nexttag = ss->firsttag = -1;
|
||||||
ss->spawn_nexttag = ss->spawn_firsttag = -1;
|
|
||||||
|
|
||||||
memset(&ss->soundorg, 0, sizeof(ss->soundorg));
|
memset(&ss->soundorg, 0, sizeof(ss->soundorg));
|
||||||
ss->validcount = 0;
|
ss->validcount = 0;
|
||||||
|
@ -708,9 +706,7 @@ static void P_LoadRawSectors(UINT8 *data)
|
||||||
ss->spawn_extra_colormap = NULL;
|
ss->spawn_extra_colormap = NULL;
|
||||||
|
|
||||||
ss->floor_xoffs = ss->ceiling_xoffs = ss->floor_yoffs = ss->ceiling_yoffs = 0;
|
ss->floor_xoffs = ss->ceiling_xoffs = ss->floor_yoffs = ss->ceiling_yoffs = 0;
|
||||||
ss->spawn_flr_xoffs = ss->spawn_ceil_xoffs = ss->spawn_flr_yoffs = ss->spawn_ceil_yoffs = 0;
|
|
||||||
ss->floorpic_angle = ss->ceilingpic_angle = 0;
|
ss->floorpic_angle = ss->ceilingpic_angle = 0;
|
||||||
ss->spawn_flrpic_angle = ss->spawn_ceilpic_angle = 0;
|
|
||||||
ss->gravity = NULL;
|
ss->gravity = NULL;
|
||||||
ss->cullheight = NULL;
|
ss->cullheight = NULL;
|
||||||
ss->verticalflip = false;
|
ss->verticalflip = false;
|
||||||
|
|
12
src/p_spec.c
12
src/p_spec.c
|
@ -1603,8 +1603,6 @@ static inline void P_InitTagLists(void)
|
||||||
size_t j = (unsigned)sectors[i].tag % numsectors;
|
size_t j = (unsigned)sectors[i].tag % numsectors;
|
||||||
sectors[i].nexttag = sectors[j].firsttag;
|
sectors[i].nexttag = sectors[j].firsttag;
|
||||||
sectors[j].firsttag = (INT32)i;
|
sectors[j].firsttag = (INT32)i;
|
||||||
sectors[i].spawn_nexttag = sectors[i].nexttag;
|
|
||||||
sectors[j].spawn_firsttag = sectors[j].firsttag;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = numlines - 1; i != (size_t)-1; i--)
|
for (i = numlines - 1; i != (size_t)-1; i--)
|
||||||
|
@ -6405,22 +6403,16 @@ static void P_ApplyFlatAlignment(line_t *master, sector_t *sector, angle_t flata
|
||||||
{
|
{
|
||||||
if (!(master->flags & ML_NETONLY)) // Modify floor flat alignment unless ML_NETONLY flag is set
|
if (!(master->flags & ML_NETONLY)) // Modify floor flat alignment unless ML_NETONLY flag is set
|
||||||
{
|
{
|
||||||
sector->spawn_flrpic_angle = sector->floorpic_angle = flatangle;
|
sector->floorpic_angle = flatangle;
|
||||||
sector->floor_xoffs += xoffs;
|
sector->floor_xoffs += xoffs;
|
||||||
sector->floor_yoffs += yoffs;
|
sector->floor_yoffs += yoffs;
|
||||||
// saved for netgames
|
|
||||||
sector->spawn_flr_xoffs = sector->floor_xoffs;
|
|
||||||
sector->spawn_flr_yoffs = sector->floor_yoffs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(master->flags & ML_NONET)) // Modify ceiling flat alignment unless ML_NONET flag is set
|
if (!(master->flags & ML_NONET)) // Modify ceiling flat alignment unless ML_NONET flag is set
|
||||||
{
|
{
|
||||||
sector->spawn_ceilpic_angle = sector->ceilingpic_angle = flatangle;
|
sector->ceilingpic_angle = flatangle;
|
||||||
sector->ceiling_xoffs += xoffs;
|
sector->ceiling_xoffs += xoffs;
|
||||||
sector->ceiling_yoffs += yoffs;
|
sector->ceiling_yoffs += yoffs;
|
||||||
// saved for netgames
|
|
||||||
sector->spawn_ceil_xoffs = sector->ceiling_xoffs;
|
|
||||||
sector->spawn_ceil_yoffs = sector->ceiling_yoffs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
11
src/r_defs.h
11
src/r_defs.h
|
@ -384,17 +384,6 @@ typedef struct sector_s
|
||||||
// for fade thinker
|
// for fade thinker
|
||||||
INT16 spawn_lightlevel;
|
INT16 spawn_lightlevel;
|
||||||
|
|
||||||
// these are saved for netgames, so do not let Lua touch these!
|
|
||||||
INT32 spawn_nexttag, spawn_firsttag; // the actual nexttag/firsttag values may differ if the sector's tag was changed
|
|
||||||
|
|
||||||
// offsets sector spawned with (via linedef type 7)
|
|
||||||
fixed_t spawn_flr_xoffs, spawn_flr_yoffs;
|
|
||||||
fixed_t spawn_ceil_xoffs, spawn_ceil_yoffs;
|
|
||||||
|
|
||||||
// flag angles sector spawned with (via linedef type 7)
|
|
||||||
angle_t spawn_flrpic_angle;
|
|
||||||
angle_t spawn_ceilpic_angle;
|
|
||||||
|
|
||||||
// colormap structure
|
// colormap structure
|
||||||
extracolormap_t *spawn_extra_colormap;
|
extracolormap_t *spawn_extra_colormap;
|
||||||
} sector_t;
|
} sector_t;
|
||||||
|
|
Loading…
Reference in New Issue