Fix icon packaging on Windows. (#42)
* Fix icon packaging on Windows. * Add icon variants.
@@ -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)
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 753 B |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 4.2 KiB |
@@ -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.
|
||||
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
@@ -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"
|
||||
APP_ICON_B ICON "appb.ico"
|
||||
APP_ICON_K ICON "appk.ico"
|
||||
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 46 KiB |
@@ -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) {
|
||||
|
||||