aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/Base/scriptables
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-03 05:37:08 +0200
committerEinar Johan Trøan Sømåen2012-07-03 05:37:08 +0200
commit2f90dd76f99a827ce1bf5ea8ee6d653396756e1b (patch)
tree1239e46c37d48023f2a6cd0148d93d0920b34a83 /engines/wintermute/Base/scriptables
parentc27d6585df61efc8b1ff5917de2dc3ae8b5d4248 (diff)
downloadscummvm-rg350-2f90dd76f99a827ce1bf5ea8ee6d653396756e1b.tar.gz
scummvm-rg350-2f90dd76f99a827ce1bf5ea8ee6d653396756e1b.tar.bz2
scummvm-rg350-2f90dd76f99a827ce1bf5ea8ee6d653396756e1b.zip
WINTERMUTE: Rename FuncName->funcName in CScValue
Diffstat (limited to 'engines/wintermute/Base/scriptables')
-rw-r--r--engines/wintermute/Base/scriptables/SXArray.cpp36
-rw-r--r--engines/wintermute/Base/scriptables/SXDate.cpp34
-rw-r--r--engines/wintermute/Base/scriptables/SXFile.cpp46
-rw-r--r--engines/wintermute/Base/scriptables/SXMath.cpp50
-rw-r--r--engines/wintermute/Base/scriptables/SXMemBuffer.cpp62
-rw-r--r--engines/wintermute/Base/scriptables/SXStore.cpp44
-rw-r--r--engines/wintermute/Base/scriptables/SXString.cpp36
-rw-r--r--engines/wintermute/Base/scriptables/ScEngine.cpp20
-rw-r--r--engines/wintermute/Base/scriptables/ScScript.cpp246
-rw-r--r--engines/wintermute/Base/scriptables/ScStack.cpp32
-rw-r--r--engines/wintermute/Base/scriptables/ScValue.cpp318
-rw-r--r--engines/wintermute/Base/scriptables/ScValue.h82
-rw-r--r--engines/wintermute/Base/scriptables/SxObject.cpp4
13 files changed, 505 insertions, 505 deletions
diff --git a/engines/wintermute/Base/scriptables/SXArray.cpp b/engines/wintermute/Base/scriptables/SXArray.cpp
index c22dd9e4b5..72c848f747 100644
--- a/engines/wintermute/Base/scriptables/SXArray.cpp
+++ b/engines/wintermute/Base/scriptables/SXArray.cpp
@@ -45,15 +45,15 @@ CSXArray::CSXArray(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
_length = 0;
_values = new CScValue(Game);
- int NumParams = stack->pop()->GetInt(0);
+ int NumParams = stack->pop()->getInt(0);
- if (NumParams == 1) _length = stack->pop()->GetInt(0);
+ if (NumParams == 1) _length = stack->pop()->getInt(0);
else if (NumParams > 1) {
_length = NumParams;
char ParamName[20];
for (int i = 0; i < NumParams; i++) {
sprintf(ParamName, "%d", i);
- _values->SetProp(ParamName, stack->pop());
+ _values->setProp(ParamName, stack->pop());
}
}
}
@@ -79,10 +79,10 @@ const char *CSXArray::scToString() {
char PropName[20];
for (int i = 0; i < _length; i++) {
sprintf(PropName, "%d", i);
- CScValue *val = _values->GetProp(PropName);
+ CScValue *val = _values->getProp(PropName);
if (val) {
- if (strlen(Dummy) + strlen(val->GetString()) < 32768) {
- strcat(Dummy, val->GetString());
+ if (strlen(Dummy) + strlen(val->getString()) < 32768) {
+ strcat(Dummy, val->getString());
}
}
@@ -98,13 +98,13 @@ HRESULT CSXArray::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
// Push
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Push") == 0) {
- int NumParams = stack->pop()->GetInt(0);
+ int NumParams = stack->pop()->getInt(0);
char ParamName[20];
for (int i = 0; i < NumParams; i++) {
_length++;
sprintf(ParamName, "%d", _length - 1);
- _values->SetProp(ParamName, stack->pop(), true);
+ _values->setProp(ParamName, stack->pop(), true);
}
stack->pushInt(_length);
@@ -121,8 +121,8 @@ HRESULT CSXArray::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
if (_length > 0) {
char ParamName[20];
sprintf(ParamName, "%d", _length - 1);
- stack->push(_values->GetProp(ParamName));
- _values->DeleteProp(ParamName);
+ stack->push(_values->getProp(ParamName));
+ _values->deleteProp(ParamName);
_length--;
} else stack->pushNULL();
@@ -135,13 +135,13 @@ HRESULT CSXArray::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
//////////////////////////////////////////////////////////////////////////
CScValue *CSXArray::scGetProperty(const char *name) {
- _scValue->SetNULL();
+ _scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Type") == 0) {
- _scValue->SetString("array");
+ _scValue->setString("array");
return _scValue;
}
@@ -149,7 +149,7 @@ CScValue *CSXArray::scGetProperty(const char *name) {
// Length
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Length") == 0) {
- _scValue->SetInt(_length);
+ _scValue->setInt(_length);
return _scValue;
}
@@ -159,7 +159,7 @@ CScValue *CSXArray::scGetProperty(const char *name) {
else {
char ParamName[20];
if (ValidNumber(name, ParamName)) {
- return _values->GetProp(ParamName);
+ return _values->getProp(ParamName);
} else return _scValue;
}
}
@@ -172,13 +172,13 @@ HRESULT CSXArray::scSetProperty(const char *name, CScValue *value) {
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Length") == 0) {
int OrigLength = _length;
- _length = MAX(value->GetInt(0), 0);
+ _length = MAX(value->getInt(0), 0);
char PropName[20];
if (_length < OrigLength) {
for (int i = _length; i < OrigLength; i++) {
sprintf(PropName, "%d", i);
- _values->DeleteProp(PropName);
+ _values->deleteProp(PropName);
}
}
return S_OK;
@@ -192,7 +192,7 @@ HRESULT CSXArray::scSetProperty(const char *name, CScValue *value) {
if (ValidNumber(name, ParamName)) {
int Index = atoi(ParamName);
if (Index >= _length) _length = Index + 1;
- return _values->SetProp(ParamName, value);
+ return _values->setProp(ParamName, value);
} else return E_FAIL;
}
}
@@ -231,7 +231,7 @@ HRESULT CSXArray::Push(CScValue *Val) {
char ParamName[20];
_length++;
sprintf(ParamName, "%d", _length - 1);
- _values->SetProp(ParamName, Val, true);
+ _values->setProp(ParamName, Val, true);
return S_OK;
}
diff --git a/engines/wintermute/Base/scriptables/SXDate.cpp b/engines/wintermute/Base/scriptables/SXDate.cpp
index 61a646df43..e108c03a6e 100644
--- a/engines/wintermute/Base/scriptables/SXDate.cpp
+++ b/engines/wintermute/Base/scriptables/SXDate.cpp
@@ -45,14 +45,14 @@ CSXDate::CSXDate(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
memset(&_tm, 0, sizeof(_tm));
CScValue *valYear = stack->pop();
- _tm.tm_year = valYear->GetInt() - 1900;
- _tm.tm_mon = stack->pop()->GetInt() - 1;
- _tm.tm_mday = stack->pop()->GetInt();
- _tm.tm_hour = stack->pop()->GetInt();
- _tm.tm_min = stack->pop()->GetInt();
- _tm.tm_sec = stack->pop()->GetInt();
-
- if (valYear->IsNULL()) {
+ _tm.tm_year = valYear->getInt() - 1900;
+ _tm.tm_mon = stack->pop()->getInt() - 1;
+ _tm.tm_mday = stack->pop()->getInt();
+ _tm.tm_hour = stack->pop()->getInt();
+ _tm.tm_min = stack->pop()->getInt();
+ _tm.tm_sec = stack->pop()->getInt();
+
+ if (valYear->isNULL()) {
g_system->getTimeAndDate(_tm);
}
}
@@ -140,7 +140,7 @@ HRESULT CSXDate::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetYear") == 0) {
stack->correctParams(1);
- _tm.tm_year = stack->pop()->GetInt() - 1900;
+ _tm.tm_year = stack->pop()->getInt() - 1900;
stack->pushNULL();
return S_OK;
}
@@ -149,7 +149,7 @@ HRESULT CSXDate::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetMonth") == 0) {
stack->correctParams(1);
- _tm.tm_mon = stack->pop()->GetInt() - 1;
+ _tm.tm_mon = stack->pop()->getInt() - 1;
stack->pushNULL();
return S_OK;
}
@@ -158,7 +158,7 @@ HRESULT CSXDate::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetDate") == 0) {
stack->correctParams(1);
- _tm.tm_mday = stack->pop()->GetInt();
+ _tm.tm_mday = stack->pop()->getInt();
stack->pushNULL();
return S_OK;
}
@@ -167,7 +167,7 @@ HRESULT CSXDate::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetHours") == 0) {
stack->correctParams(1);
- _tm.tm_hour = stack->pop()->GetInt();
+ _tm.tm_hour = stack->pop()->getInt();
stack->pushNULL();
return S_OK;
}
@@ -176,7 +176,7 @@ HRESULT CSXDate::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetMinutes") == 0) {
stack->correctParams(1);
- _tm.tm_min = stack->pop()->GetInt();
+ _tm.tm_min = stack->pop()->getInt();
stack->pushNULL();
return S_OK;
}
@@ -185,7 +185,7 @@ HRESULT CSXDate::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetSeconds") == 0) {
stack->correctParams(1);
- _tm.tm_sec = stack->pop()->GetInt();
+ _tm.tm_sec = stack->pop()->getInt();
stack->pushNULL();
return S_OK;
}
@@ -208,13 +208,13 @@ HRESULT CSXDate::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
CScValue *CSXDate::scGetProperty(const char *name) {
- _scValue->SetNULL();
+ _scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Type") == 0) {
- _scValue->SetString("date");
+ _scValue->setString("date");
return _scValue;
}
@@ -229,7 +229,7 @@ HRESULT CSXDate::scSetProperty(const char *name, CScValue *value) {
// Name
//////////////////////////////////////////////////////////////////////////
if(strcmp(name, "Name")==0){
- setName(value->GetString());
+ setName(value->getString());
return S_OK;
}
diff --git a/engines/wintermute/Base/scriptables/SXFile.cpp b/engines/wintermute/Base/scriptables/SXFile.cpp
index fc2fca1991..6738df0301 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;
@@ -111,7 +111,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "SetFilename") == 0) {
stack->correctParams(1);
- const char *Filename = stack->pop()->GetString();
+ const char *Filename = stack->pop()->getString();
cleanup();
CBUtils::SetString(&_filename, Filename);
stack->pushNULL();
@@ -124,7 +124,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
else if (strcmp(name, "OpenAsText") == 0 || strcmp(name, "OpenAsBinary") == 0) {
stack->correctParams(1);
Close();
- _mode = stack->pop()->GetInt(1);
+ _mode = stack->pop()->getInt(1);
if (_mode < 1 || _mode > 3) {
script->RuntimeError("File.%s: invalid access mode. Setting read mode.", name);
_mode = 1;
@@ -175,7 +175,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
script->RuntimeError("File.%s: File is not open", name);
stack->pushBool(false);
} else {
- int Pos = stack->pop()->GetInt();
+ int Pos = stack->pop()->getInt();
stack->pushBool(SetPos(Pos));
}
return S_OK;
@@ -196,8 +196,8 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Copy") == 0) {
stack->correctParams(2);
- const char *Dest = stack->pop()->GetString();
- bool Overwrite = stack->pop()->GetBool(true);
+ const char *Dest = stack->pop()->getString();
+ bool Overwrite = stack->pop()->getBool(true);
Close();
stack->pushBool(CBPlatform::CopyFile(_filename, Dest, !Overwrite) != false);
@@ -258,7 +258,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "ReadText") == 0) {
stack->correctParams(1);
- int TextLen = stack->pop()->GetInt();
+ int TextLen = stack->pop()->getInt();
if (!_textMode || !_readFile) {
script->RuntimeError("File.%s: File must be open in text mode.", name);
@@ -305,7 +305,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "WriteLine") == 0 || strcmp(name, "WriteText") == 0) {
stack->correctParams(1);
- const char *Line = stack->pop()->GetString();
+ const char *Line = stack->pop()->getString();
if (!_textMode || !_writeFile) {
script->RuntimeError("File.%s: File must be open for writing in text mode.", name);
stack->pushBool(false);
@@ -454,7 +454,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "WriteBool") == 0) {
stack->correctParams(1);
- bool Val = stack->pop()->GetBool();
+ bool Val = stack->pop()->getBool();
if (_textMode || !_writeFile) {
script->RuntimeError("File.%s: File must be open for writing in binary mode.", name);
@@ -472,7 +472,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "WriteByte") == 0) {
stack->correctParams(1);
- byte Val = stack->pop()->GetInt();
+ byte Val = stack->pop()->getInt();
if (_textMode || !_writeFile) {
script->RuntimeError("File.%s: File must be open for writing in binary mode.", name);
@@ -490,7 +490,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "WriteShort") == 0) {
stack->correctParams(1);
- short Val = stack->pop()->GetInt();
+ short Val = stack->pop()->getInt();
if (_textMode || !_writeFile) {
script->RuntimeError("File.%s: File must be open for writing in binary mode.", name);
@@ -508,7 +508,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "WriteInt") == 0 || strcmp(name, "WriteLong") == 0) {
stack->correctParams(1);
- int Val = stack->pop()->GetInt();
+ int Val = stack->pop()->getInt();
if (_textMode || !_writeFile) {
script->RuntimeError("File.%s: File must be open for writing in binary mode.", name);
@@ -526,7 +526,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "WriteFloat") == 0) {
stack->correctParams(1);
- float Val = stack->pop()->GetFloat();
+ float Val = stack->pop()->getFloat();
if (_textMode || !_writeFile) {
script->RuntimeError("File.%s: File must be open for writing in binary mode.", name);
@@ -544,7 +544,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "WriteDouble") == 0) {
stack->correctParams(1);
- double Val = stack->pop()->GetFloat();
+ double Val = stack->pop()->getFloat();
if (_textMode || !_writeFile) {
script->RuntimeError("File.%s: File must be open for writing in binary mode.", name);
@@ -562,7 +562,7 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "WriteString") == 0) {
stack->correctParams(1);
- const char *Val = stack->pop()->GetString();
+ const char *Val = stack->pop()->getString();
if (_textMode || !_writeFile) {
script->RuntimeError("File.%s: File must be open for writing in binary mode.", name);
@@ -586,13 +586,13 @@ HRESULT CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
CScValue *CSXFile::scGetProperty(const char *name) {
- _scValue->SetNULL();
+ _scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Type") == 0) {
- _scValue->SetString("file");
+ _scValue->setString("file");
return _scValue;
}
@@ -600,7 +600,7 @@ CScValue *CSXFile::scGetProperty(const char *name) {
// Filename (RO)
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Filename") == 0) {
- _scValue->SetString(_filename);
+ _scValue->setString(_filename);
return _scValue;
}
@@ -608,7 +608,7 @@ CScValue *CSXFile::scGetProperty(const char *name) {
// Position (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Position") == 0) {
- _scValue->SetInt(GetPos());
+ _scValue->setInt(GetPos());
return _scValue;
}
@@ -616,7 +616,7 @@ CScValue *CSXFile::scGetProperty(const char *name) {
// Length (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Length") == 0) {
- _scValue->SetInt(GetLength());
+ _scValue->setInt(GetLength());
return _scValue;
}
@@ -624,7 +624,7 @@ CScValue *CSXFile::scGetProperty(const char *name) {
// TextMode (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "TextMode") == 0) {
- _scValue->SetBool(_textMode);
+ _scValue->setBool(_textMode);
return _scValue;
}
@@ -632,7 +632,7 @@ CScValue *CSXFile::scGetProperty(const char *name) {
// AccessMode (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "AccessMode") == 0) {
- _scValue->SetInt(_mode);
+ _scValue->setInt(_mode);
return _scValue;
}
@@ -648,7 +648,7 @@ HRESULT CSXFile::scSetProperty(const char *name, CScValue *value) {
//////////////////////////////////////////////////////////////////////////
if(strcmp(name, "Length")==0){
int OrigLength = _length;
- _length = max(value->GetInt(0), 0);
+ _length = max(value->getInt(0), 0);
char PropName[20];
if(_length < OrigLength){
diff --git a/engines/wintermute/Base/scriptables/SXMath.cpp b/engines/wintermute/Base/scriptables/SXMath.cpp
index 110330d4ef..92e6823534 100644
--- a/engines/wintermute/Base/scriptables/SXMath.cpp
+++ b/engines/wintermute/Base/scriptables/SXMath.cpp
@@ -64,7 +64,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Abs") == 0) {
stack->correctParams(1);
- stack->pushFloat(fabs(stack->pop()->GetFloat()));
+ stack->pushFloat(fabs(stack->pop()->getFloat()));
return S_OK;
}
@@ -73,7 +73,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Acos") == 0) {
stack->correctParams(1);
- stack->pushFloat(acos(stack->pop()->GetFloat()));
+ stack->pushFloat(acos(stack->pop()->getFloat()));
return S_OK;
}
@@ -82,7 +82,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Asin") == 0) {
stack->correctParams(1);
- stack->pushFloat(asin(stack->pop()->GetFloat()));
+ stack->pushFloat(asin(stack->pop()->getFloat()));
return S_OK;
}
@@ -91,7 +91,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Atan") == 0) {
stack->correctParams(1);
- stack->pushFloat(atan(stack->pop()->GetFloat()));
+ stack->pushFloat(atan(stack->pop()->getFloat()));
return S_OK;
}
@@ -100,8 +100,8 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Atan2") == 0) {
stack->correctParams(2);
- double y = stack->pop()->GetFloat();
- double x = stack->pop()->GetFloat();
+ double y = stack->pop()->getFloat();
+ double x = stack->pop()->getFloat();
stack->pushFloat(atan2(y, x));
return S_OK;
}
@@ -111,7 +111,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Ceil") == 0) {
stack->correctParams(1);
- stack->pushFloat(ceil(stack->pop()->GetFloat()));
+ stack->pushFloat(ceil(stack->pop()->getFloat()));
return S_OK;
}
@@ -120,7 +120,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Cos") == 0) {
stack->correctParams(1);
- stack->pushFloat(cos(DegreeToRadian(stack->pop()->GetFloat())));
+ stack->pushFloat(cos(DegreeToRadian(stack->pop()->getFloat())));
return S_OK;
}
@@ -129,7 +129,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Cosh") == 0) {
stack->correctParams(1);
- stack->pushFloat(cosh(DegreeToRadian(stack->pop()->GetFloat())));
+ stack->pushFloat(cosh(DegreeToRadian(stack->pop()->getFloat())));
return S_OK;
}
@@ -138,7 +138,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Exp") == 0) {
stack->correctParams(1);
- stack->pushFloat(exp(stack->pop()->GetFloat()));
+ stack->pushFloat(exp(stack->pop()->getFloat()));
return S_OK;
}
@@ -147,7 +147,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Floor") == 0) {
stack->correctParams(1);
- stack->pushFloat(floor(stack->pop()->GetFloat()));
+ stack->pushFloat(floor(stack->pop()->getFloat()));
return S_OK;
}
@@ -156,7 +156,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Log") == 0) {
stack->correctParams(1);
- stack->pushFloat(log(stack->pop()->GetFloat()));
+ stack->pushFloat(log(stack->pop()->getFloat()));
return S_OK;
}
@@ -165,7 +165,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Log10") == 0) {
stack->correctParams(1);
- stack->pushFloat(log10(stack->pop()->GetFloat()));
+ stack->pushFloat(log10(stack->pop()->getFloat()));
return S_OK;
}
@@ -174,8 +174,8 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Pow") == 0) {
stack->correctParams(2);
- double x = stack->pop()->GetFloat();
- double y = stack->pop()->GetFloat();
+ double x = stack->pop()->getFloat();
+ double y = stack->pop()->getFloat();
stack->pushFloat(pow(x, y));
return S_OK;
@@ -186,7 +186,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Sin") == 0) {
stack->correctParams(1);
- stack->pushFloat(sin(DegreeToRadian(stack->pop()->GetFloat())));
+ stack->pushFloat(sin(DegreeToRadian(stack->pop()->getFloat())));
return S_OK;
}
@@ -195,7 +195,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Sinh") == 0) {
stack->correctParams(1);
- stack->pushFloat(sinh(DegreeToRadian(stack->pop()->GetFloat())));
+ stack->pushFloat(sinh(DegreeToRadian(stack->pop()->getFloat())));
return S_OK;
}
@@ -204,7 +204,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Tan") == 0) {
stack->correctParams(1);
- stack->pushFloat(tan(DegreeToRadian(stack->pop()->GetFloat())));
+ stack->pushFloat(tan(DegreeToRadian(stack->pop()->getFloat())));
return S_OK;
}
@@ -213,7 +213,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Tanh") == 0) {
stack->correctParams(1);
- stack->pushFloat(tanh(DegreeToRadian(stack->pop()->GetFloat())));
+ stack->pushFloat(tanh(DegreeToRadian(stack->pop()->getFloat())));
return S_OK;
}
@@ -222,7 +222,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Sqrt") == 0) {
stack->correctParams(1);
- stack->pushFloat(sqrt(stack->pop()->GetFloat()));
+ stack->pushFloat(sqrt(stack->pop()->getFloat()));
return S_OK;
}
@@ -231,7 +231,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "DegToRad") == 0) {
stack->correctParams(1);
- stack->pushFloat(DegreeToRadian(stack->pop()->GetFloat()));
+ stack->pushFloat(DegreeToRadian(stack->pop()->getFloat()));
return S_OK;
}
@@ -240,7 +240,7 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "RadToDeg") == 0) {
stack->correctParams(1);
- stack->pushFloat(RadianToDegree(stack->pop()->GetFloat()));
+ stack->pushFloat(RadianToDegree(stack->pop()->getFloat()));
return S_OK;
}
@@ -250,13 +250,13 @@ HRESULT CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
CScValue *CSXMath::scGetProperty(const char *name) {
- _scValue->SetNULL();
+ _scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Type") == 0) {
- _scValue->SetString("math");
+ _scValue->setString("math");
return _scValue;
}
@@ -264,7 +264,7 @@ CScValue *CSXMath::scGetProperty(const char *name) {
// PI
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "PI") == 0) {
- _scValue->SetFloat(PI);
+ _scValue->setFloat(PI);
return _scValue;
}
diff --git a/engines/wintermute/Base/scriptables/SXMemBuffer.cpp b/engines/wintermute/Base/scriptables/SXMemBuffer.cpp
index 7dcb6ea1a7..0afdf08450 100644
--- a/engines/wintermute/Base/scriptables/SXMemBuffer.cpp
+++ b/engines/wintermute/Base/scriptables/SXMemBuffer.cpp
@@ -47,7 +47,7 @@ CSXMemBuffer::CSXMemBuffer(CBGame *inGame, CScStack *stack): CBScriptable(inGame
_buffer = NULL;
_size = 0;
- int NewSize = stack->pop()->GetInt();
+ int NewSize = stack->pop()->getInt();
Resize(MAX(0, NewSize));
}
@@ -128,7 +128,7 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "SetSize") == 0) {
stack->correctParams(1);
- int NewSize = stack->pop()->GetInt();
+ int NewSize = stack->pop()->getInt();
NewSize = MAX(0, NewSize);
if (SUCCEEDED(Resize(NewSize))) stack->pushBool(true);
else stack->pushBool(false);
@@ -141,7 +141,7 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GetBool") == 0) {
stack->correctParams(1);
- int Start = stack->pop()->GetInt();
+ int Start = stack->pop()->getInt();
if (!CheckBounds(script, Start, sizeof(bool))) stack->pushNULL();
else stack->pushBool(*(bool *)((byte *)_buffer + Start));
@@ -153,7 +153,7 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GetByte") == 0) {
stack->correctParams(1);
- int Start = stack->pop()->GetInt();
+ int Start = stack->pop()->getInt();
if (!CheckBounds(script, Start, sizeof(byte))) stack->pushNULL();
else stack->pushInt(*(byte *)((byte *)_buffer + Start));
@@ -165,7 +165,7 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GetShort") == 0) {
stack->correctParams(1);
- int Start = stack->pop()->GetInt();
+ int Start = stack->pop()->getInt();
if (!CheckBounds(script, Start, sizeof(short))) stack->pushNULL();
else stack->pushInt(65536 + * (short *)((byte *)_buffer + Start));
@@ -177,7 +177,7 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GetInt") == 0 || strcmp(name, "GetLong") == 0) {
stack->correctParams(1);
- int Start = stack->pop()->GetInt();
+ int Start = stack->pop()->getInt();
if (!CheckBounds(script, Start, sizeof(int))) stack->pushNULL();
else stack->pushInt(*(int *)((byte *)_buffer + Start));
@@ -189,7 +189,7 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GetFloat") == 0) {
stack->correctParams(1);
- int Start = stack->pop()->GetInt();
+ int Start = stack->pop()->getInt();
if (!CheckBounds(script, Start, sizeof(float))) stack->pushNULL();
else stack->pushFloat(*(float *)((byte *)_buffer + Start));
@@ -201,7 +201,7 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GetDouble") == 0) {
stack->correctParams(1);
- int Start = stack->pop()->GetInt();
+ int Start = stack->pop()->getInt();
if (!CheckBounds(script, Start, sizeof(double))) stack->pushNULL();
else stack->pushFloat(*(double *)((byte *)_buffer + Start));
@@ -213,8 +213,8 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GetString") == 0) {
stack->correctParams(2);
- int Start = stack->pop()->GetInt();
- int Length = stack->pop()->GetInt();
+ int Start = stack->pop()->getInt();
+ int Length = stack->pop()->getInt();
// find end of string
if (Length == 0 && Start >= 0 && Start < _size) {
@@ -242,7 +242,7 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GetPointer") == 0) {
stack->correctParams(1);
- int Start = stack->pop()->GetInt();
+ int Start = stack->pop()->getInt();
if (!CheckBounds(script, Start, sizeof(void *))) stack->pushNULL();
else {
void *Pointer = *(void **)((byte *)_buffer + Start);
@@ -257,8 +257,8 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetBool") == 0) {
stack->correctParams(2);
- int Start = stack->pop()->GetInt();
- bool Val = stack->pop()->GetBool();
+ int Start = stack->pop()->getInt();
+ bool Val = stack->pop()->getBool();
if (!CheckBounds(script, Start, sizeof(bool))) stack->pushBool(false);
else {
@@ -273,8 +273,8 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetByte") == 0) {
stack->correctParams(2);
- int Start = stack->pop()->GetInt();
- byte Val = (byte)stack->pop()->GetInt();
+ int Start = stack->pop()->getInt();
+ byte Val = (byte)stack->pop()->getInt();
if (!CheckBounds(script, Start, sizeof(byte))) stack->pushBool(false);
else {
@@ -289,8 +289,8 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetShort") == 0) {
stack->correctParams(2);
- int Start = stack->pop()->GetInt();
- short Val = (short)stack->pop()->GetInt();
+ int Start = stack->pop()->getInt();
+ short Val = (short)stack->pop()->getInt();
if (!CheckBounds(script, Start, sizeof(short))) stack->pushBool(false);
else {
@@ -305,8 +305,8 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetInt") == 0 || strcmp(name, "SetLong") == 0) {
stack->correctParams(2);
- int Start = stack->pop()->GetInt();
- int Val = stack->pop()->GetInt();
+ int Start = stack->pop()->getInt();
+ int Val = stack->pop()->getInt();
if (!CheckBounds(script, Start, sizeof(int))) stack->pushBool(false);
else {
@@ -321,8 +321,8 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetFloat") == 0) {
stack->correctParams(2);
- int Start = stack->pop()->GetInt();
- float Val = (float)stack->pop()->GetFloat();
+ int Start = stack->pop()->getInt();
+ float Val = (float)stack->pop()->getFloat();
if (!CheckBounds(script, Start, sizeof(float))) stack->pushBool(false);
else {
@@ -337,8 +337,8 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetDouble") == 0) {
stack->correctParams(2);
- int Start = stack->pop()->GetInt();
- double Val = stack->pop()->GetFloat();
+ int Start = stack->pop()->getInt();
+ double Val = stack->pop()->getFloat();
if (!CheckBounds(script, Start, sizeof(double))) stack->pushBool(false);
else {
@@ -353,8 +353,8 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetString") == 0) {
stack->correctParams(2);
- int Start = stack->pop()->GetInt();
- const char *Val = stack->pop()->GetString();
+ int Start = stack->pop()->getInt();
+ const char *Val = stack->pop()->getString();
if (!CheckBounds(script, Start, strlen(Val) + 1)) stack->pushBool(false);
else {
@@ -369,13 +369,13 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetPointer") == 0) {
stack->correctParams(2);
- int Start = stack->pop()->GetInt();
+ int Start = stack->pop()->getInt();
/* CScValue *Val = */ stack->pop();
if (!CheckBounds(script, Start, sizeof(void *))) stack->pushBool(false);
else {
/*
- int Pointer = (int)Val->GetMemBuffer();
+ int Pointer = (int)Val->getMemBuffer();
memcpy((byte *)_buffer+Start, &Pointer, sizeof(void*));
stack->pushBool(true);
*/
@@ -408,13 +408,13 @@ HRESULT CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack
//////////////////////////////////////////////////////////////////////////
CScValue *CSXMemBuffer::scGetProperty(const char *name) {
- _scValue->SetNULL();
+ _scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Type") == 0) {
- _scValue->SetString("membuffer");
+ _scValue->setString("membuffer");
return _scValue;
}
@@ -422,7 +422,7 @@ CScValue *CSXMemBuffer::scGetProperty(const char *name) {
// Size (RO)
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Size") == 0) {
- _scValue->SetInt(_size);
+ _scValue->setInt(_size);
return _scValue;
}
@@ -438,7 +438,7 @@ HRESULT CSXMemBuffer::scSetProperty(const char *name, CScValue *value) {
//////////////////////////////////////////////////////////////////////////
if(strcmp(name, "Length")==0){
int OrigLength = _length;
- _length = max(value->GetInt(0), 0);
+ _length = max(value->getInt(0), 0);
char PropName[20];
if(_length < OrigLength){
diff --git a/engines/wintermute/Base/scriptables/SXStore.cpp b/engines/wintermute/Base/scriptables/SXStore.cpp
index a1d41c2db6..6d0461df54 100644
--- a/engines/wintermute/Base/scriptables/SXStore.cpp
+++ b/engines/wintermute/Base/scriptables/SXStore.cpp
@@ -108,7 +108,7 @@ HRESULT CSXStore::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "ValidateProducts") == 0) {
stack->correctParams(1);
- const char *prodIdList = stack->pop()->GetString();
+ const char *prodIdList = stack->pop()->getString();
_lastProductRequestOwner = script->_owner;
ValidateProducts(prodIdList);
stack->pushNULL();
@@ -119,14 +119,14 @@ HRESULT CSXStore::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GetValidProduct") == 0) {
stack->correctParams(1);
- int index = stack->pop()->GetInt();
+ int index = stack->pop()->getInt();
if (index >= 0 && index < _validProducts.GetSize()) {
CScValue *prod = stack->getPushValue();
if (prod) {
- prod->SetProperty("Id", _validProducts[index]->GetId());
- prod->SetProperty("Name", _validProducts[index]->GetName());
- prod->SetProperty("Description", _validProducts[index]->GetDesc());
- prod->SetProperty("Price", _validProducts[index]->GetPrice());
+ prod->setProperty("Id", _validProducts[index]->GetId());
+ prod->setProperty("Name", _validProducts[index]->GetName());
+ prod->setProperty("Description", _validProducts[index]->GetDesc());
+ prod->setProperty("Price", _validProducts[index]->GetPrice());
}
} else
stack->pushNULL();
@@ -138,7 +138,7 @@ HRESULT CSXStore::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GetInvalidProduct") == 0) {
stack->correctParams(1);
- int index = stack->pop()->GetInt();
+ int index = stack->pop()->getInt();
if (index >= 0 && index < _invalidProducts.size())
stack->pushString(_invalidProducts[index].c_str());
else
@@ -151,13 +151,13 @@ HRESULT CSXStore::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GetTransaction") == 0) {
stack->correctParams(1);
- int index = stack->pop()->GetInt();
+ int index = stack->pop()->getInt();
if (index >= 0 && index < _transactions.GetSize()) {
CScValue *trans = stack->getPushValue();
if (trans) {
- trans->SetProperty("Id", _transactions[index]->GetId());
- trans->SetProperty("ProductId", _transactions[index]->GetProductId());
- trans->SetProperty("State", _transactions[index]->GetState());
+ trans->setProperty("Id", _transactions[index]->GetId());
+ trans->setProperty("ProductId", _transactions[index]->GetProductId());
+ trans->setProperty("State", _transactions[index]->GetState());
}
} else
stack->pushNULL();
@@ -169,7 +169,7 @@ HRESULT CSXStore::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Purchase") == 0) {
stack->correctParams(1);
- const char *prodId = stack->pop()->GetString();
+ const char *prodId = stack->pop()->getString();
stack->pushBool(Purchase(script, prodId));
return S_OK;
@@ -179,7 +179,7 @@ HRESULT CSXStore::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "FinishTransaction") == 0) {
stack->correctParams(1);
- const char *transId = stack->pop()->GetString();
+ const char *transId = stack->pop()->getString();
stack->pushBool(FinishTransaction(script, transId));
return S_OK;
@@ -200,7 +200,7 @@ HRESULT CSXStore::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "UnlockProduct") == 0) {
stack->correctParams(1);
- const char *prodId = stack->pop()->GetString();
+ const char *prodId = stack->pop()->getString();
Game->_registry->WriteBool("Purchases", prodId, true);
Game->_registry->SaveValues();
@@ -215,7 +215,7 @@ HRESULT CSXStore::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "IsProductUnlocked") == 0) {
stack->correctParams(1);
- const char *prodId = stack->pop()->GetString();
+ const char *prodId = stack->pop()->getString();
stack->pushBool(Game->_registry->ReadBool("Purchases", prodId, false));
@@ -228,48 +228,48 @@ HRESULT CSXStore::scCallMethod(CScScript *script, CScStack *stack, CScStack *thi
//////////////////////////////////////////////////////////////////////////
CScValue *CSXStore::scGetProperty(const char *name) {
- _scValue->SetNULL();
+ _scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Type") == 0) {
- _scValue->SetString("store");
+ _scValue->setString("store");
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// Available (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Available") == 0) {
- _scValue->SetBool(IsAvailable());
+ _scValue->setBool(IsAvailable());
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// EventsEnabled (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "EventsEnabled") == 0) {
- _scValue->SetBool(GetEventsEnabled());
+ _scValue->setBool(GetEventsEnabled());
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumValidProducts (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "NumValidProducts") == 0) {
- _scValue->SetInt(_validProducts.GetSize());
+ _scValue->setInt(_validProducts.GetSize());
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumInvalidProducts (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "NumInvalidProducts") == 0) {
- _scValue->SetInt(_invalidProducts.size());
+ _scValue->setInt(_invalidProducts.size());
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
// NumTransactions (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "NumTransactions") == 0) {
- _scValue->SetInt(_transactions.GetSize());
+ _scValue->setInt(_transactions.GetSize());
return _scValue;
}
diff --git a/engines/wintermute/Base/scriptables/SXString.cpp b/engines/wintermute/Base/scriptables/SXString.cpp
index 36dc257229..4f6bd5a33d 100644
--- a/engines/wintermute/Base/scriptables/SXString.cpp
+++ b/engines/wintermute/Base/scriptables/SXString.cpp
@@ -51,14 +51,14 @@ CSXString::CSXString(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
stack->correctParams(1);
CScValue *Val = stack->pop();
- if (Val->IsInt()) {
- _capacity = MAX(0, Val->GetInt());
+ if (Val->isInt()) {
+ _capacity = MAX(0, Val->getInt());
if (_capacity > 0) {
_string = new char[_capacity];
memset(_string, 0, _capacity);
}
} else {
- SetStringVal(Val->GetString());
+ SetStringVal(Val->getString());
}
if (_capacity == 0) SetStringVal("");
@@ -105,8 +105,8 @@ HRESULT CSXString::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Substring") == 0) {
stack->correctParams(2);
- int start = stack->pop()->GetInt();
- int end = stack->pop()->GetInt();
+ int start = stack->pop()->getInt();
+ int end = stack->pop()->getInt();
if (end < start) CBUtils::Swap(&start, &end);
@@ -136,17 +136,17 @@ HRESULT CSXString::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Substr") == 0) {
stack->correctParams(2);
- int start = stack->pop()->GetInt();
+ int start = stack->pop()->getInt();
CScValue *val = stack->pop();
- int len = val->GetInt();
+ int len = val->getInt();
- if (!val->IsNULL() && len <= 0) {
+ if (!val->isNULL() && len <= 0) {
stack->pushString("");
return S_OK;
}
- if (val->IsNULL()) len = strlen(_string) - start;
+ if (val->isNULL()) len = strlen(_string) - start;
// try {
WideString str;
@@ -219,8 +219,8 @@ HRESULT CSXString::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
else if (strcmp(name, "IndexOf") == 0) {
stack->correctParams(2);
- const char *strToFind = stack->pop()->GetString();
- int index = stack->pop()->GetInt();
+ const char *strToFind = stack->pop()->getString();
+ int index = stack->pop()->getInt();
WideString str;
if (Game->_textEncoding == TEXT_UTF8)
@@ -247,7 +247,7 @@ HRESULT CSXString::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
stack->correctParams(1);
CScValue *Val = stack->pop();
char Separators[MAX_PATH] = ",";
- if (!Val->IsNULL()) strcpy(Separators, Val->GetString());
+ if (!Val->isNULL()) strcpy(Separators, Val->getString());
CSXArray *Array = new CSXArray(Game);
if (!Array) {
@@ -318,13 +318,13 @@ HRESULT CSXString::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
//////////////////////////////////////////////////////////////////////////
CScValue *CSXString::scGetProperty(const char *name) {
- _scValue->SetNULL();
+ _scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
// Type (RO)
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Type") == 0) {
- _scValue->SetString("string");
+ _scValue->setString("string");
return _scValue;
}
//////////////////////////////////////////////////////////////////////////
@@ -333,9 +333,9 @@ CScValue *CSXString::scGetProperty(const char *name) {
else if (strcmp(name, "Length") == 0) {
if (Game->_textEncoding == TEXT_UTF8) {
WideString wstr = StringUtil::Utf8ToWide(_string);
- _scValue->SetInt(wstr.size());
+ _scValue->setInt(wstr.size());
} else
- _scValue->SetInt(strlen(_string));
+ _scValue->setInt(strlen(_string));
return _scValue;
}
@@ -343,7 +343,7 @@ CScValue *CSXString::scGetProperty(const char *name) {
// Capacity
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Capacity") == 0) {
- _scValue->SetInt(_capacity);
+ _scValue->setInt(_capacity);
return _scValue;
}
@@ -357,7 +357,7 @@ HRESULT CSXString::scSetProperty(const char *name, CScValue *value) {
// Capacity
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Capacity") == 0) {
- int NewCap = value->GetInt();
+ int NewCap = value->getInt();
if (NewCap < strlen(_string) + 1) Game->LOG(0, "Warning: cannot lower string capacity");
else if (NewCap != _capacity) {
char *NewStr = new char[NewCap];
diff --git a/engines/wintermute/Base/scriptables/ScEngine.cpp b/engines/wintermute/Base/scriptables/ScEngine.cpp
index e840d0cd78..8aca4c9edf 100644
--- a/engines/wintermute/Base/scriptables/ScEngine.cpp
+++ b/engines/wintermute/Base/scriptables/ScEngine.cpp
@@ -105,17 +105,17 @@ CScEngine::CScEngine(CBGame *inGame): CBBase(inGame) {
// register 'Game' as global variable
- if (!_globals->PropExists("Game")) {
+ if (!_globals->propExists("Game")) {
CScValue val(Game);
- val.SetNative(Game, true);
- _globals->SetProp("Game", &val);
+ val.setNative(Game, true);
+ _globals->setProp("Game", &val);
}
// register 'Math' as global variable
- if (!_globals->PropExists("Math")) {
+ if (!_globals->propExists("Math")) {
CScValue val(Game);
- val.SetNative(Game->_mathClass, true);
- _globals->SetProp("Math", &val);
+ val.setNative(Game->_mathClass, true);
+ _globals->setProp("Math", &val);
}
// prepare script cache
@@ -250,11 +250,11 @@ CScScript *CScEngine::RunScript(const char *Filename, CBScriptHolder *Owner) {
} else {
// publish the "self" pseudo-variable
CScValue val(Game);
- if (Owner)val.SetNative(Owner, true);
- else val.SetNULL();
+ if (Owner)val.setNative(Owner, true);
+ else val.setNULL();
- script->_globals->SetProp("self", &val);
- script->_globals->SetProp("this", &val);
+ script->_globals->setProp("self", &val);
+ script->_globals->setProp("this", &val);
_scripts.Add(script);
Game->GetDebugMgr()->OnScriptInit(script);
diff --git a/engines/wintermute/Base/scriptables/ScScript.cpp b/engines/wintermute/Base/scriptables/ScScript.cpp
index 61e1e91282..217233534c 100644
--- a/engines/wintermute/Base/scriptables/ScScript.cpp
+++ b/engines/wintermute/Base/scriptables/ScScript.cpp
@@ -486,16 +486,16 @@ HRESULT CScScript::ExecuteInstruction() {
switch (inst) {
case II_DEF_VAR:
- _operand->SetNULL();
+ _operand->setNULL();
dw = GetDWORD();
if (_scopeStack->_sP < 0) {
- _globals->SetProp(_symbols[dw], _operand);
+ _globals->setProp(_symbols[dw], _operand);
if (Game->GetDebugMgr()->_enabled)
- Game->GetDebugMgr()->OnVariableInit(WME_DBGVAR_SCRIPT, this, NULL, _globals->GetProp(_symbols[dw]), _symbols[dw]);
+ Game->GetDebugMgr()->OnVariableInit(WME_DBGVAR_SCRIPT, this, NULL, _globals->getProp(_symbols[dw]), _symbols[dw]);
} else {
- _scopeStack->getTop()->SetProp(_symbols[dw], _operand);
+ _scopeStack->getTop()->setProp(_symbols[dw], _operand);
if (Game->GetDebugMgr()->_enabled)
- Game->GetDebugMgr()->OnVariableInit(WME_DBGVAR_SCOPE, this, _scopeStack->getTop(), _scopeStack->getTop()->GetProp(_symbols[dw]), _symbols[dw]);
+ Game->GetDebugMgr()->OnVariableInit(WME_DBGVAR_SCOPE, this, _scopeStack->getTop(), _scopeStack->getTop()->getProp(_symbols[dw]), _symbols[dw]);
}
break;
@@ -505,12 +505,12 @@ HRESULT CScScript::ExecuteInstruction() {
dw = GetDWORD();
/* char *Temp = _symbols[dw]; // TODO delete */
// only create global var if it doesn't exist
- if (!_engine->_globals->PropExists(_symbols[dw])) {
- _operand->SetNULL();
- _engine->_globals->SetProp(_symbols[dw], _operand, false, inst == II_DEF_CONST_VAR);
+ if (!_engine->_globals->propExists(_symbols[dw])) {
+ _operand->setNULL();
+ _engine->_globals->setProp(_symbols[dw], _operand, false, inst == II_DEF_CONST_VAR);
if (Game->GetDebugMgr()->_enabled)
- Game->GetDebugMgr()->OnVariableInit(WME_DBGVAR_GLOBAL, this, NULL, _engine->_globals->GetProp(_symbols[dw]), _symbols[dw]);
+ Game->GetDebugMgr()->OnVariableInit(WME_DBGVAR_GLOBAL, this, NULL, _engine->_globals->getProp(_symbols[dw]), _symbols[dw]);
}
break;
}
@@ -520,7 +520,7 @@ HRESULT CScScript::ExecuteInstruction() {
Game->GetDebugMgr()->OnScriptShutdownScope(this, _scopeStack->getTop());
_scopeStack->pop();
- _iP = (uint32)_callStack->pop()->GetInt();
+ _iP = (uint32)_callStack->pop()->getInt();
if (_scopeStack->_sP < 0) Game->GetDebugMgr()->OnScriptChangeScope(this, NULL);
else Game->GetDebugMgr()->OnScriptChangeScope(this, _scopeStack->getTop());
@@ -543,7 +543,7 @@ HRESULT CScScript::ExecuteInstruction() {
case II_CALL:
dw = GetDWORD();
- _operand->SetInt(_iP);
+ _operand->setInt(_iP);
_callStack->push(_operand);
_iP = dw;
@@ -553,7 +553,7 @@ HRESULT CScScript::ExecuteInstruction() {
case II_CALL_BY_EXP: {
// push var
// push string
- str = _stack->pop()->GetString();
+ str = _stack->pop()->getString();
char *MethodName = new char[strlen(str) + 1];
strcpy(MethodName, str);
@@ -564,15 +564,15 @@ HRESULT CScScript::ExecuteInstruction() {
bool TriedNative = false;
// we are already calling this method, try native
- if (_thread && _methodThread && strcmp(MethodName, _threadEvent) == 0 && var->_type == VAL_NATIVE && _owner == var->GetNative()) {
+ if (_thread && _methodThread && strcmp(MethodName, _threadEvent) == 0 && var->_type == VAL_NATIVE && _owner == var->getNative()) {
TriedNative = true;
res = var->_valNative->scCallMethod(this, _stack, _thisStack, MethodName);
}
if (FAILED(res)) {
- if (var->IsNative() && var->GetNative()->canHandleMethod(MethodName)) {
+ if (var->isNative() && var->getNative()->canHandleMethod(MethodName)) {
if (!_unbreakable) {
- _waitScript = var->GetNative()->invokeMethodThread(MethodName);
+ _waitScript = var->getNative()->invokeMethodThread(MethodName);
if (!_waitScript) {
_stack->correctParams(0);
RuntimeError("Error invoking method '%s'.", MethodName);
@@ -591,21 +591,21 @@ HRESULT CScScript::ExecuteInstruction() {
break;
}
/*
- CScValue* val = var->GetProp(MethodName);
+ CScValue* val = var->getProp(MethodName);
if(val){
- dw = GetFuncPos(val->GetString());
+ dw = GetFuncPos(val->getString());
if(dw==0){
- TExternalFunction* f = GetExternal(val->GetString());
+ TExternalFunction* f = GetExternal(val->getString());
if(f){
ExternalCall(_stack, _thisStack, f);
}
else{
// not an internal nor external, try for native function
- Game->ExternalCall(this, _stack, _thisStack, val->GetString());
+ Game->ExternalCall(this, _stack, _thisStack, val->getString());
}
}
else{
- _operand->SetInt(_iP);
+ _operand->setInt(_iP);
_callStack->Push(_operand);
_iP = dw;
}
@@ -637,7 +637,7 @@ HRESULT CScScript::ExecuteInstruction() {
break;
}
case II_SCOPE:
- _operand->SetNULL();
+ _operand->setNULL();
_scopeStack->push(_operand);
if (_scopeStack->_sP < 0) Game->GetDebugMgr()->OnScriptChangeScope(this, NULL);
@@ -651,7 +651,7 @@ HRESULT CScScript::ExecuteInstruction() {
break;
case II_CREATE_OBJECT:
- _operand->SetObject();
+ _operand->setObject();
_stack->push(_operand);
break;
@@ -662,7 +662,7 @@ HRESULT CScScript::ExecuteInstruction() {
case II_PUSH_VAR: {
CScValue *var = GetVar(_symbols[GetDWORD()]);
if (false && /*var->_type==VAL_OBJECT ||*/ var->_type == VAL_NATIVE) {
- _operand->SetReference(var);
+ _operand->setReference(var);
_stack->push(_operand);
} else _stack->push(var);
break;
@@ -670,7 +670,7 @@ HRESULT CScScript::ExecuteInstruction() {
case II_PUSH_VAR_REF: {
CScValue *var = GetVar(_symbols[GetDWORD()]);
- _operand->SetReference(var);
+ _operand->setReference(var);
_stack->push(_operand);
break;
}
@@ -682,12 +682,12 @@ HRESULT CScScript::ExecuteInstruction() {
CScValue *val = _stack->pop();
if (!val) {
RuntimeError("Script stack corruption detected. Please report this script at WME bug reports forum.");
- var->SetNULL();
+ var->setNULL();
} else {
- if (val->GetType() == VAL_VARIABLE_REF) val = val->_valRef;
- if (val->_type == VAL_NATIVE) var->SetValue(val);
+ if (val->getType() == VAL_VARIABLE_REF) val = val->_valRef;
+ if (val->_type == VAL_NATIVE) var->setValue(val);
else {
- var->Copy(val);
+ var->copy(val);
}
}
@@ -725,12 +725,12 @@ HRESULT CScScript::ExecuteInstruction() {
break;
case II_PUSH_THIS_FROM_STACK:
- _operand->SetReference(_stack->getTop());
+ _operand->setReference(_stack->getTop());
_thisStack->push(_operand);
break;
case II_PUSH_THIS:
- _operand->SetReference(GetVar(_symbols[GetDWORD()]));
+ _operand->setReference(GetVar(_symbols[GetDWORD()]));
_thisStack->push(_operand);
break;
@@ -739,8 +739,8 @@ HRESULT CScScript::ExecuteInstruction() {
break;
case II_PUSH_BY_EXP: {
- str = _stack->pop()->GetString();
- CScValue *val = _stack->pop()->GetProp(str);
+ str = _stack->pop()->getString();
+ CScValue *val = _stack->pop()->getProp(str);
if (val) _stack->push(val);
else _stack->pushNULL();
@@ -748,14 +748,14 @@ HRESULT CScScript::ExecuteInstruction() {
}
case II_POP_BY_EXP: {
- str = _stack->pop()->GetString();
+ str = _stack->pop()->getString();
CScValue *var = _stack->pop();
CScValue *val = _stack->pop();
if (val == NULL) {
RuntimeError("Script stack corruption detected. Please report this script at WME bug reports forum.");
- var->SetNULL();
- } else var->SetProp(str, val);
+ var->setNULL();
+ } else var->setProp(str, val);
if (Game->GetDebugMgr()->_enabled)
Game->GetDebugMgr()->OnVariableChangeValue(var, NULL);
@@ -768,7 +768,7 @@ HRESULT CScScript::ExecuteInstruction() {
break;
case II_POP_REG1:
- _reg1->Copy(_stack->pop());
+ _reg1->copy(_stack->pop());
break;
case II_JMP:
@@ -777,12 +777,12 @@ HRESULT CScScript::ExecuteInstruction() {
case II_JMP_FALSE: {
dw = GetDWORD();
- //if(!_stack->pop()->GetBool()) _iP = dw;
+ //if(!_stack->pop()->getBool()) _iP = dw;
CScValue *Val = _stack->pop();
if (!Val) {
RuntimeError("Script corruption detected. Did you use '=' instead of '==' for comparison?");
} else {
- if (!Val->GetBool()) _iP = dw;
+ if (!Val->getBool()) _iP = dw;
}
break;
}
@@ -791,16 +791,16 @@ HRESULT CScScript::ExecuteInstruction() {
op2 = _stack->pop();
op1 = _stack->pop();
- if (op1->IsNULL() || op2->IsNULL()) _operand->SetNULL();
- else if (op1->GetType() == VAL_STRING || op2->GetType() == VAL_STRING) {
- char *tempStr = new char [strlen(op1->GetString()) + strlen(op2->GetString()) + 1];
- strcpy(tempStr, op1->GetString());
- strcat(tempStr, op2->GetString());
- _operand->SetString(tempStr);
+ if (op1->isNULL() || op2->isNULL()) _operand->setNULL();
+ else if (op1->getType() == VAL_STRING || op2->getType() == VAL_STRING) {
+ char *tempStr = new char [strlen(op1->getString()) + strlen(op2->getString()) + 1];
+ strcpy(tempStr, op1->getString());
+ strcat(tempStr, op2->getString());
+ _operand->setString(tempStr);
delete [] tempStr;
- } else if (op1->GetType() == VAL_INT && op2->GetType() == VAL_INT)
- _operand->SetInt(op1->GetInt() + op2->GetInt());
- else _operand->SetFloat(op1->GetFloat() + op2->GetFloat());
+ } else if (op1->getType() == VAL_INT && op2->getType() == VAL_INT)
+ _operand->setInt(op1->getInt() + op2->getInt());
+ else _operand->setFloat(op1->getFloat() + op2->getFloat());
_stack->push(_operand);
@@ -810,10 +810,10 @@ HRESULT CScScript::ExecuteInstruction() {
op2 = _stack->pop();
op1 = _stack->pop();
- if (op1->IsNULL() || op2->IsNULL()) _operand->SetNULL();
- else if (op1->GetType() == VAL_INT && op2->GetType() == VAL_INT)
- _operand->SetInt(op1->GetInt() - op2->GetInt());
- else _operand->SetFloat(op1->GetFloat() - op2->GetFloat());
+ if (op1->isNULL() || op2->isNULL()) _operand->setNULL();
+ else if (op1->getType() == VAL_INT && op2->getType() == VAL_INT)
+ _operand->setInt(op1->getInt() - op2->getInt());
+ else _operand->setFloat(op1->getFloat() - op2->getFloat());
_stack->push(_operand);
@@ -823,10 +823,10 @@ HRESULT CScScript::ExecuteInstruction() {
op2 = _stack->pop();
op1 = _stack->pop();
- if (op1->IsNULL() || op2->IsNULL()) _operand->SetNULL();
- else if (op1->GetType() == VAL_INT && op2->GetType() == VAL_INT)
- _operand->SetInt(op1->GetInt() * op2->GetInt());
- else _operand->SetFloat(op1->GetFloat() * op2->GetFloat());
+ if (op1->isNULL() || op2->isNULL()) _operand->setNULL();
+ else if (op1->getType() == VAL_INT && op2->getType() == VAL_INT)
+ _operand->setInt(op1->getInt() * op2->getInt());
+ else _operand->setFloat(op1->getFloat() * op2->getFloat());
_stack->push(_operand);
@@ -836,10 +836,10 @@ HRESULT CScScript::ExecuteInstruction() {
op2 = _stack->pop();
op1 = _stack->pop();
- if (op2->GetFloat() == 0.0f) RuntimeError("Division by zero.");
+ if (op2->getFloat() == 0.0f) RuntimeError("Division by zero.");
- if (op1->IsNULL() || op2->IsNULL() || op2->GetFloat() == 0.0f) _operand->SetNULL();
- else _operand->SetFloat(op1->GetFloat() / op2->GetFloat());
+ if (op1->isNULL() || op2->isNULL() || op2->getFloat() == 0.0f) _operand->setNULL();
+ else _operand->setFloat(op1->getFloat() / op2->getFloat());
_stack->push(_operand);
@@ -849,10 +849,10 @@ HRESULT CScScript::ExecuteInstruction() {
op2 = _stack->pop();
op1 = _stack->pop();
- if (op2->GetInt() == 0) RuntimeError("Division by zero.");
+ if (op2->getInt() == 0) RuntimeError("Division by zero.");
- if (op1->IsNULL() || op2->IsNULL() || op2->GetInt() == 0) _operand->SetNULL();
- else _operand->SetInt(op1->GetInt() % op2->GetInt());
+ if (op1->isNULL() || op2->isNULL() || op2->getInt() == 0) _operand->setNULL();
+ else _operand->setInt(op1->getInt() % op2->getInt());
_stack->push(_operand);
@@ -860,9 +860,9 @@ HRESULT CScScript::ExecuteInstruction() {
case II_NOT:
op1 = _stack->pop();
- //if(op1->IsNULL()) _operand->SetNULL();
- if (op1->IsNULL()) _operand->SetBool(true);
- else _operand->SetBool(!op1->GetBool());
+ //if(op1->isNULL()) _operand->setNULL();
+ if (op1->isNULL()) _operand->setBool(true);
+ else _operand->setBool(!op1->getBool());
_stack->push(_operand);
break;
@@ -872,9 +872,9 @@ HRESULT CScScript::ExecuteInstruction() {
op1 = _stack->pop();
if (op1 == NULL || op2 == NULL) {
RuntimeError("Script corruption detected. Did you use '=' instead of '==' for comparison?");
- _operand->SetBool(false);
+ _operand->setBool(false);
} else {
- _operand->SetBool(op1->GetBool() && op2->GetBool());
+ _operand->setBool(op1->getBool() && op2->getBool());
}
_stack->push(_operand);
break;
@@ -884,9 +884,9 @@ HRESULT CScScript::ExecuteInstruction() {
op1 = _stack->pop();
if (op1 == NULL || op2 == NULL) {
RuntimeError("Script corruption detected. Did you use '=' instead of '==' for comparison?");
- _operand->SetBool(false);
+ _operand->setBool(false);
} else {
- _operand->SetBool(op1->GetBool() || op2->GetBool());
+ _operand->setBool(op1->getBool() || op2->getBool());
}
_stack->push(_operand);
break;
@@ -896,22 +896,22 @@ HRESULT CScScript::ExecuteInstruction() {
op1 = _stack->pop();
/*
- if((op1->IsNULL() && !op2->IsNULL()) || (!op1->IsNULL() && op2->IsNULL())) _operand->SetBool(false);
- else if(op1->IsNative() && op2->IsNative()){
- _operand->SetBool(op1->GetNative() == op2->GetNative());
+ if((op1->isNULL() && !op2->isNULL()) || (!op1->isNULL() && op2->isNULL())) _operand->setBool(false);
+ else if(op1->isNative() && op2->isNative()){
+ _operand->setBool(op1->getNative() == op2->getNative());
}
- else if(op1->GetType()==VAL_STRING || op2->GetType()==VAL_STRING){
- _operand->SetBool(scumm_stricmp(op1->GetString(), op2->GetString())==0);
+ else if(op1->getType()==VAL_STRING || op2->getType()==VAL_STRING){
+ _operand->setBool(scumm_stricmp(op1->getString(), op2->getString())==0);
}
- else if(op1->GetType()==VAL_FLOAT && op2->GetType()==VAL_FLOAT){
- _operand->SetBool(op1->GetFloat() == op2->GetFloat());
+ else if(op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
+ _operand->setBool(op1->getFloat() == op2->getFloat());
}
else{
- _operand->SetBool(op1->GetInt() == op2->GetInt());
+ _operand->setBool(op1->getInt() == op2->getInt());
}
*/
- _operand->SetBool(CScValue::Compare(op1, op2) == 0);
+ _operand->setBool(CScValue::compare(op1, op2) == 0);
_stack->push(_operand);
break;
@@ -920,22 +920,22 @@ HRESULT CScScript::ExecuteInstruction() {
op1 = _stack->pop();
/*
- if((op1->IsNULL() && !op2->IsNULL()) || (!op1->IsNULL() && op2->IsNULL())) _operand->SetBool(true);
- else if(op1->IsNative() && op2->IsNative()){
- _operand->SetBool(op1->GetNative() != op2->GetNative());
+ if((op1->isNULL() && !op2->isNULL()) || (!op1->isNULL() && op2->isNULL())) _operand->setBool(true);
+ else if(op1->isNative() && op2->isNative()){
+ _operand->setBool(op1->getNative() != op2->getNative());
}
- else if(op1->GetType()==VAL_STRING || op2->GetType()==VAL_STRING){
- _operand->SetBool(scumm_stricmp(op1->GetString(), op2->GetString())!=0);
+ else if(op1->getType()==VAL_STRING || op2->getType()==VAL_STRING){
+ _operand->setBool(scumm_stricmp(op1->getString(), op2->getString())!=0);
}
- else if(op1->GetType()==VAL_FLOAT && op2->GetType()==VAL_FLOAT){
- _operand->SetBool(op1->GetFloat() != op2->GetFloat());
+ else if(op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
+ _operand->setBool(op1->getFloat() != op2->getFloat());
}
else{
- _operand->SetBool(op1->GetInt() != op2->GetInt());
+ _operand->setBool(op1->getInt() != op2->getInt());
}
*/
- _operand->SetBool(CScValue::Compare(op1, op2) != 0);
+ _operand->setBool(CScValue::compare(op1, op2) != 0);
_stack->push(_operand);
break;
@@ -944,13 +944,13 @@ HRESULT CScScript::ExecuteInstruction() {
op1 = _stack->pop();
/*
- if(op1->GetType()==VAL_FLOAT && op2->GetType()==VAL_FLOAT){
- _operand->SetBool(op1->GetFloat() < op2->GetFloat());
+ if(op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
+ _operand->setBool(op1->getFloat() < op2->getFloat());
}
- else _operand->SetBool(op1->GetInt() < op2->GetInt());
+ else _operand->setBool(op1->getInt() < op2->getInt());
*/
- _operand->SetBool(CScValue::Compare(op1, op2) < 0);
+ _operand->setBool(CScValue::compare(op1, op2) < 0);
_stack->push(_operand);
break;
@@ -959,13 +959,13 @@ HRESULT CScScript::ExecuteInstruction() {
op1 = _stack->pop();
/*
- if(op1->GetType()==VAL_FLOAT && op2->GetType()==VAL_FLOAT){
- _operand->SetBool(op1->GetFloat() > op2->GetFloat());
+ if(op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
+ _operand->setBool(op1->getFloat() > op2->getFloat());
}
- else _operand->SetBool(op1->GetInt() > op2->GetInt());
+ else _operand->setBool(op1->getInt() > op2->getInt());
*/
- _operand->SetBool(CScValue::Compare(op1, op2) > 0);
+ _operand->setBool(CScValue::compare(op1, op2) > 0);
_stack->push(_operand);
break;
@@ -974,13 +974,13 @@ HRESULT CScScript::ExecuteInstruction() {
op1 = _stack->pop();
/*
- if(op1->GetType()==VAL_FLOAT && op2->GetType()==VAL_FLOAT){
- _operand->SetBool(op1->GetFloat() <= op2->GetFloat());
+ if(op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
+ _operand->setBool(op1->getFloat() <= op2->getFloat());
}
- else _operand->SetBool(op1->GetInt() <= op2->GetInt());
+ else _operand->setBool(op1->getInt() <= op2->getInt());
*/
- _operand->SetBool(CScValue::Compare(op1, op2) <= 0);
+ _operand->setBool(CScValue::compare(op1, op2) <= 0);
_stack->push(_operand);
break;
@@ -989,13 +989,13 @@ HRESULT CScScript::ExecuteInstruction() {
op1 = _stack->pop();
/*
- if(op1->GetType()==VAL_FLOAT && op2->GetType()==VAL_FLOAT){
- _operand->SetBool(op1->GetFloat() >= op2->GetFloat());
+ if(op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
+ _operand->setBool(op1->getFloat() >= op2->getFloat());
}
- else _operand->SetBool(op1->GetInt() >= op2->GetInt());
+ else _operand->setBool(op1->getInt() >= op2->getInt());
*/
- _operand->SetBool(CScValue::Compare(op1, op2) >= 0);
+ _operand->setBool(CScValue::compare(op1, op2) >= 0);
_stack->push(_operand);
break;
@@ -1003,8 +1003,8 @@ HRESULT CScScript::ExecuteInstruction() {
op2 = _stack->pop();
op1 = _stack->pop();
- //_operand->SetBool(op1->GetType()==op2->GetType() && op1->GetFloat()==op2->GetFloat());
- _operand->SetBool(CScValue::CompareStrict(op1, op2) == 0);
+ //_operand->setBool(op1->getType()==op2->getType() && op1->getFloat()==op2->getFloat());
+ _operand->setBool(CScValue::compareStrict(op1, op2) == 0);
_stack->push(_operand);
break;
@@ -1013,8 +1013,8 @@ HRESULT CScScript::ExecuteInstruction() {
op2 = _stack->pop();
op1 = _stack->pop();
- //_operand->SetBool(op1->GetType()!=op2->GetType() || op1->GetFloat()!=op2->GetFloat());
- _operand->SetBool(CScValue::CompareStrict(op1, op2) != 0);
+ //_operand->setBool(op1->getType()!=op2->getType() || op1->getFloat()!=op2->getFloat());
+ _operand->setBool(CScValue::compareStrict(op1, op2) != 0);
_stack->push(_operand);
break;
@@ -1077,17 +1077,17 @@ CScValue *CScScript::GetVar(char *name) {
// scope locals
if (_scopeStack->_sP >= 0) {
- if (_scopeStack->getTop()->PropExists(name)) ret = _scopeStack->getTop()->GetProp(name);
+ if (_scopeStack->getTop()->propExists(name)) ret = _scopeStack->getTop()->getProp(name);
}
// script globals
if (ret == NULL) {
- if (_globals->PropExists(name)) ret = _globals->GetProp(name);
+ if (_globals->propExists(name)) ret = _globals->getProp(name);
}
// engine globals
if (ret == NULL) {
- if (_engine->_globals->PropExists(name)) ret = _engine->_globals->GetProp(name);
+ if (_engine->_globals->propExists(name)) ret = _engine->_globals->getProp(name);
}
if (ret == NULL) {
@@ -1096,11 +1096,11 @@ CScValue *CScScript::GetVar(char *name) {
CScValue *Val = new CScValue(Game);
CScValue *Scope = _scopeStack->getTop();
if (Scope) {
- Scope->SetProp(name, Val);
- ret = _scopeStack->getTop()->GetProp(name);
+ Scope->setProp(name, Val);
+ ret = _scopeStack->getTop()->getProp(name);
} else {
- _globals->SetProp(name, Val);
- ret = _globals->GetProp(name);
+ _globals->setProp(name, Val);
+ ret = _globals->getProp(name);
}
delete Val;
}
@@ -1352,29 +1352,29 @@ HRESULT CScScript::ExternalCall(CScStack *stack, CScStack *thisStack, CScScript:
CScValue *Val = stack->pop();
switch (Function->params[i]) {
case TYPE_BOOL:
- Buffer->PutDWORD((uint32)Val->GetBool());
+ Buffer->PutDWORD((uint32)Val->getBool());
break;
case TYPE_LONG:
- Buffer->PutDWORD(Val->GetInt());
+ Buffer->PutDWORD(Val->getInt());
break;
case TYPE_BYTE:
- Buffer->PutDWORD((byte)Val->GetInt());
+ Buffer->PutDWORD((byte)Val->getInt());
break;
case TYPE_STRING:
- if (Val->IsNULL()) Buffer->PutDWORD(0);
- else Buffer->PutDWORD((uint32)Val->GetString());
+ if (Val->isNULL()) Buffer->PutDWORD(0);
+ else Buffer->PutDWORD((uint32)Val->getString());
break;
case TYPE_MEMBUFFER:
- if (Val->IsNULL()) Buffer->PutDWORD(0);
- else Buffer->PutDWORD((uint32)Val->GetMemBuffer());
+ if (Val->isNULL()) Buffer->PutDWORD(0);
+ else Buffer->PutDWORD((uint32)Val->getMemBuffer());
break;
case TYPE_FLOAT: {
- float f = Val->GetFloat();
+ float f = Val->getFloat();
Buffer->PutDWORD(*((uint32 *)&f));
break;
}
case TYPE_DOUBLE: {
- double d = Val->GetFloat();
+ double d = Val->getFloat();
uint32 *pd = (uint32 *)&d;
Buffer->PutDWORD(pd[0]);
@@ -1527,7 +1527,7 @@ double CScScript::GetST0Double(void) {
//////////////////////////////////////////////////////////////////////////
HRESULT CScScript::CopyParameters(CScStack *stack) {
int i;
- int NumParams = stack->pop()->GetInt();
+ int NumParams = stack->pop()->getInt();
for (i = NumParams - 1; i >= 0; i--) {
_stack->push(stack->getAt(i));
}
diff --git a/engines/wintermute/Base/scriptables/ScStack.cpp b/engines/wintermute/Base/scriptables/ScStack.cpp
index dc953ed8d0..c00f0656e0 100644
--- a/engines/wintermute/Base/scriptables/ScStack.cpp
+++ b/engines/wintermute/Base/scriptables/ScStack.cpp
@@ -71,10 +71,10 @@ void CScStack::push(CScValue *val) {
if (_sP < _values.GetSize()) {
_values[_sP]->cleanup();
- _values[_sP]->Copy(val);
+ _values[_sP]->copy(val);
} else {
CScValue *copyVal = new CScValue(Game);
- copyVal->Copy(val);
+ copyVal->copy(val);
_values.Add(copyVal);
}
}
@@ -111,7 +111,7 @@ CScValue *CScStack::getAt(int index) {
//////////////////////////////////////////////////////////////////////////
void CScStack::correctParams(uint32 expected_params) {
- int nu_params = pop()->GetInt();
+ int nu_params = pop()->getInt();
if (expected_params < nu_params) { // too many params
while (expected_params < nu_params) {
@@ -125,7 +125,7 @@ void CScStack::correctParams(uint32 expected_params) {
while (expected_params > nu_params) {
//Push(null_val);
CScValue *null_val = new CScValue(Game);
- null_val->SetNULL();
+ null_val->setNULL();
_values.InsertAt(_sP - nu_params + 1, null_val);
nu_params++;
_sP++;
@@ -143,11 +143,11 @@ void CScStack::correctParams(uint32 expected_params) {
void CScStack::pushNULL() {
/*
CScValue* val = new CScValue(Game);
- val->SetNULL();
+ val->setNULL();
Push(val);
delete val;
*/
- getPushValue()->SetNULL();
+ getPushValue()->setNULL();
}
@@ -155,11 +155,11 @@ void CScStack::pushNULL() {
void CScStack::pushInt(int val) {
/*
CScValue* val = new CScValue(Game);
- val->SetInt(Val);
+ val->setInt(Val);
Push(val);
delete val;
*/
- getPushValue()->SetInt(val);
+ getPushValue()->setInt(val);
}
@@ -167,11 +167,11 @@ void CScStack::pushInt(int val) {
void CScStack::pushFloat(double val) {
/*
CScValue* val = new CScValue(Game);
- val->SetFloat(Val);
+ val->setFloat(Val);
Push(val);
delete val;
*/
- getPushValue()->SetFloat(val);
+ getPushValue()->setFloat(val);
}
@@ -179,11 +179,11 @@ void CScStack::pushFloat(double val) {
void CScStack::pushBool(bool val) {
/*
CScValue* val = new CScValue(Game);
- val->SetBool(Val);
+ val->setBool(Val);
Push(val);
delete val;
*/
- getPushValue()->SetBool(val);
+ getPushValue()->setBool(val);
}
@@ -191,11 +191,11 @@ void CScStack::pushBool(bool val) {
void CScStack::pushString(const char *val) {
/*
CScValue* val = new CScValue(Game);
- val->SetString(Val);
+ val->setString(Val);
Push(val);
delete val;
*/
- getPushValue()->SetString(val);
+ getPushValue()->setString(val);
}
@@ -203,12 +203,12 @@ void CScStack::pushString(const char *val) {
void CScStack::pushNative(CBScriptable *val, bool persistent) {
/*
CScValue* val = new CScValue(Game);
- val->SetNative(Val, Persistent);
+ val->setNative(Val, Persistent);
Push(val);
delete val;
*/
- getPushValue()->SetNative(val, persistent);
+ getPushValue()->setNative(val, persistent);
}
diff --git a/engines/wintermute/Base/scriptables/ScValue.cpp b/engines/wintermute/Base/scriptables/ScValue.cpp
index aede849ecc..04872fb4ae 100644
--- a/engines/wintermute/Base/scriptables/ScValue.cpp
+++ b/engines/wintermute/Base/scriptables/ScValue.cpp
@@ -58,9 +58,9 @@ CScValue::CScValue(CBGame *inGame): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CScValue::CScValue(CBGame *inGame, bool Val): CBBase(inGame) {
+CScValue::CScValue(CBGame *inGame, bool val): CBBase(inGame) {
_type = VAL_BOOL;
- _valBool = Val;
+ _valBool = val;
_valInt = 0;
_valFloat = 0.0f;
@@ -73,9 +73,9 @@ CScValue::CScValue(CBGame *inGame, bool Val): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CScValue::CScValue(CBGame *inGame, int Val): CBBase(inGame) {
+CScValue::CScValue(CBGame *inGame, int val): CBBase(inGame) {
_type = VAL_INT;
- _valInt = Val;
+ _valInt = val;
_valFloat = 0.0f;
_valBool = false;
@@ -88,9 +88,9 @@ CScValue::CScValue(CBGame *inGame, int Val): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CScValue::CScValue(CBGame *inGame, double Val): CBBase(inGame) {
+CScValue::CScValue(CBGame *inGame, double val): CBBase(inGame) {
_type = VAL_FLOAT;
- _valFloat = Val;
+ _valFloat = val;
_valInt = 0;
_valBool = false;
@@ -103,10 +103,10 @@ CScValue::CScValue(CBGame *inGame, double Val): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CScValue::CScValue(CBGame *inGame, const char *Val): CBBase(inGame) {
+CScValue::CScValue(CBGame *inGame, const char *val): CBBase(inGame) {
_type = VAL_STRING;
_valString = NULL;
- SetStringVal(Val);
+ setStringVal(val);
_valBool = false;
_valInt = 0;
@@ -119,12 +119,12 @@ CScValue::CScValue(CBGame *inGame, const char *Val): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-void CScValue::cleanup(bool IgnoreNatives) {
- DeleteProps();
+void CScValue::cleanup(bool ignoreNatives) {
+ deleteProps();
if (_valString) delete [] _valString;
- if (!IgnoreNatives) {
+ if (!ignoreNatives) {
if (_valNative && !_persistent) {
_valNative->_refCount--;
if (_valNative->_refCount <= 0) {
@@ -156,8 +156,8 @@ CScValue::~CScValue() {
//////////////////////////////////////////////////////////////////////////
-CScValue *CScValue::GetProp(const char *name) {
- if (_type == VAL_VARIABLE_REF) return _valRef->GetProp(name);
+CScValue *CScValue::getProp(const char *name) {
+ if (_type == VAL_VARIABLE_REF) return _valRef->getProp(name);
if (_type == VAL_STRING && strcmp(name, "Length") == 0) {
Game->_scValue->_type = VAL_INT;
@@ -167,10 +167,10 @@ CScValue *CScValue::GetProp(const char *name) {
#else
if (true) {
#endif
- Game->_scValue->SetInt(strlen(_valString));
+ Game->_scValue->setInt(strlen(_valString));
} else {
WideString wstr = StringUtil::Utf8ToWide(_valString);
- Game->_scValue->SetInt(wstr.size());
+ Game->_scValue->setInt(wstr.size());
}
return Game->_scValue;
@@ -188,8 +188,8 @@ CScValue *CScValue::GetProp(const char *name) {
}
//////////////////////////////////////////////////////////////////////////
-HRESULT CScValue::DeleteProp(const char *name) {
- if (_type == VAL_VARIABLE_REF) return _valRef->DeleteProp(name);
+HRESULT CScValue::deleteProp(const char *name) {
+ if (_type == VAL_VARIABLE_REF) return _valRef->deleteProp(name);
_valIter = _valObject.find(name);
if (_valIter != _valObject.end()) {
@@ -203,8 +203,8 @@ HRESULT CScValue::DeleteProp(const char *name) {
//////////////////////////////////////////////////////////////////////////
-HRESULT CScValue::SetProp(const char *name, CScValue *Val, bool CopyWhole, bool SetAsConst) {
- if (_type == VAL_VARIABLE_REF) return _valRef->SetProp(name, Val);
+HRESULT CScValue::setProp(const char *name, CScValue *Val, bool CopyWhole, bool SetAsConst) {
+ if (_type == VAL_VARIABLE_REF) return _valRef->setProp(name, Val);
HRESULT ret = E_FAIL;
if (_type == VAL_NATIVE && _valNative) {
@@ -221,7 +221,7 @@ HRESULT CScValue::SetProp(const char *name, CScValue *Val, bool CopyWhole, bool
if (!val) val = new CScValue(Game);
else val->cleanup();
- val->Copy(Val, CopyWhole);
+ val->copy(Val, CopyWhole);
val->_isConstVar = SetAsConst;
_valObject[name] = val;
@@ -247,8 +247,8 @@ HRESULT CScValue::SetProp(const char *name, CScValue *Val, bool CopyWhole, bool
//////////////////////////////////////////////////////////////////////////
-bool CScValue::PropExists(const char *name) {
- if (_type == VAL_VARIABLE_REF) return _valRef->PropExists(name);
+bool CScValue::propExists(const char *name) {
+ if (_type == VAL_VARIABLE_REF) return _valRef->propExists(name);
_valIter = _valObject.find(name);
return (_valIter != _valObject.end());
@@ -256,7 +256,7 @@ bool CScValue::PropExists(const char *name) {
//////////////////////////////////////////////////////////////////////////
-void CScValue::DeleteProps() {
+void CScValue::deleteProps() {
_valIter = _valObject.begin();
while (_valIter != _valObject.end()) {
delete(CScValue *)_valIter->_value;
@@ -270,170 +270,170 @@ void CScValue::DeleteProps() {
void CScValue::CleanProps(bool IncludingNatives) {
_valIter = _valObject.begin();
while (_valIter != _valObject.end()) {
- if (!_valIter->_value->_isConstVar && (!_valIter->_value->IsNative() || IncludingNatives)) _valIter->_value->SetNULL();
+ if (!_valIter->_value->_isConstVar && (!_valIter->_value->isNative() || IncludingNatives)) _valIter->_value->setNULL();
_valIter++;
}
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::IsNULL() {
- if (_type == VAL_VARIABLE_REF) return _valRef->IsNULL();
+bool CScValue::isNULL() {
+ if (_type == VAL_VARIABLE_REF) return _valRef->isNULL();
return (_type == VAL_NULL);
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::IsNative() {
- if (_type == VAL_VARIABLE_REF) return _valRef->IsNative();
+bool CScValue::isNative() {
+ if (_type == VAL_VARIABLE_REF) return _valRef->isNative();
return (_type == VAL_NATIVE);
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::IsString() {
- if (_type == VAL_VARIABLE_REF) return _valRef->IsString();
+bool CScValue::isString() {
+ if (_type == VAL_VARIABLE_REF) return _valRef->isString();
return (_type == VAL_STRING);
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::IsFloat() {
- if (_type == VAL_VARIABLE_REF) return _valRef->IsFloat();
+bool CScValue::isFloat() {
+ if (_type == VAL_VARIABLE_REF) return _valRef->isFloat();
return (_type == VAL_FLOAT);
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::IsInt() {
- if (_type == VAL_VARIABLE_REF) return _valRef->IsInt();
+bool CScValue::isInt() {
+ if (_type == VAL_VARIABLE_REF) return _valRef->isInt();
return (_type == VAL_INT);
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::IsBool() {
- if (_type == VAL_VARIABLE_REF) return _valRef->IsBool();
+bool CScValue::isBool() {
+ if (_type == VAL_VARIABLE_REF) return _valRef->isBool();
return (_type == VAL_BOOL);
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::IsObject() {
- if (_type == VAL_VARIABLE_REF) return _valRef->IsObject();
+bool CScValue::isObject() {
+ if (_type == VAL_VARIABLE_REF) return _valRef->isObject();
return (_type == VAL_OBJECT);
}
//////////////////////////////////////////////////////////////////////////
-TValType CScValue::GetTypeTolerant() {
- if (_type == VAL_VARIABLE_REF) return _valRef->GetType();
+TValType CScValue::getTypeTolerant() {
+ if (_type == VAL_VARIABLE_REF) return _valRef->getType();
return _type;
}
//////////////////////////////////////////////////////////////////////////
-void CScValue::SetBool(bool Val) {
+void CScValue::setBool(bool val) {
if (_type == VAL_VARIABLE_REF) {
- _valRef->SetBool(Val);
+ _valRef->setBool(val);
return;
}
if (_type == VAL_NATIVE) {
- _valNative->scSetBool(Val);
+ _valNative->scSetBool(val);
return;
}
- _valBool = Val;
+ _valBool = val;
_type = VAL_BOOL;
}
//////////////////////////////////////////////////////////////////////////
-void CScValue::SetInt(int Val) {
+void CScValue::setInt(int val) {
if (_type == VAL_VARIABLE_REF) {
- _valRef->SetInt(Val);
+ _valRef->setInt(val);
return;
}
if (_type == VAL_NATIVE) {
- _valNative->scSetInt(Val);
+ _valNative->scSetInt(val);
return;
}
- _valInt = Val;
+ _valInt = val;
_type = VAL_INT;
}
//////////////////////////////////////////////////////////////////////////
-void CScValue::SetFloat(double Val) {
+void CScValue::setFloat(double val) {
if (_type == VAL_VARIABLE_REF) {
- _valRef->SetFloat(Val);
+ _valRef->setFloat(val);
return;
}
if (_type == VAL_NATIVE) {
- _valNative->scSetFloat(Val);
+ _valNative->scSetFloat(val);
return;
}
- _valFloat = Val;
+ _valFloat = val;
_type = VAL_FLOAT;
}
//////////////////////////////////////////////////////////////////////////
-void CScValue::SetString(const char *Val) {
+void CScValue::setString(const char *val) {
if (_type == VAL_VARIABLE_REF) {
- _valRef->SetString(Val);
+ _valRef->setString(val);
return;
}
if (_type == VAL_NATIVE) {
- _valNative->scSetString(Val);
+ _valNative->scSetString(val);
return;
}
- SetStringVal(Val);
+ setStringVal(val);
if (_valString) _type = VAL_STRING;
else _type = VAL_NULL;
}
-void CScValue::SetString(const Common::String &Val) {
- SetString(Val.c_str());
+void CScValue::setString(const Common::String &val) {
+ setString(val.c_str());
}
//////////////////////////////////////////////////////////////////////////
-void CScValue::SetStringVal(const char *Val) {
+void CScValue::setStringVal(const char *val) {
if (_valString) {
delete [] _valString;
_valString = NULL;
}
- if (Val == NULL) {
+ if (val == NULL) {
_valString = NULL;
return;
}
- _valString = new char [strlen(Val) + 1];
+ _valString = new char [strlen(val) + 1];
if (_valString) {
- strcpy(_valString, Val);
+ strcpy(_valString, val);
}
}
//////////////////////////////////////////////////////////////////////////
-void CScValue::SetNULL() {
+void CScValue::setNULL() {
if (_type == VAL_VARIABLE_REF) {
- _valRef->SetNULL();
+ _valRef->setNULL();
return;
}
@@ -442,21 +442,21 @@ void CScValue::SetNULL() {
if (_valNative->_refCount <= 0) delete _valNative;
}
_valNative = NULL;
- DeleteProps();
+ deleteProps();
_type = VAL_NULL;
}
//////////////////////////////////////////////////////////////////////////
-void CScValue::SetNative(CBScriptable *Val, bool Persistent) {
+void CScValue::setNative(CBScriptable *Val, bool Persistent) {
if (_type == VAL_VARIABLE_REF) {
- _valRef->SetNative(Val, Persistent);
+ _valRef->setNative(Val, Persistent);
return;
}
if (Val == NULL) {
- SetNULL();
+ setNULL();
} else {
if (_valNative && !_persistent) {
_valNative->_refCount--;
@@ -476,27 +476,27 @@ void CScValue::SetNative(CBScriptable *Val, bool Persistent) {
//////////////////////////////////////////////////////////////////////////
-void CScValue::SetObject() {
+void CScValue::setObject() {
if (_type == VAL_VARIABLE_REF) {
- _valRef->SetObject();
+ _valRef->setObject();
return;
}
- DeleteProps();
+ deleteProps();
_type = VAL_OBJECT;
}
//////////////////////////////////////////////////////////////////////////
-void CScValue::SetReference(CScValue *Val) {
+void CScValue::setReference(CScValue *Val) {
_valRef = Val;
_type = VAL_VARIABLE_REF;
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::GetBool(bool Default) {
- if (_type == VAL_VARIABLE_REF) return _valRef->GetBool();
+bool CScValue::getBool(bool Default) {
+ if (_type == VAL_VARIABLE_REF) return _valRef->getBool();
switch (_type) {
case VAL_BOOL:
@@ -521,8 +521,8 @@ bool CScValue::GetBool(bool Default) {
//////////////////////////////////////////////////////////////////////////
-int CScValue::GetInt(int Default) {
- if (_type == VAL_VARIABLE_REF) return _valRef->GetInt();
+int CScValue::getInt(int Default) {
+ if (_type == VAL_VARIABLE_REF) return _valRef->getInt();
switch (_type) {
case VAL_BOOL:
@@ -547,8 +547,8 @@ int CScValue::GetInt(int Default) {
//////////////////////////////////////////////////////////////////////////
-double CScValue::GetFloat(double Default) {
- if (_type == VAL_VARIABLE_REF) return _valRef->GetFloat();
+double CScValue::getFloat(double Default) {
+ if (_type == VAL_VARIABLE_REF) return _valRef->getFloat();
switch (_type) {
case VAL_BOOL:
@@ -572,8 +572,8 @@ double CScValue::GetFloat(double Default) {
}
//////////////////////////////////////////////////////////////////////////
-void *CScValue::GetMemBuffer() {
- if (_type == VAL_VARIABLE_REF) return _valRef->GetMemBuffer();
+void *CScValue::getMemBuffer() {
+ if (_type == VAL_VARIABLE_REF) return _valRef->getMemBuffer();
if (_type == VAL_NATIVE) return _valNative->scToMemBuffer();
else return (void *)NULL;
@@ -581,40 +581,40 @@ void *CScValue::GetMemBuffer() {
//////////////////////////////////////////////////////////////////////////
-const char *CScValue::GetString() {
- if (_type == VAL_VARIABLE_REF) return _valRef->GetString();
+const char *CScValue::getString() {
+ if (_type == VAL_VARIABLE_REF) return _valRef->getString();
switch (_type) {
case VAL_OBJECT:
- SetStringVal("[object]");
+ setStringVal("[object]");
break;
case VAL_NULL:
- SetStringVal("[null]");
+ setStringVal("[null]");
break;
case VAL_NATIVE: {
const char *StrVal = _valNative->scToString();
- SetStringVal(StrVal);
+ setStringVal(StrVal);
return StrVal;
break;
}
case VAL_BOOL:
- SetStringVal(_valBool ? "yes" : "no");
+ setStringVal(_valBool ? "yes" : "no");
break;
case VAL_INT: {
char dummy[50];
sprintf(dummy, "%d", _valInt);
- SetStringVal(dummy);
+ setStringVal(dummy);
break;
}
case VAL_FLOAT: {
char dummy[50];
sprintf(dummy, "%f", _valFloat);
- SetStringVal(dummy);
+ setStringVal(dummy);
break;
}
@@ -622,7 +622,7 @@ const char *CScValue::GetString() {
break;
default:
- SetStringVal("");
+ setStringVal("");
}
return _valString;
@@ -630,8 +630,8 @@ const char *CScValue::GetString() {
//////////////////////////////////////////////////////////////////////////
-CBScriptable *CScValue::GetNative() {
- if (_type == VAL_VARIABLE_REF) return _valRef->GetNative();
+CBScriptable *CScValue::getNative() {
+ if (_type == VAL_VARIABLE_REF) return _valRef->getNative();
if (_type == VAL_NATIVE) return _valNative;
else return NULL;
@@ -639,13 +639,13 @@ CBScriptable *CScValue::GetNative() {
//////////////////////////////////////////////////////////////////////////
-TValType CScValue::GetType() {
+TValType CScValue::getType() {
return _type;
}
//////////////////////////////////////////////////////////////////////////
-void CScValue::Copy(CScValue *orig, bool CopyWhole) {
+void CScValue::copy(CScValue *orig, bool copyWhole) {
Game = orig->Game;
if (_valNative && !_persistent) {
@@ -656,7 +656,7 @@ void CScValue::Copy(CScValue *orig, bool CopyWhole) {
}
}
- if (orig->_type == VAL_VARIABLE_REF && orig->_valRef && CopyWhole) orig = orig->_valRef;
+ if (orig->_type == VAL_VARIABLE_REF && orig->_valRef && copyWhole) orig = orig->_valRef;
cleanup(true);
@@ -664,7 +664,7 @@ void CScValue::Copy(CScValue *orig, bool CopyWhole) {
_valBool = orig->_valBool;
_valInt = orig->_valInt;
_valFloat = orig->_valFloat;
- SetStringVal(orig->_valString);
+ setStringVal(orig->_valString);
_valRef = orig->_valRef;
_persistent = orig->_persistent;
@@ -678,7 +678,7 @@ void CScValue::Copy(CScValue *orig, bool CopyWhole) {
orig->_valIter = orig->_valObject.begin();
while (orig->_valIter != orig->_valObject.end()) {
_valObject[orig->_valIter->_key] = new CScValue(Game);
- _valObject[orig->_valIter->_key]->Copy(orig->_valIter->_value);
+ _valObject[orig->_valIter->_key]->copy(orig->_valIter->_value);
orig->_valIter++;
}
} else _valObject.clear();
@@ -686,34 +686,34 @@ void CScValue::Copy(CScValue *orig, bool CopyWhole) {
//////////////////////////////////////////////////////////////////////////
-void CScValue::SetValue(CScValue *Val) {
- if (Val->_type == VAL_VARIABLE_REF) {
- SetValue(Val->_valRef);
+void CScValue::setValue(CScValue *val) {
+ if (val->_type == VAL_VARIABLE_REF) {
+ setValue(val->_valRef);
return;
}
// if being assigned a simple type, preserve native state
- if (_type == VAL_NATIVE && (Val->_type == VAL_INT || Val->_type == VAL_STRING || Val->_type == VAL_BOOL)) {
- switch (Val->_type) {
+ if (_type == VAL_NATIVE && (val->_type == VAL_INT || val->_type == VAL_STRING || val->_type == VAL_BOOL)) {
+ switch (val->_type) {
case VAL_INT:
- _valNative->scSetInt(Val->GetInt());
+ _valNative->scSetInt(val->getInt());
break;
case VAL_FLOAT:
- _valNative->scSetFloat(Val->GetFloat());
+ _valNative->scSetFloat(val->getFloat());
break;
case VAL_BOOL:
- _valNative->scSetBool(Val->GetBool());
+ _valNative->scSetBool(val->getBool());
break;
case VAL_STRING:
- _valNative->scSetString(Val->GetString());
+ _valNative->scSetString(val->getString());
break;
default:
- warning("CScValue::SetValue - unhandled enum");
+ warning("CScValue::setValue - unhandled enum");
break;
}
}
// otherwise just copy everything
- else Copy(Val);
+ else copy(val);
}
@@ -802,13 +802,13 @@ HRESULT CScValue::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
-HRESULT CScValue::saveAsText(CBDynBuffer *Buffer, int Indent) {
+HRESULT CScValue::saveAsText(CBDynBuffer *buffer, int indent) {
_valIter = _valObject.begin();
while (_valIter != _valObject.end()) {
- Buffer->putTextIndent(Indent, "PROPERTY {\n");
- Buffer->putTextIndent(Indent + 2, "NAME=\"%s\"\n", _valIter->_key.c_str());
- Buffer->putTextIndent(Indent + 2, "VALUE=\"%s\"\n", _valIter->_value->GetString());
- Buffer->putTextIndent(Indent, "}\n\n");
+ buffer->putTextIndent(indent, "PROPERTY {\n");
+ buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _valIter->_key.c_str());
+ buffer->putTextIndent(indent + 2, "VALUE=\"%s\"\n", _valIter->_value->getString());
+ buffer->putTextIndent(indent, "}\n\n");
_valIter++;
}
@@ -818,45 +818,45 @@ HRESULT CScValue::saveAsText(CBDynBuffer *Buffer, int Indent) {
//////////////////////////////////////////////////////////////////////////
// -1 ... left is less, 0 ... equals, 1 ... left is greater
-int CScValue::Compare(CScValue *Val1, CScValue *Val2) {
+int CScValue::compare(CScValue *val1, CScValue *val2) {
// both natives?
- if (Val1->IsNative() && Val2->IsNative()) {
+ if (val1->isNative() && val2->isNative()) {
// same class?
- if (strcmp(Val1->GetNative()->getClassName(), Val2->GetNative()->getClassName()) == 0) {
- return Val1->GetNative()->scCompare(Val2->GetNative());
- } else return strcmp(Val1->GetString(), Val2->GetString());
+ if (strcmp(val1->getNative()->getClassName(), val2->getNative()->getClassName()) == 0) {
+ return val1->getNative()->scCompare(val2->getNative());
+ } else return strcmp(val1->getString(), val2->getString());
}
// both objects?
- if (Val1->IsObject() && Val2->IsObject()) return -1;
+ if (val1->isObject() && val2->isObject()) return -1;
// null states
- if (Val1->IsNULL() && !Val2->IsNULL()) return -1;
- else if (!Val1->IsNULL() && Val2->IsNULL()) return 1;
- else if (Val1->IsNULL() && Val2->IsNULL()) return 0;
+ if (val1->isNULL() && !val2->isNULL()) return -1;
+ else if (!val1->isNULL() && val2->isNULL()) return 1;
+ else if (val1->isNULL() && val2->isNULL()) return 0;
// one of them is string? convert both to string
- if (Val1->IsString() || Val2->IsString()) return strcmp(Val1->GetString(), Val2->GetString());
+ if (val1->isString() || val2->isString()) return strcmp(val1->getString(), val2->getString());
// one of them is float?
- if (Val1->IsFloat() || Val2->IsFloat()) {
- if (Val1->GetFloat() < Val2->GetFloat()) return -1;
- else if (Val1->GetFloat() > Val2->GetFloat()) return 1;
+ if (val1->isFloat() || val2->isFloat()) {
+ if (val1->getFloat() < val2->getFloat()) return -1;
+ else if (val1->getFloat() > val2->getFloat()) return 1;
else return 0;
}
// otherwise compare as int's
- if (Val1->GetInt() < Val2->GetInt()) return -1;
- else if (Val1->GetInt() > Val2->GetInt()) return 1;
+ if (val1->getInt() < val2->getInt()) return -1;
+ else if (val1->getInt() > val2->getInt()) return 1;
else return 0;
}
//////////////////////////////////////////////////////////////////////////
-int CScValue::CompareStrict(CScValue *Val1, CScValue *Val2) {
- if (Val1->GetTypeTolerant() != Val2->GetTypeTolerant()) return -1;
- else return CScValue::Compare(Val1, Val2);
+int CScValue::compareStrict(CScValue *val1, CScValue *val2) {
+ if (val1->getTypeTolerant() != val2->getTypeTolerant()) return -1;
+ else return CScValue::compare(val1, val2);
}
@@ -872,43 +872,43 @@ HRESULT CScValue::DbgSendVariables(IWmeDebugClient *Client, EWmeDebuggerVariable
//////////////////////////////////////////////////////////////////////////
-bool CScValue::SetProperty(const char *propName, int value) {
+bool CScValue::setProperty(const char *propName, int value) {
CScValue *Val = new CScValue(Game, value);
- bool Ret = SUCCEEDED(SetProp(propName, Val));
+ bool Ret = SUCCEEDED(setProp(propName, Val));
delete Val;
return Ret;
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::SetProperty(const char *propName, const char *value) {
+bool CScValue::setProperty(const char *propName, const char *value) {
CScValue *Val = new CScValue(Game, value);
- bool Ret = SUCCEEDED(SetProp(propName, Val));
+ bool Ret = SUCCEEDED(setProp(propName, Val));
delete Val;
return Ret;
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::SetProperty(const char *propName, double value) {
+bool CScValue::setProperty(const char *propName, double value) {
CScValue *Val = new CScValue(Game, value);
- bool Ret = SUCCEEDED(SetProp(propName, Val));
+ bool Ret = SUCCEEDED(setProp(propName, Val));
delete Val;
return Ret;
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::SetProperty(const char *propName, bool value) {
+bool CScValue::setProperty(const char *propName, bool value) {
CScValue *Val = new CScValue(Game, value);
- bool Ret = SUCCEEDED(SetProp(propName, Val));
+ bool Ret = SUCCEEDED(setProp(propName, Val));
delete Val;
return Ret;
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::SetProperty(const char *propName) {
+bool CScValue::setProperty(const char *propName) {
CScValue *Val = new CScValue(Game);
- bool Ret = SUCCEEDED(SetProp(propName, Val));
+ bool Ret = SUCCEEDED(setProp(propName, Val));
delete Val;
return Ret;
}
@@ -918,7 +918,7 @@ bool CScValue::SetProperty(const char *propName) {
// IWmeDebugProp
//////////////////////////////////////////////////////////////////////////
EWmeDebuggerPropType CScValue::DbgGetType() {
- switch (GetType()) {
+ switch (getType()) {
case VAL_NULL:
return WME_DBGPROP_NULL;
case VAL_STRING:
@@ -940,56 +940,56 @@ EWmeDebuggerPropType CScValue::DbgGetType() {
//////////////////////////////////////////////////////////////////////////
int CScValue::DbgGetValInt() {
- return GetInt();
+ return getInt();
}
//////////////////////////////////////////////////////////////////////////
double CScValue::DbgGetValFloat() {
- return GetFloat();
+ return getFloat();
}
//////////////////////////////////////////////////////////////////////////
bool CScValue::DbgGetValBool() {
- return GetBool();
+ return getBool();
}
//////////////////////////////////////////////////////////////////////////
const char *CScValue::DbgGetValString() {
- return GetString();
+ return getString();
}
//////////////////////////////////////////////////////////////////////////
IWmeDebugObject *CScValue::DbgGetValNative() {
- return GetNative();
+ return getNative();
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::DbgSetVal(int Value) {
- SetInt(Value);
+bool CScValue::DbgSetVal(int value) {
+ setInt(value);
return true;
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::DbgSetVal(double Value) {
- SetFloat(Value);
+bool CScValue::DbgSetVal(double value) {
+ setFloat(value);
return true;
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::DbgSetVal(bool Value) {
- SetBool(Value);
+bool CScValue::DbgSetVal(bool value) {
+ setBool(value);
return true;
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::DbgSetVal(const char *Value) {
- SetString(Value);
+bool CScValue::DbgSetVal(const char *value) {
+ setString(value);
return true;
}
//////////////////////////////////////////////////////////////////////////
bool CScValue::DbgSetVal() {
- SetNULL();
+ setNULL();
return true;
}
@@ -1020,13 +1020,13 @@ bool CScValue::DbgGetProperty(int index, const char **name, IWmeDebugProp **valu
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::DbgGetDescription(char *Buf, int BufSize) {
- if (_type == VAL_VARIABLE_REF) return _valRef->DbgGetDescription(Buf, BufSize);
+bool CScValue::DbgGetDescription(char *buf, int bufSize) {
+ if (_type == VAL_VARIABLE_REF) return _valRef->DbgGetDescription(buf, bufSize);
if (_type == VAL_NATIVE) {
- _valNative->scDebuggerDesc(Buf, BufSize);
+ _valNative->scDebuggerDesc(buf, bufSize);
} else {
- strncpy(Buf, GetString(), BufSize);
+ strncpy(buf, getString(), bufSize);
}
return true;
}
diff --git a/engines/wintermute/Base/scriptables/ScValue.h b/engines/wintermute/Base/scriptables/ScValue.h
index 90c783c9ce..3c25a4d1e7 100644
--- a/engines/wintermute/Base/scriptables/ScValue.h
+++ b/engines/wintermute/Base/scriptables/ScValue.h
@@ -43,49 +43,49 @@ class CBScriptable;
class CScValue : public CBBase, public IWmeDebugProp {
public:
- HRESULT DbgSendVariables(IWmeDebugClient *Client, EWmeDebuggerVariableType Type, CScScript *script, unsigned int ScopeID);
+ HRESULT DbgSendVariables(IWmeDebugClient *client, EWmeDebuggerVariableType type, CScScript *script, unsigned int scopeID);
- static int Compare(CScValue *Val1, CScValue *Val2);
- static int CompareStrict(CScValue *Val1, CScValue *Val2);
- TValType GetTypeTolerant();
+ static int compare(CScValue *Val1, CScValue *Val2);
+ static int compareStrict(CScValue *Val1, CScValue *Val2);
+ TValType getTypeTolerant();
void cleanup(bool IgnoreNatives = false);
DECLARE_PERSISTENT(CScValue, CBBase)
bool _isConstVar;
HRESULT saveAsText(CBDynBuffer *Buffer, int Indent);
- void SetValue(CScValue *Val);
+ void setValue(CScValue *Val);
bool _persistent;
- bool PropExists(const char *name);
- void Copy(CScValue *orig, bool CopyWhole = false);
- void SetStringVal(const char *Val);
- TValType GetType();
- bool GetBool(bool Default = false);
- int GetInt(int Default = 0);
- double GetFloat(double Default = 0.0f);
- const char *GetString();
- void *GetMemBuffer();
- CBScriptable *GetNative();
- HRESULT DeleteProp(const char *name);
- void DeleteProps();
- void CleanProps(bool IncludingNatives);
- void SetBool(bool Val);
- void SetInt(int Val);
- void SetFloat(double Val);
- void SetString(const char *Val);
- void SetString(const Common::String &Val);
- void SetNULL();
- void SetNative(CBScriptable *Val, bool Persistent = false);
- void SetObject();
- void SetReference(CScValue *Val);
- bool IsNULL();
- bool IsNative();
- bool IsString();
- bool IsBool();
- bool IsFloat();
- bool IsInt();
- bool IsObject();
- HRESULT SetProp(const char *name, CScValue *Val, bool CopyWhole = false, bool SetAsConst = false);
- CScValue *GetProp(const char *name);
+ bool propExists(const char *name);
+ void copy(CScValue *orig, bool copyWhole = false);
+ void setStringVal(const char *val);
+ TValType getType();
+ bool getBool(bool Default = false);
+ int getInt(int Default = 0);
+ double getFloat(double Default = 0.0f);
+ const char *getString();
+ void *getMemBuffer();
+ CBScriptable *getNative();
+ HRESULT deleteProp(const char *name);
+ void deleteProps();
+ void CleanProps(bool includingNatives);
+ void setBool(bool val);
+ void setInt(int val);
+ void setFloat(double val);
+ void setString(const char *val);
+ void setString(const Common::String &val);
+ void setNULL();
+ void setNative(CBScriptable *val, bool persistent = false);
+ void setObject();
+ void setReference(CScValue *val);
+ bool isNULL();
+ bool isNative();
+ bool isString();
+ bool isBool();
+ bool isFloat();
+ bool isInt();
+ bool isObject();
+ HRESULT setProp(const char *name, CScValue *val, bool copyWhole = false, bool setAsConst = false);
+ CScValue *getProp(const char *name);
CBScriptable *_valNative;
CScValue *_valRef;
protected:
@@ -104,11 +104,11 @@ public:
Common::HashMap<Common::String, CScValue *> _valObject;
Common::HashMap<Common::String, CScValue *>::iterator _valIter;
- bool SetProperty(const char *PropName, int Value);
- bool SetProperty(const char *PropName, const char *Value);
- bool SetProperty(const char *PropName, double Value);
- bool SetProperty(const char *PropName, bool Value);
- bool SetProperty(const char *PropName);
+ bool setProperty(const char *PropName, int Value);
+ bool setProperty(const char *PropName, const char *Value);
+ bool setProperty(const char *PropName, double Value);
+ bool setProperty(const char *PropName, bool Value);
+ bool setProperty(const char *PropName);
// IWmeDebugProp interface implementation
diff --git a/engines/wintermute/Base/scriptables/SxObject.cpp b/engines/wintermute/Base/scriptables/SxObject.cpp
index b4fd782f76..7f61a81b19 100644
--- a/engines/wintermute/Base/scriptables/SxObject.cpp
+++ b/engines/wintermute/Base/scriptables/SxObject.cpp
@@ -44,9 +44,9 @@ CBScriptable *makeSXObject(CBGame *inGame, CScStack *stack) {
//////////////////////////////////////////////////////////////////////////
CSXObject::CSXObject(CBGame *inGame, CScStack *stack): CBObject(inGame) {
- int NumParams = stack->pop()->GetInt(0);
+ int NumParams = stack->pop()->getInt(0);
for (int i = 0; i < NumParams; i++) {
- addScript(stack->pop()->GetString());
+ addScript(stack->pop()->getString());
}
}