summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-03-22 16:41:10 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-03-22 16:41:10 +0000
commitf6bd7da487f163d8ce6fa6975229715f11e1c3bb (patch)
tree3a2f4985865275aa84a2892b06f808f44b96279c
parentc1e091c761ca5f673831d4547db80b1ba1c59399 (diff)
downloadmana-f6bd7da487f163d8ce6fa6975229715f11e1c3bb.tar.gz
mana-f6bd7da487f163d8ce6fa6975229715f11e1c3bb.tar.bz2
mana-f6bd7da487f163d8ce6fa6975229715f11e1c3bb.tar.xz
mana-f6bd7da487f163d8ce6fa6975229715f11e1c3bb.zip
Use the icon included in the executable on Windows.
-rw-r--r--data/icons/CMakeLists.txt2
-rw-r--r--data/icons/Makefile.am2
-rw-r--r--data/icons/tmw-32x32.pngbin2228 -> 0 bytes
-rw-r--r--src/main.cpp13
4 files changed, 14 insertions, 3 deletions
diff --git a/data/icons/CMakeLists.txt b/data/icons/CMakeLists.txt
index 60bfc921..e50c7ab9 100644
--- a/data/icons/CMakeLists.txt
+++ b/data/icons/CMakeLists.txt
@@ -1,5 +1,5 @@
SET(FILES
- tmw-32x32.png
+ tmw.png
)
INSTALL(FILES ${FILES} DESTINATION ${DATA_DIR}/icons)
diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am
index 3354d7ff..375edef7 100644
--- a/data/icons/Makefile.am
+++ b/data/icons/Makefile.am
@@ -1,7 +1,7 @@
iconsdir = $(pkgdatadir)/data/icons
-icons_DATA = tmw-32x32.png
+icons_DATA = tmw.png
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(datadir)/pixmaps
diff --git a/data/icons/tmw-32x32.png b/data/icons/tmw-32x32.png
deleted file mode 100644
index af9ad35c..00000000
--- a/data/icons/tmw-32x32.png
+++ /dev/null
Binary files differ
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 <SDL_syswm.h>
+#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);