diff options
author | Paul Gilbert | 2013-12-18 08:53:44 -0500 |
---|---|---|
committer | Paul Gilbert | 2013-12-18 08:53:44 -0500 |
commit | 23f9cb19b4e4d36b2a1c52847a54a8ae9c430f32 (patch) | |
tree | dd4ef3b57e0cf79db82fe171a3de4c006b5dbdda | |
parent | b99176fee6f8f3f78783f19ba760fbb35647044b (diff) | |
download | scummvm-rg350-23f9cb19b4e4d36b2a1c52847a54a8ae9c430f32.tar.gz scummvm-rg350-23f9cb19b4e4d36b2a1c52847a54a8ae9c430f32.tar.bz2 scummvm-rg350-23f9cb19b4e4d36b2a1c52847a54a8ae9c430f32.zip |
VOYEUR: In progress work on fixing initial apartment animation
-rw-r--r-- | engines/voyeur/events.cpp | 9 | ||||
-rw-r--r-- | engines/voyeur/files_threads.cpp | 3 | ||||
-rw-r--r-- | engines/voyeur/graphics.cpp | 32 | ||||
-rw-r--r-- | engines/voyeur/graphics.h | 1 |
4 files changed, 39 insertions, 6 deletions
diff --git a/engines/voyeur/events.cpp b/engines/voyeur/events.cpp index 6dbd7de4a5..b752c50c0c 100644 --- a/engines/voyeur/events.cpp +++ b/engines/voyeur/events.cpp @@ -201,8 +201,8 @@ void EventsManager::videoTimer() { if (_gameData._hasPalette) { _gameData._hasPalette = false; - g_system->getPaletteManager()->setPalette(_gameData._palette, - _gameData._palStartIndex, + g_system->getPaletteManager()->setPalette(_gameData._palette + + _gameData._palStartIndex * 3, _gameData._palStartIndex, _gameData._palEndIndex - _gameData._palStartIndex + 1); } } @@ -423,14 +423,13 @@ void EventsManager::getMouseInfo() { if ((_gameCounter - _joe) > 8) { _joe = _gameCounter; - // TODO: Figure out difference between setOneColor and setColor calls if (_vm->_bob) { _vm->_bob = false; - //_vm->_graphicsManager.setColor(128, 55, 5, 5); + _vm->_graphicsManager.setOneColor(128, 55, 5, 5); _vm->_graphicsManager.setColor(128, 220, 20, 20); } else { _vm->_bob = true; - //_vm->_graphicsManager.setColor(128, 55, 55, 55); + _vm->_graphicsManager.setOneColor(128, 55, 55, 55); _vm->_graphicsManager.setColor(128, 220, 20, 20); } } diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp index eb9f27d0e5..c8080641f1 100644 --- a/engines/voyeur/files_threads.cpp +++ b/engines/voyeur/files_threads.cpp @@ -1575,12 +1575,13 @@ void ThreadResource::doAptAnim(int mode) { for (int idx = 0; (idx < 6) && !_vm->shouldQuit(); ++idx) { PictureResource *pic = _vm->_bVoy->boltEntry(id + idx + 1)._picResource; (*_vm->_graphicsManager._vPort)->setupViewPort(pic); + pal->startFade(); (*_vm->_graphicsManager._vPort)->_flags |= 8; _vm->_graphicsManager.flipPage(); _vm->_eventsManager.sWaitFlip(); - _vm->_eventsManager.delay(5); + _vm->_eventsManager.delay(50); } _vm->_bVoy->freeBoltGroup(id); diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp index 96214b7779..25f63a99a2 100644 --- a/engines/voyeur/graphics.cpp +++ b/engines/voyeur/graphics.cpp @@ -56,6 +56,7 @@ GraphicsManager::GraphicsManager(): _backgroundPage = NULL; _vPort = NULL; _fontPtr = NULL; + Common::fill(&_VGAColors[0], &_VGAColors[PALETTE_SIZE], 0); } void GraphicsManager::sInitGraphics() { @@ -350,6 +351,7 @@ void GraphicsManager::sDrawPic(DisplayResource *srcDisplay, DisplayResource *des // loc_25D40 if (srcFlags & DISPFLAG_100) { // loc_25D4A + error("TODO: sDrawPic"); } else { // loc_2606D destP = (byte *)_screenSurface.getPixels() + screenOffset; @@ -453,13 +455,35 @@ error("TODO: var22/var24/var2C not initialised before use?"); } } else { if (srcFlags & 0x100) { + // Simple run-length encoded image srcP = srcImgData; if (isClipped) { // loc_26424 + error("TODO: sDrawPic"); } else { // loc_26543 + for (int yp = 0; yp < height1; ++yp) { + int runLength = 0; + for (int xp = 0; xp < width2; ++xp, --runLength) { + if (runLength <= 0) { + // Start of run length, so get pixel and repeat length + pixel = *srcP++; + if (pixel & 0x80) { + pixel &= 0x7f; + runLength = *srcP++; + if (runLength == 0) + runLength = width2; + } + } + + // Copy pixel to output + *destP++ = pixel; + } + + destP += widthDiff2; + } } } else { for (int yp = 0; yp < height1; ++yp) { @@ -646,6 +670,14 @@ void GraphicsManager::setColor(int idx, byte r, byte g, byte b) { _vm->_eventsManager._intPtr._palEndIndex = MAX(_vm->_eventsManager._intPtr._palEndIndex, idx); } +void GraphicsManager::setOneColor(int idx, byte r, byte g, byte b) { + byte palEntry[3]; + palEntry[0] = r; + palEntry[1] = g; + palEntry[2] = b; + g_system->getPaletteManager()->setPalette(&palEntry[0], idx, 1); +} + void GraphicsManager::screenReset() { resetPalette(); diff --git a/engines/voyeur/graphics.h b/engines/voyeur/graphics.h index cdd582873a..549d05f911 100644 --- a/engines/voyeur/graphics.h +++ b/engines/voyeur/graphics.h @@ -110,6 +110,7 @@ public: void setPalette(const byte *palette, int start, int count); void resetPalette(); void setColor(int idx, byte r, byte g, byte b); + void setOneColor(int idx, byte r, byte g, byte b); void screenReset(); void doScroll(const Common::Point &pt); void fadeDownICF1(int steps); |