]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - common.h
Rename model functions to make them more generic and obvious what they're for
[xonotic/darkplaces.git] / common.h
index e91be28379d9830d08f76523874c35dfb02c63bd..bf1d5c134e68ddaa660a6979fced421d274ac244 100644 (file)
--- a/common.h
+++ b/common.h
@@ -26,6 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #ifdef WIN32
 # define strcasecmp _stricmp
 # define strncasecmp _strnicmp
+#else
+#include "strings.h"
 #endif
 
 // Create our own define for Mac OS X
@@ -34,7 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #endif
 
 #ifdef SUNOS
-#include <sys/file.h>          ///< Needed for FNDELAY
+#include <sys/file.h>          ///< Needed for O_NDELAY
 #endif
 
 //============================================================================
@@ -147,22 +149,23 @@ protocolversion_t;
  * @{
  */
 
+void MSG_InitReadBuffer (sizebuf_t *buf, unsigned char *data, int size);
 void MSG_WriteChar (sizebuf_t *sb, int c);
 void MSG_WriteByte (sizebuf_t *sb, int c);
 void MSG_WriteShort (sizebuf_t *sb, int c);
 void MSG_WriteLong (sizebuf_t *sb, int c);
-void MSG_WriteFloat (sizebuf_t *sb, float f);
+void MSG_WriteFloat (sizebuf_t *sb, vec_t f);
 void MSG_WriteString (sizebuf_t *sb, const char *s);
 void MSG_WriteUnterminatedString (sizebuf_t *sb, const char *s);
-void MSG_WriteAngle8i (sizebuf_t *sb, float f);
-void MSG_WriteAngle16i (sizebuf_t *sb, float f);
-void MSG_WriteAngle32f (sizebuf_t *sb, float f);
-void MSG_WriteCoord13i (sizebuf_t *sb, float f);
-void MSG_WriteCoord16i (sizebuf_t *sb, float f);
-void MSG_WriteCoord32f (sizebuf_t *sb, float f);
-void MSG_WriteCoord (sizebuf_t *sb, float f, protocolversion_t protocol);
-void MSG_WriteVector (sizebuf_t *sb, float *v, protocolversion_t protocol);
-void MSG_WriteAngle (sizebuf_t *sb, float f, protocolversion_t protocol);
+void MSG_WriteAngle8i (sizebuf_t *sb, vec_t f);
+void MSG_WriteAngle16i (sizebuf_t *sb, vec_t f);
+void MSG_WriteAngle32f (sizebuf_t *sb, vec_t f);
+void MSG_WriteCoord13i (sizebuf_t *sb, vec_t f);
+void MSG_WriteCoord16i (sizebuf_t *sb, vec_t f);
+void MSG_WriteCoord32f (sizebuf_t *sb, vec_t f);
+void MSG_WriteCoord (sizebuf_t *sb, vec_t f, protocolversion_t protocol);
+void MSG_WriteVector (sizebuf_t *sb, const vec3_t v, protocolversion_t protocol);
+void MSG_WriteAngle (sizebuf_t *sb, vec_t f, protocolversion_t protocol);
 
 void MSG_BeginReading (sizebuf_t *sb);
 int MSG_ReadLittleShort (sizebuf_t *sb);
@@ -187,7 +190,7 @@ float MSG_ReadCoord13i (sizebuf_t *sb);
 float MSG_ReadCoord16i (sizebuf_t *sb);
 float MSG_ReadCoord32f (sizebuf_t *sb);
 float MSG_ReadCoord (sizebuf_t *sb, protocolversion_t protocol);
-void MSG_ReadVector (sizebuf_t *sb, float *v, protocolversion_t protocol);
+void MSG_ReadVector (sizebuf_t *sb, vec3_t v, protocolversion_t protocol);
 float MSG_ReadAngle (sizebuf_t *sb, protocolversion_t protocol);
 //@}
 //============================================================================
@@ -203,10 +206,6 @@ int COM_ParseToken_QuakeC(const char **datapointer, qboolean returnnewline);
 int COM_ParseToken_VM_Tokenize(const char **datapointer, qboolean returnnewline);
 int COM_ParseToken_Console(const char **datapointer);
 
-extern int com_argc;
-extern const char **com_argv;
-extern int com_selffd;
-
 int COM_CheckParm (const char *parm);
 void COM_Init (void);
 void COM_Shutdown (void);
@@ -234,7 +233,7 @@ extern int dpsnprintf (char *buffer, size_t buffersize, const char *format, ...)
 extern int dpvsnprintf (char *buffer, size_t buffersize, const char *format, va_list args);
 
 // A bunch of functions are forbidden for security reasons (and also to please MSVS 2005, for some of them)
-// LordHavoc: added #undef lines here to avoid warnings in Linux
+// LadyHavoc: added #undef lines here to avoid warnings in Linux
 #undef strcat
 #define strcat DO_NOT_USE_STRCAT__USE_STRLCAT_OR_MEMCPY
 #undef strncat
@@ -267,6 +266,7 @@ typedef enum gamemode_e
        GAME_NORMAL,
        GAME_HIPNOTIC,
        GAME_ROGUE,
+       GAME_QUOTH,
        GAME_NEHAHRA,
        GAME_NEXUIZ,
        GAME_XONOTIC,
@@ -276,7 +276,6 @@ typedef enum gamemode_e
        GAME_BATTLEMECH,
        GAME_ZYMOTIC,
        GAME_SETHERAL,
-       GAME_SOM,
        GAME_TENEBRAE, // full of evil hackery
        GAME_NEOTERIC,
        GAME_OPENQUARTZ, //this game sucks
@@ -290,14 +289,26 @@ typedef enum gamemode_e
        GAME_PROPHECY,
        GAME_BLOODOMNICIDE,
        GAME_STEELSTORM, // added by motorsep
+       GAME_STEELSTORM2, // added by motorsep
+       GAME_SSAMMO, // added by motorsep
+       GAME_STEELSTORMREVENANTS, // added by motorsep 07/19/2015
+       GAME_TOMESOFMEPHISTOPHELES, // added by motorsep
        GAME_STRAPBOMB, // added by motorsep for Urre
        GAME_MOONHELM,
+       GAME_VORETOURNAMENT,
+       GAME_DOOMBRINGER, // added by Cloudwalk for kristus
        GAME_COUNT
 }
 gamemode_t;
 
+// Master switch for some hacks/changes that eventually should become cvars.
+#define IS_NEXUIZ_DERIVED(g) ((g) == GAME_NEXUIZ || (g) == GAME_XONOTIC || (g) == GAME_VORETOURNAMENT)
+// Pre-csqcmodels era.
+#define IS_OLDNEXUIZ_DERIVED(g) ((g) == GAME_NEXUIZ || (g) == GAME_VORETOURNAMENT)
+
 extern gamemode_t gamemode;
 extern const char *gamename;
+extern const char *gamenetworkfiltername;
 extern const char *gamedirname1;
 extern const char *gamedirname2;
 extern const char *gamescreenshotname;
@@ -372,5 +383,7 @@ char **XPM_DecodeString(const char *in);
 
 size_t base64_encode(unsigned char *buf, size_t buflen, size_t outbuflen);
 
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+
 #endif