From 8981fa3f164aa8f397df2af8b85d6edfa4bdd883 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 7 Feb 2011 17:47:20 +0000 Subject: [PATCH] VIDEO: Inline SMK palette svn-id: r55805 --- video/smk_decoder.cpp | 6 ++---- video/smk_decoder.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/video/smk_decoder.cpp b/video/smk_decoder.cpp index 366c434b1b7..0a1bcea1dc8 100644 --- a/video/smk_decoder.cpp +++ b/video/smk_decoder.cpp @@ -485,7 +485,6 @@ bool SmackerDecoder::load(Common::SeekableReadStream *stream) { // Height needs to be doubled if we have flags (Y-interlaced or Y-doubled) _surface->create(width, height * (_header.flags ? 2 : 1), 1); - _palette = (byte *)malloc(3 * 256); memset(_palette, 0, 3 * 256); return true; } @@ -519,7 +518,6 @@ void SmackerDecoder::close() { delete[] _frameSizes; delete[] _frameTypes; - free(_palette); reset(); } @@ -858,8 +856,8 @@ void SmackerDecoder::unpackPalette() { uint32 len = 4 * _fileStream->readByte(); byte *chunk = (byte *)malloc(len); - _fileStream->read(&chunk[0], len); - byte *p = &chunk[0]; + _fileStream->read(chunk, len); + byte *p = chunk; byte oldPalette[3*256]; memcpy(oldPalette, _palette, 3 * 256); diff --git a/video/smk_decoder.h b/video/smk_decoder.h index 3476dbe5349..61503357633 100644 --- a/video/smk_decoder.h +++ b/video/smk_decoder.h @@ -119,7 +119,7 @@ protected: byte *_frameTypes; byte *_frameData; // The RGB palette - byte *_palette; + byte _palette[3 * 256]; bool _dirtyPalette; Common::Rational _frameRate;