]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Sys_Print added to handle the output of text to the terminal (since this varies from...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 25 May 2003 16:17:37 +0000 (16:17 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 25 May 2003 16:17:37 +0000 (16:17 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3032 d7cf8633-e32d-0410-b094-e92efae38249

sys.h
sys_linux.c
sys_shared.c
sys_win.c

diff --git a/sys.h b/sys.h
index 91eeb2c03fb6c830ebe27e750cb2a850a3a872e5..6b38df3ebd361e1eb395e5400acf25f783f2b8d8 100644 (file)
--- a/sys.h
+++ b/sys.h
@@ -8,7 +8,7 @@ of the License, or (at your option) any later version.
 
 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 See the GNU General Public License for more details.
 
@@ -56,7 +56,10 @@ void Sys_Error (const char *error, ...);
 // an error will cause the entire program to exit
 
 void Sys_Printf (const char *fmt, ...);
-// send text to the console
+// send text to the quake console (and possibly to terminal)
+
+void Sys_Print(const char *text);
+// (may) output text to terminal which launched program
 
 void Sys_Quit (void);
 
index 148f540bb91e2f4bc5cf4c02b4f1b0eb028d9790..e63d6a7a8df3db2305e2b241cdfefcf5bd3e7d7c 100644 (file)
@@ -84,7 +84,11 @@ void Sys_Error (const char *error, ...)
 
        Host_Shutdown ();
        exit (1);
+}
 
+void Sys_Print(const char *text)
+{
+       printf("%s", text);
 }
 
 double Sys_DoubleTime (void)
index ddd831e2ecfa07a1791c2280e5e1839fe154ed8d..3d666e922ae258c5772a61b29e5e665689abd179 100644 (file)
@@ -48,9 +48,6 @@ static char qfont_table[256] = {
        'x',  'y',  'z',  '{',  '|',  '}',  '~',  '<'
 };
 
-//#ifdef WIN32
-//extern HANDLE houtput;
-//#endif
 
 #define MAX_PRINT_MSG  16384
 void Sys_Printf (const char *fmt, ...)
@@ -64,9 +61,6 @@ void Sys_Printf (const char *fmt, ...)
        struct tm       *local = NULL;
 
        unsigned char           *p;
-//#ifdef WIN32
-//     DWORD           dummy;
-//#endif
 
        va_start (argptr, fmt);
        vsnprintf (start, sizeof(start), fmt, argptr);
@@ -90,12 +84,7 @@ void Sys_Printf (const char *fmt, ...)
        final[MAX_PRINT_MSG - 1] = 0;
        for (p = (unsigned char *) final;*p; p++)
                *p = qfont_table[*p];
-//#ifdef WIN32
-//     if (cls.state == ca_dedicated)
-//             WriteFile(houtput, final, strlen (final), &dummy, NULL);
-//#else
-       printf("%s", final);
-//#endif
+       Sys_Print(final);
 }
 
 
index e23c8b3fee1bbc5aa64b744e98611e3195126d4b..ae3f7cd4aad5357772cff78e670515f44e38ea8e 100644 (file)
--- a/sys_win.c
+++ b/sys_win.c
@@ -132,6 +132,13 @@ void Sys_Quit (void)
        exit (0);
 }
 
+void Sys_Print(const char *text)
+{
+       DWORD dummy;
+       extern HANDLE houtput;
+       if (cls.state == ca_dedicated)
+               WriteFile(houtput, text, strlen (text), &dummy, NULL);
+}
 
 /*
 ================