MADS: Fix for scene loading in teleporter scenes

This commit is contained in:
Paul Gilbert 2014-05-04 15:05:31 -04:00
parent ff5b97e75a
commit 36a1b66c71
4 changed files with 13 additions and 30 deletions

View File

@ -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) {

View File

@ -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

View File

@ -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];
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);
}
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

View File

@ -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");
}