aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2015-12-18 19:04:51 +0100
committerEugene Sandulenko2015-12-27 15:40:53 +0100
commitcce763ea2ebf93cb83580bb7fe5b8ed9b3b7ad3e (patch)
tree2c67c197e8dd391ef9a8ab9a6505c8a50193a129
parent9ae6992c7c8b9479d2c0dc7fd238f07e7cf37dab (diff)
downloadscummvm-rg350-cce763ea2ebf93cb83580bb7fe5b8ed9b3b7ad3e.tar.gz
scummvm-rg350-cce763ea2ebf93cb83580bb7fe5b8ed9b3b7ad3e.tar.bz2
scummvm-rg350-cce763ea2ebf93cb83580bb7fe5b8ed9b3b7ad3e.zip
WAGE: Completed drawFilledEllipse
-rw-r--r--engines/wage/design.cpp19
-rw-r--r--engines/wage/design.h2
2 files changed, 7 insertions, 14 deletions
diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp
index f4d9299e4c..13e631eb99 100644
--- a/engines/wage/design.cpp
+++ b/engines/wage/design.cpp
@@ -450,18 +450,12 @@ void Design::drawHLine(int x1, int x2, int y, int color, void (*plotProc)(int, i
(*plotProc)(x, y, color, data);
}
-void Design::patternVLine(Graphics::Surface *surface, Patterns &patterns, byte fillType, int x, int y1, int y2, int x0, int y0) {
+void Design::drawVLine(int x, int y1, int y2, int color, void (*plotProc)(int, int, int, void *), void *data) {
if (y1 > y2)
SWAP(y1, y2);
- if (fillType > patterns.size())
- return;
-
- for (int y = y1; y < y2; y++)
- if (x >= 0 && x < surface->w && y >= 0 && y < surface->h)
- *((byte *)surface->getBasePtr(x, y)) =
- (patterns[fillType - 1][(y - y0) % 8] & (1 << (7 - (x - x0) % 8))) ?
- kColorBlack : kColorWhite;
+ for (int y = y1; y < y2; x++)
+ (*plotProc)(x, y, color, data);
}
/* Bresenham as presented in Foley & Van Dam */
@@ -475,15 +469,14 @@ void Design::drawThickLine (int x1, int y1, int x2, int y2, int thick, int color
int dx = abs(x2 - x1);
int dy = abs(y2 - y1);
-/*
if (dx == 0) {
- patternVLine(surface, patterns, fillType, x1, y1, y2, x1, y1);
+ drawVLine(x1, y1, y2, color, plotProc, data);
return;
} else if (dy == 0) {
- patternHLine(surface, patterns, fillType, x1, x2, y1, x1, y1);
+ drawHLine(x1, x2, y1, color, plotProc, data);
return;
}
-*/
+
if (dy <= dx) {
/* More-or-less horizontal. use wid for vertical stroke */
/* Doug Claar: watch out for NaN in atan2 (2.0.5) */
diff --git a/engines/wage/design.h b/engines/wage/design.h
index 2da3b6e201..8b2c6b5967 100644
--- a/engines/wage/design.h
+++ b/engines/wage/design.h
@@ -98,7 +98,7 @@ private:
void (*plotProc)(int, int, int, void *), void *data);
void drawFilledEllipse(int x0, int y0, int x1, int y1, void (*plotProc)(int, int, int, void *), void *data);
void drawHLine(int x1, int x2, int y, int color, void (*plotProc)(int, int, int, void *), void *data);
- void patternVLine(Graphics::Surface *surface, Patterns &patterns, byte fillType, int x, int y1, int y2, int x0, int y0);
+ void drawVLine(int x, int y1, int y2, int color, void (*plotProc)(int, int, int, void *), void *data);
void drawThickLine (int x1, int y1, int x2, int y2, int thick, int color,
void (*plotProc)(int, int, int, void *), void *data);
};