aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/scriptables
diff options
context:
space:
mode:
Diffstat (limited to 'engines/wintermute/base/scriptables')
-rw-r--r--engines/wintermute/base/scriptables/script.cpp36
-rw-r--r--engines/wintermute/base/scriptables/script_engine.cpp6
-rw-r--r--engines/wintermute/base/scriptables/script_ext_date.cpp2
-rw-r--r--engines/wintermute/base/scriptables/script_ext_file.cpp4
-rw-r--r--engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp4
-rw-r--r--engines/wintermute/base/scriptables/script_value.cpp2
6 files changed, 27 insertions, 27 deletions
diff --git a/engines/wintermute/base/scriptables/script.cpp b/engines/wintermute/base/scriptables/script.cpp
index 57e08135ed..a519da5832 100644
--- a/engines/wintermute/base/scriptables/script.cpp
+++ b/engines/wintermute/base/scriptables/script.cpp
@@ -591,11 +591,11 @@ bool ScScript::executeInstruction() {
}
/*
ScValue* val = var->getProp(MethodName);
- if(val){
+ if (val){
dw = GetFuncPos(val->getString());
- if(dw==0){
+ if (dw==0){
TExternalFunction* f = GetExternal(val->getString());
- if(f){
+ if (f){
ExternalCall(_stack, _thisStack, f);
}
else{
@@ -776,7 +776,7 @@ bool ScScript::executeInstruction() {
case II_JMP_FALSE: {
dw = getDWORD();
- //if(!_stack->pop()->getBool()) _iP = dw;
+ //if (!_stack->pop()->getBool()) _iP = dw;
ScValue *val = _stack->pop();
if (!val) {
runtimeError("Script corruption detected. Did you use '=' instead of '==' for comparison?");
@@ -864,7 +864,7 @@ bool ScScript::executeInstruction() {
case II_NOT:
op1 = _stack->pop();
- //if(op1->isNULL()) _operand->setNULL();
+ //if (op1->isNULL()) _operand->setNULL();
if (op1->isNULL()) _operand->setBool(true);
else _operand->setBool(!op1->getBool());
_stack->push(_operand);
@@ -900,14 +900,14 @@ bool ScScript::executeInstruction() {
op1 = _stack->pop();
/*
- if((op1->isNULL() && !op2->isNULL()) || (!op1->isNULL() && op2->isNULL())) _operand->setBool(false);
- else if(op1->isNative() && op2->isNative()){
+ 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){
+ 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){
+ else if (op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
_operand->setBool(op1->getFloat() == op2->getFloat());
}
else{
@@ -924,14 +924,14 @@ bool ScScript::executeInstruction() {
op1 = _stack->pop();
/*
- if((op1->isNULL() && !op2->isNULL()) || (!op1->isNULL() && op2->isNULL())) _operand->setBool(true);
- else if(op1->isNative() && op2->isNative()){
+ 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){
+ 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){
+ else if (op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
_operand->setBool(op1->getFloat() != op2->getFloat());
}
else{
@@ -948,7 +948,7 @@ bool ScScript::executeInstruction() {
op1 = _stack->pop();
/*
- if(op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
+ if (op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
_operand->setBool(op1->getFloat() < op2->getFloat());
}
else _operand->setBool(op1->getInt() < op2->getInt());
@@ -963,7 +963,7 @@ bool ScScript::executeInstruction() {
op1 = _stack->pop();
/*
- if(op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
+ if (op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
_operand->setBool(op1->getFloat() > op2->getFloat());
}
else _operand->setBool(op1->getInt() > op2->getInt());
@@ -978,7 +978,7 @@ bool ScScript::executeInstruction() {
op1 = _stack->pop();
/*
- if(op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
+ if (op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
_operand->setBool(op1->getFloat() <= op2->getFloat());
}
else _operand->setBool(op1->getInt() <= op2->getInt());
@@ -993,7 +993,7 @@ bool ScScript::executeInstruction() {
op1 = _stack->pop();
/*
- if(op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
+ if (op1->getType()==VAL_FLOAT && op2->getType()==VAL_FLOAT){
_operand->setBool(op1->getFloat() >= op2->getFloat());
}
else _operand->setBool(op1->getInt() >= op2->getInt());
@@ -1257,7 +1257,7 @@ bool ScScript::persist(BasePersistenceManager *persistMgr) {
//////////////////////////////////////////////////////////////////////////
ScScript *ScScript::invokeEventHandler(const char *eventName, bool unbreakable) {
- //if(_state!=SCRIPT_PERSISTENT) return NULL;
+ //if (_state!=SCRIPT_PERSISTENT) return NULL;
uint32 pos = getEventPos(eventName);
if (!pos) return NULL;
diff --git a/engines/wintermute/base/scriptables/script_engine.cpp b/engines/wintermute/base/scriptables/script_engine.cpp
index c33d844aa1..792dfd4589 100644
--- a/engines/wintermute/base/scriptables/script_engine.cpp
+++ b/engines/wintermute/base/scriptables/script_engine.cpp
@@ -257,14 +257,14 @@ bool ScEngine::tick() {
bool obj_found=false;
for(int j=0; j<_gameRef->_regObjects.getSize(); j++)
{
- if(_gameRef->_regObjects[j] == _scripts[i]->_waitObject)
+ if (_gameRef->_regObjects[j] == _scripts[i]->_waitObject)
{
- if(_gameRef->_regObjects[j]->IsReady()) _scripts[i]->Run();
+ if (_gameRef->_regObjects[j]->IsReady()) _scripts[i]->Run();
obj_found = true;
break;
}
}
- if(!obj_found) _scripts[i]->finish(); // _waitObject no longer exists
+ if (!obj_found) _scripts[i]->finish(); // _waitObject no longer exists
*/
if (_gameRef->validObject(_scripts[i]->_waitObject)) {
if (_scripts[i]->_waitObject->isReady()) _scripts[i]->run();
diff --git a/engines/wintermute/base/scriptables/script_ext_date.cpp b/engines/wintermute/base/scriptables/script_ext_date.cpp
index 322fb9bc5b..d2fd3663c7 100644
--- a/engines/wintermute/base/scriptables/script_ext_date.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_date.cpp
@@ -228,7 +228,7 @@ bool SXDate::scSetProperty(const char *name, ScValue *value) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
- if(strcmp(name, "Name")==0){
+ if (strcmp(name, "Name")==0){
setName(value->getString());
return STATUS_OK;
}
diff --git a/engines/wintermute/base/scriptables/script_ext_file.cpp b/engines/wintermute/base/scriptables/script_ext_file.cpp
index 01179bb3ad..7da1601bdc 100644
--- a/engines/wintermute/base/scriptables/script_ext_file.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_file.cpp
@@ -663,12 +663,12 @@ bool SXFile::scSetProperty(const char *name, ScValue *value) {
//////////////////////////////////////////////////////////////////////////
// Length
//////////////////////////////////////////////////////////////////////////
- if(strcmp(name, "Length")==0){
+ if (strcmp(name, "Length")==0){
int OrigLength = _length;
_length = max(value->getInt(0), 0);
char PropName[20];
- if(_length < OrigLength){
+ if (_length < OrigLength){
for(int i=_length; i<OrigLength; i++){
sprintf(PropName, "%d", i);
_values->DeleteProp(PropName);
diff --git a/engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp b/engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp
index 6b791871ad..3d3f0b218b 100644
--- a/engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp
@@ -462,12 +462,12 @@ bool SXMemBuffer::scSetProperty(const char *name, ScValue *value) {
//////////////////////////////////////////////////////////////////////////
// Length
//////////////////////////////////////////////////////////////////////////
- if(strcmp(name, "Length")==0){
+ if (strcmp(name, "Length")==0){
int OrigLength = _length;
_length = max(value->getInt(0), 0);
char PropName[20];
- if(_length < OrigLength){
+ if (_length < OrigLength){
for(int i=_length; i<OrigLength; i++){
sprintf(PropName, "%d", i);
_values->DeleteProp(PropName);
diff --git a/engines/wintermute/base/scriptables/script_value.cpp b/engines/wintermute/base/scriptables/script_value.cpp
index 59e0965f5e..5e824cd10c 100644
--- a/engines/wintermute/base/scriptables/script_value.cpp
+++ b/engines/wintermute/base/scriptables/script_value.cpp
@@ -240,7 +240,7 @@ bool ScValue::setProp(const char *name, ScValue *val, bool copyWhole, bool setAs
val->_isConstVar = SetAsConst;
_valObject[Name] = val;
- if(_type!=VAL_NATIVE) _type = VAL_OBJECT;
+ if (_type!=VAL_NATIVE) _type = VAL_OBJECT;
*/
}