- Fixed: The nodebuilder is highly likely to renumber vertices, so we need to remember how the

original vertices map to the new ones until after vertex slopes are handled.

SVN r3380 (trunk)
This commit is contained in:
Randy Heit 2012-02-21 21:52:42 +00:00
commit 472ac1b07c
5 changed files with 38 additions and 13 deletions

View file

@ -73,7 +73,7 @@
#define MISSING_TEXTURE_WARN_LIMIT 20
void P_SpawnSlopeMakers (FMapThing *firstmt, FMapThing *lastmt);
void P_SpawnSlopeMakers (FMapThing *firstmt, FMapThing *lastmt, const int *oldvertextable);
void P_SetSlopes ();
void P_CopySlopes();
void BloodCrypt (void *data, int key, int len);
@ -3444,6 +3444,7 @@ void P_SetupLevel (char *lumpname, int position)
int numbuildthings;
int i;
bool buildmap;
const int *oldvertextable = NULL;
// This is motivated as follows:
@ -3758,7 +3759,7 @@ void P_SetupLevel (char *lumpname, int position)
bool BuildGLNodes;
if (ForceNodeBuild)
{
BuildGLNodes = Renderer->RequireGLNodes() || am_textured || multiplayer || demoplayback || demorecording || genglnodes;
BuildGLNodes = RequireGLNodes || multiplayer || demoplayback || demorecording || genglnodes;
startTime = I_FPSTime ();
TArray<FNodeBuilder::FPolyStart> polyspots, anchors;
@ -3782,6 +3783,7 @@ void P_SetupLevel (char *lumpname, int position)
vertexes, numvertexes);
endTime = I_FPSTime ();
DPrintf ("BSP generation took %.3f sec (%d segs)\n", (endTime - startTime) * 0.001, numsegs);
oldvertextable = builder.GetOldVertexTable();
reloop = true;
}
else
@ -3868,7 +3870,7 @@ void P_SetupLevel (char *lumpname, int position)
if (!buildmap)
{
// [RH] Spawn slope creating things first.
P_SpawnSlopeMakers (&MapThingsConverted[0], &MapThingsConverted[MapThingsConverted.Size()]);
P_SpawnSlopeMakers (&MapThingsConverted[0], &MapThingsConverted[MapThingsConverted.Size()], oldvertextable);
P_CopySlopes();
// Spawn 3d floors - must be done before spawning things so it can't be done in P_SpawnSpecials
@ -3898,6 +3900,10 @@ void P_SetupLevel (char *lumpname, int position)
delete[] buildthings;
}
delete map;
if (oldvertextable != NULL)
{
delete[] oldvertextable;
}
// set up world state
P_SpawnSpecials ();