Tremulous Forum

Mods => Modding Center => Topic started by: Bomb on July 23, 2008, 09:35:32 pm

Title: Line Preservation?
Post by: Bomb on July 23, 2008, 09:35:32 pm
Does anyone know how the tremded console preserves the bottom line? That is, what keeps the output from overwriting your input?
Title: Re: Line Preservation?
Post by: Undeference on July 23, 2008, 10:18:34 pm
The input line is not actually preserved. When a new line of output is printed, the input line is replaced by output and printed to the next line. The result is that it looks like it never went away, but it really did. (Echoing is specifically disabled and stdin is made non-blocking.)
Title: Re: Line Preservation?
Post by: Bomb on July 23, 2008, 10:49:37 pm
How might one replicate this functionality with standard C functions (e.g. printf)?
Title: Re: Line Preservation?
Post by: epsy on July 23, 2008, 11:49:35 pm
best would be to just browse trem's source
Title: Re: Line Preservation?
Post by: Bomb on July 24, 2008, 01:25:37 am
That's easier said than done. There are upwards of a hundred files to look through. Not to mention the fact that every print-related function calls a different function.

So, does anyone know how to do this?

[EDIT] How does the tremded know what the input line says?
Title: Re: Line Preservation?
Post by: Undeference on July 24, 2008, 02:39:54 am
http://svn.icculus.org/quake3/trunk/code/sys/con_tty.c?view=markup
Title: Re: Line Preservation?
Post by: Bomb on July 24, 2008, 09:47:54 pm
Thanks Undeference. Much <3 to you!