diff options
author | David Athay <ko2fan@gmail.com> | 2011-01-27 14:55:56 -0600 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2011-01-27 14:55:56 -0600 |
commit | e5ecfdfd67b806c76cbcc57f0df8e2ddda75ac2e (patch) | |
tree | a147807888b1c3d9b1fcf3c178143d9572ce6c41 /src/client.cpp | |
parent | 0c4cc6b924d953459198aaae4710296ffb47bfa4 (diff) | |
parent | fe7a543ce0495b55122afbf11d0488289613cff5 (diff) | |
download | mana-client-e5ecfdfd67b806c76cbcc57f0df8e2ddda75ac2e.tar.gz mana-client-e5ecfdfd67b806c76cbcc57f0df8e2ddda75ac2e.tar.bz2 mana-client-e5ecfdfd67b806c76cbcc57f0df8e2ddda75ac2e.tar.xz mana-client-e5ecfdfd67b806c76cbcc57f0df8e2ddda75ac2e.zip |
Merge branch '0.5' of git://gitorious.org/mana/mana into 0.5
Diffstat (limited to 'src/client.cpp')
-rw-r--r-- | src/client.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/client.cpp b/src/client.cpp index 110420d5..b57c3ae8 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -299,17 +299,29 @@ Client::Client(const Options &options): // Add the local data directory to PhysicsFS search path resman->addToSearchPath(mLocalDataDir, false); + std::string iconFile = branding.getValue("appIcon", "icons/mana"); +#ifdef WIN32 + iconFile += ".ico"; +#else + iconFile += ".png"; +#endif + iconFile = resman->getPath(iconFile); + logger->log("Loading icon from file: %s", iconFile.c_str()); #ifdef WIN32 static SDL_SysWMinfo pInfo; SDL_GetWMInfo(&pInfo); - HICON icon = LoadIcon(GetModuleHandle(NULL), "A"); + // Attempt to load icon from .ico file + HICON icon = (HICON) LoadImage(NULL, + iconFile.c_str(), + IMAGE_ICON, 64, 64, LR_LOADFROMFILE); + // If it's failing, we load the default resource file. + if (!icon) + icon = LoadIcon(GetModuleHandle(NULL), "A"); + if (icon) - { SetClassLong(pInfo.window, GCL_HICON, (LONG) icon); - } #else - mIcon = IMG_Load(resman->getPath( - branding.getValue("appIcon", "icons/mana.png")).c_str()); + mIcon = IMG_Load(iconFile.c_str()); if (mIcon) { SDL_SetAlpha(mIcon, SDL_SRCALPHA, SDL_ALPHA_OPAQUE); |