Skip to content

Commit

Permalink
Fix minor perf problem in debug mode, navigating long game lists.
Browse files Browse the repository at this point in the history
InputMappingToPspButton is very slow and was called once per item.
  • Loading branch information
hrydgard committed Nov 13, 2023
1 parent 1920514 commit 802bae6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions UI/MainScreen.cpp
Expand Up @@ -158,10 +158,10 @@ class GameButton : public UI::Clickable {
std::vector<int> pspKeys;
bool showInfo = false;

if (KeyMap::InputMappingToPspButton(InputMapping(key.deviceId, key.keyCode), &pspKeys)) {
if (HasFocus() && KeyMap::InputMappingToPspButton(InputMapping(key.deviceId, key.keyCode), &pspKeys)) {
for (auto it = pspKeys.begin(), end = pspKeys.end(); it != end; ++it) {
// If the button mapped to triangle, then show the info.
if (HasFocus() && (key.flags & KEY_UP) && *it == CTRL_TRIANGLE) {
if ((key.flags & KEY_UP) && *it == CTRL_TRIANGLE) {
showInfo = true;
}
}
Expand Down

0 comments on commit 802bae6

Please sign in to comment.