aboutsummaryrefslogtreecommitdiff
path: root/engines/adl/adl.h
diff options
context:
space:
mode:
authorWalter van Niftrik2017-08-10 13:15:26 +0200
committerWalter van Niftrik2019-07-17 08:41:34 +0200
commitf4f4d6119f4db550bcf7201788fd92adfa1915d0 (patch)
tree7f5e7160c519154b96841ef66e52591e7f371e4d /engines/adl/adl.h
parent39e4fdb98c27f97ffffcfba8b6579697a4c809d2 (diff)
downloadscummvm-rg350-f4f4d6119f4db550bcf7201788fd92adfa1915d0.tar.gz
scummvm-rg350-f4f4d6119f4db550bcf7201788fd92adfa1915d0.tar.bz2
scummvm-rg350-f4f4d6119f4db550bcf7201788fd92adfa1915d0.zip
ADL: Remove opcode counts from script interface
Diffstat (limited to 'engines/adl/adl.h')
-rw-r--r--engines/adl/adl.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/engines/adl/adl.h b/engines/adl/adl.h
index b7a2ff583f..7ab21d9bec 100644
--- a/engines/adl/adl.h
+++ b/engines/adl/adl.h
@@ -117,10 +117,19 @@ public:
ScriptEnv(const Command &cmd, byte room, byte verb, byte noun) :
_cmd(cmd), _room(room), _verb(verb), _noun(noun), _ip(0) { }
+ virtual ~ScriptEnv() { }
+
+ enum kOpType {
+ kOpTypeDone,
+ kOpTypeCond,
+ kOpTypeAct
+ };
+
byte op() const { return _cmd.script[_ip]; }
+ virtual kOpType getOpType() const = 0;
// We keep this 1-based for easier comparison with the original engine
byte arg(uint i) const { return _cmd.script[_ip + i]; }
- void skip(uint i) { _ip += i; }
+ virtual void next(uint numArgs) = 0;
bool isMatch() const {
return (_cmd.room == IDI_ANY || _cmd.room == _room) &&
@@ -128,15 +137,15 @@ public:
(_cmd.noun == IDI_ANY || _cmd.noun == _noun);
}
- byte getCondCount() const { return _cmd.numCond; }
- byte getActCount() const { return _cmd.numAct; }
byte getNoun() const { return _noun; }
const Command &getCommand() const { return _cmd; }
+protected:
+ byte _ip;
+
private:
const Command &_cmd;
const byte _room, _verb, _noun;
- byte _ip;
};
enum {
@@ -353,6 +362,7 @@ protected:
void doActions(ScriptEnv &env);
bool doOneCommand(const Commands &commands, byte verb, byte noun);
void doAllCommands(const Commands &commands, byte verb, byte noun);
+ virtual ScriptEnv *createScriptEnv(const Command &cmd, byte room, byte verb, byte noun);
// Debug functions
static Common::String toAscii(const Common::String &str);