mirror of
https://github.com/glest/glest-source.git
synced 2025-08-29 02:40:17 +02:00
- bugfix for custom data path macro usage to avoid compiler errors
This commit is contained in:
@@ -500,6 +500,11 @@ void endPathWithSlash(string &path,bool requireOSSlash) {
|
||||
}
|
||||
}
|
||||
|
||||
void formatPath(string &path) {
|
||||
replaceAll(path, "\"", "");
|
||||
replaceAll(path, "//", "/");
|
||||
}
|
||||
|
||||
void trimPathWithStartingSlash(string &path) {
|
||||
if(StartsWith(path, "/") == true || StartsWith(path, "\\") == true) {
|
||||
path.erase(path.begin(),path.begin()+1);
|
||||
|
@@ -77,11 +77,11 @@ void PlatformContextGl::init(int colorBits, int depthBits, int stencilBits,bool
|
||||
#ifndef WIN32
|
||||
string mg_icon_file = "";
|
||||
#if defined(CUSTOM_DATA_INSTALL_PATH_VALUE)
|
||||
if(fileExists(CUSTOM_DATA_INSTALL_PATH_VALUE + "megaglest.png")) {
|
||||
mg_icon_file = CUSTOM_DATA_INSTALL_PATH_VALUE + "megaglest.png";
|
||||
if(fileExists(formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH_VALUE)) + "megaglest.png")) {
|
||||
mg_icon_file = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH_VALUE)) + "megaglest.png";
|
||||
}
|
||||
else if(fileExists(CUSTOM_DATA_INSTALL_PATH_VALUE + "megaglest.bmp")) {
|
||||
mg_icon_file = CUSTOM_DATA_INSTALL_PATH_VALUE + "megaglest.bmp";
|
||||
else if(fileExists(formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH_VALUE)) + "megaglest.bmp")) {
|
||||
mg_icon_file = formatPath(TOSTRING(CUSTOM_DATA_INSTALL_PATH_VALUE)) + "megaglest.bmp";
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -202,15 +202,15 @@ void PlatformContextGl::init(int colorBits, int depthBits, int stencilBits,bool
|
||||
SDL_WM_GrabInput(SDL_GRAB_OFF);
|
||||
|
||||
GLuint err = glewInit();
|
||||
if (GLEW_OK != err) {
|
||||
fprintf(stderr, "Error [main]: glewInit failed: %s\n", glewGetErrorString(err));
|
||||
//return 1;
|
||||
throw std::runtime_error((char *)glewGetErrorString(err));
|
||||
if (GLEW_OK != err) {
|
||||
fprintf(stderr, "Error [main]: glewInit failed: %s\n", glewGetErrorString(err));
|
||||
//return 1;
|
||||
throw std::runtime_error((char *)glewGetErrorString(err));
|
||||
}
|
||||
//fprintf(stdout, "Status: Using GLEW %s\n", glewGetString(GLEW_VERSION));
|
||||
|
||||
int bufferSize = (resW * resH * BaseColorPickEntity::COLOR_COMPONENTS);
|
||||
BaseColorPickEntity::init(bufferSize);
|
||||
BaseColorPickEntity::init(bufferSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user