Author Topic: Line Preservation?  (Read 4617 times)

Bomb

  • Guest
Line Preservation?
« 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?

Undeference

  • Tremulous Developers
  • *
  • Posts: 1254
  • Turrets: +122/-45
Re: Line Preservation?
« Reply #1 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.)
Need help? Ask intelligently. Please share solutions you find.

Thats what we need, helpful players, not more powerful admins.

Bomb

  • Guest
Re: Line Preservation?
« Reply #2 on: July 23, 2008, 10:49:37 pm »
How might one replicate this functionality with standard C functions (e.g. printf)?

epsy

  • Posts: 205
  • Turrets: +8/-25
    • Armagetron Advanced!
Re: Line Preservation?
« Reply #3 on: July 23, 2008, 11:49:35 pm »
best would be to just browse trem's source
Warning: All opinions expressed in my posts are mine and mine alone. Any connection to any group I am affiliated with - be it the ArmagetronAd Developers or any other group, is purely coincidental unless otherwise expressly stated. Don't be a dolt when you read my posts, as they *may* require some brainpower and thinking (also purely coincidental). Any opinion in my posts not expressed by me are purely figments of your imagination and will be dealt with accordingly.
SigTemplate by Khasla.

Bomb

  • Guest
Re: Line Preservation?
« Reply #4 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?
« Last Edit: July 24, 2008, 02:19:47 am by Bomb »

Undeference

  • Tremulous Developers
  • *
  • Posts: 1254
  • Turrets: +122/-45
Need help? Ask intelligently. Please share solutions you find.

Thats what we need, helpful players, not more powerful admins.

Bomb

  • Guest
Re: Line Preservation?
« Reply #6 on: July 24, 2008, 09:47:54 pm »
Thanks Undeference. Much <3 to you!