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;
// If we need to enlarge the log queue
if (len > remain)
{
- unsigned int factor = ((logq_ind + len) / logq_size) + 1;
- qbyte* newqueue;
+ size_t factor = ((logq_ind + len) / logq_size) + 1;
+ 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;
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);
{
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;
// 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
for (;*timestamp;index++, timestamp++)
- if (index < sizeof(line) - 2)
+ if (index < (int)sizeof(line) - 2)
line[index] = *timestamp;
}
// 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;
}
-// LordHavoc: increased from 4096 to 16384
-#define MAXPRINTMSG 16384
-
/*
================
Con_Printf
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);
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...
{
int y;
int i;
- char editlinecopy[257], *text;
+ char editlinecopy[MAX_INPUTLINE+1], *text;
if (!key_consoleactive)
return; // don't draw anything
// use strlen of edit_line instead of key_linepos to allow editing
// of early characters w/o erasing
- y = strlen(text);
+ 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
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)
sprintf(temptext, "say_team:%s%c", chat_buffer, (int) 10+((int)(realtime*con_cursorspeed)&1));
else
sprintf(temptext, "say:%s%c", chat_buffer, (int) 10+((int)(realtime*con_cursorspeed)&1));
- while (strlen(temptext) >= (size_t) con_linewidth)
+ while ((int)strlen(temptext) >= con_linewidth)
{
DrawQ_ColoredString( 0, v, temptext, con_linewidth, 8, 8, 1.0, 1.0, 1.0, 1.0, 0, &colorindex );
strcpy(temptext, &temptext[con_linewidth]);
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;
const char **walk = list;
while (*walk) {
- len = strlen(*walk);
+ len = (int)strlen(*walk);
if (len > maxlen)
maxlen = len;
walk++;
maxlen += 1;
while (*list) {
- len = strlen(*list);
+ len = (int)strlen(*list);
if (pos + maxlen >= width) {
Con_Print("\n");
pos = 0;
else
list[0] = Cmd_CompleteAliasBuildList(s);
cmd = *list[0];
- cmd_len = strlen (cmd);
+ cmd_len = (int)strlen (cmd);
} else {
if (c)
cmd = *(list[0] = Cmd_CompleteBuildList(s));
if (a)
cmd = *(list[2] = Cmd_CompleteAliasBuildList(s));
- cmd_len = strlen (s);
+ cmd_len = (int)strlen (s);
do {
for (i = 0; i < 3; i++) {
char ch = cmd[cmd_len];