Skip to content
Snippets Groups Projects
Commit f2d1d2b4 authored by Andrei Karas's avatar Andrei Karas
Browse files

fix window icon in windows.

parent c41454ff
No related branches found
Tags v1.4.1.4
No related merge requests found
......@@ -356,6 +356,10 @@ void Client::gameInit()
SDL_EventState(SDL_SYSWMEVENT, SDL_IGNORE);
SDL_EventState(SDL_USEREVENT, SDL_IGNORE);
#ifdef WIN32
setIcon();
#endif
initGraphics();
extractDataDir();
mountDataDir();
......@@ -586,7 +590,9 @@ void Client::initTitle()
}
SDL::SetWindowTitle(mainGraphics->getWindow(), mCaption.c_str());
#ifndef WIN32
setIcon();
#endif
}
#ifdef ANDROID
......@@ -2965,6 +2971,8 @@ void Client::setIcon()
// Attempt to load icon from .ico file
HICON icon = (HICON) LoadImage(nullptr, iconFile.c_str(),
IMAGE_ICON, 64, 64, LR_LOADFROMFILE);
if (!icon)
logger->log("icon load error");
// If it's failing, we load the default resource file.
if (!icon)
icon = LoadIcon(GetModuleHandle(nullptr), "A");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment