Skip to content

Commit

Permalink
WAGE: Test script execution
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Dec 27, 2015
1 parent e71fe81 commit 0b3e161
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion engines/wage/script.cpp
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion engines/wage/script.h
Expand Up @@ -126,8 +126,10 @@ class Script {
}
};


public:
bool execute(World *world, int loopCount, String *inputText, Designed *inputClick, WageEngine *callbacks);

private:
Operand *readOperand();
Operand *readStringOperand();
const char *readOperator();
Expand Down
6 changes: 5 additions & 1 deletion engines/wage/wage.cpp
Expand Up @@ -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 {

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 0b3e161

Please sign in to comment.