summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskidd13 <skidd13@openttd.org>2008-06-15 16:40:41 +0000
committerskidd13 <skidd13@openttd.org>2008-06-15 16:40:41 +0000
commitf95cee3057a22c917ced9505b751630ad493f778 (patch)
treeb47a450dae3da0e23d14bae5e97738b2cb81a707 /src
parentdd5f4f0a2cea16741276514581758b2dfc08665b (diff)
downloadopenttd-f95cee3057a22c917ced9505b751630ad493f778.tar.xz
(svn r13523) -Codechange: replace qsort by the internal typesafe QSortT for resolution sorting
Diffstat (limited to 'src')
-rw-r--r--src/gfx.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index 676e68ffc..9f7f4150b 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -18,6 +18,7 @@
#include "core/math_func.hpp"
#include "settings_type.h"
#include "core/alloc_func.hpp"
+#include "core/sort_func.hpp"
#include "landscape_type.h"
#include "table/palettes.h"
@@ -1312,14 +1313,14 @@ bool ToggleFullScreen(bool fs)
return result;
}
-static int CDECL compare_res(const void *pa, const void *pb)
+static int CDECL compare_res(const uint16 *pa, const uint16 *pb)
{
- int x = ((const uint16*)pa)[0] - ((const uint16*)pb)[0];
+ int x = pa[0] - pb[0];
if (x != 0) return x;
- return ((const uint16*)pa)[1] - ((const uint16*)pb)[1];
+ return pa[1] - pb[1];
}
void SortResolutions(int count)
{
- qsort(_resolutions, count, sizeof(_resolutions[0]), compare_res);
+ QSortT((uint16*)_resolutions, count, compare_res);
}