aboutsummaryrefslogtreecommitdiff
path: root/saga/console.h
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-12-03 19:15:44 +0000
committerTorbjörn Andersson2004-12-03 19:15:44 +0000
commitc64c7eb4d4edd087031603df446abf271f616480 (patch)
treedcd747faca1c7f8d8fc0a9ba42a1bf1d076e83a7 /saga/console.h
parent2cfdcb5a59dec0e66e81dc91be142224156de473 (diff)
downloadscummvm-rg350-c64c7eb4d4edd087031603df446abf271f616480.tar.gz
scummvm-rg350-c64c7eb4d4edd087031603df446abf271f616480.tar.bz2
scummvm-rg350-c64c7eb4d4edd087031603df446abf271f616480.zip
First pass at migrating from the old Reinherit console to the ScummVM
console. Some things are likely to have broken. For instance, I believe the old console was could be visible during gameplay, while ScummVM's is modal. So any place where we output something to the console during gameplay should probably be removed. Some things I've stubbed out. Basically any code that registers a variable. Most of the debugging commands are untested. Syntax may have changed because of different command-line parsing. (I never actually used the old console, so I don't know for sure. :-) Actually, I'm not that interested in reproducing the old console commands faithfully. What we should do now is to make the immediately useful console stuff work. Anything that remains unimplemented should probably be removed. svn-id: r15976
Diffstat (limited to 'saga/console.h')
-rw-r--r--saga/console.h92
1 files changed, 26 insertions, 66 deletions
diff --git a/saga/console.h b/saga/console.h
index c6b99c2a7e..ad522a7af3 100644
--- a/saga/console.h
+++ b/saga/console.h
@@ -26,83 +26,43 @@
#ifndef SAGA_CONSOLE_H_
#define SAGA_CONSOLE_H_
-namespace Saga {
-
-#define CON_INPUTBUF_LEN 80
-
-#define CONSOLE_BGCOLOR 0x00A0A0A0UL
-#define CONSOLE_TXTCOLOR 0x00FFFFFFUL
-#define CONSOLE_TXTSHADOW 0x00202020UL
-
-struct CONSOLE_LINE {
- CONSOLE_LINE *next;
- CONSOLE_LINE *prev;
- char *str_p;
- int str_len;
-};
+#include "common/debugger.h"
-struct CON_SCROLLBACK {
- CONSOLE_LINE *head;
- CONSOLE_LINE *tail;
- int lines;
-};
+namespace Saga {
-#define CON_DEFAULTPOS 136
-#define CON_DEFAULTLINES 100
-#define CON_DEFAULTCMDS 10
-#define CON_DROPTIME 400
-#define CON_PRINTFLIMIT 1024
-#define CON_LINE_H 10
-#define CON_INPUT_H 10
-
-class Console {
- public:
- int reg(void);
+class Console : public Common::Debugger<Console> {
+public:
Console(SagaEngine *vm);
~Console(void);
- int activate(void);
- int deactivate(void);
- bool isActive(void);
+protected:
+ virtual void preEnter();
+ virtual void postEnter();
- int type(int in_char);
- int draw(SURFACE *ds);
- int print(const char *fmt_str, ...);
+private:
+ bool Cmd_Exit(int argc, const char **argv);
+ bool Cmd_Help(int argc, const char **argv);
- int cmdUp(void);
- int cmdDown(void);
- int pageUp(void);
- int pageDown(void);
+ bool Cmd_ActorAdd(int argc, const char **argv);
+ bool Cmd_ActorDel(int argc, const char **argv);
+ bool Cmd_ActorMove(int argc, const char **argv);
+ bool Cmd_ActorMoveRel(int argc, const char **argv);
+ bool Cmd_ActorSetO(int argc, const char **argv);
+ bool Cmd_ActorSetAct(int argc, const char **argv);
- int dropConsole(double percent);
- int raiseConsole(double percent);
+ bool Cmd_AnimInfo(int argc, const char **argv);
- private:
- int addLine(CON_SCROLLBACK *scroll, int line_max, const char *constr_p);
- int deleteLine(CON_SCROLLBACK *scroll);
- int deleteScroll(CON_SCROLLBACK *scroll);
- int setDropPos(double percent);
+ bool Cmd_SceneChange(int argc, const char **argv);
+ bool Cmd_SceneInfo(int argc, const char **argv);
+ bool Cmd_ActionInfo(int argc, const char **argv);
+ bool Cmd_ObjectInfo(int argc, const char **argv);
- private:
- SagaEngine *_vm;
+ bool Cmd_ScriptInfo(int argc, const char **argv);
+ bool Cmd_ScriptExec(int argc, const char **argv);
+ bool Cmd_ScriptToggleStep(int argc, const char **argv);
- CON_SCROLLBACK _scrollback;
- 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[CON_INPUTBUF_LEN + 1];
- int _inputPos;
+private:
+ SagaEngine *_vm;
};
} // End of namespace Saga