aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2008-11-20 13:50:53 +0000
committerMax Horn2008-11-20 13:50:53 +0000
commit32f735a228d9cc786655f25a5906e68f5adeb182 (patch)
tree0199bb6835a33ac39bcf5ade0111d91321ec961e
parent63e7836dec3fb17c351292021a93dd31774e9594 (diff)
downloadscummvm-rg350-32f735a228d9cc786655f25a5906e68f5adeb182.tar.gz
scummvm-rg350-32f735a228d9cc786655f25a5906e68f5adeb182.tar.bz2
scummvm-rg350-32f735a228d9cc786655f25a5906e68f5adeb182.zip
cleanup
svn-id: r35131
-rw-r--r--engines/scumm/script.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp
index 1dbc87dd79..d2d4efc719 100644
--- a/engines/scumm/script.cpp
+++ b/engines/scumm/script.cpp
@@ -488,13 +488,12 @@ byte ScummEngine::fetchScriptByte() {
}
uint ScummEngine::fetchScriptWord() {
- int a;
if (*_lastCodePtr + sizeof(MemBlkHeader) != _scriptOrgPointer) {
long oldoffs = _scriptPointer - _scriptOrgPointer;
getScriptBaseAddress();
_scriptPointer = _scriptOrgPointer + oldoffs;
}
- a = READ_LE_UINT16(_scriptPointer);
+ uint a = READ_LE_UINT16(_scriptPointer);
_scriptPointer += 2;
return a;
}
@@ -504,13 +503,12 @@ int ScummEngine::fetchScriptWordSigned() {
}
uint ScummEngine::fetchScriptDWord() {
- int a;
if (*_lastCodePtr + sizeof(MemBlkHeader) != _scriptOrgPointer) {
- uint32 oldoffs = _scriptPointer - _scriptOrgPointer;
+ long oldoffs = _scriptPointer - _scriptOrgPointer;
getScriptBaseAddress();
_scriptPointer = _scriptOrgPointer + oldoffs;
}
- a = READ_LE_UINT32(_scriptPointer);
+ uint a = READ_LE_UINT32(_scriptPointer);
_scriptPointer += 4;
return a;
}
@@ -718,17 +716,12 @@ void ScummEngine::setResult(int value) {
void ScummEngine::push(int a) {
assert(_scummStackPos >= 0 && _scummStackPos < ARRAYSIZE(_vmStack));
- debug(9, "push %d", a);
_vmStack[_scummStackPos++] = a;
}
int ScummEngine::pop() {
- if (_scummStackPos < 1 || _scummStackPos > ARRAYSIZE(_vmStack)) {
- error("No items on stack to pop() for %s (0x%X) at [%d-%d]", getOpcodeDesc(_opcode), _opcode, _roomResource, vm.slot[_currentScript].number);
- }
- --_scummStackPos;
- debug(9, "pop %d", _vmStack[_scummStackPos]);
- return _vmStack[_scummStackPos];
+ assert(_scummStackPos >= 1 && _scummStackPos <= ARRAYSIZE(_vmStack));
+ return _vmStack[--_scummStackPos];
}
void ScummEngine::stopObjectCode() {