From 90b546f93e29c6f535aaff0735659e2a2a2a6032 Mon Sep 17 00:00:00 2001 From: AllMeatball <181806857+AllMeatball@users.noreply.github.com> Date: Wed, 14 May 2025 11:16:29 -0500 Subject: [PATCH] isleapp: Set icon on non-windows systems --- ISLE/isleapp.cpp | 15 +++++++++++++++ ISLE/res/resource.h | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index 8350cab6..13bf54d4 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -486,6 +486,21 @@ MxResult IsleApp::SetupWindow() return FAILURE; } +#ifndef _WIN32 + SDL_Surface *icon = SDL_CreateSurfaceFrom( + ISLE_ICON.width, + ISLE_ICON.height, + SDL_PIXELFORMAT_RGBA32, + (void*)ISLE_ICON.pixel_data, + ISLE_ICON.width * ISLE_ICON.bytes_per_pixel + ); + + if (icon) { + SDL_SetWindowIcon(m_windowHandle, icon); + SDL_DestroySurface(icon); + } +#endif + if (!SetupLegoOmni()) { return FAILURE; } diff --git a/ISLE/res/resource.h b/ISLE/res/resource.h index 647c616e..f36db072 100644 --- a/ISLE/res/resource.h +++ b/ISLE/res/resource.h @@ -3,3 +3,7 @@ #define ISLE_BUSY 104 #define APP_ICON 105 + +#ifndef _WIN32 +#include "isle.h" +#endif