diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-03-27 11:23:16 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-03-27 11:23:16 +0000 |
commit | 75ecd3b04df947ba1ac489f60933f18686b62ec1 (patch) | |
tree | 35651e318ca361a35606ac98ab7dae37965b6887 /src | |
parent | 0b5aa685bf50d03f63126fb261cde464a2bc28e4 (diff) | |
download | mana-75ecd3b04df947ba1ac489f60933f18686b62ec1.tar.gz mana-75ecd3b04df947ba1ac489f60933f18686b62ec1.tar.bz2 mana-75ecd3b04df947ba1ac489f60933f18686b62ec1.tar.xz mana-75ecd3b04df947ba1ac489f60933f18686b62ec1.zip |
Icon loading doesn't necessarily succeed, so better not crash when it doesn't.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index 11600b6f..71963786 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -255,11 +255,17 @@ void init_engine(const Options &options) static SDL_SysWMinfo pInfo; SDL_GetWMInfo(&pInfo); HICON icon = LoadIcon(GetModuleHandle(NULL), "A"); - SetClassLong(pInfo.window, GCL_HICON, (LONG) icon); + if (icon) + { + 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); + if (icon) + { + SDL_SetAlpha(icon, SDL_SRCALPHA, SDL_ALPHA_OPAQUE); + SDL_WM_SetIcon(icon, NULL); + } #endif #ifdef USE_OPENGL |