X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fcommon%2FScriptRunner.h;h=7a8aa2cf7f1e0e4f0a0ec44749cf73d7ec352a5a;hb=59c735f03e5959ab6a32afac1603f1e371786ed7;hp=9b0f1ac8aa037503bdce31580a2e4ae617512b96;hpb=8060b9ee74a24fe33a874732035dc8b74003439f;p=l2e.git diff --git a/src/common/ScriptRunner.h b/src/common/ScriptRunner.h index 9b0f1ac..7a8aa2c 100644 --- a/src/common/ScriptRunner.h +++ b/src/common/ScriptRunner.h @@ -1,14 +1,8 @@ -/* - * ScriptRunner.h - * - * Created on: Oct 13, 2012 - * Author: holy - */ - #ifndef COMMON_SCRIPTRUNNER_H_ #define COMMON_SCRIPTRUNNER_H_ #include "fwd.h" +#include "Script.h" #include "../geometry/Vector.h" #include @@ -25,18 +19,16 @@ public: void Run(ScriptHost &, const Script &); bool Running() const; - void *Address0() const { return address0; } - void *Address1() const { return address1; } - int Integer0() const { return integer0; } - int Integer1() const { return integer1; } - const geometry::Vector &Vector0() const { return vector0; } - const geometry::Vector &Vector1() const { return vector1; } + void *AddressRegister(int n) const { return address[n]; } + int IntegerRegister(int n) const { return integer[n]; } + const geometry::Vector &VectorRegister(int n) const { return vector[n]; } private: void Reset(); - void Exec(unsigned char code); + void Exec(Script::Code code); void *PopAddress(); + Script::Code PopCode(); int PopInt(); const geometry::Vector &PopVector(); @@ -53,12 +45,10 @@ private: const Script *script; int cursor; - void *address0; - void *address1; - int integer0; - int integer1; - geometry::Vector vector0; - geometry::Vector vector1; + static const int numRegisters = 7; + void *address[numRegisters]; + int integer[numRegisters]; + geometry::Vector vector[numRegisters]; Uint8 compare;