summaryrefslogtreecommitdiff
path: root/src/gfx.cpp
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-04-12 18:46:49 +0200
committerglx22 <glx22@users.noreply.github.com>2019-04-18 21:49:34 +0200
commit9195f2337a7c4f9154058877093bbb74db33cf32 (patch)
tree4b04354f9ba835623db51f961ba5c2f9c0342e47 /src/gfx.cpp
parent25e534f3cf42a723f97d6fc08d582329e60a0186 (diff)
downloadopenttd-9195f2337a7c4f9154058877093bbb74db33cf32.tar.xz
Codechange: use std::vector for _resolutions
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r--src/gfx.cpp13
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());
}