git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2856
d7cf8633-e32d-0410-b094-
e92efae38249
+
+// Extract integers from buffers
+
+unsigned int BuffBigLong (const qbyte *buffer)
+{
+ return (buffer[0] << 24) | (buffer[1] << 16) | (buffer[2] << 8) | buffer[3];
+}
+
+unsigned short BuffBigShort (const qbyte *buffer)
+{
+ return (buffer[0] << 8) | buffer[1];
+}
+
+unsigned int BuffLittleLong (const qbyte *buffer)
+{
+ return (buffer[3] << 24) | (buffer[2] << 16) | (buffer[1] << 8) | buffer[0];
+}
+
+unsigned short BuffLittleShort (const qbyte *buffer)
+{
+ return (buffer[1] << 8) | buffer[0];
+}
+
+
/*
==============================================================================
/*
==============================================================================
extern float (*LittleFloat) (float l);
#endif
extern float (*LittleFloat) (float l);
#endif
+unsigned int BuffBigLong (const qbyte *buffer);
+unsigned short BuffBigShort (const qbyte *buffer);
+unsigned int BuffLittleLong (const qbyte *buffer);
+unsigned short BuffLittleShort (const qbyte *buffer);
+
+
//============================================================================
void MSG_WriteChar (sizebuf_t *sb, int c);
//============================================================================
void MSG_WriteChar (sizebuf_t *sb, int c);