X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=common.h;h=7ad25529cfc0e9afccb7e44e08511452983f94bf;hb=d5fef1c90c39fd59bf139e8a2c080ec75ef37187;hp=91835e73c04ac009ddd3e638d4da3dd6d1147e8b;hpb=08dc528c1e2e6c2b1891c12dbc69ec985387a232;p=xonotic%2Fdarkplaces.git diff --git a/common.h b/common.h index 91835e73..7ad25529 100644 --- a/common.h +++ b/common.h @@ -17,7 +17,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// comndef.h -- general definitions + +#ifndef COMMON_H +#define COMMON_H // LordHavoc: MSVC has a different name for snprintf #ifdef WIN32 @@ -42,6 +44,7 @@ void SZ_Clear (sizebuf_t *buf); void *SZ_GetSpace (sizebuf_t *buf, int length); void SZ_Write (sizebuf_t *buf, void *data, int length); void SZ_Print (sizebuf_t *buf, char *data); // strcats onto the sizebuf +void SZ_HexDumpToConsole(sizebuf_t *buf); //============================================================================ #if !defined(ENDIAN_LITTLE) && !defined(ENDIAN_BIG) @@ -99,8 +102,6 @@ extern int msg_readcount; extern qboolean msg_badread; // set if a read goes beyond end of message void MSG_BeginReading (void); -//int MSG_ReadChar (void); -//int MSG_ReadByte (void); int MSG_ReadShort (void); int MSG_ReadLong (void); float MSG_ReadFloat (void); @@ -108,11 +109,8 @@ char *MSG_ReadString (void); #define MSG_ReadChar() (msg_readcount >= net_message.cursize ? (msg_badread = true, -1) : (signed char)net_message.data[msg_readcount++]) #define MSG_ReadByte() (msg_readcount >= net_message.cursize ? (msg_badread = true, -1) : (unsigned char)net_message.data[msg_readcount++]) -//#define MSG_ReadShort() ((msg_readcount + 2) > net_message.cursize ? (msg_badread = true, -1) : (short)net_message.data[msg_readcount+=2, msg_readcount-2] | (net_message.data[msg_readcount-1] << 8)) -//#define MSG_ReadLong() ((msg_readcount + 4) > net_message.cursize ? (msg_badread = true, -1) : (int)net_message.data[msg_readcount+=4, msg_readcount-4] | (net_message.data[msg_readcount-3] << 8) | (net_message.data[msg_readcount-2] << 16) | (net_message.data[msg_readcount-1] << 24)) float MSG_ReadCoord (void); -//float MSG_ReadAngle (void); float MSG_ReadDPCoord (void); @@ -125,24 +123,8 @@ extern int dpprotocol; //============================================================================ -/* -void Q_memset (void *dest, int fill, int count); -void Q_memcpy (void *dest, void *src, int count); -int Q_memcmp (void *m1, void *m2, int count); -void Q_strcpy (char *dest, char *src); -void Q_strncpy (char *dest, char *src, int count); -int Q_strlen (char *str); -char *Q_strrchr (char *s, char c); -void Q_strcat (char *dest, char *src); -int Q_strcmp (char *s1, char *s2); -int Q_strncmp (char *s1, char *s2, int count); -*/ int Q_strcasecmp (char *s1, char *s2); int Q_strncasecmp (char *s1, char *s2, int n); -/* -int Q_atoi (char *str); -float Q_atof (char *str); -*/ //============================================================================ @@ -151,13 +133,14 @@ extern qboolean com_eof; char *COM_Parse (char *data); - -extern int com_argc; -extern char **com_argv; +extern char com_basedir[MAX_OSPATH]; +extern int com_argc; +extern char **com_argv; int COM_CheckParm (char *parm); void COM_Init (void); -void COM_InitArgv (int argc, char **argv); +void COM_InitArgv (void); +void COM_InitGameType (void); char *COM_SkipPath (char *pathname); void COM_StripExtension (char *in, char *out); @@ -189,16 +172,15 @@ extern struct cvar_s registered; #define GAME_HIPNOTIC 1 #define GAME_ROGUE 2 #define GAME_NEHAHRA 3 -#define GAME_FIENDARENA 4 -#define GAME_ZYMOTIC 5 -#define GAME_BLOODBATH 6 +#define GAME_TRANSFUSION 4 extern int gamemode; extern char *gamename; // LordHavoc: useful... -extern void COM_ToLowerString(char *in, char *out); -extern void COM_ToUpperString(char *in, char *out); +void COM_ToLowerString(char *in, char *out); +void COM_ToUpperString(char *in, char *out); +int COM_StringBeginsWith(const char *s, const char *match); typedef struct stringlist_s { @@ -209,3 +191,6 @@ typedef struct stringlist_s int matchpattern(char *in, char *pattern); stringlist_t *listdirectory(char *path); void freedirectory(stringlist_t *list); + +#endif +