@@ -282,16 +282,16 @@ bool VideoDriver_SDL::CreateMainSurface(
if (_sdl_window == nullptr) {
DEBUG(driver, 0, "SDL2: Couldn't allocate a window to draw on");
return false;
}
char icon_path[MAX_PATH];
if (FioFindFullPath(icon_path, lastof(icon_path), BASESET_DIR, "openttd.32.bmp") != nullptr) {
std::string icon_path = FioFindFullPath(BASESET_DIR, "openttd.32.bmp");
if (!icon_path.empty()) {
/* Give the application an icon */
SDL_Surface *icon = SDL_LoadBMP(icon_path);
SDL_Surface *icon = SDL_LoadBMP(icon_path.c_str());
if (icon != nullptr) {
/* Get the colourkey, which will be magenta */
uint32 rgbmap = SDL_MapRGB(icon->format, 255, 0, 255);
SDL_SetColorKey(icon, SDL_TRUE, rgbmap);
SDL_SetWindowIcon(_sdl_window, icon);