libresrc: put new wxBitmap constructor behind wx version check

Based off https://github.com/Aegisub/Aegisub/pull/175
This commit is contained in:
Ryan 2021-01-30 07:29:45 -05:00
parent 8d8ea166df
commit f3958288ac

View file

@ -23,9 +23,11 @@
wxBitmap libresrc_getimage(const unsigned char *buff, size_t size, double scale, int dir) { wxBitmap libresrc_getimage(const unsigned char *buff, size_t size, double scale, int dir) {
wxMemoryInputStream mem(buff, size); wxMemoryInputStream mem(buff, size);
if (dir != wxLayout_RightToLeft) if (dir != wxLayout_RightToLeft)
#ifdef __WXMAC__ #if wxCHECK_VERSION(3, 1, 0)
return wxBitmap(wxImage(mem), -1, scale); // Since wxWidgets 3.1.0, there is an undocumented third parameter in the ctor of wxBitmap from wxImage
return wxBitmap(wxImage(mem).Mirror(), -1, scale); // 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 #else
return wxBitmap(wxImage(mem)); return wxBitmap(wxImage(mem));
return wxBitmap(wxImage(mem).Mirror()); return wxBitmap(wxImage(mem).Mirror());