Skip to content
Snippets Groups Projects
Commit eadf9539 authored by Nev3r's avatar Nev3r
Browse files

Store a copy of sectors, lines and sides in memory so that P_NetArchiveWorld()...

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.
parent 7e0152f3
Branches
Tags
2 merge requests!718Rename R_IsPointInSubsector to R_PointInSubsectorOrNull/Nil,!563Netarchive compare changes
...@@ -103,6 +103,9 @@ node_t *nodes; ...@@ -103,6 +103,9 @@ node_t *nodes;
line_t *lines; line_t *lines;
side_t *sides; side_t *sides;
mapthing_t *mapthings; mapthing_t *mapthings;
sector_t *spawnsectors;
line_t *spawnlines;
side_t *spawnsides;
INT32 numstarposts; INT32 numstarposts;
UINT16 bossdisabled; UINT16 bossdisabled;
boolean stoppedclock; boolean stoppedclock;
...@@ -2775,6 +2778,15 @@ boolean P_SetupLevel(boolean skipprecip) ...@@ -2775,6 +2778,15 @@ boolean P_SetupLevel(boolean skipprecip)
P_LoadLineDefs2(); P_LoadLineDefs2();
P_GroupLines(); 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_PrepareRawThings(vres_Find(virt, "THINGS")->data);
P_MakeMapMD5(virt, &mapmd5); P_MakeMapMD5(virt, &mapmd5);
......
...@@ -63,6 +63,7 @@ extern seg_t *segs; ...@@ -63,6 +63,7 @@ extern seg_t *segs;
extern size_t numsectors; extern size_t numsectors;
extern sector_t *sectors; extern sector_t *sectors;
extern sector_t *spawnsectors;
extern size_t numsubsectors; extern size_t numsubsectors;
extern subsector_t *subsectors; extern subsector_t *subsectors;
...@@ -72,9 +73,11 @@ extern node_t *nodes; ...@@ -72,9 +73,11 @@ extern node_t *nodes;
extern size_t numlines; extern size_t numlines;
extern line_t *lines; extern line_t *lines;
extern line_t *spawnlines;
extern size_t numsides; extern size_t numsides;
extern side_t *sides; extern side_t *sides;
extern side_t *spawnsides;
// //
// POV data. // POV data.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment