From 686164a4de8d1a7d8b78e279e7b9eb7c5a77fb6f Mon Sep 17 00:00:00 2001 From: Exzap <13877693+Exzap@users.noreply.github.com> Date: Tue, 1 Sep 2026 15:08:07 +0200 Subject: [PATCH] GameList: Fix ordering --- src/gui/wxgui/components/wxGameList.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/wxgui/components/wxGameList.cpp b/src/gui/wxgui/components/wxGameList.cpp index 68c9762d..68116026 100644 --- a/src/gui/wxgui/components/wxGameList.cpp +++ b/src/gui/wxgui/components/wxGameList.cpp @@ -1082,7 +1082,7 @@ void wxGameList::OnClose(wxCloseEvent& event) int wxGameList::FindInsertPosition(TitleId titleId, bool& entryAlreadyExists) { entryAlreadyExists = false; - SortData data{this, ItemColumns(GetSortIndicator()), IsAscendingSortIndicator()}; + SortData data{this, ItemColumns(GetSortIndicator()), IsAscendingSortIndicator() ? 1 : -1}; const auto itemCount = GetItemCount(); if (itemCount == 0) @@ -1092,7 +1092,7 @@ int wxGameList::FindInsertPosition(TitleId titleId, bool& entryAlreadyExists) while (low < high) { sint32 mid = low + (high - low) / 2; - auto cmp = SortComparator(titleId, (uint64)GetItemData(mid), &data); + auto cmp = data.dir * order_to_int(SortComparator(titleId, (uint64)GetItemData(mid), &data)); if (cmp <= 0) { if (cmp == 0)