]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - console.c
rewrote memory system entirely (hunk, cache, and zone are gone, memory pools replaced...
[xonotic/darkplaces.git] / console.c
index d7cb88fc219f1d97c065df3f98a399d650ecd93d..d8654f31b4e62e8b3cb5e102a5a890557330e817 100644 (file)
--- a/console.c
+++ b/console.c
@@ -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.
 
@@ -63,10 +63,12 @@ extern      char    key_lines[32][MAXCMDLINE];
 extern int             edit_line;
 extern int             key_linepos;
 extern int             key_insert;
-               
+
 
 qboolean       con_initialized;
 
+mempool_t      *console_mempool;
+
 int            con_notifylines;                // scan lines to clear for notify lines
 
 extern void M_Menu_Main_f (void);
@@ -160,7 +162,7 @@ void Con_CheckResize (void)
        int             i, j, width, oldwidth, oldtotallines, numlines, numchars;
        char    tbuf[CON_TEXTSIZE];
 
-       width = (vid.width >> 3) - 2;
+       width = (vid.conwidth >> 3) - 2;
 
        if (width == con_linewidth)
                return;
@@ -230,10 +232,11 @@ void Con_Init (void)
                        sprintf (temp, "%s%s", com_gamedir, t2);
                        unlink (temp);
                }
-               logfile.value = 1;
+               logfile.integer = 1;
        }
 
-       con_text = Hunk_AllocName (CON_TEXTSIZE, "context");
+       console_mempool = Mem_AllocPool("console");
+       con_text = Mem_Alloc(console_mempool, CON_TEXTSIZE);
        memset (con_text, ' ', CON_TEXTSIZE);
        con_linewidth = -1;
        Con_CheckResize ();
@@ -393,7 +396,7 @@ void Con_Printf (char *fmt, ...)
        va_end (argptr);
        
 // also echo to debugging console
-       Sys_Printf ("%s", msg); // also echo to debugging console
+       Sys_Printf ("%s", msg);
 
 // log all messages to file
        if (con_debuglog)
@@ -439,7 +442,7 @@ void Con_DPrintf (char *fmt, ...)
        va_list         argptr;
        char            msg[MAXPRINTMSG];
                
-       if (!developer.value)
+       if (!developer.integer)
                return;                 // don't confuse non-developers with techie stuff...
 
        va_start (argptr,fmt);
@@ -785,7 +788,6 @@ Con_CompleteCommandLine (void)
                        Con_Printf("%i possible aliases%s\n", a, (a > 1) ? "s: " : ":");
                        Con_DisplayList(list[2]);
                }
-               return;
        }
        
        if (cmd) {
@@ -799,6 +801,6 @@ Con_CompleteCommandLine (void)
        }
        for (i = 0; i < 3; i++)
                if (list[i])
-                       qfree (list[i]);
+                       Mem_Free(list[i]);
 }