console.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /*
  2. Copyright (C) 2004 Michael Liebscher <johnnycanuck@users.sourceforge.net>
  3. Copyright (C) 1997-2001 Id Software, Inc.
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License
  6. as published by the Free Software Foundation; either version 2
  7. of the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  15. */
  16. /*
  17. * console.h: Console drawing and management..
  18. *
  19. * Author: Michael Liebscher <johnnycanuck@users.sourceforge.net>
  20. *
  21. * Acknowledgement:
  22. * This code was derived from Quake II, and was originally
  23. * written by Id Software, Inc.
  24. *
  25. */
  26. /*
  27. Notes:
  28. This module is implemented by console.c.
  29. */
  30. #ifndef __CONSOLE_H__
  31. #define __CONSOLE_H__
  32. #define NUM_CON_TIMES 4
  33. #define CON_TEXTSIZE 32768
  34. typedef struct
  35. {
  36. _boolean initialized;
  37. char text[CON_TEXTSIZE];
  38. int current; // line where next message will be printed
  39. int x; // offset in current line for next print
  40. int display; // bottom of console displays this line
  41. int ormask; // high bit mask for colored characters
  42. int linewidth; // characters across screen
  43. int totallines; // total lines in console scrollback
  44. float cursorspeed;
  45. int vislines;
  46. float times[NUM_CON_TIMES]; // cls.realtime time the line was generated
  47. // for transparent notify lines
  48. } console_t;
  49. extern console_t con;
  50. extern void Con_DrawCharacter( int cx, int line, int num );
  51. extern void Con_CheckResize( void );
  52. extern void Con_Init( void );
  53. extern void Con_DrawConsole( float frac );
  54. extern void Con_Print( char *txt );
  55. extern void Con_CenteredPrint( const char *text );
  56. extern void Con_DrawNotify( void );
  57. extern void Con_ClearNotify( void );
  58. extern void Con_ToggleConsole_f( void );
  59. extern void Client_Screen_RunConsole( void );
  60. extern void Client_Screen_DrawConsole( void );
  61. #endif /* __CONSOLE_H__ */