Store a copy of sectors, lines and sides in memory so that P_NetArchiveWorld() can soon use them instead of relying on re-opening the original lumps.

Fix print type issue.
This commit is contained in:
Nev3r 2019-12-23 12:30:01 +01:00
parent 7e0152f37b
commit eadf953957
2 changed files with 15 additions and 0 deletions

View File

@ -103,6 +103,9 @@ node_t *nodes;
line_t *lines;
side_t *sides;
mapthing_t *mapthings;
sector_t *spawnsectors;
line_t *spawnlines;
side_t *spawnsides;
INT32 numstarposts;
UINT16 bossdisabled;
boolean stoppedclock;
@ -2775,6 +2778,15 @@ boolean P_SetupLevel(boolean skipprecip)
P_LoadLineDefs2();
P_GroupLines();
// Copy relevant map data for NetArchive purposes.
spawnsectors = Z_Calloc(numsectors * sizeof (*sectors), PU_LEVEL, NULL);
spawnlines = Z_Calloc(numlines * sizeof (*lines), PU_LEVEL, NULL);
spawnsides = Z_Calloc(numsides * sizeof (*sides), PU_LEVEL, NULL);
memcpy(spawnsectors, sectors, numsectors * sizeof (*sectors));
memcpy(spawnlines, lines, numlines * sizeof (*lines));
memcpy(spawnsides, sides, numsides * sizeof (*sides));
P_PrepareRawThings(vres_Find(virt, "THINGS")->data);
P_MakeMapMD5(virt, &mapmd5);

View File

@ -63,6 +63,7 @@ extern seg_t *segs;
extern size_t numsectors;
extern sector_t *sectors;
extern sector_t *spawnsectors;
extern size_t numsubsectors;
extern subsector_t *subsectors;
@ -72,9 +73,11 @@ extern node_t *nodes;
extern size_t numlines;
extern line_t *lines;
extern line_t *spawnlines;
extern size_t numsides;
extern side_t *sides;
extern side_t *spawnsides;
//
// POV data.