]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - console.c
added EF_DOUBLESIDED (and internally RENDER_NOCULLFACE)
[xonotic/darkplaces.git] / console.c
index b99f7c4b02b0f8a6dde2dba2959d7d873ec668fe..1bfe368558f1698a7b19dbd506dda70a4c277b23 100644 (file)
--- a/console.c
+++ b/console.c
@@ -66,7 +66,7 @@ cvar_t log_file = {0, "log_file",""};
 char crt_log_file [MAX_OSPATH] = "";
 qfile_t* logfile = NULL;
 
-qbyte* logqueue = NULL;
+unsigned char* logqueue = NULL;
 size_t logq_ind = 0;
 size_t logq_size = 0;
 
@@ -183,10 +183,10 @@ void Log_ConPrint (const char *msg)
                if (len > remain)
                {
                        size_t factor = ((logq_ind + len) / logq_size) + 1;
-                       qbyte* newqueue;
+                       unsigned char* newqueue;
 
                        logq_size *= factor;
-                       newqueue = Mem_Alloc (tempmempool, logq_size);
+                       newqueue = (unsigned char *)Mem_Alloc (tempmempool, logq_size);
                        memcpy (newqueue, logqueue, logq_ind);
                        Mem_Free (logqueue);
                        logqueue = newqueue;
@@ -368,8 +368,8 @@ void Con_Init (void)
        con_totallines = CON_TEXTSIZE / con_linewidth;
 
        // Allocate a log queue
-       logq_size = 512;
-       logqueue = Mem_Alloc (tempmempool, logq_size);
+       logq_size = MAX_INPUTLINE;
+       logqueue = (unsigned char *)Mem_Alloc (tempmempool, logq_size);
        logq_ind = 0;
 
        Cvar_RegisterVariable (&log_file);
@@ -535,14 +535,14 @@ void Con_Print(const char *msg)
 {
        int mask = 0;
        static int index = 0;
-       static char line[16384];
+       static char line[MAX_INPUTLINE];
 
        for (;*msg;msg++)
        {
                if (index == 0)
                {
                        // if this is the beginning of a new line, print timestamp
-                       char *timestamp = timestamps.integer ? Sys_TimeString(timeformat.string) : "";
+                       const char *timestamp = timestamps.integer ? Sys_TimeString(timeformat.string) : "";
                        // reset the color
                        // FIXME: 1. perhaps we should use a terminal system 2. use a constant instead of 7!
                        line[index++] = STRING_COLOR_TAG;
@@ -557,16 +557,16 @@ void Con_Print(const char *msg)
                                        // play talk wav
                                        S_LocalSound ("sound/misc/talk.wav");
                                }
-                               if (gamemode == GAME_NEXUIZ)
-                               {
-                                       line[index++] = '^';
+                               //if (gamemode == GAME_NEXUIZ)
+                               //{
+                                       line[index++] = STRING_COLOR_TAG;
                                        line[index++] = '3';
-                               }
-                               else
-                               {
-                                       // go to colored text
-                                       mask = 128;
-                               }
+                               //}
+                               //else
+                               //{
+                               //      // go to colored text
+                               //      mask = 128;
+                               //}
                                msg++;
                        }
                        // store timestamp
@@ -577,7 +577,7 @@ void Con_Print(const char *msg)
                // append the character
                line[index++] = *msg;
                // if this is a newline character, we have a complete line to print
-               if (*msg == '\n' || index >= 16000)
+               if (*msg == '\n' || index >= (int)sizeof(line) / 2)
                {
                        // terminate the line
                        line[index] = 0;
@@ -601,9 +601,6 @@ void Con_Print(const char *msg)
 }
 
 
-// LordHavoc: increased from 4096 to 16384
-#define        MAXPRINTMSG     16384
-
 /*
 ================
 Con_Printf
@@ -614,7 +611,7 @@ Prints to all appropriate console targets
 void Con_Printf(const char *fmt, ...)
 {
        va_list argptr;
-       char msg[MAXPRINTMSG];
+       char msg[MAX_INPUTLINE];
 
        va_start(argptr,fmt);
        dpvsnprintf(msg,sizeof(msg),fmt,argptr);
@@ -647,7 +644,7 @@ A Con_Printf that only shows up if the "developer" cvar is set
 void Con_DPrintf(const char *fmt, ...)
 {
        va_list argptr;
-       char msg[MAXPRINTMSG];
+       char msg[MAX_INPUTLINE];
 
        if (!developer.integer)
                return;                 // don't confuse non-developers with techie stuff...
@@ -681,7 +678,7 @@ void Con_DrawInput (void)
 {
        int             y;
        int             i;
-       char editlinecopy[257], *text;
+       char editlinecopy[MAX_INPUTLINE+1], *text;
 
        if (!key_consoleactive)
                return;         // don't draw anything
@@ -696,7 +693,7 @@ void Con_DrawInput (void)
        y = (int)strlen(text);
 
 // fill out remainder with spaces
-       for (i = y; i < 256; i++)
+       for (i = y; i < (int)sizeof(editlinecopy)-1; i++)
                text[i] = ' ';
 
        // add the cursor frame
@@ -730,8 +727,7 @@ void Con_DrawNotify (void)
        char    *text;
        int             i;
        float   time;
-       extern char chat_buffer[];
-       char    temptext[256];
+       char    temptext[MAX_INPUTLINE];
        int colorindex = -1; //-1 for default
 
        if (con_notify.integer < 0)
@@ -802,7 +798,6 @@ Draws the console with the solid background
 The typing input line at the bottom should only be drawn if typing is allowed
 ================
 */
-extern char engineversion[40];
 void Con_DrawConsole (int lines)
 {
        int i, y, rows, j;