From 61f8a035c78f9790e8f88dae9b584f6d6c739c13 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 29 Sep 2004 17:50:17 +0000 Subject: Hack to work around bug #1037052 svn-id: r15349 --- scumm/smush/smush_player.cpp | 18 ++++++++++++++++++ scumm/smush/smush_player.h | 2 ++ 2 files changed, 20 insertions(+) (limited to 'scumm/smush') diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp index 88323adaf0..8f83b87f87 100644 --- a/scumm/smush/smush_player.cpp +++ b/scumm/smush/smush_player.cpp @@ -257,6 +257,18 @@ void SmushPlayer::init() { _vm->_smushVideoShouldFinish = false; _vm->setDirtyColors(0, 255); _dst = _vm->virtscr[0].getPixels(0, 0); + + // HACK HACK HACK: This is an *evil* trick, beware! + // We do this to fix bug #1037052. A proper solution would change all the + // drawing code to use the pitch value specified by the virtual screen. + // However, since a lot of the SMUSH code currently assumes the screen + // width and pitch to be equal, this will require lots of changes. So + // we resort to this hackish solution for now. + _origPitch = _vm->virtscr[0].pitch; + _origNumStrips = _vm->gdi._numStrips; + _vm->virtscr[0].pitch = _vm->virtscr[0].w; + _vm->gdi._numStrips = _vm->virtscr[0].w / 8; + _smixer = new SmushMixer(_vm->_mixer); g_timer->installTimerProc(&timerCallback, _speed, this); } @@ -298,6 +310,12 @@ void SmushPlayer::release() { _vm->_mixer->stopHandle(_IACTchannel); _vm->_fullRedraw = true; + + + // HACK HACK HACK: This is an *evil* trick, beware! See above for + // some explanation. + _vm->virtscr[0].pitch = _origPitch; + _vm->gdi._numStrips = _origNumStrips; } void SmushPlayer::checkBlock(const Chunk &b, Chunk::type type_expected, uint32 min_size) { diff --git a/scumm/smush/smush_player.h b/scumm/smush/smush_player.h index 5802c60437..4ccb44c84e 100644 --- a/scumm/smush/smush_player.h +++ b/scumm/smush/smush_player.h @@ -83,6 +83,8 @@ public: protected: SmushFont *_sf[5]; int _width, _height; + + int _origPitch, _origNumStrips; void insanity(bool); void setPalette(const byte *palette); -- cgit v1.2.3