diff options
| -rw-r--r-- | engines/wage/design.cpp | 37 | ||||
| -rw-r--r-- | engines/wage/design.h | 3 | ||||
| -rw-r--r-- | engines/wage/entities.cpp | 4 | ||||
| -rw-r--r-- | engines/wage/gui.cpp | 2 | 
4 files changed, 42 insertions, 4 deletions
| diff --git a/engines/wage/design.cpp b/engines/wage/design.cpp index 6255932f37..f28d583d8f 100644 --- a/engines/wage/design.cpp +++ b/engines/wage/design.cpp @@ -263,7 +263,7 @@ 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(); @@ -292,6 +292,41 @@ void Design::drawRect(Graphics::ManagedSurface *surface, Common::ReadStream &in,  		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) { +	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); + +	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); + +	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::drawRoundRect(Graphics::ManagedSurface *surface, Common::ReadStream &in,  	Graphics::MacPatterns &patterns, byte fillType, byte borderThickness, byte borderFillType) { diff --git a/engines/wage/design.h b/engines/wage/design.h index 948476b43c..017fdfc14d 100644 --- a/engines/wage/design.h +++ b/engines/wage/design.h @@ -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 { diff --git a/engines/wage/entities.cpp b/engines/wage/entities.cpp index b2babbab4d..28a708b0c3 100644 --- a/engines/wage/entities.cpp +++ b/engines/wage/entities.cpp @@ -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);  	}  } diff --git a/engines/wage/gui.cpp b/engines/wage/gui.cpp index 235a2497fc..2626f3b447 100644 --- a/engines/wage/gui.cpp +++ b/engines/wage/gui.cpp @@ -13,7 +13,7 @@   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   * GNU General Public License for more details. - +    * You should have received a copy of the GNU General Public License   * along with this program; if not, write to the Free Software   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 
