Changeset - r9527:baeeb6603576
[Not reviewed]
master
0 1 0
skidd13 - 16 years ago 2008-06-15 16:40:41
skidd13@openttd.org
(svn r13523) -Codechange: replace qsort by the internal typesafe QSortT for resolution sorting
1 file changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/gfx.cpp
Show inline comments
 
@@ -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);
 
}
0 comments (0 inline, 0 general)