version 0.7
[zeRace] / sdl.h
diff --git a/sdl.h b/sdl.h
index a613c93..26245c5 100644 (file)
--- a/sdl.h
+++ b/sdl.h
@@ -1,7 +1,24 @@
+/* some useful functions for zeRace game */
+
+#include <string.h>
 #include <SDL.h>
 #include <SDL_image.h>
 
+/* endianness setup */
+#if SDL_BYTEORDER == SDL_BIG_ENDIAN
+  #define RMASK 0xff000000
+  #define GMASK 0x00ff0000
+  #define BMASK 0x0000ff00
+  #define AMASK 0x000000ff
+#else
+  #define RMASK 0x000000ff
+  #define GMASK 0x0000ff00
+  #define BMASK 0x00ff0000
+  #define AMASK 0xff000000
+#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);
 void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel);
 void setpixel(SDL_Surface *screen, int x, int y, Uint8 r, Uint8 g, Uint8 b);