mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-30 09:43:45 +01:00
UI: Prevent stretching game icons on detail.
Also, make them a bit bigger in the save data screen.
This commit is contained in:
1 parent
03cd1d5c5e
commit
dbb19d169f
4 files changed
+12
-7
No files matched your search
+7
-3
@@ -228,8 +228,8 @@ void GameIconView::Draw(UIContext &dc) {
|
||||
return;
|
||||
}
|
||||
|
||||
textureWidth_ = info->icon.texture->Width();
|
||||
textureHeight_ = info->icon.texture->Height();
|
||||
textureWidth_ = info->icon.texture->Width() * scale_;
|
||||
textureHeight_ = info->icon.texture->Height() * scale_;
|
||||
|
||||
// Fade icon with the backgrounds.
|
||||
double loadTime = info->icon.timeLoaded;
|
||||
@@ -241,9 +241,13 @@ void GameIconView::Draw(UIContext &dc) {
|
||||
}
|
||||
uint32_t color = whiteAlpha(ease((time_now_d() - loadTime) * 3));
|
||||
|
||||
// Adjust size so we don't stretch the image vertically or horizontally.
|
||||
// Make sure it's not wider than 144 (like Doom Legacy homebrew), ugly in the grid mode.
|
||||
float nw = std::min(bounds_.h * textureWidth_ / textureHeight_, (float)bounds_.w);
|
||||
|
||||
dc.Flush();
|
||||
dc.GetDrawContext()->BindTexture(0, info->icon.texture->GetTexture());
|
||||
dc.Draw()->Rect(bounds_.x, bounds_.y, bounds_.w, bounds_.h, color);
|
||||
dc.Draw()->Rect(bounds_.x, bounds_.y, nw, bounds_.h, color);
|
||||
dc.Flush();
|
||||
dc.RebindTexture();
|
||||
}
|
||||
Reference in new issue
Block a user