From dd7178dbc8d00c7eea4e92d7a3c4d335402cd9f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Sun, 18 Dec 2022 19:08:44 +0100 Subject: [PATCH] Stop setting window icons on windows Also fix font editor builds on windows and add more font editor builds to the ghactions workflow. Funny, we don't really need resource.h anymore. The resource compiler does, but we don't. --- .github/build.sh | 9 +++++++-- src/PowderToyFontEditor.cpp | 18 ------------------ src/PowderToySDL.cpp | 18 ------------------ src/client/Client.cpp | 1 - 4 files changed, 7 insertions(+), 39 deletions(-) diff --git a/.github/build.sh b/.github/build.sh index 46830b453..077a0f412 100755 --- a/.github/build.sh +++ b/.github/build.sh @@ -143,10 +143,15 @@ meson_configure+=$'\t'-Db_strip=false meson_configure+=$'\t'-Db_staticpic=false meson_configure+=$'\t'-Dinstall_check=true meson_configure+=$'\t'-Dmod_id=$MOD_ID -if [[ $BSH_HOST_ARCH-$BSH_HOST_PLATFORM-$BSH_HOST_LIBC == x86_64-linux-gnu ]]; then +case $BSH_HOST_ARCH-$BSH_HOST_PLATFORM-$BSH_HOST_LIBC-$BSH_DEBUG_RELEASE in +x86_64-linux-gnu-debug) ;& +x86_64-windows-mingw-debug) ;& +x86_64-windows-msvc-debug) ;& +x86_64-darwin-macos-debug) meson_configure+=$'\t'-Dbuild_render=true meson_configure+=$'\t'-Dbuild_font=true -fi + ;; +esac if [[ $BSH_STATIC_DYNAMIC == static ]]; then meson_configure+=$'\t'-Dstatic=prebuilt if [[ $BSH_HOST_PLATFORM == windows ]]; then diff --git a/src/PowderToyFontEditor.cpp b/src/PowderToyFontEditor.cpp index 326eba694..cb7a53e83 100644 --- a/src/PowderToyFontEditor.cpp +++ b/src/PowderToyFontEditor.cpp @@ -44,7 +44,6 @@ #include "gui/Style.h" #include "gui/interface/Engine.h" -#define INCLUDE_SYSWM #include "SDLCompat.h" int desktopWidth = 1280, desktopHeight = 1024; @@ -139,23 +138,6 @@ int SDLOpen() } } -#ifdef WIN - SDL_SysWMinfo SysInfo; - SDL_VERSION(&SysInfo.version); - if(SDL_GetWindowWMInfo(sdl_window, &SysInfo) <= 0) - { - printf("%s : %p\n", SDL_GetError(), SysInfo.info.win.window); - exit(-1); - } - HWND WindowHandle = SysInfo.info.win.window; - - // Use GetModuleHandle to get the Exe HMODULE/HINSTANCE - HMODULE hModExe = GetModuleHandle(NULL); - HICON hIconSmall = (HICON)LoadImage(hModExe, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 16, 16, LR_SHARED); - HICON hIconBig = (HICON)LoadImage(hModExe, MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 32, 32, LR_SHARED); - SendMessage(WindowHandle, WM_SETICON, ICON_SMALL, (LPARAM)hIconSmall); - SendMessage(WindowHandle, WM_SETICON, ICON_BIG, (LPARAM)hIconBig); -#endif #ifdef LIN std::vector imageData; int imgw, imgh; diff --git a/src/PowderToySDL.cpp b/src/PowderToySDL.cpp index b05b0337a..b9bb1f3cc 100644 --- a/src/PowderToySDL.cpp +++ b/src/PowderToySDL.cpp @@ -53,7 +53,6 @@ #include "gui/interface/Engine.h" #include "gui/interface/Keys.h" -#define INCLUDE_SYSWM #include "SDLCompat.h" int desktopWidth = 1280, desktopHeight = 1024; @@ -195,23 +194,6 @@ void SDLOpen() } } -#ifdef WIN - SDL_SysWMinfo SysInfo; - SDL_VERSION(&SysInfo.version); - if(SDL_GetWindowWMInfo(sdl_window, &SysInfo) <= 0) - { - printf("%s : %p\n", SDL_GetError(), SysInfo.info.win.window); - exit(-1); - } - HWND WindowHandle = SysInfo.info.win.window; - - // Use GetModuleHandle to get the Exe HMODULE/HINSTANCE - HMODULE hModExe = GetModuleHandle(NULL); - HICON hIconSmall = (HICON)LoadImage(hModExe, MAKEINTRESOURCE(101), IMAGE_ICON, 16, 16, LR_SHARED); - HICON hIconBig = (HICON)LoadImage(hModExe, MAKEINTRESOURCE(101), IMAGE_ICON, 32, 32, LR_SHARED); - SendMessage(WindowHandle, WM_SETICON, ICON_SMALL, (LPARAM)hIconSmall); - SendMessage(WindowHandle, WM_SETICON, ICON_BIG, (LPARAM)hIconBig); -#endif #ifdef LIN std::vector imageData; int imgw, imgh; diff --git a/src/client/Client.cpp b/src/client/Client.cpp index 1d68dcb1f..ed4da1469 100644 --- a/src/client/Client.cpp +++ b/src/client/Client.cpp @@ -32,7 +32,6 @@ # include # include # include -# include "resource.h" #else # include # include