aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-09 04:09:15 +0200
committerEinar Johan Trøan Sømåen2012-07-09 04:09:15 +0200
commit7c984d24a8cd2ebe5a7860e21cda392edada34b3 (patch)
tree36d6cd53884107f29a451ffe1b06370e3fdc7f67
parent1eea9ad1a3ae577195363abe475cfbbee33d153b (diff)
downloadscummvm-rg350-7c984d24a8cd2ebe5a7860e21cda392edada34b3.tar.gz
scummvm-rg350-7c984d24a8cd2ebe5a7860e21cda392edada34b3.tar.bz2
scummvm-rg350-7c984d24a8cd2ebe5a7860e21cda392edada34b3.zip
WINTERMUTE: Change RECT -> Common::Rect and POINT-> Common::Point, completing the removal of Windows-specifics in wintypes.h
-rw-r--r--engines/wintermute/Ad/AdGame.cpp8
-rw-r--r--engines/wintermute/Ad/AdInventoryBox.cpp3
-rw-r--r--engines/wintermute/Ad/AdInventoryBox.h3
-rw-r--r--engines/wintermute/Ad/AdItem.cpp6
-rw-r--r--engines/wintermute/Ad/AdResponseBox.cpp2
-rw-r--r--engines/wintermute/Ad/AdResponseBox.h2
-rw-r--r--engines/wintermute/Ad/AdScene.cpp6
-rw-r--r--engines/wintermute/Ad/AdSentence.h3
-rw-r--r--engines/wintermute/Base/BActiveRect.cpp2
-rw-r--r--engines/wintermute/Base/BActiveRect.h2
-rw-r--r--engines/wintermute/Base/BDynBuffer.cpp4
-rw-r--r--engines/wintermute/Base/BDynBuffer.h4
-rw-r--r--engines/wintermute/Base/BFileManager.cpp8
-rw-r--r--engines/wintermute/Base/BFontBitmap.cpp2
-rw-r--r--engines/wintermute/Base/BFontTT.cpp2
-rw-r--r--engines/wintermute/Base/BFrame.cpp6
-rw-r--r--engines/wintermute/Base/BFrame.h2
-rw-r--r--engines/wintermute/Base/BGame.cpp34
-rw-r--r--engines/wintermute/Base/BGame.h12
-rw-r--r--engines/wintermute/Base/BObject.h2
-rw-r--r--engines/wintermute/Base/BPersistMgr.cpp4
-rw-r--r--engines/wintermute/Base/BPersistMgr.h5
-rw-r--r--engines/wintermute/Base/BRegion.cpp6
-rw-r--r--engines/wintermute/Base/BRegion.h4
-rw-r--r--engines/wintermute/Base/BRenderSDL.cpp8
-rw-r--r--engines/wintermute/Base/BRenderSDL.h4
-rw-r--r--engines/wintermute/Base/BRenderer.cpp8
-rw-r--r--engines/wintermute/Base/BRenderer.h12
-rw-r--r--engines/wintermute/Base/BSprite.cpp6
-rw-r--r--engines/wintermute/Base/BSprite.h4
-rw-r--r--engines/wintermute/Base/BSubFrame.cpp6
-rw-r--r--engines/wintermute/Base/BSubFrame.h4
-rw-r--r--engines/wintermute/Base/BSurface.cpp4
-rw-r--r--engines/wintermute/Base/BSurface.h14
-rw-r--r--engines/wintermute/Base/BSurfaceSDL.cpp14
-rw-r--r--engines/wintermute/Base/BSurfaceSDL.h14
-rw-r--r--engines/wintermute/Base/BViewport.cpp2
-rw-r--r--engines/wintermute/Base/BViewport.h4
-rw-r--r--engines/wintermute/Base/PartEmitter.h2
-rw-r--r--engines/wintermute/Base/PartParticle.cpp2
-rw-r--r--engines/wintermute/Base/PartParticle.h2
-rw-r--r--engines/wintermute/Base/file/BDiskFile.cpp2
-rw-r--r--engines/wintermute/Base/file/BPkgFile.cpp2
-rw-r--r--engines/wintermute/Base/file/BSaveThumbFile.cpp2
-rw-r--r--engines/wintermute/Base/scriptables/SXString.cpp2
-rw-r--r--engines/wintermute/Base/scriptables/ScScript.cpp2
-rw-r--r--engines/wintermute/Base/scriptables/ScScript.h2
-rw-r--r--engines/wintermute/PlatformSDL.cpp30
-rw-r--r--engines/wintermute/PlatformSDL.h22
-rw-r--r--engines/wintermute/Sys/SysClassRegistry.cpp2
-rw-r--r--engines/wintermute/UI/UIButton.cpp10
-rw-r--r--engines/wintermute/UI/UIObject.cpp6
-rw-r--r--engines/wintermute/UI/UITiledImage.h19
-rw-r--r--engines/wintermute/UI/UIWindow.cpp2
-rw-r--r--engines/wintermute/UI/UIWindow.h6
-rw-r--r--engines/wintermute/utils/PathUtil.cpp10
-rw-r--r--engines/wintermute/utils/utils.cpp2
-rw-r--r--engines/wintermute/utils/utils.h2
-rw-r--r--engines/wintermute/video/VidPlayer.cpp4
-rw-r--r--engines/wintermute/video/VidTheoraPlayer.cpp2
-rw-r--r--engines/wintermute/wintypes.h28
61 files changed, 190 insertions, 209 deletions
diff --git a/engines/wintermute/Ad/AdGame.cpp b/engines/wintermute/Ad/AdGame.cpp
index bf4bb41c75..69a31575cb 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: {
- RECT rc;
+ Common::Rect 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();
- POINT p;
+ Common::Point p;
getMousePos(&p);
_scene->update();
@@ -1900,7 +1900,7 @@ ERRORCODE CAdGame::removeSpeechDir(const char *dir) {
//////////////////////////////////////////////////////////////////////////
char *CAdGame::findSpeechFile(char *stringID) {
- char *ret = new char[MAX_PATH];
+ char *ret = new char[MAX_PATH_LENGTH];
for (int i = 0; i < _speechDirs.GetSize(); i++) {
sprintf(ret, "%s%s.ogg", _speechDirs[i], stringID);
@@ -1924,7 +1924,7 @@ char *CAdGame::findSpeechFile(char *stringID) {
//////////////////////////////////////////////////////////////////////////
bool CAdGame::validMouse() {
- POINT pos;
+ Common::Point pos;
CBPlatform::getCursorPos(&pos);
return _renderer->pointInViewport(&pos);
diff --git a/engines/wintermute/Ad/AdInventoryBox.cpp b/engines/wintermute/Ad/AdInventoryBox.cpp
index 9cb26d8e53..3b887c4737 100644
--- a/engines/wintermute/Ad/AdInventoryBox.cpp
+++ b/engines/wintermute/Ad/AdInventoryBox.cpp
@@ -39,6 +39,7 @@
#include "engines/wintermute/UI/UIWindow.h"
#include "engines/wintermute/PlatformSDL.h"
#include "common/str.h"
+#include "common/rect.h"
namespace WinterMute {
@@ -122,7 +123,7 @@ ERRORCODE CAdInventoryBox::display() {
// display window
- RECT rect = _itemsArea;
+ Common::Rect rect = _itemsArea;
if (_window) {
CBPlatform::offsetRect(&rect, _window->_posX, _window->_posY);
_window->display();
diff --git a/engines/wintermute/Ad/AdInventoryBox.h b/engines/wintermute/Ad/AdInventoryBox.h
index 536f60130e..e3aec3a20b 100644
--- a/engines/wintermute/Ad/AdInventoryBox.h
+++ b/engines/wintermute/Ad/AdInventoryBox.h
@@ -30,6 +30,7 @@
#define WINTERMUTE_ADINVENTORYBOX_H
#include "engines/wintermute/Base/BObject.h"
+#include "common/rect.h"
namespace WinterMute {
class CUIButton;
@@ -48,7 +49,7 @@ public:
CUIButton *_closeButton;
int _spacing;
int _scrollOffset;
- RECT _itemsArea;
+ Common::Rect _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 3b17cfd963..e2e7374f68 100644
--- a/engines/wintermute/Ad/AdItem.cpp
+++ b/engines/wintermute/Ad/AdItem.cpp
@@ -389,9 +389,9 @@ ERRORCODE CAdItem::update() {
ERRORCODE CAdItem::display(int x, int y) {
int width = 0;
if (_currentSprite) {
- RECT rc;
- _currentSprite->GetBoundingRect(&rc, 0, 0);
- width = rc.right - rc.left;
+ Common::Rect rc;
+ _currentSprite->getBoundingRect(&rc, 0, 0);
+ width = rc.width();
}
_posX = x + width / 2;
diff --git a/engines/wintermute/Ad/AdResponseBox.cpp b/engines/wintermute/Ad/AdResponseBox.cpp
index 0eeadd72bc..9ab669ba14 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() {
- RECT rect = _responseArea;
+ Common::Rect 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 de21921fde..31076c056c 100644
--- a/engines/wintermute/Ad/AdResponseBox.h
+++ b/engines/wintermute/Ad/AdResponseBox.h
@@ -74,7 +74,7 @@ public:
CUIWindow *_window;
CUIWindow *_shieldWindow;
bool _horizontal;
- RECT _responseArea;
+ Common::Rect _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 9362830a54..c6a3b971ed 100644
--- a/engines/wintermute/Ad/AdScene.cpp
+++ b/engines/wintermute/Ad/AdScene.cpp
@@ -621,7 +621,7 @@ ERRORCODE CAdScene::loadBuffer(byte *buffer, bool complete) {
}
int ar, ag, ab, aa;
- char camera[MAX_PATH] = "";
+ char camera[MAX_PATH_LENGTH] = "";
/* float WaypointHeight = -1.0f; */
while ((cmd = parser.getCommand((char **)&buffer, commands, (char **)&params)) > 0) {
@@ -818,7 +818,7 @@ ERRORCODE CAdScene::loadBuffer(byte *buffer, bool complete) {
break;
case TOKEN_VIEWPORT: {
- RECT rc;
+ Common::Rect 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) {
- RECT *rc = _viewport->getRect();
+ Common::Rect *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 a8b08433c1..8ec0ca55e4 100644
--- a/engines/wintermute/Ad/AdSentence.h
+++ b/engines/wintermute/Ad/AdSentence.h
@@ -33,6 +33,7 @@
#include "engines/wintermute/Base/BBase.h"
#include "engines/wintermute/persistent.h"
#include "engines/wintermute/dctypes.h" // Added by ClassView
+#include "common/rect.h"
namespace WinterMute {
class CAdTalkDef;
@@ -55,7 +56,7 @@ public:
TTextAlign _align;
ERRORCODE display();
int _width;
- POINT _pos;
+ Common::Point _pos;
CBFont *_font;
char *getNextStance();
char *getCurrentStance();
diff --git a/engines/wintermute/Base/BActiveRect.cpp b/engines/wintermute/Base/BActiveRect.cpp
index 86a441c317..5e1af264d9 100644
--- a/engines/wintermute/Base/BActiveRect.cpp
+++ b/engines/wintermute/Base/BActiveRect.cpp
@@ -86,7 +86,7 @@ CBActiveRect::~CBActiveRect() {
//////////////////////////////////////////////////////////////////////////
void CBActiveRect::clipRect() {
- RECT rc;
+ Common::Rect 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 a65f0cea7a..cbb617342c 100644
--- a/engines/wintermute/Base/BActiveRect.h
+++ b/engines/wintermute/Base/BActiveRect.h
@@ -46,7 +46,7 @@ public:
CBRegion *_region;
int _offsetX;
int _offsetY;
- RECT _rect;
+ Common::Rect _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/BDynBuffer.cpp b/engines/wintermute/Base/BDynBuffer.cpp
index d0d4cfeafb..291712c6c8 100644
--- a/engines/wintermute/Base/BDynBuffer.cpp
+++ b/engines/wintermute/Base/BDynBuffer.cpp
@@ -160,7 +160,7 @@ char *CBDynBuffer::getString() {
//////////////////////////////////////////////////////////////////////////
-void CBDynBuffer::putText(LPCSTR fmt, ...) {
+void CBDynBuffer::putText(const char *fmt, ...) {
va_list va;
va_start(va, fmt);
@@ -171,7 +171,7 @@ void CBDynBuffer::putText(LPCSTR fmt, ...) {
//////////////////////////////////////////////////////////////////////////
-void CBDynBuffer::putTextIndent(int indent, LPCSTR fmt, ...) {
+void CBDynBuffer::putTextIndent(int indent, const char *fmt, ...) {
va_list va;
putText("%*s", indent, "");
diff --git a/engines/wintermute/Base/BDynBuffer.h b/engines/wintermute/Base/BDynBuffer.h
index c29e6ac275..1826a81c30 100644
--- a/engines/wintermute/Base/BDynBuffer.h
+++ b/engines/wintermute/Base/BDynBuffer.h
@@ -37,8 +37,8 @@ namespace WinterMute {
class CBDynBuffer : public CBBase {
public:
bool _initialized;
- void putText(LPCSTR fmt, ...);
- void putTextIndent(int indent, LPCSTR fmt, ...);
+ void putText(const char *fmt, ...);
+ void putTextIndent(int indent, const char *fmt, ...);
uint32 getDWORD();
void putDWORD(uint32 val);
char *getString();
diff --git a/engines/wintermute/Base/BFileManager.cpp b/engines/wintermute/Base/BFileManager.cpp
index 8c68bc9263..621089d803 100644
--- a/engines/wintermute/Base/BFileManager.cpp
+++ b/engines/wintermute/Base/BFileManager.cpp
@@ -311,7 +311,7 @@ ERRORCODE CBFileManager::initPaths() {
AddPath(PATH_PACKAGE, pathPtr);
AddPath(PATH_SINGLE, pathPtr);
#else
- char bundlePath[MAX_PATH];
+ char bundlePath[MAX_PATH_LENGTH];
sprintf(bundlePath, "%s/../", pathPtr);
AddPath(PATH_PACKAGE, bundlePath);
@@ -524,7 +524,7 @@ ERRORCODE CBFileManager::registerPackage(const char *Path, const char *name, boo
// TODO
error("Implement RegisterPackage, this is the old one");
#if 0
- char Filename[MAX_PATH];
+ char Filename[MAX_PATH_LENGTH];
sprintf(filename, "%s%s", Path, name);
FILE *f = fopen(filename, "rb");
@@ -670,7 +670,7 @@ Common::File *CBFileManager::openPackage(const Common::String &name) {
//RestoreCurrentDir();
Common::File *ret = new Common::File();
- char filename[MAX_PATH];
+ char filename[MAX_PATH_LENGTH];
for (int i = 0; i < _packagePaths.GetSize(); i++) {
sprintf(filename, "%s%s.%s", _packagePaths[i], name.c_str(), PACKAGE_EXTENSION);
@@ -696,7 +696,7 @@ Common::File *CBFileManager::openSingleFile(const Common::String &name) {
restoreCurrentDir();
Common::File *ret = NULL;
- char filename[MAX_PATH];
+ char filename[MAX_PATH_LENGTH];
for (int i = 0; i < _singlePaths.GetSize(); i++) {
sprintf(filename, "%s%s", _singlePaths[i], name.c_str());
diff --git a/engines/wintermute/Base/BFontBitmap.cpp b/engines/wintermute/Base/BFontBitmap.cpp
index c2b7cfef1a..56e969d7e7 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;
- RECT rect;
+ Common::Rect 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 8f665a51fd..22f16a53f6 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) {
- RECT rc;
+ Common::Rect 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 9f0c89c39c..5f516c3735 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);
- RECT rect;
+ Common::Rect 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(LPRECT rect, int x, int y, float scaleX, float scaleY) {
+bool CBFrame::getBoundingRect(Common::Rect *rect, int x, int y, float scaleX, float scaleY) {
if (!rect) return false;
CBPlatform::setRectEmpty(rect);
- RECT subRect;
+ Common::Rect 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 55ade445e3..4c43db142d 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(LPRECT rect, int x, int y, float scaleX = 100, float scaleY = 100);
+ bool getBoundingRect(Common::Rect *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 41cc62ba3e..b227a56dc8 100644
--- a/engines/wintermute/Base/BGame.cpp
+++ b/engines/wintermute/Base/BGame.cpp
@@ -578,7 +578,7 @@ void CBGame::DEBUG_DebugDisable() {
//////////////////////////////////////////////////////////////////////
-void CBGame::LOG(ERRORCODE res, LPCSTR fmt, ...) {
+void CBGame::LOG(ERRORCODE res, const char *fmt, ...) {
uint32 secs = g_system->getMillis() / 1000;
uint32 hours = secs / 3600;
secs = secs % 3600;
@@ -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);
- POINT p;
+ Common::Point p;
p.x = x + _renderer->_drawOffsetX;
p.y = y + _renderer->_drawOffsetY;
@@ -1802,7 +1802,7 @@ ERRORCODE CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Screenshot") == 0) {
stack->correctParams(1);
- char filename[MAX_PATH];
+ char filename[MAX_PATH_LENGTH];
CScValue *Val = stack->pop();
@@ -2805,7 +2805,7 @@ void CBGame::quickMessage(const char *text) {
//////////////////////////////////////////////////////////////////////////
-void CBGame::quickMessageForm(LPSTR fmt, ...) {
+void CBGame::quickMessageForm(char *fmt, ...) {
char buff[256];
va_list va;
@@ -3191,7 +3191,7 @@ ERRORCODE CBGame::showCursor() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBGame::SaveGame(int slot, const char *desc, bool quickSave) {
- char filename[MAX_PATH + 1];
+ char filename[MAX_PATH_LENGTH + 1];
getSaveSlotFilename(slot, filename);
LOG(0, "Saving game '%s'...", filename);
@@ -3242,7 +3242,7 @@ ERRORCODE CBGame::loadGame(int slot) {
_loading = false;
_scheduledLoadSlot = -1;
- char filename[MAX_PATH + 1];
+ char filename[MAX_PATH_LENGTH + 1];
getSaveSlotFilename(slot, filename);
return loadGame(filename);
@@ -3875,7 +3875,7 @@ AnsiString CBGame::getDataDir() {
ERRORCODE CBGame::getSaveSlotDescription(int slot, char *buffer) {
buffer[0] = '\0';
- char filename[MAX_PATH + 1];
+ char filename[MAX_PATH_LENGTH + 1];
getSaveSlotFilename(slot, filename);
CBPersistMgr *pm = new CBPersistMgr(Game);
if (!pm) return STATUS_FAILED;
@@ -3897,7 +3897,7 @@ ERRORCODE CBGame::getSaveSlotDescription(int slot, char *buffer) {
//////////////////////////////////////////////////////////////////////////
bool CBGame::isSaveSlotUsed(int slot) {
- char filename[MAX_PATH + 1];
+ char filename[MAX_PATH_LENGTH + 1];
getSaveSlotFilename(slot, filename);
warning("CBGame::IsSaveSlotUsed(%d) - FIXME, ugly solution", slot);
@@ -3910,7 +3910,7 @@ bool CBGame::isSaveSlotUsed(int slot) {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBGame::emptySaveSlot(int slot) {
- char filename[MAX_PATH + 1];
+ char filename[MAX_PATH_LENGTH + 1];
getSaveSlotFilename(slot, filename);
CBPlatform::deleteFile(filename);
@@ -3967,7 +3967,7 @@ ERRORCODE CBGame::popViewport() {
//////////////////////////////////////////////////////////////////////////
-ERRORCODE CBGame::getCurrentViewportRect(RECT *rect, bool *custom) {
+ERRORCODE CBGame::getCurrentViewportRect(Common::Rect *rect, bool *custom) {
if (rect == NULL) return STATUS_FAILED;
else {
if (_viewportSP >= 0) {
@@ -4021,7 +4021,7 @@ void CBGame::setInteractive(bool state) {
//////////////////////////////////////////////////////////////////////////
void CBGame::resetMousePos() {
- POINT p;
+ Common::Point p;
p.x = _mousePos.x + _renderer->_drawOffsetX;
p.y = _mousePos.y + _renderer->_drawOffsetY;
@@ -4048,7 +4048,7 @@ ERRORCODE CBGame::displayContentSimple() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CBGame::displayIndicator() {
if (_saveLoadImage) {
- RECT rc;
+ Common::Rect rc;
CBPlatform::setRect(&rc, 0, 0, _saveLoadImage->getWidth(), _saveLoadImage->getHeight());
if (_loadInProgress) _saveLoadImage->displayTrans(_loadImageX, _loadImageY, rc);
else _saveLoadImage->displayTrans(_saveImageX, _saveImageY, rc);
@@ -4209,7 +4209,7 @@ ERRORCODE CBGame::onActivate(bool activate, bool refreshMouse) {
_renderer->_active = activate;
if (refreshMouse) {
- POINT p;
+ Common::Point p;
getMousePos(&p);
setActiveObject(_renderer->getObjectAt(p.x, p.y));
}
@@ -4407,7 +4407,7 @@ CBDebugger *CBGame::getDebugMgr() {
//////////////////////////////////////////////////////////////////////////
-void CBGame::getMousePos(POINT *pos) {
+void CBGame::getMousePos(Common::Point *pos) {
CBPlatform::getCursorPos(pos);
pos->x -= _renderer->_drawOffsetX;
@@ -4417,7 +4417,7 @@ void CBGame::getMousePos(POINT *pos) {
// Windows can squish maximized window if it's larger than desktop
// so we need to modify mouse position appropriately (tnx mRax)
if (_renderer->_windowed && ::IsZoomed(_renderer->_window)) {
- RECT rc;
+ Common::Rect rc;
::GetClientRect(_renderer->_window, &rc);
Pos->x *= Game->_renderer->_realWidth;
Pos->x /= (rc.right - rc.left);
@@ -4434,7 +4434,7 @@ void CBGame::getMousePos(POINT *pos) {
pos->x = MIN(_mouseLockRect.right, pos->x);
pos->y = MIN(_mouseLockRect.bottom, pos->y);
- POINT newPos = *pos;
+ Common::Point newPos = *pos;
newPos.x += _renderer->_drawOffsetX;
newPos.y += _renderer->_drawOffsetY;
@@ -4481,7 +4481,7 @@ bool CBGame::isDoubleClick(int buttonIndex) {
maxMoveY = 16;
#endif
- POINT pos;
+ Common::Point 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 44b5b4a86d..867700db9b 100644
--- a/engines/wintermute/Base/BGame.h
+++ b/engines/wintermute/Base/BGame.h
@@ -91,8 +91,8 @@ public:
virtual ERRORCODE miniUpdate();
- void getMousePos(POINT *Pos);
- RECT _mouseLockRect;
+ void getMousePos(Common::Point *Pos);
+ Common::Rect _mouseLockRect;
bool _shuttingDown;
@@ -172,7 +172,7 @@ public:
CBTransitionMgr *_transMgr;
CBDebugger *getDebugMgr();
- void LOG(ERRORCODE res, LPCSTR fmt, ...);
+ void LOG(ERRORCODE res, const char *fmt, ...);
CBRenderer *_renderer;
CBSoundMgr *_soundMgr;
@@ -310,12 +310,12 @@ public:
uint32 _liveTimerLast;
CBObject *_capturedObject;
- POINT _mousePos;
+ Common::Point _mousePos;
bool validObject(CBObject *object);
ERRORCODE unregisterObject(CBObject *object);
ERRORCODE registerObject(CBObject *object);
void quickMessage(const char *text);
- void quickMessageForm(LPSTR fmt, ...);
+ void quickMessageForm(char *fmt, ...);
ERRORCODE displayQuickMsg();
uint32 _fps;
ERRORCODE updateMusicCrossfade();
@@ -334,7 +334,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(RECT *rect, bool *custom = NULL);
+ ERRORCODE getCurrentViewportRect(Common::Rect *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 ff876a3035..3a82cbe128 100644
--- a/engines/wintermute/Base/BObject.h
+++ b/engines/wintermute/Base/BObject.h
@@ -103,7 +103,7 @@ public:
bool _registrable;
bool _zoomable;
bool _shadowable;
- RECT _rect;
+ Common::Rect _rect;
bool _rectSet;
int _iD;
bool _movable;
diff --git a/engines/wintermute/Base/BPersistMgr.cpp b/engines/wintermute/Base/BPersistMgr.cpp
index bbe532d819..412aa88312 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, RECT *val) {
+ERRORCODE CBPersistMgr::transfer(const char *name, Common::Rect *val) {
if (_saving) {
_saveStream->writeSint32LE(val->left);
_saveStream->writeSint32LE(val->top);
@@ -694,7 +694,7 @@ ERRORCODE CBPersistMgr::transfer(const char *name, RECT *val) {
//////////////////////////////////////////////////////////////////////////
// POINT
-ERRORCODE CBPersistMgr::transfer(const char *name, POINT *val) {
+ERRORCODE CBPersistMgr::transfer(const char *name, Common::Point *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 9559dc7490..dc4c2173de 100644
--- a/engines/wintermute/Base/BPersistMgr.h
+++ b/engines/wintermute/Base/BPersistMgr.h
@@ -35,6 +35,7 @@
#include "common/stream.h"
#include "common/str.h"
#include "common/system.h"
+#include "common/rect.h"
namespace WinterMute {
@@ -84,8 +85,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, RECT *val);
- ERRORCODE transfer(const char *name, POINT *val);
+ ERRORCODE transfer(const char *name, Common::Rect *val);
+ ERRORCODE transfer(const char *name, Common::Point *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 32eb383de0..45b202e35f 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;
- POINT pt;
+ Common::Point pt;
pt.x = x;
pt.y = y;
- RECT rect;
+ Common::Rect 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(RECT *rect) {
+ERRORCODE CBRegion::getBoundingRect(Common::Rect *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 5f6b79e17f..4aa491d7c9 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(RECT *rect);
+ ERRORCODE getBoundingRect(Common::Rect *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);
- RECT _rect;
+ Common::Rect _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 e2ddc38d98..323c6cc7be 100644
--- a/engines/wintermute/Base/BRenderSDL.cpp
+++ b/engines/wintermute/Base/BRenderSDL.cpp
@@ -298,7 +298,7 @@ ERRORCODE CBRenderSDL::fadeToColor(uint32 Color, Common::Rect *rect) {
fillRect.setWidth(rect->width());
fillRect.setHeight(rect->height());
} else {
- RECT rc;
+ Common::Rect rc;
Game->getCurrentViewportRect(&rc);
fillRect.left = (int16)rc.left;
fillRect.top = (int16)rc.top;
@@ -501,7 +501,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);
- POINT point1, point2;
+ Common::Point point1, point2;
point1.x = x1;
point1.y = y1;
pointToScreen(&point1);
@@ -605,7 +605,7 @@ void CBRenderSDL::modTargetRect(Common::Rect *rect) {
}
//////////////////////////////////////////////////////////////////////////
-void CBRenderSDL::pointFromScreen(POINT *point) {
+void CBRenderSDL::pointFromScreen(Common::Point *point) {
#if 0
SDL_Rect viewportRect;
SDL_RenderGetViewport(GetSdlRenderer(), &viewportRect);
@@ -617,7 +617,7 @@ void CBRenderSDL::pointFromScreen(POINT *point) {
//////////////////////////////////////////////////////////////////////////
-void CBRenderSDL::pointToScreen(POINT *point) {
+void CBRenderSDL::pointToScreen(Common::Point *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 f7659e3e84..6c88feb059 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(POINT *point);
- void pointToScreen(POINT *point);
+ void pointFromScreen(Common::Point *point);
+ void pointToScreen(Common::Point *point);
void dumpData(const char *filename);
diff --git a/engines/wintermute/Base/BRenderer.cpp b/engines/wintermute/Base/BRenderer.cpp
index 9038d8364e..a3774e3770 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) {
- POINT point;
+ Common::Point point;
point.x = x;
point.y = y;
@@ -203,7 +203,7 @@ ERRORCODE CBRenderer::setScreenViewport() {
//////////////////////////////////////////////////////////////////////////
-ERRORCODE CBRenderer::setViewport(RECT *rect) {
+ERRORCODE CBRenderer::setViewport(Common::Rect *rect) {
return setViewport(rect->left + _drawOffsetX,
rect->top + _drawOffsetY,
rect->right + _drawOffsetX,
@@ -221,7 +221,7 @@ CBImage *CBRenderer::takeScreenshot() {
ERRORCODE CBRenderer::clipCursor() {
/*
if (!_windowed) {
- RECT rc;
+ Common::Rect 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(POINT *p) {
+bool CBRenderer::pointInViewport(Common::Point *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 5d290eedd6..c32a4d6bc1 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(RECT *Rect);
+ virtual ERRORCODE setViewport(Common::Rect *Rect);
virtual ERRORCODE setScreenViewport();
virtual ERRORCODE fade(uint16 Alpha);
virtual ERRORCODE fadeToColor(uint32 Color, Common::Rect *rect = NULL);
@@ -101,17 +101,17 @@ public:
virtual ERRORCODE endSpriteBatch() {
return STATUS_OK;
};
- bool pointInViewport(POINT *P);
+ bool pointInViewport(Common::Point *P);
uint32 _forceAlphaColor;
uint32 _window;
uint32 _clipperWindow;
bool _active;
bool _ready;
bool _windowed;
- RECT _windowRect;
- RECT _viewportRect;
- RECT _screenRect;
- RECT _monitorRect;
+ Common::Rect _windowRect;
+ Common::Rect _viewportRect;
+ Common::Rect _screenRect;
+ Common::Rect _monitorRect;
int _bPP;
int _height;
int _width;
diff --git a/engines/wintermute/Base/BSprite.cpp b/engines/wintermute/Base/BSprite.cpp
index 6d595ffbe8..349cb1e2f5 100644
--- a/engines/wintermute/Base/BSprite.cpp
+++ b/engines/wintermute/Base/BSprite.cpp
@@ -413,13 +413,13 @@ CBSurface *CBSprite::getSurface() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBSprite::GetBoundingRect(LPRECT rect, int x, int y, float scaleX, float scaleY) {
+bool CBSprite::getBoundingRect(Common::Rect *rect, int x, int y, float scaleX, float scaleY) {
if (!rect) return false;
CBPlatform::setRectEmpty(rect);
for (int i = 0; i < _frames.GetSize(); i++) {
- RECT frame;
- RECT temp;
+ Common::Rect frame;
+ Common::Rect 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 a9ca84d358..2b705b689a 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(LPRECT rect, int x, int y, float scaleX = 100, float scaleY = 100);
+ bool getBoundingRect(Common::Rect *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, RECT *rect = NULL);
+ ERRORCODE addFrame(const char *filename, uint32 delay = 0, int hotspotX = 0, int hotspotY = 0, Common::Rect *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 af7bb128a5..4a1a5ec1f0 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);
- RECT rect;
+ Common::Rect 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(LPRECT rect, int x, int y, float scaleX, float scaleY) {
+bool CBSubFrame::getBoundingRect(Common::Rect *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));
- RECT rect;
+ Common::Rect 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 b1503e3506..a13a5fa196 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(LPRECT rect, int x, int y, float scaleX = 100, float scaleY = 100);
+ bool getBoundingRect(Common::Rect *rect, int x, int y, float scaleX = 100, float scaleY = 100);
int _hotspotX;
int _hotspotY;
uint32 _alpha;
- RECT _rect;
+ Common::Rect _rect;
bool _cKDefault;
byte _cKRed;
diff --git a/engines/wintermute/Base/BSurface.cpp b/engines/wintermute/Base/BSurface.cpp
index 0cf5292afb..dd7f17a895 100644
--- a/engines/wintermute/Base/BSurface.cpp
+++ b/engines/wintermute/Base/BSurface.cpp
@@ -76,12 +76,12 @@ bool CBSurface::isTransparentAt(int x, int y) {
}
//////////////////////////////////////////////////////////////////////
-ERRORCODE CBSurface::displayHalfTrans(int x, int y, RECT rect) {
+ERRORCODE CBSurface::displayHalfTrans(int x, int y, Common::Rect rect) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-ERRORCODE CBSurface::displayTransform(int x, int y, int hotX, int hotY, 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, Common::Rect 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 6a4dd89af6..4351e163e5 100644
--- a/engines/wintermute/Base/BSurface.h
+++ b/engines/wintermute/Base/BSurface.h
@@ -52,14 +52,14 @@ public:
CBSurface(CBGame *inGame);
virtual ~CBSurface();
- virtual ERRORCODE displayHalfTrans(int x, int y, RECT rect);
+ virtual ERRORCODE displayHalfTrans(int x, int y, Common::Rect rect);
virtual bool isTransparentAt(int x, int y);
- virtual ERRORCODE displayTransZoom(int x, int y, 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, RECT rect, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false) = 0;
- virtual ERRORCODE displayTransOffset(int x, int y, 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, RECT rect, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool MirrorY = false) = 0;
- virtual ERRORCODE displayZoom(int x, int y, 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, 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, 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 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 27bd7fd334..7bddcdf04c 100644
--- a/engines/wintermute/Base/BSurfaceSDL.cpp
+++ b/engines/wintermute/Base/BSurfaceSDL.cpp
@@ -423,40 +423,40 @@ ERRORCODE CBSurfaceSDL::endPixelOp() {
//////////////////////////////////////////////////////////////////////////
-ERRORCODE CBSurfaceSDL::display(int x, int y, RECT rect, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
+ERRORCODE CBSurfaceSDL::display(int x, int y, Common::Rect 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, RECT rect, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
+ERRORCODE CBSurfaceSDL::displayTrans(int x, int y, Common::Rect 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, RECT rect, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY, int offsetX, int offsetY) {
+ERRORCODE CBSurfaceSDL::displayTransOffset(int x, int y, Common::Rect 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, RECT rect, float zoomX, float zoomY, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
+ERRORCODE CBSurfaceSDL::displayTransZoom(int x, int y, Common::Rect 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, RECT rect, float zoomX, float zoomY, uint32 alpha, bool Transparent, TSpriteBlendMode blendMode, bool mirrorX, bool 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) {
return drawSprite(x, y, &rect, zoomX, zoomY, alpha, !Transparent, blendMode, mirrorX, mirrorY);
}
//////////////////////////////////////////////////////////////////////////
-ERRORCODE CBSurfaceSDL::displayTransform(int x, int y, int hotX, int hotY, 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, Common::Rect 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, 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, Common::Rect *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 (renderer->_forceAlphaColor != 0) alpha = renderer->_forceAlphaColor;
diff --git a/engines/wintermute/Base/BSurfaceSDL.h b/engines/wintermute/Base/BSurfaceSDL.h
index 544473ced5..91a75f27b7 100644
--- a/engines/wintermute/Base/BSurfaceSDL.h
+++ b/engines/wintermute/Base/BSurfaceSDL.h
@@ -52,12 +52,12 @@ public:
ERRORCODE endPixelOp();
- ERRORCODE displayTransZoom(int x, int y, 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, RECT rect, uint32 alpha = 0xFFFFFFFF, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false);
- ERRORCODE displayTransOffset(int x, int y, 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, RECT rect, TSpriteBlendMode blendMode = BLEND_NORMAL, bool mirrorX = false, bool mirrorY = false);
- ERRORCODE displayZoom(int x, int y, 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, 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, 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);
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);
@@ -78,7 +78,7 @@ public:
private:
Graphics::Surface *_surface;
- ERRORCODE drawSprite(int x, int y, 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, Common::Rect *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 7542e6bbfc..ad89bc0697 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
//////////////////////////////////////////////////////////////////////////
-RECT *CBViewport::getRect() {
+Common::Rect *CBViewport::getRect() {
return &_rect;
}
diff --git a/engines/wintermute/Base/BViewport.h b/engines/wintermute/Base/BViewport.h
index f2e960943a..0ace6791bc 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();
- RECT *getRect();
+ Common::Rect *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:
- RECT _rect;
+ Common::Rect _rect;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/Base/PartEmitter.h b/engines/wintermute/Base/PartEmitter.h
index 984ef78820..2f72d96103 100644
--- a/engines/wintermute/Base/PartEmitter.h
+++ b/engines/wintermute/Base/PartEmitter.h
@@ -82,7 +82,7 @@ public:
int _maxBatches;
int _batchesGenerated;
- RECT _border;
+ Common::Rect _border;
int _borderThicknessLeft;
int _borderThicknessRight;
int _borderThicknessTop;
diff --git a/engines/wintermute/Base/PartParticle.cpp b/engines/wintermute/Base/PartParticle.cpp
index 0cf05e88a1..9d667bdca8 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)) {
- POINT p;
+ Common::Point 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 3f495a432b..229bc11935 100644
--- a/engines/wintermute/Base/PartParticle.h
+++ b/engines/wintermute/Base/PartParticle.h
@@ -57,7 +57,7 @@ public:
int _alpha1;
int _alpha2;
- RECT _border;
+ Common::Rect _border;
Vector2 _pos;
float _posZ;
Vector2 _velocity;
diff --git a/engines/wintermute/Base/file/BDiskFile.cpp b/engines/wintermute/Base/file/BDiskFile.cpp
index f2706bbfb5..1e9ec96e66 100644
--- a/engines/wintermute/Base/file/BDiskFile.cpp
+++ b/engines/wintermute/Base/file/BDiskFile.cpp
@@ -46,7 +46,7 @@ void correctSlashes(char *fileName) {
}
Common::SeekableReadStream *openDiskFile(const Common::String &filename, CBFileManager *fileManager) {
- char fullPath[MAX_PATH];
+ char fullPath[MAX_PATH_LENGTH];
uint32 prefixSize = 0;
Common::SeekableReadStream *file = NULL;
diff --git a/engines/wintermute/Base/file/BPkgFile.cpp b/engines/wintermute/Base/file/BPkgFile.cpp
index 08a92b52f6..fcacfdfd40 100644
--- a/engines/wintermute/Base/file/BPkgFile.cpp
+++ b/engines/wintermute/Base/file/BPkgFile.cpp
@@ -68,7 +68,7 @@ public:
Common::SeekableReadStream *openPkgFile(const Common::String &filename, CBFileManager *fileManager) {
CBFileEntry *fileEntry;
Common::SeekableReadStream *file = NULL;
- char fileName[MAX_PATH];
+ char fileName[MAX_PATH_LENGTH];
strcpy(fileName, filename.c_str());
// correct slashes
diff --git a/engines/wintermute/Base/file/BSaveThumbFile.cpp b/engines/wintermute/Base/file/BSaveThumbFile.cpp
index 6f31a424c0..a7a844fc9d 100644
--- a/engines/wintermute/Base/file/BSaveThumbFile.cpp
+++ b/engines/wintermute/Base/file/BSaveThumbFile.cpp
@@ -69,7 +69,7 @@ ERRORCODE CBSaveThumbFile::open(const Common::String &filename) {
int slot = atoi(tempFilename);
delete [] tempFilename;
- char slotFilename[MAX_PATH + 1];
+ char slotFilename[MAX_PATH_LENGTH + 1];
Game->getSaveSlotFilename(slot, slotFilename);
CBPersistMgr *pm = new CBPersistMgr(Game);
if (!pm) return STATUS_FAILED;
diff --git a/engines/wintermute/Base/scriptables/SXString.cpp b/engines/wintermute/Base/scriptables/SXString.cpp
index f4bb610c64..1ddec89ee6 100644
--- a/engines/wintermute/Base/scriptables/SXString.cpp
+++ b/engines/wintermute/Base/scriptables/SXString.cpp
@@ -246,7 +246,7 @@ ERRORCODE CSXString::scCallMethod(CScScript *script, CScStack *stack, CScStack *
else if (strcmp(name, "Split") == 0) {
stack->correctParams(1);
CScValue *val = stack->pop();
- char separators[MAX_PATH] = ",";
+ char separators[MAX_PATH_LENGTH] = ",";
if (!val->isNULL()) strcpy(separators, val->getString());
CSXArray *array = new CSXArray(Game);
diff --git a/engines/wintermute/Base/scriptables/ScScript.cpp b/engines/wintermute/Base/scriptables/ScScript.cpp
index 19f1fb29a1..0abd9a1ff9 100644
--- a/engines/wintermute/Base/scriptables/ScScript.cpp
+++ b/engines/wintermute/Base/scriptables/ScScript.cpp
@@ -1178,7 +1178,7 @@ ERRORCODE CScScript::run() {
//////////////////////////////////////////////////////////////////////
-void CScScript::runtimeError(LPCSTR fmt, ...) {
+void CScScript::runtimeError(const char *fmt, ...) {
char buff[256];
va_list va;
diff --git a/engines/wintermute/Base/scriptables/ScScript.h b/engines/wintermute/Base/scriptables/ScScript.h
index 6bd1d26142..6635970dc5 100644
--- a/engines/wintermute/Base/scriptables/ScScript.h
+++ b/engines/wintermute/Base/scriptables/ScScript.h
@@ -75,7 +75,7 @@ public:
CScScript *invokeEventHandler(const char *eventName, bool unbreakable = false);
uint32 _timeSlice;
DECLARE_PERSISTENT(CScScript, CBBase)
- void runtimeError(LPCSTR fmt, ...);
+ void runtimeError(const char *fmt, ...);
ERRORCODE run();
ERRORCODE finish(bool includingThreads = false);
ERRORCODE sleep(uint32 duration);
diff --git a/engines/wintermute/PlatformSDL.cpp b/engines/wintermute/PlatformSDL.cpp
index cbfa93c488..9803ffb928 100644
--- a/engines/wintermute/PlatformSDL.cpp
+++ b/engines/wintermute/PlatformSDL.cpp
@@ -166,7 +166,7 @@ int CBPlatform::SDLEventWatcher(void *userdata, Common::Event *event) {
//////////////////////////////////////////////////////////////////////////
// Win32 API bindings
//////////////////////////////////////////////////////////////////////////
-void CBPlatform::outputDebugString(LPCSTR lpOutputString) {
+void CBPlatform::outputDebugString(const char *lpOutputString) {
/*
#ifdef __WIN32__
::OutputDebugString(lpOutputString);
@@ -181,7 +181,7 @@ uint32 CBPlatform::getTime() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::getCursorPos(LPPOINT lpPoint) {
+bool CBPlatform::getCursorPos(Common::Point *lpPoint) {
CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer);
Common::Point p = g_system->getEventManager()->getMousePos();
@@ -197,7 +197,7 @@ bool CBPlatform::getCursorPos(LPPOINT lpPoint) {
bool CBPlatform::setCursorPos(int X, int Y) {
CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer);
- POINT p;
+ Common::Point p;
p.x = X;
p.y = Y;
renderer->pointToScreen(&p);
@@ -245,23 +245,23 @@ bool CBPlatform::setForegroundWindow() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::setRectEmpty(LPRECT lprc) {
+bool CBPlatform::setRectEmpty(Common::Rect *lprc) {
lprc->left = lprc->right = lprc->top = lprc->bottom = 0;
return true;
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::isRectEmpty(const LPRECT lprc) {
+bool CBPlatform::isRectEmpty(const Common::Rect *lprc) {
return (lprc->left >= lprc->right) || (lprc->top >= lprc->bottom);
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::ptInRect(LPRECT lprc, POINT p) {
+bool CBPlatform::ptInRect(Common::Rect *lprc, Common::Point p) {
return (p.x >= lprc->left) && (p.x < lprc->right) && (p.y >= lprc->top) && (p.y < lprc->bottom);
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::setRect(LPRECT lprc, int left, int top, int right, int bottom) {
+bool CBPlatform::setRect(Common::Rect *lprc, int left, int top, int right, int bottom) {
lprc->left = left;
lprc->top = top;
lprc->right = right;
@@ -271,7 +271,7 @@ bool CBPlatform::setRect(LPRECT lprc, int left, int top, int right, int bottom)
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::intersectRect(LPRECT lprcDst, const LPRECT lprcSrc1, const LPRECT lprcSrc2) {
+bool CBPlatform::intersectRect(Common::Rect *lprcDst, const Common::Rect *lprcSrc1, const Common::Rect *lprcSrc2) {
if (isRectEmpty(lprcSrc1) || isRectEmpty(lprcSrc2) ||
lprcSrc1->left >= lprcSrc2->right || lprcSrc2->left >= lprcSrc1->right ||
lprcSrc1->top >= lprcSrc2->bottom || lprcSrc2->top >= lprcSrc1->bottom) {
@@ -287,7 +287,7 @@ bool CBPlatform::intersectRect(LPRECT lprcDst, const LPRECT lprcSrc1, const LPRE
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::unionRect(LPRECT lprcDst, RECT *lprcSrc1, RECT *lprcSrc2) {
+bool CBPlatform::unionRect(Common::Rect *lprcDst, Common::Rect *lprcSrc1, Common::Rect *lprcSrc2) {
if (isRectEmpty(lprcSrc1)) {
if (isRectEmpty(lprcSrc2)) {
setRectEmpty(lprcDst);
@@ -310,7 +310,7 @@ bool CBPlatform::unionRect(LPRECT lprcDst, RECT *lprcSrc1, RECT *lprcSrc2) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::copyRect(LPRECT lprcDst, RECT *lprcSrc) {
+bool CBPlatform::copyRect(Common::Rect *lprcDst, Common::Rect *lprcSrc) {
if (lprcDst == NULL || lprcSrc == NULL) return false;
*lprcDst = *lprcSrc;
@@ -318,7 +318,7 @@ bool CBPlatform::copyRect(LPRECT lprcDst, RECT *lprcSrc) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::offsetRect(LPRECT lprc, int dx, int dy) {
+bool CBPlatform::offsetRect(Common::Rect *lprc, int dx, int dy) {
if (lprc == NULL) return false;
lprc->left += dx;
@@ -330,7 +330,7 @@ bool CBPlatform::offsetRect(LPRECT lprc, int dx, int dy) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::equalRect(LPRECT rect1, LPRECT rect2) {
+bool CBPlatform::equalRect(Common::Rect *rect1, Common::Rect *rect2) {
return rect1->left == rect2->left && rect1->right == rect2->right && rect1->top == rect2->top && rect1->bottom == rect2->bottom;
}
@@ -339,9 +339,9 @@ bool CBPlatform::equalRect(LPRECT rect1, LPRECT rect2) {
AnsiString CBPlatform::getSystemFontPath() {
#ifdef __WIN32__
// we're looking for something like "c:\windows\fonts\";
- char winDir[MAX_PATH + 1];
- winDir[MAX_PATH] = '\0';
- ::GetWindowsDirectory(winDir, MAX_PATH);
+ char winDir[MAX_PATH_LENGTH + 1];
+ winDir[MAX_PATH_LENGTH] = '\0';
+ ::GetWindowsDirectory(winDir, MAX_PATH_LENGTH);
return PathUtil::Combine(AnsiString(winDir), "fonts");
#else
// !PORTME
diff --git a/engines/wintermute/PlatformSDL.h b/engines/wintermute/PlatformSDL.h
index 6b8879328a..fc2e60a7a4 100644
--- a/engines/wintermute/PlatformSDL.h
+++ b/engines/wintermute/PlatformSDL.h
@@ -48,9 +48,9 @@ public:
static AnsiString getPlatformName();
// Win32 API bindings
- static void outputDebugString(LPCSTR lpOutputString);
+ static void outputDebugString(const char *lpOutputString);
static uint32 getTime();
- static bool getCursorPos(LPPOINT lpPoint);
+ static bool getCursorPos(Common::Point *lpPoint);
static bool setCursorPos(int X, int Y);
static bool showWindow(int nCmdShow);
static bool deleteFile(const char *lpFileName);
@@ -59,15 +59,15 @@ public:
static bool releaseCapture();
static bool setForegroundWindow();
- static bool setRectEmpty(LPRECT lprc);
- static bool isRectEmpty(const LPRECT lprc);
- static bool ptInRect(LPRECT lprc, POINT p);
- static bool setRect(LPRECT lprc, int left, int top, int right, int bottom);
- static bool intersectRect(LPRECT lprcDst, const LPRECT lprcSrc1, const LPRECT lprcSrc2);
- static bool unionRect(LPRECT lprcDst, RECT *lprcSrc1, RECT *lprcSrc2);
- static bool copyRect(LPRECT lprcDst, RECT *lprcSrc);
- static bool offsetRect(LPRECT lprc, int dx, int dy);
- static bool equalRect(LPRECT rect1, LPRECT rect2);
+ static bool setRectEmpty(Common::Rect *lprc);
+ static bool isRectEmpty(const Common::Rect *lprc);
+ static bool ptInRect(Common::Rect *lprc, Common::Point p);
+ static bool setRect(Common::Rect *lprc, int left, int top, int right, int bottom);
+ static bool intersectRect(Common::Rect *lprcDst, const Common::Rect *lprcSrc1, const Common::Rect *lprcSrc2);
+ static bool unionRect(Common::Rect *lprcDst, Common::Rect *lprcSrc1, Common::Rect *lprcSrc2);
+ static bool copyRect(Common::Rect *lprcDst, Common::Rect *lprcSrc);
+ static bool offsetRect(Common::Rect *lprc, int dx, int dy);
+ static bool equalRect(Common::Rect *rect1, Common::Rect *rect2);
// string functions
diff --git a/engines/wintermute/Sys/SysClassRegistry.cpp b/engines/wintermute/Sys/SysClassRegistry.cpp
index 1ebcccf6e1..4bdb571df4 100644
--- a/engines/wintermute/Sys/SysClassRegistry.cpp
+++ b/engines/wintermute/Sys/SysClassRegistry.cpp
@@ -78,7 +78,7 @@ bool CSysClassRegistry::unregisterClass(CSysClass *classObj) {
if (it == _classes.end()) return false;
if (classObj->getNumInstances() != 0) {
- char str[MAX_PATH];
+ char str[MAX_PATH_LENGTH];
sprintf(str, "Memory leak@class %-20s: %d instance(s) left\n", classObj->getName().c_str(), classObj->getNumInstances());
CBPlatform::outputDebugString(str);
}
diff --git a/engines/wintermute/UI/UIButton.cpp b/engines/wintermute/UI/UIButton.cpp
index 2dfb688e46..930157ebf5 100644
--- a/engines/wintermute/UI/UIButton.cpp
+++ b/engines/wintermute/UI/UIButton.cpp
@@ -539,7 +539,7 @@ ERRORCODE CUIButton::saveAsText(CBDynBuffer *buffer, int indent) {
//////////////////////////////////////////////////////////////////////////
void CUIButton::correctSize() {
- RECT rect;
+ Common::Rect rect;
CBSprite *img = NULL;
if (_image) img = _image;
@@ -550,14 +550,14 @@ void CUIButton::correctSize() {
if (_width <= 0) {
if (img) {
- img->GetBoundingRect(&rect, 0, 0);
+ img->getBoundingRect(&rect, 0, 0);
_width = rect.right - rect.left;
} else _width = 100;
}
if (_height <= 0) {
if (img) {
- img->GetBoundingRect(&rect, 0, 0);
+ img->getBoundingRect(&rect, 0, 0);
_height = rect.bottom - rect.top;
}
}
@@ -623,8 +623,8 @@ ERRORCODE CUIButton::display(int offsetX, int offsetY) {
int imageY = offsetY + _posY;
if (image && _centerImage) {
- RECT rc;
- image->GetBoundingRect(&rc, 0, 0);
+ Common::Rect rc;
+ image->getBoundingRect(&rc, 0, 0);
imageX += (_width - (rc.right - rc.left)) / 2;
imageY += (_height - (rc.bottom - rc.top)) / 2;
}
diff --git a/engines/wintermute/UI/UIObject.cpp b/engines/wintermute/UI/UIObject.cpp
index 7ed8ffb74f..1a00748a98 100644
--- a/engines/wintermute/UI/UIObject.cpp
+++ b/engines/wintermute/UI/UIObject.cpp
@@ -113,18 +113,18 @@ void CUIObject::setListener(CBScriptHolder *object, CBScriptHolder *listenerObje
//////////////////////////////////////////////////////////////////////////
void CUIObject::correctSize() {
- RECT rect;
+ Common::Rect rect;
if (_width <= 0) {
if (_image) {
- _image->GetBoundingRect(&rect, 0, 0);
+ _image->getBoundingRect(&rect, 0, 0);
_width = rect.right - rect.left;
} else _width = 100;
}
if (_height <= 0) {
if (_image) {
- _image->GetBoundingRect(&rect, 0, 0);
+ _image->getBoundingRect(&rect, 0, 0);
_height = rect.bottom - rect.top;
}
}
diff --git a/engines/wintermute/UI/UITiledImage.h b/engines/wintermute/UI/UITiledImage.h
index 22f472dc28..297a868ed0 100644
--- a/engines/wintermute/UI/UITiledImage.h
+++ b/engines/wintermute/UI/UITiledImage.h
@@ -31,6 +31,7 @@
#include "UIObject.h"
+#include "common/rect.h"
namespace WinterMute {
class CBSubFrame;
@@ -46,15 +47,15 @@ public:
CUITiledImage(CBGame *inGame = NULL);
virtual ~CUITiledImage();
CBSubFrame *_image;
- RECT _upLeft;
- RECT _upMiddle;
- RECT _upRight;
- RECT _middleLeft;
- RECT _middleMiddle;
- RECT _middleRight;
- RECT _downLeft;
- RECT _downMiddle;
- RECT _downRight;
+ Common::Rect _upLeft;
+ Common::Rect _upMiddle;
+ Common::Rect _upRight;
+ Common::Rect _middleLeft;
+ Common::Rect _middleMiddle;
+ Common::Rect _middleRight;
+ Common::Rect _downLeft;
+ Common::Rect _downMiddle;
+ Common::Rect _downRight;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/UI/UIWindow.cpp b/engines/wintermute/UI/UIWindow.cpp
index d00d07a819..5f63390519 100644
--- a/engines/wintermute/UI/UIWindow.cpp
+++ b/engines/wintermute/UI/UIWindow.cpp
@@ -1135,7 +1135,7 @@ ERRORCODE CUIWindow::handleMouse(TMouseEvent event, TMouseButton button) {
if (!CBPlatform::isRectEmpty(&_dragRect)) {
// start drag
if (event == MOUSE_CLICK && button == MOUSE_BUTTON_LEFT) {
- RECT dragRect = _dragRect;
+ Common::Rect dragRect = _dragRect;
int offsetX, offsetY;
getTotalOffset(&offsetX, &offsetY);
CBPlatform::offsetRect(&dragRect, _posX + offsetX, _posY + offsetY);
diff --git a/engines/wintermute/UI/UIWindow.h b/engines/wintermute/UI/UIWindow.h
index 80e5761ddc..79e1ce09be 100644
--- a/engines/wintermute/UI/UIWindow.h
+++ b/engines/wintermute/UI/UIWindow.h
@@ -59,14 +59,14 @@ public:
TWindowMode _mode;
ERRORCODE moveFocus(bool forward = true);
virtual ERRORCODE handleMouse(TMouseEvent Event, TMouseButton Button);
- POINT _dragFrom;
+ Common::Point _dragFrom;
bool _dragging;
DECLARE_PERSISTENT(CUIWindow, CUIObject)
bool _transparent;
ERRORCODE showWidget(const char *name, bool visible = true);
ERRORCODE enableWidget(const char *name, bool enable = true);
- RECT _titleRect;
- RECT _dragRect;
+ Common::Rect _titleRect;
+ Common::Rect _dragRect;
virtual ERRORCODE display(int offsetX = 0, int offsetY = 0);
CUIWindow(CBGame *inGame);
virtual ~CUIWindow();
diff --git a/engines/wintermute/utils/PathUtil.cpp b/engines/wintermute/utils/PathUtil.cpp
index cfc3db916e..5c12a71c33 100644
--- a/engines/wintermute/utils/PathUtil.cpp
+++ b/engines/wintermute/utils/PathUtil.cpp
@@ -116,8 +116,8 @@ AnsiString PathUtil::getSafeLogFileName() {
AnsiString logFileName = getUserDirectory();
#ifdef __WIN32__
- char moduleName[MAX_PATH];
- ::GetModuleFileName(NULL, moduleName, MAX_PATH);
+ char moduleName[MAX_PATH_LENGTH];
+ ::GetModuleFileName(NULL, moduleName, MAX_PATH_LENGTH);
AnsiString fileName = GetFileNameWithoutExtension(moduleName) + ".log";
fileName = Combine("/Wintermute Engine/Logs/", fileName);
@@ -162,7 +162,7 @@ AnsiString PathUtil::getUserDirectory() {
AnsiString userDir = "./";
#if 0
#ifdef __WIN32__
- char buffer[MAX_PATH];
+ char buffer[MAX_PATH_LENGTH];
buffer[0] = '\0';
LPITEMIDLIST pidl = NULL;
LPMALLOC pMalloc;
@@ -178,14 +178,14 @@ AnsiString PathUtil::getUserDirectory() {
FSRef fileRef;
OSStatus error = FSFindFolder(kUserDomain, kApplicationSupportFolderType, true, &fileRef);
if (error == noErr) {
- char buffer[MAX_PATH];
+ char buffer[MAX_PATH_LENGTH];
error = FSRefMakePath(&fileRef, (UInt8 *)buffer, sizeof(buffer));
if (error == noErr)
userDir = buffer;
}
#elif __IPHONEOS__
- char path[MAX_PATH];
+ char path[MAX_PATH_LENGTH];
IOS_GetDataDir(path);
userDir = AnsiString(path);
#endif
diff --git a/engines/wintermute/utils/utils.cpp b/engines/wintermute/utils/utils.cpp
index ca68b3c691..d672656973 100644
--- a/engines/wintermute/utils/utils.cpp
+++ b/engines/wintermute/utils/utils.cpp
@@ -45,7 +45,7 @@ static inline unsigned Sqr(int x) {
//////////////////////////////////////////////////////////////////////////////////
-void CBUtils::clip(int *destX, int *destY, RECT *srcRect, RECT *destRect) {
+void CBUtils::clip(int *destX, int *destY, Common::Rect *srcRect, Common::Rect *destRect) {
// If it's partly off the right side of the screen
if (*destX + (srcRect->right - srcRect->left) > destRect->right)
srcRect->right -= *destX + (srcRect->right - srcRect->left) - destRect->right;
diff --git a/engines/wintermute/utils/utils.h b/engines/wintermute/utils/utils.h
index 52678a3e9f..50665dad1f 100644
--- a/engines/wintermute/utils/utils.h
+++ b/engines/wintermute/utils/utils.h
@@ -37,7 +37,7 @@ class CBGame;
class CBUtils {
public:
- static void clip(int *DestX, int *DestY, RECT *SrcRect, RECT *DestRect);
+ static void clip(int *DestX, int *DestY, Common::Rect *SrcRect, Common::Rect *DestRect);
static void swap(int *a, int *b);
static bool strBeginsI(const char *String, const char *Fragment);
static float normalizeAngle(float Angle);
diff --git a/engines/wintermute/video/VidPlayer.cpp b/engines/wintermute/video/VidPlayer.cpp
index 51453fb34b..7fa8e6e218 100644
--- a/engines/wintermute/video/VidPlayer.cpp
+++ b/engines/wintermute/video/VidPlayer.cpp
@@ -128,7 +128,7 @@ ERRORCODE CVidPlayer::initialize(const char *inFilename, const char *SubtitleFil
#if 0
cleanup();
- char Filename[MAX_PATH];
+ char Filename[MAX_PATH_LENGTH];
Game->_fileManager->GetFullPath(inFilename, filename);
// open file
@@ -382,7 +382,7 @@ ERRORCODE CVidPlayer::loadSubtitles(const char *filename, const char *SubtitleFi
#if 0
if (!Filename) return STATUS_OK;
- char NewFile[MAX_PATH];
+ char NewFile[MAX_PATH_LENGTH];
char drive[_MAX_DRIVE];
char dir[_MAX_DIR];
char fname[_MAX_FNAME];
diff --git a/engines/wintermute/video/VidTheoraPlayer.cpp b/engines/wintermute/video/VidTheoraPlayer.cpp
index 6b71c2a2fd..c57049e177 100644
--- a/engines/wintermute/video/VidTheoraPlayer.cpp
+++ b/engines/wintermute/video/VidTheoraPlayer.cpp
@@ -652,7 +652,7 @@ void CVidTheoraPlayer::writeAlpha() {
//////////////////////////////////////////////////////////////////////////
ERRORCODE CVidTheoraPlayer::display(uint32 alpha) {
- RECT rc;
+ Common::Rect rc;
ERRORCODE res;
if (_texture && _videoFrameReady) {
diff --git a/engines/wintermute/wintypes.h b/engines/wintermute/wintypes.h
index b4d2830c20..678fb6bb6b 100644
--- a/engines/wintermute/wintypes.h
+++ b/engines/wintermute/wintypes.h
@@ -30,6 +30,7 @@
#define WINTERMUTE_WINTYPES_H
#include "common/scummsys.h"
+#include "common/rect.h"
namespace WinterMute {
@@ -48,32 +49,7 @@ typedef bool ERRORCODE;
#define STATUS_OK (true)
#define STATUS_FAILED (false)
-#ifndef __WIN32__
-
-#define MAX_PATH 512
-
-typedef char *NPSTR, *LPSTR, *PSTR;
-typedef PSTR *PZPSTR;
-typedef const PSTR *PCZPSTR;
-typedef const char *LPCSTR, *PCSTR;
-typedef PCSTR *PZPCSTR;
-
-typedef struct tagRECT {
- int32 left;
- int32 top;
- int32 right;
- int32 bottom;
-} RECT, *LPRECT;
-
-
-typedef struct tagPOINT {
- int32 x;
- int32 y;
-} POINT, *LPPOINT;
-
-#endif // __WIN32__
-
-
+#define MAX_PATH_LENGTH 512
} // end of namespace WinterMute