diff options
author | uruk | 2013-09-16 16:18:02 +0200 |
---|---|---|
committer | uruk | 2013-09-16 16:18:02 +0200 |
commit | fe72db6c85d31fdc13e39f3575d63ef061ab8cc9 (patch) | |
tree | 603f0c03727b76d358908132f976f790eb88a0f7 /engines/avalanche | |
parent | 5f6fc0de6be8cb048e3a757197912d872a7d6e27 (diff) | |
download | scummvm-rg350-fe72db6c85d31fdc13e39f3575d63ef061ab8cc9.tar.gz scummvm-rg350-fe72db6c85d31fdc13e39f3575d63ef061ab8cc9.tar.bz2 scummvm-rg350-fe72db6c85d31fdc13e39f3575d63ef061ab8cc9.zip |
AVALANCHE: Make Graphics::drawPicture more safe. Fix an index-bug regarding Gyro::_objectList.
Diffstat (limited to 'engines/avalanche')
-rw-r--r-- | engines/avalanche/dropdown.cpp | 2 | ||||
-rw-r--r-- | engines/avalanche/graphics.cpp | 2 | ||||
-rw-r--r-- | engines/avalanche/graphics.h | 2 | ||||
-rw-r--r-- | engines/avalanche/lucerna.cpp | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/engines/avalanche/dropdown.cpp b/engines/avalanche/dropdown.cpp index c43a5b0852..edf99ae9a2 100644 --- a/engines/avalanche/dropdown.cpp +++ b/engines/avalanche/dropdown.cpp @@ -629,7 +629,7 @@ void Dropdown::runMenuAction() { } void Dropdown::runMenuObjects() { - _vm->_lucerna->thinkAbout(_vm->_gyro->_objectList[_activeMenuItem._choiceNum + 1], Gyro::kThing); + _vm->_lucerna->thinkAbout(_vm->_gyro->_objectList[_activeMenuItem._choiceNum], Gyro::kThing); } void Dropdown::runMenuPeople() { diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index 8f51f749e3..a6cbe3d765 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -291,7 +291,7 @@ void Graphics::drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 } } -void Graphics::drawPicture(::Graphics::Surface &target, ::Graphics::Surface &picture, uint16 destX, uint16 destY) { +void Graphics::drawPicture(::Graphics::Surface &target, const ::Graphics::Surface &picture, uint16 destX, uint16 destY) { // Copy the picture to the given place on the screen. for (uint16 y = 0; y < picture.h; y++) { for (uint16 x = 0; x < picture.w; x++) { diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index a94ed77112..41b1016cb4 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -85,7 +85,7 @@ public: ::Graphics::Surface loadPictureRow(Common::File &file, uint16 width, uint16 height); // Reads Row-planar EGA data. void drawSprite(const SpriteInfo &sprite, byte picnum, int16 x, int16 y); - void drawPicture(::Graphics::Surface &target, ::Graphics::Surface &picture, uint16 destX, uint16 destY); // Can't call .free() here. See Lucerna::showscore() for example. + 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(); diff --git a/engines/avalanche/lucerna.cpp b/engines/avalanche/lucerna.cpp index 0450ea9f36..275375c8ad 100644 --- a/engines/avalanche/lucerna.cpp +++ b/engines/avalanche/lucerna.cpp @@ -1004,8 +1004,8 @@ void Lucerna::refreshObjectList() { for (byte i = 0; i < kObjectNum; i++) { if (_vm->_gyro->_objects[i]) { - _vm->_gyro->_carryNum++; _vm->_gyro->_objectList[_vm->_gyro->_carryNum] = i + 1; + _vm->_gyro->_carryNum++; } } } |