if (buf->cursize + length > buf->maxsize)
{
if (!buf->allowoverflow)
- Host_Error ("SZ_GetSpace: overflow without allowoverflow set");
+ Host_Error ("SZ_GetSpace: overflow without allowoverflow set\n");
if (length > buf->maxsize)
- Host_Error ("SZ_GetSpace: %i is > full buffer size", length);
+ Host_Error ("SZ_GetSpace: %i is > full buffer size\n", length);
buf->overflowed = true;
- Con_Printf ("SZ_GetSpace: overflow");
+ Con_Printf ("SZ_GetSpace: overflow\n");
SZ_Clear (buf);
}
void SZ_Print (sizebuf_t *buf, char *data)
{
int len;
-
+
len = strlen(data)+1;
// byte * cast to keep VC++ happy
memcpy ((qbyte *)SZ_GetSpace(buf, len-1)-1,data,len); // write over trailing 0
}
+static char *hexchar = "0123456789ABCDEF";
+void SZ_HexDumpToConsole(sizebuf_t *buf)
+{
+ int i;
+ char text[1024];
+ char *cur, *flushpointer;
+ cur = text;
+ flushpointer = text + 512;
+ for (i = 0;i < buf->cursize;i++)
+ {
+ if ((i & 15) == 0)
+ {
+ *cur++ = hexchar[(i >> 12) & 15];
+ *cur++ = hexchar[(i >> 8) & 15];
+ *cur++ = hexchar[(i >> 4) & 15];
+ *cur++ = hexchar[(i >> 0) & 15];
+ *cur++ = ':';
+ *cur++ = ' ';
+ }
+ else if ((i & 15) == 15)
+ *cur++ = '\n';
+ else
+ *cur++ = ' ';
+ if (i & 1)
+ {
+ *cur++ = hexchar[(buf->data[i] >> 4) & 15] | 0x80;
+ *cur++ = hexchar[(buf->data[i] >> 0) & 15] | 0x80;
+ }
+ else
+ {
+ *cur++ = hexchar[(buf->data[i] >> 4) & 15];
+ *cur++ = hexchar[(buf->data[i] >> 0) & 15];
+ }
+ if (cur >= flushpointer)
+ {
+ *cur++ = 0;
+ Con_Printf("%s", text);
+ cur = text;
+ }
+ }
+ if ((i & 15) != 0)
+ *cur++ = '\n';
+ if (cur > text)
+ {
+ *cur++ = 0;
+ Con_Printf("%s", text);
+ }
+}
+
//============================================================================
void COM_InitGameType (void)
{
- char name[128];
+ char name[MAX_OSPATH];
COM_StripExtension(com_argv[0], name);
COM_ToLowerString(name, name);
if (strstr(name, "transfusion"))
gamemode = GAME_TRANSFUSION;
- else if (strstr(name, "zymotic"))
- gamemode = GAME_ZYMOTIC;
- else if (strstr(name, "fiendarena"))
- gamemode = GAME_FIENDARENA;
else if (strstr(name, "nehahra"))
gamemode = GAME_NEHAHRA;
else if (strstr(name, "hipnotic"))
if (COM_CheckParm ("-transfusion"))
gamemode = GAME_TRANSFUSION;
- else if (COM_CheckParm ("-zymotic"))
- gamemode = GAME_ZYMOTIC;
- else if (COM_CheckParm ("-fiendarena"))
- gamemode = GAME_FIENDARENA;
else if (COM_CheckParm ("-nehahra"))
gamemode = GAME_NEHAHRA;
else if (COM_CheckParm ("-hipnotic"))
switch(gamemode)
{
case GAME_NORMAL:
- if (registered.integer)
- gamename = "DarkPlaces-Quake";
- else
- gamename = "DarkPlaces-SharewareQuake";
+ gamename = "DarkPlaces-Quake";
gamedirname = "";
break;
case GAME_HIPNOTIC:
gamename = "DarkPlaces-Nehahra";
gamedirname = "nehahra";
break;
- case GAME_FIENDARENA:
- gamename = "FiendArena";
- gamedirname = "fiendarena";
- break;
- case GAME_ZYMOTIC:
- gamename = "Zymotic";
- gamedirname = "zymotic";
- break;
case GAME_TRANSFUSION:
gamename = "Transfusion";
gamedirname = "transfusion";