mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
Remove redundant saving of GL nodes if they were loaded from cache
This commit is contained in:
parent
3e7b0c2916
commit
20adcecb1d
1 changed files with 16 additions and 12 deletions
|
@ -959,6 +959,7 @@ bool P_LoadGLNodes(MapData * map)
|
|||
bool P_CheckNodes(MapData * map, bool rebuilt, int buildtime)
|
||||
{
|
||||
bool ret = false;
|
||||
bool loaded = false;
|
||||
|
||||
// If the map loading code has performed a node rebuild we don't need to check for it again.
|
||||
if (!rebuilt && !P_CheckForGLNodes())
|
||||
|
@ -978,7 +979,8 @@ bool P_CheckNodes(MapData * map, bool rebuilt, int buildtime)
|
|||
numsegs = 0;
|
||||
|
||||
// Try to load GL nodes (cached or GWA)
|
||||
if (!P_LoadGLNodes(map))
|
||||
loaded = P_LoadGLNodes(map);
|
||||
if (!loaded)
|
||||
{
|
||||
// none found - we have to build new ones!
|
||||
unsigned int startTime, endTime;
|
||||
|
@ -1006,6 +1008,8 @@ bool P_CheckNodes(MapData * map, bool rebuilt, int buildtime)
|
|||
}
|
||||
}
|
||||
|
||||
if (!loaded)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
// Building nodes in debug is much slower so let's cache them only if cachetime is 0
|
||||
buildtime = 0;
|
||||
|
@ -1019,7 +1023,7 @@ bool P_CheckNodes(MapData * map, bool rebuilt, int buildtime)
|
|||
{
|
||||
DPrintf("Not caching nodes (time = %f)\n", buildtime/1000.f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!gamenodes)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue