mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-02 22:11:22 +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://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@595 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
73b56185fa
commit
f704084539
1 changed files with 18 additions and 7 deletions
|
@ -402,6 +402,7 @@ void Con_Print (const char *txt)
|
||||||
int c, l;
|
int c, l;
|
||||||
static int cr;
|
static int cr;
|
||||||
int mask;
|
int mask;
|
||||||
|
qboolean boundary;
|
||||||
|
|
||||||
//con_backscroll = 0; //johnfitz -- better console scrolling
|
//con_backscroll = 0; //johnfitz -- better console scrolling
|
||||||
|
|
||||||
|
@ -420,17 +421,27 @@ void Con_Print (const char *txt)
|
||||||
else
|
else
|
||||||
mask = 0;
|
mask = 0;
|
||||||
|
|
||||||
|
boundary = true;
|
||||||
|
|
||||||
while ( (c = *txt) )
|
while ( (c = *txt) )
|
||||||
{
|
{
|
||||||
// count word length
|
if (c <= ' ')
|
||||||
for (l=0 ; l< con_linewidth ; l++)
|
{
|
||||||
if ( txt[l] <= ' ')
|
boundary = true;
|
||||||
break;
|
}
|
||||||
|
else if (boundary)
|
||||||
|
{
|
||||||
|
// count word length
|
||||||
|
for (l = 0; l < con_linewidth; l++)
|
||||||
|
if (txt[l] <= ' ')
|
||||||
|
break;
|
||||||
|
|
||||||
// word wrap
|
// word wrap
|
||||||
if (l != con_linewidth && (con_x + l > con_linewidth) )
|
if (l != con_linewidth && (con_x + l > con_linewidth))
|
||||||
con_x = 0;
|
con_x = 0;
|
||||||
|
|
||||||
|
boundary = false;
|
||||||
|
}
|
||||||
|
|
||||||
txt++;
|
txt++;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue