diff options
author | Eugene Sandulenko | 2004-08-10 18:31:33 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2004-08-10 18:31:33 +0000 |
commit | 632042dae47246ba313b7375831349f197b03678 (patch) | |
tree | 0eba839f3a10e63cce32cfbfec8d7e395b9b7974 /saga/console.h | |
parent | 0f1c83f1e76297302fb4ed58b90113a99ee0baec (diff) | |
download | scummvm-rg350-632042dae47246ba313b7375831349f197b03678.tar.gz scummvm-rg350-632042dae47246ba313b7375831349f197b03678.tar.bz2 scummvm-rg350-632042dae47246ba313b7375831349f197b03678.zip |
Move CON_* to a class.
svn-id: r14538
Diffstat (limited to 'saga/console.h')
-rw-r--r-- | saga/console.h | 69 |
1 files changed, 50 insertions, 19 deletions
diff --git a/saga/console.h b/saga/console.h index c2fb5ad24c..b24f2540c1 100644 --- a/saga/console.h +++ b/saga/console.h @@ -34,20 +34,6 @@ namespace Saga { #define R_CONSOLE_TXTCOLOR 0x00FFFFFFUL #define R_CONSOLE_TXTSHADOW 0x00202020UL -struct R_CONSOLEINFO { - int active; - int y_max; - int line_max; - int hist_max; - int hist_pos; - int line_pos; - int y_pos; - char *prompt; - int prompt_w; - char input_buf[R_CON_INPUTBUF_LEN + 1]; - int input_pos; -}; - struct R_CONSOLE_LINE { R_CONSOLE_LINE *next; R_CONSOLE_LINE *prev; @@ -61,11 +47,6 @@ struct R_CON_SCROLLBACK { int lines; }; -static int CON_AddLine(R_CON_SCROLLBACK *scroll, int line_max, const char *constr_p); -static int CON_DeleteLine(R_CON_SCROLLBACK *scroll); -static int CON_DeleteScroll(R_CON_SCROLLBACK *scroll); -static int CON_SetDropPos(double percent); - #define R_CON_DEFAULTPOS 136 #define R_CON_DEFAULTLINES 100 #define R_CON_DEFAULTCMDS 10 @@ -74,6 +55,56 @@ static int CON_SetDropPos(double percent); #define R_CON_LINE_H 10 #define R_CON_INPUT_H 10 +class Console { + public: + int reg(void); + Console(SagaEngine *vm); + ~Console(void); + + int activate(void); + int deactivate(void); + bool isActive(void); + + int type(int in_char); + int draw(R_SURFACE *ds); + int print(const char *fmt_str, ...); + + int cmdUp(void); + int cmdDown(void); + int pageUp(void); + int pageDown(void); + + int dropConsole(double percent); + int raiseConsole(double percent); + + private: + int addLine(R_CON_SCROLLBACK *scroll, int line_max, const char *constr_p); + int deleteLine(R_CON_SCROLLBACK *scroll); + int deleteScroll(R_CON_SCROLLBACK *scroll); + int setDropPos(double percent); + + private: + SagaEngine *_vm; + + R_CON_SCROLLBACK _scrollback; + R_CON_SCROLLBACK _history; + + int _resize; + int _droptime; + + bool _active; + int _yMax; + int _lineMax; + int _histMax; + int _histPos; + int _linePos; + int _yPos; + char *_prompt; + int _promptW; + char _inputBuf[R_CON_INPUTBUF_LEN + 1]; + int _inputPos; +}; + } // End of namespace Saga #endif |