aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/video/robot_decoder.h
diff options
context:
space:
mode:
authorColin Snover2017-02-25 18:13:55 -0600
committerColin Snover2017-04-23 13:07:25 -0500
commitf3db412d6f3dd90893eb90a084491b90acdddc9e (patch)
tree0285436046d7dad038c92f9105866a37454c3ce8 /engines/sci/video/robot_decoder.h
parenta799cb3462a220afcd705c74291075f98520d87c (diff)
downloadscummvm-rg350-f3db412d6f3dd90893eb90a084491b90acdddc9e.tar.gz
scummvm-rg350-f3db412d6f3dd90893eb90a084491b90acdddc9e.tar.bz2
scummvm-rg350-f3db412d6f3dd90893eb90a084491b90acdddc9e.zip
SCI32: Serialize Robots in SCI3
This is necessary for at least Lighthouse, which maintains the state of Robots across save games.
Diffstat (limited to 'engines/sci/video/robot_decoder.h')
-rw-r--r--engines/sci/video/robot_decoder.h46
1 files changed, 38 insertions, 8 deletions
diff --git a/engines/sci/video/robot_decoder.h b/engines/sci/video/robot_decoder.h
index 9d8c720968..aa1d9da75c 100644
--- a/engines/sci/video/robot_decoder.h
+++ b/engines/sci/video/robot_decoder.h
@@ -469,23 +469,25 @@ public:
#pragma mark RobotDecoder
/**
- * RobotDecoder implements the logic required
- * for Robot animations.
- *
- * @note A paused or finished RobotDecoder was
- * classified as serializable in SCI3, but the
- * save/load code would attempt to use uninitialised
- * values, so it seems that robots were not ever
- * actually able to be saved.
+ * RobotDecoder implements the logic required for Robot animations.
*/
class RobotDecoder {
public:
RobotDecoder(SegManager *segMan);
~RobotDecoder();
+ GuiResourceId getResourceId() const {
+ return _robotId;
+ }
+
private:
SegManager *_segMan;
+ /**
+ * The ID of the currently loaded robot.
+ */
+ GuiResourceId _robotId;
+
#pragma mark Constants
public:
/**
@@ -1175,6 +1177,27 @@ private:
#pragma mark Rendering
public:
/**
+ * Gets the plane used to render the robot.
+ */
+ const reg_t getPlaneId() const {
+ return _planeId;
+ }
+
+ /**
+ * Gets the origin of the robot.
+ */
+ Common::Point getPosition() const {
+ return _position;
+ }
+
+ /**
+ * Gets the scale of the robot.
+ */
+ int16 getScale() const {
+ return _scaleInfo.x;
+ }
+
+ /**
* Puts the current dimensions of the robot, in game script
* coordinates, into the given rect, and returns the total
* number of frames in the robot animation.
@@ -1207,6 +1230,8 @@ public:
*/
void expandCel(byte *target, const byte* source, const int16 celWidth, const int16 celHeight) const;
+ int16 getPriority() const;
+
/**
* Sets the visual priority of the robot.
* @see Plane::_priority
@@ -1292,6 +1317,11 @@ private:
DecompressorLZS _decompressor;
/**
+ * The ID of the robot plane.
+ */
+ reg_t _planeId;
+
+ /**
* The origin of the robot animation, in screen
* coordinates.
*/