X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=console.c;h=91a99be38819ee42d684b4ea5690c544e243eb54;hb=c4e92b9982882076e7b35e55fb43bd1a0dbd340d;hp=da0f18a184828ddb8f3df2c3698c76ccbc12b29a;hpb=6c5d4ab63ab0801ead42cd4a61559003050b6465;p=xonotic%2Fdarkplaces.git diff --git a/console.c b/console.c index da0f18a1..91a99be3 100644 --- a/console.c +++ b/console.c @@ -124,7 +124,7 @@ cvar_t log_file = {0, "log_file","", "filename to log messages to"}; cvar_t log_dest_udp = {0, "log_dest_udp","", "UDP address to log messages to (in QW rcon compatible format); multiple destinations can be separated by spaces; DO NOT SPECIFY DNS NAMES HERE"}; char log_dest_buffer[1400]; // UDP packet size_t log_dest_buffer_pos; -qboolean log_dest_buffer_appending; +unsigned int log_dest_buffer_appending; char crt_log_file [MAX_OSPATH] = ""; qfile_t* logfile = NULL; @@ -844,7 +844,7 @@ Con_Rcon_AddChar Adds a character to the rcon buffer ================ */ -void Con_Rcon_AddChar(char c) +void Con_Rcon_AddChar(int c) { if(log_dest_buffer_appending) return; @@ -1030,7 +1030,7 @@ void Con_Print(const char *msg) int lastcolor = 0; const char *in; char *out; - char color; + int color; for(in = line, out = printline; *in; ++in) { switch(*in) @@ -1167,6 +1167,10 @@ void Con_Print(const char *msg) in+=4; break; } + *out++ = STRING_COLOR_TAG; + *out++ = STRING_COLOR_RGB_DEFAULT; + ++in; + break; /*case 'a': if ( isxdigit(in[2]) || in[2] == '+' || in[2] == '-' ) { @@ -1380,9 +1384,9 @@ int Con_DisplayLineFunc(void *passthrough, const char *line, size_t length, floa (void) 0; else { - int x = ti->x + (ti->width - width) * ti->alignment; + int x = (int) (ti->x + (ti->width - width) * ti->alignment); if(isContinuation && *ti->continuationString) - x += DrawQ_String_Font(x, ti->y, ti->continuationString, strlen(ti->continuationString), ti->fontsize, ti->fontsize, 1.0, 1.0, 1.0, 1.0, 0, NULL, false, ti->font); + x += (int) DrawQ_String_Font(x, ti->y, ti->continuationString, strlen(ti->continuationString), ti->fontsize, ti->fontsize, 1.0, 1.0, 1.0, 1.0, 0, NULL, false, ti->font); if(length > 0) DrawQ_String_Font(x, ti->y, line, length, ti->fontsize, ti->fontsize, 1.0, 1.0, 1.0, 1.0, 0, &(ti->colorindex), false, ti->font); } @@ -1415,7 +1419,7 @@ int Con_DrawNotifyRect(int mask_must, int mask_mustnot, float maxage, float x, f l = 0; Con_WordWidthFunc(&ti, NULL, &l, -1); l = strlen(continuationString); - continuationWidth = Con_WordWidthFunc(&ti, continuationString, &l, -1); + continuationWidth = (int) Con_WordWidthFunc(&ti, continuationString, &l, -1); // first find the first line to draw by backwards iterating and word wrapping to find their length... startidx = con_lines_count; @@ -1812,8 +1816,8 @@ qboolean GetMapList (const char *s, char *completedname, int completednamebuffer if (com_token[0] == '}') break; // skip leading whitespace - for (k = 0;com_token[k] && com_token[k] <= ' ';k++); - for (l = 0;l < (int)sizeof(keyname) - 1 && com_token[k+l] && com_token[k+l] > ' ';l++) + for (k = 0;com_token[k] && ISWHITESPACE(com_token[k]);k++); + for (l = 0;l < (int)sizeof(keyname) - 1 && com_token[k+l] && !ISWHITESPACE(com_token[k+l]);l++) keyname[l] = com_token[k+l]; keyname[l] = 0; if (!COM_ParseToken_Simple(&data, false, false)) @@ -2318,7 +2322,7 @@ int Nicks_AddLastColor(char *buffer, int pos) { qboolean quote_added = false; int match; - char color = STRING_COLOR_DEFAULT + '0'; + int color = STRING_COLOR_DEFAULT + '0'; char r = 0, g = 0, b = 0; if(con_nickcompletion_flags.integer & NICKS_ADD_QUOTE && buffer[Nicks_matchpos-1] == '\"') @@ -2344,11 +2348,13 @@ int Nicks_AddLastColor(char *buffer, int pos) else if(buffer[match+1] == STRING_COLOR_RGB_DEFAULT) { if ( isxdigit(buffer[match+2]) && isxdigit(buffer[match+3]) && isxdigit(buffer[match+4]) ) + { r = buffer[match+2]; g = buffer[match+3]; b = buffer[match+4]; color = -1; break; + } } } }