- 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 introVideoFile = CoreData::getInstance().getIntroVideoFilename();
|
||||||
string introVideoFileFallback = CoreData::getInstance().getIntroVideoFilenameFallback();
|
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.clearBuffers();
|
||||||
//renderer.reset3dMenu();
|
//renderer.reset3dMenu();
|
||||||
//renderer.clearZBuffer();
|
//renderer.clearZBuffer();
|
||||||
|
|
|
@ -121,13 +121,21 @@ Text * FontMetrics::getTextHandler() {
|
||||||
|
|
||||||
float FontMetrics::getTextWidth(const string &str) {
|
float FontMetrics::getTextWidth(const string &str) {
|
||||||
string longestLine = "";
|
string longestLine = "";
|
||||||
vector<string> lineTokens;
|
size_t found = str.find("\n");
|
||||||
Tokenize(str,lineTokens,"\n");
|
if (found == string::npos) {
|
||||||
for(unsigned int i = 0; i < lineTokens.size(); ++i) {
|
longestLine = str;
|
||||||
string currentStr = lineTokens[i];
|
}
|
||||||
if(currentStr.length() > longestLine.length()) {
|
else {
|
||||||
longestLine = currentStr;
|
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) {
|
if(textHandler != NULL) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user