From 737e38eff82e92fcea4d0971d0b43c5fa4a6d53c Mon Sep 17 00:00:00 2001 From: uruk Date: Wed, 5 Feb 2014 13:36:10 +0100 Subject: AVALANCHE: Implement the floating eyeballs and the "Glerk"s animation. --- engines/avalanche/ghostroom.cpp | 39 ++++++++++++++++++++++++++++++++++++++- engines/avalanche/graphics.cpp | 4 ++++ engines/avalanche/graphics.h | 1 + 3 files changed, 43 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/avalanche/ghostroom.cpp b/engines/avalanche/ghostroom.cpp index cbb36fb814..aee8b4f48d 100644 --- a/engines/avalanche/ghostroom.cpp +++ b/engines/avalanche/ghostroom.cpp @@ -32,7 +32,7 @@ namespace Avalanche { const int8 GhostRoom::kAdjustment[5] = { 7, 0, 7, 7, 7 }; const byte GhostRoom::kWaveOrder[5] = { 5, 1, 2, 3, 4 }; -const byte GhostRoom::kGlerkFade[26] = { 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 3, 3, 3, 2, 2, 1 }; +const byte GhostRoom::kGlerkFade[26] = { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 2, 2, 2, 1, 1, 0 }; const byte GhostRoom::kGreldetFade[18] = { 1, 2, 3, 4, 5, 6, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1 }; GhostRoom::GhostRoom(AvalancheEngine *vm) { @@ -168,7 +168,44 @@ void GhostRoom::run() { _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 640, 200), kColorBlack); // Black out the whole screen. loadPictures(); + + _glerkStage = 0; + + for (int x = 500; x >= 217; x--) { + // The floating eyeballs: + int xBound = x % 30; + if ((22 <= xBound) && (xBound <= 27)) { + if (xBound == 27) + _vm->_graphics->drawFilledRectangle(Common::Rect(x, 134, x + 17, 137), kColorBlack); + _vm->_graphics->ghostDrawPicture(_eyes[0], x, 136); + _vm->_graphics->drawDot(x + 16, 137, kColorBlack); + } else { + if (xBound == 21) + _vm->_graphics->drawFilledRectangle(Common::Rect(x, 136, x + 18, 140), kColorBlack); + _vm->_graphics->ghostDrawPicture(_eyes[0], x, 135); + _vm->_graphics->drawDot(x + 16, 136, kColorBlack); // Eyes would leave a trail 1 pixel high behind them. + } + + // Plot the Glerk: + if ((x % 10) == 0) { + if (_glerkStage > 25) + break; + + _vm->_graphics->ghostDrawGlerk(_glerk[kGlerkFade[_glerkStage]], 456, 14); + _glerkStage++; + } + + _vm->_graphics->refreshScreen(); + + doBat(); + + wait(15); + } + // Blank out the Glerk's space. + _vm->_graphics->drawFilledRectangle(Common::Rect(456, 14, 530, 50), kColorBlack); + _vm->_graphics->refreshScreen(); + warning("STUB: run()"); CursorMan.showMouse(true); diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index 8bc32d8b1f..06c8c83b94 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -281,6 +281,10 @@ Common::Point GraphicManager::drawArc(Graphics::Surface &surface, int16 x, int16 return endPoint; } +void GraphicManager::drawDot(int x, int y, Color color) { + *(byte *)_surface.getBasePtr(x, y) = color; +} + void GraphicManager::drawLine(int x1, int y1, int x2, int y2, int penX, int penY, Color color) { _surface.drawThickLine(x1, y1, x2, y2, penX, penY, color); } diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index 485da1f4ee..a372ce8012 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -59,6 +59,7 @@ public: void loadDigits(); void loadMouse(byte which); + void drawDot(int x, int y, Color color); void drawLine(int x1, int y1, int x2, int y2, int penX, int penY, Color color); Common::Point drawScreenArc(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color); void drawPieSlice(int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, Color color); -- cgit v1.2.3