diff options
author | Strangerke | 2013-09-28 17:09:50 +0200 |
---|---|---|
committer | Strangerke | 2013-09-28 17:09:50 +0200 |
commit | ef8b661c3d80a498f0bacf0b954764084c95262b (patch) | |
tree | ff8b826513e5ed32b51b6a681d864a1607f40d24 | |
parent | 6a7326ec26b4882061a17cf399fa2f685c3d776e (diff) | |
download | scummvm-rg350-ef8b661c3d80a498f0bacf0b954764084c95262b.tar.gz scummvm-rg350-ef8b661c3d80a498f0bacf0b954764084c95262b.tar.bz2 scummvm-rg350-ef8b661c3d80a498f0bacf0b954764084c95262b.zip |
AVALANCHE: Partially move drawScroll to Graphics
-rw-r--r-- | engines/avalanche/dialogs.cpp | 28 | ||||
-rw-r--r-- | engines/avalanche/graphics.cpp | 30 | ||||
-rw-r--r-- | engines/avalanche/graphics.h | 1 |
3 files changed, 32 insertions, 27 deletions
diff --git a/engines/avalanche/dialogs.cpp b/engines/avalanche/dialogs.cpp index 9367c072c2..d2c413163b 100644 --- a/engines/avalanche/dialogs.cpp +++ b/engines/avalanche/dialogs.cpp @@ -419,34 +419,8 @@ void Dialogs::drawScroll(DialogFunctionType modeFunc) { if ((1 <= _useIcon) && (_useIcon <= 34)) lx += kHalfIconWidth; - _vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface); - CursorMan.showMouse(false); - - // The right corners of the scroll. - _vm->_graphics->drawPieSlice(mx + lx, my - ly, 0, 90, 15, kColorLightgray); - _vm->_graphics->drawPieSlice(mx + lx, my + ly, 270, 360, 15, kColorLightgray); - _vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, kColorRed); - _vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, kColorRed); - - // The body of the scroll. - _vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), kColorLightgray); - _vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly + 1), kColorLightgray); - _vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly + 1), kColorLightgray); - - // The left corners of the scroll. - _vm->_graphics->drawPieSlice(mx - lx - 31, my - ly, 0, 180, 15, kColorDarkgray); - _vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, kColorRed); - _vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my - ly, mx - lx - 31 + 15, my - ly, kColorRed); - _vm->_graphics->drawPieSlice(mx - lx - 31, my + ly, 180, 360, 15, kColorDarkgray); - _vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my + ly, 180, 360, 15, kColorRed); - _vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my + ly, mx - lx - 31 + 15, my + ly, kColorRed); - - // The rear borders of the scroll. - _vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5), kColorRed); - _vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7), kColorRed); - _vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), kColorRed); - _vm->_graphics->_scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), kColorRed); + _vm->_graphics->drawScroll(mx, lx, my, ly); mx -= lx; my -= ly + 2; diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp index 007c5101f3..1961ce9a39 100644 --- a/engines/avalanche/graphics.cpp +++ b/engines/avalanche/graphics.cpp @@ -363,6 +363,36 @@ void Graphics::drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::Str CursorMan.showMouse(true); } +void Graphics::drawScroll(int mx, int lx, int my, int ly) { + _scrolls.copyFrom(_surface); + + // The right corners of the scroll. + drawPieSlice(mx + lx, my - ly, 0, 90, 15, kColorLightgray); + drawPieSlice(mx + lx, my + ly, 270, 360, 15, kColorLightgray); + drawArc(_scrolls, mx + lx, my - ly, 0, 90, 15, kColorRed); + drawArc(_scrolls, mx + lx, my + ly, 270, 360, 15, kColorRed); + + // The body of the scroll. + _scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), kColorLightgray); + _scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly + 1), kColorLightgray); + _scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly + 1), kColorLightgray); + + // The left corners of the scroll. + drawPieSlice(mx - lx - 31, my - ly, 0, 180, 15, kColorDarkgray); + drawArc(_scrolls, mx - lx - 31, my - ly, 0, 180, 15, kColorRed); + _scrolls.drawLine(mx - lx - 31 - 15, my - ly, mx - lx - 31 + 15, my - ly, kColorRed); + drawPieSlice(mx - lx - 31, my + ly, 180, 360, 15, kColorDarkgray); + drawArc(_scrolls, mx - lx - 31, my + ly, 180, 360, 15, kColorRed); + _scrolls.drawLine(mx - lx - 31 - 15, my + ly, mx - lx - 31 + 15, my + ly, kColorRed); + + // The rear borders of the scroll. + _scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5), kColorRed); + _scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7), kColorRed); + _scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), kColorRed); + _scrolls.fillRect(Common::Rect(mx + lx + 15, my - ly, mx + lx + 16, my + ly), kColorRed); + +} + ::Graphics::Surface Graphics::loadPictureGraphic(Common::File &file) { // This function mimics Pascal's getimage(). // The height and the width are stored in 2-2 bytes. We have to add 1 to each because Pascal stores the value of them -1. diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h index de2723115d..8fdc39f34f 100644 --- a/engines/avalanche/graphics.h +++ b/engines/avalanche/graphics.h @@ -81,6 +81,7 @@ public: void drawDirection(int index, int x, int y); void drawScrollShadow(int16 x1, int16 y1, int16 x2, int16 y2); void drawShadowBox(int16 x1, int16 y1, int16 x2, int16 y2, Common::String text); + void drawScroll(int mx, int lx, int my, int ly); void clearAlso(); void clearTextBar(); void setAlsoLine(int x1, int y1, int x2, int y2, Color color); |