WAGE: Fix style issues
This commit is contained in:
parent
c071eb0e18
commit
5bb5bb64f0
4 changed files with 42 additions and 4 deletions
|
@ -263,6 +263,36 @@ void drawPixelPlain(int x, int y, int color, void *data) {
|
|||
if (x >= 0 && x < p->surface->w && y >= 0 && y < p->surface->h)
|
||||
*((byte *)p->surface->getBasePtr(x, y)) = (byte)color;
|
||||
}
|
||||
/*
|
||||
void Design::drawRect(Graphics::ManagedSurface *surface, Common::ReadStream &in,
|
||||
Graphics::MacPatterns &patterns, byte fillType, byte borderThickness, byte borderFillType) {
|
||||
int16 y1 = in.readSint16BE();
|
||||
int16 x1 = in.readSint16BE();
|
||||
int16 y2 = in.readSint16BE();
|
||||
int16 x2 = in.readSint16BE();
|
||||
|
||||
if (x1 > x2)
|
||||
SWAP(x1, x2);
|
||||
if (y1 > y2)
|
||||
SWAP(y1, y2);
|
||||
|
||||
Common::Rect r(x1, y1, x2, y2);
|
||||
PlotData pd(surface, &patterns, fillType, 1, this);
|
||||
|
||||
if (fillType <= patterns.size())
|
||||
Graphics::drawFilledRect(r, kColorBlack, drawPixel, &pd);
|
||||
|
||||
pd.fillType = borderFillType;
|
||||
pd.thickness = borderThickness;
|
||||
|
||||
if (borderThickness > 0 && borderFillType <= patterns.size()) {
|
||||
Graphics::drawLine(x1, y1, x2, y1, kColorBlack, drawPixel, &pd);
|
||||
Graphics::drawLine(x2, y1, x2, y2, kColorBlack, drawPixel, &pd);
|
||||
Graphics::drawLine(x2, y2, x1, y2, kColorBlack, drawPixel, &pd);
|
||||
Graphics::drawLine(x1, y2, x1, y1, kColorBlack, drawPixel, &pd);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
void Design::drawRect(Graphics::ManagedSurface *surface, Common::ReadStream &in,
|
||||
Graphics::MacPatterns &patterns, byte fillType, byte borderThickness, byte borderFillType) {
|
||||
|
@ -279,6 +309,11 @@ void Design::drawRect(Graphics::ManagedSurface *surface, Common::ReadStream &in,
|
|||
Common::Rect r(x1, y1, x2, y2);
|
||||
PlotData pd(surface, &patterns, fillType, 1, this);
|
||||
|
||||
const Graphics::Surface s(*surface);
|
||||
Graphics::TransparentSurface *ts = new Graphics::TransparentSurface(*surface);
|
||||
Graphics::NinePatchBitmap bmp(ts, true);
|
||||
//bmp.blit(s, x1, y1, (x2 - x1), (y2 - y1));
|
||||
|
||||
if (fillType <= patterns.size())
|
||||
Graphics::drawFilledRect(r, kColorBlack, drawPixel, &pd);
|
||||
|
||||
|
|
|
@ -51,6 +51,9 @@
|
|||
#include "common/memstream.h"
|
||||
#include "common/rect.h"
|
||||
|
||||
#include "graphics/nine_patch.h"
|
||||
#include "graphics/transparent_surface.h"
|
||||
|
||||
#include "graphics/macgui/macwindowmanager.h"
|
||||
|
||||
namespace Wage {
|
||||
|
|
|
@ -146,12 +146,12 @@ void Scene::paint(Graphics::ManagedSurface *surface, int x, int y) {
|
|||
_design->paint(surface, *((WageEngine *)g_engine)->_world->_patterns, x, y);
|
||||
|
||||
for (ObjList::const_iterator it = _objs.begin(); it != _objs.end(); ++it) {
|
||||
debug(2, "paining Obj: %s, index: %d, type: %d", (*it)->_name.c_str(), (*it)->_index, (*it)->_type);
|
||||
debug(2, "painting Obj: %s, index: %d, type: %d", (*it)->_name.c_str(), (*it)->_index, (*it)->_type);
|
||||
(*it)->_design->paint(surface, *((WageEngine *)g_engine)->_world->_patterns, x, y);
|
||||
}
|
||||
|
||||
for (ChrList::const_iterator it = _chrs.begin(); it != _chrs.end(); ++it) {
|
||||
debug(2, "paining Chr: %s", (*it)->_name.c_str());
|
||||
debug(2, "painting Chr: %s", (*it)->_name.c_str());
|
||||
(*it)->_design->paint(surface, *((WageEngine *)g_engine)->_world->_patterns, x, y);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue