mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-13 07:57:58 +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 P_CheckNodes(MapData * map, bool rebuilt, int buildtime)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
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 the map loading code has performed a node rebuild we don't need to check for it again.
|
||||||
if (!rebuilt && !P_CheckForGLNodes())
|
if (!rebuilt && !P_CheckForGLNodes())
|
||||||
|
@ -978,7 +979,8 @@ bool P_CheckNodes(MapData * map, bool rebuilt, int buildtime)
|
||||||
numsegs = 0;
|
numsegs = 0;
|
||||||
|
|
||||||
// Try to load GL nodes (cached or GWA)
|
// 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!
|
// none found - we have to build new ones!
|
||||||
unsigned int startTime, endTime;
|
unsigned int startTime, endTime;
|
||||||
|
@ -1006,20 +1008,22 @@ bool P_CheckNodes(MapData * map, bool rebuilt, int buildtime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!loaded)
|
||||||
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
// Building nodes in debug is much slower so let's cache them only if cachetime is 0
|
// Building nodes in debug is much slower so let's cache them only if cachetime is 0
|
||||||
buildtime = 0;
|
buildtime = 0;
|
||||||
#endif
|
#endif
|
||||||
if (gl_cachenodes && buildtime/1000.f >= gl_cachetime)
|
if (gl_cachenodes && buildtime/1000.f >= gl_cachetime)
|
||||||
{
|
{
|
||||||
DPrintf("Caching nodes\n");
|
DPrintf("Caching nodes\n");
|
||||||
CreateCachedNodes(map);
|
CreateCachedNodes(map);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DPrintf("Not caching nodes (time = %f)\n", buildtime/1000.f);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
DPrintf("Not caching nodes (time = %f)\n", buildtime/1000.f);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (!gamenodes)
|
if (!gamenodes)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue