version 0.4
[zeRace] / sdl.h
diff --git a/sdl.h b/sdl.h
index 193d175..3eceb70 100644 (file)
--- a/sdl.h
+++ b/sdl.h
@@ -4,6 +4,19 @@
 #include <SDL.h>
 #include <SDL_image.h>
 
+/* endianness setup */
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+  #define RSHIFT 24
+  #define GSHIFT 16
+  #define BSHIFT 8
+  #define ASHIFT 0
+#else
+  #define RSHIFT 0
+  #define GSHIFT 8
+  #define BSHIFT 16
+  #define ASHIFT 24
+#endif
+
 void print(SDL_Surface *dst,int x,int y,unsigned char *text);
 void readstring(SDL_Surface *dst,int x,int y,unsigned char *text,int limit);
 Uint32 getpixel(SDL_Surface *surface, int x, int y);