aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
diff options
context:
space:
mode:
authorPaul Gilbert2015-05-16 22:48:24 -0400
committerPaul Gilbert2015-05-16 22:48:24 -0400
commit46e27b6293c0de767c9713c08e89e63dcf52fcc3 (patch)
tree06453f1a036e673a154521e065a0c2c88f425683 /engines/sherlock
parent7aa804b5ccd3489c852bbde01362bd2ce91d6cf8 (diff)
downloadscummvm-rg350-46e27b6293c0de767c9713c08e89e63dcf52fcc3.tar.gz
scummvm-rg350-46e27b6293c0de767c9713c08e89e63dcf52fcc3.tar.bz2
scummvm-rg350-46e27b6293c0de767c9713c08e89e63dcf52fcc3.zip
SHERLOCK: Update CAnim loading for Rose Tattoo
Diffstat (limited to 'engines/sherlock')
-rw-r--r--engines/sherlock/objects.cpp23
-rw-r--r--engines/sherlock/objects.h11
-rw-r--r--engines/sherlock/scene.cpp7
3 files changed, 30 insertions, 11 deletions
diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp
index c6254ee7b5..2576ff04d6 100644
--- a/engines/sherlock/objects.cpp
+++ b/engines/sherlock/objects.cpp
@@ -1135,17 +1135,30 @@ const Common::Rect Object::getOldBounds() const {
/**
* Load the data for the animation
*/
-void CAnim::load(Common::SeekableReadStream &s) {
+void CAnim::load(Common::SeekableReadStream &s, bool isRoseTattoo) {
char buffer[12];
s.read(buffer, 12);
_name = Common::String(buffer);
- s.read(_sequences, 30);
+ if (isRoseTattoo) {
+ Common::fill(&_sequences[0], &_sequences[30], 0);
+ _size = s.readUint32LE();
+ } else {
+ s.read(_sequences, 30);
+ }
+
_position.x = s.readSint16LE();
_position.y = s.readSint16LE();
- _size = s.readUint32LE();
- _type = (SpriteType)s.readUint16LE();
- _flags = s.readByte();
+
+ if (isRoseTattoo) {
+ _flags = s.readByte();
+ _scaleVal = s.readSint16LE();
+ } else {
+ _size = s.readUint32LE();
+ _type = (SpriteType)s.readUint16LE();
+ _flags = s.readByte();
+ }
+
_goto.x = s.readSint16LE();
_goto.y = s.readSint16LE();
_gotoDir = s.readSint16LE();
diff --git a/engines/sherlock/objects.h b/engines/sherlock/objects.h
index 2073f06f88..fd4a103a8d 100644
--- a/engines/sherlock/objects.h
+++ b/engines/sherlock/objects.h
@@ -256,17 +256,22 @@ public:
struct CAnim {
Common::String _name; // Name
- byte _sequences[MAX_FRAME]; // Animation sequences
Common::Point _position; // Position
int _size; // Size of uncompressed animation
- SpriteType _type;
int _flags; // Tells if can be walked behind
Common::Point _goto; // coords holmes should walk to before starting canim
int _gotoDir;
Common::Point _teleportPos; // Location Holmes shoul teleport to after
int _teleportDir; // playing canim
- void load(Common::SeekableReadStream &s);
+ // Scalpel specific
+ byte _sequences[MAX_FRAME]; // Animation sequences
+ SpriteType _type;
+
+ // Rose Tattoo specific
+ int _scaleVal; // How much the canim is scaled
+
+ void load(Common::SeekableReadStream &s, bool isRoseTattoo);
};
struct SceneImage {
diff --git a/engines/sherlock/scene.cpp b/engines/sherlock/scene.cpp
index 034896486e..0ac2eec0ff 100644
--- a/engines/sherlock/scene.cpp
+++ b/engines/sherlock/scene.cpp
@@ -398,13 +398,14 @@ bool Scene::loadScene(const Common::String &filename) {
// Load in cAnim list
_cAnim.clear();
if (bgHeader._numcAnimations) {
+ int animSize = _vm->getGameID() == GType_SerratedScalpel ? 65 : 47;
Common::SeekableReadStream *canimStream = _lzwMode ?
- Resources::decompressLZ(*rrmStream, 65 * bgHeader._numcAnimations) :
- rrmStream->readStream(65 * bgHeader._numcAnimations);
+ res.decompress(*rrmStream, animSize * bgHeader._numcAnimations) :
+ rrmStream->readStream(animSize * bgHeader._numcAnimations);
_cAnim.resize(bgHeader._numcAnimations);
for (uint idx = 0; idx < _cAnim.size(); ++idx)
- _cAnim[idx].load(*canimStream);
+ _cAnim[idx].load(*canimStream, _vm->getGameID() == GType_RoseTattoo);
delete canimStream;
}