X-Git-Url: http://royale.zerezo.com/git/?p=zeRace;a=blobdiff_plain;f=sdl.h;h=3eceb7074bb8ff4ee46f306c3faa38cb6dbcede6;hp=a613c93e85e95f336b8bce99232fdde230251edb;hb=ee6ec6d95d78f74973a2ba97077cc94709bb6c61;hpb=f3b6b880f4b72504090898ab825f38f091a68168 diff --git a/sdl.h b/sdl.h index a613c93..3eceb70 100644 --- a/sdl.h +++ b/sdl.h @@ -1,7 +1,24 @@ +/* some useful functions for zeRace game */ + +#include #include #include +/* 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); 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);