aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/Base
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 /engines/wintermute/Base
parentc4fac37bd0035ac19ab0279941d4f1a2eb118409 (diff)
downloadscummvm-rg350-0273e495e1495d6abbcac4dde4cfa7e6ca2c29d7.tar.gz
scummvm-rg350-0273e495e1495d6abbcac4dde4cfa7e6ca2c29d7.tar.bz2
scummvm-rg350-0273e495e1495d6abbcac4dde4cfa7e6ca2c29d7.zip
WINTERMUTE: Cleanup and rename functions in PlatformSDL.
Diffstat (limited to 'engines/wintermute/Base')
-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
19 files changed, 84 insertions, 84 deletions
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;