Ticket #85 (closed enhancement: fixed)

Opened 5 years ago

Last modified 9 months ago

Clean up text console code

Reported by: Ingar Owned by: Ingar
Priority: minor Component: quake2world
Keywords: console text wrap curses ncurses pdcurses Cc:

Description

With the color codes added, word wrapping on the console is seriously broken. The code assumes a fixed linewidth and needs to be rewritten to make and index of the printable lines.

The same problem exists in the experimental ncurses server console, it would be a good idea to split things into console.c cl_console.c and sv_console.c.

As a sidenote: pdcurses might be the ticket to a decent windows console.

Change History

follow-up: ↓ 2   Changed 5 years ago by Ingar

  • status changed from new to assigned

As of revision 969, the new console backend is in place. There are a few minor issues left when the input line scrolls past the right off the screen.

The next step is to split it into core functionality and client support, move parts of the console to libcommon and provide a base for the server console.

in reply to: ↑ 1   Changed 5 years ago by Ingar

  • summary changed from fix console word wrapping to Clean up text console code

note, the minor issue with the input don't belong here. Input must be handled after the console changes.

in reply to: ↑ description ; follow-up: ↓ 4   Changed 5 years ago by Ingar

As of revision 990, the ncurses console is in place, it can be used with the dedicated server or in conjuction with the normal client. Disbled by default, enable it at build time with --with-ncurses

remaining issues: Con_Clear_f and Con_Dump_f don't work with a dedicated server (and potentialy crash the dedicated server if you build it without ncurses). This requires a Con_Init cleanup.

The hooks into common.c and main.c are rather nasty.

I should look into pdcurses. We could even have a decent dedicated server on win32.

in reply to: ↑ 3   Changed 5 years ago by Ingar

  • priority changed from major to minor
  • type changed from task to enhancement

The backend now properly splits long words and the ncurses console has been optimized to reduce screen updates. The timeout (in ms) can be set through the con_timeout cvar. clearconsole and dumpconsole can now be used with the dedicated server. I've also cleaned up the hooks into common.c and main.c.

PDcurses on win32 might be harder then expected. SDL prevents output to the system console and some linker magic is required to make it work.

  Changed 3 years ago by jdolan

Ingar, is there additional work here, or should we close this out? The only thing I can think of is perhaps breaking out some code into sv_console.c, and maybe trying to reduce the #ifdef HAVE_CURSES which runs a little rampant at times. But overall I think the console is in rather good shape.

  Changed 9 months ago by jdolan

  • status changed from assigned to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.