aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-05-04 15:05:31 -0400
committerPaul Gilbert2014-05-04 15:05:31 -0400
commit36a1b66c71543749cdf9276bb18f2e85b98a46e9 (patch)
tree30f192b8e5961c4e006b1d652b02b8ce09a2dc7b /engines
parentff5b97e75af06e07692eb9ddd9da73055997eefe (diff)
downloadscummvm-rg350-36a1b66c71543749cdf9276bb18f2e85b98a46e9.tar.gz
scummvm-rg350-36a1b66c71543749cdf9276bb18f2e85b98a46e9.tar.bz2
scummvm-rg350-36a1b66c71543749cdf9276bb18f2e85b98a46e9.zip
MADS: Fix for scene loading in teleporter scenes
Diffstat (limited to 'engines')
-rw-r--r--engines/mads/assets.cpp11
-rw-r--r--engines/mads/assets.h5
-rw-r--r--engines/mads/scene_data.cpp25
-rw-r--r--engines/mads/sprites.cpp4
4 files changed, 14 insertions, 31 deletions
diff --git a/engines/mads/assets.cpp b/engines/mads/assets.cpp
index 46a6d3c916..bf9647dda4 100644
--- a/engines/mads/assets.cpp
+++ b/engines/mads/assets.cpp
@@ -205,17 +205,6 @@ MSprite *SpriteAsset::getFrame(int frameIndex) {
}
}
-
-void SpriteAsset::drawScaled(int frameNumber, MSurface &depthSurface, MSurface &destSurface,
- int scale, int depth, const Common::Point &pos) {
- error("TODO: SpriteAsset::drawScaled - map to frame methods");
-}
-
-void SpriteAsset::depthDraw(MSurface *surface, MSurface *depthSurface, int frameNumber,
- const Common::Point &pt, int depth) {
- error("TODO: map depthDraw to frame draw methods");
-}
-
/*------------------------------------------------------------------------*/
SpriteSetCharInfo::SpriteSetCharInfo(Common::SeekableReadStream *s) {
diff --git a/engines/mads/assets.h b/engines/mads/assets.h
index dfe6db086e..874eee7925 100644
--- a/engines/mads/assets.h
+++ b/engines/mads/assets.h
@@ -105,11 +105,6 @@ public:
byte *getPalette() { return _palette; }
int getColorCount() { return _colorCount; }
bool isBackground() const { return _isBackground; }
-
- void drawScaled(int frameNumber, MSurface &depthSurface, MSurface &destSurface,
- int scale, int depth, const Common::Point &pos);
- void depthDraw(MSurface *surface, MSurface *depthSurface, int frameNumber,
- const Common::Point &pt, int depth);
};
} // End of namespace MADS
diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp
index 646106ee9a..65220ced35 100644
--- a/engines/mads/scene_data.cpp
+++ b/engines/mads/scene_data.cpp
@@ -226,17 +226,15 @@ void SceneInfo::load(int sceneId, int variant, const Common::String &resName,
Common::Array<SpriteAsset *> spriteSets;
Common::Array<int> usageList;
- if (flags & 1) {
- for (uint i = 0; i < setNames.size(); ++i) {
- Common::String setResName;
- if (sceneFlag || resName.hasPrefix("*"))
- setResName += "*";
- setResName += setNames[i];
-
- SpriteAsset *sprites = new SpriteAsset(_vm, setResName, flags);
- spriteSets.push_back(sprites);
- usageList.push_back(sprites->_usageIndex);
- }
+ for (uint i = 0; i < setNames.size(); ++i) {
+ Common::String setResName;
+ if (sceneFlag || resName.hasPrefix("*"))
+ setResName += "*";
+ setResName += setNames[i];
+
+ SpriteAsset *sprites = new SpriteAsset(_vm, setResName, flags);
+ spriteSets.push_back(sprites);
+ usageList.push_back(sprites->_usageIndex);
}
_vm->_palette->_paletteUsage.updateUsage(usageList, _usageIndex);
@@ -246,8 +244,9 @@ void SceneInfo::load(int sceneId, int variant, const Common::String &resName,
SpriteAsset *asset = spriteSets[si._spriteSetIndex];
assert(asset && _depthStyle != 2);
- asset->drawScaled(asset->getCount(), depthSurface, bgSurface,
- si._scale, si._depth, si._position);
+ MSprite *spr = asset->getFrame(asset->getCount() - 1);
+ bgSurface.copyFrom(spr, si._position, si._depth, &depthSurface, si._scale,
+ spr->getTransparencyIndex());
}
// Free the sprite sets
diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp
index 7bd8407c41..432a0e17df 100644
--- a/engines/mads/sprites.cpp
+++ b/engines/mads/sprites.cpp
@@ -258,8 +258,8 @@ void SpriteSlots::drawBackground() {
if (spriteSlot._depth <= 1) {
frame->copyTo(&scene._backgroundSurface, frame->getTransparencyIndex());
} else if (scene._depthStyle == 0) {
- asset->depthDraw(&scene._backgroundSurface, &scene._depthSurface, spriteSlot._frameNumber,
- pt, spriteSlot._depth);
+ scene._backgroundSurface.copyFrom(frame, pt, spriteSlot._depth, &scene._backgroundSurface,
+ 100, frame->getTransparencyIndex());
} else {
error("Unsupported depth style");
}