]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - common.h
Coordinates are now floats in network protocol (bloats it yes, but the accuracy allow...
[xonotic/darkplaces.git] / common.h
index 8f1719316d59123617d8064e02e964da38ab1f0c..a9dad19e01e2262500fc7ad7d39c91b0d802f6ba 100644 (file)
--- a/common.h
+++ b/common.h
@@ -31,6 +31,11 @@ typedef enum {false, true}   qboolean;
 
 //============================================================================
 
+extern void *qmalloc(unsigned int size);
+extern void qfree(void *mem);
+
+//============================================================================
+
 typedef struct sizebuf_s
 {
        qboolean        allowoverflow;  // if false, do a Sys_Error
@@ -113,6 +118,9 @@ void MSG_WriteFloat (sizebuf_t *sb, float f);
 void MSG_WriteString (sizebuf_t *sb, char *s);
 void MSG_WriteCoord (sizebuf_t *sb, float f);
 void MSG_WriteAngle (sizebuf_t *sb, float f);
+void MSG_WritePreciseAngle (sizebuf_t *sb, float f);
+
+#define MSG_WriteFloatCoord MSG_WriteFloat
 
 extern int                     msg_readcount;
 extern qboolean        msg_badread;            // set if a read goes beyond end of message
@@ -133,7 +141,10 @@ char *MSG_ReadString (void);
 float MSG_ReadCoord (void);
 //float MSG_ReadAngle (void);
 
-#define MSG_ReadAngle() (dpprotocol ? MSG_ReadShort() * (360.0f / 65536.0f) : MSG_ReadByte() * (360.0f / 256.0f))
+#define MSG_ReadFloatCoord MSG_ReadFloat
+
+#define MSG_ReadAngle() (MSG_ReadByte() * (360.0f / 256.0f))
+#define MSG_ReadPreciseAngle() (MSG_ReadShort() * (360.0f / 65536.0f))
 
 extern qboolean dpprotocol;
 
@@ -194,8 +205,6 @@ int COM_OpenFile (char *filename, int *hndl, qboolean quiet);
 int COM_FOpenFile (char *filename, FILE **file, qboolean quiet);
 void COM_CloseFile (int h);
 
-byte *COM_LoadStackFile (char *path, void *buffer, int bufsize, qboolean quiet);
-byte *COM_LoadTempFile (char *path, qboolean quiet);
 byte *COM_LoadHunkFile (char *path, qboolean quiet);
 byte *COM_LoadMallocFile (char *path, qboolean quiet);
 void COM_LoadCacheFile (char *path, struct cache_user_s *cu, qboolean quiet);
@@ -207,3 +216,7 @@ int COM_FileExists(char *filename);
 extern struct cvar_s   registered;
 
 extern qboolean                standard_quake, rogue, hipnotic, nehahra;
+
+// LordHavoc: useful...
+extern void COM_ToLowerString(char *in, char *out);
+extern void COM_ToUpperString(char *in, char *out);