From 7fdfea5a6935fd0293fcb3b51790019b9adeedf7 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Wed, 30 Sep 2015 20:50:33 +0200 Subject: [PATCH 1/2] DolphinWX: Don't use nearest neighbor scaling for banners * Makes HBC icons look better * Fixes the issue with white dots appearing in downscaled images * No longer subjectively better for GC banners according to comex --- Source/Core/DolphinWX/ISOFile.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp index 98679b0da2..ed993cd1cb 100644 --- a/Source/Core/DolphinWX/ISOFile.cpp +++ b/Source/Core/DolphinWX/ISOFile.cpp @@ -279,10 +279,7 @@ bool GameListItem::ReadPNGBanner(const std::string& path) wxBitmap GameListItem::ScaleBanner(wxImage* image) { double scale = wxTheApp->GetTopWindow()->GetContentScaleFactor(); - // Note: This uses nearest neighbor, which subjectively looks a lot - // better for GC banners than smooth scaling. - // TODO: Make scaling less bad for Homebrew Channel banners. - image->Rescale(DVD_BANNER_WIDTH * scale, DVD_BANNER_HEIGHT * scale); + image->Rescale(DVD_BANNER_WIDTH * scale, DVD_BANNER_HEIGHT * scale, wxIMAGE_QUALITY_HIGH); #ifdef __APPLE__ return wxBitmap(*image, -1, scale); #else From dec142cd00e0f5d81a01ab9d85e86ca613bbcfb7 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Wed, 30 Sep 2015 21:12:12 +0200 Subject: [PATCH 2/2] DolphinWX: Respect aspect ratio of banners --- Source/Core/DolphinWX/ISOFile.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp index ed993cd1cb..4757334778 100644 --- a/Source/Core/DolphinWX/ISOFile.cpp +++ b/Source/Core/DolphinWX/ISOFile.cpp @@ -278,10 +278,14 @@ bool GameListItem::ReadPNGBanner(const std::string& path) wxBitmap GameListItem::ScaleBanner(wxImage* image) { - double scale = wxTheApp->GetTopWindow()->GetContentScaleFactor(); - image->Rescale(DVD_BANNER_WIDTH * scale, DVD_BANNER_HEIGHT * scale, wxIMAGE_QUALITY_HIGH); + const double gui_scale = wxTheApp->GetTopWindow()->GetContentScaleFactor(); + const double target_width = DVD_BANNER_WIDTH * gui_scale; + const double target_height = DVD_BANNER_HEIGHT * gui_scale; + const double banner_scale = std::min(target_width / image->GetWidth(), target_height / image->GetHeight()); + image->Rescale(image->GetWidth() * banner_scale, image->GetHeight() * banner_scale, wxIMAGE_QUALITY_HIGH); + image->Resize(wxSize(target_width, target_height), wxPoint(), 0xFF, 0xFF, 0xFF); #ifdef __APPLE__ - return wxBitmap(*image, -1, scale); + return wxBitmap(*image, -1, gui_scale); #else return wxBitmap(*image, -1); #endif