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
1 changed files with 5 additions and 3 deletions

View File

@ -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());