From b3dea63e8456af968a35d2bcba8f26d198b697cf Mon Sep 17 00:00:00 2001 From: Crementif <26669564+Crementif@users.noreply.github.com> Date: Thu, 17 Jul 2025 15:30:55 +0200 Subject: [PATCH] build: Fix issues with mac and linux builds --- src/gui/wxgui/components/wxGameList.cpp | 9 +++++++-- src/gui/wxgui/components/wxGameList.h | 1 + src/gui/wxgui/components/wxInputDraw.cpp | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/wxgui/components/wxGameList.cpp b/src/gui/wxgui/components/wxGameList.cpp index 2e8b99c7..748e780a 100644 --- a/src/gui/wxgui/components/wxGameList.cpp +++ b/src/gui/wxgui/components/wxGameList.cpp @@ -642,6 +642,7 @@ enum ContextMenuEntries kContextMenuCopyTitleId, kContextMenuCopyTitleImage }; + void wxGameList::OnContextMenu(wxContextMenuEvent& event) { auto& config = GetConfig(); @@ -1430,7 +1431,9 @@ void wxGameList::CreateShortcut(GameInfo2& gameInfo) iconPath = outIconDir / fmt::format("{:016x}.png", gameInfo.GetBaseTitleId()); wxFileOutputStream pngFileStream(_pathToUtf8(iconPath.value())); - auto image = m_image_list->GetIcon(iconIndex).ConvertToImage(); + const auto icon = m_image_list_data[iconIndex]; + wxBitmap bitmap{icon.GetBitmap(wxDefaultSize)}; + wxImage image = bitmap.ConvertToImage(); wxPNGHandler pngHandler; if (!pngHandler.SaveFile(&image, pngFileStream, false)) { @@ -1521,7 +1524,9 @@ void wxGameList::CreateShortcut(GameInfo2& gameInfo) iconPath = outIconDir / fmt::format("{:016x}.png", gameInfo.GetBaseTitleId()); wxFileOutputStream pngFileStream(_pathToUtf8(iconPath.value())); - auto image = m_image_list->GetIcon(iconIndex).ConvertToImage(); + const auto icon = m_image_list_data[iconIndex]; + wxBitmap bitmap{icon.GetBitmap(wxDefaultSize)}; + wxImage image = bitmap.ConvertToImage(); wxPNGHandler pngHandler; if (!pngHandler.SaveFile(&image, pngFileStream, false)) { diff --git a/src/gui/wxgui/components/wxGameList.h b/src/gui/wxgui/components/wxGameList.h index 15eb8fb2..812842f3 100644 --- a/src/gui/wxgui/components/wxGameList.h +++ b/src/gui/wxgui/components/wxGameList.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include "util/helpers/Semaphore.h" diff --git a/src/gui/wxgui/components/wxInputDraw.cpp b/src/gui/wxgui/components/wxInputDraw.cpp index 0a408b9f..d12237c8 100644 --- a/src/gui/wxgui/components/wxInputDraw.cpp +++ b/src/gui/wxgui/components/wxInputDraw.cpp @@ -1,6 +1,7 @@ #include "wxgui/components/wxInputDraw.h" #include +#include wxInputDraw::wxInputDraw(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size) : wxWindow(parent, id, pos, size, 0, wxPanelNameStr)