engine/EngineConsole.c
/*	Handles cursor positioning, line wrapping, etc
	All console printing must go through this in order to be logged to disk
	If no console is visible, the notify window will pop up.
*/
Handles cursor positioning, line wrapping, etc
All console printing must go through this in order to be logged to disk
If no console is visible, the notify window will pop up.
Handles cursor positioning line wrapping etc All console printing must go through this in order to be logged to disk If no console is visible the notify window will pop up .
void Con_Print (char *txt)
{
	int			mask,y,c,l;
	static int	cr;
	if (txt[0] == 1)
	{
		mask = 128;		
		S_LocalSound("misc/talk.wav");
		txt++;
	}
	else if (txt[0] == 2)
	{
		mask = 128;		
		txt++;
	}
	else
		mask = 0;
	while ( *txt )
	{
		c = *txt;
		for (l=0 ; l< con_linewidth ; l++)
			if ( txt[l] <= ' ')
				break;
		if (l != con_linewidth && (con_x + l > con_linewidth) )
			con_x = 0;
		txt++;
		if(cr)
		{
			con_current--;
			cr = false;
		}
		if(!con_x)
		{
			Con_Linefeed ();
			if (con_current >= 0)
				con_times[con_current % NUM_CON_TIMES] = realtime;
		}
		switch (c)
		{
		case '\n':
			con_x = 0;
			break;
		case '\r':
			con_x = 0;
			cr = 1;
			break;
		default:
			y = con_current % con_totallines;
			con_text[y*con_linewidth+con_x] = c | mask;
			con_x++;
			if (con_x >= con_linewidth)
				con_x = 0;
			break;
		}
	}
}
void Con_Print ( char * txt ) { int mask , y , c , l ; static int cr ; if ( txt [ 0 ] == 1 ) { mask = 128 ; S_LocalSound ( " " ) ; txt ++ ; } else if ( txt [ 0 ] == 2 ) { mask = 128 ; txt ++ ; } else mask = 0 ; while ( * txt ) { c = * txt ; for ( l = 0 ; l < con_linewidth ; l ++ ) if ( txt [ l ] <= ' ' ) break ; if ( l != con_linewidth && ( con_x + l > con_linewidth ) ) con_x = 0 ; txt ++ ; if ( cr ) { con_current -- ; cr = false ; } if ( ! con_x ) { Con_Linefeed ( ) ; if ( con_current >= 0 ) con_times [ con_current % NUM_CON_TIMES ] = realtime ; } switch ( c ) { case ' \n ' : con_x = 0 ; break ; case ' \r ' : con_x = 0 ; cr = 1 ; break ; default : y = con_current % con_totallines ; con_text [ y * con_linewidth + con_x ] = c | mask ; con_x ++ ; if ( con_x >= con_linewidth ) con_x = 0 ; break ; } } }
Handles cursor positioning, line wrapping, etc
All console printing must go through this in order to be logged to disk
If no console is visible, the notify window will pop up.
Handles cursor positioning line wrapping etc All console printing must go through this in order to be logged to disk If no console is visible the notify window will pop up .
//con_backscroll = 0; //johnfitz -- better console scrolling // go to colored text // Play talk wav // go to colored text // Count word length // Word wrap // Mark time for transparent overlay // Display character and advance