Fixed loading/option-saving slowdown brought in by Chinese support to other languages.

This commit is contained in:
linshier
2010-08-15 11:57:31 +00:00
parent 4c4310ac1e
commit 8247c22ff0
2 changed files with 17 additions and 19 deletions
+4 -1
View File
@@ -146,11 +146,14 @@ void GameApp::Create()
jq->SetHotSpot(16,16); jq->SetHotSpot(16,16);
LOG("--Loading fonts"); LOG("--Loading fonts");
string lang = options[Options::LANG].str;
std::transform(lang.begin(), lang.end(), lang.begin(), ::tolower);
if (lang.compare("cn") == 0) {
resources.LoadWFBFont("simon",12); resources.LoadWFBFont("simon",12);
resources.LoadWFBFont("f3",16); resources.LoadWFBFont("f3",16);
resources.LoadWFBFont("magic",16); resources.LoadWFBFont("magic",16);
resources.LoadWFBFont("smallface",12); resources.LoadWFBFont("smallface",12);
}
resources.LoadWLBFont("simon",11); resources.LoadWLBFont("simon",11);
resources.GetWFont("simon")->SetTracking(-1); resources.GetWFont("simon")->SetTracking(-1);
resources.LoadWLBFont("f3",16); resources.LoadWLBFont("f3",16);
+8 -13
View File
@@ -809,22 +809,17 @@ int WResourceManager::reloadWLBFonts(){
} }
int WResourceManager::reloadWFonts(){ int WResourceManager::reloadWFonts(){
//TODO: LoadWFont(). string lang = options[Options::LANG].str;
#if 0 std::transform(lang.begin(), lang.end(), lang.begin(), ::tolower);
vector<string> fontNames;
vector<float> fontSizes;
fontNames.resize(mWFontList.size()); if (lang.compare("cn") != 0)
fontSizes.resize(mWFontList.size());
for ( map<string, int>::iterator itr = mWFontMap.begin(); itr != mWFontMap.end(); ++itr){
fontNames[itr->second] = itr->first;
fontSizes[itr->second] = mWFontList[itr->second]->GetHeight();
}
RemoveWFonts(); RemoveWFonts();
for(size_t i = 0; i < fontNames.size(); ++i){ else if (mWFontList.size() == 0){
LoadWFont(fontNames[i],fontSizes[i]); resources.LoadWFBFont("simon",12);
resources.LoadWFBFont("f3",16);
resources.LoadWFBFont("magic",16);
resources.LoadWFBFont("smallface",12);
} }
#endif
return 1; return 1;
} }