engine/EngineConsole.c
/*	johnfitz -- modified to allow insert editing

	The input line scrolls horizontally if typing goes beyond the right edge
*/
- modified to allow insert editing
The input line scrolls horizontally if typing goes beyond the right edge
- modified to allow insert editing The input line scrolls horizontally if typing goes beyond the right edge
void Con_DrawInput (void)
{
	extern double key_blinktime;
	unsigned int i;
	int len;
	char c[256],*text;
	if(key_dest != key_console && !con_forcedup)
		return;		
	text = strcpy(c, key_lines[edit_line]);
	len = strlen(key_lines[edit_line]);
	text[len] = ' ';
	text[len+1] = 0;
	if (key_linepos >= con_linewidth)
		text += 1 + key_linepos - con_linewidth;
	for(i = 0; i <= strlen(text)-1; i++) 
		Draw_Character ((i+1)<<3, vid.conheight - 16, text[i]);
	if(!((int)((realtime-key_blinktime)*con_cursorspeed) & 1))
		Draw_Character((key_linepos+1)<<3,vid.conheight-16,'_');
}
void Con_DrawInput ( void ) { extern double key_blinktime ; unsigned int i ; int len ; char c [ 256 ] , * text ; if ( key_dest != key_console && ! con_forcedup ) return ; text = strcpy ( c , key_lines [ edit_line ] ) ; len = strlen ( key_lines [ edit_line ] ) ; text [ len ] = ' ' ; text [ len + 1 ] = 0 ; if ( key_linepos >= con_linewidth ) text += 1 + key_linepos - con_linewidth ; for ( i = 0 ; i <= strlen ( text ) - 1 ; i ++ ) Draw_Character ( ( i + 1 ) << 3 , vid . conheight - 16 , text [ i ] ) ; if ( ! ( ( int ) ( ( realtime - key_blinktime ) * con_cursorspeed ) & 1 ) ) Draw_Character ( ( key_linepos + 1 ) << 3 , vid . conheight - 16 , ' ' ) ; }
johnfitz -- modified to allow insert editing
The input line scrolls horizontally if typing goes beyond the right edge
johnfitz -- modified to allow insert editing The input line scrolls horizontally if typing goes beyond the right edge
// Don't draw anything // Pad with one space so we can draw one past the string (in case the cursor is there) // Prestep if horizontally scrolling // Draw input string //only write enough letters to go from *text to cursor // johnfitz -- new cursor handling