From 0b3e161d8536e832a84b3de80604f1bf68622523 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 22 Dec 2015 10:48:19 +0100 Subject: WAGE: Test script execution --- engines/wage/script.cpp | 6 +++++- engines/wage/script.h | 4 +++- engines/wage/wage.cpp | 6 +++++- 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'engines/wage') diff --git a/engines/wage/script.cpp b/engines/wage/script.cpp index e1f3c67535..f5e4cd475e 100644 --- a/engines/wage/script.cpp +++ b/engines/wage/script.cpp @@ -64,7 +64,11 @@ bool Script::execute(World *world, int loopCount, String *inputText, Designed *i _data->skip(12); while (_data->pos() < _data->size()) { - switch(_data->readByte()) { + byte command = _data->readByte(); + + debug(1, "Command: %x", command); + + switch(command) { case 0x80: // IF processIf(); break; diff --git a/engines/wage/script.h b/engines/wage/script.h index 4c8ce456c7..97d52f07b4 100644 --- a/engines/wage/script.h +++ b/engines/wage/script.h @@ -126,8 +126,10 @@ private: } }; - +public: bool execute(World *world, int loopCount, String *inputText, Designed *inputClick, WageEngine *callbacks); + +private: Operand *readOperand(); Operand *readStringOperand(); const char *readOperator(); diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp index 00a7aadaf0..5ab2a90ac1 100644 --- a/engines/wage/wage.cpp +++ b/engines/wage/wage.cpp @@ -59,9 +59,10 @@ #include "graphics/palette.h" #include "wage/wage.h" +#include "wage/design.h" #include "wage/entities.h" +#include "wage/script.h" #include "wage/world.h" -#include "wage/design.h" namespace Wage { @@ -109,6 +110,9 @@ Common::Error WageEngine::run() { screen.create(640, 480, Graphics::PixelFormat::createFormatCLUT8()); Common::Rect r(0, 0, screen.w, screen.h); + Common::String input("look"); + _world->_globalScript->execute(_world, 1, &input, NULL, this); + _world->_orderedScenes[1]->_design->paint(&screen, _world->_patterns, false); _world->_objs["frank.1"]->_design->setBounds(&r); _world->_objs["frank.1"]->_design->paint(&screen, _world->_patterns, false); -- cgit v1.2.3