diff options
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 |