diff options
author | glx <glx@openttd.org> | 2019-04-12 18:46:49 +0200 |
---|---|---|
committer | glx22 <glx22@users.noreply.github.com> | 2019-04-18 21:49:34 +0200 |
commit | 9195f2337a7c4f9154058877093bbb74db33cf32 (patch) | |
tree | 4b04354f9ba835623db51f961ba5c2f9c0342e47 /src/gfx.cpp | |
parent | 25e534f3cf42a723f97d6fc08d582329e60a0186 (diff) | |
download | openttd-9195f2337a7c4f9154058877093bbb74db33cf32.tar.xz |
Codechange: use std::vector for _resolutions
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r-- | src/gfx.cpp | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp index 279dd35a8..97ae0f510 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -1691,20 +1691,13 @@ bool ChangeResInGame(int width, int height) bool ToggleFullScreen(bool fs) { bool result = VideoDriver::GetInstance()->ToggleFullscreen(fs); - if (_fullscreen != fs && _num_resolutions == 0) { + if (_fullscreen != fs && _resolutions.empty()) { DEBUG(driver, 0, "Could not find a suitable fullscreen resolution"); } return result; } -static int CDECL compare_res(const Dimension *pa, const Dimension *pb) +void SortResolutions() { - int x = pa->width - pb->width; - if (x != 0) return x; - return pa->height - pb->height; -} - -void SortResolutions(int count) -{ - QSortT(_resolutions, count, &compare_res); + std::sort(_resolutions.begin(), _resolutions.end()); } |