aboutsummaryrefslogtreecommitdiff
path: root/graphics/VectorRenderer.cpp
diff options
context:
space:
mode:
authorVicent Marti2008-08-15 19:10:37 +0000
committerVicent Marti2008-08-15 19:10:37 +0000
commit7c213ab11022ffce603099fe409d44d383ce94e7 (patch)
treed10f744f79d0cb0b2b0ef3a7ac986aeed06203c6 /graphics/VectorRenderer.cpp
parent9ae82653ef7586aa52fae0041b56dfd2415ea399 (diff)
downloadscummvm-rg350-7c213ab11022ffce603099fe409d44d383ce94e7.tar.gz
scummvm-rg350-7c213ab11022ffce603099fe409d44d383ce94e7.tar.bz2
scummvm-rg350-7c213ab11022ffce603099fe409d44d383ce94e7.zip
Tons of misc. GFX fixes.
svn-id: r33911
Diffstat (limited to 'graphics/VectorRenderer.cpp')
-rw-r--r--graphics/VectorRenderer.cpp10
1 files changed, 8 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;
}