diff options
author | Colin Snover | 2016-10-26 20:51:05 -0500 |
---|---|---|
committer | Colin Snover | 2016-10-26 20:56:40 -0500 |
commit | 4044ed5b6f8598dd7d1e62d64b8b875130dbaf53 (patch) | |
tree | 173747391d509ddbe3bf39d9878e954e49e68827 /engines/sci | |
parent | 8028b3c2907c559699afcb4c4895d39ad041f308 (diff) | |
download | scummvm-rg350-4044ed5b6f8598dd7d1e62d64b8b875130dbaf53.tar.gz scummvm-rg350-4044ed5b6f8598dd7d1e62d64b8b875130dbaf53.tar.bz2 scummvm-rg350-4044ed5b6f8598dd7d1e62d64b8b875130dbaf53.zip |
SCI32: Initialize video buffers to avoid flash of garbage memory
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/graphics/video32.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp index 1db66644c8..38a7b867d5 100644 --- a/engines/sci/graphics/video32.cpp +++ b/engines/sci/graphics/video32.cpp @@ -68,7 +68,8 @@ void SEQPlayer::play(const Common::String &fileName, const int16 numTicks, const // mechanism that is very similar to that used by the VMD player, which // allows the SEQ to be drawn into a bitmap ScreenItem and displayed using // the normal graphics system. - _segMan->allocateBitmap(&_bitmap, _decoder->getWidth(), _decoder->getHeight(), kDefaultSkipColor, 0, 0, kLowResX, kLowResY, 0, false, false); + SciBitmap &bitmap = *_segMan->allocateBitmap(&_bitmap, _decoder->getWidth(), _decoder->getHeight(), kDefaultSkipColor, 0, 0, kLowResX, kLowResY, 0, false, false); + bitmap.getBuffer().fillRect(Common::Rect(_decoder->getWidth(), _decoder->getHeight()), 0); CelInfo32 celInfo; celInfo.type = kCelTypeMem; @@ -262,7 +263,8 @@ void AVIPlayer::init() { g_sci->_gfxFrameout->addPlane(*_plane); if (_decoder->getPixelFormat().bytesPerPixel == 1) { - _segMan->allocateBitmap(&_bitmap, _decoder->getWidth(), _decoder->getHeight(), kDefaultSkipColor, 0, 0, xRes, yRes, 0, false, false); + SciBitmap &bitmap = *_segMan->allocateBitmap(&_bitmap, _decoder->getWidth(), _decoder->getHeight(), kDefaultSkipColor, 0, 0, xRes, yRes, 0, false, false); + bitmap.getBuffer().fillRect(Common::Rect(_decoder->getWidth(), _decoder->getHeight()), 0); CelInfo32 celInfo; celInfo.type = kCelTypeMem; @@ -705,6 +707,7 @@ VMDPlayer::EventFlags VMDPlayer::playUntilEvent(const EventFlags flags) { reg_t bitmapId; SciBitmap &vmdBitmap = *_segMan->allocateBitmap(&bitmapId, vmdRect.width(), vmdRect.height(), 255, 0, 0, screenWidth, screenHeight, 0, false, false); + vmdBitmap.getBuffer().fillRect(Common::Rect(vmdRect.width(), vmdRect.height()), 0); if (screenWidth != scriptWidth || screenHeight != scriptHeight) { mulru(vmdRect, Ratio(scriptWidth, screenWidth), Ratio(scriptHeight, screenHeight), 1); |