aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authoruruk2013-08-08 00:57:10 +0200
committeruruk2013-08-08 00:57:10 +0200
commitc182d28b02c25ce69547ef12db56a9f72c82bcc5 (patch)
treeebf8ec3eb743197142022ad18d6893d09e6965bb /engines
parent84bf0984b0fc7f2bd18d5f233a001ba311369bd5 (diff)
downloadscummvm-rg350-c182d28b02c25ce69547ef12db56a9f72c82bcc5.tar.gz
scummvm-rg350-c182d28b02c25ce69547ef12db56a9f72c82bcc5.tar.bz2
scummvm-rg350-c182d28b02c25ce69547ef12db56a9f72c82bcc5.zip
AVALANCHE: Introduce Graphics::drawPieSlice(), use it in Scrolls::drawscroll().
Diffstat (limited to 'engines')
-rw-r--r--engines/avalanche/graphics.cpp5
-rw-r--r--engines/avalanche/graphics.h2
-rw-r--r--engines/avalanche/scrolls2.cpp31
3 files changed, 23 insertions, 15 deletions
diff --git a/engines/avalanche/graphics.cpp b/engines/avalanche/graphics.cpp
index 158440b017..7870f1d20f 100644
--- a/engines/avalanche/graphics.cpp
+++ b/engines/avalanche/graphics.cpp
@@ -198,6 +198,11 @@ void Graphics::drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int
} while (j <= deltaEnd);
}
+void Graphics::drawPieSlice(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color) {
+ while (radius > 0)
+ drawArc(surface, x, y, stAngle, endAngle, radius--, color);
+ //*(byte *)surface.getBasePtr(x + 1, y) = color;
+}
diff --git a/engines/avalanche/graphics.h b/engines/avalanche/graphics.h
index 56300f480b..c3049327e8 100644
--- a/engines/avalanche/graphics.h
+++ b/engines/avalanche/graphics.h
@@ -90,6 +90,8 @@ public:
void drawArc(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
// Taken from Free Pascal's Procedure InternalEllipseDefault. Used to replace Pascal's procedure arc.
+ void drawPieSlice(const ::Graphics::Surface &surface, int16 x, int16 y, int16 stAngle, int16 endAngle, uint16 radius, byte color);
+
// The caller has to .free() the returned Surfaces!!!
::Graphics::Surface loadPictureGraphic(Common::File &file); // Reads Graphic-planar EGA data.
diff --git a/engines/avalanche/scrolls2.cpp b/engines/avalanche/scrolls2.cpp
index eeb9b4df4c..36626caf8a 100644
--- a/engines/avalanche/scrolls2.cpp
+++ b/engines/avalanche/scrolls2.cpp
@@ -365,26 +365,27 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
_vm->_graphics->_scrolls.copyFrom(_vm->_graphics->_surface);
_vm->_gyro->off();
- /* mblit(mx-lx-46,my-ly-6,mx+lx+15,my+ly+6,0,3);*/
- /*setfillstyle(1, 7);
- setcolor(7);
- pieslice(mx + lx, my - ly, 360, 90, 15);
- pieslice(mx + lx, my + ly, 270, 360, 15);
- setcolor(4);
- arc(mx + lx, my - ly, 360, 90, 15);
- arc(mx + lx, my + ly, 270, 360, 15);*/
- _vm->_graphics->drawArc(_vm->_graphics->_scrolls,mx + lx, my - ly, 0, 90, 15, red);
- _vm->_graphics->drawArc(_vm->_graphics->_scrolls,mx + lx, my + ly, 270, 360, 15, red);
+
+ // The right corners of the scroll.
+ _vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx - 2, my - ly, 0, 90, 15, lightgray);
+ _vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx + lx - 2, my + ly, 270, 360, 15, lightgray);
+ _vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my - ly, 0, 90, 15, red);
+ _vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx + lx, my + ly, 270, 360, 15, red);
+ // The body of the scroll.
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly, mx + lx, my + ly + 6), lightgray);
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly), lightgray);
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx + lx + 15, my + ly), lightgray);
- /*setfillstyle(1, 8);
- pieslice(mx - lx - 31, my - ly, 360, 180, 15);
- pieslice(mx - lx - 31, my + ly, 180, 360, 15);
- setfillstyle(1, 4);*/
+ // The left corners of the scroll.
+ _vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, darkgray);
+ _vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my - ly, 0, 180, 15, red);
+ _vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my - ly, mx - lx - 31 + 15, my - ly, red);
+ _vm->_graphics->drawPieSlice(_vm->_graphics->_scrolls, mx - lx - 31, my + ly, 180, 360, 15, darkgray);
+ _vm->_graphics->drawArc(_vm->_graphics->_scrolls, mx - lx - 31, my + ly, 180, 360, 15, red);
+ _vm->_graphics->_scrolls.drawLine(mx - lx - 31 - 15, my + ly, mx - lx - 31 + 15, my + ly, red);
+ // The rear borders of the scroll.
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my - ly - 6, mx + lx, my - ly - 5), red);
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 30, my + ly + 6, mx + lx, my + ly + 7), red);
_vm->_graphics->_scrolls.fillRect(Common::Rect(mx - lx - 15, my - ly, mx - lx - 14, my + ly), red);
@@ -394,7 +395,7 @@ void Scrolls::drawscroll(func2 gotoit) { // This is one of the oldest procs in t
ey = my - ly;
mx -= lx;
my -= ly + 2;
- //setcolor(0);
+
centre = false;
switch (use_icon) {