Changed variable name, trying to fix bug

This commit is contained in:
mathusummut
2018-11-05 21:30:51 +01:00
parent bcd76ec746
commit 6775e08fb8

View File

@@ -227,27 +227,27 @@ namespace Shared {
} }
#ifndef WIN32 #ifndef WIN32
string mg_icon_file = ""; string icon_file = "";
#if defined(DATADIR) #if defined(DATADIR)
if (fileExists(formatPath(TOSTRING(DATADIR)) + "zetaglest.png")) { if (fileExists(formatPath(TOSTRING(DATADIR)) + "zetaglest.png")) {
mg_icon_file = formatPath(TOSTRING(DATADIR)) + "zetaglest.png"; icon_file = formatPath(TOSTRING(DATADIR)) + "zetaglest.png";
} else if (fileExists(formatPath(TOSTRING(DATADIR)) + "zetaglest.bmp")) { } else if (fileExists(formatPath(TOSTRING(DATADIR)) + "zetaglest.bmp")) {
mg_icon_file = formatPath(TOSTRING(DATADIR)) + "zetaglest.bmp"; icon_file = formatPath(TOSTRING(DATADIR)) + "zetaglest.bmp";
} }
#endif #endif
if (mg_icon_file == "" && fileExists("zetaglest.png")) { if (icon_file == "" && fileExists("zetaglest.png")) {
mg_icon_file = "zetaglest.png"; icon_file = "zetaglest.png";
} else if (mg_icon_file == "" && fileExists("zetaglest.bmp")) { } else if (icon_file == "" && fileExists("zetaglest.bmp")) {
mg_icon_file = "zetaglest.bmp"; icon_file = "zetaglest.bmp";
} else if (mg_icon_file == "" && fileExists("/usr/share/pixmaps/zetaglest.png")) { } else if (icon_file == "" && fileExists("/usr/share/pixmaps/zetaglest.png")) {
mg_icon_file = "/usr/share/pixmaps/zetaglest.png"; icon_file = "/usr/share/pixmaps/zetaglest.png";
} else if (mg_icon_file == "" && fileExists("/usr/share/pixmaps/zetaglest.bmp")) { } else if (icon_file == "" && fileExists("/usr/share/pixmaps/zetaglest.bmp")) {
mg_icon_file = "/usr/share/pixmaps/zetaglest.bmp"; icon_file = "/usr/share/pixmaps/zetaglest.bmp";
} }
if (mg_icon_file != "") { if (icon_file != "") {
if (icon != NULL) { if (icon != NULL) {
SDL_FreeSurface(icon); SDL_FreeSurface(icon);
@@ -255,12 +255,12 @@ namespace Shared {
} }
//printf("Loading icon [%s]\n",mg_icon_file.c_str()); //printf("Loading icon [%s]\n",mg_icon_file.c_str());
if (extractExtension(mg_icon_file) == "bmp") { if (extractExtension(icon_file) == "bmp") {
icon = SDL_LoadBMP(mg_icon_file.c_str()); icon = SDL_LoadBMP(icon_file.c_str());
} else { } else {
//printf("Loadng png icon\n"); //printf("Loadng png icon\n");
Texture2D *texture2D = GraphicsInterface::getInstance().getFactory()->newTexture2D(); Texture2D *texture2D = GraphicsInterface::getInstance().getFactory()->newTexture2D();
texture2D->load(mg_icon_file); texture2D->load(icon_file);
std::pair<SDL_Surface*, unsigned char*> result = texture2D->CreateSDLSurface(true); std::pair<SDL_Surface*, unsigned char*> result = texture2D->CreateSDLSurface(true);
icon = result.first; icon = result.first;
delete texture2D; delete texture2D;