diff options
Diffstat (limited to 'apps/plugins/sdl/progs/quake/common.h')
-rw-r--r-- | apps/plugins/sdl/progs/quake/common.h | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/apps/plugins/sdl/progs/quake/common.h b/apps/plugins/sdl/progs/quake/common.h index a1ac227aff..8c6ab3a2dc 100644 --- a/apps/plugins/sdl/progs/quake/common.h +++ b/apps/plugins/sdl/progs/quake/common.h | |||
@@ -88,12 +88,29 @@ void InsertLinkAfter (link_t *l, link_t *after); | |||
88 | 88 | ||
89 | extern qboolean bigendien; | 89 | extern qboolean bigendien; |
90 | 90 | ||
91 | extern short (*BigShort) (short l); | 91 | // not safe on unaligned data |
92 | extern short (*LittleShort) (short l); | 92 | extern short (*BigShort) (short l); |
93 | extern int (*BigLong) (int l); | 93 | extern short (*LittleShort) (short l); |
94 | extern int (*LittleLong) (int l); | 94 | extern int (*BigLong) (int l); |
95 | extern float (*BigFloat) (float l); | 95 | extern int (*LittleLong) (int l); |
96 | extern float (*LittleFloat) (float l); | 96 | extern float (*BigFloat) (float l); |
97 | extern float (*LittleFloat) (float l); | ||
98 | |||
99 | #define LittleShortUnaligned(x) ReadLittleShort(((char*)(&(x)))) | ||
100 | #define BigShortUnaligned(x) ReadBigShort(((char*)&(x))) | ||
101 | #define LittleLongUnaligned(x) ReadLittleLong(((char*)&(x))) | ||
102 | #define BigLongUnaligned(x) ReadBigLong(((char*)&(x))) | ||
103 | #define LittleFloatUnaligned(x) ReadLittleFloat(((char*)&(x))) | ||
104 | #define BigFloatUnaligned(x) ReadBigFloat(((char*)&(x)) | ||
105 | |||
106 | |||
107 | // for unaligned | ||
108 | short ReadBigShort (char *l); | ||
109 | short ReadLittleShort (char *l); | ||
110 | int ReadBigLong (char *l); | ||
111 | int ReadLittleLong (char *l); | ||
112 | float ReadBigFloat (char *l); | ||
113 | float ReadLittleFloat (char *l); | ||
97 | 114 | ||
98 | //============================================================================ | 115 | //============================================================================ |
99 | 116 | ||