From b8d1864a077fbff5bbed32f3763ce6b8e69ce0d2 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 16 Jan 2021 13:01:51 -0500 Subject: [PATCH] aegisub: ifdef wxBitmap constructor to scale on MacOS only Quick fix to unblock the build; need better HiDPI handling across the board --- meson.build | 1 + src/libresrc/libresrc.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/meson.build b/meson.build index 5783379c8..7c0e27331 100644 --- a/meson.build +++ b/meson.build @@ -131,6 +131,7 @@ else '-DwxBUILD_SHARED=@0@'.format(build_shared), '-DwxUSE_WEBVIEW=OFF', # breaks build on linux '-DCMAKE_BUILD_TYPE=@0@'.format(build_type), + '-DwxUSE_IMAGE=ON', '-DwxBUILD_MONOLITHIC=ON']) # otherwise breaks project generation w/ meson deps += [ wx.dependency('wxmono'), diff --git a/src/libresrc/libresrc.cpp b/src/libresrc/libresrc.cpp index 79dc0f16c..bc0cda22f 100644 --- a/src/libresrc/libresrc.cpp +++ b/src/libresrc/libresrc.cpp @@ -23,8 +23,13 @@ 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); +#else + return wxBitmap(wxImage(mem)); + return wxBitmap(wxImage(mem).Mirror()); +#endif } wxIcon libresrc_geticon(const unsigned char *buff, size_t size) {