mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-22 10:49:05 +02:00
Merge pull request #14817 from hrydgard/savedata-screen-fixes
Savedata screen fixes
This commit is contained in:
3 files changed
+21
-8
No files matched your search
@@ -185,13 +185,22 @@ public:
|
||||
|
||||
// Clamp to curWidth_/curHeight_. Apparently an issue.
|
||||
if ((int)(rc.offset.x + rc.extent.width) > curWidth_) {
|
||||
rc.extent.width = curWidth_ - rc.offset.x;
|
||||
int newWidth = curWidth_ - rc.offset.x;
|
||||
rc.extent.width = std::max(1, newWidth);
|
||||
if (rc.offset.x >= curWidth_) {
|
||||
// Fallback.
|
||||
rc.offset.x = curWidth_ - rc.extent.width;
|
||||
}
|
||||
}
|
||||
|
||||
if ((int)(rc.offset.y + rc.extent.height) > curHeight_) {
|
||||
rc.extent.height = curHeight_ - rc.offset.y;
|
||||
int newHeight = curHeight_ - rc.offset.y;
|
||||
rc.extent.height = std::max(1, newHeight);
|
||||
if (rc.offset.y >= curHeight_) {
|
||||
// Fallback.
|
||||
rc.offset.y = curHeight_ - rc.extent.height;
|
||||
}
|
||||
}
|
||||
_dbg_assert_((int)(rc.offset.x + rc.extent.width) <= curWidth_);
|
||||
_dbg_assert_((int)(rc.offset.y + rc.extent.height) <= curHeight_);
|
||||
curRenderArea_.Apply(rc);
|
||||
|
||||
VkRenderData data{ VKRRenderCommand::SCISSOR };
|
||||
|
||||
@@ -83,7 +83,7 @@ void LoadPostShaderInfo(const std::vector<Path> &directories) {
|
||||
std::vector<File::FileInfo> fileInfo;
|
||||
VFSGetFileListing(directories[d].c_str(), &fileInfo, "ini:");
|
||||
|
||||
if (fileInfo.size() == 0) {
|
||||
if (fileInfo.empty()) {
|
||||
File::GetFilesInDir(directories[d], &fileInfo, "ini:");
|
||||
}
|
||||
|
||||
|
||||
@@ -317,13 +317,13 @@ void SavedataButton::Draw(UIContext &dc) {
|
||||
int availableWidth = bounds_.w - 150;
|
||||
float sineWidth = std::max(0.0f, (tw - availableWidth)) / 2.0f;
|
||||
|
||||
float tx = 150;
|
||||
float tx = 150.0f;
|
||||
if (availableWidth < tw) {
|
||||
float overageRatio = 1.5f * availableWidth * 1.0f / tw;
|
||||
tx -= (1.0f + sin(time_now_d() * overageRatio)) * sineWidth;
|
||||
Bounds tb = bounds_;
|
||||
tb.x = bounds_.x + 150;
|
||||
tb.w = bounds_.w - 150;
|
||||
tb.x = bounds_.x + 150.0f;
|
||||
tb.w = std::max(1.0f, bounds_.w - 150.0f);
|
||||
dc.PushScissor(tb);
|
||||
}
|
||||
dc.DrawText(title_.c_str(), bounds_.x + tx, bounds_.y + 4, style.fgColor, ALIGN_TOPLEFT);
|
||||
@@ -443,6 +443,8 @@ bool SavedataBrowser::BySize(const UI::View *v1, const UI::View *v2) {
|
||||
|
||||
if (GetTotalSize(b1) > GetTotalSize(b2))
|
||||
return true;
|
||||
else if (GetTotalSize(b1) < GetTotalSize(b2))
|
||||
return false;
|
||||
return strcmp(b1->GamePath().c_str(), b2->GamePath().c_str()) < 0;
|
||||
}
|
||||
|
||||
@@ -469,6 +471,8 @@ bool SavedataBrowser::ByDate(const UI::View *v1, const UI::View *v2) {
|
||||
|
||||
if (GetDateSeconds(b1) > GetDateSeconds(b2))
|
||||
return true;
|
||||
if (GetDateSeconds(b1) < GetDateSeconds(b2))
|
||||
return false;
|
||||
return strcmp(b1->GamePath().c_str(), b2->GamePath().c_str()) < 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user