Fixed loading/option-saving slowdown brought in by Chinese support to other languages.
This commit is contained in:
@@ -146,11 +146,14 @@ void GameApp::Create()
|
|||||||
jq->SetHotSpot(16,16);
|
jq->SetHotSpot(16,16);
|
||||||
|
|
||||||
LOG("--Loading fonts");
|
LOG("--Loading fonts");
|
||||||
resources.LoadWFBFont("simon",12);
|
string lang = options[Options::LANG].str;
|
||||||
resources.LoadWFBFont("f3",16);
|
std::transform(lang.begin(), lang.end(), lang.begin(), ::tolower);
|
||||||
resources.LoadWFBFont("magic",16);
|
if (lang.compare("cn") == 0) {
|
||||||
resources.LoadWFBFont("smallface",12);
|
resources.LoadWFBFont("simon",12);
|
||||||
|
resources.LoadWFBFont("f3",16);
|
||||||
|
resources.LoadWFBFont("magic",16);
|
||||||
|
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);
|
||||||
|
|||||||
@@ -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());
|
RemoveWFonts();
|
||||||
for ( map<string, int>::iterator itr = mWFontMap.begin(); itr != mWFontMap.end(); ++itr){
|
else if (mWFontList.size() == 0){
|
||||||
fontNames[itr->second] = itr->first;
|
resources.LoadWFBFont("simon",12);
|
||||||
fontSizes[itr->second] = mWFontList[itr->second]->GetHeight();
|
resources.LoadWFBFont("f3",16);
|
||||||
|
resources.LoadWFBFont("magic",16);
|
||||||
|
resources.LoadWFBFont("smallface",12);
|
||||||
}
|
}
|
||||||
RemoveWFonts();
|
|
||||||
for(size_t i = 0; i < fontNames.size(); ++i){
|
|
||||||
LoadWFont(fontNames[i],fontSizes[i]);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user