[Scummvm-git-logs] scummvm master -> d18c83e8b8b96c3849b7bdd34b17a6bb91da4e78

LubomirR lubomirr at lubomirr.eu
Sun Feb 3 23:35:51 CET 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d18c83e8b8 MUTATIONOFJB: Fix play animation command.


Commit: d18c83e8b8b96c3849b7bdd34b17a6bb91da4e78
    https://github.com/scummvm/scummvm/commit/d18c83e8b8b96c3849b7bdd34b17a6bb91da4e78
Author: Ľubomír Remák (lubomirr at lubomirr.eu)
Date: 2019-02-03T23:35:43+01:00

Commit Message:
MUTATIONOFJB: Fix play animation command.

Changed paths:
    engines/mutationofjb/commands/playanimationcommand.cpp
    engines/mutationofjb/commands/playanimationcommand.h
    engines/mutationofjb/commands/setobjectframecommand.cpp
    engines/mutationofjb/gamedata.h
    engines/mutationofjb/room.cpp
    engines/mutationofjb/room.h


diff --git a/engines/mutationofjb/commands/playanimationcommand.cpp b/engines/mutationofjb/commands/playanimationcommand.cpp
index 60c6f1c..6f70a81 100644
--- a/engines/mutationofjb/commands/playanimationcommand.cpp
+++ b/engines/mutationofjb/commands/playanimationcommand.cpp
@@ -40,8 +40,8 @@ bool PlayAnimationCommandParser::parse(const Common::String &line, ScriptParseCo
 	if (line.size() < 11 || (!line.hasPrefix("FLB ") && !line.hasPrefix("FLX ")))
 		return false;
 
-	const uint8 fromFrame = (uint8) atoi(line.c_str() + 4);
-	const uint8 toFrame = (uint8) atoi(line.c_str() + 8);
+	const int fromFrame = atoi(line.c_str() + 4);
+	const int toFrame = atoi(line.c_str() + 8);
 
 	command = new PlayAnimationCommand(fromFrame, toFrame);
 	return true;
diff --git a/engines/mutationofjb/commands/playanimationcommand.h b/engines/mutationofjb/commands/playanimationcommand.h
index da7ff25..4f0d4d7 100644
--- a/engines/mutationofjb/commands/playanimationcommand.h
+++ b/engines/mutationofjb/commands/playanimationcommand.h
@@ -37,14 +37,14 @@ public:
 
 class PlayAnimationCommand : public SeqCommand {
 public:
-	PlayAnimationCommand(uint8 fromFrame, uint8 toFrame) : _fromFrame(fromFrame), _toFrame(toFrame) {}
+	PlayAnimationCommand(int fromFrame, int toFrame) : _fromFrame(fromFrame), _toFrame(toFrame) {}
 	const Common::String &getName() const;
 
 	virtual ExecuteResult execute(ScriptExecutionContext &scriptExecCtx) override;
 	virtual Common::String debugString() const override;
 private:
-	uint8 _fromFrame;
-	uint8 _toFrame;
+	int _fromFrame;
+	int _toFrame;
 };
 
 }
diff --git a/engines/mutationofjb/commands/setobjectframecommand.cpp b/engines/mutationofjb/commands/setobjectframecommand.cpp
index 8fcff2b..9524729 100644
--- a/engines/mutationofjb/commands/setobjectframecommand.cpp
+++ b/engines/mutationofjb/commands/setobjectframecommand.cpp
@@ -40,7 +40,7 @@ bool SetObjectFrameCommandParser::parse(const Common::String &line, ScriptParseC
 		return false;
 
 	const uint8 objectId = (uint8) atoi(line.c_str() + 8);
-	const uint8 frame = (uint8) atoi(line.c_str() + 11);
+	const unsigned int frame = atoi(line.c_str() + 11);
 
 	command = new SetObjectFrameCommand(objectId, frame);
 	return true;
diff --git a/engines/mutationofjb/gamedata.h b/engines/mutationofjb/gamedata.h
index c2ddfd6..e4bc611 100644
--- a/engines/mutationofjb/gamedata.h
+++ b/engines/mutationofjb/gamedata.h
@@ -155,6 +155,7 @@ struct Object : public Common::Serializable {
 	uint8  _numFrames;
 	/**
 	 * Low 8 bits of the 16-bit starting room frame (FS register).
+	 * This is in the room frame space.
 	 *
 	 * @see _roomFrameMSB
 	 */
@@ -168,7 +169,7 @@ struct Object : public Common::Serializable {
 	/**
 	 * Current animation frame (CA register).
 	 *
-	 * @note Absolute index to the frame space. Numbered from 1.
+	 * @note Index in the shared object frame space. Numbered from 1.
 	 */
 	uint8  _currentFrame;
 	/** X coordinate of the object rectangle (XX register). */
@@ -183,6 +184,7 @@ struct Object : public Common::Serializable {
 	uint16 _WX;
 	/**
 	 * High 8 bits of the 16-bit starting room frame (WY register).
+	 * This is in the room frame space.
 	 *
 	 * @see _roomFrameLSB
 	 */
diff --git a/engines/mutationofjb/room.cpp b/engines/mutationofjb/room.cpp
index 1d49fb3..09c0f29 100644
--- a/engines/mutationofjb/room.cpp
+++ b/engines/mutationofjb/room.cpp
@@ -181,7 +181,7 @@ void Room::drawStatic(Static *const stat) {
 	drawFrames(frame, frame, staticArea, 0xC0); // Hardcoded threshold.
 }
 
-void Room::drawFrames(uint8 fromFrame, uint8 toFrame, const Common::Rect &area, uint8 threshold) {
+void Room::drawFrames(int fromFrame, int toFrame, const Common::Rect &area, uint8 threshold) {
 	GameData &gameData = _game->getGameData();
 
 	Scene *const scene = gameData.getCurrentScene();
diff --git a/engines/mutationofjb/room.h b/engines/mutationofjb/room.h
index 1c76344..ff0fbff 100644
--- a/engines/mutationofjb/room.h
+++ b/engines/mutationofjb/room.h
@@ -64,7 +64,7 @@ public:
 	 * @param stat Static.
 	 */
 	void drawStatic(Static *stat);
-	void drawFrames(uint8 fromFrame, uint8 toFrame, const Common::Rect &area = Common::Rect(), uint8 threshold = 0xFF);
+	void drawFrames(int fromFrame, int toFrame, const Common::Rect &area = Common::Rect(), uint8 threshold = 0xFF);
 	void initialDraw();
 	void redraw(bool useBackgroundBuffer = true);
 private:





More information about the Scummvm-git-logs mailing list