diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp index a5d217b9bd42..18ba83c9d369 100644 --- a/engines/wage/design.cpp +++ b/engines/wage/design.cpp @@ -78,7 +78,7 @@ Design::~Design() { delete _surface; } -void Design::paint(Graphics::Surface *surface, Patterns &patterns, bool mask, int x, int y) { +void Design::paint(Graphics::Surface *surface, Patterns &patterns, int x, int y) { Common::MemoryReadStream in(_data, _len); Common::Rect r(0, 0, _bounds->width(), _bounds->height()); bool needRender = false; @@ -91,10 +91,6 @@ void Design::paint(Graphics::Surface *surface, Patterns &patterns, bool mask, in needRender = true; } - if (mask) { - _surface->fillRect(r, kColorWhite); - } - #if 0 plotData pd(_surface, &patterns, 8, 1); int x1 = 50, y1 = 50, x2 = 200, y2 = 200, borderThickness = 30; @@ -129,20 +125,20 @@ void Design::paint(Graphics::Surface *surface, Patterns &patterns, bool mask, in debug(8, "fill: %d borderFill: %d border: %d type: %d", fillType, borderFillType, borderThickness, type); switch (type) { case 4: - drawRect(_surface, in, mask, patterns, fillType, borderThickness, borderFillType); + drawRect(_surface, in, patterns, fillType, borderThickness, borderFillType); break; case 8: - drawRoundRect(_surface, in, mask, patterns, fillType, borderThickness, borderFillType); + drawRoundRect(_surface, in, patterns, fillType, borderThickness, borderFillType); break; case 12: - drawOval(_surface, in, mask, patterns, fillType, borderThickness, borderFillType); + drawOval(_surface, in, patterns, fillType, borderThickness, borderFillType); break; case 16: case 20: - drawPolygon(_surface, in, mask, patterns, fillType, borderThickness, borderFillType); + drawPolygon(_surface, in, patterns, fillType, borderThickness, borderFillType); break; case 24: - drawBitmap(_surface, in, mask); + drawBitmap(_surface, in); break; default: warning("Unknown type => %d", type); @@ -211,7 +207,7 @@ void drawPixelPlain(int x, int y, int color, void *data) { *((byte *)p->surface->getBasePtr(x, y)) = (byte)color; } -void Design::drawRect(Graphics::Surface *surface, Common::ReadStream &in, bool mask, +void Design::drawRect(Graphics::Surface *surface, Common::ReadStream &in, Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { int16 y1 = in.readSint16BE(); int16 x1 = in.readSint16BE(); @@ -223,18 +219,11 @@ void Design::drawRect(Graphics::Surface *surface, Common::ReadStream &in, bool m if (y1 > y2) SWAP(y1, y2); - Common::Rect outer(x1, y1, x2, y2); - + Common::Rect r(x1, y1, x2, y2); plotData pd(surface, &patterns, fillType, 1); - if (mask) { - drawFilledRect(outer, kColorBlack, drawPixelPlain, &pd); - return; - } - Common::Rect inner(x1 + borderThickness, y1 + borderThickness, x2 - borderThickness, y2 - borderThickness); - if (fillType <= patterns.size()) - drawFilledRect(outer, kColorBlack, drawPixel, &pd); + drawFilledRect(r, kColorBlack, drawPixel, &pd); pd.fillType = borderFillType; pd.thickness = borderThickness; @@ -247,7 +236,7 @@ void Design::drawRect(Graphics::Surface *surface, Common::ReadStream &in, bool m } } -void Design::drawRoundRect(Graphics::Surface *surface, Common::ReadStream &in, bool mask, +void Design::drawRoundRect(Graphics::Surface *surface, Common::ReadStream &in, Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { int16 y1 = in.readSint16BE(); int16 x1 = in.readSint16BE(); @@ -260,26 +249,20 @@ void Design::drawRoundRect(Graphics::Surface *surface, Common::ReadStream &in, b if (y1 > y2) SWAP(y1, y2); - Common::Rect outer(x1, y1, x2, y2); - + Common::Rect r(x1, y1, x2, y2); plotData pd(surface, &patterns, fillType, 1); - if (mask) { - drawRoundRect(outer, arc, kColorBlack, true, drawPixelPlain, &pd); - return; - } - if (fillType <= patterns.size()) - drawRoundRect(outer, arc/2, kColorBlack, true, drawPixel, &pd); + drawRoundRect(r, arc/2, kColorBlack, true, drawPixel, &pd); pd.fillType = borderFillType; pd.thickness = borderThickness; if (borderThickness > 0 && borderFillType <= patterns.size()) - drawRoundRect(outer, arc/2, kColorBlack, false, drawPixel, &pd); + drawRoundRect(r, arc/2, kColorBlack, false, drawPixel, &pd); } -void Design::drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, bool mask, +void Design::drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { byte ignored = in.readSint16BE(); // ignored @@ -339,11 +322,6 @@ void Design::drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, boo plotData pd(surface, &patterns, fillType, 1); - if (mask) { - drawPolygonScan(xpoints, ypoints, npoints, bbox, kColorBlack, drawPixelPlain, &pd); - return; - } - if (fillType <= patterns.size()) { drawPolygonScan(xpoints, ypoints, npoints, bbox, kColorBlack, drawPixel, &pd); } @@ -359,20 +337,14 @@ void Design::drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, boo free(ypoints); } -void Design::drawOval(Graphics::Surface *surface, Common::ReadStream &in, bool mask, +void Design::drawOval(Graphics::Surface *surface, Common::ReadStream &in, Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { int16 y1 = in.readSint16BE(); int16 x1 = in.readSint16BE(); int16 y2 = in.readSint16BE(); int16 x2 = in.readSint16BE(); - plotData pd(surface, &patterns, fillType, 1); - if (mask) { - drawEllipse(x1, y1, x2, y2, true, drawPixelPlain, &pd); - return; - } - if (fillType <= patterns.size()) drawEllipse(x1, y1, x2-1, y2-1, true, drawPixel, &pd); @@ -383,7 +355,7 @@ void Design::drawOval(Graphics::Surface *surface, Common::ReadStream &in, bool m drawEllipse(x1, y1, x2-1, y2-1, false, drawPixel, &pd); } -void Design::drawBitmap(Graphics::Surface *surface, Common::ReadStream &in, bool mask) { +void Design::drawBitmap(Graphics::Surface *surface, Common::ReadStream &in) { int numBytes = in.readSint16BE(); int y1 = in.readSint16BE(); int x1 = in.readSint16BE(); diff --git a/engines/wage/design.h b/engines/wage/design.h index 9581945729a8..214e6e42c0d7 100644 --- a/engines/wage/design.h +++ b/engines/wage/design.h @@ -67,7 +67,7 @@ class Design { return _bounds; } - void paint(Graphics::Surface *canvas, Patterns &patterns, bool mask, int x, int y); + void paint(Graphics::Surface *canvas, Patterns &patterns, int x, int y); bool isPointOpaque(int x, int y); static void drawFilledRect(Graphics::Surface *surface, Common::Rect &rect, int color, Patterns &patterns, byte fillType); static void drawFilledRoundRect(Graphics::Surface *surface, Common::Rect &rect, int arc, int color, Patterns &patterns, byte fillType); @@ -79,15 +79,15 @@ class Design { Graphics::Surface *_surface; private: - void drawRect(Graphics::Surface *surface, Common::ReadStream &in, bool mask, + void drawRect(Graphics::Surface *surface, Common::ReadStream &in, Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType); - void drawRoundRect(Graphics::Surface *surface, Common::ReadStream &in, bool mask, + void drawRoundRect(Graphics::Surface *surface, Common::ReadStream &in, Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType); - void drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, bool mask, + void drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType); - void drawOval(Graphics::Surface *surface, Common::ReadStream &in, bool mask, + void drawOval(Graphics::Surface *surface, Common::ReadStream &in, Patterns &patterns, byte fillType, byte borderThickness, byte borderFillType); - void drawBitmap(Graphics::Surface *surface, Common::ReadStream &in, bool mask); + void drawBitmap(Graphics::Surface *surface, Common::ReadStream &in); void drawFilledRect(Common::Rect &rect, int color, void (*plotProc)(int, int, int, void *), void *data); static void drawRoundRect(Common::Rect &rect, int arc, int color, bool filled, void (*plotProc)(int, int, int, void *), void *data); diff --git a/engines/wage/entities.cpp b/engines/wage/entities.cpp index 614b831f537a..c93a47fd3ade 100644 --- a/engines/wage/entities.cpp +++ b/engines/wage/entities.cpp @@ -126,16 +126,16 @@ void Scene::paint(Graphics::Surface *surface, int x, int y) { Common::Rect r(x + 5, y + 5, _design->getBounds()->width() + x - 10, _design->getBounds()->height() + y - 10); surface->fillRect(r, kColorWhite); - _design->paint(surface, ((WageEngine *)g_engine)->_world->_patterns, false, x, y); + _design->paint(surface, ((WageEngine *)g_engine)->_world->_patterns, x, y); for (Common::List::const_iterator it = _objs.begin(); it != _objs.end(); ++it) { debug(2, "paining Obj: %s", (*it)->_name.c_str()); - (*it)->_design->paint(surface, ((WageEngine *)g_engine)->_world->_patterns, false, x, y); + (*it)->_design->paint(surface, ((WageEngine *)g_engine)->_world->_patterns, x, y); } for (Common::List::const_iterator it = _chrs.begin(); it != _chrs.end(); ++it) { debug(2, "paining Chr: %s", (*it)->_name.c_str()); - (*it)->_design->paint(surface, ((WageEngine *)g_engine)->_world->_patterns, false, x, y); + (*it)->_design->paint(surface, ((WageEngine *)g_engine)->_world->_patterns, x, y); } }