diff options
author | Strangerke | 2013-09-27 23:22:36 +0200 |
---|---|---|
committer | Strangerke | 2013-09-27 23:22:36 +0200 |
commit | 75258758ef64ae606a7aa6c4949bcb2b22ad1451 (patch) | |
tree | 734f5c3809b6c4f07e77257d4771dc0c4cd6c7f7 | |
parent | 649fa6e5f02e7d6d3d8a6265f90d9f2a68a76887 (diff) | |
download | scummvm-rg350-75258758ef64ae606a7aa6c4949bcb2b22ad1451.tar.gz scummvm-rg350-75258758ef64ae606a7aa6c4949bcb2b22ad1451.tar.bz2 scummvm-rg350-75258758ef64ae606a7aa6c4949bcb2b22ad1451.zip |
AVALANCHE: Move Zoom to Graphics
-rw-r--r-- | engines/avalanche/avalanche.h | 1 | ||||
-rw-r--r-- | engines/avalanche/avalot.cpp | 24 | ||||
-rw-r--r-- | engines/avalanche/graphics.cpp | 27 | ||||
-rw-r--r-- | engines/avalanche/graphics.h | 1 |
4 files changed, 25 insertions, 28 deletions
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h index 212840ba3f..024b484eb0 100644 --- a/engines/avalanche/avalanche.h +++ b/engines/avalanche/avalanche.h @@ -384,7 +384,6 @@ private: void scram(Common::String &str); void unScramble(); - void zoomOut(int16 x, int16 y); // Only used when entering the map. void enterNewTown(); void findPeople(byte room); void putGeidaAt(byte whichPed, byte ped); diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp index 2bf5a93c57..27f7338555 100644 --- a/engines/avalanche/avalot.cpp +++ b/engines/avalanche/avalot.cpp @@ -605,28 +605,6 @@ void AvalancheEngine::loadRoom(byte num) { CursorMan.showMouse(true); } -void AvalancheEngine::zoomOut(int16 x, int16 y) { - //setlinestyle(dottedln, 0, 1); TODO: Implement it with a dotted line style!!! - - ::Graphics::Surface backup; - backup.copyFrom(_graphics->_surface); - - for (byte i = 1; i <= 20; i ++) { - int16 x1 = x - (x / 20) * i; - int16 y1 = y - ((y - 10) / 20) * i; - int16 x2 = x + (((639 - x) / 20) * i); - int16 y2 = y + (((161 - y) / 20) * i); - - _graphics->_surface.frameRect(Common::Rect(x1, y1, x2, y2), kColorWhite); - _graphics->refreshScreen(); - _system->delayMillis(17); - _graphics->_surface.copyFrom(backup); - _graphics->refreshScreen(); - } - - backup.free(); -} - void AvalancheEngine::findPeople(byte room) { for (int i = 1; i < 29; i++) { if (_whereIs[i] == room) { @@ -900,7 +878,7 @@ void AvalancheEngine::enterRoom(Room roomId, byte ped) { // You're entering the map. dawn(); if (ped > 0) - zoomOut(_peds[ped]._x, _peds[ped]._y); + _graphics->zoomOut(_peds[ped]._x, _peds[ped]._y); if ((_objects[kObjectWine - 1]) && (_wineState != 3)) { _dialogs->displayScrollChain('q', 9); // Don't want to waste the wine! diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index bc0a83ab5b..a209904522 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -30,11 +30,8 @@ #include "common/system.h" #include "common/rect.h" - #include "engines/util.h" - #include "graphics/palette.h" - #include "math.h" namespace Avalanche { @@ -312,7 +309,29 @@ void Graphics::refreshScreen() { } void Graphics::refreshBackground() { - _vm->_graphics->drawPicture(_vm->_graphics->_surface, _vm->_graphics->_background, 0, 10); + drawPicture(_surface, _background, 0, 10); +} + +void Graphics::zoomOut(int16 x, int16 y) { + //setlinestyle(dottedln, 0, 1); TODO: Implement it with a dotted line style!!! + + ::Graphics::Surface backup; + backup.copyFrom(_surface); + + for (byte i = 1; i <= 20; i ++) { + int16 x1 = x - (x / 20) * i; + int16 y1 = y - ((y - 10) / 20) * i; + int16 x2 = x + (((639 - x) / 20) * i); + int16 y2 = y + (((161 - y) / 20) * i); + + _surface.frameRect(Common::Rect(x1, y1, x2, y2), kColorWhite); + refreshScreen(); + _vm->_system->delayMillis(17); + _surface.copyFrom(backup); + refreshScreen(); + } + + backup.free(); } } // End of namespace Avalanche diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index e83dbf6e72..979b3725ce 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -90,6 +90,7 @@ public: void drawPicture(::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example. void refreshScreen(); void refreshBackground(); + void zoomOut(int16 x, int16 y); // Only used when entering the map. private: AvalancheEngine *_vm; |