diff options
Diffstat (limited to 'engines/wintermute/Base')
30 files changed, 89 insertions, 84 deletions
diff --git a/engines/wintermute/Base/BActiveRect.cpp b/engines/wintermute/Base/BActiveRect.cpp index 5e1af264d9..be9c543469 100644 --- a/engines/wintermute/Base/BActiveRect.cpp +++ b/engines/wintermute/Base/BActiveRect.cpp @@ -86,7 +86,7 @@ CBActiveRect::~CBActiveRect() { //////////////////////////////////////////////////////////////////////////
void CBActiveRect::clipRect() {
- Common::Rect rc;
+ Rect32 rc;
bool customViewport;
Game->getCurrentViewportRect(&rc, &customViewport);
CBRenderer *Rend = Game->_renderer;
diff --git a/engines/wintermute/Base/BActiveRect.h b/engines/wintermute/Base/BActiveRect.h index cbb617342c..abb00c301f 100644 --- a/engines/wintermute/Base/BActiveRect.h +++ b/engines/wintermute/Base/BActiveRect.h @@ -29,6 +29,7 @@ #ifndef WINTERMUTE_BACTIVERECT_H
#define WINTERMUTE_BACTIVERECT_H
+#include "engines/wintermute/Math/Rect32.h"
#include "engines/wintermute/Base/BBase.h"
namespace WinterMute {
@@ -46,7 +47,7 @@ public: CBRegion *_region;
int _offsetX;
int _offsetY;
- Common::Rect _rect;
+ Rect32 _rect;
CBActiveRect(CBGame *inGameOwner = NULL);
CBActiveRect(CBGame *inGameOwner, CBObject *owner, CBSubFrame *frame, int x, int y, int width, int height, float zoomX = 100, float zoomY = 100, bool precise = true);
CBActiveRect(CBGame *inGame, CBObject *owner, CBRegion *region, int offsetX, int offsetY);
diff --git a/engines/wintermute/Base/BFontBitmap.cpp b/engines/wintermute/Base/BFontBitmap.cpp index 0af81f7ed4..b913eea3ee 100644 --- a/engines/wintermute/Base/BFontBitmap.cpp +++ b/engines/wintermute/Base/BFontBitmap.cpp @@ -221,7 +221,7 @@ void CBFontBitmap::drawChar(byte c, int x, int y) { row = c / _numColumns;
col = c % _numColumns;
- Common::Rect rect;
+ Rect32 rect;
/* l t r b */
int tileWidth;
if (_wholeCell) tileWidth = _tileWidth;
diff --git a/engines/wintermute/Base/BFontTT.cpp b/engines/wintermute/Base/BFontTT.cpp index 50cb8984d1..10d552d4e2 100644 --- a/engines/wintermute/Base/BFontTT.cpp +++ b/engines/wintermute/Base/BFontTT.cpp @@ -217,7 +217,7 @@ void CBFontTT::drawText(byte *text, int x, int y, int width, TTextAlign align, i // and paint it
if (surface) {
- Common::Rect rc;
+ Rect32 rc;
CBPlatform::setRect(&rc, 0, 0, surface->getWidth(), surface->getHeight());
for (int i = 0; i < _layers.getSize(); i++) {
uint32 color = _layers[i]->_color;
diff --git a/engines/wintermute/Base/BFrame.cpp b/engines/wintermute/Base/BFrame.cpp index 7680671434..a0d7d5a1e0 100644 --- a/engines/wintermute/Base/BFrame.cpp +++ b/engines/wintermute/Base/BFrame.cpp @@ -159,7 +159,7 @@ ERRORCODE CBFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) { char *params;
int cmd;
CBParser parser(Game);
- Common::Rect rect;
+ Rect32 rect;
int r = 255, g = 255, b = 255;
int ar = 255, ag = 255, ab = 255, alpha = 255;
int hotspotX = 0, hotspotY = 0;
@@ -325,11 +325,11 @@ ERRORCODE CBFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) { //////////////////////////////////////////////////////////////////////////
-bool CBFrame::getBoundingRect(Common::Rect *rect, int x, int y, float scaleX, float scaleY) {
+bool CBFrame::getBoundingRect(Rect32 *rect, int x, int y, float scaleX, float scaleY) {
if (!rect) return false;
CBPlatform::setRectEmpty(rect);
- Common::Rect subRect;
+ Rect32 subRect;
for (int i = 0; i < _subframes.getSize(); i++) {
_subframes[i]->getBoundingRect(&subRect, x, y, scaleX, scaleY);
diff --git a/engines/wintermute/Base/BFrame.h b/engines/wintermute/Base/BFrame.h index 4c43db142d..715a97ea69 100644 --- a/engines/wintermute/Base/BFrame.h +++ b/engines/wintermute/Base/BFrame.h @@ -46,7 +46,7 @@ public: DECLARE_PERSISTENT(CBFrame, CBScriptable)
CBSound *_sound;
bool _editorExpanded;
- bool getBoundingRect(Common::Rect *rect, int x, int y, float scaleX = 100, float scaleY = 100);
+ bool getBoundingRect(Rect32 *rect, int x, int y, float scaleX = 100, float scaleY = 100);
ERRORCODE saveAsText(CBDynBuffer *buffer, int indent);
int _moveY;
int _moveX;
diff --git a/engines/wintermute/Base/BGame.cpp b/engines/wintermute/Base/BGame.cpp index 7ad692ad7f..bf1bc5c34b 100644 --- a/engines/wintermute/Base/BGame.cpp +++ b/engines/wintermute/Base/BGame.cpp @@ -1360,7 +1360,7 @@ ERRORCODE CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi x = MIN(x, _renderer->_width);
y = MAX(y, 0);
y = MIN(y, _renderer->_height);
- Common::Point p;
+ Point32 p;
p.x = x + _renderer->_drawOffsetX;
p.y = y + _renderer->_drawOffsetY;
@@ -3963,7 +3963,7 @@ ERRORCODE CBGame::popViewport() { //////////////////////////////////////////////////////////////////////////
-ERRORCODE CBGame::getCurrentViewportRect(Common::Rect *rect, bool *custom) {
+ERRORCODE CBGame::getCurrentViewportRect(Rect32 *rect, bool *custom) {
if (rect == NULL) return STATUS_FAILED;
else {
if (_viewportSP >= 0) {
@@ -4044,7 +4044,7 @@ ERRORCODE CBGame::displayContentSimple() { //////////////////////////////////////////////////////////////////////////
ERRORCODE CBGame::displayIndicator() {
if (_saveLoadImage) {
- Common::Rect rc;
+ Rect32 rc;
CBPlatform::setRect(&rc, 0, 0, _saveLoadImage->getWidth(), _saveLoadImage->getHeight());
if (_loadInProgress) _saveLoadImage->displayTrans(_loadImageX, _loadImageY, rc);
else _saveLoadImage->displayTrans(_saveImageX, _saveImageY, rc);
@@ -4205,7 +4205,7 @@ ERRORCODE CBGame::onActivate(bool activate, bool refreshMouse) { _renderer->_active = activate;
if (refreshMouse) {
- Common::Point p;
+ Point32 p;
getMousePos(&p);
setActiveObject(_renderer->getObjectAt(p.x, p.y));
}
@@ -4403,7 +4403,7 @@ CBDebugger *CBGame::getDebugMgr() { //////////////////////////////////////////////////////////////////////////
-void CBGame::getMousePos(Common::Point *pos) {
+void CBGame::getMousePos(Point32 *pos) {
CBPlatform::getCursorPos(pos);
pos->x -= _renderer->_drawOffsetX;
@@ -4430,7 +4430,7 @@ void CBGame::getMousePos(Common::Point *pos) { pos->x = MIN(_mouseLockRect.right, pos->x);
pos->y = MIN(_mouseLockRect.bottom, pos->y);
- Common::Point newPos = *pos;
+ Point32 newPos = *pos;
newPos.x += _renderer->_drawOffsetX;
newPos.y += _renderer->_drawOffsetY;
@@ -4477,7 +4477,7 @@ bool CBGame::isDoubleClick(int buttonIndex) { maxMoveY = 16;
#endif
- Common::Point pos;
+ Point32 pos;
CBPlatform::getCursorPos(&pos);
int moveX = abs(pos.x - _lastClick[buttonIndex].PosX);
diff --git a/engines/wintermute/Base/BGame.h b/engines/wintermute/Base/BGame.h index 6650767600..dc1e476134 100644 --- a/engines/wintermute/Base/BGame.h +++ b/engines/wintermute/Base/BGame.h @@ -34,6 +34,7 @@ #include "engines/wintermute/Base/BObject.h"
#include "engines/wintermute/persistent.h"
#include "engines/wintermute/coll_templ.h"
+#include "engines/wintermute/Math/Rect32.h"
#include "common/events.h"
namespace WinterMute {
@@ -91,8 +92,8 @@ public: virtual ERRORCODE miniUpdate();
- void getMousePos(Common::Point *Pos);
- Common::Rect _mouseLockRect;
+ void getMousePos(Point32 *Pos);
+ Rect32 _mouseLockRect;
bool _shuttingDown;
@@ -314,7 +315,7 @@ public: uint32 _liveTimerLast;
CBObject *_capturedObject;
- Common::Point _mousePos;
+ Point32 _mousePos;
bool validObject(CBObject *object);
ERRORCODE unregisterObject(CBObject *object);
ERRORCODE registerObject(CBObject *object);
@@ -338,7 +339,7 @@ public: virtual ERRORCODE windowLoadHook(CUIWindow *win, char **buf, char **params);
virtual ERRORCODE windowScriptMethodHook(CUIWindow *win, CScScript *script, CScStack *stack, const char *name);
ERRORCODE getCurrentViewportOffset(int *offsetX = NULL, int *offsetY = NULL);
- ERRORCODE getCurrentViewportRect(Common::Rect *rect, bool *custom = NULL);
+ ERRORCODE getCurrentViewportRect(Rect32 *rect, bool *custom = NULL);
ERRORCODE popViewport();
ERRORCODE pushViewport(CBViewport *Viewport);
ERRORCODE setActiveObject(CBObject *Obj);
diff --git a/engines/wintermute/Base/BObject.h b/engines/wintermute/Base/BObject.h index 3a82cbe128..15ccdbef44 100644 --- a/engines/wintermute/Base/BObject.h +++ b/engines/wintermute/Base/BObject.h @@ -103,7 +103,7 @@ public: bool _registrable;
bool _zoomable;
bool _shadowable;
- Common::Rect _rect;
+ Rect32 _rect;
bool _rectSet;
int _iD;
bool _movable;
diff --git a/engines/wintermute/Base/BPersistMgr.cpp b/engines/wintermute/Base/BPersistMgr.cpp index 412aa88312..7308a8bbb7 100644 --- a/engines/wintermute/Base/BPersistMgr.cpp +++ b/engines/wintermute/Base/BPersistMgr.cpp @@ -671,7 +671,7 @@ ERRORCODE CBPersistMgr::transfer(const char *name, byte *val) { //////////////////////////////////////////////////////////////////////////
// RECT
-ERRORCODE CBPersistMgr::transfer(const char *name, Common::Rect *val) {
+ERRORCODE CBPersistMgr::transfer(const char *name, Rect32 *val) {
if (_saving) {
_saveStream->writeSint32LE(val->left);
_saveStream->writeSint32LE(val->top);
@@ -694,7 +694,7 @@ ERRORCODE CBPersistMgr::transfer(const char *name, Common::Rect *val) { //////////////////////////////////////////////////////////////////////////
// POINT
-ERRORCODE CBPersistMgr::transfer(const char *name, Common::Point *val) {
+ERRORCODE CBPersistMgr::transfer(const char *name, Point32 *val) {
if (_saving) {
_saveStream->writeSint32LE(val->x);
_saveStream->writeSint32LE(val->y);
diff --git a/engines/wintermute/Base/BPersistMgr.h b/engines/wintermute/Base/BPersistMgr.h index dc4c2173de..d2aca60cf9 100644 --- a/engines/wintermute/Base/BPersistMgr.h +++ b/engines/wintermute/Base/BPersistMgr.h @@ -31,6 +31,7 @@ #include "engines/wintermute/Base/BBase.h"
+#include "engines/wintermute/Math/Rect32.h"
#include "engines/savestate.h"
#include "common/stream.h"
#include "common/str.h"
@@ -85,8 +86,8 @@ public: ERRORCODE transfer(const char *name, double *val);
ERRORCODE transfer(const char *name, bool *val);
ERRORCODE transfer(const char *name, byte *val);
- ERRORCODE transfer(const char *name, Common::Rect *val);
- ERRORCODE transfer(const char *name, Common::Point *val);
+ ERRORCODE transfer(const char *name, Rect32 *val);
+ ERRORCODE transfer(const char *name, Point32 *val);
ERRORCODE transfer(const char *name, const char **val);
ERRORCODE transfer(const char *name, char **val);
ERRORCODE transfer(const char *name, Common::String *val);
diff --git a/engines/wintermute/Base/BRegion.cpp b/engines/wintermute/Base/BRegion.cpp index 63e862a569..65ba2c8825 100644 --- a/engines/wintermute/Base/BRegion.cpp +++ b/engines/wintermute/Base/BRegion.cpp @@ -79,11 +79,11 @@ bool CBRegion::createRegion() { bool CBRegion::pointInRegion(int x, int y) {
if (_points.getSize() < 3) return false;
- Common::Point pt;
+ Point32 pt;
pt.x = x;
pt.y = y;
- Common::Rect rect;
+ Rect32 rect;
rect.left = x - 1;
rect.right = x + 2;
rect.top = y - 1;
@@ -465,7 +465,7 @@ bool CBRegion::ptInPolygon(int x, int y) { //////////////////////////////////////////////////////////////////////////
-ERRORCODE CBRegion::getBoundingRect(Common::Rect *rect) {
+ERRORCODE CBRegion::getBoundingRect(Rect32 *rect) {
if (_points.getSize() == 0) CBPlatform::setRectEmpty(rect);
else {
int MinX = INT_MAX, MinY = INT_MAX, MaxX = INT_MIN, MaxY = INT_MIN;
diff --git a/engines/wintermute/Base/BRegion.h b/engines/wintermute/Base/BRegion.h index 4aa491d7c9..6c79abc8f3 100644 --- a/engines/wintermute/Base/BRegion.h +++ b/engines/wintermute/Base/BRegion.h @@ -41,7 +41,7 @@ public: int _lastMimicY;
void cleanup();
ERRORCODE mimic(CBRegion *region, float scale = 100.0f, int x = 0, int y = 0);
- ERRORCODE getBoundingRect(Common::Rect *rect);
+ ERRORCODE getBoundingRect(Rect32 *rect);
bool ptInPolygon(int x, int y);
DECLARE_PERSISTENT(CBRegion, CBObject)
bool _active;
@@ -52,7 +52,7 @@ public: bool createRegion();
ERRORCODE loadFile(const char *filename);
ERRORCODE loadBuffer(byte *buffer, bool complete = true);
- Common::Rect _rect;
+ Rect32 _rect;
CBArray<CBPoint *, CBPoint *> _points;
virtual ERRORCODE saveAsText(CBDynBuffer *buffer, int indent, const char *nameOverride = NULL);
diff --git a/engines/wintermute/Base/BRenderSDL.cpp b/engines/wintermute/Base/BRenderSDL.cpp index 26ae8c5787..c2319d1b7a 100644 --- a/engines/wintermute/Base/BRenderSDL.cpp +++ b/engines/wintermute/Base/BRenderSDL.cpp @@ -302,7 +302,7 @@ ERRORCODE CBRenderSDL::fadeToColor(uint32 Color, Common::Rect *rect) { fillRect.setWidth(rect->width());
fillRect.setHeight(rect->height());
} else {
- Common::Rect rc;
+ Rect32 rc;
Game->getCurrentViewportRect(&rc);
fillRect.left = (int16)rc.left;
fillRect.top = (int16)rc.top;
@@ -505,7 +505,7 @@ ERRORCODE CBRenderSDL::drawLine(int x1, int y1, int x2, int y2, uint32 color) { //SDL_SetRenderDrawColor(_renderer, r, g, b, a);
//SDL_SetRenderDrawBlendMode(_renderer, SDL_BLENDMODE_BLEND);
- Common::Point point1, point2;
+ Point32 point1, point2;
point1.x = x1;
point1.y = y1;
pointToScreen(&point1);
@@ -609,7 +609,7 @@ void CBRenderSDL::modTargetRect(Common::Rect *rect) { }
//////////////////////////////////////////////////////////////////////////
-void CBRenderSDL::pointFromScreen(Common::Point *point) {
+void CBRenderSDL::pointFromScreen(Point32 *point) {
#if 0
SDL_Rect viewportRect;
SDL_RenderGetViewport(GetSdlRenderer(), &viewportRect);
@@ -621,7 +621,7 @@ void CBRenderSDL::pointFromScreen(Common::Point *point) { //////////////////////////////////////////////////////////////////////////
-void CBRenderSDL::pointToScreen(Common::Point *point) {
+void CBRenderSDL::pointToScreen(Point32 *point) {
#if 0
SDL_Rect viewportRect;
SDL_RenderGetViewport(GetSdlRenderer(), &viewportRect);
diff --git a/engines/wintermute/Base/BRenderSDL.h b/engines/wintermute/Base/BRenderSDL.h index aa5b390ede..1e7acf51f3 100644 --- a/engines/wintermute/Base/BRenderSDL.h +++ b/engines/wintermute/Base/BRenderSDL.h @@ -86,8 +86,8 @@ public: ERRORCODE setViewport(int left, int top, int right, int bottom);
void modTargetRect(Common::Rect *rect);
- void pointFromScreen(Common::Point *point);
- void pointToScreen(Common::Point *point);
+ void pointFromScreen(Point32 *point);
+ void pointToScreen(Point32 *point);
void dumpData(const char *filename);
diff --git a/engines/wintermute/Base/BRenderer.cpp b/engines/wintermute/Base/BRenderer.cpp index b593161c41..d3d313faee 100644 --- a/engines/wintermute/Base/BRenderer.cpp +++ b/engines/wintermute/Base/BRenderer.cpp @@ -68,7 +68,7 @@ void CBRenderer::initLoop() { //////////////////////////////////////////////////////////////////////
CBObject *CBRenderer::getObjectAt(int x, int y) {
- Common::Point point;
+ Point32 point;
point.x = x;
point.y = y;
@@ -203,7 +203,7 @@ ERRORCODE CBRenderer::setScreenViewport() { //////////////////////////////////////////////////////////////////////////
-ERRORCODE CBRenderer::setViewport(Common::Rect *rect) {
+ERRORCODE CBRenderer::setViewport(Rect32 *rect) {
return setViewport(rect->left + _drawOffsetX,
rect->top + _drawOffsetY,
rect->right + _drawOffsetX,
@@ -221,7 +221,7 @@ CBImage *CBRenderer::takeScreenshot() { ERRORCODE CBRenderer::clipCursor() {
/*
if (!_windowed) {
- Common::Rect rc;
+ Rect32 rc;
GetWindowRect(_window, &rc);
// if "maintain aspect ratio" is in effect, lock mouse to visible area
@@ -245,7 +245,7 @@ ERRORCODE CBRenderer::unclipCursor() { }
//////////////////////////////////////////////////////////////////////////
-bool CBRenderer::pointInViewport(Common::Point *p) {
+bool CBRenderer::pointInViewport(Point32 *p) {
if (p->x < _drawOffsetX) return false;
if (p->y < _drawOffsetY) return false;
if (p->x > _drawOffsetX + _width) return false;
diff --git a/engines/wintermute/Base/BRenderer.h b/engines/wintermute/Base/BRenderer.h index 43a2e14ea2..e7a9518c50 100644 --- a/engines/wintermute/Base/BRenderer.h +++ b/engines/wintermute/Base/BRenderer.h @@ -50,7 +50,7 @@ public: virtual void dumpData(const char *filename) {};
virtual CBImage *takeScreenshot();
virtual ERRORCODE setViewport(int left, int top, int right, int bottom);
- virtual ERRORCODE setViewport(Common::Rect *Rect);
+ virtual ERRORCODE setViewport(Rect32 *Rect);
virtual ERRORCODE setScreenViewport();
virtual ERRORCODE fade(uint16 Alpha);
virtual ERRORCODE fadeToColor(uint32 Color, Common::Rect *rect = NULL);
@@ -103,17 +103,17 @@ public: virtual ERRORCODE endSpriteBatch() {
return STATUS_OK;
};
- bool pointInViewport(Common::Point *P);
+ bool pointInViewport(Point32 *P);
uint32 _forceAlphaColor;
uint32 _window;
uint32 _clipperWindow;
bool _active;
bool _ready;
bool _windowed;
- Common::Rect _windowRect;
- Common::Rect _viewportRect;
- Common::Rect _screenRect;
- Common::Rect _monitorRect;
+ Rect32 _windowRect;
+ Rect32 _viewportRect;
+ Rect32 _screenRect;
+ Rect32 _monitorRect;
int _bPP;
int _height;
int _width;
diff --git a/engines/wintermute/Base/BSprite.cpp b/engines/wintermute/Base/BSprite.cpp index 6fd5152d70..f33b5764c6 100644 --- a/engines/wintermute/Base/BSprite.cpp +++ b/engines/wintermute/Base/BSprite.cpp @@ -413,13 +413,13 @@ CBSurface *CBSprite::getSurface() { }
//////////////////////////////////////////////////////////////////////////
-bool CBSprite::getBoundingRect(Common::Rect *rect, int x, int y, float scaleX, float scaleY) {
+bool CBSprite::getBoundingRect(Rect32 *rect, int x, int y, float scaleX, float scaleY) {
if (!rect) return false;
CBPlatform::setRectEmpty(rect);
for (int i = 0; i < _frames.getSize(); i++) {
- Common::Rect frame;
- Common::Rect temp;
+ Rect32 frame;
+ Rect32 temp;
CBPlatform::copyRect(&temp, rect);
_frames[i]->getBoundingRect(&frame, x, y, scaleX, scaleY);
CBPlatform::unionRect(rect, &temp, &frame);
diff --git a/engines/wintermute/Base/BSprite.h b/engines/wintermute/Base/BSprite.h index 2b705b689a..bf40bbc6c6 100644 --- a/engines/wintermute/Base/BSprite.h +++ b/engines/wintermute/Base/BSprite.h @@ -53,7 +53,7 @@ public: DECLARE_PERSISTENT(CBSprite, CBScriptHolder)
bool _editorAllFrames;
- bool getBoundingRect(Common::Rect *rect, int x, int y, float scaleX = 100, float scaleY = 100);
+ bool getBoundingRect(Rect32 *rect, int x, int y, float scaleX = 100, float scaleY = 100);
int _moveY;
int _moveX;
ERRORCODE display(int x, int y, CBObject *registerOwner = NULL, float zoomX = 100, float zoomY = 100, uint32 alpha = 0xFFFFFFFF, float rotate = 0.0f, TSpriteBlendMode blendMode = BLEND_NORMAL);
@@ -72,7 +72,7 @@ public: ERRORCODE draw(int x, int y, CBObject *Register = NULL, float zoomX = 100, float zoomY = 100, uint32 alpha = 0xFFFFFFFF);
bool _looping;
int _currentFrame;
- ERRORCODE addFrame(const char *filename, uint32 delay = 0, int hotspotX = 0, int hotspotY = 0, Common::Rect *rect = NULL);
+ ERRORCODE addFrame(const char *filename, uint32 delay = 0, int hotspotX = 0, int hotspotY = 0, Rect32 *rect = NULL);
CBSprite(CBGame *inGame, CBObject *owner = NULL);
virtual ~CBSprite();
CBArray<CBFrame *, CBFrame *> _frames;
diff --git a/engines/wintermute/Base/BSubFrame.cpp b/engines/wintermute/Base/BSubFrame.cpp index 33c6c32f8f..aa8ce926dc 100644 --- a/engines/wintermute/Base/BSubFrame.cpp +++ b/engines/wintermute/Base/BSubFrame.cpp @@ -110,7 +110,7 @@ ERRORCODE CBSubFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) { char *params;
int cmd;
CBParser parser(Game);
- Common::Rect rect;
+ Rect32 rect;
int r = 255, g = 255, b = 255;
int ar = 255, ag = 255, ab = 255, alpha = 255;
bool custoTrans = false;
@@ -233,7 +233,7 @@ ERRORCODE CBSubFrame::draw(int x, int y, CBObject *registerOwner, float zoomX, f //////////////////////////////////////////////////////////////////////////
-bool CBSubFrame::getBoundingRect(Common::Rect *rect, int x, int y, float scaleX, float scaleY) {
+bool CBSubFrame::getBoundingRect(Rect32 *rect, int x, int y, float scaleX, float scaleY) {
if (!rect) return false;
float ratioX = scaleX / 100.0f;
@@ -259,7 +259,7 @@ ERRORCODE CBSubFrame::saveAsText(CBDynBuffer *buffer, int indent, bool complete) if (_transparent != 0xFFFF00FF)
buffer->putTextIndent(indent + 2, "TRANSPARENT { %d,%d,%d }\n", RGBCOLGetR(_transparent), RGBCOLGetG(_transparent), RGBCOLGetB(_transparent));
- Common::Rect rect;
+ Rect32 rect;
CBPlatform::setRectEmpty(&rect);
if (_surface) CBPlatform::setRect(&rect, 0, 0, _surface->getWidth(), _surface->getHeight());
if (!CBPlatform::equalRect(&rect, &_rect))
diff --git a/engines/wintermute/Base/BSubFrame.h b/engines/wintermute/Base/BSubFrame.h index a13a5fa196..46ee948e64 100644 --- a/engines/wintermute/Base/BSubFrame.h +++ b/engines/wintermute/Base/BSubFrame.h @@ -53,12 +53,12 @@ public: virtual ~CBSubFrame();
ERRORCODE loadBuffer(byte *buffer, int lifeTime, bool keepLoaded);
ERRORCODE draw(int x, int y, CBObject *registerOwner = NULL, float zoomX = 100, float zoomY = 100, bool precise = true, uint32 alpha = 0xFFFFFFFF, float rotate = 0.0f, TSpriteBlendMode blendMode = BLEND_NORMAL);
- bool getBoundingRect(Common::Rect *rect, int x, int y, float scaleX = 100, float scaleY = 100);
+ bool getBoundingRect(Rect32 *rect, int x, int y, float scaleX = 100, float scaleY = 100);
int _hotspotX;
int _hotspotY;
uint32 _alpha;
- Common::Rect _rect;
+ Rect32 _rect;
bool _cKDefault;
byte _cKRed;
diff --git a/engines/wintermute/Base/BSurface.cpp b/engines/wintermute/Base/BSurface.cpp index f67808a47f..0d96a73d41 100644 --- a/engines/wintermute/Base/BSurface.cpp +++ b/engines/wintermute/Base/BSurface.cpp @@ -75,12 +75,12 @@ bool CBSurface::isTransparentAt(int x, int y) { }
//////////////////////////////////////////////////////////////////////
-ERRORCODE CBSurface::displayHalfTrans(int x, int y, Common::Rect rect) {
+ERRORCODE CBSurface::displayHalfTrans(int x, int y, Rect32 rect) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-ERRORCODE CBSurface::displayTransform(int x, int y, int hotX, int hotY, Common::Rect rect, float zoomX, float zoomY, uint32 alpha, float rotate, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
+ERRORCODE CBSurface::displayTransform(int x, int y, int hotX, int hotY, Rect32 rect, float zoomX, float zoomY, uint32 alpha, float rotate, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
return displayTransZoom(x, y, rect, zoomX, zoomY, alpha, blendMode, mirrorX, mirrorY);
}
diff --git a/engines/wintermute/Base/BSurface.h b/engines/wintermute/Base/BSurface.h index a22f1d7606..cb19a23271 100644 --- a/engines/wintermute/Base/BSurface.h +++ b/engines/wintermute/Base/BSurface.h @@ -30,6 +30,7 @@ #define WINTERMUTE_BSURFACE_H
#include "engines/wintermute/Base/BBase.h"
+#include "engines/wintermute/Math/Rect32.h"
#include "graphics/surface.h"
namespace WinterMute {
@@ -52,14 +53,14 @@ public: CBSurface(CBGame *inGame);
virtual ~CBSurface();
- virtual ERRORCODE displayHalfTrans(int x, int y, Common::Rect rect);
+ virtual ERRORCODE displayHalfTrans(int x, int y, Rect32 rect);
virtual bool isTransparentAt(int x, int y);
- virtual ERRORCODE displayTransZoom(int x, int y, Common::Rect rect, float zoomX, float zoomY, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
- virtual ERRORCODE displayTrans(int x, int y, Common::Rect rect, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
- virtual ERRORCODE displayTransOffset(int x, int y, Common::Rect rect, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false, int offsetX = 0, int offsetY = 0) = 0;
- virtual ERRORCODE display(int x, int y, Common::Rect rect, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool MirrorY = false) = 0;
- virtual ERRORCODE displayZoom(int x, int y, Common::Rect rect, float ZoomX, float ZoomY, uint32 alpha = 0xFFFFFFFF, bool transparent = false, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
- virtual ERRORCODE displayTransform(int x, int y, int hotX, int hotY, Common::Rect rect, float zoomX, float zoomY, uint32 alpha, float rotate, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
+ virtual ERRORCODE displayTransZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
+ virtual ERRORCODE displayTrans(int x, int y, Rect32 rect, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
+ virtual ERRORCODE displayTransOffset(int x, int y, Rect32 rect, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false, int offsetX = 0, int offsetY = 0) = 0;
+ virtual ERRORCODE display(int x, int y, Rect32 rect, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool MirrorY = false) = 0;
+ virtual ERRORCODE displayZoom(int x, int y, Rect32 rect, float ZoomX, float ZoomY, uint32 alpha = 0xFFFFFFFF, bool transparent = false, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
+ virtual ERRORCODE displayTransform(int x, int y, int hotX, int hotY, Rect32 rect, float zoomX, float zoomY, uint32 alpha, float rotate, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
virtual ERRORCODE restore();
virtual ERRORCODE create(const char *filename, bool defaultCK, byte ckRed, byte ckGreen, byte ckBlue, int lifeTime = -1, bool keepLoaded = false) = 0;
virtual ERRORCODE create(int Width, int Height);
diff --git a/engines/wintermute/Base/BSurfaceSDL.cpp b/engines/wintermute/Base/BSurfaceSDL.cpp index 07e552138c..bbdfeca3d7 100644 --- a/engines/wintermute/Base/BSurfaceSDL.cpp +++ b/engines/wintermute/Base/BSurfaceSDL.cpp @@ -403,40 +403,40 @@ ERRORCODE CBSurfaceSDL::endPixelOp() { //////////////////////////////////////////////////////////////////////////
-ERRORCODE CBSurfaceSDL::display(int x, int y, Common::Rect rect, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
+ERRORCODE CBSurfaceSDL::display(int x, int y, Rect32 rect, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
return drawSprite(x, y, &rect, 100, 100, 0xFFFFFFFF, true, blendMode, mirrorX, mirrorY);
}
//////////////////////////////////////////////////////////////////////////
-ERRORCODE CBSurfaceSDL::displayTrans(int x, int y, Common::Rect rect, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
+ERRORCODE CBSurfaceSDL::displayTrans(int x, int y, Rect32 rect, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
return drawSprite(x, y, &rect, 100, 100, alpha, false, blendMode, mirrorX, mirrorY);
}
//////////////////////////////////////////////////////////////////////////
-ERRORCODE CBSurfaceSDL::displayTransOffset(int x, int y, Common::Rect rect, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY, int offsetX, int offsetY) {
+ERRORCODE CBSurfaceSDL::displayTransOffset(int x, int y, Rect32 rect, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY, int offsetX, int offsetY) {
return drawSprite(x, y, &rect, 100, 100, alpha, false, blendMode, mirrorX, mirrorY, offsetX, offsetY);
}
//////////////////////////////////////////////////////////////////////////
-ERRORCODE CBSurfaceSDL::displayTransZoom(int x, int y, Common::Rect rect, float zoomX, float zoomY, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
+ERRORCODE CBSurfaceSDL::displayTransZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
return drawSprite(x, y, &rect, zoomX, zoomY, alpha, false, blendMode, mirrorX, mirrorY);
}
//////////////////////////////////////////////////////////////////////////
-ERRORCODE CBSurfaceSDL::displayZoom(int x, int y, Common::Rect rect, float zoomX, float zoomY, uint32 alpha, bool Transparent, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
+ERRORCODE CBSurfaceSDL::displayZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha, bool Transparent, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
return drawSprite(x, y, &rect, zoomX, zoomY, alpha, !Transparent, blendMode, mirrorX, mirrorY);
}
//////////////////////////////////////////////////////////////////////////
-ERRORCODE CBSurfaceSDL::displayTransform(int x, int y, int hotX, int hotY, Common::Rect rect, float zoomX, float zoomY, uint32 alpha, float rotate, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
+ERRORCODE CBSurfaceSDL::displayTransform(int x, int y, int hotX, int hotY, Rect32 rect, float zoomX, float zoomY, uint32 alpha, float rotate, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
return drawSprite(x, y, &rect, zoomX, zoomY, alpha, false, blendMode, mirrorX, mirrorY);
}
//////////////////////////////////////////////////////////////////////////
-ERRORCODE CBSurfaceSDL::drawSprite(int x, int y, Common::Rect *rect, float zoomX, float zoomY, uint32 alpha, bool alphaDisable, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY, int offsetX, int offsetY) {
+ERRORCODE CBSurfaceSDL::drawSprite(int x, int y, Rect32 *rect, float zoomX, float zoomY, uint32 alpha, bool alphaDisable, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY, int offsetX, int offsetY) {
CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer);
if (!_loaded) {
diff --git a/engines/wintermute/Base/BSurfaceSDL.h b/engines/wintermute/Base/BSurfaceSDL.h index 0bfda92866..289f75eaf3 100644 --- a/engines/wintermute/Base/BSurfaceSDL.h +++ b/engines/wintermute/Base/BSurfaceSDL.h @@ -53,12 +53,12 @@ public: ERRORCODE endPixelOp();
- ERRORCODE displayTransZoom(int x, int y, Common::Rect rect, float zoomX, float zoomY, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false);
- ERRORCODE displayTrans(int x, int y, Common::Rect rect, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false);
- ERRORCODE displayTransOffset(int x, int y, Common::Rect rect, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false, int offsetX = 0, int offsetY = 0);
- ERRORCODE display(int x, int y, Common::Rect rect, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false);
- ERRORCODE displayZoom(int x, int y, Common::Rect rect, float zoomX, float zoomY, uint32 alpha = 0xFFFFFFFF, bool Transparent = false, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false);
- ERRORCODE displayTransform(int x, int y, int hotX, int hotY, Common::Rect Rect, float zoomX, float zoomY, uint32 alpha, float rotate, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false);
+ ERRORCODE displayTransZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false);
+ ERRORCODE displayTrans(int x, int y, Rect32 rect, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false);
+ ERRORCODE displayTransOffset(int x, int y, Rect32 rect, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false, int offsetX = 0, int offsetY = 0);
+ ERRORCODE display(int x, int y, Rect32 rect, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false);
+ ERRORCODE displayZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha = 0xFFFFFFFF, bool Transparent = false, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false);
+ ERRORCODE displayTransform(int x, int y, int hotX, int hotY, Rect32 Rect, float zoomX, float zoomY, uint32 alpha, float rotate, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false);
virtual ERRORCODE putSurface(const Graphics::Surface &surface, bool hasAlpha = false);
/* static unsigned DLL_CALLCONV ReadProc(void *buffer, unsigned size, unsigned count, fi_handle handle);
static int DLL_CALLCONV SeekProc(fi_handle handle, long offset, int origin);
@@ -86,7 +86,7 @@ private: Graphics::Surface *_surface;
bool _loaded;
void finishLoad();
- ERRORCODE drawSprite(int x, int y, Common::Rect *rect, float zoomX, float zoomY, uint32 alpha, bool alphaDisable, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY, int offsetX = 0, int offsetY = 0);
+ ERRORCODE drawSprite(int x, int y, Rect32 *rect, float zoomX, float zoomY, uint32 alpha, bool alphaDisable, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY, int offsetX = 0, int offsetY = 0);
void genAlphaMask(Graphics::Surface *surface);
uint32 getPixel(Graphics::Surface *surface, int x, int y);
diff --git a/engines/wintermute/Base/BViewport.cpp b/engines/wintermute/Base/BViewport.cpp index ad89bc0697..f1f28bc78b 100644 --- a/engines/wintermute/Base/BViewport.cpp +++ b/engines/wintermute/Base/BViewport.cpp @@ -79,7 +79,7 @@ ERRORCODE CBViewport::setRect(int left, int top, int right, int bottom, bool noC //////////////////////////////////////////////////////////////////////////
-Common::Rect *CBViewport::getRect() {
+Rect32 *CBViewport::getRect() {
return &_rect;
}
diff --git a/engines/wintermute/Base/BViewport.h b/engines/wintermute/Base/BViewport.h index 0ace6791bc..83e89a6014 100644 --- a/engines/wintermute/Base/BViewport.h +++ b/engines/wintermute/Base/BViewport.h @@ -38,7 +38,7 @@ class CBViewport : public CBBase { public:
int getHeight();
int getWidth();
- Common::Rect *getRect();
+ Rect32 *getRect();
ERRORCODE setRect(int left, int top, int right, int bottom, bool noCheck = false);
DECLARE_PERSISTENT(CBViewport, CBBase)
int _offsetY;
@@ -47,7 +47,7 @@ public: CBViewport(CBGame *inGame = NULL);
virtual ~CBViewport();
private:
- Common::Rect _rect;
+ Rect32 _rect;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/Base/PartEmitter.h b/engines/wintermute/Base/PartEmitter.h index 2f72d96103..e2de466e42 100644 --- a/engines/wintermute/Base/PartEmitter.h +++ b/engines/wintermute/Base/PartEmitter.h @@ -82,7 +82,7 @@ public: int _maxBatches;
int _batchesGenerated;
- Common::Rect _border;
+ Rect32 _border;
int _borderThicknessLeft;
int _borderThicknessRight;
int _borderThicknessTop;
diff --git a/engines/wintermute/Base/PartParticle.cpp b/engines/wintermute/Base/PartParticle.cpp index 3eaa546d29..f3a8de9ece 100644 --- a/engines/wintermute/Base/PartParticle.cpp +++ b/engines/wintermute/Base/PartParticle.cpp @@ -124,7 +124,7 @@ ERRORCODE CPartParticle::update(CPartEmitter *emitter, uint32 currentTime, uint3 // particle hit the border
if (!_isDead && !CBPlatform::isRectEmpty(&_border)) {
- Common::Point p;
+ Point32 p;
p.x = (int32)_pos.x;
p.y = (int32)_pos.y;
if (!CBPlatform::ptInRect(&_border, p))
diff --git a/engines/wintermute/Base/PartParticle.h b/engines/wintermute/Base/PartParticle.h index 229bc11935..aed559d337 100644 --- a/engines/wintermute/Base/PartParticle.h +++ b/engines/wintermute/Base/PartParticle.h @@ -31,6 +31,7 @@ #include "engines/wintermute/Base/BBase.h"
+#include "engines/wintermute/Math/Rect32.h"
#include "engines/wintermute/math/Vector2.h"
namespace WinterMute {
@@ -57,7 +58,7 @@ public: int _alpha1;
int _alpha2;
- Common::Rect _border;
+ Rect32 _border;
Vector2 _pos;
float _posZ;
Vector2 _velocity;
|