shithub: qk1

Download patch

ref: b8fdee42392c7a7692bb60483cc906dfa3acf62d
parent: 8bf29be70f8e1fcf8161d1339fa3996af7b08500
author: Konstantinn Bonnet <[email protected]>
date: Fri Feb 27 13:18:46 EST 2015

remove useless -condebug

wasn't working anyway, needed to create(2) file, or open(2) once with OTRUNC,...
shouldn't console.c be using Sys_* stuff anyway?

--- a/README
+++ b/README
@@ -42,6 +42,7 @@
 	- *printf -> *print was (mostly) stupid
 	- removed some of the command line parameters
 		. -winsize, -width, -height: just set the window dimensions with rio/rc
+		. -condebug: can just redirect with rc to same effect
 
 
 todo/issues
--- a/console.c
+++ b/console.c
@@ -25,8 +25,6 @@
 
 int			con_vislines;
 
-qboolean	con_debuglog;
-
 #define		MAXCMDLINE	256
 extern	char	key_lines[32][MAXCMDLINE];
 extern	int		edit_line;
@@ -186,21 +184,6 @@
 */
 void Con_Init (void)
 {
-#define MAXGAMEDIRLEN	1000
-	char	temp[MAXGAMEDIRLEN+1];
-	char	*t2 = "/qconsole.log";
-
-	con_debuglog = COM_CheckParm("-condebug");
-
-	if (con_debuglog)
-	{
-		if (strlen (com_gamedir) < (MAXGAMEDIRLEN - strlen (t2)))
-		{
-			sprint (temp, "%s%s", com_gamedir, t2);
-			remove (temp);
-		}
-	}
-
 	con_text = Hunk_AllocName (CON_TEXTSIZE, "context");
 	Q_memset (con_text, ' ', CON_TEXTSIZE);
 	con_linewidth = -1;
@@ -322,27 +305,6 @@
 
 /*
 ================
-Con_DebugLog
-================
-*/
-void Con_DebugLog(char *file, char *fmt, ...)
-{
-    va_list argptr; 
-    static char data[1024];
-    int fd;
-    
-    va_start(argptr, fmt);
-    vseprint(data, data+sizeof(data), fmt, argptr);
-    va_end(argptr);
-    /*fd = open(file, OWRITE | O_WRONLY | O_CREAT | O_APPEND, 0666);*/
-    fd = open(file, OWRITE);
-    write(fd, data, strlen(data));
-    close(fd);
-}
-
-
-/*
-================
 Con_Printf
 
 Handles cursor positioning, line wrapping, etc
@@ -362,10 +324,6 @@
 	
 // also echo to debugging console
 	Sys_Printf ("%s", msg);	// also echo to debugging console
-
-// log all messages to file
-	if (con_debuglog)
-		Con_DebugLog(va("%s/qconsole.log",com_gamedir), "%s", msg);
 
 	if (!con_initialized)
 		return;