diff options
author | Eugene Sandulenko | 2015-12-21 20:55:20 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2015-12-27 15:40:58 +0100 |
commit | 80af9c9c711392ff888c747ce980a69518423d31 (patch) | |
tree | 22eac647331c82fe4011757c473bc7befe96470e /engines | |
parent | 5c2f3301f0b02d080de43f06efabec117903cec2 (diff) | |
download | scummvm-rg350-80af9c9c711392ff888c747ce980a69518423d31.tar.gz scummvm-rg350-80af9c9c711392ff888c747ce980a69518423d31.tar.bz2 scummvm-rg350-80af9c9c711392ff888c747ce980a69518423d31.zip |
WAGE: Stubs for command processing
Diffstat (limited to 'engines')
-rw-r--r-- | engines/wage/script.cpp | 91 | ||||
-rw-r--r-- | engines/wage/script.h | 21 | ||||
-rw-r--r-- | engines/wage/wage.cpp | 2 |
3 files changed, 80 insertions, 34 deletions
diff --git a/engines/wage/script.cpp b/engines/wage/script.cpp index 65d4fbbfb8..19de26e9a2 100644 --- a/engines/wage/script.cpp +++ b/engines/wage/script.cpp @@ -120,41 +120,38 @@ bool Script::execute(World *world, int loopCount, String *inputText, Designed *i } } - if (_world->_globalScript != this) { debug(0, "Executing global script..."); bool globalHandled = _world->_globalScript->execute(_world, _loopCount, _inputText, _inputClick, _callbacks); if (globalHandled) _handled = true; - } - -#if 0 - else if (inputText != null) { - String input = inputText.toLowerCase(); + } else if (inputText != NULL) { + Common::String input(*inputText); + input.toLowercase(); if (input.equals("n") || input.contains("north")) { - handleMoveCommand(Scene.NORTH, "north"); + handleMoveCommand(Scene::NORTH, "north"); } else if (input.equals("e") || input.contains("east")) { - handleMoveCommand(Scene.EAST, "east"); + handleMoveCommand(Scene::EAST, "east"); } else if (input.equals("s") || input.contains("south")) { - handleMoveCommand(Scene.SOUTH, "south"); + handleMoveCommand(Scene::SOUTH, "south"); } else if (input.equals("w") || input.contains("west")) { - handleMoveCommand(Scene.WEST, "west"); - } else if (input.startsWith("take ")) { - handleTakeCommand(input.substring(5)); - } else if (input.startsWith("get ")) { - handleTakeCommand(input.substring(4)); - } else if (input.startsWith("pick up ")) { - handleTakeCommand(input.substring(8)); - } else if (input.startsWith("drop ")) { - handleDropCommand(input.substring(5)); - } else if (input.startsWith("aim ")) { - handleAimCommand(input.substring(4)); - } else if (input.startsWith("wear ")) { - handleWearCommand(input.substring(5)); - } else if (input.startsWith("put on ")) { - handleWearCommand(input.substring(7)); - } else if (input.startsWith("offer ")) { - handleOfferCommand(input.substring(6)); + handleMoveCommand(Scene::WEST, "west"); + } else if (input.hasPrefix("take ")) { + handleTakeCommand(&input.c_str()[5]); + } else if (input.hasPrefix("get ")) { + handleTakeCommand(&input.c_str()[4]); + } else if (input.hasPrefix("pick up ")) { + handleTakeCommand(&input.c_str()[8]); + } else if (input.hasPrefix("drop ")) { + handleDropCommand(&input.c_str()[5]); + } else if (input.hasPrefix("aim ")) { + handleAimCommand(&input.c_str()[4]); + } else if (input.hasPrefix("wear ")) { + handleWearCommand(&input.c_str()[5]); + } else if (input.hasPrefix("put on ")) { + handleWearCommand(&input.c_str()[7]); + } else if (input.hasPrefix("offer ")) { + handleOfferCommand(&input.c_str()[6]); } else if (input.contains("look")) { handleLookCommand(); } else if (input.contains("inventory")) { @@ -163,7 +160,8 @@ bool Script::execute(World *world, int loopCount, String *inputText, Designed *i handleStatusCommand(); } else if (input.contains("rest") || input.equals("wait")) { handleRestCommand(); - } else if (callbacks.getOffer() != null && input.contains("accept")) { + /* + } else if (callbacks.getOffer() != NULL && input.contains("accept")) { handleAcceptCommand(); } else { Chr player = world.getPlayer(); @@ -173,7 +171,9 @@ bool Script::execute(World *world, int loopCount, String *inputText, Designed *i break; } } + */ } +/* // TODO: weapons, offer, etc... } else if (inputClick instanceof Obj) { Obj obj = (Obj) inputClick; @@ -182,12 +182,12 @@ bool Script::execute(World *world, int loopCount, String *inputText, Designed *i } else { appendText(obj.getClickMessage()); } +*/ } -#endif return _handled; } - + Script::Operand *Script::readOperand() { byte operandType = _data->readByte(); switch (operandType) { @@ -318,4 +318,37 @@ void Script::appendText(String str) { _callbacks->appendText(str); } +void Script::handleMoveCommand(Scene::Directions dir, const char *dirName) { +} + +void Script::handleLookCommand() { +} + +void Script::handleInventoryCommand() { +} + +void Script::handleStatusCommand() { +} + +void Script::handleRestCommand() { +} + +void Script::handleAcceptCommand() { +} + +void Script::handleTakeCommand(const char *target) { +} + +void Script::handleDropCommand(const char *target) { +} + +void Script::handleAimCommand(const char *target) { +} + +void Script::handleWearCommand(const char *target) { +} + +void Script::handleOfferCommand(const char *target) { +} + } // End of namespace Wage diff --git a/engines/wage/script.h b/engines/wage/script.h index e898d51249..5d5f9ef7e2 100644 --- a/engines/wage/script.h +++ b/engines/wage/script.h @@ -47,7 +47,7 @@ #ifndef WAGE_SCRIPT_H #define WAGE_SCRIPT_H - + namespace Wage { class Script { @@ -77,7 +77,7 @@ private: CLICK_INPUT = 5, TEXT_INPUT = 6 }; - + union { Obj *obj; Chr *chr; @@ -88,7 +88,7 @@ private: } _value; OperandTypes _type; String _str; - + Operand(Obj *value, OperandTypes type) { _value.obj = value; _str = value->toString(); @@ -135,9 +135,20 @@ private: void processLet(); void appendText(String str); - + void handleMoveCommand(Scene::Directions dir, const char *dirName); + void handleLookCommand(); + void handleInventoryCommand(); + void handleStatusCommand(); + void handleRestCommand(); + void handleAcceptCommand(); + + void handleTakeCommand(const char *target); + void handleDropCommand(const char *target); + void handleAimCommand(const char *target); + void handleWearCommand(const char *target); + void handleOfferCommand(const char *target); }; } // End of namespace Wage - + #endif diff --git a/engines/wage/wage.cpp b/engines/wage/wage.cpp index 093c94a2f0..0689d90c83 100644 --- a/engines/wage/wage.cpp +++ b/engines/wage/wage.cpp @@ -108,6 +108,8 @@ Common::Error WageEngine::run() { Graphics::Surface screen; screen.create(640, 480, Graphics::PixelFormat::createFormatCLUT8()); Common::Rect r(0, 0, screen.w, screen.h); + + _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); _world->_scenes["temple of the holy mackeral"]->_design->setBounds(&r); |