MUTATIONOFJB: Fix missing lines between block ends.

This commit is contained in:
Ľubomír Remák 2018-08-19 16:29:41 +02:00 committed by Eugene Sandulenko
parent 9f1c628d4b
commit 561309eaa2
28 changed files with 24 additions and 32 deletions

View File

@ -556,4 +556,5 @@ Command::ExecuteResult ChangeSceneCommand::execute(ScriptExecutionContext &scrip
Common::String ChangeSceneCommand::debugString() const {
return Common::String::format("SCENE%d.%s %s %s", _sceneId, getRegisterAsString(), getOperationAsString(), getValueAsString().c_str());
}
}

View File

@ -46,9 +46,7 @@ void ConditionalCommandParser::finish(ScriptParseContext &) {
ConditionalCommand::ConditionalCommand() :
_trueCommand(nullptr),
_falseCommand(nullptr),
_cachedResult(false)
{}
_cachedResult(false) {}
Command *ConditionalCommand::getTrueCommand() const {
return _trueCommand;
@ -73,4 +71,5 @@ Command *ConditionalCommand::next() const {
return _falseCommand;
}
}
}

View File

@ -96,4 +96,5 @@ Command::ExecuteResult DefineStructCommand::execute(ScriptExecutionContext &scri
Common::String DefineStructCommand::debugString() const {
return "DEFINE_STRUCT <data omitted>";
}
}

View File

@ -38,4 +38,5 @@ public:
private:
ConversationInfo _conversationInfo;
};
}

View File

@ -77,12 +77,12 @@ bool IfCommandParser::parse(const Common::String &line, ScriptParseContext &, Co
return true;
}
IfCommand::IfCommand(uint8 sceneId, uint8 objectId, uint16 value, bool negative) :
_sceneId(sceneId),
_objectId(objectId),
_value(value),
_negative(negative)
{}
_negative(negative) {}
Command::ExecuteResult IfCommand::execute(ScriptExecutionContext &scriptExecCtx) {
Scene *const scene = scriptExecCtx.getGameData().getScene(_sceneId);
@ -108,4 +108,3 @@ Common::String IfCommand::debugString() const {
}
}

View File

@ -70,8 +70,7 @@ bool IfItemCommandParser::parse(const Common::String &line, ScriptParseContext &
IfItemCommand::IfItemCommand(const Common::String &item, bool negative) :
_item(item),
_negative(negative)
{}
_negative(negative) {}
Command::ExecuteResult IfItemCommand::execute(ScriptExecutionContext &scriptExecCtx) {
_cachedResult = scriptExecCtx.getGameData()._inventory.hasItem(_item);
@ -87,4 +86,3 @@ Common::String IfItemCommand::debugString() const {
}
}

View File

@ -68,4 +68,3 @@ Common::String IfPiggyCommand::debugString() const {
}
}

View File

@ -59,6 +59,7 @@ bool LabelCommandParser::parse(const Common::String &line, ScriptParseContext &p
return true;
}
const Common::String &LabelCommand::getName() const {
return _name;
}

View File

@ -80,4 +80,3 @@ Common::String NewRoomCommand::debugString() const {
}
}

View File

@ -61,6 +61,7 @@ bool RandomCommandParser::parse(const Common::String &line, ScriptParseContext &
return true;
}
bool RandomBlockStartParser::parse(const Common::String &line, ScriptParseContext &parseCtx, Command *&) {
if (line != "/") {
return false;
@ -84,6 +85,7 @@ void RandomBlockStartParser::transition(ScriptParseContext &parseCtx, Command *,
}
}
RandomCommand::RandomCommand(uint numChoices)
: _numChoices(numChoices),
_chosenNext(nullptr) {

View File

@ -49,4 +49,3 @@ private:
}
#endif

View File

@ -60,4 +60,3 @@ private:
}
#endif

View File

@ -110,4 +110,3 @@ public:
#else
REGISTER_PLUGIN_STATIC(MUTATIONOFJB, PLUGIN_TYPE_ENGINE, MutationOfJBMetaEngine);
#endif

View File

@ -52,7 +52,6 @@ MutationOfJBEngine::~MutationOfJBEngine() {
debug("MutationOfJBEngine::~MutationOfJBEngine");
}
void MutationOfJBEngine::setupCursor() {
const uint8 cursor[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

View File

@ -72,7 +72,6 @@ private:
CursorState _cursorState;
};
}
#endif

View File

