aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'graphics')
-rw-r--r--graphics/VectorRenderer.cpp10
-rw-r--r--graphics/VectorRenderer.h15
2 files changed, 23 insertions, 2 deletions
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp
index 16797fa930..655602ef20 100644
--- a/graphics/VectorRenderer.cpp
+++ b/graphics/VectorRenderer.cpp
@@ -370,15 +370,21 @@ drawLine(int x1, int y1, int x2, int y2) {
PixelType *ptr = (PixelType *)_activeSurface->getBasePtr(x1, y1);
int pitch = Base::surfacePitch();
+ int st = Base::_strokeWidth >> 1;
if (dy == 0) { // horizontal lines
// these can be filled really fast with a single memset.
colorFill(ptr, ptr + dx + 1, (PixelType)_fgColor);
+
+ for (int i = 0, p = pitch; i < st; ++i, p += pitch) {
+ colorFill(ptr + p, ptr + dx + 1 + p, (PixelType)_fgColor);
+ colorFill(ptr - p, ptr + dx + 1 - p, (PixelType)_fgColor);
+ }
} else if (dx == 0) { // vertical lines
// these ones use a static pitch increase.
while (y1++ <= y2) {
- *ptr = (PixelType)_fgColor;
+ colorFill(ptr - st, ptr + st, (PixelType)_fgColor);
ptr += pitch;
}
@@ -387,7 +393,7 @@ drawLine(int x1, int y1, int x2, int y2) {
pitch += (x2 > x1) ? 1 : -1;
while (dy--) {
- *ptr = (PixelType)_fgColor;
+ colorFill(ptr - st, ptr + st, (PixelType)_fgColor);
ptr += pitch;
}
diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h
index 0407028556..bd1bd1db42 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -211,6 +211,15 @@ public:
* @param r Radius of the corners of the tab (0 for squared tabs).
*/
virtual void drawTab(int x, int y, int r, int w, int h) = 0;
+
+
+ /**
+ * Simple helper function to draw a cross.
+ */
+ virtual void drawCross(int x, int y, int w, int h) {
+ drawLine(x, y, x + w, y + w);
+ drawLine(x + w, y, x, y + h);
+ }
/**
* Gets the pixel pitch for the current drawing surface.
@@ -419,6 +428,12 @@ public:
stepGetPositions(step, area, x, y, w, h);
blitAlphaBitmap(step.blitSrc, Common::Rect(x, y, x + w, y + h));
}
+
+ void drawCallback_CROSS(const Common::Rect &area, const DrawStep &step) {
+ uint16 x, y, w, h;
+ stepGetPositions(step, area, x, y, w, h);
+ drawCross(x, y, w, h);
+ }
void drawCallback_VOID(const Common::Rect &area, const DrawStep &step) {}