diff options
author | Ľubomír Remák | 2018-03-09 21:24:02 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2018-08-25 23:12:01 +0200 |
commit | d3e281e24cb0ce522dc943b2d2a6bdde0766b62c (patch) | |
tree | 8f2c00acdadff4109451f4f0692de8b6b2f0d020 /engines/mutationofjb | |
parent | b4dad9bca7593029ab368bc99f7bd96c71cbf4d8 (diff) | |
download | scummvm-rg350-d3e281e24cb0ce522dc943b2d2a6bdde0766b62c.tar.gz scummvm-rg350-d3e281e24cb0ce522dc943b2d2a6bdde0766b62c.tar.bz2 scummvm-rg350-d3e281e24cb0ce522dc943b2d2a6bdde0766b62c.zip |
MUTATIONOFJB: Fix uninitialized ChangeOperation, fix parsing tag in IF command and add some comments.
Diffstat (limited to 'engines/mutationofjb')
-rw-r--r-- | engines/mutationofjb/commands/changecommand.cpp | 3 | ||||
-rw-r--r-- | engines/mutationofjb/commands/ifcommand.cpp | 2 | ||||
-rw-r--r-- | engines/mutationofjb/game.cpp | 5 | ||||
-rw-r--r-- | engines/mutationofjb/game.h | 22 |
4 files changed, 24 insertions, 8 deletions
diff --git a/engines/mutationofjb/commands/changecommand.cpp b/engines/mutationofjb/commands/changecommand.cpp index e9bb9cc2e6..e4699ebb74 100644 --- a/engines/mutationofjb/commands/changecommand.cpp +++ b/engines/mutationofjb/commands/changecommand.cpp @@ -195,8 +195,9 @@ bool ChangeSceneCommandParser::parse(const Common::String &line, ScriptParseCont } int ChangeCommandParser::parseInteger(const char *val, ChangeCommand::ChangeOperation &op) { + op = ChangeCommand::SetValue; + if (!val || !(*val)) { - op = ChangeCommand::SetValue; return 0; } diff --git a/engines/mutationofjb/commands/ifcommand.cpp b/engines/mutationofjb/commands/ifcommand.cpp index 0643c3e161..a2816c7edd 100644 --- a/engines/mutationofjb/commands/ifcommand.cpp +++ b/engines/mutationofjb/commands/ifcommand.cpp @@ -64,7 +64,7 @@ bool IfCommandParser::parse(const Common::String &line, ScriptParseContext &pars } const char *const cstr = line.c_str(); - const char tag = cstr[2]; + const char tag = cstr[2] == ' ' ? 0 : cstr[2]; const uint8 sceneId = atoi(cstr + 3); const uint8 objectId = atoi(cstr + 6); const uint8 value = atoi(cstr + 9); diff --git a/engines/mutationofjb/game.cpp b/engines/mutationofjb/game.cpp index 15fbd033fb..c79f8d95b1 100644 --- a/engines/mutationofjb/game.cpp +++ b/engines/mutationofjb/game.cpp @@ -92,7 +92,7 @@ bool Static::loadFromStream(Common::ReadStream &stream) { } bool Bitmap::loadFromStream(Common::ReadStream &stream) { - _unknown = stream.readByte(); + _frame = stream.readByte(); _isVisible = stream.readByte(); _x1 = stream.readUint16LE(); _y1 = stream.readByte(); @@ -133,8 +133,7 @@ bool Scene::loadFromStream(Common::ReadStream &stream) { _bitmaps[i].loadFromStream(stream); } - _obstacleY1 = stream.readByte(); - _unknown386 = stream.readByte(); + _obstacleY1 = stream.readUint16LE(); _palRotStart = stream.readByte(); _palRotEnd = stream.readByte(); _palRotPeriod = stream.readByte(); diff --git a/engines/mutationofjb/game.h b/engines/mutationofjb/game.h index 77e336f024..550be2efc8 100644 --- a/engines/mutationofjb/game.h +++ b/engines/mutationofjb/game.h @@ -35,16 +35,33 @@ namespace MutationOfJB { static const uint8 MAX_STR_LENGTH = 0x14; struct Door { + /* + Door name. + Can be empty - deactivates door completely. + */ char _name[MAX_STR_LENGTH + 1]; + /* + Scene ID where the door leads. + Can be 0 - you can hover your mouse over it, but clicking it doesn't do anything (unless scripted). + */ uint8 _destSceneId; + /* X coordinate for player's position after going through the door. */ uint16 _destX; + /* Y coordinate for player's position after going through the door. */ uint16 _destY; + /* X coordinate of the door rectangle. */ uint16 _x; + /* Y coordinate of the door rectangle. */ uint8 _y; + /* Width of the door rectangle. */ uint16 _width; + /* Height of the door rectangle. */ uint8 _height; + /* X coordinate for position towards player will walk after clicking the door. */ uint16 _walkToX; + /* Y coordinate for position towards player will walk after clicking the door. */ uint8 _walkToY; + /* Unknown for now - likely not even used. */ uint8 _SP; bool loadFromStream(Common::ReadStream &stream); @@ -84,7 +101,7 @@ struct Static { }; struct Bitmap { - uint8 _unknown; + uint8 _frame; uint8 _isVisible; uint16 _x1; uint8 _y1; @@ -118,8 +135,7 @@ struct Scene { Bitmap _bitmaps[10]; - uint8 _obstacleY1; - uint8 _unknown386; + uint16 _obstacleY1; uint8 _palRotStart; uint8 _palRotEnd; uint8 _palRotPeriod; |