mirror of
https://github.com/glest/glest-source.git
synced 2025-08-16 21:33:59 +02:00
- bugfix for language files in scenarios and tutorials
- added numerous performance profiling statements
This commit is contained in:
@@ -574,16 +574,18 @@ string extractFileFromDirectoryPath(string filename)
|
||||
|
||||
string extractDirectoryPathFromFile(string filename)
|
||||
{
|
||||
size_t lastDirectory_Win = filename.find_last_of('\\');
|
||||
size_t lastDirectory_Lin = filename.find_last_of('/');
|
||||
size_t lastDirectory = (lastDirectory_Win<lastDirectory_Lin)?lastDirectory_Lin:lastDirectory_Win;
|
||||
size_t lastDirectory = filename.find_last_of("/\\");
|
||||
//printf("In [%s::%s Line: %d] filename = [%s] lastDirectory= %u\n",__FILE__,__FUNCTION__,__LINE__,filename.c_str(),lastDirectory);
|
||||
|
||||
string path = "";
|
||||
//return filename.substr( 0, filename.rfind("/")+1 );
|
||||
if (lastDirectory == string::npos) {
|
||||
return "";
|
||||
if (lastDirectory != string::npos) {
|
||||
path = filename.substr( 0, lastDirectory + 1);
|
||||
}
|
||||
|
||||
return filename.substr( 0, lastDirectory + 1);
|
||||
//printf("In [%s::%s Line: %d] filename = [%s] path = [%s]\n",__FILE__,__FUNCTION__,__LINE__,filename.c_str(),path.c_str());
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
string extractExtension(const string& filepath) {
|
||||
|
@@ -96,6 +96,8 @@ int CALLBACK EnumFontFamExProc(ENUMLOGFONTEX *lpelfe,
|
||||
|
||||
void createGlFontBitmaps(uint32 &base, const string &type, int size, int width,
|
||||
int charCount, FontMetrics &metrics) {
|
||||
// -adecw-screen-medium-r-normal--18-180-75-75-m-160-gb2312.1980-1 this is a Chinese font
|
||||
|
||||
#ifdef X11_AVAILABLE
|
||||
Display* display = glXGetCurrentDisplay();
|
||||
if(display == 0) {
|
||||
|
@@ -203,12 +203,12 @@ void SystemFlags::OutputDebug(DebugType type, const char *fmt, ...) {
|
||||
|
||||
assert(currentDebugLog.fileStream != NULL);
|
||||
|
||||
//currentDebugLog.mutex->p();
|
||||
currentDebugLog.mutex->p();
|
||||
|
||||
(*currentDebugLog.fileStream) << "[" << szBuf2 << "] " << szBuf;
|
||||
(*currentDebugLog.fileStream).flush();
|
||||
|
||||
//currentDebugLog.mutex->v();
|
||||
currentDebugLog.mutex->v();
|
||||
}
|
||||
// output to console
|
||||
else {
|
||||
|
Reference in New Issue
Block a user