From b3a3c5dfe5d4779f546d2800e24e9a32a1e25be7 Mon Sep 17 00:00:00 2001 From: Patryk Obara Date: Wed, 15 Apr 2020 17:51:01 +0200 Subject: [PATCH] Use new icon in Windows builds --- src/dosbox.ico => contrib/icons/dosbox-old.ico | Bin src/gui/sdlmain.cpp | 17 ++++++++++++----- src/winres.rc | 3 +-- 3 files changed, 13 insertions(+), 7 deletions(-) rename src/dosbox.ico => contrib/icons/dosbox-old.ico (100%) diff --git a/src/dosbox.ico b/contrib/icons/dosbox-old.ico similarity index 100% rename from src/dosbox.ico rename to contrib/icons/dosbox-old.ico diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 24fa8ff1..9989333d 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -470,12 +470,18 @@ static int watch_sdl_events(void *userdata, SDL_Event *e) } #endif -#if defined(MACOSX) - -// On macOS, as we use a nicer external icon packaged in App bundle. +/* On macOS, as we use a nicer external icon packaged in App bundle. + * + * Visual Studio bundles .ico file specified in winres.rc into the + * dosbox.exe file. + * + * Other OSes will either use svg icon bundled in the native package, or + * the window uploaded via SDL_SetWindowIcon below. + */ +#if defined(MACOSX) || defined(_MSC_VER) static void SetIcon() {} - #else + #include "icon.c" static void SetIcon() @@ -493,7 +499,8 @@ static void SetIcon() SDL_SetWindowIcon(sdl.window, s); SDL_FreeSurface(s); } -#endif // !defined(MACOSX) + +#endif static void KillSwitch(bool pressed) { if (!pressed) diff --git a/src/winres.rc b/src/winres.rc index 879b25d1..402e02e2 100644 --- a/src/winres.rc +++ b/src/winres.rc @@ -2,8 +2,7 @@ #include "winresrc.h" // icon resource -dosbox_ico ICON "dosbox.ico" - +DOSBOX_ICO ICON "..\\contrib\\icons\\dosbox-staging.ico" // version resource VS_VERSION_INFO VERSIONINFO