ioctl(cdfile, CDIOCALLOW);
if (ioctl(cdfile, CDIOCEJECT) == -1)
- Con_DPrintf("ioctl CDIOCEJECT failed\n");
+ Con_DPrint("ioctl CDIOCEJECT failed\n");
}
ioctl(cdfile, CDIOCALLOW);
if (ioctl(cdfile, CDIOCCLOSE) == -1)
- Con_DPrintf("ioctl CDIOCCLOSE failed\n");
+ Con_DPrint("ioctl CDIOCCLOSE failed\n");
}
int CDAudio_SysGetAudioDiskInfo (void)
if (ioctl(cdfile, CDIOREADTOCHEADER, &tochdr) == -1)
{
- Con_DPrintf("ioctl CDIOREADTOCHEADER failed\n");
+ Con_DPrint("ioctl CDIOREADTOCHEADER failed\n");
return -1;
}
if (tochdr.starting_track < 1)
{
- Con_DPrintf("CDAudio: no music tracks\n");
+ Con_DPrint("CDAudio: no music tracks\n");
return -1;
}
rte.data = &entry;
if (ioctl(cdfile, CDIOREADTOCENTRYS, &rte) == -1)
{
- Con_DPrintf("ioctl CDIOREADTOCENTRYS failed\n");
+ Con_DPrint("ioctl CDIOREADTOCENTRYS failed\n");
return -1;
}
if (entry.control & 4) // if it's a data track
if (ioctl(cdfile, CDIOCPLAYTRACKS, &ti) == -1)
{
- Con_DPrintf("ioctl CDIOCPLAYTRACKS failed\n");
+ Con_DPrint("ioctl CDIOCPLAYTRACKS failed\n");
return -1;
}
if (ioctl(cdfile, CDIOCRESUME) == -1)
{
- Con_DPrintf("ioctl CDIOCRESUME failed\n");
+ Con_DPrint("ioctl CDIOCRESUME failed\n");
return -1;
}
if (ioctl(cdfile, CDIOCPAUSE) == -1)
{
- Con_DPrintf("ioctl CDIOCPAUSE failed\n");
+ Con_DPrint("ioctl CDIOCPAUSE failed\n");
return -1;
}
return -1;
if (ioctl(cdfile, CDIOCRESUME) == -1)
- Con_DPrintf("ioctl CDIOCRESUME failed\n");
+ Con_DPrint("ioctl CDIOCRESUME failed\n");
return 0;
}
if (ioctl(cdfile, CDIOCREADSUBCHANNEL, &subchnl) == -1)
{
- Con_DPrintf("ioctl CDIOCREADSUBCHANNEL failed\n");
+ Con_DPrint("ioctl CDIOCREADSUBCHANNEL failed\n");
cdPlaying = false;
return -1;
}
return;
if (ioctl(cdfile, CDROMEJECT) == -1)
- Con_DPrintf("ioctl CDROMEJECT failed\n");
+ Con_DPrint("ioctl CDROMEJECT failed\n");
}
return;
if (ioctl(cdfile, CDROMCLOSETRAY) == -1)
- Con_DPrintf("ioctl CDROMCLOSETRAY failed\n");
+ Con_DPrint("ioctl CDROMCLOSETRAY failed\n");
}
int CDAudio_SysGetAudioDiskInfo (void)
if (ioctl(cdfile, CDROMREADTOCHDR, &tochdr) == -1)
{
- Con_DPrintf("ioctl CDROMREADTOCHDR failed\n");
+ Con_DPrint("ioctl CDROMREADTOCHDR failed\n");
return -1;
}
if (tochdr.cdth_trk0 < 1)
{
- Con_DPrintf("CDAudio: no music tracks\n");
+ Con_DPrint("CDAudio: no music tracks\n");
return -1;
}
entry.cdte_format = CDROM_MSF;
if (ioctl(cdfile, CDROMREADTOCENTRY, &entry) == -1)
{
- Con_DPrintf("ioctl CDROMREADTOCENTRY failed\n");
+ Con_DPrint("ioctl CDROMREADTOCENTRY failed\n");
return -1;
}
if (entry.cdte_ctrl == CDROM_DATA_TRACK)
if (ioctl(cdfile, CDROMPLAYTRKIND, &ti) == -1)
{
- Con_DPrintf("ioctl CDROMPLAYTRKIND failed\n");
+ Con_DPrint("ioctl CDROMPLAYTRKIND failed\n");
return -1;
}
if (ioctl(cdfile, CDROMRESUME) == -1)
{
- Con_DPrintf("ioctl CDROMRESUME failed\n");
+ Con_DPrint("ioctl CDROMRESUME failed\n");
return -1;
}
if (ioctl(cdfile, CDROMPAUSE) == -1)
{
- Con_DPrintf("ioctl CDROMPAUSE failed\n");
+ Con_DPrint("ioctl CDROMPAUSE failed\n");
return -1;
}
return -1;
if (ioctl(cdfile, CDROMRESUME) == -1)
- Con_DPrintf("ioctl CDROMRESUME failed\n");
+ Con_DPrint("ioctl CDROMRESUME failed\n");
return 0;
}
subchnl.cdsc_format = CDROM_MSF;
if (ioctl(cdfile, CDROMSUBCHNL, &subchnl) == -1)
{
- Con_DPrintf("ioctl CDROMSUBCHNL failed\n");
+ Con_DPrint("ioctl CDROMSUBCHNL failed\n");
cdPlaying = false;
return -1;
}
CDAudio_GetAudioDiskInfo();
if (!cdValid)
{
- Con_Printf("No CD in player.\n");
+ Con_Print("No CD in player.\n");
return;
}
}
if (CDAudio_GetAudioDiskInfo())
{
- Con_DPrintf("CDAudio_Init: No CD in player.\n");
+ Con_DPrint("CDAudio_Init: No CD in player.\n");
cdValid = false;
}
initialized = true;
- Con_DPrintf("CD Audio Initialized\n");
+ Con_DPrint("CD Audio Initialized\n");
return 0;
}
dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);
if (dwReturn)
{
- Con_DPrintf("CDAudio: drive ready test - get status failed\n");
+ Con_DPrint("CDAudio: drive ready test - get status failed\n");
return -1;
}
if (!mciStatusParms.dwReturn)
{
- Con_DPrintf("CDAudio: drive not ready\n");
+ Con_DPrint("CDAudio: drive not ready\n");
return -1;
}
dwReturn = mciSendCommand(wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_WAIT, (DWORD) (LPVOID) &mciStatusParms);
if (dwReturn)
{
- Con_DPrintf("CDAudio: get tracks - status failed\n");
+ Con_DPrint("CDAudio: get tracks - status failed\n");
return -1;
}
if (mciStatusParms.dwReturn < 1)
{
- Con_DPrintf("CDAudio: no music tracks\n");
+ Con_DPrint("CDAudio: no music tracks\n");
return -1;
}
if ((dwReturn = mciSendCommand(wDeviceID, MCI_STOP, 0, (DWORD)NULL)))
{
- Con_DPrintf("MCI_STOP failed (%i)", dwReturn);
+ Con_DPrintf("MCI_STOP failed (%i)\n", dwReturn);
return -1;
}
return 0;
mciGenericParms.dwCallback = (DWORD)mainwindow;
if ((dwReturn = mciSendCommand(wDeviceID, MCI_PAUSE, 0, (DWORD)(LPVOID) &mciGenericParms)))
{
- Con_DPrintf("MCI_PAUSE failed (%i)", dwReturn);
+ Con_DPrintf("MCI_PAUSE failed (%i)\n", dwReturn);
return -1;
}
return 0;
break;
case MCI_NOTIFY_FAILURE:
- Con_DPrintf("MCI_NOTIFY_FAILURE\n");
+ Con_DPrint("MCI_NOTIFY_FAILURE\n");
CDAudio_Stop ();
cdValid = false;
break;
void CDAudio_SysShutdown (void)
{
if (mciSendCommand(wDeviceID, MCI_CLOSE, MCI_WAIT, (DWORD)NULL))
- Con_DPrintf("CDAudio_Shutdown: MCI_CLOSE failed\n");
+ Con_DPrint("CDAudio_Shutdown: MCI_CLOSE failed\n");
}
cls.demonum = 0;
if (!cls.demos[cls.demonum][0])
{
- Con_Printf ("No demos listed with startdemos\n");
+ Con_Print("No demos listed with startdemos\n");
cls.demonum = -1;
return;
}
if (!cls.demorecording)
{
- Con_Printf ("Not recording a demo.\n");
+ Con_Print("Not recording a demo.\n");
return;
}
FS_Close (cls.demofile);
cls.demofile = NULL;
cls.demorecording = false;
- Con_Printf ("Completed demo\n");
+ Con_Print("Completed demo\n");
}
/*
c = Cmd_Argc();
if (c != 2 && c != 3 && c != 4)
{
- Con_Printf ("record <demoname> [<map> [cd track]]\n");
+ Con_Print("record <demoname> [<map> [cd track]]\n");
return;
}
if (strstr(Cmd_Argv(1), ".."))
{
- Con_Printf ("Relative pathnames are not allowed.\n");
+ Con_Print("Relative pathnames are not allowed.\n");
return;
}
if (c == 2 && cls.state == ca_connected)
{
- Con_Printf("Can not record - already connected to server\nClient demo recording must be started before connecting\n");
+ Con_Print("Can not record - already connected to server\nClient demo recording must be started before connecting\n");
return;
}
if (c == 4)
{
track = atoi(Cmd_Argv(3));
- Con_Printf ("Forcing CD track to %i\n", cls.forcetrack);
+ Con_Printf("Forcing CD track to %i\n", cls.forcetrack);
}
else
track = -1;
Cmd_ExecuteString ( va("map %s", Cmd_Argv(2)), src_command);
// open the demo file
- Con_Printf ("recording to %s.\n", name);
+ Con_Printf("recording to %s.\n", name);
cls.demofile = FS_Open (name, "wb", false);
if (!cls.demofile)
{
- Con_Printf ("ERROR: couldn't open.\n");
+ Con_Print("ERROR: couldn't open.\n");
return;
}
cls.forcetrack = track;
- FS_Printf (cls.demofile, "%i\n", cls.forcetrack);
+ FS_Printf(cls.demofile, "%i\n", cls.forcetrack);
cls.demorecording = true;
}
if (Cmd_Argc() != 2)
{
- Con_Printf ("play <demoname> : plays a demo\n");
+ Con_Print("play <demoname> : plays a demo\n");
return;
}
strlcpy (name, Cmd_Argv(1), sizeof (name));
FS_DefaultExtension (name, ".dem", sizeof (name));
- Con_Printf ("Playing demo from %s.\n", name);
+ Con_Printf("Playing demo from %s.\n", name);
cls.demofile = FS_Open (name, "rb", false);
if (!cls.demofile)
{
- Con_Printf ("ERROR: couldn't open.\n");
+ Con_Print("ERROR: couldn't open.\n");
cls.demonum = -1; // stop demo loop
return;
}
fpsavg = time > 0 ? frames / time : 0;
fpsmax = cls.td_minframetime > 0 ? 1.0 / cls.td_minframetime : 0;
// LordHavoc: timedemo now prints out 7 digits of fraction, and min/avg/max
- Con_Printf ("%i frames %5.7f seconds %5.7f fps\nmin/avg/max: %5.7f/%5.7f/%5.7f\n", frames, time, fpsavg, fpsmin, fpsavg, fpsmax);
+ Con_Printf("%i frames %5.7f seconds %5.7f fps\nmin/avg/max: %5.7f/%5.7f/%5.7f\n", frames, time, fpsavg, fpsmin, fpsavg, fpsmax);
}
/*
if (Cmd_Argc() != 2)
{
- Con_Printf ("timedemo <demoname> : gets demo speeds\n");
+ Con_Print("timedemo <demoname> : gets demo speeds\n");
return;
}
b->down[1] = k;
else
{
- Con_Printf ("Three keys down for a button!\n");
+ Con_Print("Three keys down for a button!\n");
return;
}
if (NetConn_SendUnreliableMessage(cls.netcon, &buf) == -1)
{
- Con_Printf("CL_SendMove: lost server connection\n");
+ Con_Print("CL_SendMove: lost server connection\n");
CL_Disconnect();
}
}
if (cls.demorecording)
CL_Stop_f();
- Con_DPrintf("Sending clc_disconnect\n");
+ Con_DPrint("Sending clc_disconnect\n");
SZ_Clear(&cls.message);
MSG_WriteByte(&cls.message, clc_disconnect);
NetConn_SendUnreliableMessage(cls.netcon, &cls.message);
}
else
{
- Con_Printf("Unable to find a suitable network socket to connect to server.\n");
+ Con_Print("Unable to find a suitable network socket to connect to server.\n");
strcpy(m_return_reason, "No network");
}
}
strcpy(name, "--no model--");
for (j = strlen(name);j < 25;j++)
name[j] = ' ';
- Con_Printf ("%3i: %s:%04i (%5i %5i %5i) [%3i %3i %3i] %4.2f %5.3f\n", i, name, ent->render.frame, (int) ent->render.origin[0], (int) ent->render.origin[1], (int) ent->render.origin[2], (int) ent->render.angles[0] % 360, (int) ent->render.angles[1] % 360, (int) ent->render.angles[2] % 360, ent->render.scale, ent->render.alpha);
+ Con_Printf("%3i: %s:%04i (%5i %5i %5i) [%3i %3i %3i] %4.2f %5.3f\n", i, name, ent->render.frame, (int) ent->render.origin[0], (int) ent->render.origin[1], (int) ent->render.origin[2], (int) ent->render.angles[0] % 360, (int) ent->render.angles[1] % 360, (int) ent->render.angles[2] % 360, ent->render.scale, ent->render.alpha);
}
}
{
if (developer.integer)
{
- Con_Printf("CL_SendCmd: sending reliable message:\n");
+ Con_Print("CL_SendCmd: sending reliable message:\n");
SZ_HexDumpToConsole(&cls.message);
}
if (NetConn_SendReliableMessage(cls.netcon, &cls.message) == -1)
{
cls.demopaused = !cls.demopaused;
if (cls.demopaused)
- Con_Printf("Demo paused\n");
+ Con_Print("Demo paused\n");
else
- Con_Printf("Demo unpaused\n");
+ Con_Print("Demo unpaused\n");
}
/*
{
if (Cmd_Argc () == 1)
{
- Con_Printf ("\"fog\" is \"%f %f %f %f\"\n", fog_density, fog_red, fog_green, fog_blue);
+ Con_Printf("\"fog\" is \"%f %f %f %f\"\n", fog_density, fog_red, fog_green, fog_blue);
return;
}
fog_density = atof(Cmd_Argv(1));
lastmsg = time;
// write out a nop
// LordHavoc: must use unreliable because reliable could kill the sigon message!
- Con_Printf("--> client to server keepalive\n");
+ Con_Print("--> client to server keepalive\n");
msg.data = buf;
msg.maxsize = sizeof(buf);
msg.cursize = 0;
{
//char str[8192];
-Con_DPrintf ("CL_SignonReply: %i\n", cls.signon);
+Con_DPrintf("CL_SignonReply: %i\n", cls.signon);
switch (cls.signon)
{
int nummodels, numsounds;
entity_t *ent;
- Con_DPrintf ("Serverinfo packet received.\n");
+ Con_DPrint("Serverinfo packet received.\n");
//
// wipe the client_state_t struct
//
// seperate the printfs so the server message can have a color
if (cl.protocol != PROTOCOL_NEHAHRAMOVIE) // no messages when playing the Nehahra movie
- {
- Con_Printf("\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n\n");
- Con_Printf("%c%s\n", 2, str);
- }
+ Con_Printf("\n\n\35\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\36\37\n\n\2%s", str);
// check memory integrity
Mem_CheckSentinelsGlobal();
return;
}
}
- Con_Printf ("beam list overflow!\n");
+ Con_Print("beam list overflow!\n");
}
void CL_ParseTempEntity(void)
}
}
-#define SHOWNET(x) if(cl_shownet.integer==2)Con_Printf ("%3i:%s\n", msg_readcount-1, x);
+#define SHOWNET(x) if(cl_shownet.integer==2)Con_Printf("%3i:%s\n", msg_readcount-1, x);
static qbyte cgamenetbuffer[65536];
// if recording demos, copy the message out
//
if (cl_shownet.integer == 1)
- Con_Printf ("%f %i\n", realtime, net_message.cursize);
+ Con_Printf("%f %i\n", realtime, net_message.cursize);
else if (cl_shownet.integer == 2)
- Con_Printf ("------------------\n");
+ Con_Print("------------------\n");
cl.onground = false; // unless the server says otherwise
//
i &= 31;
}
description[strlen(description)-1] = '\n'; // replace the last space with a newline
- Con_Printf("%s", description);
+ Con_Print(description);
Host_Error ("CL_ParseServerMessage: Illegible server message\n");
}
break;
case svc_nop:
if (cls.signon < SIGNONS)
- Con_Printf("<-- server to client keepalive\n");
+ Con_Print("<-- server to client keepalive\n");
break;
case svc_time:
Host_EndGame ("Server disconnected\n");
case svc_print:
- Con_Printf ("%s", MSG_ReadString ());
+ Con_Print(MSG_ReadString());
break;
case svc_centerprint:
- SCR_CenterPrint (MSG_ReadString ());
+ SCR_CenterPrint(MSG_ReadString ());
break;
case svc_stufftext:
case svc_finale:
cl.intermission = 2;
cl.completed_time = cl.time;
- SCR_CenterPrint (MSG_ReadString ());
+ SCR_CenterPrint(MSG_ReadString ());
break;
case svc_cutscene:
cl.intermission = 3;
cl.completed_time = cl.time;
- SCR_CenterPrint (MSG_ReadString ());
+ SCR_CenterPrint(MSG_ReadString ());
break;
case svc_sellscreen:
{
if (!parsingerror)
return;
- Con_Printf("Packet dump:\n");
+ Con_Print("Packet dump:\n");
SZ_HexDumpToConsole(&net_message);
parsingerror = false;
}
#endif
if (!pointfile)
{
- Con_Printf ("Could not open %s\n", name);
+ Con_Printf("Could not open %s\n", name);
return;
}
- Con_Printf ("Reading %s...\n", name);
+ Con_Printf("Reading %s...\n", name);
c = 0;
s = 0;
pointfilepos = pointfile;
Mem_Free(pointfile);
#endif
VectorCopy(leakorg, org);
- Con_Printf ("%i points read (%i particles spawned)\nLeak at %f %f %f\n", c, s, org[0], org[1], org[2]);
+ Con_Printf("%i points read (%i particles spawned)\nLeak at %f %f %f\n", c, s, org[0], org[1], org[2]);
particle(pt_static, PARTICLE_BEAM, 0xFF0000, 0xFF0000, tex_beam, false, PBLEND_ALPHA, 64, 64, 255, 0, 99999, 0, 0, org[0] - 4096, org[1], org[2], 0, 0, 0, 0, org[0] + 4096, org[1], org[2], 0, 0);
particle(pt_static, PARTICLE_BEAM, 0x00FF00, 0x00FF00, tex_beam, false, PBLEND_ALPHA, 64, 64, 255, 0, 99999, 0, 0, org[0], org[1] - 4096, org[2], 0, 0, 0, 0, org[0], org[1] + 4096, org[2], 0, 0);
for a few moments
==============
*/
-void SCR_CenterPrint (char *str)
+void SCR_CenterPrint(char *str)
{
strlcpy (scr_centerstring, str, sizeof (scr_centerstring));
scr_centertime_off = scr_centertime.value;
drawqueue_t * dq;
if(r_refdef.drawqueuesize + (int)sizeof(*dq) > r_refdef.maxdrawqueuesize)
{
- Con_DPrintf("DrawQueue full !\n");
+ Con_DPrint("DrawQueue full !\n");
return;
}
dq = (void*) (r_refdef.drawqueue + r_refdef.drawqueuesize);
drawqueue_t *dq;
if(r_refdef.drawqueuesize + (int)sizeof(*dq) > r_refdef.maxdrawqueuesize)
{
- Con_DPrintf("DrawQueue full !\n");
+ Con_DPrint("DrawQueue full !\n");
return;
}
dq = (void*) (r_refdef.drawqueue + r_refdef.drawqueuesize);
break;
if (shotnumber >= 1000000)
{
- Con_Printf("SCR_ScreenShot_f: Couldn't create the image file\n");
+ Con_Print("SCR_ScreenShot_f: Couldn't create the image file\n");
return;
}
if (Cmd_Argc() != 3)
{
- Con_Printf ("envmap <basename> <size>: save out 6 cubic environment map images, usable with loadsky, note that size must one of 128, 256, 512, or 1024 and can't be bigger than your current resolution\n");
+ Con_Print("envmap <basename> <size>: save out 6 cubic environment map images, usable with loadsky, note that size must one of 128, 256, 512, or 1024 and can't be bigger than your current resolution\n");
return;
}
size = atoi(Cmd_Argv(2));
if (size != 128 && size != 256 && size != 512 && size != 1024)
{
- Con_Printf("envmap: size must be one of 128, 256, 512, or 1024\n");
+ Con_Print("envmap: size must be one of 128, 256, 512, or 1024\n");
return;
}
if (size > vid.realwidth || size > vid.realheight)
{
- Con_Printf("envmap: your resolution is not big enough to render that size\n");
+ Con_Print("envmap: your resolution is not big enough to render that size\n");
return;
}
if (Cmd_Argc() != 2)
{
- Con_Printf ("usage: playvideo <videoname>\nplays video named video/<videoname>.dpv\n");
+ Con_Print("usage: playvideo <videoname>\nplays video named video/<videoname>.dpv\n");
return;
}
if (cmd_text.cursize + l >= cmd_text.maxsize)
{
- Con_Printf ("Cbuf_AddText: overflow\n");
+ Con_Print("Cbuf_AddText: overflow\n");
return;
}
if (Cmd_Argc () != 1)
{
- Con_Printf ("stuffcmds : execute command line parameters\n");
+ Con_Print("stuffcmds : execute command line parameters\n");
return;
}
if (Cmd_Argc () != 2)
{
- Con_Printf ("exec <filename> : execute a script file\n");
+ Con_Print("exec <filename> : execute a script file\n");
return;
}
f = (char *)FS_LoadFile (Cmd_Argv(1), false);
if (!f)
{
- Con_Printf ("couldn't exec %s\n",Cmd_Argv(1));
+ Con_Printf("couldn't exec %s\n",Cmd_Argv(1));
return;
}
- Con_DPrintf ("execing %s\n",Cmd_Argv(1));
+ Con_DPrintf("execing %s\n",Cmd_Argv(1));
Cbuf_InsertText (f);
Mem_Free(f);
int i;
for (i=1 ; i<Cmd_Argc() ; i++)
- Con_Printf ("%s ",Cmd_Argv(i));
- Con_Printf ("\n");
+ Con_Printf("%s ",Cmd_Argv(i));
+ Con_Print("\n");
}
/*
if (Cmd_Argc() == 1)
{
- Con_Printf ("Current alias commands:\n");
+ Con_Print("Current alias commands:\n");
for (a = cmd_alias ; a ; a=a->next)
- Con_Printf ("%s : %s\n", a->name, a->value);
+ Con_Printf("%s : %s\n", a->name, a->value);
return;
}
s = Cmd_Argv(1);
if (strlen(s) >= MAX_ALIAS_NAME)
{
- Con_Printf ("Alias name is too long\n");
+ Con_Print("Alias name is too long\n");
return;
}
{
if (partial && strncmp(partial, cmd->name, len))
continue;
- Con_Printf ("%s\n", cmd->name);
+ Con_Printf("%s\n", cmd->name);
count++;
}
- Con_Printf ("%i Command%s", count, (count > 1) ? "s" : "");
+ Con_Printf("%i Command%s", count, (count > 1) ? "s" : "");
if (partial)
Con_Printf(" beginning with \"%s\"", partial);
- Con_Printf ("\n\n");
+ Con_Print("\n\n");
}
/*
// fail if the command is a variable name
if (Cvar_VariableString(cmd_name)[0])
{
- Con_Printf ("Cmd_AddCommand: %s already defined as a var\n", cmd_name);
+ Con_Printf("Cmd_AddCommand: %s already defined as a var\n", cmd_name);
return;
}
{
if (!strcmp (cmd_name, cmd->name))
{
- Con_Printf ("Cmd_AddCommand: %s already defined\n", cmd_name);
+ Con_Printf("Cmd_AddCommand: %s already defined\n", cmd_name);
return;
}
}
// check cvars (always)
if (!Cvar_Command () && host_initialized)
- Con_Printf ("Unknown command \"%s\"\n", Cmd_Argv(0));
+ Con_Printf("Unknown command \"%s\"\n", Cmd_Argv(0));
cmd_tokenizebufferpos = oldpos;
}
*/
void Cmd_ForwardToServer (void)
{
- char *s;
+ const char *s;
if (cls.state != ca_connected)
{
- Con_Printf ("Can't \"%s\", not connected\n", Cmd_Argv(0));
+ Con_Printf("Can't \"%s\", not connected\n", Cmd_Argv(0));
return;
}
if (strcasecmp(Cmd_Argv(0), "cmd") != 0)
s = va("%s %s", Cmd_Argv(0), Cmd_Argc() > 1 ? Cmd_Args() : "\n");
else
- s = va("%s", Cmd_Argc() > 1 ? Cmd_Args() : "\n");
+ s = Cmd_Argc() > 1 ? Cmd_Args() : "\n";
MSG_WriteByte(&cls.message, clc_stringcmd);
SZ_Write(&cls.message, s, strlen(s) + 1);
}
// things like godmode, noclip, etc, are commands directed to the server,
// so when they are typed in at the console, they will need to be forwarded.
-void Cmd_Print (const char *text);
+void Cmd_Print(const char *text);
// used by command functions to send output to either the graphics console or
// passed as a print message to the client
if (t->trace->allsolid)
t->trace->startsolid = true;
#if COLLISIONPARANOID >= 3
- Con_Printf("S");
+ Con_Print("S");
#endif
return HULLCHECKSTATE_SOLID;
}
{
t->trace->allsolid = false;
#if COLLISIONPARANOID >= 3
- Con_Printf("E");
+ Con_Print("E");
#endif
return HULLCHECKSTATE_EMPTY;
}
if (t2 < 0)
{
#if COLLISIONPARANOID >= 3
- Con_Printf("<");
+ Con_Print("<");
#endif
num = node->children[1];
goto loc0;
if (t2 >= 0)
{
#if COLLISIONPARANOID >= 3
- Con_Printf(">");
+ Con_Print(">");
#endif
num = node->children[0];
goto loc0;
// the line intersects, find intersection point
// LordHavoc: this uses the original trace for maximum accuracy
#if COLLISIONPARANOID >= 3
- Con_Printf("M");
+ Con_Print("M");
#endif
if (plane->type < 3)
{
t->trace->fraction = bound(0, midf, 1);
#if COLLISIONPARANOID >= 3
- Con_Printf("D");
+ Con_Print("D");
#endif
return HULLCHECKSTATE_DONE;
}
printbrush = false;
if (!brush->numpoints)
{
- Con_Printf("Collision_ValidateBrush: brush with no points!\n");
+ Con_Print("Collision_ValidateBrush: brush with no points!\n");
printbrush = true;
}
#if 0
// it's ok for a brush to have one point and no planes...
if (brush->numplanes == 0 && brush->numpoints != 1)
{
- Con_Printf("Collision_ValidateBrush: brush with no planes and more than one point!\n");
+ Con_Print("Collision_ValidateBrush: brush with no planes and more than one point!\n");
printbrush = true;
}
#endif
}
if (pointsoffplanes == 0) // all points are on all planes
{
- Con_Printf("Collision_ValidateBrush: all points lie on all planes (degenerate, no brush volume!)\n");
+ Con_Print("Collision_ValidateBrush: all points lie on all planes (degenerate, no brush volume!)\n");
printbrush = true;
}
}
// check if there are too many and skip the brush
if (numplanes >= 256)
{
- Con_Printf("Mod_Q3BSP_LoadBrushes: failed to build collision brush: too many planes for buffer\n");
+ Con_Print("Mod_Q3BSP_LoadBrushes: failed to build collision brush: too many planes for buffer\n");
return NULL;
}
// check if there are too many polygon vertices for buffer
if (numpolypoints > maxpolypoints)
{
- Con_Printf("Collision_NewBrushFromPlanes: failed to build collision brush: too many points for buffer\n");
+ Con_Print("Collision_NewBrushFromPlanes: failed to build collision brush: too many points for buffer\n");
return NULL;
}
// check if there are too many triangle elements for buffer
if (numelements + (w->numpoints - 2) * 3 > maxelements)
{
- Con_Printf("Collision_NewBrushFromPlanes: failed to build collision brush: too many triangle elements for buffer\n");
+ Con_Print("Collision_NewBrushFromPlanes: failed to build collision brush: too many triangle elements for buffer\n");
return NULL;
}
// check if there are too many and skip the brush
if (numpoints >= 256)
{
- Con_Printf("Collision_NewBrushFromPlanes: failed to build collision brush: too many points for buffer\n");
+ Con_Print("Collision_NewBrushFromPlanes: failed to build collision brush: too many points for buffer\n");
Winding_Free(w);
return NULL;
}
// any brush with degenerate planes is not worth handling
if (DotProduct(startplane->normal, startplane->normal) < 0.9f || DotProduct(endplane->normal, endplane->normal) < 0.9f)
{
- Con_Printf("Collision_TraceBrushBrushFloat: degenerate thisbrush plane!\n");
+ Con_Print("Collision_TraceBrushBrushFloat: degenerate thisbrush plane!\n");
return;
}
f = furthestplanedist_float(startplane->normal, thisbrush_start->points, thisbrush_start->numpoints);
// any brush with degenerate planes is not worth handling
if (DotProduct(startplane->normal, startplane->normal) < 0.9f || DotProduct(endplane->normal, endplane->normal) < 0.9f)
{
- Con_Printf("Collision_TraceBrushBrushFloat: degenerate thatbrush plane!\n");
+ Con_Print("Collision_TraceBrushBrushFloat: degenerate thatbrush plane!\n");
return;
}
f = furthestplanedist_float(startplane->normal, thatbrush_start->points, thatbrush_start->numpoints);
// any brush with degenerate planes is not worth handling
if (DotProduct(startplane->normal, startplane->normal) < 0.9f || DotProduct(endplane->normal, endplane->normal) < 0.9f)
{
- Con_Printf("Collision_TraceLineBrushFloat: degenerate plane!\n");
+ Con_Print("Collision_TraceLineBrushFloat: degenerate plane!\n");
return;
}
if (thatbrush_start->numpoints)
{
if (numpoints > 256)
{
- Con_Printf("Polygon with more than 256 points not supported yet (fixme!)\n");
+ Con_Print("Polygon with more than 256 points not supported yet (fixme!)\n");
return;
}
polyf_brush.numpoints = numpoints;
{
if (numpoints > 256)
{
- Con_Printf("Polygon with more than 256 points not supported yet (fixme!)\n");
+ Con_Print("Polygon with more than 256 points not supported yet (fixme!)\n");
return;
}
polyf_brush.numpoints = numpoints;
int i;
if (numpoints > 256)
{
- Con_Printf("Polygon with more than 256 points not supported yet (fixme!)\n");
+ Con_Print("Polygon with more than 256 points not supported yet (fixme!)\n");
return;
}
polyf_brushstart.numpoints = numpoints;
Host_Error ("SZ_GetSpace: %i is > full buffer size\n", length);
buf->overflowed = true;
- Con_Printf ("SZ_GetSpace: overflow\n");
+ Con_Print("SZ_GetSpace: overflow\n");
SZ_Clear (buf);
}
if (cur >= flushpointer || i >= size)
{
*cur++ = 0;
- Con_Printf("%s", text);
+ Con_Print(text);
cur = text;
}
}
if (!FS_FileExists("gfx/pop.lmp"))
{
if (fs_modified)
- Con_Printf ("Playing shareware version, with modification.\nwarning: most mods require full quake data.\n");
+ Con_Print("Playing shareware version, with modification.\nwarning: most mods require full quake data.\n");
else
- Con_Printf ("Playing shareware version.\n");
+ Con_Print("Playing shareware version.\n");
return;
}
Cvar_Set ("registered", "1");
- Con_Printf ("Playing registered version.\n");
+ Con_Print("Playing registered version.\n");
}
void SZ_Clear (sizebuf_t *buf);
void *SZ_GetSpace (sizebuf_t *buf, int length);
void SZ_Write (sizebuf_t *buf, const void *data, int length);
-void SZ_Print (sizebuf_t *buf, const char *data); // strcats onto the sizebuf
+void SZ_Print(sizebuf_t *buf, const char *data); // strcats onto the sizebuf
void SZ_HexDumpToConsole(const sizebuf_t *buf);
void Com_HexDumpToConsole(const qbyte *data, int size);
if (!heventDone)
{
- Con_SafePrintf ("Couldn't create heventDone\n");
+ Con_SafePrint("Couldn't create heventDone\n");
return;
}
&dwID))
{
CloseHandle (heventDone);
- Con_SafePrintf ("Couldn't create QHOST thread\n");
+ Con_SafePrint("Couldn't create QHOST thread\n");
return;
}
// hfileBuffer is invalid. Just leave.
if (!pBuffer)
{
- Con_SafePrintf ("Invalid hfileBuffer\n");
+ Con_SafePrint("Invalid hfileBuffer\n");
break;
}
con_linewidth = -1;
Con_CheckResize ();
- Con_Printf ("Console initialized.\n");
+ Con_Print("Console initialized.\n");
//
// register our commands
/*
================
-Con_Print
+Con_PrintToHistory
Handles cursor positioning, line wrapping, etc
All console printing must go through this in order to be displayed
If no console is visible, the notify window will pop up.
================
*/
-void Con_Print (const char *txt)
+void Con_PrintToHistory(const char *txt)
{
int y, c, l, mask;
static int cr;
}
}
+// LordHavoc: increased from 4096 to 16384
+#define MAXPRINTMSG 16384
/*
================
-Con_DebugLog
+Con_LogPrint
================
*/
-void Con_DebugLog (const char *msg)
+void Con_LogPrint(const char *logfilename, const char *msg)
{
- qfile_t* file;
-
- file = FS_Open ("qconsole.log", "at", true);
+ qfile_t *file;
+ file = FS_Open(logfilename, "at", true);
if (file)
{
- FS_Printf (file, "%s", msg);
- FS_Close (file);
+ FS_Print(file, msg);
+ FS_Close(file);
}
}
-
/*
================
-Con_Printf
-
-Handles cursor positioning, line wrapping, etc
+Con_LogPrintf
================
*/
-// LordHavoc: increased from 4096 to 16384
-#define MAXPRINTMSG 16384
-// FIXME: make a buffer size safe vsprintf?
-void Con_Printf (const char *fmt, ...)
+void Con_LogPrintf(const char *logfilename, const char *fmt, ...)
{
va_list argptr;
char msg[MAXPRINTMSG];
- va_start (argptr,fmt);
- vsprintf (msg,fmt,argptr);
- va_end (argptr);
+ va_start(argptr,fmt);
+ vsprintf(msg,fmt,argptr);
+ va_end(argptr);
+ Con_LogPrint(logfilename, msg);
+}
+
+/*
+================
+Con_Print
+
+Prints to all appropriate console targets
+================
+*/
+void Con_Print(const char *msg)
+{
// also echo to debugging console
- Sys_Printf ("%s", msg);
+ Sys_Print(msg);
// log all messages to file
if (con_debuglog)
- Con_DebugLog (msg);
+ Con_LogPrint("qconsole.log", msg);
if (!con_initialized)
return;
return; // no graphics mode
// write it to the scrollable buffer
- Con_Print (msg);
+ Con_PrintToHistory(msg);
+}
+
+/*
+================
+Con_Printf
+
+Prints to all appropriate console targets
+================
+*/
+void Con_Printf(const char *fmt, ...)
+{
+ va_list argptr;
+ char msg[MAXPRINTMSG];
+
+ va_start(argptr,fmt);
+ vsprintf(msg,fmt,argptr);
+ va_end(argptr);
+
+ Con_Print(msg);
+}
+
+/*
+================
+Con_DPrint
+
+A Con_Print that only shows up if the "developer" cvar is set
+================
+*/
+void Con_DPrint(const char *msg)
+{
+ if (!developer.integer)
+ return; // don't confuse non-developers with techie stuff...
+ Con_Print(msg);
}
/*
A Con_Printf that only shows up if the "developer" cvar is set
================
*/
-void Con_DPrintf (const char *fmt, ...)
+void Con_DPrintf(const char *fmt, ...)
{
va_list argptr;
char msg[MAXPRINTMSG];
if (!developer.integer)
return; // don't confuse non-developers with techie stuff...
- va_start (argptr,fmt);
- vsprintf (msg,fmt,argptr);
- va_end (argptr);
+ va_start(argptr,fmt);
+ vsprintf(msg,fmt,argptr);
+ va_end(argptr);
- Con_Printf ("%s", msg);
+ Con_Print(msg);
}
+/*
+================
+Con_SafePrint
+
+Okay to call even when the screen can't be updated
+==================
+*/
+void Con_SafePrint(const char *msg)
+{
+ Con_Print(msg);
+}
+
/*
==================
Con_SafePrintf
Okay to call even when the screen can't be updated
==================
*/
-void Con_SafePrintf (const char *fmt, ...)
+void Con_SafePrintf(const char *fmt, ...)
{
- va_list argptr;
- char msg[1024];
+ va_list argptr;
+ char msg[MAXPRINTMSG];
- va_start (argptr,fmt);
- vsprintf (msg,fmt,argptr);
- va_end (argptr);
+ va_start(argptr,fmt);
+ vsprintf(msg,fmt,argptr);
+ va_end(argptr);
- Con_Printf ("%s", msg);
+ Con_Print(msg);
}
while (*list) {
len = strlen(*list);
if (pos + maxlen >= width) {
- Con_Printf("\n");
+ Con_Print("\n");
pos = 0;
}
- Con_Printf("%s", *list);
+ Con_Print(*list);
for (i = 0; i < (maxlen - len); i++)
- Con_Printf(" ");
+ Con_Print(" ");
pos += maxlen;
list++;
}
if (pos)
- Con_Printf("\n\n");
+ Con_Print("\n\n");
}
/*
cmd_len++;
} while (i == 3);
// 'quakebar'
- Con_Printf("\n\35");
+ Con_Print("\n\35");
for (i = 0; i < con_linewidth - 4; i++)
- Con_Printf("\36");
- Con_Printf("\37\n");
+ Con_Print("\36");
+ Con_Print("\37\n");
// Print Possible Commands
if (c) {
void Con_InitLogging (void);
void Con_Init (void);
void Con_DrawConsole (int lines);
-void Con_Print (const char *txt);
-void Con_Printf (const char *fmt, ...);
-void Con_DPrintf (const char *fmt, ...);
-void Con_SafePrintf (const char *fmt, ...);
+void Con_Print(const char *txt);
+void Con_Printf(const char *fmt, ...);
+void Con_DPrint(const char *msg);
+void Con_DPrintf(const char *fmt, ...);
+void Con_SafePrint(const char *msg);
+void Con_SafePrintf(const char *fmt, ...);
+void Con_LogPrint(const char *logfilename, const char *msg);
+void Con_LogPrintf(const char *logfilename, const char *fmt, ...);
void Con_Clear_f (void);
void Con_DrawNotify (void);
void Con_ClearNotify (void);
if (var == NULL)
{
- Con_Printf("Cvar_SetQuick: var == NULL\n");
+ Con_Print("Cvar_SetQuick: var == NULL\n");
return;
}
strcpy (var->string, value);
var->value = atof (var->string);
var->integer = (int) var->value;
- if ((var->flags & CVAR_NOTIFY) && changed)
- {
- if (sv.active)
- SV_BroadcastPrintf ("\"%s\" changed to \"%s\"\n", var->name, var->string);
- }
+ if ((var->flags & CVAR_NOTIFY) && changed && sv.active)
+ SV_BroadcastPrintf("\"%s\" changed to \"%s\"\n", var->name, var->string);
}
void Cvar_Set (const char *var_name, const char *value)
if (var == NULL)
{
// there is an error in C code if this happens
- Con_Printf ("Cvar_Set: variable %s not found\n", var_name);
+ Con_Printf("Cvar_Set: variable %s not found\n", var_name);
return;
}
if (var->flags & CVAR_READONLY)
{
- Con_Printf ("Cvar_Set: %s is read-only\n", var_name);
+ Con_Printf("Cvar_Set: %s is read-only\n", var_name);
return;
}
// first check to see if it has already been defined
if (Cvar_FindVar (variable->name))
{
- Con_Printf ("Can't register variable %s, already defined\n", variable->name);
+ Con_Printf("Can't register variable %s, already defined\n", variable->name);
return;
}
// check for overlap with a command
if (Cmd_Exists (variable->name))
{
- Con_Printf ("Cvar_RegisterVariable: %s is a command\n", variable->name);
+ Con_Printf("Cvar_RegisterVariable: %s is a command\n", variable->name);
return;
}
{
// only print if host_initialized (otherwise it could print twice if this is in a script)
if (host_initialized)
- Con_Printf ("\"%s\" is \"%s\"\n", v->name, v->string);
+ Con_Printf("\"%s\" is \"%s\"\n", v->name, v->string);
return true;
}
for (var = cvar_vars ; var ; var = var->next)
if (var->flags & CVAR_SAVE)
- FS_Printf (f, "%s \"%s\"\n", var->name, var->string);
+ FS_Printf(f, "%s \"%s\"\n", var->name, var->string);
}
if (partial && strncmp (partial,cvar->name,len))
continue;
- Con_Printf ("%s is \"%s\"\n", cvar->name, cvar->string);
+ Con_Printf("%s is \"%s\"\n", cvar->name, cvar->string);
count++;
}
- Con_Printf ("%i cvar(s)", count);
+ Con_Printf("%i cvar(s)", count);
if (partial)
- Con_Printf (" beginning with \"%s\"", partial);
- Con_Printf ("\n");
+ Con_Printf(" beginning with \"%s\"", partial);
+ Con_Print("\n");
}
// 2000-01-09 CvarList command by Maddes
if (real_nb_files <= 0)
Sys_Error ("%s is not a valid PK3 file", packfile);
- Con_Printf ("Added packfile %s (%i files)\n", packfile, real_nb_files);
+ Con_Printf("Added packfile %s (%i files)\n", packfile, real_nb_files);
return pack;
}
{
searchpath_t *s;
- Con_Printf ("Current search path:\n");
+ Con_Print("Current search path:\n");
for (s=fs_searchpaths ; s ; s=s->next)
{
if (s->pack)
{
- Con_Printf ("%s (%i files)\n", s->pack->filename, s->pack->numfiles);
+ Con_Printf("%s (%i files)\n", s->pack->filename, s->pack->numfiles);
}
else
- Con_Printf ("%s\n", s->filename);
+ Con_Printf("%s\n", s->filename);
}
}
Mem_Free(info);
- Con_Printf ("Added packfile %s (%i files)\n", packfile, numpackfiles);
+ Con_Printf("Added packfile %s (%i files)\n", packfile, numpackfiles);
return pack;
}
if (!diff)
{
if (!quiet)
- Sys_Printf ("FS_FindFile: %s in %s\n",
+ Sys_Printf("FS_FindFile: %s in %s\n",
pak->files[middle].name, pak->filename);
if (index != NULL)
if (FS_SysFileExists (netpath))
{
if (!quiet)
- Sys_Printf ("FS_FindFile: %s\n", netpath);
+ Sys_Printf("FS_FindFile: %s\n", netpath);
if (index != NULL)
*index = -1;
}
if (!quiet)
- Sys_Printf ("FS_FindFile: can't find %s\n", name);
+ Sys_Printf("FS_FindFile: can't find %s\n", name);
if (index != NULL)
*index = -1;
// No Zlib DLL = no compressed files
if (!zlib_dll && (packfile->flags & FILE_FLAG_DEFLATED))
{
- Con_Printf ("WARNING: can't open the compressed file %s\n"
+ Con_Printf("WARNING: can't open the compressed file %s\n"
"You need the Zlib DLL to use compressed files\n",
filename);
fs_filesize = -1;
}
+/*
+====================
+FS_Print
+
+Print a string into a file
+====================
+*/
+int FS_Print(qfile_t* file, const char *msg)
+{
+ return FS_Write(file, msg, strlen(msg));
+}
+
/*
====================
FS_Printf
Print a string into a file
====================
*/
-int FS_Printf (qfile_t* file, const char* format, ...)
+int FS_Printf(qfile_t* file, const char* format, ...)
{
int result;
va_list args;
handle = FS_Open (filename, "wb", false);
if (!handle)
{
- Con_Printf ("FS_WriteFile: failed on %s\n", filename);
+ Con_Printf("FS_WriteFile: failed on %s\n", filename);
return false;
}
- Con_DPrintf ("FS_WriteFile: %s\n", filename);
+ Con_DPrintf("FS_WriteFile: %s\n", filename);
FS_Write (handle, data, len);
FS_Close (handle);
return true;
else
pattern = "*";
if (!FS_ListDirectory(pattern, oneperline))
- Con_Printf("No files found.\n");
+ Con_Print("No files found.\n");
}
void FS_Dir_f(void)
size_t FS_Write (qfile_t* file, const void* data, size_t datasize);
size_t FS_Read (qfile_t* file, void* buffer, size_t buffersize);
int FS_Flush (qfile_t* file);
-int FS_Printf (qfile_t* file, const char* format, ...);
+int FS_Print(qfile_t* file, const char *msg);
+int FS_Printf(qfile_t* file, const char* format, ...);
int FS_Getc (qfile_t* file);
int FS_Seek (qfile_t* file, long offset, int whence);
long FS_Tell (qfile_t* file);
static void gl_backend_start(void)
{
- Con_DPrintf("OpenGL Backend started\n");
+ Con_DPrint("OpenGL Backend started\n");
if (qglDrawRangeElements != NULL)
{
CHECKGLERROR
backendunits = 0;
backendactive = false;
- Con_DPrintf("OpenGL Backend shutting down\n");
+ Con_DPrint("OpenGL Backend shutting down\n");
GL_Backend_FreeArrays();
}
int i, j, size;
const int *p;
if (!qglIsEnabled(GL_VERTEX_ARRAY))
- Con_Printf("R_Mesh_Draw: vertex array not enabled\n");
+ Con_Print("R_Mesh_Draw: vertex array not enabled\n");
for (j = 0, size = numverts * (int)sizeof(float[3]), p = gl_state.pointer_vertex;j < size;j += sizeof(int), p++)
paranoidblah += *p;
if (gl_state.pointer_color)
{
if (!qglIsEnabled(GL_COLOR_ARRAY))
- Con_Printf("R_Mesh_Draw: color array set but not enabled\n");
+ Con_Print("R_Mesh_Draw: color array set but not enabled\n");
for (j = 0, size = numverts * (int)sizeof(float[4]), p = gl_state.pointer_color;j < size;j += sizeof(int), p++)
paranoidblah += *p;
}
if (gl_state.units[i].t1d || gl_state.units[i].t2d || gl_state.units[i].t3d || gl_state.units[i].tcubemap || gl_state.units[i].arrayenabled)
{
if (gl_state.units[i].arrayenabled && !(gl_state.units[i].t1d || gl_state.units[i].t2d || gl_state.units[i].t3d || gl_state.units[i].tcubemap))
- Con_Printf("R_Mesh_Draw: array enabled but no texture bound\n");
+ Con_Print("R_Mesh_Draw: array enabled but no texture bound\n");
GL_ActiveTexture(i);
if (!qglIsEnabled(GL_TEXTURE_COORD_ARRAY))
- Con_Printf("R_Mesh_Draw: texcoord array set but not enabled\n");
+ Con_Print("R_Mesh_Draw: texcoord array set but not enabled\n");
for (j = 0, size = numverts * ((gl_state.units[i].t3d || gl_state.units[i].tcubemap) ? (int)sizeof(float[3]) : (int)sizeof(float[2])), p = gl_state.units[i].pointer_texcoord;j < size;j += sizeof(int), p++)
paranoidblah += *p;
}
l->prev = l->next->prev;
while (l->next->data && l->data && l->next->data->offset <= d->offset)
{
- //Con_Printf(">\n");
+ //Con_Print(">\n");
l->next = l->next->next;
l->prev = l->prev->next;
}
while (l->prev->data && l->data && l->prev->data->offset >= d->offset)
{
- //Con_Printf("<\n");
+ //Con_Print("<\n");
l->prev = l->prev->prev;
l->next = l->next->prev;
}
pic->tex = draw_generateditherpattern();
if (pic->tex == NULL)
{
- Con_Printf ("Draw_CachePic: failed to load %s\n", path);
+ Con_Printf("Draw_CachePic: failed to load %s\n", path);
pic->tex = r_notexture;
}
VectorCopy(oldangles, cl.viewangles);
intimerefresh = 0;
- Con_Printf ("%f seconds (%f fps)\n", timedelta, 128/timedelta);
+ Con_Printf("%f seconds (%f fps)\n", timedelta, 128/timedelta);
}
vec3_t fogcolor;
if (r_shadow_realtime_world.integer && !gl_stencil)
{
- Con_Printf("Realtime world lighting requires 32bit color; turning off r_shadow_realtime_world, please type vid_bitsperpixel 32;vid_restart and try again\n");
+ Con_Print("Realtime world lighting requires 32bit color; turning off r_shadow_realtime_world, please type vid_bitsperpixel 32;vid_restart and try again\n");
Cvar_SetValueQuick(&r_shadow_realtime_world, 0);
}
{
if (gl_filter_min == modes[i].minification)
{
- Con_Printf ("%s\n", modes[i].name);
+ Con_Printf("%s\n", modes[i].name);
return;
}
}
- Con_Printf ("current filter is unknown???\n");
+ Con_Print("current filter is unknown???\n");
return;
}
break;
if (i == 6)
{
- Con_Printf ("bad filter name\n");
+ Con_Print("bad filter name\n");
return;
}
int loaded;
gltexture_t *glt;
gltexturepool_t *pool;
- Con_Printf("glsize input loaded mip alpha name\n");
+ Con_Print("glsize input loaded mip alpha name\n");
for (pool = gltexturepoolchain;pool;pool = pool->next)
{
for (glt = pool->gltchain;glt;glt = glt->chain)
if (glt->image->flags & GLTEXF_UPLOAD)
{
glt->image->flags &= ~GLTEXF_UPLOAD;
- Con_DPrintf("uploaded new fragments image\n");
+ Con_DPrint("uploaded new fragments image\n");
R_MakeResizeBufferBigger(glt->image->width * glt->image->height * glt->image->depth * glt->image->bytesperpixel);
memset(resizebuffer, 255, glt->image->width * glt->image->height * glt->image->depth * glt->image->bytesperpixel);
switch(glt->image->texturetype)
va_start (argptr,format);
vsprintf (string,format,argptr);
va_end (argptr);
- Con_DPrintf ("Host_EndGame: %s\n",string);
+ Con_DPrintf("Host_EndGame: %s\n",string);
if (sv.active)
Host_ShutdownServer (false);
vsprintf (hosterrorstring1,error,argptr);
va_end (argptr);
- Con_Printf ("Host_Error: %s\n", hosterrorstring1);
+ Con_Printf("Host_Error: %s\n", hosterrorstring1);
// LordHavoc: if first frame has not been shown, or currently shutting
// down, do Sys_Error instead
f = FS_Open ("config.cfg", "w", false);
if (!f)
{
- Con_Printf ("Couldn't write config.cfg.\n");
+ Con_Print("Couldn't write config.cfg.\n");
return;
}
}
+/*
+=================
+SV_ClientPrint
+
+Sends text across to be displayed
+FIXME: make this just a stuffed echo?
+=================
+*/
+void SV_ClientPrint(const char *msg)
+{
+ MSG_WriteByte(&host_client->message, svc_print);
+ MSG_WriteString(&host_client->message, msg);
+}
+
/*
=================
SV_ClientPrintf
void SV_ClientPrintf(const char *fmt, ...)
{
va_list argptr;
- char string[1024];
+ char msg[4096];
- va_start (argptr,fmt);
- vsprintf (string, fmt,argptr);
- va_end (argptr);
+ va_start(argptr,fmt);
+ vsnprintf(msg,sizeof(msg),fmt,argptr);
+ va_end(argptr);
- MSG_WriteByte (&host_client->message, svc_print);
- MSG_WriteString (&host_client->message, string);
+ SV_ClientPrint(msg);
}
/*
=================
-SV_BroadcastPrintf
+SV_BroadcastPrint
Sends text to all active clients
=================
*/
-void SV_BroadcastPrintf(const char *fmt, ...)
+void SV_BroadcastPrint(const char *msg)
{
- va_list argptr;
- char string[4096];
int i;
client_t *client;
- va_start(argptr,fmt);
- vsnprintf(string, sizeof(string), fmt,argptr);
- va_end(argptr);
-
for (i = 0, client = svs.clients;i < svs.maxclients;i++, client++)
{
if (client->spawned)
{
MSG_WriteByte(&client->message, svc_print);
- MSG_WriteString(&client->message, string);
+ MSG_WriteString(&client->message, msg);
}
}
if (sv_echobprint.integer && cls.state == ca_dedicated)
- Sys_Printf("%s", string);
+ Sys_Print(msg);
+}
+
+/*
+=================
+SV_BroadcastPrintf
+
+Sends text to all active clients
+=================
+*/
+void SV_BroadcastPrintf(const char *fmt, ...)
+{
+ va_list argptr;
+ char msg[4096];
+
+ va_start(argptr,fmt);
+ vsnprintf(msg,sizeof(msg),fmt,argptr);
+ va_end(argptr);
+
+ SV_BroadcastPrint(msg);
}
/*
*/
void Host_ClearMemory (void)
{
- Con_DPrintf ("Clearing memory\n");
+ Con_DPrint("Clearing memory\n");
Mod_ClearAll ();
cls.signon = 0;
c++;
}
- Con_Printf ("serverprofile: %2i clients %2i msec\n", c, m);
+ Con_Printf("serverprofile: %2i clients %2i msec\n", c, m);
}
//============================================================================
NetConn_Init();
SV_Init();
- Con_Printf ("Builddate: %s\n", buildstring);
+ Con_Printf("Builddate: %s\n", buildstring);
if (cls.state != ca_dedicated)
{
host_initialized = true;
- Con_DPrintf ("========Initialized=========\n");
+ Con_DPrint("========Initialized=========\n");
if (cls.state != ca_dedicated)
{
if (isdown)
{
- Con_Printf ("recursive shutdown\n");
+ Con_Print("recursive shutdown\n");
return;
}
isdown = true;
if (!allowcheats)
{
- SV_ClientPrintf("No cheats allowed, use sv_cheats 1 and restart level to enable.\n");
+ SV_ClientPrint("No cheats allowed, use sv_cheats 1 and restart level to enable.\n");
return;
}
sv_player->v->flags = (int)sv_player->v->flags ^ FL_GODMODE;
if (!((int)sv_player->v->flags & FL_GODMODE) )
- SV_ClientPrintf ("godmode OFF\n");
+ SV_ClientPrint("godmode OFF\n");
else
- SV_ClientPrintf ("godmode ON\n");
+ SV_ClientPrint("godmode ON\n");
}
void Host_Notarget_f (void)
if (!allowcheats)
{
- SV_ClientPrintf("No cheats allowed, use sv_cheats 1 and restart level to enable.\n");
+ SV_ClientPrint("No cheats allowed, use sv_cheats 1 and restart level to enable.\n");
return;
}
sv_player->v->flags = (int)sv_player->v->flags ^ FL_NOTARGET;
if (!((int)sv_player->v->flags & FL_NOTARGET) )
- SV_ClientPrintf ("notarget OFF\n");
+ SV_ClientPrint("notarget OFF\n");
else
- SV_ClientPrintf ("notarget ON\n");
+ SV_ClientPrint("notarget ON\n");
}
qboolean noclip_anglehack;
if (!allowcheats)
{
- SV_ClientPrintf("No cheats allowed, use sv_cheats 1 and restart level to enable.\n");
+ SV_ClientPrint("No cheats allowed, use sv_cheats 1 and restart level to enable.\n");
return;
}
{
noclip_anglehack = true;
sv_player->v->movetype = MOVETYPE_NOCLIP;
- SV_ClientPrintf ("noclip ON\n");
+ SV_ClientPrint("noclip ON\n");
}
else
{
noclip_anglehack = false;
sv_player->v->movetype = MOVETYPE_WALK;
- SV_ClientPrintf ("noclip OFF\n");
+ SV_ClientPrint("noclip OFF\n");
}
}
if (!allowcheats)
{
- SV_ClientPrintf("No cheats allowed, use sv_cheats 1 and restart level to enable.\n");
+ SV_ClientPrint("No cheats allowed, use sv_cheats 1 and restart level to enable.\n");
return;
}
if (sv_player->v->movetype != MOVETYPE_FLY)
{
sv_player->v->movetype = MOVETYPE_FLY;
- SV_ClientPrintf ("flymode ON\n");
+ SV_ClientPrint("flymode ON\n");
}
else
{
sv_player->v->movetype = MOVETYPE_WALK;
- SV_ClientPrintf ("flymode OFF\n");
+ SV_ClientPrint("flymode OFF\n");
}
}
return;
}
- SV_ClientPrintf ("Client ping times:\n");
+ SV_ClientPrint("Client ping times:\n");
for (i = 0, client = svs.clients;i < svs.maxclients;i++, client++)
{
if (!client->active)
for (j=0 ; j<NUM_PING_TIMES ; j++)
total+=client->ping_times[j];
total /= NUM_PING_TIMES;
- SV_ClientPrintf ("%4i %s\n", (int)(total*1000), client->name);
+ SV_ClientPrintf("%4i %s\n", (int)(total*1000), client->name);
}
}
if (Cmd_Argc() != 2)
{
- Con_Printf ("changelevel <levelname> : continue game on a new level\n");
+ Con_Print("changelevel <levelname> : continue game on a new level\n");
return;
}
if (!sv.active || cls.demoplayback)
{
- Con_Printf ("Only the server may changelevel\n");
+ Con_Print("Only the server may changelevel\n");
return;
}
SV_SaveSpawnparms ();
if (cls.state != ca_connected || !sv.active)
{
- Con_Printf ("Not playing a local game.\n");
+ Con_Print("Not playing a local game.\n");
return;
}
if (cl.intermission)
{
- Con_Printf ("Can't save in intermission.\n");
+ Con_Print("Can't save in intermission.\n");
return;
}
{
if (i > 0)
{
- Con_Printf("Can't save multiplayer games.\n");
+ Con_Print("Can't save multiplayer games.\n");
return;
}
if (svs.clients[i].edict->v->deadflag)
{
- Con_Printf("Can't savegame with a dead player\n");
+ Con_Print("Can't savegame with a dead player\n");
return;
}
}
if (Cmd_Argc() != 2)
{
- Con_Printf ("save <savename> : save a game\n");
+ Con_Print("save <savename> : save a game\n");
return;
}
if (strstr(Cmd_Argv(1), ".."))
{
- Con_Printf ("Relative pathnames are not allowed.\n");
+ Con_Print("Relative pathnames are not allowed.\n");
return;
}
strlcpy (name, Cmd_Argv(1), sizeof (name));
FS_DefaultExtension (name, ".sav", sizeof (name));
- Con_Printf ("Saving game to %s...\n", name);
+ Con_Printf("Saving game to %s...\n", name);
f = FS_Open (name, "w", false);
if (!f)
{
- Con_Printf ("ERROR: couldn't open.\n");
+ Con_Print("ERROR: couldn't open.\n");
return;
}
- FS_Printf (f, "%i\n", SAVEGAME_VERSION);
+ FS_Printf(f, "%i\n", SAVEGAME_VERSION);
Host_SavegameComment (comment);
- FS_Printf (f, "%s\n", comment);
+ FS_Printf(f, "%s\n", comment);
for (i=0 ; i<NUM_SPAWN_PARMS ; i++)
- FS_Printf (f, "%f\n", svs.clients[0].spawn_parms[i]);
- FS_Printf (f, "%d\n", current_skill);
- FS_Printf (f, "%s\n", sv.name);
- FS_Printf (f, "%f\n",sv.time);
+ FS_Printf(f, "%f\n", svs.clients[0].spawn_parms[i]);
+ FS_Printf(f, "%d\n", current_skill);
+ FS_Printf(f, "%s\n", sv.name);
+ FS_Printf(f, "%f\n",sv.time);
// write the light styles
for (i=0 ; i<MAX_LIGHTSTYLES ; i++)
{
if (sv.lightstyles[i])
- FS_Printf (f, "%s\n", sv.lightstyles[i]);
+ FS_Printf(f, "%s\n", sv.lightstyles[i]);
else
- FS_Printf (f,"m\n");
+ FS_Print(f,"m\n");
}
FS_Flush (f);
}
FS_Close (f);
- Con_Printf ("done.\n");
+ Con_Print("done.\n");
}
if (Cmd_Argc() != 2)
{
- Con_Printf ("load <savename> : load a game\n");
+ Con_Print("load <savename> : load a game\n");
return;
}
strcpy (filename, Cmd_Argv(1));
FS_DefaultExtension (filename, ".sav", sizeof (filename));
- Con_Printf ("Loading game from %s...\n", filename);
+ Con_Printf("Loading game from %s...\n", filename);
cls.demonum = -1; // stop demo loop in case this fails
f = FS_Open (filename, "r", false);
if (!f)
{
- Con_Printf ("ERROR: couldn't open.\n");
+ Con_Print("ERROR: couldn't open.\n");
return;
}
if (version != SAVEGAME_VERSION)
{
FS_Close (f);
- Con_Printf ("Savegame is version %i, not %i\n", version, SAVEGAME_VERSION);
+ Con_Printf("Savegame is version %i, not %i\n", version, SAVEGAME_VERSION);
return;
}
SV_SpawnServer (mapname);
if (!sv.active)
{
- Con_Printf ("Couldn't load map\n");
+ Con_Print("Couldn't load map\n");
return;
}
sv.paused = true; // pause until all clients connect
if (Cmd_Argc () == 1)
{
- Con_Printf ("\"name\" is \"%s\"\n", cl_name.string);
+ Con_Printf("\"name\" is \"%s\"\n", cl_name.string);
return;
}
void Host_Version_f (void)
{
- Con_Printf ("Version: %s build %s\n", gamename, buildstring);
+ Con_Printf("Version: %s build %s\n", gamename, buildstring);
}
void Host_Say(qboolean teamonly)
if (p2[-1] == '"')
p2--;
else if (fromServer)
- Con_Printf("Host_Say: missing end quote\n");
+ Con_Print("Host_Say: missing end quote\n");
else
- SV_ClientPrintf("Host_Say: missing end quote\n");
+ SV_ClientPrint("Host_Say: missing end quote\n");
}
while (p2 > p1 && (p2[-1] == '\n' || p2[-1] == '\r'))
p2--;
for (j = 0, host_client = svs.clients;j < svs.maxclients;j++, host_client++)
if (host_client->spawned && (!teamplay.integer || host_client->edict->v->team == save->edict->v->team))
- SV_ClientPrintf("%s", text);
+ SV_ClientPrint(text);
host_client = save;
- Sys_Printf("%s", &text[1]);
+ Sys_Print(&text[1]);
}
if (p2[-1] == '"')
p2--;
else if (fromServer)
- Con_Printf("Host_Tell: missing end quote\n");
+ Con_Print("Host_Tell: missing end quote\n");
else
- SV_ClientPrintf("Host_Tell: missing end quote\n");
+ SV_ClientPrint("Host_Tell: missing end quote\n");
}
while (p2 > p1 && (p2[-1] == '\n' || p2[-1] == '\r'))
p2--;
save = host_client;
for (j = 0, host_client = svs.clients;j < svs.maxclients;j++, host_client++)
if (host_client->spawned && !strcasecmp(host_client->name, Cmd_Argv(1)))
- SV_ClientPrintf("%s", text);
+ SV_ClientPrint(text);
host_client = save;
}
if (Cmd_Argc() == 1)
{
- Con_Printf ("\"color\" is \"%i %i\"\n", cl_color.integer >> 4, cl_color.integer & 15);
- Con_Printf ("color <0-15> [0-15]\n");
+ Con_Printf("\"color\" is \"%i %i\"\n", cl_color.integer >> 4, cl_color.integer & 15);
+ Con_Print("color <0-15> [0-15]\n");
return;
}
if (sv_player && (f = ED_FindFunction ("SV_ChangeTeam")) && (SV_ChangeTeam = (func_t)(f - pr_functions)))
{
- Con_DPrintf("Calling SV_ChangeTeam\n");
+ Con_DPrint("Calling SV_ChangeTeam\n");
pr_global_struct->time = sv.time;
pr_globals[OFS_PARM0] = playercolor;
pr_global_struct->self = EDICT_TO_PROG(sv_player);
if (Cmd_Argc() != 2)
{
- Con_Printf ("\"rate\" is \"%i\"\n", cl_rate.integer);
- Con_Printf ("rate <500-25000>\n");
+ Con_Printf("\"rate\" is \"%i\"\n", cl_rate.integer);
+ Con_Print("rate <500-25000>\n");
return;
}
if (!sv_player || sv_player->v->health <= 0)
{
- SV_ClientPrintf ("Can't suicide -- already dead!\n");
+ SV_ClientPrint("Can't suicide -- already dead!\n");
return;
}
return;
}
if (!pausable.integer)
- SV_ClientPrintf ("Pause not allowed.\n");
+ SV_ClientPrint("Pause not allowed.\n");
else
{
sv.paused ^= 1;
- SV_BroadcastPrintf ("%s %spaused the game\n", host_client->name, sv.paused ? "" : "un");
+ SV_BroadcastPrintf("%s %spaused the game\n", host_client->name, sv.paused ? "" : "un");
// send notification to all clients
- MSG_WriteByte (&sv.reliable_datagram, svc_setpause);
- MSG_WriteByte (&sv.reliable_datagram, sv.paused);
+ MSG_WriteByte(&sv.reliable_datagram, svc_setpause);
+ MSG_WriteByte(&sv.reliable_datagram, sv.paused);
}
}
if (Cmd_Argc () == 1)
{
- Con_Printf ("\"pmodel\" is \"%s\"\n", cl_pmodel.string);
+ Con_Printf("\"pmodel\" is \"%s\"\n", cl_pmodel.string);
return;
}
i = atoi(Cmd_Argv(1));
{
if (cmd_source == src_command)
{
- Con_Printf ("prespawn is not valid from the console\n");
+ Con_Print("prespawn is not valid from the console\n");
return;
}
if (host_client->spawned)
{
- Con_Printf ("prespawn not valid -- already spawned\n");
+ Con_Print("prespawn not valid -- already spawned\n");
return;
}
if (cmd_source == src_command)
{
- Con_Printf("spawn is not valid from the console\n");
+ Con_Print("spawn is not valid from the console\n");
return;
}
if (host_client->spawned)
{
- Con_Printf("Spawn not valid -- already spawned\n");
+ Con_Print("Spawn not valid -- already spawned\n");
return;
}
if (!sv_player)
{
- Con_Printf("Host_Spawn: no edict??\n");
+ Con_Print("Host_Spawn: no edict??\n");
return;
}
if ((f = ED_FindFunction ("RestoreGame")))
if ((RestoreGame = (func_t)(f - pr_functions)))
{
- Con_DPrintf("Calling RestoreGame\n");
+ Con_DPrint("Calling RestoreGame\n");
pr_global_struct->time = sv.time;
pr_global_struct->self = EDICT_TO_PROG(sv_player);
PR_ExecuteProgram (RestoreGame, "");
PR_ExecuteProgram (pr_global_struct->ClientConnect, "QC function ClientConnect is missing");
if ((Sys_DoubleTime() - host_client->netconnection->connecttime) <= sv.time)
- Sys_Printf ("%s entered the game\n", host_client->name);
+ Sys_Printf("%s entered the game\n", host_client->name);
PR_ExecuteProgram (pr_global_struct->PutClientInServer, "QC function PutClientInServer is missing");
}
{
if (cmd_source == src_command)
{
- Con_Printf ("begin is not valid from the console\n");
+ Con_Print("begin is not valid from the console\n");
return;
}
message++;
}
if (message)
- SV_ClientPrintf ("Kicked by %s: %s\n", who, message);
+ SV_ClientPrintf("Kicked by %s: %s\n", who, message);
else
- SV_ClientPrintf ("Kicked by %s\n", who);
+ SV_ClientPrintf("Kicked by %s\n", who);
SV_DropClient (false); // kicked
}
if (!allowcheats)
{
- SV_ClientPrintf("No cheats allowed, use sv_cheats 1 and restart level to enable.\n");
+ SV_ClientPrint("No cheats allowed, use sv_cheats 1 and restart level to enable.\n");
return;
}
if (!strcmp (PR_GetString(e->v->classname), "viewthing"))
return e;
}
- Con_Printf ("No viewthing on map\n");
+ Con_Print("No viewthing on map\n");
return NULL;
}
m = Mod_ForName (Cmd_Argv(1), false, true, false);
if (!m)
{
- Con_Printf ("Can't load %s\n", Cmd_Argv(1));
+ Con_Printf("Can't load %s\n", Cmd_Argv(1));
return;
}
c = Cmd_Argc() - 1;
if (c > MAX_DEMOS)
{
- Con_Printf ("Max %i demos in demoloop\n", MAX_DEMOS);
+ Con_Printf("Max %i demos in demoloop\n", MAX_DEMOS);
c = MAX_DEMOS;
}
- Con_DPrintf ("%i demo(s) in loop\n", c);
+ Con_DPrintf("%i demo(s) in loop\n", c);
for (i=1 ; i<c+1 ; i++)
strlcpy (cls.demos[i-1], Cmd_Argv(i), sizeof (cls.demos[i-1]));
if (sv.active)
{
- Con_Printf("maxplayers can not be changed while a server is running.\n");
+ Con_Print("maxplayers can not be changed while a server is running.\n");
return;
}
n = atoi(Cmd_Argv(1));
n = bound(1, n, MAX_SCOREBOARD);
- Con_Printf ("\"maxplayers\" set to \"%u\"\n", n);
+ Con_Printf("\"maxplayers\" set to \"%u\"\n", n);
if (svs.clients)
Mem_Free(svs.clients);
if (fs_filesize < (int)sizeof(pcx) + 768)
{
- Con_Printf ("Bad pcx file\n");
+ Con_Print("Bad pcx file\n");
return NULL;
}
image_height = pcx.ymax + 1 - pcx.ymin;
if (pcx.manufacturer != 0x0a || pcx.version != 5 || pcx.encoding != 1 || pcx.bits_per_pixel != 8 || image_width > 4096 || image_height > 4096 || image_width <= 0 || image_height <= 0)
{
- Con_Printf ("Bad pcx file\n");
+ Con_Print("Bad pcx file\n");
return NULL;
}
if ((matchwidth && image_width != matchwidth) || (matchheight && image_height != matchheight))
void PrintTargaHeader(TargaHeader *t)
{
- Con_Printf("TargaHeader:\n");
+ Con_Print("TargaHeader:\n");
Con_Printf("uint8 id_length = %i;\n", t->id_length);
Con_Printf("uint8 colormap_type = %i;\n", t->colormap_type);
Con_Printf("uint8 image_type = %i;\n", t->image_type);
targa_header.height = image_height = f[14] + f[15] * 256;
if (image_width > 4096 || image_height > 4096 || image_width <= 0 || image_height <= 0)
{
- Con_Printf("LoadTGA: invalid size\n");
+ Con_Print("LoadTGA: invalid size\n");
PrintTargaHeader(&targa_header);
return NULL;
}
{
if (targa_header.pixel_size != 24 && targa_header.pixel_size != 32)
{
- Con_Printf ("LoadTGA: only 24bit and 32bit pixel sizes supported for type 2 and type 10 images\n");
+ Con_Print("LoadTGA: only 24bit and 32bit pixel sizes supported for type 2 and type 10 images\n");
PrintTargaHeader(&targa_header);
return NULL;
}
{
if (targa_header.pixel_size != 8)
{
- Con_Printf ("LoadTGA: only 8bit pixel size for type 1, 3, 9, and 11 images supported\n");
+ Con_Print("LoadTGA: only 8bit pixel size for type 1, 3, 9, and 11 images supported\n");
PrintTargaHeader(&targa_header);
return NULL;
}
if (targa_header.colormap_length > 256)
{
- Con_Printf ("LoadTGA: only up to 256 colormap_length supported\n");
+ Con_Print("LoadTGA: only up to 256 colormap_length supported\n");
PrintTargaHeader(&targa_header);
return NULL;
}
if (targa_header.colormap_index)
{
- Con_Printf ("LoadTGA: colormap_index not supported\n");
+ Con_Print("LoadTGA: colormap_index not supported\n");
PrintTargaHeader(&targa_header);
return NULL;
}
}
else
{
- Con_Printf ("LoadTGA: Only 32 and 24 bit colormap_size supported\n");
+ Con_Print("LoadTGA: Only 32 and 24 bit colormap_size supported\n");
PrintTargaHeader(&targa_header);
return NULL;
}
{
if (targa_header.pixel_size != 8)
{
- Con_Printf ("LoadTGA: only 8bit pixel size for type 1, 3, 9, and 11 images supported\n");
+ Con_Print("LoadTGA: only 8bit pixel size for type 1, 3, 9, and 11 images supported\n");
PrintTargaHeader(&targa_header);
return NULL;
}
}
else
{
- Con_Printf ("LoadTGA: Only type 1, 2, 3, 9, 10, and 11 targa RGB images supported, image_type = %i\n", targa_header.image_type);
+ Con_Printf("LoadTGA: Only type 1, 2, 3, 9, 10, and 11 targa RGB images supported, image_type = %i\n", targa_header.image_type);
PrintTargaHeader(&targa_header);
return NULL;
}
if (targa_header.attributes & 0x10)
{
- Con_Printf ("LoadTGA: origin must be in top left or bottom left, top right and bottom right are not supported\n");
+ Con_Print("LoadTGA: origin must be in top left or bottom left, top right and bottom right are not supported\n");
return NULL;
}
image_rgba = Mem_Alloc(tempmempool, image_width * image_height * 4);
if (!image_rgba)
{
- Con_Printf ("LoadTGA: not enough memory for %i by %i image\n", image_width, image_height);
+ Con_Printf("LoadTGA: not enough memory for %i by %i image\n", image_width, image_height);
return NULL;
}
if (fs_filesize < 9)
{
- Con_Printf("LoadLMP: invalid LMP file\n");
+ Con_Print("LoadLMP: invalid LMP file\n");
return NULL;
}
if (fs_filesize < 8 + image_width * image_height)
{
- Con_Printf("LoadLMP: invalid LMP file\n");
+ Con_Print("LoadLMP: invalid LMP file\n");
return NULL;
}
if (fs_filesize < (int) sizeof(q2wal_t))
{
- Con_Printf("LoadWAL: invalid WAL file\n");
+ Con_Print("LoadWAL: invalid WAL file\n");
return NULL;
}
if ((int) fs_filesize < (int) sizeof(q2wal_t) + (int) LittleLong(inwal->offsets[0]) + image_width * image_height)
{
- Con_Printf("LoadWAL: invalid WAL file\n");
+ Con_Print("LoadWAL: invalid WAL file\n");
return NULL;
}
if (fs_filesize < 9)
{
- Con_Printf("LoadLMPAs8Bit: invalid LMP file\n");
+ Con_Print("LoadLMPAs8Bit: invalid LMP file\n");
return NULL;
}
if (fs_filesize < 8 + image_width * image_height)
{
- Con_Printf("LoadLMPAs8Bit: invalid LMP file\n");
+ Con_Print("LoadLMPAs8Bit: invalid LMP file\n");
return NULL;
}
}
if (complain)
{
- Con_Printf ("Couldn't load %s using ", filename);
+ Con_Printf("Couldn't load %s using ", filename);
for (i = 0;imageformats[i].formatstring;i++)
{
sprintf (name, imageformats[i].formatstring, basename);
- Con_Printf (i == 0 ? "\"%s\"" : (imageformats[i+1].formatstring ? ", \"%s\"" : " or \"%s\".\n"), imageformats[i].formatstring);
+ Con_Printf(i == 0 ? "\"%s\"" : (imageformats[i+1].formatstring ? ", \"%s\"" : " or \"%s\".\n"), imageformats[i].formatstring);
}
}
if (developer_memorydebug.integer)
// No DLL = no JPEGs
if (!jpeg_dll)
{
- Con_Printf ("You need the libjpeg library to save JPEG images\n");
+ Con_Print("You need the libjpeg library to save JPEG images\n");
return false;
}
{
Cbuf_AddText (key_lines[edit_line]+1); // skip the ]
Cbuf_AddText ("\n");
- Con_Printf ("%s\n",key_lines[edit_line]);
+ Con_Printf("%s\n",key_lines[edit_line]);
edit_line = (edit_line + 1) & 31;
history_line = edit_line;
key_lines[edit_line][0] = ']';
int b, m;
if (Cmd_Argc () != 3) {
- Con_Printf ("in_unbind <bindmap> <key> : remove commands from a key\n");
+ Con_Print("in_unbind <bindmap> <key> : remove commands from a key\n");
return;
}
m = strtol(Cmd_Argv (1), NULL, 0);
if ((m < 0) || (m >= 8)) {
- Con_Printf ("%d isn't a valid bindmap\n", m);
+ Con_Printf("%d isn't a valid bindmap\n", m);
return;
}
b = Key_StringToKeynum (Cmd_Argv (2));
if (b == -1) {
- Con_Printf ("\"%s\" isn't a valid key\n", Cmd_Argv (2));
+ Con_Printf("\"%s\" isn't a valid key\n", Cmd_Argv (2));
return;
}
c = Cmd_Argc ();
if (c != 3 && c != 4) {
- Con_Printf ("in_bind <bindmap> <key> [command] : attach a command to a key\n");
+ Con_Print("in_bind <bindmap> <key> [command] : attach a command to a key\n");
return;
}
m = strtol(Cmd_Argv (1), NULL, 0);
if ((m < 0) || (m >= 8)) {
- Con_Printf ("%d isn't a valid bindmap\n", m);
+ Con_Printf("%d isn't a valid bindmap\n", m);
return;
}
b = Key_StringToKeynum (Cmd_Argv (2));
if (b == -1) {
- Con_Printf ("\"%s\" isn't a valid key\n", Cmd_Argv (2));
+ Con_Printf("\"%s\" isn't a valid key\n", Cmd_Argv (2));
return;
}
if (c == 3) {
if (keybindings[m][b])
- Con_Printf ("\"%s\" = \"%s\"\n", Cmd_Argv (2), keybindings[m][b]);
+ Con_Printf("\"%s\" = \"%s\"\n", Cmd_Argv (2), keybindings[m][b]);
else
- Con_Printf ("\"%s\" is not bound\n", Cmd_Argv (2));
+ Con_Printf("\"%s\" is not bound\n", Cmd_Argv (2));
return;
}
// copy the rest of the command line
c = Cmd_Argc ();
if (c != 3) {
- Con_Printf ("in_bindmap <bindmap> <fallback>: set current bindmap and fallback\n");
+ Con_Print("in_bindmap <bindmap> <fallback>: set current bindmap and fallback\n");
return;
}
m1 = strtol(Cmd_Argv (1), NULL, 0);
if ((m1 < 0) || (m1 >= 8)) {
- Con_Printf ("%d isn't a valid bindmap\n", m1);
+ Con_Printf("%d isn't a valid bindmap\n", m1);
return;
}
m2 = strtol(Cmd_Argv (2), NULL, 0);
if ((m2 < 0) || (m2 >= 8)) {
- Con_Printf ("%d isn't a valid bindmap\n", m2);
+ Con_Printf("%d isn't a valid bindmap\n", m2);
return;
}
int b;
if (Cmd_Argc () != 2) {
- Con_Printf ("unbind <key> : remove commands from a key\n");
+ Con_Print("unbind <key> : remove commands from a key\n");
return;
}
b = Key_StringToKeynum (Cmd_Argv (1));
if (b == -1) {
- Con_Printf ("\"%s\" isn't a valid key\n", Cmd_Argv (1));
+ Con_Printf("\"%s\" isn't a valid key\n", Cmd_Argv (1));
return;
}
c = Cmd_Argc ();
if (c != 2 && c != 3) {
- Con_Printf ("bind <key> [command] : attach a command to a key\n");
+ Con_Print("bind <key> [command] : attach a command to a key\n");
return;
}
b = Key_StringToKeynum (Cmd_Argv (1));
if (b == -1) {
- Con_Printf ("\"%s\" isn't a valid key\n", Cmd_Argv (1));
+ Con_Printf("\"%s\" isn't a valid key\n", Cmd_Argv (1));
return;
}
if (c == 2) {
if (keybindings[0][b])
- Con_Printf ("\"%s\" = \"%s\"\n", Cmd_Argv (1), keybindings[0][b]);
+ Con_Printf("\"%s\" = \"%s\"\n", Cmd_Argv (1), keybindings[0][b]);
else
- Con_Printf ("\"%s\" is not bound\n", Cmd_Argv (1));
+ Con_Printf("\"%s\" is not bound\n", Cmd_Argv (1));
return;
}
// copy the rest of the command line
for (i = 0; i < (int)(sizeof(keybindings[0])/sizeof(keybindings[0][0])); i++)
if (keybindings[0][i])
- FS_Printf (f, "bind %s \"%s\"\n",
+ FS_Printf(f, "bind %s \"%s\"\n",
Key_KeynumToString (i), keybindings[0][i]);
for (j = 1; j < 8; j++)
for (i = 0; i < (int)(sizeof(keybindings[0])/sizeof(keybindings[0][0])); i++)
if (keybindings[j][i])
- FS_Printf (f, "in_bind %d %s \"%s\"\n",
+ FS_Printf(f, "in_bind %d %s \"%s\"\n",
j, Key_KeynumToString (i), keybindings[j][i]);
}
#ifdef WIN32
}
else
- Con_Printf("LHNET_OpenSocket_Connectionless: WSAStartup failed\n");
+ Con_Print("LHNET_OpenSocket_Connectionless: WSAStartup failed\n");
#endif
break;
default:
switch (e)
{
case WSAECONNREFUSED:
- Con_Printf("Connection refused\n");
+ Con_Print("Connection refused\n");
return 0;
}
#else
switch (errno)
{
case ECONNREFUSED:
- Con_Printf("Connection refused\n");
+ Con_Print("Connection refused\n");
return 0;
}
#endif
switch (e)
{
case WSAECONNREFUSED:
- Con_Printf("Connection refused\n");
+ Con_Print("Connection refused\n");
return 0;
}
#else
switch (errno)
{
case ECONNREFUSED:
- Con_Printf("Connection refused\n");
+ Con_Print("Connection refused\n");
return 0;
}
#endif
#include "matrixlib.h"
-void Matrix4x4_Print (const matrix4x4_t *in)
+void Matrix4x4_Print(const matrix4x4_t *in)
{
Con_Printf("%f %f %f %f\n%f %f %f %f\n%f %f %f %f\n%f %f %f %f\n"
, in->m[0][0], in->m[0][1], in->m[0][2], in->m[0][3]
DrawQ_String(menu_x + cx, menu_y + cy, temp, 1, 8, 8, 1, 1, 1, 1, 0);
}
-void M_Print (float cx, float cy, const char *str)
+void M_Print(float cx, float cy, const char *str)
{
DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 1, 1, 1, 0);
}
DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 0, 0, 1, 0);
}
-void M_ItemPrint (float cx, float cy, char *str, int unghosted)
+void M_ItemPrint(float cx, float cy, char *str, int unghosted)
{
if (unghosted)
DrawQ_String(menu_x + cx, menu_y + cy, str, 0, 8, 8, 1, 1, 1, 1, 0);
M_Background(320, 200);
for (i = 0;i < NumberOfNehahraDemos;i++)
- M_Print (16, 16 + 8*i, NehahraDemos[i].desc);
+ M_Print(16, 16 + 8*i, NehahraDemos[i].desc);
// line cursor
M_DrawCharacter (8, 16 + demo_cursor*8, 12+((int)(realtime*4)&1));
M_DrawTextBox (60, 8 * 8, 23, 4);
if (gamemode == GAME_NEXUIZ)
- M_Print (95, 10 * 8, "Nexuiz is for");
+ M_Print(95, 10 * 8, "Nexuiz is for");
else if (gamemode == GAME_GOODVSBAD2)
- M_Print (95, 10 * 8, "Good Vs Bad 2 is for");
+ M_Print(95, 10 * 8, "Good Vs Bad 2 is for");
else if (gamemode == GAME_BATTLEMECH)
- M_Print (95, 10 * 8, "Battlemech is for");
+ M_Print(95, 10 * 8, "Battlemech is for");
else
- M_Print (95, 10 * 8, "Transfusion is for");
- M_Print (83, 11 * 8, "multiplayer play only");
+ M_Print(95, 10 * 8, "Transfusion is for");
+ M_Print(83, 11 * 8, "multiplayer play only");
}
else
{
M_DrawPic ( (320-p->width)/2, 4, "gfx/p_load.lmp");
for (i=0 ; i< MAX_SAVEGAMES; i++)
- M_Print (16, 32 + 8*i, m_filenames[i]);
+ M_Print(16, 32 + 8*i, m_filenames[i]);
// line cursor
M_DrawCharacter (8, 32 + load_cursor*8, 12+((int)(realtime*4)&1));
M_DrawPic ( (320-p->width)/2, 4, "gfx/p_save.lmp");
for (i=0 ; i<MAX_SAVEGAMES ; i++)
- M_Print (16, 32 + 8*i, m_filenames[i]);
+ M_Print(16, 32 + 8*i, m_filenames[i]);
// line cursor
M_DrawCharacter (8, 32 + load_cursor*8, 12+((int)(realtime*4)&1));
p = Draw_CachePic ("gfx/p_multi.lmp");
M_DrawPic ( (320-p->width)/2, 4, "gfx/p_multi.lmp");
- M_Print (64, 40, "Your name");
+ M_Print(64, 40, "Your name");
M_DrawTextBox (160, 32, 16, 1);
- M_Print (168, 40, setup_myname);
+ M_Print(168, 40, setup_myname);
if (gamemode != GAME_GOODVSBAD2)
{
- M_Print (64, 64, "Shirt color");
- M_Print (64, 88, "Pants color");
+ M_Print(64, 64, "Shirt color");
+ M_Print(64, 88, "Pants color");
}
- M_Print (64, 124-8, "Network speed limit");
- M_Print (168, 124, va("%i (%s)", setup_rate, setup_ratetable[setup_rateindex(setup_rate)].name));
+ M_Print(64, 124-8, "Network speed limit");
+ M_Print(168, 124, va("%i (%s)", setup_rate, setup_ratetable[setup_rateindex(setup_rate)].name));
M_DrawTextBox (64, 140-8, 14, 1);
- M_Print (72, 140, "Accept Changes");
+ M_Print(72, 140, "Accept Changes");
// LordHavoc: rewrote this code greatly
if (menuplyr_load)
void M_DrawCheckbox (int x, int y, int on)
{
if (on)
- M_Print (x, y, "on");
+ M_Print(x, y, "on");
else
- M_Print (x, y, "off");
+ M_Print(x, y, "off");
}
M_DrawPic ( (320-p->width)/2, 4, "gfx/ttl_cstm.lmp");
if (bind_grab)
- M_Print (12, 32, "Press a key or button for this action");
+ M_Print(12, 32, "Press a key or button for this action");
else
- M_Print (18, 32, "Enter to change, backspace to clear");
+ M_Print(18, 32, "Enter to change, backspace to clear");
// search for known bindings
for (i=0 ; i<numcommands ; i++)
continue;
}
else
- M_Print (16, y, bindnames[i][1]);
+ M_Print(16, y, bindnames[i][1]);
M_FindKeysForCommand (bindnames[i][0], keys);
}
}
}
- M_Print (150, y, keystring);
+ M_Print(150, y, keystring);
}
if (bind_grab)
// Resolution
M_Print(16, video_cursor_table[0], " Resolution");
string = va("%dx%d", video_resolutions[video_resolution][0], video_resolutions[video_resolution][1]);
- M_Print (220, video_cursor_table[0], string);
+ M_Print(220, video_cursor_table[0], string);
// Bits per pixel
M_Print(16, video_cursor_table[1], " Bits per pixel");
- M_Print (220, video_cursor_table[1], (vid_bitsperpixel.integer == 32) ? "32" : "16");
+ M_Print(220, video_cursor_table[1], (vid_bitsperpixel.integer == 32) ? "32" : "16");
// Fullscreen
M_Print(16, video_cursor_table[2], " Fullscreen");
else
startJoin = "Join Game";
protocol = "TCP/IP";
- M_Print (basex, 32, va ("%s - %s", startJoin, protocol));
+ M_Print(basex, 32, va ("%s - %s", startJoin, protocol));
basex += 8;
- M_Print (basex, lanConfig_cursor_table[0], "Port");
+ M_Print(basex, lanConfig_cursor_table[0], "Port");
M_DrawTextBox (basex+8*8, lanConfig_cursor_table[0]-8, 6, 1);
- M_Print (basex+9*8, lanConfig_cursor_table[0], lanConfig_portname);
+ M_Print(basex+9*8, lanConfig_cursor_table[0], lanConfig_portname);
if (JoiningGame)
{
- M_Print (basex, lanConfig_cursor_table[1], "Search for games...");
- M_Print (basex, lanConfig_cursor_table[2]-16, "Join game at:");
+ M_Print(basex, lanConfig_cursor_table[1], "Search for games...");
+ M_Print(basex, lanConfig_cursor_table[2]-16, "Join game at:");
M_DrawTextBox (basex+8, lanConfig_cursor_table[2]-8, 22, 1);
- M_Print (basex+16, lanConfig_cursor_table[2], lanConfig_joinname);
+ M_Print(basex+16, lanConfig_cursor_table[2], lanConfig_joinname);
}
else
{
M_DrawTextBox (basex, lanConfig_cursor_table[1]-8, 2, 1);
- M_Print (basex+8, lanConfig_cursor_table[1], "OK");
+ M_Print(basex+8, lanConfig_cursor_table[1], "OK");
}
M_DrawCharacter (basex-8, lanConfig_cursor_table [lanConfig_cursor], 12+((int)(realtime*4)&1));
M_DrawCharacter (basex+16 + 8*strlen(lanConfig_joinname), lanConfig_cursor_table [2], 10+((int)(realtime*4)&1));
if (*m_return_reason)
- M_Print (basex, 168, m_return_reason);
+ M_Print(basex, 168, m_return_reason);
}
M_DrawPic ( (320-p->width)/2, 4, "gfx/p_multi.lmp");
M_DrawTextBox (152, 32, 10, 1);
- M_Print (160, 40, "begin game");
+ M_Print(160, 40, "begin game");
- M_Print (0, 56, " Max players");
- M_Print (160, 56, va("%i", maxplayers) );
+ M_Print(0, 56, " Max players");
+ M_Print(160, 56, va("%i", maxplayers) );
if (gamemode != GAME_GOODVSBAD2)
{
- M_Print (0, 64, " Game Type");
+ M_Print(0, 64, " Game Type");
if (gamemode == GAME_TRANSFUSION)
{
if (!deathmatch.integer)
Cvar_SetValue("deathmatch", 1);
if (deathmatch.integer == 2)
- M_Print (160, 64, "Capture the Flag");
+ M_Print(160, 64, "Capture the Flag");
else
- M_Print (160, 64, "Blood Bath");
+ M_Print(160, 64, "Blood Bath");
}
else if (gamemode == GAME_BATTLEMECH)
{
if (!deathmatch.integer)
Cvar_SetValue("deathmatch", 1);
if (deathmatch.integer == 2)
- M_Print (160, 64, "Rambo Match");
+ M_Print(160, 64, "Rambo Match");
else
- M_Print (160, 64, "Deathmatch");
+ M_Print(160, 64, "Deathmatch");
}
else
{
if (!coop.integer && !deathmatch.integer)
Cvar_SetValue("deathmatch", 1);
if (coop.integer)
- M_Print (160, 64, "Cooperative");
+ M_Print(160, 64, "Cooperative");
else
- M_Print (160, 64, "Deathmatch");
+ M_Print(160, 64, "Deathmatch");
}
- M_Print (0, 72, " Teamplay");
+ M_Print(0, 72, " Teamplay");
if (gamemode == GAME_ROGUE)
{
char *msg;
case 6: msg = "Three Team CTF"; break;
default: msg = "Off"; break;
}
- M_Print (160, 72, msg);
+ M_Print(160, 72, msg);
}
else
{
case 2: msg = "Friendly Fire"; break;
default: msg = "No Friendly Fire"; break;
}
- M_Print (160, 72, msg);
+ M_Print(160, 72, msg);
}
- M_Print (0, 80, " Skill");
+ M_Print(0, 80, " Skill");
if (skill.integer == 0)
- M_Print (160, 80, "Easy difficulty");
+ M_Print(160, 80, "Easy difficulty");
else if (skill.integer == 1)
- M_Print (160, 80, "Normal difficulty");
+ M_Print(160, 80, "Normal difficulty");
else if (skill.integer == 2)
- M_Print (160, 80, "Hard difficulty");
+ M_Print(160, 80, "Hard difficulty");
else
- M_Print (160, 80, "Nightmare difficulty");
+ M_Print(160, 80, "Nightmare difficulty");
- M_Print (0, 88, " Frag Limit");
+ M_Print(0, 88, " Frag Limit");
if (fraglimit.integer == 0)
- M_Print (160, 88, "none");
+ M_Print(160, 88, "none");
else
- M_Print (160, 88, va("%i frags", fraglimit.integer));
+ M_Print(160, 88, va("%i frags", fraglimit.integer));
- M_Print (0, 96, " Time Limit");
+ M_Print(0, 96, " Time Limit");
if (timelimit.integer == 0)
- M_Print (160, 96, "none");
+ M_Print(160, 96, "none");
else
- M_Print (160, 96, va("%i minutes", timelimit.integer));
+ M_Print(160, 96, va("%i minutes", timelimit.integer));
}
- M_Print (0, 104, " Public server");
- M_Print (160, 104, (sv_public.integer == 0) ? "no" : "yes");
+ M_Print(0, 104, " Public server");
+ M_Print(160, 104, (sv_public.integer == 0) ? "no" : "yes");
- M_Print (0, 120, " Server name");
+ M_Print(0, 120, " Server name");
M_DrawTextBox (0, 124, 38, 1);
- M_Print (8, 132, hostname.string);
+ M_Print(8, 132, hostname.string);
g = lookupgameinfo();
if (gamemode != GAME_GOODVSBAD2)
{
- M_Print (0, 152, " Episode");
- M_Print (160, 152, g->episodes[startepisode].description);
+ M_Print(0, 152, " Episode");
+ M_Print(160, 152, g->episodes[startepisode].description);
}
- M_Print (0, 160, " Level");
- M_Print (160, 160, g->levels[g->episodes[startepisode].firstLevel + startlevel].description);
- M_Print (160, 168, g->levels[g->episodes[startepisode].firstLevel + startlevel].name);
+ M_Print(0, 160, " Level");
+ M_Print(160, 160, g->levels[g->episodes[startepisode].firstLevel + startlevel].description);
+ M_Print(160, 168, g->levels[g->episodes[startepisode].firstLevel + startlevel].name);
// line cursor
if (gameoptions_cursor == 8)
x = (320-26*8)/2;
M_DrawTextBox (x, 138, 24, 4);
x += 8;
- M_Print (x, 146, " More than 64 players?? ");
- M_Print (x, 154, " First, question your ");
- M_Print (x, 162, " sanity, then email ");
- M_Print (x, 170, " havoc@telefragged.com ");
+ M_Print(x, 146, " More than 64 players?? ");
+ M_Print(x, 154, " First, question your ");
+ M_Print(x, 162, " sanity, then email ");
+ M_Print(x, 170, " havoc@telefragged.com ");
}
else
m_serverInfoMessage = false;
{
if (FS_FileExists("hearing.dem"))
{
- Con_Printf("Nehahra movie and game detected.\n");
+ Con_Print("Nehahra movie and game detected.\n");
NehGameType = TYPE_BOTH;
}
else
{
- Con_Printf("Nehahra game detected.\n");
+ Con_Print("Nehahra game detected.\n");
NehGameType = TYPE_GAME;
}
}
{
if (FS_FileExists("hearing.dem"))
{
- Con_Printf("Nehahra movie detected.\n");
+ Con_Print("Nehahra movie detected.\n");
NehGameType = TYPE_DEMO;
}
else
{
- Con_Printf("Nehahra not found.\n");
+ Con_Print("Nehahra not found.\n");
NehGameType = TYPE_GAME; // could just complain, but...
}
}
// fall back to the normal menu
// say it
- Con_Printf("Falling back to normal menu\n");
+ Con_Print("Falling back to normal menu\n");
key_dest = key_game;
if (t->trace->allsolid)
t->trace->startsolid = true;
#if COLLISIONPARANOID >= 3
- Con_Printf("S");
+ Con_Print("S");
#endif
return HULLCHECKSTATE_SOLID;
}
{
t->trace->allsolid = false;
#if COLLISIONPARANOID >= 3
- Con_Printf("E");
+ Con_Print("E");
#endif
return HULLCHECKSTATE_EMPTY;
}
if (t2 < 0)
{
#if COLLISIONPARANOID >= 3
- Con_Printf("<");
+ Con_Print("<");
#endif
num = node->children[1];
goto loc0;
if (t2 >= 0)
{
#if COLLISIONPARANOID >= 3
- Con_Printf(">");
+ Con_Print(">");
#endif
num = node->children[0];
goto loc0;
// the line intersects, find intersection point
// LordHavoc: this uses the original trace for maximum accuracy
#if COLLISIONPARANOID >= 3
- Con_Printf("M");
+ Con_Print("M");
#endif
if (plane->type < 3)
{
t->trace->fraction = bound(0, midf, 1);
#if COLLISIONPARANOID >= 3
- Con_Printf("D");
+ Con_Print("D");
#endif
return HULLCHECKSTATE_DONE;
}
#if COLLISIONPARANOID >= 2
Con_Printf("t(%f %f %f,%f %f %f,%i %f %f %f)", rhc.start[0], rhc.start[1], rhc.start[2], rhc.end[0], rhc.end[1], rhc.end[2], rhc.hull - model->brushq1.hulls, rhc.hull->clip_mins[0], rhc.hull->clip_mins[1], rhc.hull->clip_mins[2]);
Mod_Q1BSP_RecursiveHullCheck(&rhc, rhc.hull->firstclipnode, 0, 1, rhc.start, rhc.end);
- Con_Printf("\n");
+ Con_Print("\n");
#else
if (DotProduct(rhc.dist, rhc.dist))
Mod_Q1BSP_RecursiveHullCheck(&rhc, rhc.hull->firstclipnode, 0, 1, rhc.start, rhc.end);
}
if ((mtwidth & 15) || (mtheight & 15))
- Con_Printf("warning: texture \"%s\" in \"%s\" is not 16 aligned", dmiptex->name, loadmodel->name);
+ Con_Printf("warning: texture \"%s\" in \"%s\" is not 16 aligned\n", dmiptex->name, loadmodel->name);
// LordHavoc: force all names to lowercase
for (j = 0;name[j];j++)
else
{
if (fs_filesize == 8)
- Con_Printf("Empty .lit file, ignoring\n");
+ Con_Print("Empty .lit file, ignoring\n");
else
- Con_Printf("Corrupt .lit file (old version?), ignoring\n");
+ Con_Print("Corrupt .lit file (old version?), ignoring\n");
Mem_Free(data);
}
}
{
if (subdivpolytriangles >= MAX_SUBDIVPOLYTRIANGLES)
{
- Con_Printf("SubdividePolygon: ran out of triangles in buffer, please increase your r_subdivide_size\n");
+ Con_Print("SubdividePolygon: ran out of triangles in buffer, please increase your r_subdivide_size\n");
return;
}
if (p >= 0 && out->clusterindex >= 0)
{
if (p >= loadmodel->brushq1.num_compressedpvs)
- Con_Printf("Mod_Q1BSP_LoadLeafs: invalid visofs\n");
+ Con_Print("Mod_Q1BSP_LoadLeafs: invalid visofs\n");
else
Mod_Q1BSP_DecompressVis(loadmodel->brushq1.data_compressedpvs + p, loadmodel->brushq1.data_compressedpvs + loadmodel->brushq1.num_compressedpvs, loadmodel->brush.data_pvsclusters + out->clusterindex * loadmodel->brush.num_pvsclusterbytes, loadmodel->brush.data_pvsclusters + (out->clusterindex + 1) * loadmodel->brush.num_pvsclusterbytes);
}
nodeportalwinding = Winding_Clip(nodeportalwinding, clipplane.normal[0], clipplane.normal[1], clipplane.normal[2], clipplane.dist, true);
if (!nodeportalwinding)
{
- Con_Printf("Mod_Q1BSP_RecursiveNodePortals: WARNING: new portal was clipped away\n");
+ Con_Print("Mod_Q1BSP_RecursiveNodePortals: WARNING: new portal was clipped away\n");
break;
}
}
text = f;
while (COM_ParseToken(&text, false))
{
- snprintf(shadername, sizeof(shadername), "%s", com_token);
+ strncpy(shadername, com_token, sizeof(shadername));
flags = 0;
sky[0] = 0;
if (COM_ParseToken(&text, false) && !strcasecmp(com_token, "{"))
if (out->data_element3i[j] < 0 || out->data_element3i[j] >= out->num_vertices)
out->data_element3i[j] = 0;
}
- Con_Printf("\n");
+ Con_Print("\n");
}
// for shadow volumes
Mod_BuildTriangleNeighbors(out->data_neighbor3i, out->data_element3i, out->num_triangles);
Mod_Init
===============
*/
-static void Mod_Print (void);
+static void Mod_Print(void);
static void Mod_Precache (void);
void Mod_Init (void)
{
int i;
model_t *mod;
- Con_Printf ("Loaded models:\n");
+ Con_Print("Loaded models:\n");
for (i = 0, mod = mod_known;i < MAX_MOD_KNOWN;i++, mod++)
if (mod->name[0])
- Con_Printf ("%4iK %s\n", mod->mempool ? (mod->mempool->totalsize + 1023) / 1024 : 0, mod->name);
+ Con_Printf("%4iK %s\n", mod->mempool ? (mod->mempool->totalsize + 1023) / 1024 : 0, mod->name);
}
/*
if (Cmd_Argc() == 2)
Mod_ForName(Cmd_Argv(1), false, true, cl.worldmodel && !strcasecmp(Cmd_Argv(1), cl.worldmodel->name));
else
- Con_Printf("usage: modelprecache <filename>\n");
+ Con_Print("usage: modelprecache <filename>\n");
}
#if 1
{
clientport2 = cl_netport.integer;
if (cls.state == ca_connected)
- Con_Printf("Changing \"cl_port\" will not take effect until you reconnect.\n");
+ Con_Print("Changing \"cl_port\" will not take effect until you reconnect.\n");
}
if (cls.state == ca_disconnected && clientport != clientport2)
{
{
hostport = sv_netport.integer;
if (sv.active)
- Con_Printf("Changing \"port\" will not take effect until \"map\" command is executed.\n");
+ Con_Print("Changing \"port\" will not take effect until \"map\" command is executed.\n");
}
}
}
}
else
- Con_DPrintf("Got a stale datagram\n");
+ Con_DPrint("Got a stale datagram\n");
return 1;
}
else if (flags & NETFLAG_ACK)
{
conn->ackSequence++;
if (conn->ackSequence != conn->sendSequence)
- Con_DPrintf("ack sequencing error\n");
+ Con_DPrint("ack sequencing error\n");
conn->lastMessageTime = realtime;
conn->timeout = realtime + net_messagetimeout.value;
conn->sendMessageLength -= MAX_PACKETFRAGMENT;
}
}
else
- Con_DPrintf("Duplicate ACK received\n");
+ Con_DPrint("Duplicate ACK received\n");
}
else
- Con_DPrintf("Stale ACK received\n");
+ Con_DPrint("Stale ACK received\n");
return 1;
}
else if (flags & NETFLAG_DATA)
length -= 18;
masterreplycount++;
if (m_state != m_slist)
- Con_Printf("received server list...\n");
+ Con_Print("received server list...\n");
while (length >= 7 && data[0] == '\\' && (data[1] != 0xFF || data[2] != 0xFF || data[3] != 0xFF || data[4] != 0xFF) && data[5] * 256 + data[6] != 0)
{
snprintf (ipstring, sizeof (ipstring), "%u.%u.%u.%u:%u", data[1], data[2], data[3], data[4], (data[5] << 8) | data[6]);
hostcache[n].ping = 100000;
hostcache[n].querytime = realtime;
// build description strings for the things users care about
- snprintf(hostcache[n].line1, sizeof(hostcache[n].line1), "?");
- snprintf(hostcache[n].line2, sizeof(hostcache[n].line2), "%s", ipstring);
+ strncpy(hostcache[n].line1, "?", sizeof(hostcache[n].line1));
+ strncpy(hostcache[n].line2, ipstring, sizeof(hostcache[n].line2));
// if not in the slist menu we should print the server to console
if (m_state != m_slist)
Con_Printf("querying %s\n", ipstring);
if (m_state == m_slist)
strcpy (m_return_reason, "Connect: Failed");
else
- Con_Printf("Connect failed\n");
+ Con_Print("Connect failed\n");
return;
}
if (cls.connect_nextsendtime)
if (m_state == m_slist)
strcpy (m_return_reason, "Connect: Still trying");
else
- Con_Printf("Still trying...\n");
+ Con_Print("Still trying...\n");
}
else
{
if (m_state == m_slist)
strcpy (m_return_reason, "Connect: Trying");
else
- Con_Printf("Trying...\n");
+ Con_Print("Trying...\n");
}
cls.connect_nextsendtime = realtime + 1;
cls.connect_remainingtries--;
NetConn_ClientParsePacket(cl_sockets[i], readbuffer, length, &peeraddress);
if (cls.netcon && realtime > cls.netcon->timeout)
{
- Con_Printf("Connection timed out\n");
+ Con_Print("Connection timed out\n");
CL_Disconnect();
}
for (conn = netconn_list;conn;conn = conn->next)
}
if (!masterquerycount)
{
- Con_Printf("Unable to query master servers, no suitable network sockets active.\n");
+ Con_Print("Unable to query master servers, no suitable network sockets active.\n");
strcpy(m_return_reason, "No network");
}
}
if (sv.active)
NetConn_Heartbeat(2);
else
- Con_Printf("No server running, can not heartbeat to master server.\n");
+ Con_Print("No server running, can not heartbeat to master server.\n");
}
void PrintStats(netconn_t *conn)
Con_Printf("packetsReceived = %i\n", packetsReceived);
Con_Printf("receivedDuplicateCount = %i\n", receivedDuplicateCount);
Con_Printf("droppedDatagrams = %i\n", droppedDatagrams);
- Con_Printf("connections =\n");
+ Con_Print("connections =\n");
for (conn = netconn_list;conn;conn = conn->next)
PrintStats(conn);
}
hostCacheCount = 0;
memset(&pingcache, 0, sizeof(pingcache));
if (m_state != m_slist)
- Con_Printf("Sending requests to master servers\n");
+ Con_Print("Sending requests to master servers\n");
NetConn_QueryMasters();
if (m_state != m_slist)
- Con_Printf("Listening for replies...\n");
+ Con_Print("Listening for replies...\n");
}
void NetConn_Init(void)
ov_decode.buffsize = fs_filesize;
if (qov_open_callbacks (&ov_decode, &vf, NULL, 0, callbacks) < 0)
{
- Con_Printf ("error while opening Ogg Vorbis file \"%s\"\n", filename);
+ Con_Printf("error while opening Ogg Vorbis file \"%s\"\n", filename);
Mem_Free (data);
return NULL;
}
vi = qov_info (&vf, -1);
if (vi->channels < 1 || vi->channels > 2)
{
- Con_Printf ("%s has an unsupported number of channels (%i)\n",
+ Con_Printf("%s has an unsupported number of channels (%i)\n",
s->name, vi->channels);
qov_clear (&vf);
Mem_Free (data);
}
else
{
- Con_Printf ("failed to allocate memory for sound \"%s\"\n", s->name);
+ Con_Printf("failed to allocate memory for sound \"%s\"\n", s->name);
Mem_FreePool (&s->mempool);
}
}
else
{
- Con_DPrintf("Couldn't load gfx/palette.lmp, falling back on internal palette\n");
+ Con_DPrint("Couldn't load gfx/palette.lmp, falling back on internal palette\n");
memcpy(host_basepal, host_quakepal, 765);
}
host_basepal[765] = host_basepal[766] = host_basepal[767] = 0; // LordHavoc: force the transparent color to black
// if there is no model, it can not block visibility
if (model == NULL)
{
- Con_Printf("Portal_Visibility: NULL model\n");
+ Con_Print("Portal_Visibility: NULL model\n");
return;
}
if (!model->brushq1.numportals)
{
- Con_Printf("Portal_Visibility: not a brush model\n");
+ Con_Print("Portal_Visibility: not a brush model\n");
return;
}
char string[STRINGTEMP_LENGTH];
PF_VarString(0, string, sizeof(string));
- Con_Printf ("======SERVER ERROR in %s:\n%s\n", PR_GetString(pr_xfunction->s_name), string);
+ Con_Printf("======SERVER ERROR in %s:\n%s\n", PR_GetString(pr_xfunction->s_name), string);
ed = PROG_TO_EDICT(pr_global_struct->self);
- ED_Print (ed);
+ ED_Print(ed);
PF_ERROR("Program error");
}
char string[STRINGTEMP_LENGTH];
PF_VarString(0, string, sizeof(string));
- Con_Printf ("======OBJECT ERROR in %s:\n%s\n", PR_GetString(pr_xfunction->s_name), string);
+ Con_Printf("======OBJECT ERROR in %s:\n%s\n", PR_GetString(pr_xfunction->s_name), string);
ed = PROG_TO_EDICT(pr_global_struct->self);
- ED_Print (ed);
+ ED_Print(ed);
ED_Free (ed);
}
{
char string[STRINGTEMP_LENGTH];
PF_VarString(0, string, sizeof(string));
- SV_BroadcastPrintf("%s", string);
+ SV_BroadcastPrint(string);
}
/*
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
{
- Con_Printf ("tried to sprint to a non-client\n");
+ Con_Print("tried to sprint to a non-client\n");
return;
}
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
{
- Con_Printf ("tried to sprint to a non-client\n");
+ Con_Print("tried to sprint to a non-client\n");
return;
}
if (!*check)
{
- Con_Printf ("no precache: %s\n", samp);
+ Con_Printf("no precache: %s\n", samp);
return;
}
entnum = G_EDICTNUM(OFS_PARM0);
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
{
- Con_Printf("Can't stuffcmd to a non-client");
+ Con_Print("Can't stuffcmd to a non-client\n");
return;
}
str = G_STRING(OFS_PARM1);
if (developer.integer)
{
PF_VarString(0, string, sizeof(string));
- Con_Printf("%s",string);
+ Con_Print(string);
}
}
i = NUM_FOR_EDICT(ent);
if (i < 1 || i > svs.maxclients || !svs.clients[i-1].active)
{
- Con_Printf("tried to setspawnparms on a non-client\n");
+ Con_Print("tried to setspawnparms on a non-client\n");
return;
}
// check for overlap with a command
if (Cmd_Exists (name))
{
- Con_Printf ("PF_registercvar: %s is a command\n", name);
+ Con_Printf("PF_registercvar: %s is a command\n", name);
return;
}
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
{
- Con_Printf ("tried to setcolor a non-client\n");
+ Con_Print("tried to setcolor a non-client\n");
return;
}
i = (NUM_FOR_EDICT(G_EDICT(OFS_PARM0)) - 1);
if (i < 0 || i >= svs.maxclients || !svs.clients[i].active)
{
- Con_Printf("PF_clientcommand: entity is not a client");
+ Con_Print("PF_clientcommand: entity is not a client\n");
return;
}
switch (type)
{
case ev_string:
- snprintf (line, sizeof (line), "%s", PR_GetString(val->string));
+ strncpy(line, PR_GetString(val->string), sizeof(line));
break;
case ev_entity:
//n = NoCrash_NUM_FOR_EDICT(PROG_TO_EDICT(val->edict));
break;
case ev_function:
f = pr_functions + val->function;
- snprintf (line, sizeof (line), "%s", PR_GetString(f->s_name));
+ strncpy(line, PR_GetString(f->s_name), sizeof(line));
break;
case ev_field:
def = ED_FieldAtOfs ( val->_int );
*/
// LordHavoc: optimized this to print out much more quickly (tempstring)
// LordHavoc: changed to print out every 4096 characters (incase there are a lot of fields to print)
-void ED_Print (edict_t *ed)
+void ED_Print(edict_t *ed)
{
int l;
ddef_t *d;
if (ed->e->free)
{
- Con_Printf ("FREE\n");
+ Con_Print("FREE\n");
return;
}
strlcat (tempstring, "\n", sizeof (tempstring));
if (strlen(tempstring) >= 4096)
{
- Con_Printf("%s", tempstring);
+ Con_Print(tempstring);
tempstring[0] = 0;
}
}
if (tempstring[0])
- Con_Printf("%s", tempstring);
+ Con_Print(tempstring);
}
/*
char *name;
int type;
- FS_Printf (f, "{\n");
+ FS_Print(f, "{\n");
if (ed->e->free)
{
- FS_Printf (f, "}\n");
+ FS_Print(f, "}\n");
return;
}
if (j == type_size[type])
continue;
- FS_Printf (f,"\"%s\" ",name);
- FS_Printf (f,"\"%s\"\n", PR_UglyValueString(d->type, (eval_t *)v));
+ FS_Printf(f,"\"%s\" ",name);
+ FS_Printf(f,"\"%s\"\n", PR_UglyValueString(d->type, (eval_t *)v));
}
- FS_Printf (f, "}\n");
+ FS_Print(f, "}\n");
}
void ED_PrintNum (int ent)
{
- ED_Print (EDICT_NUM(ent));
+ ED_Print(EDICT_NUM(ent));
}
/*
{
int i;
- Con_Printf ("%i entities\n", sv.num_edicts);
+ Con_Printf("%i entities\n", sv.num_edicts);
for (i=0 ; i<sv.num_edicts ; i++)
ED_PrintNum (i);
}
i = atoi (Cmd_Argv(1));
if (i < 0 || i >= sv.num_edicts)
{
- Con_Printf("Bad edict number\n");
+ Con_Print("Bad edict number\n");
return;
}
ED_PrintNum (i);
step++;
}
- Con_Printf ("num_edicts:%3i\n", sv.num_edicts);
- Con_Printf ("active :%3i\n", active);
- Con_Printf ("view :%3i\n", models);
- Con_Printf ("touch :%3i\n", solid);
- Con_Printf ("step :%3i\n", step);
+ Con_Printf("num_edicts:%3i\n", sv.num_edicts);
+ Con_Printf("active :%3i\n", active);
+ Con_Printf("view :%3i\n", models);
+ Con_Printf("touch :%3i\n", solid);
+ Con_Printf("step :%3i\n", step);
}
char *name;
int type;
- FS_Printf (f,"{\n");
+ FS_Print(f,"{\n");
for (i=0 ; i<progs->numglobaldefs ; i++)
{
def = &pr_globaldefs[i];
continue;
name = PR_GetString(def->s_name);
- FS_Printf (f,"\"%s\" ", name);
- FS_Printf (f,"\"%s\"\n", PR_UglyValueString(type, (eval_t *)&pr_globals[def->ofs]));
+ FS_Printf(f,"\"%s\" ", name);
+ FS_Printf(f,"\"%s\"\n", PR_UglyValueString(type, (eval_t *)&pr_globals[def->ofs]));
}
- FS_Printf (f,"}\n");
+ FS_Print(f,"}\n");
}
/*
if(Cmd_Argc() != 4)
{
- Con_Printf("edictset <edict number> <field> <value>\n");
+ Con_Print("edictset <edict number> <field> <value>\n");
return;
}
ed = EDICT_NUM(atoi(Cmd_Argv(1)));
key = ED_FindGlobal (keyname);
if (!key)
{
- Con_DPrintf ("'%s' is not a global\n", keyname);
+ Con_DPrintf("'%s' is not a global\n", keyname);
continue;
}
func = ED_FindFunction(s);
if (!func)
{
- Con_Printf ("ED_ParseEpair: Can't find function %s\n", s);
+ Con_Printf("ED_ParseEpair: Can't find function %s\n", s);
return false;
}
val->function = func - pr_functions;
key = ED_FindField (keyname);
if (!key)
{
- Con_DPrintf ("'%s' is not a field\n", keyname);
+ Con_DPrintf("'%s' is not a field\n", keyname);
continue;
}
//
if (!ent->v->classname)
{
- Con_Printf ("No classname for:\n");
- ED_Print (ent);
+ Con_Print("No classname for:\n");
+ ED_Print(ent);
ED_Free (ent);
continue;
}
{
if (developer.integer) // don't confuse non-developers with errors
{
- Con_Printf ("No spawn function for:\n");
- ED_Print (ent);
+ Con_Print("No spawn function for:\n");
+ ED_Print(ent);
}
ED_Free (ent);
continue;
died++;
}
- Con_DPrintf ("%i entities parsed, %i inhibited, %i spawned (%i removed self, %i stayed)\n", parsed, inhibited, spawned, died, spawned - died);
+ Con_DPrintf("%i entities parsed, %i inhibited, %i spawned (%i removed self, %i stayed)\n", parsed, inhibited, spawned, died, spawned - died);
}
memcpy(progs, temp, fs_filesize);
Mem_Free(temp);
- Con_DPrintf ("Programs occupy %iK.\n", fs_filesize/1024);
+ Con_DPrintf("Programs occupy %iK.\n", fs_filesize/1024);
pr_crc = CRC_Block((qbyte *)progs, fs_filesize);
int *v;
if (!sv.active)
{
- Con_Printf("no progs loaded\n");
+ Con_Print("no progs loaded\n");
return;
}
counts = Mem_Alloc(tempmempool, progs->numfielddefs * sizeof(int));
strlcat (tempstring, "\n", sizeof (tempstring));
if (strlen(tempstring) >= 4096)
{
- Con_Printf("%s", tempstring);
+ Con_Print(tempstring);
tempstring[0] = 0;
}
if (counts[i])
int i;
if (!sv.active)
{
- Con_Printf("no progs loaded\n");
+ Con_Print("no progs loaded\n");
return;
}
for (i = 0;i < progs->numglobaldefs;i++)
if ( (unsigned)s->op < sizeof(pr_opnames)/sizeof(pr_opnames[0]))
{
- Con_Printf ("%s ", pr_opnames[s->op]);
+ Con_Printf("%s ", pr_opnames[s->op]);
i = strlen(pr_opnames[s->op]);
for ( ; i<10 ; i++)
- Con_Printf (" ");
+ Con_Print(" ");
}
if (s->op == OP_IF || s->op == OP_IFNOT)
- Con_Printf ("%sbranch %i",PR_GlobalString((unsigned short) s->a),s->b);
+ Con_Printf("%sbranch %i",PR_GlobalString((unsigned short) s->a),s->b);
else if (s->op == OP_GOTO)
{
- Con_Printf ("branch %i",s->a);
+ Con_Printf("branch %i",s->a);
}
else if ( (unsigned)(s->op - OP_STORE_F) < 6)
{
- Con_Printf ("%s", PR_GlobalString((unsigned short) s->a));
- Con_Printf ("%s", PR_GlobalStringNoContents((unsigned short) s->b));
+ Con_Print(PR_GlobalString((unsigned short) s->a));
+ Con_Print(PR_GlobalStringNoContents((unsigned short) s->b));
}
else
{
if (s->a)
- Con_Printf ("%s", PR_GlobalString((unsigned short) s->a));
+ Con_Print(PR_GlobalString((unsigned short) s->a));
if (s->b)
- Con_Printf ("%s", PR_GlobalString((unsigned short) s->b));
+ Con_Print(PR_GlobalString((unsigned short) s->b));
if (s->c)
- Con_Printf ("%s", PR_GlobalStringNoContents((unsigned short) s->c));
+ Con_Print(PR_GlobalStringNoContents((unsigned short) s->c));
}
- Con_Printf ("\n");
+ Con_Print("\n");
}
/*
f = pr_stack[i].f;
if (!f)
- Con_Printf ("<NULL FUNCTION>\n");
+ Con_Print("<NULL FUNCTION>\n");
else
- Con_Printf ("%12s : %s : statement %i\n", PR_GetString(f->s_file), PR_GetString(f->s_name), pr_stack[i].s - f->first_statement);
+ Con_Printf("%12s : %s : statement %i\n", PR_GetString(f->s_file), PR_GetString(f->s_name), pr_stack[i].s - f->first_statement);
}
}
if (best)
{
//if (num < howmany)
- Con_Printf ("%7i %7i %s\n", best->profile, best->builtinsprofile, PR_GetString(best->s_name));
+ Con_Printf("%7i %7i %s\n", best->profile, best->builtinsprofile, PR_GetString(best->s_name));
num++;
best->profile = 0;
best->builtinsprofile = 0;
PR_PrintStatement (pr_statements + pr_xstatement + i);
}
else
- Con_Printf("null function executing??\n");
+ Con_Print("null function executing??\n");
PR_StackTrace ();
}
{
if (pr_depth > 0)
{
- Con_Printf("QuakeC crash report:\n");
+ Con_Print("QuakeC crash report:\n");
PR_PrintState();
}
if (!fnum || fnum >= progs->numfunctions)
{
if (pr_global_struct->self)
- ED_Print (PROG_TO_EDICT(pr_global_struct->self));
+ ED_Print(PROG_TO_EDICT(pr_global_struct->self));
Host_Error ("PR_ExecuteProgram: %s", errormessage);
}
char *ED_NewString (const char *string);
// returns a copy of the string allocated from the server's string heap
-void ED_Print (edict_t *ed);
+void ED_Print(edict_t *ed);
void ED_Write (qfile_t *f, edict_t *ed);
const char *ED_ParseEdict (const char *data, edict_t *ent);
char *PRVM_ED_NewString (const char *string);
// returns a copy of the string allocated from the server's string heap
-void PRVM_ED_Print (prvm_edict_t *ed);
+void PRVM_ED_Print(prvm_edict_t *ed);
void PRVM_ED_Write (qfile_t *f, prvm_edict_t *ed);
const char *PRVM_ED_ParseEdict (const char *data, prvm_edict_t *ent);
Con_Printf(" E_TAGATTACHMENT e%i:%i", e->tagentity, e->tagindex);
if (bits & E_LIGHTSTYLE)
Con_Printf(" E_LIGHTSTYLE %i", e->lightstyle);
- Con_Printf("\n");
+ Con_Print("\n");
}
}
if (e >= d->frames[n].framenum)
{
if (e == f->framenum)
- Con_Printf("EntityFrame_AddFrame: tried to add out of sequence frame to database\n");
+ Con_Print("EntityFrame_AddFrame: tried to add out of sequence frame to database\n");
else
- Con_Printf("EntityFrame_AddFrame: out of sequence frames in database\n");
+ Con_Print("EntityFrame_AddFrame: out of sequence frames in database\n");
return;
}
e = d->frames[n].framenum;
for (i = 0;i < MAX_ENTITY_HISTORY;i++)
if (d->commit[i].numentities)
Con_Printf(" %i", d->commit[i].framenum);
- Con_Printf("\n");
+ Con_Print("\n");
}
if (!EntityFrame4_AckFrame(d, referenceframenum))
{
- Con_Printf("EntityFrame4_CL_ReadFrame: reference frame invalid (VERY BAD ERROR), this update will be skipped\n");
+ Con_Print("EntityFrame4_CL_ReadFrame: reference frame invalid (VERY BAD ERROR), this update will be skipped\n");
skip = true;
d->ackframenum = -1;
EntityFrame4_ResetDatabase(d);
char string[VM_STRINGTEMP_LENGTH];
VM_VarString(0, string, sizeof(string));
- Con_Printf ("======%S ERROR in %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
+ Con_Printf("======%S ERROR in %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
if(prog->self)
{
ed = PRVM_G_EDICT(prog->self->ofs);
- PRVM_ED_Print (ed);
+ PRVM_ED_Print(ed);
}
PRVM_ERROR ("%s: Program error", PRVM_NAME);
char string[VM_STRINGTEMP_LENGTH];
VM_VarString(0, string, sizeof(string));
- Con_Printf ("======%s OBJECT ERROR in %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
+ Con_Printf("======%s OBJECT ERROR in %s:\n%s\n", PRVM_NAME, PRVM_GetString(prog->xfunction->s_name), string);
if(prog->self)
{
ed = PRVM_G_EDICT (prog->self->ofs);
- PRVM_ED_Print (ed);
+ PRVM_ED_Print(ed);
PRVM_ED_Free (ed);
}
char string[VM_STRINGTEMP_LENGTH];
VM_VarString(0, string, sizeof(string));
- Con_Printf(string);
+ Con_Print(string);
}
/*
if(!sv.active)
{
- Con_Printf("VM_bprint: game is not server(%s) !", PRVM_NAME);
+ Con_Printf("VM_bprint: game is not server(%s) !\n", PRVM_NAME);
return;
}
VM_VarString(0, string, sizeof(string));
- SV_BroadcastPrintf("%s", string);
+ SV_BroadcastPrint(string);
}
/*
clientnum = PRVM_G_FLOAT(OFS_PARM0);
if (!sv.active || clientnum < 0 || clientnum >= svs.maxclients || !svs.clients[clientnum].active)
{
- Con_Printf("VM_sprint: %s: invalid client or server is not active !", PRVM_NAME);
+ Con_Printf("VM_sprint: %s: invalid client or server is not active !\n", PRVM_NAME);
return;
}
// check for overlap with a command
if (Cmd_Exists (name))
{
- Con_Printf ("VM_registercvar: %s is a command\n", name);
+ Con_Printf("VM_registercvar: %s is a command\n", name);
return;
}
if (entnum < 1 || entnum > svs.maxclients || !svs.clients[entnum-1].active)
{
- Con_Printf ("tried to setcolor a non-client\n");
+ Con_Print("tried to setcolor a non-client\n");
return;
}
modestring = "wb";
break;
default:
- Con_Printf ("VM_fopen: %s no such mode %i (valid: 0 = read, 1 = append, 2 = write)\n", PRVM_NAME, mode);
+ Con_Printf("VM_fopen: %s no such mode %i (valid: 0 = read, 1 = append, 2 = write)\n", PRVM_NAME, mode);
PRVM_G_FLOAT(OFS_RETURN) = -3;
return;
}
i = PRVM_G_FLOAT(OFS_PARM0);
if (!sv.active || i < 0 || i >= svs.maxclients || !svs.clients[i].active)
{
- Con_Printf("VM_clientcommand: %s: invalid client/server is not active !", PRVM_NAME);
+ Con_Printf("VM_clientcommand: %s: invalid client/server is not active !\n", PRVM_NAME);
return;
}
}
if(pos[2] || scale[2])
- Con_Printf("VM_drawcharacter: z value%c from %s discarded",(pos[2] && scale[2]) ? 's' : 0,((pos[2] && scale[2]) ? "pos and scale" : (pos[2] ? "pos" : "scale")));
+ Con_Printf("VM_drawcharacter: z value%c from %s discarded\n",(pos[2] && scale[2]) ? 's' : 0,((pos[2] && scale[2]) ? "pos and scale" : (pos[2] ? "pos" : "scale")));
if(!scale[0] || !scale[1])
{
}
if(pos[2] || scale[2])
- Con_Printf("VM_drawstring: z value%c from %s discarded",(pos[2] && scale[2]) ? 's' : 0,((pos[2] && scale[2]) ? "pos and scale" : (pos[2] ? "pos" : "scale")));
+ Con_Printf("VM_drawstring: z value%c from %s discarded\n",(pos[2] && scale[2]) ? 's' : 0,((pos[2] && scale[2]) ? "pos and scale" : (pos[2] ? "pos" : "scale")));
DrawQ_String (pos[0], pos[1], string, 0, scale[0], scale[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag);
PRVM_G_FLOAT(OFS_RETURN) = 1;
}
if(pos[2] || size[2])
- Con_Printf("VM_drawstring: z value%c from %s discarded",(pos[2] && size[2]) ? 's' : 0,((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size")));
+ Con_Printf("VM_drawstring: z value%c from %s discarded\n",(pos[2] && size[2]) ? 's' : 0,((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size")));
DrawQ_Pic(pos[0], pos[1], pic, size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM4), flag);
PRVM_G_FLOAT(OFS_RETURN) = 1;
}
if(pos[2] || size[2])
- Con_Printf("VM_drawstring: z value%c from %s discarded",(pos[2] && size[2]) ? 's' : 0,((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size")));
+ Con_Printf("VM_drawstring: z value%c from %s discarded\n",(pos[2] && size[2]) ? 's' : 0,((pos[2] && size[2]) ? "pos and size" : (pos[2] ? "pos" : "size")));
DrawQ_Pic(pos[0], pos[1], 0, size[0], size[1], rgb[0], rgb[1], rgb[2], PRVM_G_FLOAT(OFS_PARM3), flag);
PRVM_G_FLOAT(OFS_RETURN) = 1;
type = PRVM_G_FLOAT( OFS_PARM0 );
if( type < 0 || type > 4 )
- Con_Printf ( "VM_M_gethostcachevalue: bad type %i!\n", type );
+ Con_Printf( "VM_M_gethostcachevalue: bad type %i!\n", type );
else switch(type)
{
case 0:
if(type < 0 || type > 2)
{
- Con_Printf("VM_M_gethostcachestring: bad string type requested!\n");
+ Con_Print("VM_M_gethostcachestring: bad string type requested!\n");
return;
}
if(hostnr < 0 || hostnr >= hostCacheCount)
{
- Con_Printf("VM_M_gethostcachestring: bad hostnr passed!\n");
+ Con_Print("VM_M_gethostcachestring: bad hostnr passed!\n");
return;
}
switch (type)
{
case ev_string:
- sprintf (line, "%s", PRVM_GetString(val->string));
+ strncpy(line, PRVM_GetString(val->string), sizeof(line));
break;
case ev_entity:
n = val->edict;
break;
case ev_function:
f = pr_functions + val->function;
- snprintf (line, sizeof (line), "%s", PRVM_GetString(f->s_name));
+ strncpy(line, PRVM_GetString(f->s_name), sizeof(line));
break;
case ev_field:
def = PRVM_ED_FieldAtOfs ( val->_int );
*/
// LordHavoc: optimized this to print out much more quickly (tempstring)
// LordHavoc: changed to print out every 4096 characters (incase there are a lot of fields to print)
-void PRVM_ED_Print (prvm_edict_t *ed)
+void PRVM_ED_Print(prvm_edict_t *ed)
{
int l;
ddef_t *d;
if (ed->e->free)
{
- Con_Printf ("%s: FREE\n",PRVM_NAME);
+ Con_Printf("%s: FREE\n",PRVM_NAME);
return;
}
strcat(tempstring, "\n");
if (strlen(tempstring) >= 4096)
{
- Con_Printf("%s", tempstring);
+ Con_Print(tempstring);
tempstring[0] = 0;
}
}
if (tempstring[0])
- Con_Printf("%s", tempstring);
+ Con_Print(tempstring);
}
/*
char *name;
int type;
- FS_Printf (f, "{\n");
+ FS_Print(f, "{\n");
if (ed->e->free)
{
- FS_Printf (f, "}\n");
+ FS_Print(f, "}\n");
return;
}
if (j == prvm_type_size[type])
continue;
- FS_Printf (f,"\"%s\" ",name);
- FS_Printf (f,"\"%s\"\n", PRVM_UglyValueString(d->type, (prvm_eval_t *)v));
+ FS_Printf(f,"\"%s\" ",name);
+ FS_Printf(f,"\"%s\"\n", PRVM_UglyValueString(d->type, (prvm_eval_t *)v));
}
- FS_Printf (f, "}\n");
+ FS_Print(f, "}\n");
}
void PRVM_ED_PrintNum (int ent)
{
- PRVM_ED_Print (PRVM_EDICT_NUM(ent));
+ PRVM_ED_Print(PRVM_EDICT_NUM(ent));
}
/*
if(Cmd_Argc() != 2)
{
- Con_Printf("prvm_edicts <program name>\n");
+ Con_Print("prvm_edicts <program name>\n");
return;
}
if(!PRVM_SetProgFromString(Cmd_Argv(1)))
return;
- Con_Printf ("%s: %i entities\n", PRVM_NAME, prog->num_edicts);
+ Con_Printf("%s: %i entities\n", PRVM_NAME, prog->num_edicts);
for (i=0 ; i<prog->num_edicts ; i++)
PRVM_ED_PrintNum (i);
if(Cmd_Argc() != 3)
{
- Con_Printf("prvm_edict <program name> <edict number>\n");
+ Con_Print("prvm_edict <program name> <edict number>\n");
return;
}
i = atoi (Cmd_Argv(2));
if (i >= prog->num_edicts)
{
- Con_Printf("Bad edict number\n");
+ Con_Print("Bad edict number\n");
PRVM_End;
return;
}
if(Cmd_Argc() != 2)
{
- Con_Printf("prvm_count <program name>\n");
+ Con_Print("prvm_count <program name>\n");
return;
}
active++;
}
- Con_Printf ("num_edicts:%3i\n", prog->num_edicts);
- Con_Printf ("active :%3i\n", active);
+ Con_Printf("num_edicts:%3i\n", prog->num_edicts);
+ Con_Printf("active :%3i\n", active);
}
PRVM_End;
char *name;
int type;
- FS_Printf (f,"{\n");
+ FS_Print(f,"{\n");
for (i=0 ; i<prog->progs->numglobaldefs ; i++)
{
def = &prog->globaldefs[i];
continue;
name = PRVM_GetString(def->s_name);
- FS_Printf (f,"\"%s\" ", name);
- FS_Printf (f,"\"%s\"\n", PRVM_UglyValueString(type, (prvm_eval_t *)&prog->globals[def->ofs]));
+ FS_Printf(f,"\"%s\" ", name);
+ FS_Printf(f,"\"%s\"\n", PRVM_UglyValueString(type, (prvm_eval_t *)&prog->globals[def->ofs]));
}
- FS_Printf (f,"}\n");
+ FS_Print(f,"}\n");
}
/*
key = PRVM_ED_FindGlobal (keyname);
if (!key)
{
- Con_DPrintf ("'%s' is not a global on %s\n", keyname, PRVM_NAME);
+ Con_DPrintf("'%s' is not a global on %s\n", keyname, PRVM_NAME);
continue;
}
func = PRVM_ED_FindFunction(s);
if (!func)
{
- Con_Printf ("PRVM_ED_ParseEpair: Can't find function %s in %s\n", s, PRVM_NAME);
+ Con_Printf("PRVM_ED_ParseEpair: Can't find function %s in %s\n", s, PRVM_NAME);
return false;
}
val->function = func - prog->functions;
if(Cmd_Argc() != 5)
{
- Con_Printf("prvm_edictset <program name> <edict number> <field> <value>\n");
+ Con_Print("prvm_edictset <program name> <edict number> <field> <value>\n");
return;
}
key = PRVM_ED_FindField (keyname);
if (!key)
{
- Con_DPrintf ("%s: '%s' is not a field\n", PRVM_NAME, keyname);
+ Con_DPrintf("%s: '%s' is not a field\n", PRVM_NAME, keyname);
continue;
}
string_t handle = *(string_t*)&((float*)ent->v)[PRVM_ED_FindFieldOffset("classname")];
if (!handle)
{
- Con_Printf ("No classname for:\n");
- PRVM_ED_Print (ent);
+ Con_Print("No classname for:\n");
+ PRVM_ED_Print(ent);
PRVM_ED_Free (ent);
continue;
}
{
if (developer.integer) // don't confuse non-developers with errors
{
- Con_Printf ("No spawn function for:\n");
- PRVM_ED_Print (ent);
+ Con_Print("No spawn function for:\n");
+ PRVM_ED_Print(ent);
}
PRVM_ED_Free (ent);
continue;
died++;
}
- Con_DPrintf ("%s: %i new entities parsed, %i new inhibited, %i (%i new) spawned (whereas %i removed self, %i stayed)\n", PRVM_NAME, parsed, inhibited, prog->num_edicts, spawned, died, spawned - died);
+ Con_DPrintf("%s: %i new entities parsed, %i new inhibited, %i (%i new) spawned (whereas %i removed self, %i stayed)\n", PRVM_NAME, parsed, inhibited, prog->num_edicts, spawned, died, spawned - died);
}
// not used
memcpy(prog->progs, temp, fs_filesize);
Mem_Free(temp);
- Con_DPrintf ("%s programs occupy %iK.\n", PRVM_NAME, fs_filesize/1024);
+ Con_DPrintf("%s programs occupy %iK.\n", PRVM_NAME, fs_filesize/1024);
pr_crc = CRC_Block((qbyte *)prog->progs, fs_filesize);
/*
if (!sv.active)
{
- Con_Printf("no progs loaded\n");
+ Con_Print("no progs loaded\n");
return;
}
*/
if(Cmd_Argc() != 2)
{
- Con_Printf("prvm_fields <program name>\n");
+ Con_Print("prvm_fields <program name>\n");
return;
}
strcat(tempstring, "\n");
if (strlen(tempstring) >= 4096)
{
- Con_Printf("%s", tempstring);
+ Con_Print(tempstring);
tempstring[0] = 0;
}
if (counts[i])
// TODO
/*if (!sv.active)
{
- Con_Printf("no progs loaded\n");
+ Con_Print("no progs loaded\n");
return;
}*/
if(Cmd_Argc () != 2)
{
- Con_Printf("prvm_globals <program name>\n");
+ Con_Print("prvm_globals <program name>\n");
return;
}
if ( (unsigned)s->op < sizeof(prvm_opnames)/sizeof(prvm_opnames[0]))
{
- Con_Printf ("%s ", prvm_opnames[s->op]);
+ Con_Printf("%s ", prvm_opnames[s->op]);
i = strlen(prvm_opnames[s->op]);
for ( ; i<10 ; i++)
- Con_Printf (" ");
+ Con_Print(" ");
}
if (s->op == OP_IF || s->op == OP_IFNOT)
- Con_Printf ("%sbranch %i",PRVM_GlobalString((unsigned short) s->a),s->b);
+ Con_Printf("%sbranch %i",PRVM_GlobalString((unsigned short) s->a),s->b);
else if (s->op == OP_GOTO)
{
- Con_Printf ("branch %i",s->a);
+ Con_Printf("branch %i",s->a);
}
else if ( (unsigned)(s->op - OP_STORE_F) < 6)
{
- Con_Printf ("%s", PRVM_GlobalString((unsigned short) s->a));
- Con_Printf ("%s", PRVM_GlobalStringNoContents((unsigned short) s->b));
+ Con_Print(PRVM_GlobalString((unsigned short) s->a));
+ Con_Print(PRVM_GlobalStringNoContents((unsigned short) s->b));
}
else
{
if (s->a)
- Con_Printf ("%s", PRVM_GlobalString((unsigned short) s->a));
+ Con_Print(PRVM_GlobalString((unsigned short) s->a));
if (s->b)
- Con_Printf ("%s", PRVM_GlobalString((unsigned short) s->b));
+ Con_Print(PRVM_GlobalString((unsigned short) s->b));
if (s->c)
- Con_Printf ("%s", PRVM_GlobalStringNoContents((unsigned short) s->c));
+ Con_Print(PRVM_GlobalStringNoContents((unsigned short) s->c));
}
- Con_Printf ("\n");
+ Con_Print("\n");
}
/*
f = prog->stack[i].f;
if (!f)
- Con_Printf ("<NULL FUNCTION>\n");
+ Con_Print("<NULL FUNCTION>\n");
else
- Con_Printf ("%12s : %s : statement %i\n", PRVM_GetString(f->s_file), PRVM_GetString(f->s_name), prog->stack[i].s - f->first_statement);
+ Con_Printf("%12s : %s : statement %i\n", PRVM_GetString(f->s_file), PRVM_GetString(f->s_name), prog->stack[i].s - f->first_statement);
}
}
// howmany = atoi(Cmd_Argv(1));
if(Cmd_Argc() != 2)
{
- Con_Printf("prvm_profile <program name>\n");
+ Con_Print("prvm_profile <program name>\n");
return;
}
if (best)
{
//if (num < howmany)
- Con_Printf ("%s: %7i %7i %s\n", PRVM_NAME, best->profile, best->builtinsprofile, PRVM_GetString(best->s_name));
+ Con_Printf("%s: %7i %7i %s\n", PRVM_NAME, best->profile, best->builtinsprofile, PRVM_GetString(best->s_name));
num++;
best->profile = 0;
best->builtinsprofile = 0;
PRVM_PrintStatement (prog->statements + prog->xstatement + i);
}
else
- Con_Printf("null function executing??\n");
+ Con_Print("null function executing??\n");
PRVM_StackTrace ();
}
if (!fnum || fnum >= prog->progs->numfunctions)
{
if (prog->self && PRVM_G_INT(prog->self->ofs))
- PRVM_ED_Print (PRVM_PROG_TO_EDICT(PRVM_G_INT(prog->self->ofs)));
+ PRVM_ED_Print(PRVM_PROG_TO_EDICT(PRVM_G_INT(prog->self->ofs)));
PRVM_ERROR ("PR_ExecuteProgram: %s", errormessage);
}
if (r->frame1 >= numframes)
{
- Con_DPrintf ("CL_LerpAnimation: no such frame %d\n", r->frame1);
+ Con_DPrintf("CL_LerpAnimation: no such frame %d\n", r->frame1);
r->frame1 = 0;
}
if (r->frame2 >= numframes)
{
- Con_DPrintf ("CL_LerpAnimation: no such frame %d\n", r->frame2);
+ Con_DPrintf("CL_LerpAnimation: no such frame %d\n", r->frame2);
r->frame2 = 0;
}
void R_Modules_Restart(void)
{
- Con_Printf("restarting renderer\n");
+ Con_Print("restarting renderer\n");
R_Modules_Shutdown();
R_Modules_Start();
}
for (j = 0;j < 3;j++)
for (i = 0;i < 6;i++)
Con_Printf("%s\"%s%s.tga\"", j + i > 0 ? ", " : "", basename, suffix[j][i].suffix);
- Con_Printf(" and was unable to find any of them.\n");
+ Con_Print(" and was unable to find any of them.\n");
}
return cubemaptexture;
}
if (radius < 15 || DotProduct(color, color) < 0.03)
{
- Con_Printf("R_Shadow_NewWorldLight: refusing to create a light too small/dim\n");
+ Con_Print("R_Shadow_NewWorldLight: refusing to create a light too small/dim\n");
return;
}
float origin[3], radius, color[3], angles[3], corona;
if (cl.worldmodel == NULL)
{
- Con_Printf("No map loaded.\n");
+ Con_Print("No map loaded.\n");
return;
}
FS_StripExtension (cl.worldmodel->name, name, sizeof (name));
return;
if (cl.worldmodel == NULL)
{
- Con_Printf("No map loaded.\n");
+ Con_Print("No map loaded.\n");
return;
}
FS_StripExtension (cl.worldmodel->name, name, sizeof (name));
float origin[3], radius, color[3], subtract, spotdir[3], spotcone, falloff, distbias;
if (cl.worldmodel == NULL)
{
- Con_Printf("No map loaded.\n");
+ Con_Print("No map loaded.\n");
return;
}
FS_StripExtension (cl.worldmodel->name, name, sizeof (name));
if (cl.worldmodel == NULL)
{
- Con_Printf("No map loaded.\n");
+ Con_Print("No map loaded.\n");
return;
}
data = cl.worldmodel->brush.entities;
vec3_t color;
if (!r_editlights.integer)
{
- Con_Printf("Cannot spawn light when not in editing mode. Set r_editlights to 1.\n");
+ Con_Print("Cannot spawn light when not in editing mode. Set r_editlights to 1.\n");
return;
}
if (Cmd_Argc() != 1)
{
- Con_Printf("r_editlights_spawn does not take parameters\n");
+ Con_Print("r_editlights_spawn does not take parameters\n");
return;
}
color[0] = color[1] = color[2] = 1;
char cubemapname[1024];
if (!r_editlights.integer)
{
- Con_Printf("Cannot spawn light when not in editing mode. Set r_editlights to 1.\n");
+ Con_Print("Cannot spawn light when not in editing mode. Set r_editlights to 1.\n");
return;
}
if (!r_shadow_selectedlight)
{
- Con_Printf("No selected light.\n");
+ Con_Print("No selected light.\n");
return;
}
VectorCopy(r_shadow_selectedlight->origin, origin);
}
else
{
- Con_Printf("usage: r_editlights_edit [property] [value]\n");
- Con_Printf("Selected light's properties:\n");
+ Con_Print("usage: r_editlights_edit [property] [value]\n");
+ Con_Print("Selected light's properties:\n");
Con_Printf("Origin : %f %f %f\n", r_shadow_selectedlight->origin[0], r_shadow_selectedlight->origin[1], r_shadow_selectedlight->origin[2]);
Con_Printf("Angles : %f %f %f\n", r_shadow_selectedlight->angles[0], r_shadow_selectedlight->angles[1], r_shadow_selectedlight->angles[2]);
Con_Printf("Color : %f %f %f\n", r_shadow_selectedlight->color[0], r_shadow_selectedlight->color[1], r_shadow_selectedlight->color[2]);
{
if (!r_editlights.integer)
{
- Con_Printf("Cannot spawn light when not in editing mode. Set r_editlights to 1.\n");
+ Con_Print("Cannot spawn light when not in editing mode. Set r_editlights to 1.\n");
return;
}
if (!r_shadow_selectedlight)
{
- Con_Printf("No selected light.\n");
+ Con_Print("No selected light.\n");
return;
}
R_Shadow_NewWorldLight(r_shadow_selectedlight->origin, r_shadow_selectedlight->angles, r_shadow_selectedlight->color, r_shadow_selectedlight->radius, r_shadow_selectedlight->corona, r_shadow_selectedlight->style, !r_shadow_selectedlight->shadow, r_shadow_selectedlight->cubemapname);
{
if (!r_editlights.integer)
{
- Con_Printf("Cannot spawn light when not in editing mode. Set r_editlights to 1.\n");
+ Con_Print("Cannot spawn light when not in editing mode. Set r_editlights to 1.\n");
return;
}
if (!r_shadow_selectedlight)
{
- Con_Printf("No selected light.\n");
+ Con_Print("No selected light.\n");
return;
}
R_Shadow_NewWorldLight(r_shadow_selectedlight->origin, r_shadow_selectedlight->angles, r_shadow_selectedlight->color, r_shadow_selectedlight->radius, !r_shadow_selectedlight->corona, r_shadow_selectedlight->style, r_shadow_selectedlight->shadow, r_shadow_selectedlight->cubemapname);
{
if (!r_editlights.integer)
{
- Con_Printf("Cannot remove light when not in editing mode. Set r_editlights to 1.\n");
+ Con_Print("Cannot remove light when not in editing mode. Set r_editlights to 1.\n");
return;
}
if (!r_shadow_selectedlight)
{
- Con_Printf("No selected light.\n");
+ Con_Print("No selected light.\n");
return;
}
R_Shadow_FreeWorldLight(r_shadow_selectedlight);
void R_Shadow_EditLights_Help_f(void)
{
- Con_Printf(
+ Con_Print(
"Documentation on r_editlights system:\n"
"Settings:\n"
"r_editlights : enable/disable editing mode\n"
if (strlen(sky) > 1000)
{
- Con_Printf ("sky name too long (%i, max is 1000)\n", strlen(sky));
+ Con_Printf("sky name too long (%i, max is 1000)\n", strlen(sky));
return false;
}
if (skyname[0])
Con_Printf("current sky: %s\n", skyname);
else
- Con_Printf("no skybox has been set\n");
+ Con_Print("no skybox has been set\n");
break;
case 2:
if (R_SetSkyBox(Cmd_Argv(1)))
if (skyname[0])
Con_Printf("skybox set to %s\n", skyname);
else
- Con_Printf("skybox disabled\n");
+ Con_Print("skybox disabled\n");
}
else
Con_Printf("failed to load skybox %s\n", Cmd_Argv(1));
break;
default:
- Con_Printf("usage: loadsky skyname\n");
+ Con_Print("usage: loadsky skyname\n");
break;
}
}
void CL_Screen_Init (void);
void CL_UpdateScreen (void);
-void SCR_CenterPrint (char *str);
+void SCR_CenterPrint(char *str);
void SCR_BeginLoadingPlaque (void);
void SV_ClientThink (void);
-void SV_ClientPrintf (const char *fmt, ...);
-void SV_BroadcastPrintf (const char *fmt, ...);
+void SV_ClientPrint(const char *msg);
+void SV_ClientPrintf(const char *fmt, ...);
+void SV_BroadcastPrint(const char *msg);
+void SV_BroadcastPrintf(const char *fmt, ...);
void SV_Physics (void);
mask = snd_cards_mask();
if (!mask) {
- Con_Printf("No sound cards detected\n");
+ Con_Print("No sound cards detected\n");
return 0;
}
if ((i=COM_CheckParm("-sndcard"))!=0) {
rate=11025;
frag_size=128; /* assuming stereo 8 bit */
} else {
- Con_Printf("ALSA: desired rates not supported\n");
+ Con_Print("ALSA: desired rates not supported\n");
goto error_2;
}
if ((format==-1 || format==SND_PCM_SFMT_S16_LE) && cinfo.formats & SND_PCM_FMT_S16_LE) {
format=SND_PCM_SFMT_U8;
bps=8;
} else {
- Con_Printf("ALSA: desired formats not supported\n");
+ Con_Print("ALSA: desired formats not supported\n");
goto error_2;
}
if (stereo && cinfo.max_voices>=2) {
frag_size = 64; /* assuming stereo 8 bit */
rate = 11025;
} else {
- Con_Printf("ALSA: no useable rates\n");
+ Con_Print("ALSA: no useable rates\n");
goto error;
}
break;
}
/* Fall through */
default:
- Con_Printf("ALSA: desired rate not supported\n");
+ Con_Print("ALSA: desired rate not supported\n");
goto error;
}
} else if (snd_pcm_hw_params_set_format(pcm, hw, SND_PCM_FORMAT_U8) >= 0) {
bps = 8;
} else {
- Con_Printf("ALSA: no useable formats\n");
+ Con_Print("ALSA: no useable formats\n");
goto error;
}
break;
}
/* Fall through */
default:
- Con_Printf("ALSA: desired format not supported\n");
+ Con_Print("ALSA: desired format not supported\n");
goto error;
}
if (snd_pcm_hw_params_set_access(pcm, hw,
SND_PCM_ACCESS_MMAP_INTERLEAVED) < 0) {
- Con_Printf("ALSA: interleaved is not supported\n");
+ Con_Print("ALSA: interleaved is not supported\n");
goto error;
}
} else if (snd_pcm_hw_params_set_channels(pcm, hw, 1) >= 0) {
stereo = 0;
} else {
- Con_Printf("ALSA: no useable channels\n");
+ Con_Print("ALSA: no useable channels\n");
goto error;
}
break;
break;
/* Fall through */
default:
- Con_Printf("ALSA: desired channels not supported\n");
+ Con_Print("ALSA: desired channels not supported\n");
goto error;
}
err = snd_pcm_hw_params(pcm, hw);
if (err < 0) {
- Con_Printf("ALSA: unable to install hw params\n");
+ Con_Print("ALSA: unable to install hw params\n");
goto error;
}
err = snd_pcm_sw_params(pcm, sw);
if (err < 0) {
- Con_Printf("ALSA: unable to install sw params\n");
+ Con_Print("ALSA: unable to install sw params\n");
goto error;
}
audio_fd = open (snddev, O_WRONLY | O_NDELAY | O_NONBLOCK);
if (audio_fd < 0)
{
- Con_Printf ("Can't open the sound device (%s)\n", snddev);
+ Con_Printf("Can't open the sound device (%s)\n", snddev);
return false;
}
}
if (i == sizeof (tryrates) / sizeof (tryrates[0]))
{
- Con_Printf ("Can't select an appropriate sound output format\n");
+ Con_Print("Can't select an appropriate sound output format\n");
close (audio_fd);
return false;
}
// Print some information
- Con_Printf ("%d bit %s sound initialized (rate: %dHz)\n",
+ Con_Printf("%d bit %s sound initialized (rate: %dHz)\n",
info.play.precision,
(info.play.channels == 2) ? "stereo" : "mono",
info.play.sample_rate);
if (ioctl (audio_fd, AUDIO_GETINFO, &info) < 0)
{
- Con_Printf ("Error: can't get audio info\n");
+ Con_Print("Error: can't get audio info\n");
SNDDMA_Shutdown ();
return 0;
}
}
if (write (audio_fd, writebuf, bytes) < bytes)
- Con_Printf ("audio can't keep up!\n");
+ Con_Print("audio can't keep up!\n");
wbufp = stop;
}
{
if (!sound_started || !shm)
{
- Con_Printf ("sound system not started\n");
+ Con_Print("sound system not started\n");
return;
}
{
if (!SNDDMA_Init())
{
- Con_Printf("S_Startup: SNDDMA_Init failed.\n");
+ Con_Print("S_Startup: SNDDMA_Init failed.\n");
sound_started = 0;
shm = NULL;
return;
*/
void S_Init(void)
{
- Con_DPrintf("\nSound Initialization\n");
+ Con_DPrint("\nSound Initialization\n");
S_RawSamples_ClearQueue();
sfx = &known_sfx[num_sfx++];
memset(sfx, 0, sizeof(*sfx));
- snprintf(sfx->name, sizeof(sfx->name), "%s", name);
+ strncpy(sfx->name, name, sizeof(sfx->name));
return sfx;
}
{
if (hresult != DSERR_BUFFERLOST)
{
- Con_Printf ("S_ClearBuffer: DS::Lock Sound Buffer Failed\n");
+ Con_Print("S_ClearBuffer: DS::Lock Sound Buffer Failed\n");
S_Shutdown ();
return;
}
if (++reps > 10000)
{
- Con_Printf ("S_ClearBuffer: DS: couldn't restore buffer\n");
+ Con_Print("S_ClearBuffer: DS: couldn't restore buffer\n");
S_Shutdown ();
return;
}
if (total_channels == MAX_CHANNELS)
{
- Con_Printf ("total_channels == MAX_CHANNELS\n");
+ Con_Print("total_channels == MAX_CHANNELS\n");
return;
}
if (ch->sfx && (ch->leftvol || ch->rightvol) )
total++;
- Con_Printf ("----(%i)----\n", total);
+ Con_Printf("----(%i)----\n", total);
}
// mix some sound
if (pDSBuf)
{
if (pDSBuf->lpVtbl->GetStatus (pDSBuf, &dwStatus) != DS_OK)
- Con_Printf ("Couldn't get sound buffer status\n");
+ Con_Print("Couldn't get sound buffer status\n");
if (dwStatus & DSBSTATUS_BUFFERLOST)
pDSBuf->lpVtbl->Restore (pDSBuf);
sfx = S_PrecacheSound (sound, true);
if (!sfx)
{
- Con_Printf ("S_LocalSound: can't precache %s\n", sound);
+ Con_Printf("S_LocalSound: can't precache %s\n", sound);
return;
}
S_StartSound (cl.viewentity, -1, sfx, vec3_origin, 1, 1);
{
if (modified_name)
strcpy (namebuffer + len - 3, "wav");
- Con_Printf ("Couldn't load %s\n", namebuffer);
+ Con_Printf("Couldn't load %s\n", namebuffer);
}
return NULL;
}
memcpy (str, data_p, 4);
data_p += 4;
iff_chunk_len = GetLittleLong();
- Con_Printf ("0x%x : %s (%d)\n", (int)(data_p - 4), str, iff_chunk_len);
+ Con_Printf("0x%x : %s (%d)\n", (int)(data_p - 4), str, iff_chunk_len);
data_p += (iff_chunk_len + 1) & ~1;
} while (data_p < iff_end);
}
FindChunk("RIFF");
if (!(data_p && !strncmp(data_p+8, "WAVE", 4)))
{
- Con_Printf("Missing RIFF/WAVE chunks\n");
+ Con_Print("Missing RIFF/WAVE chunks\n");
return info;
}
FindChunk("fmt ");
if (!data_p)
{
- Con_Printf("Missing fmt chunk\n");
+ Con_Print("Missing fmt chunk\n");
return info;
}
data_p += 8;
format = GetLittleShort();
if (format != 1)
{
- Con_Printf("Microsoft PCM format only\n");
+ Con_Print("Microsoft PCM format only\n");
return info;
}
FindChunk("data");
if (!data_p)
{
- Con_Printf("Missing data chunk\n");
+ Con_Print("Missing data chunk\n");
return info;
}
if (fwrite(out, 4, length, cl_avidemo_soundfile) < length)
{
Cvar_SetValueQuick(&cl_avidemo, 0);
- Con_Printf("avi saving sound failed, out of disk space? stopping avi demo capture.\n");
+ Con_Print("avi saving sound failed, out of disk space? stopping avi demo capture.\n");
}
}
else if (cl_avidemo_soundfile)
if (audio_fd < 0)
{
perror("/dev/dsp");
- Con_Printf("Could not open /dev/dsp\n");
+ Con_Print("Could not open /dev/dsp\n");
return 0;
}
if (ioctl(audio_fd, SNDCTL_DSP_RESET, 0) < 0)
{
perror("/dev/dsp");
- Con_Printf("Could not reset /dev/dsp\n");
+ Con_Print("Could not reset /dev/dsp\n");
close(audio_fd);
return 0;
}
if (ioctl(audio_fd, SNDCTL_DSP_GETCAPS, &caps)==-1)
{
perror("/dev/dsp");
- Con_Printf("Sound driver too old\n");
+ Con_Print("Sound driver too old\n");
close(audio_fd);
return 0;
}
if (!(caps & DSP_CAP_TRIGGER) || !(caps & DSP_CAP_MMAP))
{
- Con_Printf("Sorry but your soundcard can't do this\n");
+ Con_Print("Sorry but your soundcard can't do this\n");
close(audio_fd);
return 0;
}
if (ioctl(audio_fd, SNDCTL_DSP_GETOSPACE, &info)==-1)
{
perror("GETOSPACE");
- Con_Printf("Um, can't do GETOSPACE?\n");
+ Con_Print("Um, can't do GETOSPACE?\n");
close(audio_fd);
return 0;
}
if (!shm->buffer || shm->buffer == (unsigned char *)-1)
{
perror("/dev/dsp");
- Con_Printf("Could not mmap /dev/dsp\n");
+ Con_Print("Could not mmap /dev/dsp\n");
close(audio_fd);
return 0;
}
if (rc < 0)
{
perror("/dev/dsp");
- Con_Printf("Could not set /dev/dsp to stereo=%d", shm->channels);
+ Con_Printf("Could not set /dev/dsp to stereo=%d\n", shm->channels);
close(audio_fd);
return 0;
}
if (rc < 0)
{
perror("/dev/dsp");
- Con_Printf("Could not set /dev/dsp speed to %d", shm->speed);
+ Con_Printf("Could not set /dev/dsp speed to %d\n", shm->speed);
close(audio_fd);
return 0;
}
if (rc < 0)
{
perror("/dev/dsp");
- Con_Printf("Could not support 16-bit data. Try 8-bit.\n");
+ Con_Print("Could not support 16-bit data. Try 8-bit.\n");
close(audio_fd);
return 0;
}
if (rc < 0)
{
perror("/dev/dsp");
- Con_Printf("Could not support 8-bit data.\n");
+ Con_Print("Could not support 8-bit data.\n");
close(audio_fd);
return 0;
}
else
{
perror("/dev/dsp");
- Con_Printf("%d-bit sound not supported.", shm->samplebits);
+ Con_Printf("%d-bit sound not supported.\n", shm->samplebits);
close(audio_fd);
return 0;
}
if (rc < 0)
{
perror("/dev/dsp");
- Con_Printf("Could not toggle.\n");
+ Con_Print("Could not toggle.\n");
close(audio_fd);
return 0;
}
if (rc < 0)
{
perror("/dev/dsp");
- Con_Printf("Could not toggle.\n");
+ Con_Print("Could not toggle.\n");
close(audio_fd);
return 0;
}
if (ioctl(audio_fd, SNDCTL_DSP_GETOPTR, &count)==-1)
{
perror("/dev/dsp");
- Con_Printf("Uh, sound dead.\n");
+ Con_Print("Uh, sound dead.\n");
close(audio_fd);
snd_inited = 0;
return 0;
if (hInstDS == NULL)
{
- Con_SafePrintf ("Couldn't load dsound.dll\n");
+ Con_SafePrint("Couldn't load dsound.dll\n");
return SIS_FAILURE;
}
if (!pDirectSoundCreate)
{
- Con_SafePrintf ("Couldn't get DS proc addr\n");
+ Con_SafePrint("Couldn't get DS proc addr\n");
return SIS_FAILURE;
}
}
{
if (hresult != DSERR_ALLOCATED)
{
- Con_SafePrintf ("DirectSound create failed\n");
+ Con_SafePrint("DirectSound create failed\n");
return SIS_FAILURE;
}
"Sound not available",
MB_RETRYCANCEL | MB_SETFOREGROUND | MB_ICONEXCLAMATION) != IDRETRY)
{
- Con_SafePrintf ("DirectSoundCreate failure\n"
- " hardware already in use\n");
+ Con_SafePrint("DirectSoundCreate failure\n hardware already in use\n");
return SIS_NOTAVAIL;
}
}
if (DS_OK != pDS->lpVtbl->GetCaps (pDS, &dscaps))
{
- Con_SafePrintf ("Couldn't get DS caps\n");
+ Con_SafePrint("Couldn't get DS caps\n");
}
if (dscaps.dwFlags & DSCAPS_EMULDRIVER)
{
- Con_SafePrintf ("No DirectSound driver installed\n");
+ Con_SafePrint("No DirectSound driver installed\n");
FreeSound ();
return SIS_FAILURE;
}
if (DS_OK != pDS->lpVtbl->SetCooperativeLevel (pDS, mainwindow, DSSCL_EXCLUSIVE))
{
- Con_SafePrintf ("Set coop level failed\n");
+ Con_SafePrint("Set coop level failed\n");
FreeSound ();
return SIS_FAILURE;
}
if (DS_OK != pDSPBuf->lpVtbl->SetFormat (pDSPBuf, &pformat))
{
if (snd_firsttime)
- Con_SafePrintf ("Set primary sound buffer format: no\n");
+ Con_SafePrint("Set primary sound buffer format: no\n");
}
else
{
if (snd_firsttime)
- Con_SafePrintf ("Set primary sound buffer format: yes\n");
+ Con_SafePrint("Set primary sound buffer format: yes\n");
primary_format_set = true;
}
if (DS_OK != pDS->lpVtbl->CreateSoundBuffer(pDS, &dsbuf, &pDSBuf, NULL))
{
- Con_SafePrintf ("DS:CreateSoundBuffer Failed");
+ Con_SafePrint("DS:CreateSoundBuffer Failed\n");
FreeSound ();
return SIS_FAILURE;
}
if (DS_OK != pDSBuf->lpVtbl->GetCaps (pDSBuf, &dsbcaps))
{
- Con_SafePrintf ("DS:GetCaps failed\n");
+ Con_SafePrint("DS:GetCaps failed\n");
FreeSound ();
return SIS_FAILURE;
}
if (snd_firsttime)
- Con_SafePrintf ("Using secondary sound buffer\n");
+ Con_SafePrint("Using secondary sound buffer\n");
}
else
{
if (DS_OK != pDS->lpVtbl->SetCooperativeLevel (pDS, mainwindow, DSSCL_WRITEPRIMARY))
{
- Con_SafePrintf ("Set coop level failed\n");
+ Con_SafePrint("Set coop level failed\n");
FreeSound ();
return SIS_FAILURE;
}
if (DS_OK != pDSPBuf->lpVtbl->GetCaps (pDSPBuf, &dsbcaps))
{
- Con_Printf ("DS:GetCaps failed\n");
+ Con_Print("DS:GetCaps failed\n");
return SIS_FAILURE;
}
pDSBuf = pDSPBuf;
- Con_SafePrintf ("Using primary sound buffer\n");
+ Con_SafePrint("Using primary sound buffer\n");
}
// Make sure mixer is active
{
if (hresult != DSERR_BUFFERLOST)
{
- Con_SafePrintf ("SNDDMA_InitDirect: DS::Lock Sound Buffer Failed\n");
+ Con_SafePrint("SNDDMA_InitDirect: DS::Lock Sound Buffer Failed\n");
FreeSound ();
return SIS_FAILURE;
}
if (++reps > 10000)
{
- Con_SafePrintf ("SNDDMA_InitDirect: DS: couldn't restore buffer\n");
+ Con_SafePrint("SNDDMA_InitDirect: DS: couldn't restore buffer\n");
FreeSound ();
return SIS_FAILURE;
}
{
if (hr != MMSYSERR_ALLOCATED)
{
- Con_SafePrintf ("waveOutOpen failed\n");
+ Con_SafePrint("waveOutOpen failed\n");
return false;
}
"Sound not available",
MB_RETRYCANCEL | MB_SETFOREGROUND | MB_ICONEXCLAMATION) != IDRETRY)
{
- Con_SafePrintf ("waveOutOpen failure;\n"
- " hardware already in use\n");
+ Con_SafePrint("waveOutOpen failure;\n hardware already in use\n");
return false;
}
}
hData = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, gSndBufSize);
if (!hData)
{
- Con_SafePrintf ("Sound: Out of memory.\n");
+ Con_SafePrint("Sound: Out of memory.\n");
FreeSound ();
return false;
}
lpData = GlobalLock(hData);
if (!lpData)
{
- Con_SafePrintf ("Sound: Failed to lock.\n");
+ Con_SafePrint("Sound: Failed to lock.\n");
FreeSound ();
return false;
}
if (hWaveHdr == NULL)
{
- Con_SafePrintf ("Sound: Failed to Alloc header.\n");
+ Con_SafePrint("Sound: Failed to Alloc header.\n");
FreeSound ();
return false;
}
if (lpWaveHdr == NULL)
{
- Con_SafePrintf ("Sound: Failed to lock header.\n");
+ Con_SafePrint("Sound: Failed to lock header.\n");
FreeSound ();
return false;
}
if (waveOutPrepareHeader(hWaveOut, lpWaveHdr+i, sizeof(WAVEHDR)) !=
MMSYSERR_NOERROR)
{
- Con_SafePrintf ("Sound: failed to prepare wave headers\n");
+ Con_SafePrint("Sound: failed to prepare wave headers\n");
FreeSound ();
return false;
}
snd_isdirect = true;
if (snd_firsttime)
- Con_SafePrintf ("DirectSound initialized\n");
+ Con_SafePrint("DirectSound initialized\n");
}
else
{
snd_isdirect = false;
- Con_SafePrintf ("DirectSound failed to init\n");
+ Con_SafePrint("DirectSound failed to init\n");
}
}
}
if (snd_iswave)
{
if (snd_firsttime)
- Con_SafePrintf ("Wave sound initialized\n");
+ Con_SafePrint("Wave sound initialized\n");
}
else
{
- Con_SafePrintf ("Wave sound failed to init\n");
+ Con_SafePrint("Wave sound failed to init\n");
}
}
}
{
if ( snd_completed == snd_sent )
{
- Con_DPrintf ("Sound overrun\n");
+ Con_DPrint("Sound overrun\n");
break;
}
if (wResult != MMSYSERR_NOERROR)
{
- Con_SafePrintf ("Failed to write block to device\n");
+ Con_SafePrint("Failed to write block to device\n");
FreeSound ();
return;
}
{
if (hresult != DSERR_BUFFERLOST)
{
- Con_Printf ("S_LockBuffer: DS::Lock Sound Buffer Failed\n");
+ Con_Print("S_LockBuffer: DS::Lock Sound Buffer Failed\n");
S_Shutdown ();
S_Startup ();
return NULL;
if (++reps > 10000)
{
- Con_Printf ("S_LockBuffer: DS: couldn't restore buffer\n");
+ Con_Print("S_LockBuffer: DS: couldn't restore buffer\n");
S_Shutdown ();
S_Startup ();
return NULL;
char basename[MAX_QPATH];
if (!sv.active || !sv.worldmodel)
{
- Con_Printf("Not running a server\n");
+ Con_Print("Not running a server\n");
return;
}
FS_StripExtension(sv.worldmodel->name, basename, sizeof(basename));
if ( sound_num == MAX_SOUNDS || !sv.sound_precache[sound_num] )
{
- Con_Printf ("SV_StartSound: %s not precached\n", sample);
+ Con_Printf("SV_StartSound: %s not precached\n", sample);
return;
}
if (msg->maxsize - msg->cursize < 32) // LordHavoc: increased check from 16 to 32
{
- Con_Printf ("packet overflow\n");
+ Con_Print("packet overflow\n");
// mark the rest of the entities so they can't be delta compressed against this frame
for (;e < sv.num_edicts;e++)
{
for (i = 0;i < MAX_ENTITY_HISTORY;i++)
if (d->commit[i].numentities)
Con_Printf(" %i", d->commit[i].framenum);
- Con_Printf(")\n");
+ Con_Print(")\n");
}
if (d->currententitynumber >= sv.max_edicts)
startnumber = 1;
Cvar_Set ("hostname", "UNNAMED");
scr_centertime_off = 0;
- Con_DPrintf ("SpawnServer: %s\n",server);
+ Con_DPrintf("SpawnServer: %s\n",server);
svs.changelevel_issued = false; // now safe to issue another
//
sv.worldmodel = Mod_ForName(sv.modelname, false, true, true);
if (!sv.worldmodel)
{
- Con_Printf ("Couldn't spawn server %s\n", sv.modelname);
+ Con_Printf("Couldn't spawn server %s\n", sv.modelname);
sv.active = false;
return;
}
if (host_client->netconnection)
SV_SendServerinfo(host_client);
- Con_DPrintf ("Server spawned.\n");
+ Con_DPrint("Server spawned.\n");
NetConn_Heartbeat (2);
}
continue;
if (SV_TestEntityPosition (check))
- Con_Printf ("entity in invalid position\n");
+ Con_Print("entity in invalid position\n");
}
}
{
if (IS_NAN(ent->v->velocity[i]))
{
- Con_Printf ("Got a NaN velocity on %s\n", PR_GetString(ent->v->classname));
+ Con_Printf("Got a NaN velocity on %s\n", PR_GetString(ent->v->classname));
ent->v->velocity[i] = 0;
}
if (IS_NAN(ent->v->origin[i]))
{
- Con_Printf ("Got a NaN origin on %s\n", PR_GetString(ent->v->classname));
+ Con_Printf("Got a NaN origin on %s\n", PR_GetString(ent->v->classname));
ent->v->origin[i] = 0;
}
}
Con_Printf("entity %i bump %i: velocity %f %f %f trace %f", ent - sv.edicts, bumpcount, ent->v->velocity[0], ent->v->velocity[1], ent->v->velocity[2], trace.fraction);
if (trace.fraction < 1)
Con_Printf(" : %f %f %f", trace.plane.normal[0], trace.plane.normal[1], trace.plane.normal[2]);
- Con_Printf("\n");
+ Con_Print("\n");
#endif
/*
VectorCopy (ent->v->oldorigin, ent->v->origin);
if (!SV_TestEntityPosition(ent))
{
- Con_DPrintf ("Unstuck.\n");
+ Con_DPrint("Unstuck.\n");
SV_LinkEdict (ent, true);
return;
}
ent->v->origin[2] = org[2] + z;
if (!SV_TestEntityPosition(ent))
{
- Con_DPrintf ("Unstuck.\n");
+ Con_DPrint("Unstuck.\n");
SV_LinkEdict (ent, true);
return;
}
}
VectorCopy (org, ent->v->origin);
- Con_DPrintf ("player is stuck.\n");
+ Con_DPrint("player is stuck.\n");
}
if (fabs(oldorg[1] - ent->v->origin[1]) > 4
|| fabs(oldorg[0] - ent->v->origin[0]) > 4)
{
- Con_DPrintf("TryUnstick - success.\n");
+ Con_DPrint("TryUnstick - success.\n");
return clip;
}
// still not moving
VectorClear (ent->v->velocity);
- Con_DPrintf("TryUnstick - failure.\n");
+ Con_DPrint("TryUnstick - failure.\n");
return 7;
}
if (msg_badread)
{
- Con_Printf ("SV_ReadClientMessage: badread\n");
+ Con_Print("SV_ReadClientMessage: badread\n");
SV_DropClient (false);
return;
}
switch (cmd)
{
default:
- Con_Printf ("SV_ReadClientMessage: unknown command char %i\n", cmd);
+ Con_Printf("SV_ReadClientMessage: unknown command char %i\n", cmd);
SV_DropClient (false);
return;
void Sys_Error (const char *error, ...);
// an error will cause the entire program to exit
-void Sys_Printf (const char *fmt, ...);
+void Sys_Print(const char *msg);
+void Sys_Printf(const char *fmt, ...);
// send text to the quake console (and possibly to terminal)
-void Sys_Print(const char *text);
+void Sys_PrintToTerminal(const char *text);
// (may) output text to terminal which launched program
void Sys_Quit (void);
exit (1);
}
-void Sys_Print(const char *text)
+void Sys_PrintToTerminal(const char *text)
{
printf("%s", text);
}
exit (1);
}
-void Sys_Print(const char *text)
+void Sys_PrintToTerminal(const char *text)
{
printf("%s", text);
}
};
-#define MAX_PRINT_MSG 16384
-void Sys_Printf (const char *fmt, ...)
-{
- va_list argptr;
- char start[MAX_PRINT_MSG]; // String we started with
- char stamp[MAX_PRINT_MSG]; // Time stamp
- char final[MAX_PRINT_MSG]; // String we print
-
- time_t mytime = 0;
- struct tm *local = NULL;
-
- unsigned char *p;
+#define MAXPRINTMSG 16384
- va_start (argptr, fmt);
- vsnprintf (start, sizeof(start), fmt, argptr);
- va_end (argptr);
+void Sys_Print(const char *msg)
+{
+ unsigned char *p;
+ // Time stamp
+ char stamp[128];
+ // String we print
+ char final[MAXPRINTMSG];
if (sys_nostdout)
return;
if (timestamps.integer)
{
- mytime = time (NULL);
- local = localtime (&mytime);
- strftime (stamp, sizeof (stamp), timeformat.string, local);
-
- snprintf (final, sizeof (final), "%s%s", stamp, start);
+ time_t mytime = time(NULL);
+ strftime(stamp, sizeof(stamp), timeformat.string, localtime(&mytime));
+ snprintf(final, sizeof(final), "%s%s", stamp, msg);
}
else
- snprintf (final, sizeof (final), "%s", start);
+ strncpy(final, msg, sizeof(final));
// LordHavoc: make sure the string is terminated
- final[MAX_PRINT_MSG - 1] = 0;
+ final[MAXPRINTMSG-1] = 0;
for (p = (unsigned char *) final;*p; p++)
*p = qfont_table[*p];
- Sys_Print(final);
+ Sys_PrintToTerminal(final);
+}
+
+void Sys_Printf(const char *fmt, ...)
+{
+ va_list argptr;
+ char msg[MAXPRINTMSG]; // String we started with
+
+ va_start(argptr,fmt);
+ vsnprintf(msg,sizeof(msg),fmt,argptr);
+ va_end(argptr);
+
+ Sys_Print(msg);
}
exit (0);
}
-void Sys_Print(const char *text)
+void Sys_PrintToTerminal(const char *text)
{
DWORD dummy;
extern HANDLE houtput;
if (!XF86DGAQueryVersion(vidx11_display, &MajorVersion, &MinorVersion))
{
// unable to query, probalby not supported
- Con_Printf( "Failed to detect XF86DGA Mouse\n" );
+ Con_Print( "Failed to detect XF86DGA Mouse\n" );
vid_dga.integer = 0;
}
else
if (!(vidx11_display = XOpenDisplay(NULL)))
{
- Con_Printf("Couldn't open the X display\n");
+ Con_Print("Couldn't open the X display\n");
return false;
}
visinfo = qglXChooseVisual(vidx11_display, vidx11_screen, attrib);
if (!visinfo)
{
- Con_Printf("Couldn't get an RGB, Double-buffered, Depth visual\n");
+ Con_Print("Couldn't get an RGB, Double-buffered, Depth visual\n");
return false;
}
drivername = com_argv[i + 1];
if (!SDL_GL_LoadLibrary(drivername))
{
- Con_Printf("Unable to load GL driver \"%s\"\n: ", drivername, SDL_GetError());
+ Con_Printf("Unable to load GL driver \"%s\": ", drivername, SDL_GetError());
return false;
}
if (qglGetString == NULL)
{
VID_Shutdown();
- Con_Printf("Required OpenGL function glGetString not found\n");
+ Con_Print("Required OpenGL function glGetString not found\n");
return false;
}
if (disableparm && (COM_CheckParm(disableparm) || COM_CheckParm("-safe")))
{
- Con_DPrintf("disabled by commandline\n");
+ Con_DPrint("disabled by commandline\n");
return false;
}
// delay the return so it prints all missing functions
if (failed)
return false;
- Con_DPrintf("enabled\n");
+ Con_DPrint("enabled\n");
return true;
}
else
{
- Con_DPrintf("not detected\n");
+ Con_DPrint("not detected\n");
return false;
}
}
if (!GL_CheckExtension("OpenGL 1.1.0", opengl110funcs, NULL, false))
Sys_Error("OpenGL 1.1.0 functions not found\n");
- Con_DPrintf ("GL_VENDOR: %s\n", gl_vendor);
- Con_DPrintf ("GL_RENDERER: %s\n", gl_renderer);
- Con_DPrintf ("GL_VERSION: %s\n", gl_version);
- Con_DPrintf ("GL_EXTENSIONS: %s\n", gl_extensions);
- Con_DPrintf ("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions);
+ Con_DPrintf("GL_VENDOR: %s\n", gl_vendor);
+ Con_DPrintf("GL_RENDERER: %s\n", gl_renderer);
+ Con_DPrintf("GL_VERSION: %s\n", gl_version);
+ Con_DPrintf("GL_EXTENSIONS: %s\n", gl_extensions);
+ Con_DPrintf("%s_EXTENSIONS: %s\n", gl_platform, gl_platformextensions);
- Con_DPrintf("Checking OpenGL extensions...\n");
+ Con_DPrint("Checking OpenGL extensions...\n");
if (!GL_CheckExtension("glDrawRangeElements", drawrangeelementsfuncs, "-nodrawrangeelements", true))
GL_CheckExtension("GL_EXT_draw_range_elements", drawrangeelementsextfuncs, "-nodrawrangeelements", false);
VID_Close();
if (!VID_Mode(vid_fullscreen.integer, vid_width.integer, vid_height.integer, vid_bitsperpixel.integer))
{
- Con_Printf("Video mode change failed\n");
+ Con_Print("Video mode change failed\n");
if (!VID_Mode(current_vid_fullscreen, current_vid_width, current_vid_height, current_vid_bitsperpixel))
Sys_Error("Unable to restore to last working video mode\n");
}
Cvar_SetQuick(&vid_bitsperpixel, com_argv[i+1]);
}
- Con_DPrintf("Starting video system\n");
+ Con_DPrint("Starting video system\n");
success = VID_Mode(vid_fullscreen.integer, vid_width.integer, vid_height.integer, vid_bitsperpixel.integer);
if (!success)
{
- Con_Printf("Desired video mode fail, trying fallbacks...\n");
+ Con_Print("Desired video mode fail, trying fallbacks...\n");
if (!success && vid_bitsperpixel.integer > 16)
success = VID_Mode(vid_fullscreen.integer, vid_width.integer, vid_height.integer, 16);
if (!success && (vid_width.integer > 640 || vid_height.integer > 480))
if (i & RC_PALETTE)
{
VID_Shutdown();
- Con_Printf ("Can't run in non-RGB mode\n");
+ Con_Print("Can't run in non-RGB mode\n");
return false;
}
if (bpp > depth)
{
VID_Shutdown();
- Con_Printf ("A higher desktop depth is required to run this video mode\n");
+ Con_Print("A higher desktop depth is required to run this video mode\n");
return false;
}
if (!GL_CheckExtension("wgl", wglfuncs, NULL, false))
{
VID_Shutdown();
- Con_Printf("wgl functions not found\n");
+ Con_Print("wgl functions not found\n");
return false;
}
if (!baseRC)
{
VID_Shutdown();
- Con_Printf("Could not initialize GL (wglCreateContext failed).\n\nMake sure you are in 65536 color mode, and try running -window.\n");
+ Con_Print("Could not initialize GL (wglCreateContext failed).\n\nMake sure you are in 65536 color mode, and try running -window.\n");
return false;
}
if (!qwglMakeCurrent(hdc, baseRC))
if (qglGetString == NULL)
{
VID_Shutdown();
- Con_Printf("glGetString not found\n");
+ Con_Print("glGetString not found\n");
return false;
}
gl_renderer = qglGetString(GL_RENDERER);
if (hInstDI == NULL)
{
- Con_SafePrintf ("Couldn't load dinput.dll\n");
+ Con_SafePrint("Couldn't load dinput.dll\n");
return false;
}
}
if (!pDirectInputCreate)
{
- Con_SafePrintf ("Couldn't get DI proc addr\n");
+ Con_SafePrint("Couldn't get DI proc addr\n");
return false;
}
}
if (FAILED(hr))
{
- Con_SafePrintf ("Couldn't open DI mouse device\n");
+ Con_SafePrint("Couldn't open DI mouse device\n");
return false;
}
if (FAILED(hr))
{
- Con_SafePrintf ("Couldn't set DI mouse format\n");
+ Con_SafePrint("Couldn't set DI mouse format\n");
return false;
}
if (FAILED(hr))
{
- Con_SafePrintf ("Couldn't set DI coop level\n");
+ Con_SafePrint("Couldn't set DI coop level\n");
return false;
}
if (FAILED(hr))
{
- Con_SafePrintf ("Couldn't set DI buffersize\n");
+ Con_SafePrint("Couldn't set DI buffersize\n");
return false;
}
if (dinput)
{
- Con_SafePrintf ("DirectInput initialized\n");
+ Con_SafePrint("DirectInput initialized\n");
}
else
{
- Con_SafePrintf ("DirectInput not initialized\n");
+ Con_SafePrint("DirectInput not initialized\n");
}
}
// verify joystick driver is present
if ((numdevs = joyGetNumDevs ()) == 0)
{
- Con_Printf ("\njoystick not found -- driver not present\n\n");
+ Con_Print("\njoystick not found -- driver not present\n\n");
return;
}
// abort startup if we didn't find a valid joystick
if (mmr != JOYERR_NOERROR)
{
- Con_Printf ("\njoystick not found -- no valid joysticks (%x)\n\n", mmr);
+ Con_Printf("\njoystick not found -- no valid joysticks (%x)\n\n", mmr);
return;
}
memset (&jc, 0, sizeof(jc));
if ((mmr = joyGetDevCaps (joy_id, &jc, sizeof(jc))) != JOYERR_NOERROR)
{
- Con_Printf ("\njoystick not found -- invalid joystick capabilities (%x)\n\n", mmr);
+ Con_Printf("\njoystick not found -- invalid joystick capabilities (%x)\n\n", mmr);
return;
}
joy_avail = true;
joy_advancedinit = false;
- Con_Printf ("\njoystick detected\n\n");
+ Con_Print("\njoystick detected\n\n");
}
if (strcmp (joy_name.string, "joystick") != 0)
{
// notify user of advanced controller
- Con_Printf ("\n%s configured\n\n", joy_name.string);
+ Con_Printf("\n%s configured\n\n", joy_name.string);
}
// advanced initialization here
if ((temp = FS_LoadFile ("gfx.wad", false)))
{
if (memcmp(temp, "WAD2", 4))
- Con_Printf("gfx.wad doesn't have WAD2 id\n");
+ Con_Print("gfx.wad doesn't have WAD2 id\n");
else
{
wad_mempool = Mem_AllocPool("gfx.wad");
if (!file)
{
if (complain)
- Con_Printf ("W_LoadTextureWadFile: couldn't find %s", filename);
+ Con_Printf("W_LoadTextureWadFile: couldn't find %s\n", filename);
return;
}
if (FS_Read(file, &header, sizeof(wadinfo_t)) != sizeof(wadinfo_t))
- {Con_Printf ("W_LoadTextureWadFile: unable to read wad header");return;}
+ {Con_Print("W_LoadTextureWadFile: unable to read wad header\n");return;}
if(memcmp(header.identification, "WAD3", 4))
- {Con_Printf ("W_LoadTextureWadFile: Wad file %s doesn't have WAD3 id\n",filename);return;}
+ {Con_Printf("W_LoadTextureWadFile: Wad file %s doesn't have WAD3 id\n",filename);return;}
numlumps = LittleLong(header.numlumps);
if (numlumps < 1 || numlumps > TEXWAD_MAXIMAGES)
- {Con_Printf ("W_LoadTextureWadFile: invalid number of lumps (%i)\n", numlumps);return;}
+ {Con_Printf("W_LoadTextureWadFile: invalid number of lumps (%i)\n", numlumps);return;}
infotableofs = LittleLong(header.infotableofs);
if (FS_Seek (file, infotableofs, SEEK_SET))
- {Con_Printf ("W_LoadTextureWadFile: unable to seek to lump table");return;}
+ {Con_Print("W_LoadTextureWadFile: unable to seek to lump table\n");return;}
if (!(lumps = Mem_Alloc(tempmempool, sizeof(lumpinfo_t)*numlumps)))
- {Con_Printf ("W_LoadTextureWadFile: unable to allocate temporary memory for lump table");return;}
+ {Con_Print("W_LoadTextureWadFile: unable to allocate temporary memory for lump table\n");return;}
if (FS_Read(file, lumps, sizeof(lumpinfo_t) * numlumps) != sizeof(lumpinfo_t) * (size_t)numlumps)
- {Con_Printf ("W_LoadTextureWadFile: unable to read lump table");return;}
+ {Con_Print("W_LoadTextureWadFile: unable to read lump table\n");return;}
for (i=0, lump_p = lumps ; i<numlumps ; i++,lump_p++)
{
{
file = texwadlump[i].file;
if (FS_Seek(file, texwadlump[i].position, SEEK_SET))
- {Con_Printf("W_GetTexture: corrupt WAD3 file");return NULL;}
+ {Con_Print("W_GetTexture: corrupt WAD3 file\n");return NULL;}
tex = Mem_Alloc(tempmempool, texwadlump[i].size);
if (!tex)
return NULL;
if (FS_Read(file, tex, texwadlump[i].size) < (size_t)texwadlump[i].size)
- {Con_Printf("W_GetTexture: corrupt WAD3 file");return NULL;}
+ {Con_Print("W_GetTexture: corrupt WAD3 file\n");return NULL;}
tex->width = LittleLong(tex->width);
tex->height = LittleLong(tex->height);
}
Con_Printf("%i memory pools, totalling %i bytes (%.3fMB)\n", count, size, size / 1048576.0);
if (tempmempool == NULL)
- Con_Printf("Error: no tempmempool allocated\n");
+ Con_Print("Error: no tempmempool allocated\n");
else if (tempmempool->chain)
{
Con_Printf("%i bytes (%.3fMB) of temporary memory still allocated (Leak!)\n", tempmempool->totalsize, tempmempool->totalsize / 1048576.0);
- Con_Printf("listing temporary memory allocations:\n");
+ Con_Print("listing temporary memory allocations:\n");
for (mem = tempmempool->chain;mem;mem = mem->next)
Con_Printf("%10i bytes allocated at %s:%i\n", mem->size, mem->filename, mem->fileline);
}
mempool_t *pool;
memheader_t *mem;
Mem_CheckSentinelsGlobal();
- Con_Printf("memory pool list:\n"
+ Con_Print("memory pool list:\n"
"size name\n");
for (pool = poolchain;pool;pool = pool->next)
{
}
// drop through
default:
- Con_Printf("MemList_f: unrecognized options\nusage: memlist [all]\n");
+ Con_Print("MemList_f: unrecognized options\nusage: memlist [all]\n");
break;
}
}