DIRECTOR: Fix palette loading

This commit is contained in:
Dmitry Iskrich 2016-06-10 13:35:46 +03:00 committed by Eugene Sandulenko
parent 8064274d3b
commit 2b57a711f6
2 changed files with 3 additions and 2 deletions

View File

@ -61,8 +61,8 @@ void DIBDecoder::destroy() {
void DIBDecoder::loadPalette(Common::SeekableReadStream &stream) {
uint16 steps = stream.size()/6;
uint16 index = (steps * 3) - 1;
_paletteColorCount = steps;
_palette = new byte[index];
for (uint8 i = 0; i < steps; i++) {
_palette[index - 2] = stream.readByte();
stream.readByte();

View File

@ -91,7 +91,8 @@ Score::Score(Archive &movie, Lingo &lingo) {
Common::SeekableReadStream *pal = _movieArchive->getResource(MKTAG('C', 'L', 'U', 'T'), clutList[0]);
palette.loadPalette(*pal);
g_system->getPaletteManager()->setPalette(palette.getPalette(), 0, 255);
g_system->getPaletteManager()->setPalette(palette.getPalette(), 0, palette.getPaletteColorCount());
}
void Score::loadFrames(Common::SeekableReadStream &stream) {