Skip to content

Commit

Permalink
WAGE: Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Dec 27, 2015
1 parent cd84abb commit efab4a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
14 changes: 6 additions & 8 deletions engines/wage/design.cpp
Expand Up @@ -55,11 +55,9 @@ struct plotData {
Graphics::Surface *surface;
Patterns *patterns;
int fillType;
int x0;
int y0;

plotData(Graphics::Surface *s, Patterns *p, int f, int x, int y) :
surface(s), patterns(p), fillType(f), x0(x), y0(y) {}
plotData(Graphics::Surface *s, Patterns *p, int f) :
surface(s), patterns(p), fillType(f) {}
};

Design::Design(Common::SeekableReadStream *data) {
Expand Down Expand Up @@ -147,7 +145,7 @@ void Design::drawRect(Graphics::Surface *surface, Common::ReadStream &in, bool m
int16 x2 = in.readSint16BE();
Common::Rect outer(x1, y1, x2, y2);

plotData pd(surface, &patterns, borderFillType, x1, y1);
plotData pd(surface, &patterns, borderFillType);

if (mask) {
drawFilledRect(outer, kColorBlack, drawPixelPlain, &pd);
Expand All @@ -171,7 +169,7 @@ void Design::drawRoundRect(Graphics::Surface *surface, Common::ReadStream &in, b
int16 arc = in.readSint16BE();
Common::Rect outer(x1, y1, x2, y2);

plotData pd(surface, &patterns, borderFillType, x1, y1);
plotData pd(surface, &patterns, borderFillType);

if (mask) {
drawFilledRoundRect(outer, arc, kColorBlack, drawPixelPlain, &pd);
Expand Down Expand Up @@ -242,7 +240,7 @@ void Design::drawPolygon(Graphics::Surface *surface, Common::ReadStream &in, boo
ypoints[i] = ycoords[i];
}

plotData pd(surface, &patterns, fillType, bx1, by1);
plotData pd(surface, &patterns, fillType);

if (mask) {
drawPolygonScan(xpoints, ypoints, npoints, bbox, kColorBlack, drawPixelPlain, &pd);
Expand All @@ -268,7 +266,7 @@ void Design::drawOval(Graphics::Surface *surface, Common::ReadStream &in, bool m
int16 y2 = in.readSint16BE();
int16 x2 = in.readSint16BE();

plotData pd(surface, &patterns, borderFillType, x1, y1);
plotData pd(surface, &patterns, borderFillType);

if (mask) {
drawFilledEllipse(x1, y1, x2, y2, drawPixelPlain, &pd);
Expand Down
8 changes: 4 additions & 4 deletions engines/wage/wage.cpp
Expand Up @@ -110,10 +110,10 @@ Common::Error WageEngine::run() {
Common::Rect r(0, 0, screen.w, screen.h);
//_world->_objs["frank.1"]->_design->setBounds(&r);
//_world->_objs["frank.1"]->_design->paint(&screen, _world->_patterns, false);
//_world->_scenes["temple of the holy mackeral"]->_design->setBounds(&r);
//_world->_scenes["temple of the holy mackeral"]->_design->paint(&screen, _world->_patterns, false);
_world->_scenes["tower level 3"]->_design->setBounds(&r);
_world->_scenes["tower level 3"]->_design->paint(&screen, _world->_patterns, false);
_world->_scenes["temple of the holy mackeral"]->_design->setBounds(&r);
_world->_scenes["temple of the holy mackeral"]->_design->paint(&screen, _world->_patterns, false);
//_world->_scenes["tower level 3"]->_design->setBounds(&r);
//_world->_scenes["tower level 3"]->_design->paint(&screen, _world->_patterns, false);

return Common::kNoError;
}
Expand Down

0 comments on commit efab4a1

Please sign in to comment.