Skip to content

Commit

Permalink
bugfix: set last active config to the savestate name (#1545)
Browse files Browse the repository at this point in the history
  • Loading branch information
midwan committed Dec 23, 2024
1 parent fcf14be commit bb509c9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1076,6 +1076,7 @@ static void parse_cmdline (int argc, TCHAR **argv)
savestate_state = STATE_DORESTORE;
xfree(txt);
}
SetLastActiveConfig(txt);
#endif
}
loaded = true;
Expand Down Expand Up @@ -1175,6 +1176,7 @@ static void parse_cmdline (int argc, TCHAR **argv)
savestate_state = STATE_DORESTORE;
currprefs.start_gui = false;
}
SetLastActiveConfig(txt);
}
else if (_tcscmp(txt2.c_str(), ".cue") == 0
|| _tcscmp(txt2.c_str(), ".iso") == 0
Expand Down
6 changes: 3 additions & 3 deletions src/osdep/gui/PanelSavestate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static gcn::Image* imgSavestate = nullptr;
static gcn::Button* cmdLoadState;
static gcn::Button* cmdSaveState;

std::string get_file_timestamp(const std::string& filename)
static std::string get_file_timestamp(const std::string& filename)
{
struct stat st {};
tm tm{};
Expand Down Expand Up @@ -210,7 +210,7 @@ void RefreshPanelSavestate()
imgSavestate = nullptr;
}

if (current_state_num >= 0 && current_state_num < radioButtons.size()) {
if (current_state_num >= 0 && current_state_num < static_cast<int>(radioButtons.size())) {
radioButtons[current_state_num]->setSelected(true);
}

Expand All @@ -229,7 +229,7 @@ void RefreshPanelSavestate()
}
}

if (screenshot_filename.length() > 0)
if (!screenshot_filename.empty())
{
auto* const f = fopen(screenshot_filename.c_str(), "rbe");
if (f)
Expand Down

0 comments on commit bb509c9

Please sign in to comment.