From f6bd7da487f163d8ce6fa6975229715f11e1c3bb Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Thu, 22 Mar 2007 16:41:10 +0000 Subject: Use the icon included in the executable on Windows. --- src/main.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 810dc758..98a7aeb7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -81,6 +81,10 @@ #include "utils/dtor.h" #include "utils/tostring.h" +#ifdef WIN32 +#include +#endif + // Account infos char n_server, n_character; @@ -257,9 +261,16 @@ void init_engine(const Options &options) } SDL_WM_SetCaption("The Mana World", NULL); - SDL_Surface *icon = IMG_Load(TMW_DATADIR "data/icons/tmw-32x32.png"); +#ifdef WIN32 + static SDL_SysWMinfo pInfo; + SDL_GetWMInfo(&pInfo); + HICON icon = LoadIcon(GetModuleHandle(NULL), "A"); + SetClassLong(pInfo.window, GCL_HICON, (LONG) icon); +#else + SDL_Surface *icon = IMG_Load(TMW_DATADIR "data/icons/tmw.png"); 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