diff --git a/CMakeLists.txt b/CMakeLists.txt index 9488103..293cb22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -263,8 +263,8 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux") # Generate icon_bytes.c from the app icon PNG. add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.c ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.h - COMMAND file_to_c ${CMAKE_SOURCE_DIR}/icons/512.png icon_bytes ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.c ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.h - DEPENDS ${CMAKE_SOURCE_DIR}/icons/512.png + COMMAND file_to_c ${CMAKE_SOURCE_DIR}/icons/app.png icon_bytes ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.c ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.h + DEPENDS ${CMAKE_SOURCE_DIR}/icons/app.png ) target_sources(BanjoRecompiled PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/icon_bytes.c) diff --git a/icons/128.ico b/icons/128.ico deleted file mode 100644 index eb0d575..0000000 Binary files a/icons/128.ico and /dev/null differ diff --git a/icons/16.ico b/icons/16.ico deleted file mode 100644 index 2083dd5..0000000 Binary files a/icons/16.ico and /dev/null differ diff --git a/icons/256.ico b/icons/256.ico deleted file mode 100644 index b87cf2b..0000000 Binary files a/icons/256.ico and /dev/null differ diff --git a/icons/32.ico b/icons/32.ico deleted file mode 100644 index bb993f0..0000000 Binary files a/icons/32.ico and /dev/null differ diff --git a/icons/512.ico b/icons/512.ico deleted file mode 100644 index b87cf2b..0000000 Binary files a/icons/512.ico and /dev/null differ diff --git a/icons/64.ico b/icons/64.ico deleted file mode 100644 index 17de69c..0000000 Binary files a/icons/64.ico and /dev/null differ diff --git a/icons/README.md b/icons/README.md new file mode 100644 index 0000000..b8a6bd5 --- /dev/null +++ b/icons/README.md @@ -0,0 +1,18 @@ +When making icons for Windows, it is important to generate the multiple ICO files on different sizes and pack them into one single ICO file. + +Using a tool such as `icomake` is recommended for this: https://github.com/tringi/icomake + +The recommended workflow is to progressively downscale the icon into the following sizes and export them from a tool that supports exporting to ICO: + +- 256.ico, 256x256 +- 128.ico, 128x128 +- 64.ico, 64x64 +- 32.ico, 32x32 +- 16.ico, 16x16 + +Once these are ready, `icomake` can pack these into one icon with the following command: +``` +.\icomake.exe app.ico 16.ico 32.ico 64.ico 128.ico 256.ico +``` + +If done correctly, Windows will now pick the icon with the correct size on the title bar, the taskbar and as a shortcut. \ No newline at end of file diff --git a/icons/512.png b/icons/app.png similarity index 100% rename from icons/512.png rename to icons/app.png diff --git a/icons/app.rc b/icons/app.rc index d1cfaaa..d2d4df8 100644 --- a/icons/app.rc +++ b/icons/app.rc @@ -1,6 +1,2 @@ -1 ICON DISCARDABLE "512.ico" -2 ICON DISCARDABLE "256.ico" -3 ICON DISCARDABLE "128.ico" -4 ICON DISCARDABLE "64.ico" -5 ICON DISCARDABLE "32.ico" -6 ICON DISCARDABLE "16.ico" \ No newline at end of file +APP_ICON_B ICON "appb.ico" +APP_ICON_K ICON "appk.ico" \ No newline at end of file diff --git a/icons/appb.ico b/icons/appb.ico new file mode 100644 index 0000000..c5c4622 Binary files /dev/null and b/icons/appb.ico differ diff --git a/icons/appk.ico b/icons/appk.ico new file mode 100644 index 0000000..d8f381d Binary files /dev/null and b/icons/appk.ico differ diff --git a/src/main/main.cpp b/src/main/main.cpp index 9432890..f7b1a83 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -151,7 +151,7 @@ ultramodern::renderer::WindowHandle create_window(ultramodern::gfx_callbacks_t:: window = SDL_CreateWindow("Banjo: Recompiled", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1600, 960, flags); #if defined(__linux__) - SetImageAsIcon("icons/512.png",window); + SetImageAsIcon("icons/app.png", window); #endif if (window == nullptr) {