mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-13 00:34:11 +00:00
Console word wrap fix: only check and wrap at word boundaries, not in the middle of a word.
(Enter "r_nolerp_list" in the console for an example.) git-svn-id: svn+ssh://svn.code.sf.net/p/quakespasm/code/trunk@595 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
6dd3c40734
commit
606890402c
1 changed files with 18 additions and 7 deletions
|
@ -402,6 +402,7 @@ void Con_Print (const char *txt)
|
|||
int c, l;
|
||||
static int cr;
|
||||
int mask;
|
||||
qboolean boundary;
|
||||
|
||||
//con_backscroll = 0; //johnfitz -- better console scrolling
|
||||
|
||||
|
@ -420,17 +421,27 @@ void Con_Print (const char *txt)
|
|||
else
|
||||
mask = 0;
|
||||
|
||||
boundary = true;
|
||||
|
||||
while ( (c = *txt) )
|
||||
{
|
||||
// count word length
|
||||
for (l=0 ; l< con_linewidth ; l++)
|
||||
if ( txt[l] <= ' ')
|
||||
break;
|
||||
if (c <= ' ')
|
||||
{
|
||||
boundary = true;
|
||||
}
|
||||
else if (boundary)
|
||||
{
|
||||
// count word length
|
||||
for (l = 0; l < con_linewidth; l++)
|
||||
if (txt[l] <= ' ')
|
||||
break;
|
||||
|
||||
// word wrap
|
||||
if (l != con_linewidth && (con_x + l > con_linewidth) )
|
||||
con_x = 0;
|
||||
// word wrap
|
||||
if (l != con_linewidth && (con_x + l > con_linewidth))
|
||||
con_x = 0;
|
||||
|
||||
boundary = false;
|
||||
}
|
||||
|
||||
txt++;
|
||||
|
||||
|
|
Loading…
Reference in a new issue