aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/Ad
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-09 12:27:06 +0200
committerEinar Johan Trøan Sømåen2012-07-09 12:27:06 +0200
commit07cebdbf2b70e02b12d32880d23dbe293ab12358 (patch)
treed60a66f89c8bd1e1749010fa3aa41d2e5459f5ad /engines/wintermute/Ad
parent2959065e49390ab1da0b00a277a464d991ff10ad (diff)
downloadscummvm-rg350-07cebdbf2b70e02b12d32880d23dbe293ab12358.tar.gz
scummvm-rg350-07cebdbf2b70e02b12d32880d23dbe293ab12358.tar.bz2
scummvm-rg350-07cebdbf2b70e02b12d32880d23dbe293ab12358.zip
WINTERMUTE: Change usage of Common::Rect to our own 32-bit variant.
Diffstat (limited to 'engines/wintermute/Ad')
-rw-r--r--engines/wintermute/Ad/AdGame.cpp6
-rw-r--r--engines/wintermute/Ad/AdInventoryBox.cpp6
-rw-r--r--engines/wintermute/Ad/AdInventoryBox.h2
-rw-r--r--engines/wintermute/Ad/AdItem.cpp2
-rw-r--r--engines/wintermute/Ad/AdResponseBox.cpp2
-rw-r--r--engines/wintermute/Ad/AdResponseBox.h2
-rw-r--r--engines/wintermute/Ad/AdScene.cpp4
-rw-r--r--engines/wintermute/Ad/AdSentence.h3
8 files changed, 14 insertions, 13 deletions
diff --git a/engines/wintermute/Ad/AdGame.cpp b/engines/wintermute/Ad/AdGame.cpp
index 6a58f99881..ed31cd3acb 100644
--- a/engines/wintermute/Ad/AdGame.cpp
+++ b/engines/wintermute/Ad/AdGame.cpp
@@ -1210,7 +1210,7 @@ ERRORCODE CAdGame::loadBuffer(byte *buffer, bool complete) {
break;
case TOKEN_SCENE_VIEWPORT: {
- Common::Rect rc;
+ Rect32 rc;
parser.scanStr((char *)params2, "%d,%d,%d,%d", &rc.left, &rc.top, &rc.right, &rc.bottom);
if (!_sceneViewport) _sceneViewport = new CBViewport(Game);
if (_sceneViewport) _sceneViewport->setRect(rc.left, rc.top, rc.right, rc.bottom);
@@ -1698,7 +1698,7 @@ ERRORCODE CAdGame::displayContent(bool doUpdate, bool displayAll) {
// process scripts
if (doUpdate) _scEngine->tick();
- Common::Point p;
+ Point32 p;
getMousePos(&p);
_scene->update();
@@ -1924,7 +1924,7 @@ char *CAdGame::findSpeechFile(char *stringID) {
//////////////////////////////////////////////////////////////////////////
bool CAdGame::validMouse() {
- Common::Point pos;
+ Point32 pos;
CBPlatform::getCursorPos(&pos);
return _renderer->pointInViewport(&pos);
diff --git a/engines/wintermute/Ad/AdInventoryBox.cpp b/engines/wintermute/Ad/AdInventoryBox.cpp
index fe3a9b8a09..a528167e8c 100644
--- a/engines/wintermute/Ad/AdInventoryBox.cpp
+++ b/engines/wintermute/Ad/AdInventoryBox.cpp
@@ -47,7 +47,7 @@ IMPLEMENT_PERSISTENT(CAdInventoryBox, false)
//////////////////////////////////////////////////////////////////////////
CAdInventoryBox::CAdInventoryBox(CBGame *inGame): CBObject(inGame) {
- CBPlatform::setRectEmpty(&_itemsArea);
+ _itemsArea.setEmpty();
_scrollOffset = 0;
_spacing = 0;
_itemWidth = _itemHeight = 50;
@@ -123,9 +123,9 @@ ERRORCODE CAdInventoryBox::display() {
// display window
- Common::Rect rect = _itemsArea;
+ Rect32 rect = _itemsArea;
if (_window) {
- CBPlatform::offsetRect(&rect, _window->_posX, _window->_posY);
+ rect.offsetRect(_window->_posX, _window->_posY);
_window->display();
}
diff --git a/engines/wintermute/Ad/AdInventoryBox.h b/engines/wintermute/Ad/AdInventoryBox.h
index e3aec3a20b..857abd5d35 100644
--- a/engines/wintermute/Ad/AdInventoryBox.h
+++ b/engines/wintermute/Ad/AdInventoryBox.h
@@ -49,7 +49,7 @@ public:
CUIButton *_closeButton;
int _spacing;
int _scrollOffset;
- Common::Rect _itemsArea;
+ Rect32 _itemsArea;
ERRORCODE listen(CBScriptHolder *param1, uint32 param2);
CUIWindow *_window;
CAdInventoryBox(CBGame *inGame);
diff --git a/engines/wintermute/Ad/AdItem.cpp b/engines/wintermute/Ad/AdItem.cpp
index 435947e96d..e8c32607dc 100644
--- a/engines/wintermute/Ad/AdItem.cpp
+++ b/engines/wintermute/Ad/AdItem.cpp
@@ -389,7 +389,7 @@ ERRORCODE CAdItem::update() {
ERRORCODE CAdItem::display(int x, int y) {
int width = 0;
if (_currentSprite) {
- Common::Rect rc;
+ Rect32 rc;
_currentSprite->getBoundingRect(&rc, 0, 0);
width = rc.width();
}
diff --git a/engines/wintermute/Ad/AdResponseBox.cpp b/engines/wintermute/Ad/AdResponseBox.cpp
index f2162012e0..cb9a0496d1 100644
--- a/engines/wintermute/Ad/AdResponseBox.cpp
+++ b/engines/wintermute/Ad/AdResponseBox.cpp
@@ -397,7 +397,7 @@ ERRORCODE CAdResponseBox::saveAsText(CBDynBuffer *buffer, int indent) {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CAdResponseBox::display() {
- Common::Rect rect = _responseArea;
+ Rect32 rect = _responseArea;
if (_window) {
CBPlatform::offsetRect(&rect, _window->_posX, _window->_posY);
//_window->display();
diff --git a/engines/wintermute/Ad/AdResponseBox.h b/engines/wintermute/Ad/AdResponseBox.h
index 31076c056c..86fe8ed947 100644
--- a/engines/wintermute/Ad/AdResponseBox.h
+++ b/engines/wintermute/Ad/AdResponseBox.h
@@ -74,7 +74,7 @@ public:
CUIWindow *_window;
CUIWindow *_shieldWindow;
bool _horizontal;
- Common::Rect _responseArea;
+ Rect32 _responseArea;
int _verticalAlign;
TTextAlign _align;
ERRORCODE loadFile(const char *filename);
diff --git a/engines/wintermute/Ad/AdScene.cpp b/engines/wintermute/Ad/AdScene.cpp
index f674e92274..41b413cc14 100644
--- a/engines/wintermute/Ad/AdScene.cpp
+++ b/engines/wintermute/Ad/AdScene.cpp
@@ -818,7 +818,7 @@ ERRORCODE CAdScene::loadBuffer(byte *buffer, bool complete) {
break;
case TOKEN_VIEWPORT: {
- Common::Rect rc;
+ Rect32 rc;
parser.scanStr((char *)params, "%d,%d,%d,%d", &rc.left, &rc.top, &rc.right, &rc.bottom);
if (!_viewport) _viewport = new CBViewport(Game);
if (_viewport) _viewport->setRect(rc.left, rc.top, rc.right, rc.bottom, true);
@@ -1988,7 +1988,7 @@ ERRORCODE CAdScene::saveAsText(CBDynBuffer *buffer, int indent) {
// viewport
if (_viewport) {
- Common::Rect *rc = _viewport->getRect();
+ Rect32 *rc = _viewport->getRect();
buffer->putTextIndent(indent + 2, "VIEWPORT { %d, %d, %d, %d }\n", rc->left, rc->top, rc->right, rc->bottom);
}
diff --git a/engines/wintermute/Ad/AdSentence.h b/engines/wintermute/Ad/AdSentence.h
index 8ec0ca55e4..86a3c57c99 100644
--- a/engines/wintermute/Ad/AdSentence.h
+++ b/engines/wintermute/Ad/AdSentence.h
@@ -32,6 +32,7 @@
#include "engines/wintermute/Base/BBase.h"
#include "engines/wintermute/persistent.h"
+#include "engines/wintermute/Math/Rect32.h"
#include "engines/wintermute/dctypes.h" // Added by ClassView
#include "common/rect.h"
@@ -56,7 +57,7 @@ public:
TTextAlign _align;
ERRORCODE display();
int _width;
- Common::Point _pos;
+ Point32 _pos;
CBFont *_font;
char *getNextStance();
char *getCurrentStance();