diff options
author | Arnaud Boutonné | 2009-09-16 22:19:54 +0000 |
---|---|---|
committer | Arnaud Boutonné | 2009-09-16 22:19:54 +0000 |
commit | 6976bc87b78e9416f6c389bdf9131234d4d979c5 (patch) | |
tree | a338d6ecd2fd96a1ccf84e73228fed661e244df2 /engines | |
parent | f1a218bb328778e7d73309e20bcb3aeadfcebd72 (diff) | |
download | scummvm-rg350-6976bc87b78e9416f6c389bdf9131234d4d979c5.tar.gz scummvm-rg350-6976bc87b78e9416f6c389bdf9131234d4d979c5.tar.bz2 scummvm-rg350-6976bc87b78e9416f6c389bdf9131234d4d979c5.zip |
Playtoons - Add patterns to drawCircle
svn-id: r44122
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/video.cpp | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp index 98350af738..2357f66750 100644 --- a/engines/gob/video.cpp +++ b/engines/gob/video.cpp @@ -367,11 +367,15 @@ void Video::drawCircle(SurfaceDesc &dest, int16 x0, int16 y0, int16 ddFy = -2 * radius; int16 x = 0; int16 y = radius; + int16 tmpPattern = (_vm->_draw->_pattern & 0xFF); - putPixel(x0, y0 + radius, color, dest); - putPixel(x0, y0 - radius, color, dest); - putPixel(x0 + radius, y0, color, dest); - putPixel(x0 - radius, y0, color, dest); + if (tmpPattern == 0) { + putPixel(x0, y0 + radius, color, dest); + putPixel(x0, y0 - radius, color, dest); + putPixel(x0 + radius, y0, color, dest); + putPixel(x0 - radius, y0, color, dest); + } else + warning ("Video::drawCircle - pattern %d", _vm->_draw->_pattern); while (x < y) { if (f >= 0) { @@ -382,14 +386,35 @@ void Video::drawCircle(SurfaceDesc &dest, int16 x0, int16 y0, x++; ddFx += 2; f += ddFx + 1; - putPixel(x0 + x, y0 + y, color, dest); - putPixel(x0 - x, y0 + y, color, dest); - putPixel(x0 + x, y0 - y, color, dest); - putPixel(x0 - x, y0 - y, color, dest); - putPixel(x0 + y, y0 + x, color, dest); - putPixel(x0 - y, y0 + x, color, dest); - putPixel(x0 + y, y0 - x, color, dest); - putPixel(x0 - y, y0 - x, color, dest); + + switch (tmpPattern) { + case -1: + fillRect(dest, x0 - y, y0 + x, x0 + y, y0 + x, color); + fillRect(dest, x0 - x, y0 + y, x0 + x, y0 + y, color); + fillRect(dest, x0 - y, y0 - x, x0 + y, y0 - x, color); + fillRect(dest, x0 - x, y0 - y, x0 + x, y0 - y, color); + break; + case 0: + putPixel(x0 + x, y0 + y, color, dest); + putPixel(x0 - x, y0 + y, color, dest); + putPixel(x0 + x, y0 - y, color, dest); + putPixel(x0 - x, y0 - y, color, dest); + putPixel(x0 + y, y0 + x, color, dest); + putPixel(x0 - y, y0 + x, color, dest); + putPixel(x0 + y, y0 - x, color, dest); + putPixel(x0 - y, y0 - x, color, dest); + break; + default: + fillRect(dest, x0 + y - tmpPattern, y0 + x - tmpPattern, x0 + y, y0 + x, color); + fillRect(dest, x0 + x - tmpPattern, y0 + y - tmpPattern, x0 + x, y0 + y, color); + fillRect(dest, x0 - y, y0 + x - tmpPattern, x0 - y + tmpPattern, y0 + x, color); + fillRect(dest, x0 - x, y0 + y - tmpPattern, x0 - x + tmpPattern, y0 + y, color); + fillRect(dest, x0 + y - tmpPattern, y0 - x, x0 + y, y0 - x + tmpPattern, color); + fillRect(dest, x0 + x - tmpPattern, y0 - y, x0 + x, y0 - y + tmpPattern, color); + fillRect(dest, x0 - y, y0 - x, x0 - y + tmpPattern, y0 - x + tmpPattern, color); + fillRect(dest, x0 - x, y0 - y, x0 - x + tmpPattern, y0 - y + tmpPattern, color); + break; + } } } |