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.cpp54
-rw-r--r--engines/wintermute/base/scriptables/script_engine.cpp18
-rw-r--r--engines/wintermute/base/scriptables/script_ext_array.cpp18
-rw-r--r--engines/wintermute/base/scriptables/script_ext_file.cpp8
-rw-r--r--engines/wintermute/base/scriptables/script_ext_file.h2
-rw-r--r--engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp20
6 files changed, 60 insertions, 60 deletions
diff --git a/engines/wintermute/base/scriptables/script.cpp b/engines/wintermute/base/scriptables/script.cpp
index 54a04c454f..75c4d38574 100644
--- a/engines/wintermute/base/scriptables/script.cpp
+++ b/engines/wintermute/base/scriptables/script.cpp
@@ -165,7 +165,7 @@ bool ScScript::initScript() {
//////////////////////////////////////////////////////////////////////////
bool ScScript::initTables() {
- uint32 OrigIP = _iP;
+ uint32 origIP = _iP;
readHeader();
// load symbol table
@@ -232,7 +232,7 @@ bool ScScript::initTables() {
}
- _iP = OrigIP;
+ _iP = origIP;
return STATUS_OK;
}
@@ -546,7 +546,7 @@ bool ScScript::executeInstruction() {
case II_DEF_GLOB_VAR:
case II_DEF_CONST_VAR: {
dw = getDWORD();
- /* char *Temp = _symbols[dw]; // TODO delete */
+ /* char *temp = _symbols[dw]; // TODO delete */
// only create global var if it doesn't exist
if (!_engine->_globals->propExists(_symbols[dw])) {
_operand->setNULL();
@@ -604,8 +604,8 @@ bool ScScript::executeInstruction() {
// push var
// push string
str = _stack->pop()->getString();
- char *MethodName = new char[strlen(str) + 1];
- strcpy(MethodName, str);
+ char *methodName = new char[strlen(str) + 1];
+ strcpy(methodName, str);
ScValue *var = _stack->pop();
if (var->_type == VAL_VARIABLE_REF) {
@@ -613,21 +613,21 @@ bool ScScript::executeInstruction() {
}
bool res = STATUS_FAILED;
- bool TriedNative = false;
+ 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()) {
- TriedNative = true;
- res = var->_valNative->scCallMethod(this, _stack, _thisStack, MethodName);
+ 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 (DID_FAIL(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);
+ runtimeError("Error invoking method '%s'.", methodName);
_stack->pushNULL();
} else {
_state = SCRIPT_WAITING_SCRIPT;
@@ -636,10 +636,10 @@ bool ScScript::executeInstruction() {
} else {
// can call methods in unbreakable mode
_stack->correctParams(0);
- runtimeError("Cannot call method '%s'. Ignored.", MethodName);
+ runtimeError("Cannot call method '%s'. Ignored.", methodName);
_stack->pushNULL();
}
- delete[] MethodName;
+ delete[] methodName;
break;
}
/*
@@ -665,29 +665,29 @@ bool ScScript::executeInstruction() {
*/
else {
res = STATUS_FAILED;
- if (var->_type == VAL_NATIVE && !TriedNative) {
- res = var->_valNative->scCallMethod(this, _stack, _thisStack, MethodName);
+ if (var->_type == VAL_NATIVE && !triedNative) {
+ res = var->_valNative->scCallMethod(this, _stack, _thisStack, methodName);
}
if (DID_FAIL(res)) {
_stack->correctParams(0);
- runtimeError("Call to undefined method '%s'. Ignored.", MethodName);
+ runtimeError("Call to undefined method '%s'. Ignored.", methodName);
_stack->pushNULL();
}
}
}
- delete[] MethodName;
+ delete[] methodName;
}
break;
case II_EXTERNAL_CALL: {
- uint32 SymbolIndex = getDWORD();
+ uint32 symbolIndex = getDWORD();
- TExternalFunction *f = getExternal(_symbols[SymbolIndex]);
+ TExternalFunction *f = getExternal(_symbols[symbolIndex]);
if (f) {
externalCall(_stack, _thisStack, f);
} else {
- _gameRef->ExternalCall(this, _stack, _thisStack, _symbols[SymbolIndex]);
+ _gameRef->externalCall(this, _stack, _thisStack, _symbols[symbolIndex]);
}
break;
@@ -737,8 +737,8 @@ bool ScScript::executeInstruction() {
}
case II_POP_VAR: {
- char *VarName = _symbols[getDWORD()];
- ScValue *var = getVar(VarName);
+ char *varName = _symbols[getDWORD()];
+ ScValue *var = getVar(varName);
if (var) {
ScValue *val = _stack->pop();
if (!val) {
@@ -1460,13 +1460,13 @@ bool ScScript::externalCall(ScStack *stack, ScStack *thisStack, ScScript::TExter
//////////////////////////////////////////////////////////////////////////
bool ScScript::copyParameters(ScStack *stack) {
int i;
- int NumParams = stack->pop()->getInt();
- for (i = NumParams - 1; i >= 0; i--) {
+ int numParams = stack->pop()->getInt();
+ for (i = numParams - 1; i >= 0; i--) {
_stack->push(stack->getAt(i));
}
- _stack->pushInt(NumParams);
+ _stack->pushInt(numParams);
- for (i = 0; i < NumParams; i++) {
+ for (i = 0; i < numParams; i++) {
stack->pop();
}
diff --git a/engines/wintermute/base/scriptables/script_engine.cpp b/engines/wintermute/base/scriptables/script_engine.cpp
index e1aed7ed82..bc8d54ef58 100644
--- a/engines/wintermute/base/scriptables/script_engine.cpp
+++ b/engines/wintermute/base/scriptables/script_engine.cpp
@@ -227,13 +227,13 @@ byte *ScEngine::getCompiledScript(const char *filename, uint32 *outSize, bool ig
CScCachedScript *cachedScript = new CScCachedScript(filename, compBuffer, compSize);
if (cachedScript) {
int index = 0;
- uint32 MinTime = g_system->getMillis();
+ uint32 minTime = g_system->getMillis();
for (int i = 0; i < MAX_CACHED_SCRIPTS; i++) {
if (_cachedScripts[i] == NULL) {
index = i;
break;
- } else if (_cachedScripts[i]->_timestamp <= MinTime) {
- MinTime = _cachedScripts[i]->_timestamp;
+ } else if (_cachedScripts[i]->_timestamp <= minTime) {
+ minTime = _cachedScripts[i]->_timestamp;
index = i;
}
}
@@ -338,13 +338,13 @@ bool ScEngine::tick() {
// time sliced script
if (_scripts[i]->_timeSlice > 0) {
- uint32 StartTime = g_system->getMillis();
- while (_scripts[i]->_state == SCRIPT_RUNNING && g_system->getMillis() - StartTime < _scripts[i]->_timeSlice) {
+ uint32 startTime = g_system->getMillis();
+ while (_scripts[i]->_state == SCRIPT_RUNNING && g_system->getMillis() - startTime < _scripts[i]->_timeSlice) {
_currentScript = _scripts[i];
_scripts[i]->executeInstruction();
}
if (_isProfiling && _scripts[i]->_filename) {
- addScriptTime(_scripts[i]->_filename, g_system->getMillis() - StartTime);
+ addScriptTime(_scripts[i]->_filename, g_system->getMillis() - startTime);
}
}
@@ -473,8 +473,8 @@ bool ScEngine::resetObject(BaseObject *Object) {
resetScript(_scripts[i]);
}
- bool IsThread = _scripts[i]->_methodThread || _scripts[i]->_thread;
- _scripts[i]->finish(!IsThread); // 1.9b1 - top-level script kills its threads as well
+ bool isThread = _scripts[i]->_methodThread || _scripts[i]->_thread;
+ _scripts[i]->finish(!isThread); // 1.9b1 - top-level script kills its threads as well
}
}
return STATUS_OK;
@@ -707,7 +707,7 @@ bool ScEngine::loadBreakpoints() {
int count = _gameRef->_registry->readInt("Debug", "NumBreakpoints", 0);
for (int i = 1; i <= count; i++) {
- /* uint32 BufSize = 512; */
+ /* uint32 bufSize = 512; */
sprintf(key, "Breakpoint%d", i);
AnsiString breakpoint = _gameRef->_registry->readString("Debug", key, "");
diff --git a/engines/wintermute/base/scriptables/script_ext_array.cpp b/engines/wintermute/base/scriptables/script_ext_array.cpp
index 0380103cd4..cc3bec89c0 100644
--- a/engines/wintermute/base/scriptables/script_ext_array.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_array.cpp
@@ -162,9 +162,9 @@ ScValue *SXArray::scGetProperty(const char *name) {
// [number]
//////////////////////////////////////////////////////////////////////////
else {
- char ParamName[20];
- if (validNumber(name, ParamName)) {
- return _values->getProp(ParamName);
+ char paramName[20];
+ if (validNumber(name, paramName)) {
+ return _values->getProp(paramName);
} else {
return _scValue;
}
@@ -178,14 +178,14 @@ bool SXArray::scSetProperty(const char *name, ScValue *value) {
// Length
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Length") == 0) {
- int OrigLength = _length;
+ int origLength = _length;
_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);
+ char propName[20];
+ if (_length < origLength) {
+ for (int i = _length; i < origLength; i++) {
+ sprintf(propName, "%d", i);
+ _values->deleteProp(propName);
}
}
return STATUS_OK;
diff --git a/engines/wintermute/base/scriptables/script_ext_file.cpp b/engines/wintermute/base/scriptables/script_ext_file.cpp
index 437fbb64a2..4eeabca04d 100644
--- a/engines/wintermute/base/scriptables/script_ext_file.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_file.cpp
@@ -188,8 +188,8 @@ bool SXFile::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack,
script->runtimeError("File.%s: File is not open", name);
stack->pushBool(false);
} else {
- int Pos = stack->pop()->getInt();
- stack->pushBool(setPos(Pos));
+ int pos = stack->pop()->getInt();
+ stack->pushBool(setPos(pos));
}
return STATUS_OK;
}
@@ -703,10 +703,10 @@ bool SXFile::scSetProperty(const char *name, ScValue *value) {
// Length
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Length")==0){
- int OrigLength = _length;
+ int origLength = _length;
_length = max(value->getInt(0), 0);
- char PropName[20];
+ char propName[20];
if (_length < OrigLength){
for(int i=_length; i<OrigLength; i++){
sprintf(PropName, "%d", i);
diff --git a/engines/wintermute/base/scriptables/script_ext_file.h b/engines/wintermute/base/scriptables/script_ext_file.h
index 4d78feb044..d083f96a4a 100644
--- a/engines/wintermute/base/scriptables/script_ext_file.h
+++ b/engines/wintermute/base/scriptables/script_ext_file.h
@@ -55,7 +55,7 @@ private:
void cleanup();
uint32 getPos();
uint32 getLength();
- bool setPos(uint32 Pos, int whence = SEEK_SET);
+ bool setPos(uint32 pos, int whence = SEEK_SET);
char *_filename;
Common::WriteStream *openForWrite(const Common::String &filename, bool binary);
Common::WriteStream *openForAppend(const Common::String &filename, bool binary);
diff --git a/engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp b/engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp
index e15af3446e..9bde5d45e7 100644
--- a/engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp
@@ -47,14 +47,14 @@ SXMemBuffer::SXMemBuffer(BaseGame *inGame, ScStack *stack): BaseScriptable(inGam
_buffer = NULL;
_size = 0;
- int NewSize = stack->pop()->getInt();
- resize(MAX(0, NewSize));
+ int newSize = stack->pop()->getInt();
+ resize(MAX(0, newSize));
}
//////////////////////////////////////////////////////////////////////////
-SXMemBuffer::SXMemBuffer(BaseGame *inGame, void *Buffer): BaseScriptable(inGame) {
+SXMemBuffer::SXMemBuffer(BaseGame *inGame, void *buffer): BaseScriptable(inGame) {
_size = 0;
- _buffer = Buffer;
+ _buffer = buffer;
}
@@ -184,11 +184,11 @@ bool SXMemBuffer::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisSt
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "GetShort") == 0) {
stack->correctParams(1);
- int Start = stack->pop()->getInt();
- if (!checkBounds(script, Start, sizeof(short))) {
+ int start = stack->pop()->getInt();
+ if (!checkBounds(script, start, sizeof(short))) {
stack->pushNULL();
} else {
- stack->pushInt(65536 + * (short *)((byte *)_buffer + Start));
+ stack->pushInt(65536 + * (short *)((byte *)_buffer + start));
}
return STATUS_OK;
@@ -416,7 +416,7 @@ bool SXMemBuffer::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisSt
stack->pushBool(false);
} else {
/*
- int Pointer = (int)Val->getMemBuffer();
+ int pointer = (int)Val->getMemBuffer();
memcpy((byte *)_buffer+Start, &Pointer, sizeof(void*));
stack->pushBool(true);
*/
@@ -478,10 +478,10 @@ bool SXMemBuffer::scSetProperty(const char *name, ScValue *value) {
// Length
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Length")==0){
- int OrigLength = _length;
+ int origLength = _length;
_length = max(value->getInt(0), 0);
- char PropName[20];
+ char propName[20];
if (_length < OrigLength){
for(int i=_length; i<OrigLength; i++){
sprintf(PropName, "%d", i);