diff options
author | Dmitry Iskrich | 2016-06-04 22:10:51 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 14d0bb6844accf4cb3d840d5ff01c25298bd7483 (patch) | |
tree | 099c1670dd06594e8422ca854406dcf12025fedc /engines | |
parent | cc2abbbb9c7190a567aee9babc2073757a4edc0f (diff) | |
download | scummvm-rg350-14d0bb6844accf4cb3d840d5ff01c25298bd7483.tar.gz scummvm-rg350-14d0bb6844accf4cb3d840d5ff01c25298bd7483.tar.bz2 scummvm-rg350-14d0bb6844accf4cb3d840d5ff01c25298bd7483.zip |
DIRECTOR: Find CLUT table in score initialization
Diffstat (limited to 'engines')
-rw-r--r-- | engines/director/score.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp index b896665a1c..1e9ea191bc 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -58,6 +58,17 @@ Score::Score(Archive &movie) { if (_movieArchive->hasResource(MKTAG('M','C','N','M'), 0)) { debug("Mac name %s", _movieArchive->getName(MKTAG('M','C','N','M'), 0).c_str()); } + DIBDecoder palette; + Common::Array<uint16> clutList = _movieArchive->getResourceIDList(MKTAG('C','L','U','T')); + + if (clutList.size() > 1) + error("More than one palette was found"); + if (clutList.size() == 0) + error("CLUT not found"); + + Common::SeekableReadStream *pal = _movieArchive->getResource(MKTAG('C', 'L', 'U', 'T'), clutList[0]); + palette.loadPalette(*pal); + g_system->getPaletteManager()->setPalette(palette.getPalette(), 0, 255); } void Score::loadFrames(Common::SeekableReadStream &stream) { @@ -486,10 +497,6 @@ void Frame::readSprite(Common::SeekableReadStream &stream, uint16 offset, uint16 void Frame::display(Archive &_movie, Graphics::ManagedSurface &surface, Common::Rect moviRect) { surface.clear(); - DIBDecoder palette; - Common::SeekableReadStream *pal = _movie.getResource(MKTAG('C', 'L', 'U', 'T'), 1025); - palette.loadPalette(*pal); - g_system->getPaletteManager()->setPalette(palette.getPalette(), 0, 255); for (uint16 i = 0; i < CHANNEL_COUNT; i++) { if (_sprites[i]->_enabled) { |