diff options
author | uruk | 2014-02-11 23:10:16 +0100 |
---|---|---|
committer | uruk | 2014-02-11 23:10:16 +0100 |
commit | 6ffbbc8ab247b5d61ab02ae7944bdeeafecac280 (patch) | |
tree | e2ceab49a81fead72f01f8d2975107a357450486 | |
parent | db2baa6f06fbc8382d75f2c6855dc6fecee62d5e (diff) | |
download | scummvm-rg350-6ffbbc8ab247b5d61ab02ae7944bdeeafecac280.tar.gz scummvm-rg350-6ffbbc8ab247b5d61ab02ae7944bdeeafecac280.tar.bz2 scummvm-rg350-6ffbbc8ab247b5d61ab02ae7944bdeeafecac280.zip |
AVALANCHE: Move/rename/implement Help::plotButton().
-rw-r--r-- | engines/avalanche/graphics.cpp | 34 | ||||
-rw-r--r-- | engines/avalanche/graphics.h | 3 | ||||
-rw-r--r-- | engines/avalanche/help.cpp | 7 | ||||
-rw-r--r-- | engines/avalanche/help.h | 1 |
4 files changed, 39 insertions, 6 deletions
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index 9a6e48c619..ec1446dbee 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -653,6 +653,40 @@ void GraphicManager::ghostDrawBackgroundItems(Common::File &file) { } /** +* @remarks Originally called 'plot_button' +*/ +void GraphicManager::helpDrawButton(int y, byte which) { + if (y > 200) { + _vm->_graphics->setBackgroundColor(kColorGreen); + _vm->_system->delayMillis(10); + _vm->_graphics->setBackgroundColor(kColorBlack); + return; + } + + Common::File file; + + if (!file.open("buttons.avd")) + error("AVALANCHE: Help: File not found: buttons.avd"); + + file.seek(which * 930); // 930 is the size of one button. + + Graphics::Surface button = loadPictureGraphic(file); + + int x = 0; + if (y == -177) { + x = 229; + y = 5; + } + else + x = 470; + + _vm->_graphics->drawPicture(_surface, button, x, y); + + button.free(); + file.close(); +} + +/** * This function mimics Pascal's getimage(). */ Graphics::Surface GraphicManager::loadPictureGraphic(Common::File &file) { diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index 71f1a09a7b..8e74b18e42 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -103,6 +103,9 @@ public: void ghostDrawPicture(const Graphics::Surface &picture, uint16 destX, uint16 destY); void ghostDrawBackgroundItems(Common::File &file); + // Help's function: + void helpDrawButton(int y, byte which); + void clearAlso(); void clearTextBar(); void setAlsoLine(int x1, int y1, int x2, int y2, Color color); diff --git a/engines/avalanche/help.cpp b/engines/avalanche/help.cpp index a34ac4c685..c75be19cea 100644 --- a/engines/avalanche/help.cpp +++ b/engines/avalanche/help.cpp @@ -38,11 +38,8 @@ Help::Help(AvalancheEngine *vm) { _highlightWas = 0; } -void Help::plotButton(int8 y, byte which) { - warning("STUB: Help::plotButton()"); -} - void Help::getMe(byte which) { + // Help icons are 80x20. _highlightWas = 177; // Forget where the highlight was. @@ -61,7 +58,7 @@ void Help::getMe(byte which) { _vm->_graphics->drawFilledRectangle(Common::Rect(8, 40, 450, 200), kColorWhite); byte index = file.readByte(); - plotButton(-177, index); + _vm->_graphics->helpDrawButton(-177, index); // Plot the title: _vm->_graphics->drawNormalText(title, _vm->_font, 8, 629 - 8 * title.size(), 26, kColorBlack); diff --git a/engines/avalanche/help.h b/engines/avalanche/help.h index 912927ae97..f2d02f3e32 100644 --- a/engines/avalanche/help.h +++ b/engines/avalanche/help.h @@ -49,7 +49,6 @@ private: Button _buttons[10]; byte _highlightWas; - void plotButton(int8 y, byte which); void getMe(byte which); Common::String getLine(Common::File &file); // It was a nested function in getMe(). byte checkMouse(); // Returns clicked-on button, or 0 if none. |