Add onDemandLoadTrackScreenshots for all tracks
This commit is contained in:
parent
f777e01a21
commit
8fead715da
@ -1031,6 +1031,8 @@ void RaceManager::exitRace(bool delete_world)
|
|||||||
World::deleteWorld();
|
World::deleteWorld();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reload track screenshot after delete_world (track textures are unloaded)
|
||||||
|
track_manager->onDemandLoadTrackScreenshots();
|
||||||
m_saved_gp = NULL;
|
m_saved_gp = NULL;
|
||||||
m_track_number = 0;
|
m_track_number = 0;
|
||||||
|
|
||||||
|
@ -190,6 +190,11 @@ Track::Track(const std::string &filename)
|
|||||||
/** Destructor, removes quad data structures etc. */
|
/** Destructor, removes quad data structures etc. */
|
||||||
Track::~Track()
|
Track::~Track()
|
||||||
{
|
{
|
||||||
|
#ifndef SERVER_ONLY
|
||||||
|
if (GE::getDriver()->getDriverType() == video::EDT_VULKAN)
|
||||||
|
GE::getGEConfig()->m_ondemand_load_texture_paths.erase(m_screenshot);
|
||||||
|
#endif
|
||||||
|
|
||||||
// Note that the music information in m_music is globally managed
|
// Note that the music information in m_music is globally managed
|
||||||
// by the music_manager, and is freed there. So no need to free it
|
// by the music_manager, and is freed there. So no need to free it
|
||||||
// here (esp. since various track might share the same music).
|
// here (esp. since various track might share the same music).
|
||||||
@ -614,6 +619,14 @@ void Track::loadTrackInfo()
|
|||||||
if (m_screenshot.length() > 0)
|
if (m_screenshot.length() > 0)
|
||||||
{
|
{
|
||||||
m_screenshot = m_root+m_screenshot;
|
m_screenshot = m_root+m_screenshot;
|
||||||
|
#ifndef SERVER_ONLY
|
||||||
|
if (GE::getDriver()->getDriverType() == video::EDT_VULKAN)
|
||||||
|
{
|
||||||
|
m_screenshot = file_manager->getFileSystem()
|
||||||
|
->getAbsolutePath(m_screenshot.c_str()).c_str();
|
||||||
|
GE::getGEConfig()->m_ondemand_load_texture_paths.insert(m_screenshot);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
delete root;
|
delete root;
|
||||||
|
|
||||||
|
@ -175,6 +175,7 @@ void TrackManager::loadTrackList()
|
|||||||
loadTrack(dir+*subdir+"/");
|
loadTrack(dir+*subdir+"/");
|
||||||
} // for dir in dirs
|
} // for dir in dirs
|
||||||
} // for i <m_track_search_path.size()
|
} // for i <m_track_search_path.size()
|
||||||
|
onDemandLoadTrackScreenshots();
|
||||||
} // loadTrackList
|
} // loadTrackList
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@ -341,3 +342,19 @@ int TrackManager::getTrackIndexByIdent(const std::string& ident) const
|
|||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
} // getTrackIndexByIdent
|
} // getTrackIndexByIdent
|
||||||
|
|
||||||
|
// ----------------------------------------------------------------------------
|
||||||
|
void TrackManager::onDemandLoadTrackScreenshots()
|
||||||
|
{
|
||||||
|
if (irr_driver->getVideoDriver()->getDriverType() != video::EDT_VULKAN)
|
||||||
|
return;
|
||||||
|
for (unsigned i = 0; i < m_tracks.size(); i++)
|
||||||
|
{
|
||||||
|
if (m_tracks[i]->isInternal())
|
||||||
|
continue;
|
||||||
|
irr::video::ITexture* screenshot = irr_driver->getTexture(
|
||||||
|
m_tracks[i]->getScreenshotFile());
|
||||||
|
if (screenshot && screenshot->useOnDemandLoad())
|
||||||
|
screenshot->getTextureHandler();
|
||||||
|
}
|
||||||
|
} // onDemandLoadTrackScreenshots
|
||||||
|
@ -136,6 +136,8 @@ public:
|
|||||||
{
|
{
|
||||||
return soccer_arena ? m_soccer_arena_groups[g] : m_arena_groups[g];
|
return soccer_arena ? m_soccer_arena_groups[g] : m_arena_groups[g];
|
||||||
} // getArenasInGroup
|
} // getArenasInGroup
|
||||||
|
// ------------------------------------------------------------------------
|
||||||
|
void onDemandLoadTrackScreenshots();
|
||||||
|
|
||||||
}; // TrackManager
|
}; // TrackManager
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user