@ -87,8 +87,7 @@ ScriptParseContext::ScriptParseContext(Common::SeekableReadStream &stream) :
_stream(stream),
_currentCommand(nullptr),
_lastCommand(nullptr),
_pendingRandomCommand(nullptr)
{}
_pendingRandomCommand(nullptr) {}
bool ScriptParseContext::readLine(Common::String &line) {
do {

View File

@ -58,4 +58,3 @@ Common::String toUpperCP895(const Common::String &str) {
}
}

View File

@ -32,7 +32,6 @@ namespace Common {
class String;
}
namespace MutationOfJB {
void reportFileMissingError(const char *fileName);

View File

@ -62,7 +62,9 @@ void ButtonWidget::handleEvent(const Common::Event &event) {
break;
}
}
void ButtonWidget::_draw(Graphics::ManagedSurface &surface) {
void ButtonWidget::draw(Graphics::ManagedSurface &surface) {
surface.blitFrom(_pressed ? _pressedSurface : _normalSurface, Common::Point(_area.left, _area.top));
}
}

View File

@ -44,7 +44,7 @@ public:
virtual void handleEvent(const Common::Event &event) override;
protected:
virtual void _draw(Graphics::ManagedSurface &) override;
virtual void draw(Graphics::ManagedSurface &) override;
private:
Graphics::Surface _normalSurface;

View File

@ -59,7 +59,7 @@ void ConversationWidget::clearChoices() {
markDirty();
}
void ConversationWidget::_draw(Graphics::ManagedSurface &surface) {
void ConversationWidget::draw(Graphics::ManagedSurface &surface) {
surface.blitFrom(_surface, Common::Point(_area.left, _area.top));
for (int i = 0; i < CONVERSATION_MAX_CHOICES; ++i) {
@ -94,4 +94,3 @@ void ConversationWidget::handleEvent(const Common::Event &event) {
}
}

View File

@ -51,7 +51,7 @@ public:
virtual void handleEvent(const Common::Event &event) override;
protected:
virtual void _draw(Graphics::ManagedSurface &surface) override;
virtual void draw(Graphics::ManagedSurface &surface) override;
private:
Graphics::Surface _surface;

View File

@ -30,7 +30,7 @@ ImageWidget::ImageWidget(Gui &gui, const Common::Rect &area, const Graphics::Sur
_image(image) {}
void ImageWidget::_draw(Graphics::ManagedSurface &surface) {
void ImageWidget::draw(Graphics::ManagedSurface &surface) {
surface.blitFrom(_image, Common::Point(_area.left, _area.top));
}

View File

@ -33,7 +33,7 @@ public:
ImageWidget(Gui &gui, const Common::Rect &area, const Graphics::Surface &image);
protected:
virtual void _draw(Graphics::ManagedSurface &surface) override;
virtual void draw(Graphics::ManagedSurface &surface) override;
private:
Graphics::Surface _image;

View File

@ -63,7 +63,7 @@ void InventoryWidget::drawInventoryItem(Graphics::ManagedSurface &surface, const
surface.blitFrom(_surfaces[surfaceNo], sourceRect, destStartPos);
}
void InventoryWidget::_draw(Graphics::ManagedSurface &surface) {
void InventoryWidget::draw(Graphics::ManagedSurface &surface) {
Inventory &inventory = _gui.getGame().getGameData().getInventory();
const Inventory::Items &items = inventory.getItems();
surface.fillRect(_area, 0x00);

View File

@ -35,7 +35,7 @@ namespace MutationOfJB {
class InventoryWidget : public Widget {
public:
InventoryWidget(Gui &gui, Gui::InventoryMap &inventoryMap, const Common::Array<Graphics::Surface> &inventorySurfaces);
virtual void _draw(Graphics::ManagedSurface &) override;
virtual void draw(Graphics::ManagedSurface &) override;
private:
void drawInventoryItem(Graphics::ManagedSurface &surface, const Common::String &item, int pos);

View File

@ -54,7 +54,7 @@ bool Widget::isDirty() const {
void Widget::update(Graphics::ManagedSurface &surface) {
if (_dirty) {
if (_visible) {
_draw(surface);
draw(surface);
}
_dirty = false;
}

View File

@ -55,7 +55,7 @@ public:
virtual void handleEvent(const Common::Event &) {}
protected:
virtual void _draw(Graphics::ManagedSurface &) = 0;
virtual void draw(Graphics::ManagedSurface &) = 0;
Gui &_gui;
Common::Rect _area;
@ -67,4 +67,3 @@ protected:
}
#endif