diff options
author | Jindrich Makovicka <makovick@gmail.com> | 2018-09-16 18:26:04 +0200 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2018-10-26 20:22:38 +0200 |
commit | 25ab9c1997f770f4a8a66bb3ad4b82ba87e3a977 (patch) | |
tree | ba3950e5d5d9994ff3763ec65d121254bb5b37cc /src/misc_gui.cpp | |
parent | 47ff673664a14e250bf01af6f29c65abb1e0975e (diff) | |
download | openttd-25ab9c1997f770f4a8a66bb3ad4b82ba87e3a977.tar.xz |
Codechange: Improve (un)zoom performance
When zooming out with a high res display, there can be about 150k sprites
to be sorted before displaying. With the O(n^2) complexity of the sprite
sorter, this can take several seconds.
This patch works around this by sorting the sprites by the xmin coordinate
first using QSort, which later allows an early bailout out of the inner
loop. This is enough to cut down the full unzoom time on a 4k display to a
fraction of second.
Diffstat (limited to 'src/misc_gui.cpp')
0 files changed, 0 insertions, 0 deletions