- tomreyn broken the intro text centering but adding empty intro text properties, so i commented the properties out
- added more info / safer logic to center text
This commit is contained in:
parent
6662f35347
commit
8d6cdfb5db
|
@ -499,6 +499,8 @@ Intro::Intro(Program *program):
|
|||
string introVideoFile = CoreData::getInstance().getIntroVideoFilename();
|
||||
string introVideoFileFallback = CoreData::getInstance().getIntroVideoFilenameFallback();
|
||||
|
||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Intro Video [%s] [%s]\n",introVideoFile.c_str(),introVideoFileFallback.c_str());
|
||||
|
||||
//renderer.clearBuffers();
|
||||
//renderer.reset3dMenu();
|
||||
//renderer.clearZBuffer();
|
||||
|
|
|
@ -121,14 +121,22 @@ Text * FontMetrics::getTextHandler() {
|
|||
|
||||
float FontMetrics::getTextWidth(const string &str) {
|
||||
string longestLine = "";
|
||||
size_t found = str.find("\n");
|
||||
if (found == string::npos) {
|
||||
longestLine = str;
|
||||
}
|
||||
else {
|
||||
vector<string> lineTokens;
|
||||
Tokenize(str,lineTokens,"\n");
|
||||
if(lineTokens.size() > 0) {
|
||||
for(unsigned int i = 0; i < lineTokens.size(); ++i) {
|
||||
string currentStr = lineTokens[i];
|
||||
if(currentStr.length() > longestLine.length()) {
|
||||
longestLine = currentStr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(textHandler != NULL) {
|
||||
//printf("str [%s] textHandler->Advance = %f Font::scaleFontValue = %f\n",str.c_str(),textHandler->Advance(str.c_str()),Font::scaleFontValue);
|
||||
|
|
Loading…
Reference in New Issue
Block a user