X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=console.c;h=14dcb7dcc27ee89704dbb1d45f475f692b280ae7;hb=259c8a118477de2e8e31e86e7dfb0d20698b0489;hp=d8654f31b4e62e8b3cb5e102a5a890557330e817;hpb=d57be67cb00229acb8564b92c8b7c58eeed8a0cb;p=xonotic%2Fdarkplaces.git diff --git a/console.c b/console.c index d8654f31..14dcb7dc 100644 --- a/console.c +++ b/console.c @@ -83,18 +83,13 @@ void Con_ToggleConsole_f (void) if (key_dest == key_console) { if (cls.state == ca_connected) -// { key_dest = key_game; -// key_lines[edit_line][1] = 0; // clear any typing -// key_linepos = 1; -// } else M_Menu_Main_f (); } else key_dest = key_console; - -// SCR_EndLoadingPlaque (); + memset (con_times, 0, sizeof(con_times)); } @@ -109,7 +104,7 @@ void Con_Clear_f (void) memset (con_text, ' ', CON_TEXTSIZE); } - + /* ================ Con_ClearNotify @@ -118,12 +113,12 @@ Con_ClearNotify void Con_ClearNotify (void) { int i; - + for (i=0 ; i= con_linewidth) text += 1 + key_linepos - con_linewidth; - - // draw it - y = con_vislines - 16; - // for (i=0 ; i con_notifytime.value) continue; text = con_text + (i % con_totallines)*con_linewidth; - + clearnotify = 0; -// for (x = 0 ; x < con_linewidth ; x++) -// Draw_Character ( (x+1)<<3, v, text[x]); - // LordHavoc: speedup - Draw_String(8, v, text, con_linewidth); + DrawQ_String(8, v, text, con_linewidth, 8, 8, 1, 1, 1, 1, 0); v += 8; } @@ -585,9 +544,9 @@ void Con_DrawNotify (void) if (key_dest == key_message) { clearnotify = 0; - + x = 0; - + // LordHavoc: speedup, and other improvements if (team_message) sprintf(temptext, "say_team:%s%c", chat_buffer, (int) 10+((int)(realtime*con_cursorspeed)&1)); @@ -595,25 +554,17 @@ void Con_DrawNotify (void) sprintf(temptext, "say:%s%c", chat_buffer, (int) 10+((int)(realtime*con_cursorspeed)&1)); while (strlen(temptext) >= con_linewidth) { - Draw_String (8, v, temptext, con_linewidth); + DrawQ_String (8, v, temptext, con_linewidth, 8, 8, 1, 1, 1, 1, 0); strcpy(temptext, &temptext[con_linewidth]); v += 8; } if (strlen(temptext) > 0) { - Draw_String (8, v, temptext, 0); + DrawQ_String (8, v, temptext, 0, 8, 8, 1, 1, 1, 1, 0); v += 8; } -// Draw_String (8, v, "say:", 0); -// while(chat_buffer[x]) -// { -// Draw_Character ( (x+5)<<3, v, chat_buffer[x]); -// x++; -// } -// Draw_Character ( (x+5)<<3, v, 10+((int)(realtime*con_cursorspeed)&1)); -// v += 8; } - + if (v > con_notifylines) con_notifylines = v; } @@ -626,18 +577,21 @@ Draws the console with the solid background The typing input line at the bottom should only be drawn if typing is allowed ================ */ -void Con_DrawConsole (int lines, qboolean drawinput) +extern cvar_t scr_conalpha; +extern char engineversion[40]; +void Con_DrawConsole (int lines) { int i, y; int rows; char *text; int j; - + if (lines <= 0) return; // draw the background - Draw_ConsoleBackground (lines); + DrawQ_Pic(0, lines - vid.conheight, "gfx/conback", vid.conwidth, vid.conheight, 1, 1, 1, scr_conalpha.value * lines / vid.conheight, 0); + DrawQ_String(vid.conwidth - strlen(engineversion) * 8 - 8, lines - 8, engineversion, 0, 8, 8, 1, 0, 0, 1, 0); // draw the text con_vislines = lines; @@ -645,22 +599,16 @@ void Con_DrawConsole (int lines, qboolean drawinput) rows = (lines-16)>>3; // rows of text to draw y = lines - 16 - (rows<<3); // may start slightly negative - for (i= con_current - rows + 1 ; i<=con_current ; i++, y+=8 ) + for (i = con_current - rows + 1;i <= con_current;i++, y += 8) { - j = i - con_backscroll; - if (j<0) - j = 0; + j = max(i - con_backscroll, 0); text = con_text + (j % con_totallines)*con_linewidth; -// for (x=0 ; x 1) ? "s: " : ":"); Con_DisplayList(list[0]); } - + if (v) { Con_Printf("%i possible variable%s\n", v, (v > 1) ? "s: " : ":"); Con_DisplayList(list[1]); } - + if (a) { Con_Printf("%i possible aliases%s\n", a, (a > 1) ? "s: " : ":"); Con_DisplayList(list[2]); } } - + if (cmd) { strncpy(key_lines[edit_line] + 1, cmd, cmd_len); key_linepos = cmd_len + 1;