mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-15 04:15:28 +00:00
Optimised game-loading, by not reading terrain textures or calculating bounding boxes when not necessary; maps load about twenty seconds faster (at least in Debug mode). Also fixed possible minor bug (FLT_MIN vs -FLT_MAX) and other trivial things.
This was SVN commit r1917.
This commit is contained in:
@@ -57,7 +57,11 @@ CTextureEntry* CTextureManager::FindTexture(Handle handle)
|
||||
for (uint k=0;k<m_TerrainTextures.size();k++) {
|
||||
STextureType& ttype=m_TerrainTextures[k];
|
||||
for (uint i=0;i<ttype.m_Textures.size();i++) {
|
||||
if (handle==ttype.m_Textures[i]->GetHandle()) {
|
||||
// Don't bother looking at textures that haven't been loaded yet - since
|
||||
// the caller has given us a Handle to the texture, it must be loaded.
|
||||
// (This matters because GetHandle would load the texture, even though
|
||||
// there's no need to.)
|
||||
if (ttype.m_Textures[i]->IsLoaded() && handle==ttype.m_Textures[i]->GetHandle()) {
|
||||
return ttype.m_Textures[i];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user