From 87607bbc8bf97d8204be4b3eae6eeb5a51bb0ea4 Mon Sep 17 00:00:00 2001 From: David Athay Date: Wed, 12 Nov 2008 16:33:17 +0000 Subject: Fixed chat transparency and icon loading. --- src/main.cpp | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 67eeccd6..ede00d57 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -267,22 +267,6 @@ void initEngine(const Options &options) SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); SDL_WM_SetCaption(branding.getValue("appName", "The Mana World").c_str(), NULL); -#ifdef WIN32 - static SDL_SysWMinfo pInfo; - SDL_GetWMInfo(&pInfo); - HICON icon = LoadIcon(GetModuleHandle(NULL), "A"); - if (icon) - { - SetClassLong(pInfo.window, GCL_HICON, (LONG) icon); - } -#else - SDL_Surface *icon = IMG_Load(TMW_DATADIR branding.getValue("appIcon", "data/icons/tmw.png")); - if (icon) - { - SDL_SetAlpha(icon, SDL_SRCALPHA, SDL_ALPHA_OPAQUE); - SDL_WM_SetIcon(icon, NULL); - } -#endif ResourceManager *resman = ResourceManager::getInstance(); @@ -354,6 +338,23 @@ void initEngine(const Options &options) resman->addToSearchPath(TMW_DATADIR "data", true); #endif +#ifdef WIN32 + static SDL_SysWMinfo pInfo; + SDL_GetWMInfo(&pInfo); + HICON icon = LoadIcon(GetModuleHandle(NULL), "A"); + if (icon) + { + SetClassLong(pInfo.window, GCL_HICON, (LONG) icon); + } +#else + SDL_Surface *icon = IMG_Load(resman->getPath(branding.getValue("appIcon", "data/icons/tmw.png")).c_str()); + if (icon) + { + SDL_SetAlpha(icon, SDL_SRCALPHA, SDL_ALPHA_OPAQUE); + SDL_WM_SetIcon(icon, NULL); + } +#endif + #ifdef USE_OPENGL bool useOpenGL = (config.getValue("opengl", 0) == 1); -- cgit v1.2.3-70-g09d2