From f3958288acb5b4ff439287cbb4c3e5d0c60a6725 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 30 Jan 2021 07:29:45 -0500 Subject: [PATCH] libresrc: put new wxBitmap constructor behind wx version check Based off https://github.com/Aegisub/Aegisub/pull/175 --- src/libresrc/libresrc.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/libresrc/libresrc.cpp b/src/libresrc/libresrc.cpp index bc0cda22f..f42bf0e05 100644 --- a/src/libresrc/libresrc.cpp +++ b/src/libresrc/libresrc.cpp @@ -23,9 +23,11 @@ wxBitmap libresrc_getimage(const unsigned char *buff, size_t size, double scale, int dir) { wxMemoryInputStream mem(buff, size); if (dir != wxLayout_RightToLeft) -#ifdef __WXMAC__ - return wxBitmap(wxImage(mem), -1, scale); - return wxBitmap(wxImage(mem).Mirror(), -1, scale); +#if wxCHECK_VERSION(3, 1, 0) + // Since wxWidgets 3.1.0, there is an undocumented third parameter in the ctor of wxBitmap from wxImage + // This "scale" parameter sets the logical scale factor of the created wxBitmap + return wxBitmap(wxImage(mem), wxBITMAP_SCREEN_DEPTH, scale); + return wxBitmap(wxImage(mem).Mirror(), wxBITMAP_SCREEN_DEPTH, scale); #else return wxBitmap(wxImage(mem)); return wxBitmap(wxImage(mem).Mirror());