diff options
author | uruk | 2013-10-01 09:57:41 +0200 |
---|---|---|
committer | uruk | 2013-10-01 09:57:41 +0200 |
commit | bb8157772cca0f5c7192781a8816af35b09e88e2 (patch) | |
tree | 09ce246916c7aaffaa111adfb842fc0bc491aabb | |
parent | 8408fa46c73de4923e456ee13210f171953ad820 (diff) | |
download | scummvm-rg350-bb8157772cca0f5c7192781a8816af35b09e88e2.tar.gz scummvm-rg350-bb8157772cca0f5c7192781a8816af35b09e88e2.tar.bz2 scummvm-rg350-bb8157772cca0f5c7192781a8816af35b09e88e2.zip |
AVALANCHE: Rename getIcon() to drawIcon(), move it to Graphics from Dialogs, implement it. Repair Dialogs::scrollModeDialogue().
-rw-r--r-- | engines/avalanche/dialogs.cpp | 23 | ||||
-rw-r--r-- | engines/avalanche/dialogs.h | 1 | ||||
-rw-r--r-- | engines/avalanche/graphics.cpp | 16 | ||||
-rw-r--r-- | engines/avalanche/graphics.h | 1 |
4 files changed, 19 insertions, 22 deletions
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp index c0383045c7..34c32c04af 100644 --- a/engines/avalanche/dialogs.cpp +++ b/engines/avalanche/dialogs.cpp @@ -192,7 +192,7 @@ void Dialogs::scrollModeDialogue() { cursorPos.y /= 2; char inChar = 0; - if (event.type == Common::EVENT_KEYDOWN) { + if ((event.type == Common::EVENT_KEYDOWN) && (event.kbd.ascii <= 122) && (event.kbd.ascii >= 97)) { inChar = (char)event.kbd.ascii; Common::String temp(inChar); temp.toUppercase(); @@ -363,25 +363,6 @@ void Dialogs::unDodgem() { g_system->warpMouse(_dodgeCoord.x, _dodgeCoord.y); // No change, so restore the pointer's original position. } -void Dialogs::getIcon(int16 x, int16 y, byte which) { - Common::File file; - - if (!file.open("icons.avd")) - error("AVALANCHE: Scrolls: File not found: icons.avd"); - - which--; - file.seek(which * 426); - - byte *p = new byte[426]; - file.read(p, 426); - - //putimage(x, y, p, 0); - warning("STUB: Scrolls::getIcon()"); - - delete[] p; - file.close(); -} - void Dialogs::drawScroll(DialogFunctionType modeFunc) { int16 lx = 0; int16 ly = (_maxLineNum + 1) * 6; @@ -423,7 +404,7 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) { } if ((1 <= _useIcon) && (_useIcon <= 33)) { // Standard icon. - getIcon(mx, my + ly / 2, _useIcon); + _vm->_graphics->drawIcon(mx, my + ly / 2, _useIcon); iconIndent = 53; } diff --git a/engines/avalanche/dialogs.h b/engines/avalanche/dialogs.h index 19ee9e36a2..745169d794 100644 --- a/engines/avalanche/dialogs.h +++ b/engines/avalanche/dialogs.h @@ -125,7 +125,6 @@ private: void say(int16 x, int16 y, Common::String text); void resetScrollDriver(); void ringBell(); // Original: dingdongbell - void getIcon(int16 x, int16 y, byte which); void loadFont(); // From Visa: diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index 4435e5939b..a7d9c3964e 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -594,6 +594,22 @@ void GraphicManager::drawSign(Common::String fn, int16 xl, int16 yl, int16 y) { file.close(); } +void GraphicManager::drawIcon(int16 x, int16 y, byte which) { + Common::File file; + + if (!file.open("icons.avd")) + error("AVALANCHE: Scrolls: File not found: icons.avd"); + + which--; + file.seek(which * 426); + + Graphics::Surface icon = loadPictureGraphic(file); + drawPicture(_scrolls, icon, x, y); + + icon.free(); + file.close(); +} + void GraphicManager::prepareBubble(int xc, int xw, int my, Common::Point points[3]) { // Backup the screen before drawing the bubble. _scrolls.copyFrom(_surface); diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index aa9c209c4f..a09552fc91 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -105,6 +105,7 @@ public: void drawCursor(byte pos); void drawReadyLight(Color color); void drawSign(Common::String name, int16 xl, int16 yl, int16 y); // This is for drawing a big "about" or "gameover" picture loaded from a file into an empty scroll. + void drawIcon(int16 x, int16 y, byte which); // Draws an icon to the current scroll. void prepareBubble(int xc, int xw, int my, Common::Point points[3]); |