mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-08 11:57:25 +00:00
SLUDGE: Fix shadow flickering in frasse
Opening the action menu would cause frasse's shadow to flicker. It would go on top and below the sprite.
This commit is contained in:
parent
b0c853c992
commit
cc714bd989
@ -474,11 +474,29 @@ struct PeopleYComperator {
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T, class StrictWeakOrdering>
|
||||
void bubble_sort(T first, T last, StrictWeakOrdering comp) {
|
||||
bool swapped;
|
||||
do {
|
||||
swapped = false;
|
||||
for (T i = first; i != last; ++i) {
|
||||
T j = i;
|
||||
++j;
|
||||
if (j != last && comp(*j, *i)) {
|
||||
SWAP(*i, *j);
|
||||
swapped = true;
|
||||
}
|
||||
}
|
||||
} while (swapped);
|
||||
}
|
||||
|
||||
void PeopleManager::shufflePeople() {
|
||||
if (_allPeople->empty())
|
||||
return;
|
||||
|
||||
Common::sort(_allPeople->begin(), _allPeople->end(), PeopleYComperator());
|
||||
// Use a stable sorting algorithm to sort people to avoid
|
||||
// equal elements moving around and causing flickering issues
|
||||
bubble_sort(_allPeople->begin(), _allPeople->end(), PeopleYComperator());
|
||||
}
|
||||
|
||||
void PeopleManager::drawPeople() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user