From a596185844988592907e209b3ba75992f313a1c4 Mon Sep 17 00:00:00 2001 From: Tim Angus <tim@ngus.net> Date: Fri, 14 Apr 2006 19:54:56 +0000 Subject: [PATCH] * Fixed radix sort on big endian platforms (from tjw, blame Timbo for the bug) --- code/renderer/tr_main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/renderer/tr_main.c b/code/renderer/tr_main.c index 61112484..d45492cc 100644 --- a/code/renderer/tr_main.c +++ b/code/renderer/tr_main.c @@ -1037,11 +1037,17 @@ Radix sort with 4 byte size buckets static void R_RadixSort( drawSurf_t *source, int size ) { static drawSurf_t scratch[ MAX_DRAWSURFS ]; - +#ifdef Q3_LITTLE_ENDIAN R_Radix( 0, size, source, scratch ); R_Radix( 1, size, scratch, source ); R_Radix( 2, size, source, scratch ); R_Radix( 3, size, scratch, source ); +#else + R_Radix( 3, size, source, scratch ); + R_Radix( 2, size, scratch, source ); + R_Radix( 1, size, source, scratch ); + R_Radix( 0, size, scratch, source ); +#endif //Q3_LITTLE_ENDIAN } //==========================================================================================