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:
Ykkrosh
2005-02-09 23:19:48 +00:00
parent 614e523c89
commit 3b1395d80b
14 changed files with 175 additions and 154 deletions
+5 -1
View File
@@ -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];
}
}