diff options
author | Gregory Montoir | 2007-01-30 22:44:14 +0000 |
---|---|---|
committer | Gregory Montoir | 2007-01-30 22:44:14 +0000 |
commit | 9abaa064a07bfb44ea3663e026cce874c77d449e (patch) | |
tree | 510a29a939ba31bbdab07993f72a3516e7dac39e /engines/scumm/smush/smush_player.cpp | |
parent | 3766e0a77df3839c1622b254390e665c009d4b74 (diff) | |
download | scummvm-rg350-9abaa064a07bfb44ea3663e026cce874c77d449e.tar.gz scummvm-rg350-9abaa064a07bfb44ea3663e026cce874c77d449e.tar.bz2 scummvm-rg350-9abaa064a07bfb44ea3663e026cce874c77d449e.zip |
got rid of codec37/codec47 init/deinit methods, cleanup
svn-id: r25295
Diffstat (limited to 'engines/scumm/smush/smush_player.cpp')
-rw-r--r-- | engines/scumm/smush/smush_player.cpp | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/engines/scumm/smush/smush_player.cpp b/engines/scumm/smush/smush_player.cpp index ce2f32d29b..5c89e758cc 100644 --- a/engines/scumm/smush/smush_player.cpp +++ b/engines/scumm/smush/smush_player.cpp @@ -40,6 +40,8 @@ #include "scumm/util.h" #include "scumm/smush/channel.h" #include "scumm/smush/chunk.h" +#include "scumm/smush/codec37.h" +#include "scumm/smush/codec47.h" #include "scumm/smush/smush_font.h" #include "scumm/smush/smush_mixer.h" #include "scumm/smush/smush_player.h" @@ -238,6 +240,8 @@ SmushPlayer::SmushPlayer(ScummEngine_v7 *scumm) { _vm = scumm; _version = -1; _nbframes = 0; + _codec37 = 0; + _codec47 = 0; _smixer = NULL; _strings = NULL; _sf[0] = NULL; @@ -284,8 +288,6 @@ SmushPlayer::~SmushPlayer() { void SmushPlayer::init(int32 speed) { _frame = 0; _speed = speed; - _codec37AlreadyInit = false; - _codec47AlreadyInit = false; _endOfFile = false; _vm->_smushVideoShouldFinish = false; @@ -354,14 +356,10 @@ void SmushPlayer::release() { _initDone = false; - if (_codec37AlreadyInit) { - _codec37.deinit(); - _codec37AlreadyInit = false; - } - if (_codec47AlreadyInit) { - _codec47.deinit(); - _codec47AlreadyInit = false; - } + delete _codec37; + _codec37 = 0; + delete _codec47; + _codec47 = 0; } void SmushPlayer::checkBlock(const Chunk &b, Chunk::type type_expected, uint32 min_size) { @@ -798,18 +796,16 @@ void SmushPlayer::decodeFrameObject(int codec, const uint8 *src, int left, int t smush_decode_codec1(_dst, src, left, top, width, height, _vm->_screenWidth); break; case 37: - if (!_codec37AlreadyInit) { - _codec37.init(width, height); - _codec37AlreadyInit = true; - } - _codec37.decode(_dst, src); + if (!_codec37) + _codec37 = new Codec37Decoder(width, height); + if (_codec37) + _codec37->decode(_dst, src); break; case 47: - if (!_codec47AlreadyInit) { - _codec47.init(width, height); - _codec47AlreadyInit = true; - } - _codec47.decode(_dst, src); + if (!_codec47) + _codec47 = new Codec47Decoder(width, height); + if (_codec47) + _codec47->decode(_dst, src); break; default: error("Invalid codec for frame object : %d", codec); |