aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-09 01:35:53 +0200
committerEinar Johan Trøan Sømåen2012-07-09 01:35:53 +0200
commit0273e495e1495d6abbcac4dde4cfa7e6ca2c29d7 (patch)
tree9fa6a60b9c1b7e60cd88cf7e1c9370f1369698db
parentc4fac37bd0035ac19ab0279941d4f1a2eb118409 (diff)
downloadscummvm-rg350-0273e495e1495d6abbcac4dde4cfa7e6ca2c29d7.tar.gz
scummvm-rg350-0273e495e1495d6abbcac4dde4cfa7e6ca2c29d7.tar.bz2
scummvm-rg350-0273e495e1495d6abbcac4dde4cfa7e6ca2c29d7.zip
WINTERMUTE: Cleanup and rename functions in PlatformSDL.
-rw-r--r--engines/wintermute/Ad/AdGame.cpp6
-rw-r--r--engines/wintermute/Ad/AdInventoryBox.cpp4
-rw-r--r--engines/wintermute/Ad/AdResponseBox.cpp4
-rw-r--r--engines/wintermute/Ad/AdScene.cpp4
-rw-r--r--engines/wintermute/Base/BActiveRect.cpp10
-rw-r--r--engines/wintermute/Base/BFader.cpp6
-rw-r--r--engines/wintermute/Base/BFontBitmap.cpp2
-rw-r--r--engines/wintermute/Base/BFontTT.cpp4
-rw-r--r--engines/wintermute/Base/BFrame.cpp8
-rw-r--r--engines/wintermute/Base/BGame.cpp46
-rw-r--r--engines/wintermute/Base/BObject.cpp2
-rw-r--r--engines/wintermute/Base/BRegion.cpp10
-rw-r--r--engines/wintermute/Base/BRenderer.cpp4
-rw-r--r--engines/wintermute/Base/BSprite.cpp8
-rw-r--r--engines/wintermute/Base/BSubFrame.cpp18
-rw-r--r--engines/wintermute/Base/BTransitionMgr.cpp6
-rw-r--r--engines/wintermute/Base/BViewport.cpp4
-rw-r--r--engines/wintermute/Base/PartEmitter.cpp6
-rw-r--r--engines/wintermute/Base/PartParticle.cpp6
-rw-r--r--engines/wintermute/Base/scriptables/SXFile.cpp4
-rw-r--r--engines/wintermute/Base/scriptables/ScEngine.cpp20
-rw-r--r--engines/wintermute/Base/scriptables/ScEngine.h2
-rw-r--r--engines/wintermute/Base/scriptables/ScScript.cpp2
-rw-r--r--engines/wintermute/PlatformSDL.cpp65
-rw-r--r--engines/wintermute/PlatformSDL.h49
-rw-r--r--engines/wintermute/Sys/SysClassRegistry.cpp2
-rw-r--r--engines/wintermute/UI/UIButton.cpp8
-rw-r--r--engines/wintermute/UI/UIEdit.cpp8
-rw-r--r--engines/wintermute/UI/UITiledImage.cpp54
-rw-r--r--engines/wintermute/UI/UIWindow.cpp16
-rw-r--r--engines/wintermute/video/VidTheoraPlayer.cpp2
-rw-r--r--engines/wintermute/wintermute.cpp8
32 files changed, 196 insertions, 202 deletions
diff --git a/engines/wintermute/Ad/AdGame.cpp b/engines/wintermute/Ad/AdGame.cpp
index da64c19fe9..55cb3b876b 100644
--- a/engines/wintermute/Ad/AdGame.cpp
+++ b/engines/wintermute/Ad/AdGame.cpp
@@ -1925,7 +1925,7 @@ char *CAdGame::findSpeechFile(char *stringID) {
//////////////////////////////////////////////////////////////////////////
bool CAdGame::validMouse() {
POINT pos;
- CBPlatform::GetCursorPos(&pos);
+ CBPlatform::getCursorPos(&pos);
return _renderer->pointInViewport(&pos);
}
@@ -1953,7 +1953,7 @@ HRESULT CAdGame::onMouseLeftDown() {
if (_activeObject != NULL) Game->_capturedObject = Game->_activeObject;
_mouseLeftDown = true;
- CBPlatform::SetCapture(_renderer->_window);
+ CBPlatform::setCapture(_renderer->_window);
return S_OK;
}
@@ -1962,7 +1962,7 @@ HRESULT CAdGame::onMouseLeftDown() {
HRESULT CAdGame::onMouseLeftUp() {
if (_activeObject) _activeObject->handleMouse(MOUSE_RELEASE, MOUSE_BUTTON_LEFT);
- CBPlatform::ReleaseCapture();
+ CBPlatform::releaseCapture();
_capturedObject = NULL;
_mouseLeftDown = false;
diff --git a/engines/wintermute/Ad/AdInventoryBox.cpp b/engines/wintermute/Ad/AdInventoryBox.cpp
index 8472ab122e..81a8f7db2b 100644
--- a/engines/wintermute/Ad/AdInventoryBox.cpp
+++ b/engines/wintermute/Ad/AdInventoryBox.cpp
@@ -46,7 +46,7 @@ IMPLEMENT_PERSISTENT(CAdInventoryBox, false)
//////////////////////////////////////////////////////////////////////////
CAdInventoryBox::CAdInventoryBox(CBGame *inGame): CBObject(inGame) {
- CBPlatform::SetRectEmpty(&_itemsArea);
+ CBPlatform::setRectEmpty(&_itemsArea);
_scrollOffset = 0;
_spacing = 0;
_itemWidth = _itemHeight = 50;
@@ -124,7 +124,7 @@ HRESULT CAdInventoryBox::display() {
// display window
RECT rect = _itemsArea;
if (_window) {
- CBPlatform::OffsetRect(&rect, _window->_posX, _window->_posY);
+ CBPlatform::offsetRect(&rect, _window->_posX, _window->_posY);
_window->display();
}
diff --git a/engines/wintermute/Ad/AdResponseBox.cpp b/engines/wintermute/Ad/AdResponseBox.cpp
index eb9912fb14..eea61a4268 100644
--- a/engines/wintermute/Ad/AdResponseBox.cpp
+++ b/engines/wintermute/Ad/AdResponseBox.cpp
@@ -57,7 +57,7 @@ CAdResponseBox::CAdResponseBox(CBGame *inGame): CBObject(inGame) {
_shieldWindow = new CUIWindow(Game);
_horizontal = false;
- CBPlatform::SetRectEmpty(&_responseArea);
+ CBPlatform::setRectEmpty(&_responseArea);
_scrollOffset = 0;
_spacing = 0;
@@ -399,7 +399,7 @@ HRESULT CAdResponseBox::saveAsText(CBDynBuffer *buffer, int indent) {
HRESULT CAdResponseBox::display() {
RECT rect = _responseArea;
if (_window) {
- CBPlatform::OffsetRect(&rect, _window->_posX, _window->_posY);
+ CBPlatform::offsetRect(&rect, _window->_posX, _window->_posY);
//_window->display();
}
diff --git a/engines/wintermute/Ad/AdScene.cpp b/engines/wintermute/Ad/AdScene.cpp
index 2e99b93e88..3f6d724ac4 100644
--- a/engines/wintermute/Ad/AdScene.cpp
+++ b/engines/wintermute/Ad/AdScene.cpp
@@ -485,14 +485,14 @@ HRESULT CAdScene::initLoop() {
#ifdef _DEBUGxxxx
int nu_steps = 0;
uint32 start = Game->_currentTime;
- while (!_pfReady && CBPlatform::GetTime() - start <= _pfMaxTime) {
+ while (!_pfReady && CBPlatform::getTime() - start <= _pfMaxTime) {
PathFinderStep();
nu_steps++;
}
if (nu_steps > 0) Game->LOG(0, "STAT: PathFinder iterations in one loop: %d (%s) _pfMaxTime=%d", nu_steps, _pfReady ? "finished" : "not yet done", _pfMaxTime);
#else
uint32 start = Game->_currentTime;
- while (!_pfReady && CBPlatform::GetTime() - start <= _pfMaxTime) pathFinderStep();
+ while (!_pfReady && CBPlatform::getTime() - start <= _pfMaxTime) pathFinderStep();
#endif
return S_OK;
diff --git a/engines/wintermute/Base/BActiveRect.cpp b/engines/wintermute/Base/BActiveRect.cpp
index eb4f60b0d0..86a441c317 100644
--- a/engines/wintermute/Base/BActiveRect.cpp
+++ b/engines/wintermute/Base/BActiveRect.cpp
@@ -36,7 +36,7 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////
CBActiveRect::CBActiveRect(CBGame *inGame): CBBase(inGame) {
- CBPlatform::SetRectEmpty(&_rect);
+ CBPlatform::setRectEmpty(&_rect);
_owner = NULL;
_frame = NULL;
_region = NULL;
@@ -51,7 +51,7 @@ CBActiveRect::CBActiveRect(CBGame *inGame): CBBase(inGame) {
CBActiveRect::CBActiveRect(CBGame *inGame, CBObject *owner, CBSubFrame *frame, int x, int y, int width, int height, float zoomX, float zoomY, bool precise): CBBase(inGame) {
_owner = owner;
_frame = frame;
- CBPlatform::SetRect(&_rect, x, y, x + width, y + height);
+ CBPlatform::setRect(&_rect, x, y, x + width, y + height);
_zoomX = zoomX;
_zoomY = zoomY;
_precise = precise;
@@ -64,8 +64,8 @@ CBActiveRect::CBActiveRect(CBGame *inGame, CBObject *owner, CBSubFrame *frame, i
CBActiveRect::CBActiveRect(CBGame *inGame, CBObject *owner, CBRegion *region, int offsetX, int offsetY): CBBase(inGame) {
_owner = owner;
_region = region;
- CBPlatform::CopyRect(&_rect, &region->_rect);
- CBPlatform::OffsetRect(&_rect, -offsetX, -offsetY);
+ CBPlatform::copyRect(&_rect, &region->_rect);
+ CBPlatform::offsetRect(&_rect, -offsetX, -offsetY);
_zoomX = 100;
_zoomY = 100;
_precise = true;
@@ -101,7 +101,7 @@ void CBActiveRect::clipRect() {
if (rc.left > _rect.left) _offsetX = rc.left - _rect.left;
if (rc.top > _rect.top) _offsetY = rc.top - _rect.top;
- CBPlatform::IntersectRect(&_rect, &_rect, &rc);
+ CBPlatform::intersectRect(&_rect, &_rect, &rc);
}
} // end of namespace WinterMute
diff --git a/engines/wintermute/Base/BFader.cpp b/engines/wintermute/Base/BFader.cpp
index 2f6a79028f..ef0208c44d 100644
--- a/engines/wintermute/Base/BFader.cpp
+++ b/engines/wintermute/Base/BFader.cpp
@@ -67,7 +67,7 @@ HRESULT CBFader::update() {
uint32 time;
- if (_system) time = CBPlatform::GetTime() - _startTime;
+ if (_system) time = CBPlatform::getTime() - _startTime;
else time = Game->_timer - _startTime;
if (time >= _duration) _currentAlpha = _targetAlpha;
@@ -115,7 +115,7 @@ HRESULT CBFader::fadeIn(uint32 sourceColor, uint32 duration, bool system) {
_duration = duration;
_system = system;
- if (_system) _startTime = CBPlatform::GetTime();
+ if (_system) _startTime = CBPlatform::getTime();
else _startTime = Game->_timer;
return S_OK;
@@ -138,7 +138,7 @@ HRESULT CBFader::fadeOut(uint32 targetColor, uint32 duration, bool system) {
_duration = duration;
_system = system;
- if (_system) _startTime = CBPlatform::GetTime();
+ if (_system) _startTime = CBPlatform::getTime();
else _startTime = Game->_timer;
diff --git a/engines/wintermute/Base/BFontBitmap.cpp b/engines/wintermute/Base/BFontBitmap.cpp
index 06c6055101..45c2efbdb7 100644
--- a/engines/wintermute/Base/BFontBitmap.cpp
+++ b/engines/wintermute/Base/BFontBitmap.cpp
@@ -229,7 +229,7 @@ void CBFontBitmap::drawChar(byte c, int x, int y) {
if (_wholeCell) tileWidth = _tileWidth;
else tileWidth = _widths[c];
- CBPlatform::SetRect(&rect, col * _tileWidth, row * _tileHeight, col * _tileWidth + tileWidth, (row + 1)*_tileHeight);
+ CBPlatform::setRect(&rect, col * _tileWidth, row * _tileHeight, col * _tileWidth + tileWidth, (row + 1)*_tileHeight);
bool handled = false;
if (_sprite) {
_sprite->GetCurrentFrame();
diff --git a/engines/wintermute/Base/BFontTT.cpp b/engines/wintermute/Base/BFontTT.cpp
index 7eafd5fd90..e2240f28bb 100644
--- a/engines/wintermute/Base/BFontTT.cpp
+++ b/engines/wintermute/Base/BFontTT.cpp
@@ -218,7 +218,7 @@ void CBFontTT::drawText(byte *text, int x, int y, int width, TTextAlign align, i
// and paint it
if (surface) {
RECT rc;
- CBPlatform::SetRect(&rc, 0, 0, surface->getWidth(), surface->getHeight());
+ CBPlatform::setRect(&rc, 0, 0, surface->getWidth(), surface->getHeight());
for (int i = 0; i < _layers.GetSize(); i++) {
uint32 color = _layers[i]->_color;
uint32 origForceAlpha = _renderer->_forceAlphaColor;
@@ -639,7 +639,7 @@ HRESULT CBFontTT::initFont() {
Common::SeekableReadStream *file = Game->_fileManager->openFile(_fontFile);
if (!file) {
// the requested font file is not in wme file space; try loading a system font
- AnsiString fontFileName = PathUtil::combine(CBPlatform::GetSystemFontPath(), PathUtil::getFileName(_fontFile));
+ AnsiString fontFileName = PathUtil::combine(CBPlatform::getSystemFontPath(), PathUtil::getFileName(_fontFile));
file = Game->_fileManager->openFile(fontFileName.c_str(), false);
if (!file) {
Game->LOG(0, "Error loading TrueType font '%s'", _fontFile);
diff --git a/engines/wintermute/Base/BFrame.cpp b/engines/wintermute/Base/BFrame.cpp
index 65d2d55f6a..ebb5fe0e6c 100644
--- a/engines/wintermute/Base/BFrame.cpp
+++ b/engines/wintermute/Base/BFrame.cpp
@@ -170,7 +170,7 @@ HRESULT CBFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
bool decoration = false;
bool mirrorX = false;
bool mirrorY = false;
- CBPlatform::SetRectEmpty(&rect);
+ CBPlatform::setRectEmpty(&rect);
char *surface_file = NULL;
while ((cmd = parser.getCommand((char **)&buffer, commands, &params)) > 0) {
@@ -305,7 +305,7 @@ HRESULT CBFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
if (custoTrans) sub->_transparent = DRGBA(r, g, b, 0xFF);
}
- if (CBPlatform::IsRectEmpty(&rect)) sub->setDefaultRect();
+ if (CBPlatform::isRectEmpty(&rect)) sub->setDefaultRect();
else sub->_rect = rect;
sub->_hotspotX = hotspotX;
@@ -327,13 +327,13 @@ HRESULT CBFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
//////////////////////////////////////////////////////////////////////////
bool CBFrame::getBoundingRect(LPRECT rect, int x, int y, float scaleX, float scaleY) {
if (!rect) return false;
- CBPlatform::SetRectEmpty(rect);
+ CBPlatform::setRectEmpty(rect);
RECT subRect;
for (int i = 0; i < _subframes.GetSize(); i++) {
_subframes[i]->getBoundingRect(&subRect, x, y, scaleX, scaleY);
- CBPlatform::UnionRect(rect, rect, &subRect);
+ CBPlatform::unionRect(rect, rect, &subRect);
}
return true;
}
diff --git a/engines/wintermute/Base/BGame.cpp b/engines/wintermute/Base/BGame.cpp
index bebccec08f..94f105926b 100644
--- a/engines/wintermute/Base/BGame.cpp
+++ b/engines/wintermute/Base/BGame.cpp
@@ -243,7 +243,7 @@ CBGame::CBGame(): CBObject(this) {
_lastCursor = NULL;
- CBPlatform::SetRectEmpty(&_mouseLockRect);
+ CBPlatform::setRectEmpty(&_mouseLockRect);
_suppressScriptErrors = false;
_lastMiniUpdate = 0;
@@ -336,7 +336,7 @@ CBGame::~CBGame() {
_stringTable = NULL;
DEBUG_DebugDisable();
- CBPlatform::OutputDebugString("--- shutting down normally ---\n");
+ CBPlatform::outputDebugString("--- shutting down normally ---\n");
}
@@ -560,7 +560,7 @@ void CBGame::DEBUG_DebugEnable(const char *filename) {
LOG(0, "%s ver %d.%d.%d%s, Compiled on " __DATE__ ", " __TIME__, DCGF_NAME, DCGF_VER_MAJOR, DCGF_VER_MINOR, DCGF_VER_BUILD, DCGF_VER_SUFFIX);
//LOG(0, "Extensions: %s ver %d.%02d", EXT_NAME, EXT_VER_MAJOR, EXT_VER_MINOR);
- AnsiString platform = CBPlatform::GetPlatformName();
+ AnsiString platform = CBPlatform::getPlatformName();
LOG(0, "Platform: %s", platform.c_str());
LOG(0, "");
}
@@ -618,7 +618,7 @@ void CBGame::setEngineLogCallback(ENGINE_LOG_CALLBACK callback, void *data) {
HRESULT CBGame::initLoop() {
_viewportSP = -1;
- _currentTime = CBPlatform::GetTime();
+ _currentTime = CBPlatform::getTime();
getDebugMgr()->onGameTick();
_renderer->initLoop();
@@ -1364,7 +1364,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS
p.x = x + _renderer->_drawOffsetX;
p.y = y + _renderer->_drawOffsetY;
- CBPlatform::SetCursorPos(p.x, p.y);
+ CBPlatform::setCursorPos(p.x, p.y);
stack->pushNULL();
return S_OK;
@@ -1383,7 +1383,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS
if (right < left) CBUtils::swap(&left, &right);
if (bottom < top) CBUtils::swap(&top, &bottom);
- CBPlatform::SetRect(&_mouseLockRect, left, top, right, bottom);
+ CBPlatform::setRect(&_mouseLockRect, left, top, right, bottom);
stack->pushNULL();
return S_OK;
@@ -2213,7 +2213,7 @@ CScValue *CBGame::scGetProperty(const char *name) {
// WindowsTime (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "WindowsTime") == 0) {
- _scValue->setInt((int)CBPlatform::GetTime());
+ _scValue->setInt((int)CBPlatform::getTime());
return _scValue;
}
@@ -2532,7 +2532,7 @@ CScValue *CBGame::scGetProperty(const char *name) {
// Platform (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Platform") == 0) {
- _scValue->setString(CBPlatform::GetPlatformName().c_str());
+ _scValue->setString(CBPlatform::getPlatformName().c_str());
return _scValue;
}
@@ -3913,7 +3913,7 @@ HRESULT CBGame::emptySaveSlot(int slot) {
char filename[MAX_PATH + 1];
getSaveSlotFilename(slot, filename);
- CBPlatform::DeleteFile(filename);
+ CBPlatform::deleteFile(filename);
return S_OK;
}
@@ -3971,10 +3971,10 @@ HRESULT CBGame::getCurrentViewportRect(RECT *rect, bool *custom) {
if (rect == NULL) return E_FAIL;
else {
if (_viewportSP >= 0) {
- CBPlatform::CopyRect(rect, _viewportStack[_viewportSP]->getRect());
+ CBPlatform::copyRect(rect, _viewportStack[_viewportSP]->getRect());
if (custom) *custom = true;
} else {
- CBPlatform::SetRect(rect, _renderer->_drawOffsetX,
+ CBPlatform::setRect(rect, _renderer->_drawOffsetX,
_renderer->_drawOffsetY,
_renderer->_width + _renderer->_drawOffsetX,
_renderer->_height + _renderer->_drawOffsetY);
@@ -4025,7 +4025,7 @@ void CBGame::resetMousePos() {
p.x = _mousePos.x + _renderer->_drawOffsetX;
p.y = _mousePos.y + _renderer->_drawOffsetY;
- CBPlatform::SetCursorPos(p.x, p.y);
+ CBPlatform::setCursorPos(p.x, p.y);
}
@@ -4049,7 +4049,7 @@ HRESULT CBGame::displayContentSimple() {
HRESULT CBGame::displayIndicator() {
if (_saveLoadImage) {
RECT rc;
- CBPlatform::SetRect(&rc, 0, 0, _saveLoadImage->getWidth(), _saveLoadImage->getHeight());
+ CBPlatform::setRect(&rc, 0, 0, _saveLoadImage->getWidth(), _saveLoadImage->getHeight());
if (_loadInProgress) _saveLoadImage->displayTrans(_loadImageX, _loadImageY, rc);
else _saveLoadImage->displayTrans(_saveImageX, _saveImageY, rc);
}
@@ -4233,7 +4233,7 @@ HRESULT CBGame::onMouseLeftDown() {
if (_activeObject != NULL) _capturedObject = _activeObject;
_mouseLeftDown = true;
- CBPlatform::SetCapture(_renderer->_window);
+ CBPlatform::setCapture(_renderer->_window);
return S_OK;
}
@@ -4242,7 +4242,7 @@ HRESULT CBGame::onMouseLeftDown() {
HRESULT CBGame::onMouseLeftUp() {
if (_activeObject) _activeObject->handleMouse(MOUSE_RELEASE, MOUSE_BUTTON_LEFT);
- CBPlatform::ReleaseCapture();
+ CBPlatform::releaseCapture();
_capturedObject = NULL;
_mouseLeftDown = false;
@@ -4408,7 +4408,7 @@ CBDebugger *CBGame::getDebugMgr() {
//////////////////////////////////////////////////////////////////////////
void CBGame::getMousePos(POINT *pos) {
- CBPlatform::GetCursorPos(pos);
+ CBPlatform::getCursorPos(pos);
pos->x -= _renderer->_drawOffsetX;
pos->y -= _renderer->_drawOffsetY;
@@ -4427,7 +4427,7 @@ void CBGame::getMousePos(POINT *pos) {
*/
if (_mouseLockRect.left != 0 && _mouseLockRect.right != 0 && _mouseLockRect.top != 0 && _mouseLockRect.bottom != 0) {
- if (!CBPlatform::PtInRect(&_mouseLockRect, *pos)) {
+ if (!CBPlatform::ptInRect(&_mouseLockRect, *pos)) {
pos->x = MAX(_mouseLockRect.left, pos->x);
pos->y = MAX(_mouseLockRect.top, pos->y);
@@ -4439,7 +4439,7 @@ void CBGame::getMousePos(POINT *pos) {
newPos.x += _renderer->_drawOffsetX;
newPos.y += _renderer->_drawOffsetY;
- CBPlatform::SetCursorPos(newPos.x, newPos.y);
+ CBPlatform::setCursorPos(newPos.x, newPos.y);
}
}
}
@@ -4448,9 +4448,9 @@ void CBGame::getMousePos(POINT *pos) {
HRESULT CBGame::miniUpdate() {
if (!_miniUpdateEnabled) return S_OK;
- if (CBPlatform::GetTime() - _lastMiniUpdate > 200) {
+ if (CBPlatform::getTime() - _lastMiniUpdate > 200) {
if (_soundMgr) _soundMgr->initLoop();
- _lastMiniUpdate = CBPlatform::GetTime();
+ _lastMiniUpdate = CBPlatform::getTime();
}
return S_OK;
}
@@ -4482,14 +4482,14 @@ bool CBGame::isDoubleClick(int buttonIndex) {
#endif
POINT pos;
- CBPlatform::GetCursorPos(&pos);
+ CBPlatform::getCursorPos(&pos);
int moveX = abs(pos.x - _lastClick[buttonIndex].PosX);
int moveY = abs(pos.y - _lastClick[buttonIndex].PosY);
- if (_lastClick[buttonIndex].Time == 0 || CBPlatform::GetTime() - _lastClick[buttonIndex].Time > maxDoubleCLickTime || moveX > maxMoveX || moveY > maxMoveY) {
- _lastClick[buttonIndex].Time = CBPlatform::GetTime();
+ if (_lastClick[buttonIndex].Time == 0 || CBPlatform::getTime() - _lastClick[buttonIndex].Time > maxDoubleCLickTime || moveX > maxMoveX || moveY > maxMoveY) {
+ _lastClick[buttonIndex].Time = CBPlatform::getTime();
_lastClick[buttonIndex].PosX = pos.x;
_lastClick[buttonIndex].PosY = pos.y;
return false;
diff --git a/engines/wintermute/Base/BObject.cpp b/engines/wintermute/Base/BObject.cpp
index 6b4b0f5da2..ac45d9827a 100644
--- a/engines/wintermute/Base/BObject.cpp
+++ b/engines/wintermute/Base/BObject.cpp
@@ -65,7 +65,7 @@ CBObject::CBObject(CBGame *inGame): CBScriptHolder(inGame) {
_iD = Game->getSequence();
- CBPlatform::SetRectEmpty(&_rect);
+ CBPlatform::setRectEmpty(&_rect);
_rectSet = false;
_cursor = NULL;
diff --git a/engines/wintermute/Base/BRegion.cpp b/engines/wintermute/Base/BRegion.cpp
index 878b73e5e3..1b89988ba8 100644
--- a/engines/wintermute/Base/BRegion.cpp
+++ b/engines/wintermute/Base/BRegion.cpp
@@ -49,7 +49,7 @@ CBRegion::CBRegion(CBGame *inGame): CBObject(inGame) {
_lastMimicScale = -1;
_lastMimicX = _lastMimicY = INT_MIN;
- CBPlatform::SetRectEmpty(&_rect);
+ CBPlatform::setRectEmpty(&_rect);
}
@@ -64,7 +64,7 @@ void CBRegion::cleanup() {
for (int i = 0; i < _points.GetSize(); i++) delete _points[i];
_points.RemoveAll();
- CBPlatform::SetRectEmpty(&_rect);
+ CBPlatform::setRectEmpty(&_rect);
_editorSelectedPoint = -1;
}
@@ -89,7 +89,7 @@ bool CBRegion::pointInRegion(int x, int y) {
rect.top = y - 1;
rect.bottom = y + 2;
- if (CBPlatform::PtInRect(&_rect, pt)) return ptInPolygon(x, y);
+ if (CBPlatform::ptInRect(&_rect, pt)) return ptInPolygon(x, y);
else return false;
}
@@ -466,7 +466,7 @@ bool CBRegion::ptInPolygon(int x, int y) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBRegion::getBoundingRect(RECT *rect) {
- if (_points.GetSize() == 0) CBPlatform::SetRectEmpty(rect);
+ if (_points.GetSize() == 0) CBPlatform::setRectEmpty(rect);
else {
int MinX = INT_MAX, MinY = INT_MAX, MaxX = INT_MIN, MaxY = INT_MIN;
@@ -477,7 +477,7 @@ HRESULT CBRegion::getBoundingRect(RECT *rect) {
MaxX = MAX(MaxX, _points[i]->x);
MaxY = MAX(MaxY, _points[i]->y);
}
- CBPlatform::SetRect(rect, MinX, MinY, MaxX, MaxY);
+ CBPlatform::setRect(rect, MinX, MinY, MaxX, MaxY);
}
return S_OK;
}
diff --git a/engines/wintermute/Base/BRenderer.cpp b/engines/wintermute/Base/BRenderer.cpp
index e7d5ec55cb..6708fb65b9 100644
--- a/engines/wintermute/Base/BRenderer.cpp
+++ b/engines/wintermute/Base/BRenderer.cpp
@@ -47,7 +47,7 @@ CBRenderer::CBRenderer(CBGame *inGame): CBBase(inGame) {
_forceAlphaColor = 0x00;
_width = _height = _bPP = 0;
- CBPlatform::SetRectEmpty(&_monitorRect);
+ CBPlatform::setRectEmpty(&_monitorRect);
_realWidth = _realHeight = 0;
_drawOffsetX = _drawOffsetY = 0;
@@ -74,7 +74,7 @@ CBObject *CBRenderer::getObjectAt(int x, int y) {
point.y = y;
for (int i = _rectList.GetSize() - 1; i >= 0; i--) {
- if (CBPlatform::PtInRect(&_rectList[i]->_rect, point)) {
+ if (CBPlatform::ptInRect(&_rectList[i]->_rect, point)) {
if (_rectList[i]->_precise) {
// frame
if (_rectList[i]->_frame) {
diff --git a/engines/wintermute/Base/BSprite.cpp b/engines/wintermute/Base/BSprite.cpp
index 0b12e2cb5a..e022d75d84 100644
--- a/engines/wintermute/Base/BSprite.cpp
+++ b/engines/wintermute/Base/BSprite.cpp
@@ -146,7 +146,7 @@ HRESULT CBSprite::loadFile(const char *filename, int lifeTime, TSpriteCacheType
delete frame;
delete subframe;
} else {
- CBPlatform::SetRect(&subframe->_rect, 0, 0, subframe->_surface->getWidth(), subframe->_surface->getHeight());
+ CBPlatform::setRect(&subframe->_rect, 0, 0, subframe->_surface->getWidth(), subframe->_surface->getHeight());
frame->_subframes.Add(subframe);
_frames.Add(frame);
_currentFrame = 0;
@@ -416,13 +416,13 @@ CBSurface *CBSprite::getSurface() {
bool CBSprite::GetBoundingRect(LPRECT rect, int x, int y, float scaleX, float scaleY) {
if (!rect) return false;
- CBPlatform::SetRectEmpty(rect);
+ CBPlatform::setRectEmpty(rect);
for (int i = 0; i < _frames.GetSize(); i++) {
RECT frame;
RECT temp;
- CBPlatform::CopyRect(&temp, rect);
+ CBPlatform::copyRect(&temp, rect);
_frames[i]->getBoundingRect(&frame, x, y, scaleX, scaleY);
- CBPlatform::UnionRect(rect, &temp, &frame);
+ CBPlatform::unionRect(rect, &temp, &frame);
}
return true;
}
diff --git a/engines/wintermute/Base/BSubFrame.cpp b/engines/wintermute/Base/BSubFrame.cpp
index 182a2b0e37..36eb2f4063 100644
--- a/engines/wintermute/Base/BSubFrame.cpp
+++ b/engines/wintermute/Base/BSubFrame.cpp
@@ -49,7 +49,7 @@ CBSubFrame::CBSubFrame(CBGame *inGame): CBScriptable(inGame, true) {
_alpha = 0xFFFFFFFF;
_transparent = 0xFFFF00FF;
- CBPlatform::SetRectEmpty(&_rect);
+ CBPlatform::setRectEmpty(&_rect);
_editorSelected = false;
@@ -114,7 +114,7 @@ HRESULT CBSubFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
int r = 255, g = 255, b = 255;
int ar = 255, ag = 255, ab = 255, alpha = 255;
bool custoTrans = false;
- CBPlatform::SetRectEmpty(&rect);
+ CBPlatform::setRectEmpty(&rect);
char *surfaceFile = NULL;
delete _surface;
@@ -196,7 +196,7 @@ HRESULT CBSubFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
return E_FAIL;
}
*/
- if (CBPlatform::IsRectEmpty(&rect)) setDefaultRect();
+ if (CBPlatform::isRectEmpty(&rect)) setDefaultRect();
else _rect = rect;
return S_OK;
@@ -239,7 +239,7 @@ bool CBSubFrame::getBoundingRect(LPRECT rect, int x, int y, float scaleX, float
float ratioX = scaleX / 100.0f;
float ratioY = scaleY / 100.0f;
- CBPlatform::SetRect(rect,
+ CBPlatform::setRect(rect,
(int)(x - _hotspotX * ratioX),
(int)(y - _hotspotY * ratioY),
(int)(x - _hotspotX * ratioX + (_rect.right - _rect.left) * ratioX),
@@ -260,9 +260,9 @@ HRESULT CBSubFrame::saveAsText(CBDynBuffer *buffer, int indent, bool complete) {
buffer->putTextIndent(indent + 2, "TRANSPARENT { %d,%d,%d }\n", D3DCOLGetR(_transparent), D3DCOLGetG(_transparent), D3DCOLGetB(_transparent));
RECT rect;
- CBPlatform::SetRectEmpty(&rect);
- if (_surface) CBPlatform::SetRect(&rect, 0, 0, _surface->getWidth(), _surface->getHeight());
- if (!CBPlatform::EqualRect(&rect, &_rect))
+ CBPlatform::setRectEmpty(&rect);
+ if (_surface) CBPlatform::setRect(&rect, 0, 0, _surface->getWidth(), _surface->getHeight());
+ if (!CBPlatform::equalRect(&rect, &_rect))
buffer->putTextIndent(indent + 2, "RECT { %d,%d,%d,%d }\n", _rect.left, _rect.top, _rect.right, _rect.bottom);
if (_hotspotX != 0 || _hotspotY != 0)
@@ -304,8 +304,8 @@ HRESULT CBSubFrame::saveAsText(CBDynBuffer *buffer, int indent, bool complete) {
//////////////////////////////////////////////////////////////////////////
void CBSubFrame::setDefaultRect() {
if (_surface) {
- CBPlatform::SetRect(&_rect, 0, 0, _surface->getWidth(), _surface->getHeight());
- } else CBPlatform::SetRectEmpty(&_rect);
+ CBPlatform::setRect(&_rect, 0, 0, _surface->getWidth(), _surface->getHeight());
+ } else CBPlatform::setRectEmpty(&_rect);
}
diff --git a/engines/wintermute/Base/BTransitionMgr.cpp b/engines/wintermute/Base/BTransitionMgr.cpp
index dd20e6b687..f2da9b7351 100644
--- a/engines/wintermute/Base/BTransitionMgr.cpp
+++ b/engines/wintermute/Base/BTransitionMgr.cpp
@@ -87,7 +87,7 @@ HRESULT CBTransitionMgr::update() {
if (!_started) {
_started = true;
- _lastTime = CBPlatform::GetTime();
+ _lastTime = CBPlatform::getTime();
}
switch (_type) {
@@ -96,7 +96,7 @@ HRESULT CBTransitionMgr::update() {
break;
case TRANSITION_FADE_OUT: {
- uint32 time = CBPlatform::GetTime() - _lastTime;
+ uint32 time = CBPlatform::getTime() - _lastTime;
int alpha = (int)(255 - (float)time / (float)FADE_DURATION * 255);
alpha = MIN(255, MAX(alpha, 0));
Game->_renderer->fade((uint16)alpha);
@@ -107,7 +107,7 @@ HRESULT CBTransitionMgr::update() {
break;
case TRANSITION_FADE_IN: {
- uint32 time = CBPlatform::GetTime() - _lastTime;
+ uint32 time = CBPlatform::getTime() - _lastTime;
int alpha = (int)((float)time / (float)FADE_DURATION * 255);
alpha = MIN(255, MAX(alpha, 0));
Game->_renderer->fade((uint16)alpha);
diff --git a/engines/wintermute/Base/BViewport.cpp b/engines/wintermute/Base/BViewport.cpp
index 8292f5e145..64e138cb33 100644
--- a/engines/wintermute/Base/BViewport.cpp
+++ b/engines/wintermute/Base/BViewport.cpp
@@ -36,7 +36,7 @@ IMPLEMENT_PERSISTENT(CBViewport, false)
//////////////////////////////////////////////////////////////////////////
CBViewport::CBViewport(CBGame *inGame): CBBase(inGame) {
- CBPlatform::SetRectEmpty(&_rect);
+ CBPlatform::setRectEmpty(&_rect);
_mainObject = NULL;
_offsetX = _offsetY = 0;
}
@@ -71,7 +71,7 @@ HRESULT CBViewport::setRect(int left, int top, int right, int bottom, bool noChe
bottom = MIN(bottom, Game->_renderer->_height);
}
- CBPlatform::SetRect(&_rect, left, top, right, bottom);
+ CBPlatform::setRect(&_rect, left, top, right, bottom);
_offsetX = left;
_offsetY = top;
return S_OK;
diff --git a/engines/wintermute/Base/PartEmitter.cpp b/engines/wintermute/Base/PartEmitter.cpp
index d3d7843f57..ca19651ac9 100644
--- a/engines/wintermute/Base/PartEmitter.cpp
+++ b/engines/wintermute/Base/PartEmitter.cpp
@@ -49,7 +49,7 @@ IMPLEMENT_PERSISTENT(CPartEmitter, false)
CPartEmitter::CPartEmitter(CBGame *inGame, CBScriptHolder *Owner) : CBObject(inGame) {
_width = _height = 0;
- CBPlatform::SetRectEmpty(&_border);
+ CBPlatform::setRectEmpty(&_border);
_borderThicknessLeft = _borderThicknessRight = _borderThicknessTop = _borderThicknessBottom = 0;
_angle1 = _angle2 = 0;
@@ -178,7 +178,7 @@ HRESULT CPartEmitter::initParticle(CPartParticle *particle, uint32 currentTime,
float angVelocity = CBUtils::randomFloat(_angVelocity1, _angVelocity2);
float growthRate = CBUtils::randomFloat(_growthRate1, _growthRate2);
- if (!CBPlatform::IsRectEmpty(&_border)) {
+ if (!CBPlatform::isRectEmpty(&_border)) {
int thicknessLeft = (int)(_borderThicknessLeft - (float)_borderThicknessLeft * posZ / 100.0f);
int thicknessRight = (int)(_borderThicknessRight - (float)_borderThicknessRight * posZ / 100.0f);
int thicknessTop = (int)(_borderThicknessTop - (float)_borderThicknessTop * posZ / 100.0f);
@@ -347,7 +347,7 @@ int CPartEmitter::compareZ(const void *obj1, const void *obj2) {
//////////////////////////////////////////////////////////////////////////
HRESULT CPartEmitter::setBorder(int x, int y, int width, int height) {
- CBPlatform::SetRect(&_border, x, y, x + width, y + height);
+ CBPlatform::setRect(&_border, x, y, x + width, y + height);
return S_OK;
}
diff --git a/engines/wintermute/Base/PartParticle.cpp b/engines/wintermute/Base/PartParticle.cpp
index 956c9bf2df..f69446f36f 100644
--- a/engines/wintermute/Base/PartParticle.cpp
+++ b/engines/wintermute/Base/PartParticle.cpp
@@ -48,7 +48,7 @@ CPartParticle::CPartParticle(CBGame *inGame) : CBBase(inGame) {
_creationTime = 0;
_lifeTime = 0;
_isDead = true;
- CBPlatform::SetRectEmpty(&_border);
+ CBPlatform::setRectEmpty(&_border);
_state = PARTICLE_NORMAL;
_fadeStart = 0;
@@ -123,11 +123,11 @@ HRESULT CPartParticle::update(CPartEmitter *emitter, uint32 currentTime, uint32
}
// particle hit the border
- if (!_isDead && !CBPlatform::IsRectEmpty(&_border)) {
+ if (!_isDead && !CBPlatform::isRectEmpty(&_border)) {
POINT p;
p.x = (int32)_pos.x;
p.y = (int32)_pos.y;
- if (!CBPlatform::PtInRect(&_border, p))
+ if (!CBPlatform::ptInRect(&_border, p))
fadeOut(currentTime, emitter->_fadeOutTime);
}
if (_state != PARTICLE_NORMAL) return S_OK;
diff --git a/engines/wintermute/Base/scriptables/SXFile.cpp b/engines/wintermute/Base/scriptables/SXFile.cpp
index b29c82853b..83e9302678 100644
--- a/engines/wintermute/Base/scriptables/SXFile.cpp
+++ b/engines/wintermute/Base/scriptables/SXFile.cpp
@@ -187,7 +187,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
else if (strcmp(name, "Delete") == 0) {
stack->correctParams(0);
close();
- stack->pushBool(CBPlatform::DeleteFile(_filename) != false);
+ stack->pushBool(CBPlatform::deleteFile(_filename) != false);
return S_OK;
}
@@ -200,7 +200,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
bool Overwrite = stack->pop()->getBool(true);
close();
- stack->pushBool(CBPlatform::CopyFile(_filename, Dest, !Overwrite) != false);
+ stack->pushBool(CBPlatform::copyFile(_filename, Dest, !Overwrite) != false);
return S_OK;
}
diff --git a/engines/wintermute/Base/scriptables/ScEngine.cpp b/engines/wintermute/Base/scriptables/ScEngine.cpp
index b70f04f568..9b51cb2fe2 100644
--- a/engines/wintermute/Base/scriptables/ScEngine.cpp
+++ b/engines/wintermute/Base/scriptables/ScEngine.cpp
@@ -218,7 +218,7 @@ byte *CScEngine::getCompiledScript(const char *filename, uint32 *outSize, bool i
if (!ignoreCache) {
for (int i = 0; i < MAX_CACHED_SCRIPTS; i++) {
if (_cachedScripts[i] && scumm_stricmp(_cachedScripts[i]->_filename.c_str(), filename) == 0) {
- _cachedScripts[i]->_timestamp = CBPlatform::GetTime();
+ _cachedScripts[i]->_timestamp = CBPlatform::getTime();
*outSize = _cachedScripts[i]->_size;
return _cachedScripts[i]->_buffer;
}
@@ -259,7 +259,7 @@ byte *CScEngine::getCompiledScript(const char *filename, uint32 *outSize, bool i
CScCachedScript *cachedScript = new CScCachedScript(filename, compBuffer, compSize);
if (cachedScript) {
int index = 0;
- uint32 MinTime = CBPlatform::GetTime();
+ uint32 MinTime = CBPlatform::getTime();
for (int i = 0; i < MAX_CACHED_SCRIPTS; i++) {
if (_cachedScripts[i] == NULL) {
index = i;
@@ -320,7 +320,7 @@ HRESULT CScEngine::tick() {
case SCRIPT_SLEEPING: {
if (_scripts[i]->_waitFrozen) {
- if (_scripts[i]->_waitTime <= CBPlatform::GetTime()) _scripts[i]->run();
+ if (_scripts[i]->_waitTime <= CBPlatform::getTime()) _scripts[i]->run();
} else {
if (_scripts[i]->_waitTime <= Game->_timer) _scripts[i]->run();
}
@@ -359,25 +359,25 @@ HRESULT CScEngine::tick() {
// time sliced script
if (_scripts[i]->_timeSlice > 0) {
- uint32 StartTime = CBPlatform::GetTime();
- while (_scripts[i]->_state == SCRIPT_RUNNING && CBPlatform::GetTime() - StartTime < _scripts[i]->_timeSlice) {
+ uint32 StartTime = CBPlatform::getTime();
+ while (_scripts[i]->_state == SCRIPT_RUNNING && CBPlatform::getTime() - StartTime < _scripts[i]->_timeSlice) {
_currentScript = _scripts[i];
_scripts[i]->executeInstruction();
}
- if (_isProfiling && _scripts[i]->_filename) addScriptTime(_scripts[i]->_filename, CBPlatform::GetTime() - StartTime);
+ if (_isProfiling && _scripts[i]->_filename) addScriptTime(_scripts[i]->_filename, CBPlatform::getTime() - StartTime);
}
// normal script
else {
uint32 StartTime = 0;
bool isProfiling = _isProfiling;
- if (isProfiling) StartTime = CBPlatform::GetTime();
+ if (isProfiling) StartTime = CBPlatform::getTime();
while (_scripts[i]->_state == SCRIPT_RUNNING) {
_currentScript = _scripts[i];
_scripts[i]->executeInstruction();
}
- if (isProfiling && _scripts[i]->_filename) addScriptTime(_scripts[i]->_filename, CBPlatform::GetTime() - StartTime);
+ if (isProfiling && _scripts[i]->_filename) addScriptTime(_scripts[i]->_filename, CBPlatform::getTime() - StartTime);
}
_currentScript = NULL;
}
@@ -740,7 +740,7 @@ void CScEngine::enableProfiling() {
// destroy old data, if any
_scriptTimes.clear();
- _profilingStartTime = CBPlatform::GetTime();
+ _profilingStartTime = CBPlatform::getTime();
_isProfiling = true;
}
@@ -757,7 +757,7 @@ void CScEngine::disableProfiling() {
//////////////////////////////////////////////////////////////////////////
void CScEngine::dumpStats() {
error("DumpStats not ported to ScummVM yet");
- /* uint32 totalTime = CBPlatform::GetTime() - _profilingStartTime;
+ /* uint32 totalTime = CBPlatform::getTime() - _profilingStartTime;
typedef std::vector <std::pair<uint32, std::string> > TimeVector;
TimeVector times;
diff --git a/engines/wintermute/Base/scriptables/ScEngine.h b/engines/wintermute/Base/scriptables/ScEngine.h
index 479c77a77a..6b290e4e94 100644
--- a/engines/wintermute/Base/scriptables/ScEngine.h
+++ b/engines/wintermute/Base/scriptables/ScEngine.h
@@ -58,7 +58,7 @@ public:
class CScCachedScript {
public:
CScCachedScript(const char *filename, byte *buffer, uint32 size) {
- _timestamp = CBPlatform::GetTime();
+ _timestamp = CBPlatform::getTime();
_buffer = new byte[size];
if (_buffer) memcpy(_buffer, buffer, size);
_size = size;
diff --git a/engines/wintermute/Base/scriptables/ScScript.cpp b/engines/wintermute/Base/scriptables/ScScript.cpp
index 6c7f7d0a05..180d3d884b 100644
--- a/engines/wintermute/Base/scriptables/ScScript.cpp
+++ b/engines/wintermute/Base/scriptables/ScScript.cpp
@@ -1148,7 +1148,7 @@ HRESULT CScScript::sleep(uint32 duration) {
_state = SCRIPT_SLEEPING;
if (Game->_state == GAME_FROZEN) {
- _waitTime = CBPlatform::GetTime() + duration;
+ _waitTime = CBPlatform::getTime() + duration;
_waitFrozen = true;
} else {
_waitTime = Game->_timer + duration;
diff --git a/engines/wintermute/PlatformSDL.cpp b/engines/wintermute/PlatformSDL.cpp
index ff839bb637..b31c825244 100644
--- a/engines/wintermute/PlatformSDL.cpp
+++ b/engines/wintermute/PlatformSDL.cpp
@@ -43,13 +43,13 @@ namespace WinterMute {
CBGame *CBPlatform::Game = NULL;
#define CLASS_NAME "GF_FRAME"
-int CBPlatform::Initialize(CBGame *inGame, int argc, char *argv[]) {
+int CBPlatform::initialize(CBGame *inGame, int argc, char *argv[]) {
Game = inGame;
return true;
}
//////////////////////////////////////////////////////////////////////////
-void CBPlatform::HandleEvent(Common::Event *event) {
+void CBPlatform::handleEvent(Common::Event *event) {
switch (event->type) {
case Common::EVENT_LBUTTONDOWN:
@@ -166,12 +166,7 @@ int CBPlatform::SDLEventWatcher(void *userdata, Common::Event *event) {
//////////////////////////////////////////////////////////////////////////
// Win32 API bindings
//////////////////////////////////////////////////////////////////////////
-HINSTANCE CBPlatform::ShellExecute(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, int nShowCmd) {
- return 0;
-}
-
-//////////////////////////////////////////////////////////////////////////
-void CBPlatform::OutputDebugString(LPCSTR lpOutputString) {
+void CBPlatform::outputDebugString(LPCSTR lpOutputString) {
/*
#ifdef __WIN32__
::OutputDebugString(lpOutputString);
@@ -181,12 +176,12 @@ void CBPlatform::OutputDebugString(LPCSTR lpOutputString) {
//////////////////////////////////////////////////////////////////////////
-uint32 CBPlatform::GetTime() {
+uint32 CBPlatform::getTime() {
return g_system->getMillis();
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::GetCursorPos(LPPOINT lpPoint) {
+bool CBPlatform::getCursorPos(LPPOINT lpPoint) {
CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer);
Common::Point p = g_system->getEventManager()->getMousePos();
@@ -199,7 +194,7 @@ bool CBPlatform::GetCursorPos(LPPOINT lpPoint) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::SetCursorPos(int X, int Y) {
+bool CBPlatform::setCursorPos(int X, int Y) {
CBRenderSDL *renderer = static_cast<CBRenderSDL *>(Game->_renderer);
POINT p;
@@ -212,19 +207,19 @@ bool CBPlatform::SetCursorPos(int X, int Y) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::ShowWindow(HWND hWnd, int nCmdShow) {
+bool CBPlatform::showWindow(HWND hWnd, int nCmdShow) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::DeleteFile(const char *lpFileName) {
+bool CBPlatform::deleteFile(const char *lpFileName) {
return remove(lpFileName) ? true : false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::CopyFile(const char *from, const char *to, bool failIfExists) {
+bool CBPlatform::copyFile(const char *from, const char *to, bool failIfExists) {
// try {
- warning("CBPlatform::CopyFile(%s, %s, %d) - not implemented", from, to, failIfExists);
+ warning("CBPlatform::copyFile(%s, %s, %d) - not implemented", from, to, failIfExists);
return false;
// if (failIfExists && boost::filesystem::exists(to)) return false;
// boost::filesystem::copy_file(from, to);
@@ -235,38 +230,38 @@ bool CBPlatform::CopyFile(const char *from, const char *to, bool failIfExists) {
}
//////////////////////////////////////////////////////////////////////////
-HWND CBPlatform::SetCapture(HWND hWnd) {
+HWND CBPlatform::setCapture(HWND hWnd) {
return 0;
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::ReleaseCapture() {
+bool CBPlatform::releaseCapture() {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::SetForegroundWindow(HWND hWnd) {
+bool CBPlatform::setForegroundWindow(HWND hWnd) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::SetRectEmpty(LPRECT lprc) {
+bool CBPlatform::setRectEmpty(LPRECT lprc) {
lprc->left = lprc->right = lprc->top = lprc->bottom = 0;
return true;
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::IsRectEmpty(const LPRECT lprc) {
+bool CBPlatform::isRectEmpty(const LPRECT lprc) {
return (lprc->left >= lprc->right) || (lprc->top >= lprc->bottom);
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::PtInRect(LPRECT lprc, POINT p) {
+bool CBPlatform::ptInRect(LPRECT lprc, 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(LPRECT lprc, int left, int top, int right, int bottom) {
lprc->left = left;
lprc->top = top;
lprc->right = right;
@@ -276,11 +271,11 @@ bool CBPlatform::SetRect(LPRECT lprc, int left, int top, int right, int bottom)
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::IntersectRect(LPRECT lprcDst, const LPRECT lprcSrc1, const LPRECT lprcSrc2) {
- if (IsRectEmpty(lprcSrc1) || IsRectEmpty(lprcSrc2) ||
+bool CBPlatform::intersectRect(LPRECT lprcDst, const LPRECT lprcSrc1, const LPRECT lprcSrc2) {
+ if (isRectEmpty(lprcSrc1) || isRectEmpty(lprcSrc2) ||
lprcSrc1->left >= lprcSrc2->right || lprcSrc2->left >= lprcSrc1->right ||
lprcSrc1->top >= lprcSrc2->bottom || lprcSrc2->top >= lprcSrc1->bottom) {
- SetRectEmpty(lprcDst);
+ setRectEmpty(lprcDst);
return false;
}
lprcDst->left = MAX(lprcSrc1->left, lprcSrc2->left);
@@ -292,16 +287,16 @@ bool CBPlatform::IntersectRect(LPRECT lprcDst, const LPRECT lprcSrc1, const LPRE
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::UnionRect(LPRECT lprcDst, RECT *lprcSrc1, RECT *lprcSrc2) {
- if (IsRectEmpty(lprcSrc1)) {
- if (IsRectEmpty(lprcSrc2)) {
- SetRectEmpty(lprcDst);
+bool CBPlatform::unionRect(LPRECT lprcDst, RECT *lprcSrc1, RECT *lprcSrc2) {
+ if (isRectEmpty(lprcSrc1)) {
+ if (isRectEmpty(lprcSrc2)) {
+ setRectEmpty(lprcDst);
return false;
} else {
*lprcDst = *lprcSrc2;
}
} else {
- if (IsRectEmpty(lprcSrc2)) {
+ if (isRectEmpty(lprcSrc2)) {
*lprcDst = *lprcSrc1;
} else {
lprcDst->left = MIN(lprcSrc1->left, lprcSrc2->left);
@@ -315,7 +310,7 @@ bool CBPlatform::UnionRect(LPRECT lprcDst, RECT *lprcSrc1, RECT *lprcSrc2) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::CopyRect(LPRECT lprcDst, RECT *lprcSrc) {
+bool CBPlatform::copyRect(LPRECT lprcDst, RECT *lprcSrc) {
if (lprcDst == NULL || lprcSrc == NULL) return false;
*lprcDst = *lprcSrc;
@@ -323,7 +318,7 @@ bool CBPlatform::CopyRect(LPRECT lprcDst, RECT *lprcSrc) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::OffsetRect(LPRECT lprc, int dx, int dy) {
+bool CBPlatform::offsetRect(LPRECT lprc, int dx, int dy) {
if (lprc == NULL) return false;
lprc->left += dx;
@@ -335,13 +330,13 @@ bool CBPlatform::OffsetRect(LPRECT lprc, int dx, int dy) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBPlatform::EqualRect(LPRECT rect1, LPRECT rect2) {
+bool CBPlatform::equalRect(LPRECT rect1, LPRECT rect2) {
return rect1->left == rect2->left && rect1->right == rect2->right && rect1->top == rect2->top && rect1->bottom == rect2->bottom;
}
//////////////////////////////////////////////////////////////////////////
-AnsiString CBPlatform::GetSystemFontPath() {
+AnsiString CBPlatform::getSystemFontPath() {
#ifdef __WIN32__
// we're looking for something like "c:\windows\fonts\";
char winDir[MAX_PATH + 1];
@@ -356,7 +351,7 @@ AnsiString CBPlatform::GetSystemFontPath() {
}
//////////////////////////////////////////////////////////////////////////
-AnsiString CBPlatform::GetPlatformName() {
+AnsiString CBPlatform::getPlatformName() {
// TODO: Should conform to the WME-spec.
//return AnsiString(SDL_GetPlatform());
return AnsiString("ScummVM");
diff --git a/engines/wintermute/PlatformSDL.h b/engines/wintermute/PlatformSDL.h
index 6adba29ae8..9b567c8b30 100644
--- a/engines/wintermute/PlatformSDL.h
+++ b/engines/wintermute/PlatformSDL.h
@@ -41,34 +41,33 @@ class CBGame;
//////////////////////////////////////////////////////////////////////////
class CBPlatform {
public:
- static int Initialize(CBGame *inGame, int argc, char *argv[]);
- static void HandleEvent(Common::Event *event);
+ static int initialize(CBGame *inGame, int argc, char *argv[]);
+ static void handleEvent(Common::Event *event);
- static AnsiString GetSystemFontPath();
- static AnsiString GetPlatformName();
+ static AnsiString getSystemFontPath();
+ static AnsiString getPlatformName();
// Win32 API bindings
- static HINSTANCE ShellExecute(HWND hwnd, LPCSTR lpOperation, LPCSTR lpFile, LPCSTR lpParameters, LPCSTR lpDirectory, int nShowCmd);
- static void OutputDebugString(LPCSTR lpOutputString);
- static uint32 GetTime();
- static bool GetCursorPos(LPPOINT lpPoint);
- static bool SetCursorPos(int X, int Y);
- static bool ShowWindow(HWND hWnd, int nCmdShow);
- static bool DeleteFile(const char *lpFileName);
- static bool CopyFile(const char *from, const char *to, bool failIfExists);
- static HWND SetCapture(HWND hWnd);
- static bool ReleaseCapture();
- static bool SetForegroundWindow(HWND hWnd);
-
- 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 void outputDebugString(LPCSTR lpOutputString);
+ static uint32 getTime();
+ static bool getCursorPos(LPPOINT lpPoint);
+ static bool setCursorPos(int X, int Y);
+ static bool showWindow(HWND hWnd, int nCmdShow);
+ static bool deleteFile(const char *lpFileName);
+ static bool copyFile(const char *from, const char *to, bool failIfExists);
+ static HWND setCapture(HWND hWnd);
+ static bool releaseCapture();
+ static bool setForegroundWindow(HWND hWnd);
+
+ 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);
// string functions
diff --git a/engines/wintermute/Sys/SysClassRegistry.cpp b/engines/wintermute/Sys/SysClassRegistry.cpp
index d9441c20e4..59528f13f1 100644
--- a/engines/wintermute/Sys/SysClassRegistry.cpp
+++ b/engines/wintermute/Sys/SysClassRegistry.cpp
@@ -80,7 +80,7 @@ bool CSysClassRegistry::unregisterClass(CSysClass *classObj) {
if (classObj->getNumInstances() != 0) {
char str[MAX_PATH];
sprintf(str, "Memory leak@class %-20s: %d instance(s) left\n", classObj->getName().c_str(), classObj->getNumInstances());
- CBPlatform::OutputDebugString(str);
+ CBPlatform::outputDebugString(str);
}
_classes.erase(it);
diff --git a/engines/wintermute/UI/UIButton.cpp b/engines/wintermute/UI/UIButton.cpp
index b5f22b29fc..ce432d8f4a 100644
--- a/engines/wintermute/UI/UIButton.cpp
+++ b/engines/wintermute/UI/UIButton.cpp
@@ -586,12 +586,12 @@ HRESULT CUIButton::display(int offsetX, int offsetY) {
CBFont *font = 0;
//RECT rect;
- //CBPlatform::SetRect(&rect, OffsetX + _posX, OffsetY + _posY, OffsetX+_posX+_width, OffsetY+_posY+_height);
- //_hover = (!_disable && CBPlatform::PtInRect(&rect, Game->_mousePos)!=FALSE);
+ //CBPlatform::setRect(&rect, OffsetX + _posX, OffsetY + _posY, OffsetX+_posX+_width, OffsetY+_posY+_height);
+ //_hover = (!_disable && CBPlatform::ptInRect(&rect, Game->_mousePos)!=FALSE);
_hover = (!_disable && Game->_activeObject == this && (Game->_interactive || Game->_state == GAME_SEMI_FROZEN));
if ((_press && _hover && !Game->_mouseLeftDown) ||
- (_oneTimePress && CBPlatform::GetTime() - _oneTimePressTime >= 100)) press();
+ (_oneTimePress && CBPlatform::getTime() - _oneTimePressTime >= 100)) press();
if (_disable) {
@@ -908,7 +908,7 @@ HRESULT CUIButton::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
if (_visible && !_disable) {
_oneTimePress = true;
- _oneTimePressTime = CBPlatform::GetTime();
+ _oneTimePressTime = CBPlatform::getTime();
}
stack->pushNULL();
diff --git a/engines/wintermute/UI/UIEdit.cpp b/engines/wintermute/UI/UIEdit.cpp
index c1971b342d..0aac35a366 100644
--- a/engines/wintermute/UI/UIEdit.cpp
+++ b/engines/wintermute/UI/UIEdit.cpp
@@ -633,8 +633,8 @@ HRESULT CUIEdit::display(int offsetX, int offsetY) {
// cursor
if (focused && curFirst) {
if (Count) {
- if (CBPlatform::GetTime() - _lastBlinkTime >= _cursorBlinkRate) {
- _lastBlinkTime = CBPlatform::GetTime();
+ if (CBPlatform::getTime() - _lastBlinkTime >= _cursorBlinkRate) {
+ _lastBlinkTime = CBPlatform::getTime();
_cursorVisible = !_cursorVisible;
}
if (_cursorVisible)
@@ -656,8 +656,8 @@ HRESULT CUIEdit::display(int offsetX, int offsetY) {
// cursor
if (focused && !curFirst) {
if (Count) {
- if (CBPlatform::GetTime() - _lastBlinkTime >= _cursorBlinkRate) {
- _lastBlinkTime = CBPlatform::GetTime();
+ if (CBPlatform::getTime() - _lastBlinkTime >= _cursorBlinkRate) {
+ _lastBlinkTime = CBPlatform::getTime();
_cursorVisible = !_cursorVisible;
}
if (_cursorVisible)
diff --git a/engines/wintermute/UI/UITiledImage.cpp b/engines/wintermute/UI/UITiledImage.cpp
index 05426bd01c..4b115c98e3 100644
--- a/engines/wintermute/UI/UITiledImage.cpp
+++ b/engines/wintermute/UI/UITiledImage.cpp
@@ -44,15 +44,15 @@ IMPLEMENT_PERSISTENT(CUITiledImage, false)
CUITiledImage::CUITiledImage(CBGame *inGame): CBObject(inGame) {
_image = NULL;
- CBPlatform::SetRectEmpty(&_upLeft);
- CBPlatform::SetRectEmpty(&_upMiddle);
- CBPlatform::SetRectEmpty(&_upRight);
- CBPlatform::SetRectEmpty(&_middleLeft);
- CBPlatform::SetRectEmpty(&_middleMiddle);
- CBPlatform::SetRectEmpty(&_middleRight);
- CBPlatform::SetRectEmpty(&_downLeft);
- CBPlatform::SetRectEmpty(&_downMiddle);
- CBPlatform::SetRectEmpty(&_downRight);
+ CBPlatform::setRectEmpty(&_upLeft);
+ CBPlatform::setRectEmpty(&_upMiddle);
+ CBPlatform::setRectEmpty(&_upRight);
+ CBPlatform::setRectEmpty(&_middleLeft);
+ CBPlatform::setRectEmpty(&_middleMiddle);
+ CBPlatform::setRectEmpty(&_middleRight);
+ CBPlatform::setRectEmpty(&_downLeft);
+ CBPlatform::setRectEmpty(&_downMiddle);
+ CBPlatform::setRectEmpty(&_downRight);
}
@@ -270,19 +270,19 @@ HRESULT CUITiledImage::loadBuffer(byte *buffer, bool complete) {
if (vTiles && hTiles) {
// up row
- CBPlatform::SetRect(&_upLeft, 0, 0, h1, v1);
- CBPlatform::SetRect(&_upMiddle, h1, 0, h1 + h2, v1);
- CBPlatform::SetRect(&_upRight, h1 + h2, 0, h1 + h2 + h3, v1);
+ CBPlatform::setRect(&_upLeft, 0, 0, h1, v1);
+ CBPlatform::setRect(&_upMiddle, h1, 0, h1 + h2, v1);
+ CBPlatform::setRect(&_upRight, h1 + h2, 0, h1 + h2 + h3, v1);
// middle row
- CBPlatform::SetRect(&_middleLeft, 0, v1, h1, v1 + v2);
- CBPlatform::SetRect(&_middleMiddle, h1, v1, h1 + h2, v1 + v2);
- CBPlatform::SetRect(&_middleRight, h1 + h2, v1, h1 + h2 + h3, v1 + v2);
+ CBPlatform::setRect(&_middleLeft, 0, v1, h1, v1 + v2);
+ CBPlatform::setRect(&_middleMiddle, h1, v1, h1 + h2, v1 + v2);
+ CBPlatform::setRect(&_middleRight, h1 + h2, v1, h1 + h2 + h3, v1 + v2);
// down row
- CBPlatform::SetRect(&_downLeft, 0, v1 + v2, h1, v1 + v2 + v3);
- CBPlatform::SetRect(&_downMiddle, h1, v1 + v2, h1 + h2, v1 + v2 + v3);
- CBPlatform::SetRect(&_downRight, h1 + h2, v1 + v2, h1 + h2 + h3, v1 + v2 + v3);
+ CBPlatform::setRect(&_downLeft, 0, v1 + v2, h1, v1 + v2 + v3);
+ CBPlatform::setRect(&_downMiddle, h1, v1 + v2, h1 + h2, v1 + v2 + v3);
+ CBPlatform::setRect(&_downRight, h1 + h2, v1 + v2, h1 + h2 + h3, v1 + v2 + v3);
}
// default
@@ -290,17 +290,17 @@ HRESULT CUITiledImage::loadBuffer(byte *buffer, bool complete) {
int width = _image->_surface->getWidth() / 3;
int height = _image->_surface->getHeight() / 3;
- if (CBPlatform::IsRectEmpty(&_upLeft)) CBPlatform::SetRect(&_upLeft, 0, 0, width, height);
- if (CBPlatform::IsRectEmpty(&_upMiddle)) CBPlatform::SetRect(&_upMiddle, width, 0, 2 * width, height);
- if (CBPlatform::IsRectEmpty(&_upRight)) CBPlatform::SetRect(&_upRight, 2 * width, 0, 3 * width, height);
+ if (CBPlatform::isRectEmpty(&_upLeft)) CBPlatform::setRect(&_upLeft, 0, 0, width, height);
+ if (CBPlatform::isRectEmpty(&_upMiddle)) CBPlatform::setRect(&_upMiddle, width, 0, 2 * width, height);
+ if (CBPlatform::isRectEmpty(&_upRight)) CBPlatform::setRect(&_upRight, 2 * width, 0, 3 * width, height);
- if (CBPlatform::IsRectEmpty(&_middleLeft)) CBPlatform::SetRect(&_middleLeft, 0, height, width, 2 * height);
- if (CBPlatform::IsRectEmpty(&_middleMiddle)) CBPlatform::SetRect(&_middleMiddle, width, height, 2 * width, 2 * height);
- if (CBPlatform::IsRectEmpty(&_middleRight)) CBPlatform::SetRect(&_middleRight, 2 * width, height, 3 * width, 2 * height);
+ if (CBPlatform::isRectEmpty(&_middleLeft)) CBPlatform::setRect(&_middleLeft, 0, height, width, 2 * height);
+ if (CBPlatform::isRectEmpty(&_middleMiddle)) CBPlatform::setRect(&_middleMiddle, width, height, 2 * width, 2 * height);
+ if (CBPlatform::isRectEmpty(&_middleRight)) CBPlatform::setRect(&_middleRight, 2 * width, height, 3 * width, 2 * height);
- if (CBPlatform::IsRectEmpty(&_downLeft)) CBPlatform::SetRect(&_downLeft, 0, 2 * height, width, 3 * height);
- if (CBPlatform::IsRectEmpty(&_downMiddle)) CBPlatform::SetRect(&_downMiddle, width, 2 * height, 2 * width, 3 * height);
- if (CBPlatform::IsRectEmpty(&_downRight)) CBPlatform::SetRect(&_downRight, 2 * width, 2 * height, 3 * width, 3 * height);
+ if (CBPlatform::isRectEmpty(&_downLeft)) CBPlatform::setRect(&_downLeft, 0, 2 * height, width, 3 * height);
+ if (CBPlatform::isRectEmpty(&_downMiddle)) CBPlatform::setRect(&_downMiddle, width, 2 * height, 2 * width, 3 * height);
+ if (CBPlatform::isRectEmpty(&_downRight)) CBPlatform::setRect(&_downRight, 2 * width, 2 * height, 3 * width, 3 * height);
}
return S_OK;
diff --git a/engines/wintermute/UI/UIWindow.cpp b/engines/wintermute/UI/UIWindow.cpp
index 5d1bf05bfb..c93a00402b 100644
--- a/engines/wintermute/UI/UIWindow.cpp
+++ b/engines/wintermute/UI/UIWindow.cpp
@@ -54,8 +54,8 @@ IMPLEMENT_PERSISTENT(CUIWindow, false)
//////////////////////////////////////////////////////////////////////////
CUIWindow::CUIWindow(CBGame *inGame): CUIObject(inGame) {
- CBPlatform::SetRectEmpty(&_titleRect);
- CBPlatform::SetRectEmpty(&_dragRect);
+ CBPlatform::setRectEmpty(&_titleRect);
+ CBPlatform::setRectEmpty(&_dragRect);
_titleAlign = TAL_LEFT;
_transparent = false;
@@ -185,7 +185,7 @@ HRESULT CUIWindow::display(int offsetX, int offsetY) {
if (image)
image->draw(_posX + offsetX, _posY + offsetY, _transparent ? NULL : this);
- if (!CBPlatform::IsRectEmpty(&_titleRect) && font && _text) {
+ if (!CBPlatform::isRectEmpty(&_titleRect) && font && _text) {
font->drawText((byte *)_text, _posX + offsetX + _titleRect.left, _posY + offsetY + _titleRect.top, _titleRect.right - _titleRect.left, _titleAlign, _titleRect.bottom - _titleRect.top);
}
@@ -621,11 +621,11 @@ HRESULT CUIWindow::saveAsText(CBDynBuffer *buffer, int indent) {
error("UIWindow::SaveAsText - Unhandled enum-value NUM_TEXT_ALIGN");
}
- if (!CBPlatform::IsRectEmpty(&_titleRect)) {
+ if (!CBPlatform::isRectEmpty(&_titleRect)) {
buffer->putTextIndent(indent + 2, "TITLE_RECT { %d, %d, %d, %d }\n", _titleRect.left, _titleRect.top, _titleRect.right, _titleRect.bottom);
}
- if (!CBPlatform::IsRectEmpty(&_dragRect)) {
+ if (!CBPlatform::isRectEmpty(&_dragRect)) {
buffer->putTextIndent(indent + 2, "DRAG_RECT { %d, %d, %d, %d }\n", _dragRect.left, _dragRect.top, _dragRect.right, _dragRect.bottom);
}
@@ -1132,15 +1132,15 @@ HRESULT CUIWindow::handleMouse(TMouseEvent event, TMouseButton button) {
HRESULT res = CUIObject::handleMouse(event, button);
// handle window dragging
- if (!CBPlatform::IsRectEmpty(&_dragRect)) {
+ if (!CBPlatform::isRectEmpty(&_dragRect)) {
// start drag
if (event == MOUSE_CLICK && button == MOUSE_BUTTON_LEFT) {
RECT dragRect = _dragRect;
int offsetX, offsetY;
getTotalOffset(&offsetX, &offsetY);
- CBPlatform::OffsetRect(&dragRect, _posX + offsetX, _posY + offsetY);
+ CBPlatform::offsetRect(&dragRect, _posX + offsetX, _posY + offsetY);
- if (CBPlatform::PtInRect(&dragRect, Game->_mousePos)) {
+ if (CBPlatform::ptInRect(&dragRect, Game->_mousePos)) {
_dragFrom.x = Game->_mousePos.x;
_dragFrom.y = Game->_mousePos.y;
_dragging = true;
diff --git a/engines/wintermute/video/VidTheoraPlayer.cpp b/engines/wintermute/video/VidTheoraPlayer.cpp
index b8a9886105..f1c3de9283 100644
--- a/engines/wintermute/video/VidTheoraPlayer.cpp
+++ b/engines/wintermute/video/VidTheoraPlayer.cpp
@@ -656,7 +656,7 @@ HRESULT CVidTheoraPlayer::display(uint32 alpha) {
HRESULT res;
if (_texture && _videoFrameReady) {
- CBPlatform::SetRect(&rc, 0, 0, _texture->getWidth(), _texture->getHeight());
+ CBPlatform::setRect(&rc, 0, 0, _texture->getWidth(), _texture->getHeight());
if (_playZoom == 100.0f) res = _texture->displayTrans(_posX, _posY, rc, alpha);
else res = _texture->displayTransZoom(_posX, _posY, rc, _playZoom, _playZoom, alpha);
} else res = E_FAIL;
diff --git a/engines/wintermute/wintermute.cpp b/engines/wintermute/wintermute.cpp
index 4d56b3c69e..2d1f1fdf00 100644
--- a/engines/wintermute/wintermute.cpp
+++ b/engines/wintermute/wintermute.cpp
@@ -142,7 +142,7 @@ int WinterMuteEngine::init() {
_game = new CAdGame;
if (!_game) return 1;
- CBPlatform::Initialize(_game, 0, NULL);
+ CBPlatform::initialize(_game, 0, NULL);
bool windowedMode = !ConfMan.getBool("fullscreen");
@@ -231,7 +231,7 @@ int WinterMuteEngine::init() {
// load game
- uint32 DataInitStart = CBPlatform::GetTime();
+ uint32 DataInitStart = CBPlatform::getTime();
if (FAILED(_game->loadFile(_game->_settingsGameFile ? _game->_settingsGameFile : "default.game"))) {
_game->LOG(ret, "Error loading game file. Exiting.");
@@ -243,7 +243,7 @@ int WinterMuteEngine::init() {
_game->_renderer->_ready = true;
_game->_miniUpdateEnabled = true;
- _game->LOG(0, "Engine initialized in %d ms", CBPlatform::GetTime() - DataInitStart);
+ _game->LOG(0, "Engine initialized in %d ms", CBPlatform::getTime() - DataInitStart);
_game->LOG(0, "");
if (ConfMan.hasKey("save_slot")) {
@@ -273,7 +273,7 @@ int WinterMuteEngine::messageLoop() {
while (!done) {
Common::Event event;
while (_system->getEventManager()->pollEvent(event)) {
- CBPlatform::HandleEvent(&event);
+ CBPlatform::handleEvent(&event);
}
if (_game && _game->_renderer->_active && _game->_renderer->_ready) {