diff options
author | Strangerke | 2011-06-29 16:15:41 +0200 |
---|---|---|
committer | Strangerke | 2011-06-29 16:15:41 +0200 |
commit | b0c9c9122fc678074aba30068e5b36d347208e65 (patch) | |
tree | 79a99db08ec985f2e5f1e216823b1104d5b753fb /engines/m4/mads_logic.cpp | |
parent | f2f3124246a77036f843dee2d83ad28084234ebc (diff) | |
parent | c32a3ea0d30336771bab460ecccb58c4614e6294 (diff) | |
download | scummvm-rg350-b0c9c9122fc678074aba30068e5b36d347208e65.tar.gz scummvm-rg350-b0c9c9122fc678074aba30068e5b36d347208e65.tar.bz2 scummvm-rg350-b0c9c9122fc678074aba30068e5b36d347208e65.zip |
Merge branch 'master' of github.com:scummvm/scummvm into soltys_wip2
Diffstat (limited to 'engines/m4/mads_logic.cpp')
-rw-r--r-- | engines/m4/mads_logic.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/engines/m4/mads_logic.cpp b/engines/m4/mads_logic.cpp index b1e57bd7f3..cc28a26e68 100644 --- a/engines/m4/mads_logic.cpp +++ b/engines/m4/mads_logic.cpp @@ -177,7 +177,7 @@ void MadsSceneLogic::initializeDataMap() { uint32 MadsSceneLogic::getDataValue(int dataId) { switch (dataId) { - case 1: + case 1: return _madsVm->scene()->_abortTimersMode2; case 2: return _madsVm->scene()->_abortTimers; @@ -208,7 +208,7 @@ uint32 MadsSceneLogic::getDataValue(int dataId) { void MadsSceneLogic::setDataValue(int dataId, uint16 dataValue) { switch (dataId) { - case 1: + case 1: _madsVm->scene()->_abortTimersMode2 = (AbortTimerMode)dataValue; break; case 2: @@ -297,7 +297,7 @@ uint16 MadsSceneLogic::startReversibleSpriteSequence(uint16 srcSpriteIdx, bool f uint8 depth = _madsVm->_rails->getDepth(Common::Point(spriteFrame->x + (spriteFrame->width() / 2), spriteFrame->y + (spriteFrame->height() / 2))); - return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0, + return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0, true, 100, depth - 1, 1, ANIMTYPE_REVERSIBLE, 0, 0); } @@ -306,7 +306,7 @@ uint16 MadsSceneLogic::startCycledSpriteSequence(uint16 srcSpriteIdx, bool flipp uint8 depth = _madsVm->_rails->getDepth(Common::Point(spriteFrame->x + (spriteFrame->width() / 2), spriteFrame->y + (spriteFrame->height() / 2))); - return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0, + return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0, true, 100, depth - 1, 1, ANIMTYPE_CYCLED, 0, 0); } @@ -315,7 +315,7 @@ uint16 MadsSceneLogic::startSpriteSequence3(uint16 srcSpriteIdx, bool flipped, i uint8 depth = _madsVm->_rails->getDepth(Common::Point(spriteFrame->x + (spriteFrame->width() / 2), spriteFrame->y + (spriteFrame->height() / 2))); - return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0, + return _madsVm->scene()->_sequenceList.add(srcSpriteIdx, flipped, 1, triggerCountdown, timeoutTicks, extraTicks, numTicks, 0, 0, true, 100, depth - 1, -1, ANIMTYPE_CYCLED, 0, 0); } @@ -335,11 +335,11 @@ void MadsSceneLogic::getPlayerSpritesPrefix() { strcpy(_madsVm->_player._spritesPrefix, "RXSM"); else if (_madsVm->globals()->_nextSceneId == 112) strcpy(_madsVm->_player._spritesPrefix, ""); - + if (strcmp(oldName, _madsVm->_player._spritesPrefix) != 0) _madsVm->_player._spritesChanged = true; - if ((_madsVm->globals()->_nextSceneId == 105) || + if ((_madsVm->globals()->_nextSceneId == 105) || ((_madsVm->globals()->_nextSceneId == 109) && (_madsVm->globals()->_globals[15] != 0))) { // TODO: unknown flag setting _madsVm->_player._spritesChanged = true; @@ -420,7 +420,7 @@ void MadsSceneLogic::initializeScripts() { if ((language != 1) || (_madsVm->getLanguage() != Common::EN_ANY)) continue; - // Found script block for the given game and language. + // Found script block for the given game and language. _scriptsSize = (i < (offsets.size() - 1)) ? offsets[i + 1] - offsets[i] : f.size() - offsets[i]; break; } @@ -433,7 +433,7 @@ void MadsSceneLogic::initializeScripts() { // Load up the list of subroutines into a hash map uint32 blockOffset = f.pos() - 3; - uint32 subsStart = 0; + uint32 subsStart = 0; for (;;) { // Get next entry Common::String subName; @@ -593,12 +593,12 @@ void MadsSceneLogic::execute(uint32 subOffset) { } case OP_DSTORE: { // Stores data variable - param = getParam(scriptOffset, opcode); + param = getParam(scriptOffset, opcode); ScriptVar v = stack.pop(); setDataValue(param, v.isInt() ? v.get() : 0); break; } - + case OP_LOAD: // loads local variable onto stack param = getParam(scriptOffset, opcode); stack.push(locals[param]); @@ -621,7 +621,7 @@ void MadsSceneLogic::execute(uint32 subOffset) { case OP_GSTORE: // pops stack and stores in global variable param = getParam(scriptOffset, opcode); - assert(param < TOTAL_NUM_VARIABLES); + assert(param < TOTAL_NUM_VARIABLES); _madsVm->globals()->_globals[param] = stack.pop().get(); break; @@ -647,7 +647,7 @@ void MadsSceneLogic::execute(uint32 subOffset) { // Condition satisfied - do the jump scriptOffset = param; break; - + case OP_JMPTRUE: // conditional jump param = subOffset + getParam(scriptOffset, opcode); if (stack.pop().get() != 0) @@ -708,7 +708,7 @@ void MadsSceneLogic::execute(uint32 subOffset) { case OP_OR: param1 |= param2; break; case OP_EOR: param1 ^= param2; break; } - + stack.push(ScriptVar(param1)); } break; @@ -774,7 +774,7 @@ uint32 MadsSceneLogic::getParam(uint32 &scriptOffset, int opcode) { */ void MadsSceneLogic::getCallParameters(int numParams, Common::Stack<ScriptVar> &stack, ScriptVar *callParams) { assert(numParams <= MAX_CALL_PARAMS); - for (int i = 0; i < numParams; ++i, ++callParams) + for (int i = 0; i < numParams; ++i, ++callParams) *callParams = stack.pop(); } @@ -881,7 +881,7 @@ void MadsSceneLogic::callSubroutine(int subIndex, Common::Stack<ScriptVar> &stac case 14: { // DynamicHotspots_add EXTRACT_PARAMS(7); - int idx = _madsVm->scene()->_dynamicHotspots.add(p[0], p[1], p[2], + int idx = _madsVm->scene()->_dynamicHotspots.add(p[0], p[1], p[2], Common::Rect(p[6], p[5], p[6] + p[4], p[5] + p[3])); stack.push(ScriptVar(idx)); break; |