3
*************************************************************************
5
ArmageTron -- Just another Tron Lightcycle Game in 3D.
6
Copyright (C) 2000 Manuel Moos (manuel@moosnet.de)
8
**************************************************************************
10
This program is free software; you can redistribute it and/or
11
modify it under the terms of the GNU General Public License
12
as published by the Free Software Foundation; either version 2
13
of the License, or (at your option) any later version.
15
This program is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
GNU General Public License for more details.
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
***************************************************************************
28
#ifndef ArmageTron_CONSOLE_H
29
#define ArmageTron_CONSOLE_H
34
#include "tCallback.h"
37
extern REAL rCWIDTH_CON;
38
extern REAL rCHEIGHT_CON;
40
class rConsole:public tConsole{
41
tArray<tString> lines;
43
int currentTop; // the line currently at top of the screen
44
int currentIn; // the line currently written into
46
double lastTimeout; // the time the last message dissapeared
47
double lastCustomTimeout; // the time the last custom key was pressed
49
// the following Variables are only of interest in non-fullscreen mode:
50
int height; // the maximum height of the console in lines
51
REAL timeout; // the time until one message dissapears
53
static int MaxHeight(); // max height
55
void DisplayAtNewline();
57
bool fullscreen; // should the con be displayed fullscreen or
58
// be limited to the upper edge of the screen?
60
bool autoDisplayAtSwap; // do we need to call GL_Display manually?
61
bool autoDisplayAtNewline;
68
void SetHeight(int h,bool stop_scroll=true);
69
void SetTimeout(REAL to);
73
// rConsole & operator<<(const tString &s);
74
virtual tConsole & DoPrint( const tString& s );
78
virtual void DoCenterDisplay(const tString &s,REAL timeout=2,REAL r=1,REAL g=1,REAL b=1);
80
virtual tString ColorString(REAL r, REAL g, REAL b) const;
84
extern rConsole sr_con; // where all the output is directed to
88
void sr_Unblock_stdin();
92
class rForceTextCallback:public tCallbackOr{
94
rForceTextCallback(BOOLRETFUNC *f);
95
static bool ForceText();
98
class rSmallConsoleCallback:public tCallbackOr{
100
rSmallConsoleCallback(BOOLRETFUNC *f);
101
static bool SmallColsole();
104
class rCenterDisplayCallback:public tCallback{
106
rCenterDisplayCallback(VOIDFUNC *f);
107
static void CenterDisplay();
110
// if one of those callbacks returns true, auto display at newline is disabled.
111
class rNoAutoDisplayAtNewlineCallback:public tCallbackOr{
113
rNoAutoDisplayAtNewlineCallback(BOOLRETFUNC *f);
114
static bool NoAutoDisplayAtNewline();