aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-03 06:32:19 +0200
committerEinar Johan Trøan Sømåen2012-07-03 06:32:19 +0200
commit370355f85ec1ac55b7a1467899ecfbff788ec1c7 (patch)
tree788aa5db2242a74928895967825364a9afebaa4d /engines
parent2457d3860470a757ccf7f008c5638c6a7b5af1de (diff)
downloadscummvm-rg350-370355f85ec1ac55b7a1467899ecfbff788ec1c7.tar.gz
scummvm-rg350-370355f85ec1ac55b7a1467899ecfbff788ec1c7.tar.bz2
scummvm-rg350-370355f85ec1ac55b7a1467899ecfbff788ec1c7.zip
WINTERMUTE: Rename FuncName->funcName in utils
Diffstat (limited to 'engines')
-rw-r--r--engines/wintermute/Ad/AdEntity.cpp2
-rw-r--r--engines/wintermute/Ad/AdGame.cpp8
-rw-r--r--engines/wintermute/Ad/AdItem.cpp4
-rw-r--r--engines/wintermute/Ad/AdNodeState.cpp6
-rw-r--r--engines/wintermute/Ad/AdResponse.cpp4
-rw-r--r--engines/wintermute/Ad/AdResponseBox.cpp4
-rw-r--r--engines/wintermute/Ad/AdScene.cpp8
-rw-r--r--engines/wintermute/Ad/AdTalkDef.cpp6
-rw-r--r--engines/wintermute/Ad/AdTalkNode.cpp6
-rw-r--r--engines/wintermute/Base/BFileManager.cpp8
-rw-r--r--engines/wintermute/Base/BFontTT.cpp4
-rw-r--r--engines/wintermute/Base/BGame.cpp22
-rw-r--r--engines/wintermute/Base/BRegistry.cpp2
-rw-r--r--engines/wintermute/Base/BSoundBuffer.cpp4
-rw-r--r--engines/wintermute/Base/PartEmitter.cpp30
-rw-r--r--engines/wintermute/Base/PartParticle.cpp2
-rw-r--r--engines/wintermute/Base/scriptables/SXFile.cpp4
-rw-r--r--engines/wintermute/Base/scriptables/SXStore.h14
-rw-r--r--engines/wintermute/Base/scriptables/SXString.cpp2
-rw-r--r--engines/wintermute/Base/scriptables/ScEngine.cpp4
-rw-r--r--engines/wintermute/UI/UIEdit.cpp2
-rw-r--r--engines/wintermute/utils/utils.cpp142
-rw-r--r--engines/wintermute/utils/utils.h30
-rw-r--r--engines/wintermute/video/VidTheoraPlayer.cpp6
24 files changed, 162 insertions, 162 deletions
diff --git a/engines/wintermute/Ad/AdEntity.cpp b/engines/wintermute/Ad/AdEntity.cpp
index 89506045b8..0623327e0a 100644
--- a/engines/wintermute/Ad/AdEntity.cpp
+++ b/engines/wintermute/Ad/AdEntity.cpp
@@ -999,7 +999,7 @@ HRESULT CAdEntity::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
void CAdEntity::setItem(const char *itemName) {
- CBUtils::SetString(&_item, itemName);
+ CBUtils::setString(&_item, itemName);
}
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/wintermute/Ad/AdGame.cpp b/engines/wintermute/Ad/AdGame.cpp
index cd493c9471..901a60ba35 100644
--- a/engines/wintermute/Ad/AdGame.cpp
+++ b/engines/wintermute/Ad/AdGame.cpp
@@ -1037,7 +1037,7 @@ HRESULT CAdGame::scSetProperty(const char *name, CScValue *value) {
if (value == NULL) {
delete[] _startupScene;
_startupScene = NULL;
- } else CBUtils::SetString(&_startupScene, value->getString());
+ } else CBUtils::setString(&_startupScene, value->getString());
return S_OK;
}
@@ -1206,7 +1206,7 @@ HRESULT CAdGame::loadBuffer(byte *Buffer, bool Complete) {
case TOKEN_ITEMS:
ItemsFound = true;
- CBUtils::SetString(&_itemsFile, (char *)params2);
+ CBUtils::setString(&_itemsFile, (char *)params2);
if (FAILED(LoadItemsFile(_itemsFile))) {
delete[] _itemsFile;
_itemsFile = NULL;
@@ -1233,11 +1233,11 @@ HRESULT CAdGame::loadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_STARTUP_SCENE:
- CBUtils::SetString(&_startupScene, (char *)params2);
+ CBUtils::setString(&_startupScene, (char *)params2);
break;
case TOKEN_DEBUG_STARTUP_SCENE:
- CBUtils::SetString(&_debugStartupScene, (char *)params2);
+ CBUtils::setString(&_debugStartupScene, (char *)params2);
break;
}
}
diff --git a/engines/wintermute/Ad/AdItem.cpp b/engines/wintermute/Ad/AdItem.cpp
index a6c990528f..c105478045 100644
--- a/engines/wintermute/Ad/AdItem.cpp
+++ b/engines/wintermute/Ad/AdItem.cpp
@@ -238,7 +238,7 @@ HRESULT CAdItem::loadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_AMOUNT_STRING:
- CBUtils::SetString(&_amountString, (char *)params);
+ CBUtils::setString(&_amountString, (char *)params);
break;
case TOKEN_TALK: {
@@ -705,7 +705,7 @@ HRESULT CAdItem::scSetProperty(const char *name, CScValue *value) {
delete[] _amountString;
_amountString = NULL;
} else {
- CBUtils::SetString(&_amountString, value->getString());
+ CBUtils::setString(&_amountString, value->getString());
}
return S_OK;
}
diff --git a/engines/wintermute/Ad/AdNodeState.cpp b/engines/wintermute/Ad/AdNodeState.cpp
index 611d3f4b83..f732067471 100644
--- a/engines/wintermute/Ad/AdNodeState.cpp
+++ b/engines/wintermute/Ad/AdNodeState.cpp
@@ -71,7 +71,7 @@ CAdNodeState::~CAdNodeState() {
void CAdNodeState::setName(const char *name) {
delete[] _name;
_name = NULL;
- CBUtils::SetString(&_name, name);
+ CBUtils::setString(&_name, name);
}
@@ -79,7 +79,7 @@ void CAdNodeState::setName(const char *name) {
void CAdNodeState::setFilename(const char *Filename) {
delete[] _filename;
_filename = NULL;
- CBUtils::SetString(&_filename, Filename);
+ CBUtils::setString(&_filename, Filename);
}
@@ -87,7 +87,7 @@ void CAdNodeState::setFilename(const char *Filename) {
void CAdNodeState::SetCursor(const char *Filename) {
delete[] _cursor;
_cursor = NULL;
- CBUtils::SetString(&_cursor, Filename);
+ CBUtils::setString(&_cursor, Filename);
}
diff --git a/engines/wintermute/Ad/AdResponse.cpp b/engines/wintermute/Ad/AdResponse.cpp
index 2b1b9efded..36b6ce454a 100644
--- a/engines/wintermute/Ad/AdResponse.cpp
+++ b/engines/wintermute/Ad/AdResponse.cpp
@@ -66,8 +66,8 @@ CAdResponse::~CAdResponse() {
//////////////////////////////////////////////////////////////////////////
void CAdResponse::SetText(const char *Text) {
- CBUtils::SetString(&_text, Text);
- CBUtils::SetString(&_textOrig, Text);
+ CBUtils::setString(&_text, Text);
+ CBUtils::setString(&_textOrig, Text);
}
diff --git a/engines/wintermute/Ad/AdResponseBox.cpp b/engines/wintermute/Ad/AdResponseBox.cpp
index 912022d7dd..b73465590e 100644
--- a/engines/wintermute/Ad/AdResponseBox.cpp
+++ b/engines/wintermute/Ad/AdResponseBox.cpp
@@ -567,8 +567,8 @@ HRESULT CAdResponseBox::weedResponses() {
//////////////////////////////////////////////////////////////////////////
void CAdResponseBox::setLastResponseText(const char *Text, const char *TextOrig) {
- CBUtils::SetString(&_lastResponseText, Text);
- CBUtils::SetString(&_lastResponseTextOrig, TextOrig);
+ CBUtils::setString(&_lastResponseText, Text);
+ CBUtils::setString(&_lastResponseTextOrig, TextOrig);
}
diff --git a/engines/wintermute/Ad/AdScene.cpp b/engines/wintermute/Ad/AdScene.cpp
index 205f7f12a5..2b5aed2777 100644
--- a/engines/wintermute/Ad/AdScene.cpp
+++ b/engines/wintermute/Ad/AdScene.cpp
@@ -409,8 +409,8 @@ int CAdScene::getPointsDist(CBPoint p1, CBPoint p2, CBObject *requester) {
if (xLength > yLength) {
if (X1 > X2) {
- CBUtils::Swap(&X1, &X2);
- CBUtils::Swap(&Y1, &Y2);
+ CBUtils::swap(&X1, &X2);
+ CBUtils::swap(&Y1, &Y2);
}
yStep = (double)(Y2 - Y1) / (double)(X2 - X1);
@@ -422,8 +422,8 @@ int CAdScene::getPointsDist(CBPoint p1, CBPoint p2, CBObject *requester) {
}
} else {
if (Y1 > Y2) {
- CBUtils::Swap(&X1, &X2);
- CBUtils::Swap(&Y1, &Y2);
+ CBUtils::swap(&X1, &X2);
+ CBUtils::swap(&Y1, &Y2);
}
xStep = (double)(X2 - X1) / (double)(Y2 - Y1);
diff --git a/engines/wintermute/Ad/AdTalkDef.cpp b/engines/wintermute/Ad/AdTalkDef.cpp
index 679da816c0..6a1e0a1d15 100644
--- a/engines/wintermute/Ad/AdTalkDef.cpp
+++ b/engines/wintermute/Ad/AdTalkDef.cpp
@@ -78,7 +78,7 @@ HRESULT CAdTalkDef::loadFile(const char *Filename) {
HRESULT ret;
- CBUtils::SetString(&_filename, Filename);
+ CBUtils::setString(&_filename, Filename);
if (FAILED(ret = loadBuffer(Buffer, true))) Game->LOG(0, "Error parsing TALK file '%s'", Filename);
@@ -139,11 +139,11 @@ HRESULT CAdTalkDef::loadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_DEFAULT_SPRITE:
- CBUtils::SetString(&_defaultSpriteFilename, (char *)params);
+ CBUtils::setString(&_defaultSpriteFilename, (char *)params);
break;
case TOKEN_DEFAULT_SPRITESET_FILE:
- CBUtils::SetString(&_defaultSpriteSetFilename, (char *)params);
+ CBUtils::setString(&_defaultSpriteSetFilename, (char *)params);
break;
case TOKEN_DEFAULT_SPRITESET: {
diff --git a/engines/wintermute/Ad/AdTalkNode.cpp b/engines/wintermute/Ad/AdTalkNode.cpp
index 291721662a..8b093922e9 100644
--- a/engines/wintermute/Ad/AdTalkNode.cpp
+++ b/engines/wintermute/Ad/AdTalkNode.cpp
@@ -112,11 +112,11 @@ HRESULT CAdTalkNode::loadBuffer(byte *Buffer, bool Complete) {
while ((cmd = parser.GetCommand((char **)&Buffer, commands, (char **)&params)) > 0) {
switch (cmd) {
case TOKEN_SPRITE:
- CBUtils::SetString(&_spriteFilename, (char *)params);
+ CBUtils::setString(&_spriteFilename, (char *)params);
break;
case TOKEN_SPRITESET_FILE:
- CBUtils::SetString(&_spriteSetFilename, (char *)params);
+ CBUtils::setString(&_spriteSetFilename, (char *)params);
break;
case TOKEN_SPRITESET: {
@@ -143,7 +143,7 @@ HRESULT CAdTalkNode::loadBuffer(byte *Buffer, bool Complete) {
break;
case TOKEN_COMMENT:
- if (Game->_editorMode) CBUtils::SetString(&_comment, (char *)params);
+ if (Game->_editorMode) CBUtils::setString(&_comment, (char *)params);
break;
case TOKEN_EDITOR_PROPERTY:
diff --git a/engines/wintermute/Base/BFileManager.cpp b/engines/wintermute/Base/BFileManager.cpp
index 12167624ae..1fe1c7546a 100644
--- a/engines/wintermute/Base/BFileManager.cpp
+++ b/engines/wintermute/Base/BFileManager.cpp
@@ -287,10 +287,10 @@ HRESULT CBFileManager::initPaths() {
// single files paths
pathList = Game->_registry->ReadString("Resource", "CustomPaths", "");
- numPaths = CBUtils::StrNumEntries(pathList.c_str(), ';');
+ numPaths = CBUtils::strNumEntries(pathList.c_str(), ';');
for (int i = 0; i < numPaths; i++) {
- char *path = CBUtils::StrEntry(i, pathList.c_str(), ';');
+ char *path = CBUtils::strEntry(i, pathList.c_str(), ';');
if (path && strlen(path) > 0) {
addPath(PATH_SINGLE, path);
}
@@ -331,10 +331,10 @@ HRESULT CBFileManager::initPaths() {
pathList = Game->_registry->ReadString("Resource", "PackagePaths", "");
- numPaths = CBUtils::StrNumEntries(pathList.c_str(), ';');
+ numPaths = CBUtils::strNumEntries(pathList.c_str(), ';');
for (int i = 0; i < numPaths; i++) {
- char *path = CBUtils::StrEntry(i, pathList.c_str(), ';');
+ char *path = CBUtils::strEntry(i, pathList.c_str(), ';');
if (path && strlen(path) > 0) {
addPath(PATH_PACKAGE, path);
}
diff --git a/engines/wintermute/Base/BFontTT.cpp b/engines/wintermute/Base/BFontTT.cpp
index 9b4bb3ddff..cc373961e2 100644
--- a/engines/wintermute/Base/BFontTT.cpp
+++ b/engines/wintermute/Base/BFontTT.cpp
@@ -480,7 +480,7 @@ HRESULT CBFontTT::loadBuffer(byte *Buffer) {
break;
case TOKEN_FILENAME:
- CBUtils::SetString(&_fontFile, params);
+ CBUtils::setString(&_fontFile, params);
break;
case TOKEN_BOLD:
@@ -542,7 +542,7 @@ HRESULT CBFontTT::loadBuffer(byte *Buffer) {
_layers.Add(Layer);
}
- if (!_fontFile) CBUtils::SetString(&_fontFile, "arial.ttf");
+ if (!_fontFile) CBUtils::setString(&_fontFile, "arial.ttf");
return initFont();
}
diff --git a/engines/wintermute/Base/BGame.cpp b/engines/wintermute/Base/BGame.cpp
index f2908c9d96..b3c4c87ecd 100644
--- a/engines/wintermute/Base/BGame.cpp
+++ b/engines/wintermute/Base/BGame.cpp
@@ -212,7 +212,7 @@ CBGame::CBGame(): CBObject(this) {
_indicatorHeight = 8;
_richSavedGames = false;
_savedGameExt = NULL;
- CBUtils::SetString(&_savedGameExt, "dsv");
+ CBUtils::setString(&_savedGameExt, "dsv");
_musicCrossfadeRunning = false;
_musicCrossfadeStartTime = 0;
@@ -229,7 +229,7 @@ CBGame::CBGame(): CBObject(this) {
_loadImageX = _loadImageY = 0;
_localSaveDir = NULL;
- CBUtils::SetString(&_localSaveDir, "saves");
+ CBUtils::setString(&_localSaveDir, "saves");
_saveDirChecked = false;
_loadingIcon = NULL;
@@ -925,7 +925,7 @@ HRESULT CBGame::loadBuffer(byte *buffer, bool complete) {
break;
case TOKEN_SAVE_IMAGE:
- CBUtils::SetString(&_saveImageName, (char *)params);
+ CBUtils::setString(&_saveImageName, (char *)params);
break;
case TOKEN_SAVE_IMAGE_X:
@@ -937,7 +937,7 @@ HRESULT CBGame::loadBuffer(byte *buffer, bool complete) {
break;
case TOKEN_LOAD_IMAGE:
- CBUtils::SetString(&_loadImageName, (char *)params);
+ CBUtils::setString(&_loadImageName, (char *)params);
break;
case TOKEN_LOAD_IMAGE_X:
@@ -949,7 +949,7 @@ HRESULT CBGame::loadBuffer(byte *buffer, bool complete) {
break;
case TOKEN_LOCAL_SAVE_DIR:
- CBUtils::SetString(&_localSaveDir, (char *)params);
+ CBUtils::setString(&_localSaveDir, (char *)params);
break;
case TOKEN_COMPAT_KILL_METHOD_THREADS:
@@ -1369,8 +1369,8 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS
int right = stack->pop()->getInt();
int bottom = stack->pop()->getInt();
- if (right < left) CBUtils::Swap(&left, &right);
- if (bottom < top) CBUtils::Swap(&top, &bottom);
+ if (right < left) CBUtils::swap(&left, &right);
+ if (bottom < top) CBUtils::swap(&top, &bottom);
CBPlatform::SetRect(&_mouseLockRect, left, top, right, bottom);
@@ -1900,7 +1900,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS
delete[] _loadImageName;
_loadImageName = NULL;
} else {
- CBUtils::SetString(&_loadImageName, Val->getString());
+ CBUtils::setString(&_loadImageName, Val->getString());
}
stack->pushNULL();
return S_OK;
@@ -1919,7 +1919,7 @@ HRESULT CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS
delete[] _saveImageName;
_saveImageName = NULL;
} else {
- CBUtils::SetString(&_saveImageName, Val->getString());
+ CBUtils::setString(&_saveImageName, Val->getString());
}
stack->pushNULL();
return S_OK;
@@ -3026,7 +3026,7 @@ HRESULT CBGame::ExternalCall(CScScript *script, CScStack *stack, CScStack *thisS
int from = stack->pop()->getInt();
int to = stack->pop()->getInt();
- stack->pushInt(CBUtils::RandomInt(from, to));
+ stack->pushInt(CBUtils::randomInt(from, to));
}
//////////////////////////////////////////////////////////////////////////
@@ -3589,7 +3589,7 @@ HRESULT CBGame::loadSettings(const char *filename) {
break;
case TOKEN_SAVED_GAME_EXT:
- CBUtils::SetString(&_savedGameExt, (char *)params);
+ CBUtils::setString(&_savedGameExt, (char *)params);
break;
case TOKEN_GUID:
diff --git a/engines/wintermute/Base/BRegistry.cpp b/engines/wintermute/Base/BRegistry.cpp
index efc2c77d88..7a77e17fc7 100644
--- a/engines/wintermute/Base/BRegistry.cpp
+++ b/engines/wintermute/Base/BRegistry.cpp
@@ -188,7 +188,7 @@ void CBRegistry::LoadXml(const AnsiString fileName, PathValueMap &values) {
//////////////////////////////////////////////////////////////////////////
void CBRegistry::SaveXml(const AnsiString fileName, PathValueMap &values) {
- CBUtils::CreatePath(fileName.c_str());
+ CBUtils::createPath(fileName.c_str());
TiXmlDocument doc;
doc.LinkEndChild(new TiXmlDeclaration("1.0", "utf-8", ""));
diff --git a/engines/wintermute/Base/BSoundBuffer.cpp b/engines/wintermute/Base/BSoundBuffer.cpp
index 80753c5f50..55db2a0f89 100644
--- a/engines/wintermute/Base/BSoundBuffer.cpp
+++ b/engines/wintermute/Base/BSoundBuffer.cpp
@@ -122,7 +122,7 @@ HRESULT CBSoundBuffer::loadFromFile(const char *Filename, bool ForceReload) {
if (!_stream) {
return E_FAIL;
}
- CBUtils::SetString(&_filename, Filename);
+ CBUtils::setString(&_filename, Filename);
return S_OK;
#if 0
@@ -138,7 +138,7 @@ HRESULT CBSoundBuffer::loadFromFile(const char *Filename, bool ForceReload) {
return E_FAIL;
}
- CBUtils::SetString(&_filename, Filename);
+ CBUtils::setString(&_filename, Filename);
/*
HRESULT res;
diff --git a/engines/wintermute/Base/PartEmitter.cpp b/engines/wintermute/Base/PartEmitter.cpp
index 276540a14f..785e8738b5 100644
--- a/engines/wintermute/Base/PartEmitter.cpp
+++ b/engines/wintermute/Base/PartEmitter.cpp
@@ -155,28 +155,28 @@ HRESULT CPartEmitter::initParticle(CPartParticle *Particle, uint32 CurrentTime,
if (!Particle) return E_FAIL;
if (_sprites.GetSize() == 0) return E_FAIL;
- int PosX = CBUtils::RandomInt(_posX, _posX + _width);
- int PosY = CBUtils::RandomInt(_posY, _posY + _height);
- float PosZ = CBUtils::RandomFloat(0.0f, 100.0f);
+ int PosX = CBUtils::randomInt(_posX, _posX + _width);
+ int PosY = CBUtils::randomInt(_posY, _posY + _height);
+ float PosZ = CBUtils::randomFloat(0.0f, 100.0f);
float Velocity;
if (_velocityZBased) Velocity = _velocity1 + PosZ * (_velocity2 - _velocity1) / 100;
- else Velocity = CBUtils::RandomFloat(_velocity1, _velocity2);
+ else Velocity = CBUtils::randomFloat(_velocity1, _velocity2);
float Scale;
if (_scaleZBased) Scale = _scale1 + PosZ * (_scale2 - _scale1) / 100;
- else Scale = CBUtils::RandomFloat(_scale1, _scale2);
+ else Scale = CBUtils::randomFloat(_scale1, _scale2);
int LifeTime;
if (_lifeTimeZBased) LifeTime = _lifeTime2 - PosZ * (_lifeTime2 - _lifeTime1) / 100;
- else LifeTime = CBUtils::RandomInt(_lifeTime1, _lifeTime2);
+ else LifeTime = CBUtils::randomInt(_lifeTime1, _lifeTime2);
- float Angle = CBUtils::RandomAngle(_angle1, _angle2);
- int SpriteIndex = CBUtils::RandomInt(0, _sprites.GetSize() - 1);
+ float Angle = CBUtils::randomAngle(_angle1, _angle2);
+ int SpriteIndex = CBUtils::randomInt(0, _sprites.GetSize() - 1);
- float Rotation = CBUtils::RandomAngle(_rotation1, _rotation2);
- float AngVelocity = CBUtils::RandomFloat(_angVelocity1, _angVelocity2);
- float GrowthRate = CBUtils::RandomFloat(_growthRate1, _growthRate2);
+ float Rotation = CBUtils::randomAngle(_rotation1, _rotation2);
+ float AngVelocity = CBUtils::randomFloat(_angVelocity1, _angVelocity2);
+ float GrowthRate = CBUtils::randomFloat(_growthRate1, _growthRate2);
if (!CBPlatform::IsRectEmpty(&_border)) {
int ThicknessLeft = (int)(_borderThicknessLeft - (float)_borderThicknessLeft * PosZ / 100.0f);
@@ -195,14 +195,14 @@ HRESULT CPartEmitter::initParticle(CPartParticle *Particle, uint32 CurrentTime,
Vector2 VecVel(0, Velocity);
Matrix4 MatRot;
- MatRot.RotationZ(Common::deg2rad(CBUtils::NormalizeAngle(Angle - 180)));
+ MatRot.RotationZ(Common::deg2rad(CBUtils::normalizeAngle(Angle - 180)));
MatRot.TransformVector2(VecVel);
if (_alphaTimeBased) {
Particle->_alpha1 = _alpha1;
Particle->_alpha2 = _alpha2;
} else {
- int Alpha = CBUtils::RandomInt(_alpha1, _alpha2);
+ int Alpha = CBUtils::randomInt(_alpha1, _alpha2);
Particle->_alpha1 = Alpha;
Particle->_alpha2 = Alpha;
}
@@ -394,7 +394,7 @@ HRESULT CPartEmitter::addForce(const char *name, CPartForce::TForceType Type, in
Force->_direction = Vector2(0, Strength);
Matrix4 MatRot;
- MatRot.RotationZ(Common::deg2rad(CBUtils::NormalizeAngle(Angle - 180)));
+ MatRot.RotationZ(Common::deg2rad(CBUtils::normalizeAngle(Angle - 180)));
MatRot.TransformVector2(Force->_direction);
return S_OK;
@@ -1082,7 +1082,7 @@ HRESULT CPartEmitter::scSetProperty(const char *name, CScValue *value) {
else if (strcmp(name, "EmitEvent") == 0) {
delete[] _emitEvent;
_emitEvent = NULL;
- if (!value->isNULL()) CBUtils::SetString(&_emitEvent, value->getString());
+ if (!value->isNULL()) CBUtils::setString(&_emitEvent, value->getString());
return S_OK;
}
diff --git a/engines/wintermute/Base/PartParticle.cpp b/engines/wintermute/Base/PartParticle.cpp
index b348521808..604e113b90 100644
--- a/engines/wintermute/Base/PartParticle.cpp
+++ b/engines/wintermute/Base/PartParticle.cpp
@@ -164,7 +164,7 @@ HRESULT CPartParticle::update(CPartEmitter *Emitter, uint32 CurrentTime, uint32
// update rotation
_rotation += _angVelocity * ElapsedTime;
- _rotation = CBUtils::NormalizeAngle(_rotation);
+ _rotation = CBUtils::normalizeAngle(_rotation);
// update scale
if (_exponentialGrowth)
diff --git a/engines/wintermute/Base/scriptables/SXFile.cpp b/engines/wintermute/Base/scriptables/SXFile.cpp
index 6738df0301..e31afde2e9 100644
--- a/engines/wintermute/Base/scriptables/SXFile.cpp
+++ b/engines/wintermute/Base/scriptables/SXFile.cpp
@@ -60,7 +60,7 @@ CSXFile::CSXFile(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
CScValue *Val = stack->pop();
_filename = NULL;
- if (!Val->isNULL()) CBUtils::SetString(&_filename, Val->getString());
+ if (!Val->isNULL()) CBUtils::setString(&_filename, Val->getString());
_readFile = NULL;
_writeFile = NULL;
@@ -113,7 +113,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
stack->correctParams(1);
const char *Filename = stack->pop()->getString();
cleanup();
- CBUtils::SetString(&_filename, Filename);
+ CBUtils::setString(&_filename, Filename);
stack->pushNULL();
return S_OK;
}
diff --git a/engines/wintermute/Base/scriptables/SXStore.h b/engines/wintermute/Base/scriptables/SXStore.h
index 3c39b3f266..43d36553a7 100644
--- a/engines/wintermute/Base/scriptables/SXStore.h
+++ b/engines/wintermute/Base/scriptables/SXStore.h
@@ -47,10 +47,10 @@ public:
CBStoreProduct(const char *id, const char *name, const char *desc, const char *price) {
_id = _name = _desc = _price = NULL;
- CBUtils::SetString(&_id, id);
- CBUtils::SetString(&_name, name);
- CBUtils::SetString(&_desc, desc);
- CBUtils::SetString(&_price, price);
+ CBUtils::setString(&_id, id);
+ CBUtils::setString(&_name, name);
+ CBUtils::setString(&_desc, desc);
+ CBUtils::setString(&_price, price);
}
~CBStoreProduct() {
@@ -98,9 +98,9 @@ public:
CBStoreTransaction(const char *id, const char *productId, const char *state) {
_id = _productId = _state = NULL;
- CBUtils::SetString(&_id, id);
- CBUtils::SetString(&_productId, productId);
- CBUtils::SetString(&_state, state);
+ CBUtils::setString(&_id, id);
+ CBUtils::setString(&_productId, productId);
+ CBUtils::setString(&_state, state);
}
~CBStoreTransaction() {
diff --git a/engines/wintermute/Base/scriptables/SXString.cpp b/engines/wintermute/Base/scriptables/SXString.cpp
index 58cce4d7bb..f5981bb73d 100644
--- a/engines/wintermute/Base/scriptables/SXString.cpp
+++ b/engines/wintermute/Base/scriptables/SXString.cpp
@@ -108,7 +108,7 @@ HRESULT CSXString::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
int start = stack->pop()->getInt();
int end = stack->pop()->getInt();
- if (end < start) CBUtils::Swap(&start, &end);
+ if (end < start) CBUtils::swap(&start, &end);
//try {
WideString str;
diff --git a/engines/wintermute/Base/scriptables/ScEngine.cpp b/engines/wintermute/Base/scriptables/ScEngine.cpp
index deeaeb1443..b0fb447e17 100644
--- a/engines/wintermute/Base/scriptables/ScEngine.cpp
+++ b/engines/wintermute/Base/scriptables/ScEngine.cpp
@@ -786,8 +786,8 @@ HRESULT CScEngine::LoadBreakpoints() {
sprintf(Key, "Breakpoint%d", i);
AnsiString breakpoint = Game->_registry->ReadString("Debug", Key, "");
- char *Path = CBUtils::StrEntry(0, breakpoint.c_str(), ':');
- char *Line = CBUtils::StrEntry(1, breakpoint.c_str(), ':');
+ char *Path = CBUtils::strEntry(0, breakpoint.c_str(), ':');
+ char *Line = CBUtils::strEntry(1, breakpoint.c_str(), ':');
if (Path != NULL && Line != NULL) AddBreakpoint(Path, atoi(Line));
delete[] Path;
diff --git a/engines/wintermute/UI/UIEdit.cpp b/engines/wintermute/UI/UIEdit.cpp
index 2dec9c139f..d87eeea630 100644
--- a/engines/wintermute/UI/UIEdit.cpp
+++ b/engines/wintermute/UI/UIEdit.cpp
@@ -790,7 +790,7 @@ bool CUIEdit::handleKeypress(Common::Event *event, bool printable) {
//////////////////////////////////////////////////////////////////////////
int CUIEdit::deleteChars(int Start, int End) {
- if (Start > End) CBUtils::Swap(&Start, &End);
+ if (Start > End) CBUtils::swap(&Start, &End);
Start = MAX(Start, (int)0);
End = MIN((size_t)End, strlen(_text));
diff --git a/engines/wintermute/utils/utils.cpp b/engines/wintermute/utils/utils.cpp
index ae456b25e7..ab7ebac565 100644
--- a/engines/wintermute/utils/utils.cpp
+++ b/engines/wintermute/utils/utils.cpp
@@ -45,30 +45,30 @@ static inline unsigned Sqr(int x) {
//////////////////////////////////////////////////////////////////////////////////
-void CBUtils::Clip(int *DestX, int *DestY, RECT *SrcRect, RECT *DestRect) {
+void CBUtils::clip(int *destX, int *destY, RECT *srcRect, 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;
+ if (*destX + (srcRect->right - srcRect->left) > destRect->right)
+ srcRect->right -= *destX + (srcRect->right - srcRect->left) - destRect->right;
- if (SrcRect->right < 0) SrcRect->right = 0;
+ if (srcRect->right < 0) srcRect->right = 0;
// Partly off the left side of the screen
- if (*DestX < DestRect->left) {
- SrcRect->left += DestRect->left - *DestX;
- *DestX = DestRect->left;
+ if (*destX < destRect->left) {
+ srcRect->left += destRect->left - *destX;
+ *destX = destRect->left;
}
// Partly off the top of the screen
- if (*DestY < DestRect->top) {
- SrcRect->top += DestRect->top - *DestY;
- *DestY = DestRect->top;
+ if (*destY < destRect->top) {
+ srcRect->top += destRect->top - *destY;
+ *destY = destRect->top;
}
// If it's partly off the bottom side of the screen
- if (*DestY + (SrcRect->bottom - SrcRect->top) > DestRect->bottom)
- SrcRect->bottom -= ((SrcRect->bottom - SrcRect->top) + *DestY) - DestRect->bottom;
+ if (*destY + (srcRect->bottom - srcRect->top) > destRect->bottom)
+ srcRect->bottom -= ((srcRect->bottom - srcRect->top) + *destY) - destRect->bottom;
- if (SrcRect->bottom < 0) SrcRect->bottom = 0;
+ if (srcRect->bottom < 0) srcRect->bottom = 0;
return;
}
@@ -76,36 +76,36 @@ void CBUtils::Clip(int *DestX, int *DestY, RECT *SrcRect, RECT *DestRect) {
//////////////////////////////////////////////////////////////////////////////////
// Swap - swaps two integers
//////////////////////////////////////////////////////////////////////////////////
-void CBUtils::Swap(int *a, int *b) {
+void CBUtils::swap(int *a, int *b) {
int Temp = *a;
*a = *b;
*b = Temp;
}
//////////////////////////////////////////////////////////////////////////
-bool CBUtils::StrBeginsI(const char *String, const char *Fragment) {
- return (scumm_strnicmp(String, Fragment, strlen(Fragment)) == 0);
+bool CBUtils::strBeginsI(const char *string, const char *fragment) {
+ return (scumm_strnicmp(string, fragment, strlen(fragment)) == 0);
}
//////////////////////////////////////////////////////////////////////////
-float CBUtils::NormalizeAngle(float Angle) {
- while (Angle > 360) Angle -= 360;
- while (Angle < 0) Angle += 360;
+float CBUtils::normalizeAngle(float angle) {
+ while (angle > 360) angle -= 360;
+ while (angle < 0) angle += 360;
- return Angle;
+ return angle;
}
////////////////////////////////////////////////////////////////////////////////
-void CBUtils::CreatePath(const char *Path, bool PathOnly) {
- AnsiString path;
+void CBUtils::createPath(const char *path, bool pathOnly) {
+ AnsiString pathStr;
- if (!PathOnly) path = PathUtil::getDirectoryName(Path);
- else path = Path;
+ if (!pathOnly) pathStr = PathUtil::getDirectoryName(path);
+ else pathStr = path;
// try {
- warning("CBUtils::CreatePath - not implemented: %s", Path);
+ warning("CBUtils::CreatePath - not implemented: %s", path);
// boost::filesystem::create_directories(path);
// } catch (...) {
return;
@@ -114,13 +114,13 @@ void CBUtils::CreatePath(const char *Path, bool PathOnly) {
//////////////////////////////////////////////////////////////////////////
-void CBUtils::DebugMessage(HWND hWnd, const char *Text) {
+void CBUtils::debugMessage(HWND hWnd, const char *text) {
//MessageBox(hWnd, Text, "WME", MB_OK|MB_ICONINFORMATION);
}
//////////////////////////////////////////////////////////////////////////
-char *CBUtils::SetString(char **string, const char *value) {
+char *CBUtils::setString(char **string, const char *value) {
delete[] *string;
*string = new char[strlen(value) + 1];
if (*string) strcpy(*string, value);
@@ -128,34 +128,34 @@ char *CBUtils::SetString(char **string, const char *value) {
}
//////////////////////////////////////////////////////////////////////////
-int CBUtils::StrNumEntries(const char *Str, const char Delim) {
- int NumEntries = 1;
- for (uint32 i = 0; i < strlen(Str); i++) {
- if (Str[i] == Delim) NumEntries++;
+int CBUtils::strNumEntries(const char *str, const char delim) {
+ int numEntries = 1;
+ for (uint32 i = 0; i < strlen(str); i++) {
+ if (str[i] == delim) numEntries++;
}
- return NumEntries;
+ return numEntries;
}
//////////////////////////////////////////////////////////////////////////
-char *CBUtils::StrEntry(int Entry, const char *Str, const char Delim) {
- int NumEntries = 0;
+char *CBUtils::strEntry(int entry, const char *str, const char delim) {
+ int numEntries = 0;
- const char *Start = NULL;
- int Len = 0;
+ const char *start = NULL;
+ int len = 0;
- for (uint32 i = 0; i <= strlen(Str); i++) {
- if (NumEntries == Entry) {
- if (!Start) Start = Str + i;
- else Len++;
+ for (uint32 i = 0; i <= strlen(str); i++) {
+ if (numEntries == entry) {
+ if (!start) start = str + i;
+ else len++;
}
- if (Str[i] == Delim || Str[i] == '\0') {
- NumEntries++;
- if (Start) {
- char *Ret = new char[Len + 1];
- memset(Ret, 0, Len + 1);
- strncpy(Ret, Start, Len);
- return Ret;
+ if (str[i] == delim || str[i] == '\0') {
+ numEntries++;
+ if (start) {
+ char *ret = new char[len + 1];
+ memset(ret, 0, len + 1);
+ strncpy(ret, start, len);
+ return ret;
}
}
}
@@ -163,7 +163,7 @@ char *CBUtils::StrEntry(int Entry, const char *Str, const char Delim) {
}
//////////////////////////////////////////////////////////////////////////
-int CBUtils::RandomInt(int from, int to) {
+int CBUtils::randomInt(int from, int to) {
if (to < from) {
int i = to;
to = from;
@@ -174,27 +174,27 @@ int CBUtils::RandomInt(int from, int to) {
}
//////////////////////////////////////////////////////////////////////////
-float CBUtils::RandomFloat(float from, float to) {
+float CBUtils::randomFloat(float from, float to) {
const uint32 randMax = RAND_MAX;
float randNum = (float)g_wintermute->randInt(0, randMax) / (float)randMax;
return from + (to - from) * randNum;
}
//////////////////////////////////////////////////////////////////////////
-float CBUtils::RandomAngle(float From, float To) {
+float CBUtils::randomAngle(float From, float To) {
while (To < From) {
To += 360;
}
- return NormalizeAngle(RandomFloat(From, To));
+ return normalizeAngle(randomFloat(From, To));
}
//////////////////////////////////////////////////////////////////////////
-bool CBUtils::MatchesPattern(const char *Pattern, const char *String) {
+bool CBUtils::matchesPattern(const char *pattern, const char *string) {
char stringc, patternc;
- for (;; ++String) {
- stringc = toupper(*String);
- patternc = toupper(*Pattern++);
+ for (;; ++string) {
+ stringc = toupper(*string);
+ patternc = toupper(*pattern++);
switch (patternc) {
case 0:
@@ -205,29 +205,29 @@ bool CBUtils::MatchesPattern(const char *Pattern, const char *String) {
break;
case '*':
- if (!*Pattern) return true;
+ if (!*pattern) return true;
- if (*Pattern == '.') {
+ if (*pattern == '.') {
char *dot;
- if (Pattern[1] == '*' && Pattern[2] == 0) return true;
- dot = (char *)strchr(String, '.');
- if (Pattern[1] == 0) return (dot == NULL || dot[1] == 0);
+ if (pattern[1] == '*' && pattern[2] == 0) return true;
+ dot = (char *)strchr(string, '.');
+ if (pattern[1] == 0) return (dot == NULL || dot[1] == 0);
if (dot != NULL) {
- String = dot;
- if (strpbrk(Pattern, "*?[") == NULL && strchr(String + 1, '.') == NULL)
- return(scumm_stricmp(Pattern + 1, String + 1) == 0);
+ string = dot;
+ if (strpbrk(pattern, "*?[") == NULL && strchr(string + 1, '.') == NULL)
+ return(scumm_stricmp(pattern + 1, string + 1) == 0);
}
}
- while (*String)
- if (CBUtils::MatchesPattern(Pattern, String++))
+ while (*string)
+ if (CBUtils::matchesPattern(pattern, string++))
return true;
return false;
default:
if (patternc != stringc)
if (patternc == '.' && stringc == 0)
- return(CBUtils::MatchesPattern(Pattern, String));
+ return(CBUtils::matchesPattern(pattern, string));
else
return false;
break;
@@ -236,10 +236,10 @@ bool CBUtils::MatchesPattern(const char *Pattern, const char *String) {
}
//////////////////////////////////////////////////////////////////////////
-char *CBUtils::GetPath(const char *Filename) {
- AnsiString path = PathUtil::getDirectoryName(Filename);
+char *CBUtils::getPath(const char *filename) {
+ AnsiString path = PathUtil::getDirectoryName(filename);
//path = boost::filesystem::syste_complete(path).string();
- warning("CBUtils::GetPath: (%s), not implemented", Filename);
+ warning("CBUtils::GetPath: (%s), not implemented", filename);
char *ret = new char[path.size() + 1];
strcpy(ret, path.c_str());
@@ -247,8 +247,8 @@ char *CBUtils::GetPath(const char *Filename) {
}
//////////////////////////////////////////////////////////////////////////
-char *CBUtils::GetFilename(const char *Filename) {
- AnsiString path = PathUtil::getFileName(Filename);
+char *CBUtils::getFilename(const char *filename) {
+ AnsiString path = PathUtil::getFileName(filename);
char *ret = new char[path.size() + 1];
strcpy(ret, path.c_str());
return ret;
diff --git a/engines/wintermute/utils/utils.h b/engines/wintermute/utils/utils.h
index 46e895ff4d..219cacd249 100644
--- a/engines/wintermute/utils/utils.h
+++ b/engines/wintermute/utils/utils.h
@@ -37,27 +37,27 @@ class CBGame;
class CBUtils {
public:
- static void Clip(int *DestX, int *DestY, RECT *SrcRect, RECT *DestRect);
- static void Swap(int *a, int *b);
- static bool StrBeginsI(const char *String, const char *Fragment);
- static float NormalizeAngle(float Angle);
+ static void clip(int *DestX, int *DestY, RECT *SrcRect, RECT *DestRect);
+ static void swap(int *a, int *b);
+ static bool strBeginsI(const char *String, const char *Fragment);
+ static float normalizeAngle(float Angle);
- static void CreatePath(const char *Path, bool PathOnly = false);
+ static void createPath(const char *Path, bool PathOnly = false);
- static void DebugMessage(HWND hWnd, const char *Text);
- static char *SetString(char **String, const char *Value);
+ static void debugMessage(HWND hWnd, const char *Text);
+ static char *setString(char **String, const char *Value);
- static int StrNumEntries(const char *Str, const char Delim = ',');
- static char *StrEntry(int Entry, const char *Str, const char Delim = ',');
+ static int strNumEntries(const char *Str, const char Delim = ',');
+ static char *strEntry(int Entry, const char *Str, const char Delim = ',');
- static int RandomInt(int From, int To);
- static float RandomFloat(float From, float To);
- static float RandomAngle(float From, float To);
+ static int randomInt(int From, int To);
+ static float randomFloat(float From, float To);
+ static float randomAngle(float From, float To);
- static bool MatchesPattern(const char *pattern, const char *string);
+ static bool matchesPattern(const char *pattern, const char *string);
- static char *GetPath(const char *Filename);
- static char *GetFilename(const char *Filename);
+ static char *getPath(const char *Filename);
+ static char *getFilename(const char *Filename);
static void RGBtoHSL(uint32 RGBColor, byte *OutH, byte *OutS, byte *OutL);
static uint32 HSLtoRGB(byte H, byte S, byte L);
diff --git a/engines/wintermute/video/VidTheoraPlayer.cpp b/engines/wintermute/video/VidTheoraPlayer.cpp
index 2c93e2ee33..d47f3b3ae5 100644
--- a/engines/wintermute/video/VidTheoraPlayer.cpp
+++ b/engines/wintermute/video/VidTheoraPlayer.cpp
@@ -140,7 +140,7 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo
_file = Game->_fileManager->openFile(filename, true, false);
if (!_file) return E_FAIL;
- //if (Filename != _filename) CBUtils::SetString(&_filename, Filename);
+ //if (Filename != _filename) CBUtils::setString(&_filename, Filename);
#if defined (USE_THEORADEC)
_theoraDecoder = new TheoraDecoder();
#else
@@ -167,7 +167,7 @@ HRESULT CVidTheoraPlayer::initialize(const Common::String &filename, const Commo
_file = Game->_fileManager->openFile(Filename);
if (!_file) return E_FAIL;
- if (Filename != _filename) CBUtils::SetString(&_filename, Filename);
+ if (Filename != _filename) CBUtils::setString(&_filename, Filename);
// start up Ogg stream synchronization layer
ogg_sync_init(&m_OggSyncState);
@@ -691,7 +691,7 @@ HRESULT CVidTheoraPlayer::setAlphaImage(const Common::String &filename) {
SAFE_DELETE_ARRAY(m_AlphaFilename);
return E_FAIL;
}
- if (m_AlphaFilename != Filename) CBUtils::SetString(&m_AlphaFilename, Filename);
+ if (m_AlphaFilename != Filename) CBUtils::setString(&m_AlphaFilename, Filename);
m_AlphaImage->Convert(IMG_TRUECOLOR);
#endif
return S_OK;