diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 69055644d3..ede8699101 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -375,16 +375,18 @@ void GameButton::Draw(UIContext &dc) { } else { dc.Draw()->Flush(); } + if (ginfo->hasConfig && !ginfo->id.empty()) { const AtlasImage *gearImage = dc.Draw()->GetAtlas()->getImage(ImageID("I_GEAR")); if (gearImage) { if (gridStyle_) { - dc.Draw()->DrawImage(ImageID("I_GEAR"), x, y + h - gearImage->h*g_Config.fGameGridScale, g_Config.fGameGridScale); + dc.Draw()->DrawImage(ImageID("I_GEAR"), bounds_.x, y + h - gearImage->h*g_Config.fGameGridScale, g_Config.fGameGridScale); } else { - dc.Draw()->DrawImage(ImageID("I_GEAR"), x - gearImage->w, y, 1.0f); + dc.Draw()->DrawImage(ImageID("I_GEAR"), bounds_.x - 1, y, 1.0f); } } } + const int regionIndex = (int)ginfo->region; if (g_Config.bShowRegionOnGameIcon && regionIndex >= 0 && regionIndex < (int)GameRegion::COUNT) { const ImageID regionIcons[(int)GameRegion::COUNT] = { @@ -398,22 +400,25 @@ void GameButton::Draw(UIContext &dc) { const AtlasImage *image = dc.Draw()->GetAtlas()->getImage(regionIcons[regionIndex]); if (image) { if (gridStyle_) { - dc.Draw()->DrawImage(regionIcons[regionIndex], x + w - (image->w + 5)*g_Config.fGameGridScale, + dc.Draw()->DrawImage(regionIcons[regionIndex], bounds_.x + bounds_.w - (image->w + 5)*g_Config.fGameGridScale, y + h - (image->h + 5)*g_Config.fGameGridScale, g_Config.fGameGridScale); } else { - dc.Draw()->DrawImage(regionIcons[regionIndex], x - 2 - image->w - 3, y + h - image->h - 5, 1.0f); + dc.Draw()->DrawImage(regionIcons[regionIndex], bounds_.x + 4, y + h - image->h - 5, 1.0f); } } } + if (gridStyle_ && g_Config.bShowIDOnGameIcon) { dc.SetFontScale(0.5f*g_Config.fGameGridScale, 0.5f*g_Config.fGameGridScale); - dc.DrawText(ginfo->id_version, x+5, y+1, 0xFF000000, ALIGN_TOPLEFT); - dc.DrawText(ginfo->id_version, x+4, y, dc.theme->infoStyle.fgColor, ALIGN_TOPLEFT); + dc.DrawText(ginfo->id_version, bounds_.x+5, y+1, 0xFF000000, ALIGN_TOPLEFT); + dc.DrawText(ginfo->id_version, bounds_.x+4, y, dc.theme->infoStyle.fgColor, ALIGN_TOPLEFT); dc.SetFontScale(1.0f, 1.0f); } + if (overlayColor) { dc.FillRect(Drawable(overlayColor), overlayBounds); } + dc.RebindTexture(); } diff --git a/UI/SavedataScreen.cpp b/UI/SavedataScreen.cpp index 63cc707703..0f639834df 100644 --- a/UI/SavedataScreen.cpp +++ b/UI/SavedataScreen.cpp @@ -757,10 +757,11 @@ void GameIconView::Draw(UIContext &dc) { // 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); + int x = bounds_.x + (bounds_.w - nw) / 2.0f; dc.Flush(); dc.GetDrawContext()->BindTexture(0, texture); - dc.Draw()->Rect(bounds_.x, bounds_.y, nw, bounds_.h, color); + dc.Draw()->Rect(x, bounds_.y, nw, bounds_.h, color); dc.Flush(); dc.RebindTexture(); }