diff options
author | Eric Fry | 2018-06-26 22:35:31 +1000 |
---|---|---|
committer | Eugene Sandulenko | 2018-07-20 06:43:33 +0000 |
commit | 989d8d9b8abecee3f0b72c92a05067e128fc6cdd (patch) | |
tree | 6879c75dccd45e4ae6f2396ee62425f625494f37 /engines/illusions/bbdou | |
parent | 7cadb7ad0ce7b24c28d3fa9d842f7083ae5b9056 (diff) | |
download | scummvm-rg350-989d8d9b8abecee3f0b72c92a05067e128fc6cdd.tar.gz scummvm-rg350-989d8d9b8abecee3f0b72c92a05067e128fc6cdd.tar.bz2 scummvm-rg350-989d8d9b8abecee3f0b72c92a05067e128fc6cdd.zip |
ILLUSIONS: Formatting, remove trailing whitespace.
Diffstat (limited to 'engines/illusions/bbdou')
-rw-r--r-- | engines/illusions/bbdou/bbdou_bubble.cpp | 12 | ||||
-rw-r--r-- | engines/illusions/bbdou/bbdou_credits.cpp | 14 | ||||
-rw-r--r-- | engines/illusions/bbdou/bbdou_cursor.cpp | 6 | ||||
-rw-r--r-- | engines/illusions/bbdou/bbdou_specialcode.cpp | 30 | ||||
-rw-r--r-- | engines/illusions/bbdou/bbdou_specialcode.h | 4 | ||||
-rw-r--r-- | engines/illusions/bbdou/bbdou_triggerfunctions.cpp | 2 | ||||
-rw-r--r-- | engines/illusions/bbdou/illusions_bbdou.cpp | 6 | ||||
-rw-r--r-- | engines/illusions/bbdou/illusions_bbdou.h | 10 | ||||
-rw-r--r-- | engines/illusions/bbdou/scriptopcodes_bbdou.cpp | 40 | ||||
-rw-r--r-- | engines/illusions/bbdou/scriptopcodes_bbdou.h | 4 |
10 files changed, 64 insertions, 64 deletions
diff --git a/engines/illusions/bbdou/bbdou_bubble.cpp b/engines/illusions/bbdou/bbdou_bubble.cpp index 62e7959830..c631a22109 100644 --- a/engines/illusions/bbdou/bbdou_bubble.cpp +++ b/engines/illusions/bbdou/bbdou_bubble.cpp @@ -101,7 +101,7 @@ void BbdouBubble::addItem0(uint32 sequenceId1, uint32 sequenceId2, uint32 progRe } void BbdouBubble::show() { - + if (_prevItem0) { hide(); } @@ -110,14 +110,14 @@ void BbdouBubble::show() { _currItem0 = 0; calcBubbles(_pt1, _pt2); - + Control *control = _vm->_dict->getObjectControl(_prevItem0->_objectId); control->setActorPosition(_pt2); control->startSequenceActor(0x60057, 2, 0); control->startSequenceActor(_prevItem0->_sequenceId1, 2, 0); control->appearActor(); control->deactivateObject(); - + for (uint i = 0; i < 32; ++i) { if (_items[i]._enabled == 1) { Control *subControl = _vm->_dict->getObjectControl(_items[i]._objectId); @@ -125,7 +125,7 @@ void BbdouBubble::show() { subControl->startSequenceActor(_items[i]._sequenceId, 2, 0); } } - + } void BbdouBubble::hide() { @@ -156,7 +156,7 @@ void BbdouBubble::setup(int16 minCount, Common::Point pt1, Common::Point pt2, ui if (item0->_count < maxCount && item0->_count >= minCount && (!progResKeywordId || item0->_progResKeywordId == progResKeywordId)) { maxCount = item0->_count; - _currItem0 = item0; + _currItem0 = item0; } } _pt1 = pt1; @@ -204,7 +204,7 @@ void BbdouBubble::calcBubbles(Common::Point &pt1, Common::Point &pt2) { for (int i = 0; i < kSequenceIdsCount; ++i) sequenceCounters[i] = 0; - + if (pt2.y >= pt1.y) { swapY = true; if (pt1.x == pt2.x) diff --git a/engines/illusions/bbdou/bbdou_credits.cpp b/engines/illusions/bbdou/bbdou_credits.cpp index 393026e9f7..08f9900c4e 100644 --- a/engines/illusions/bbdou/bbdou_credits.cpp +++ b/engines/illusions/bbdou/bbdou_credits.cpp @@ -53,7 +53,7 @@ void BbdouCredits::stop() { void BbdouCredits::drawNextLine() { uint leftIndex, rightIndex; - + if (!readNextLine(leftIndex, rightIndex)) { _vm->_scriptResource->_properties.set(_endSignalPropertyId, true); return; @@ -81,13 +81,13 @@ void BbdouCredits::drawNextLine() { void charToWChar(const char *text, uint16 *wtext, uint size) { while (*text != 0 && size > 1) { *wtext++ = (byte)*text++; - /* + /* byte c = (byte)*text++; if (c > 127) c = 32; *wtext = c; - debug("%04X", *wtext); + debug("%04X", *wtext); ++wtext; - */ + */ --size; } *wtext++ = 0; @@ -99,7 +99,7 @@ void BbdouCredits::drawTextToControl(uint32 objectId, const char *text, uint ali // TODO Extract to Actor class Control *control = _vm->getObjectControl(objectId); - FontResource *font = _vm->_dict->findFont(_currFontId); + FontResource *font = _vm->_dict->findFont(_currFontId); TextDrawer textDrawer; WidthHeight dimensions; uint16 *outText; @@ -116,7 +116,7 @@ bool BbdouCredits::readNextLine(uint &leftIndex, uint &rightIndex) { int textLines = 0; leftIndex = 0; rightIndex = 0; - + do { uint lineIndex = _currLineIndex++; const char *text = getText(lineIndex); @@ -147,7 +147,7 @@ bool BbdouCredits::readNextLine(uint &leftIndex, uint &rightIndex) { } } } while (!done); - + return textLines > 0; } diff --git a/engines/illusions/bbdou/bbdou_cursor.cpp b/engines/illusions/bbdou/bbdou_cursor.cpp index 605919a29f..3a098b9f1e 100644 --- a/engines/illusions/bbdou/bbdou_cursor.cpp +++ b/engines/illusions/bbdou/bbdou_cursor.cpp @@ -50,7 +50,7 @@ void BbdouCursor::init(uint32 objectId, uint32 progResKeywordId) { Control *control = _vm->_dict->getObjectControl(objectId); // TODO? control->_actor->setControlRoutine(new Common::Functor2Mem<Control*, uint32, void, BbdouCursor>(this, &BbdouCursor::actorControlRoutine1)); control->_flags |= 8; - + _data._mode = 1; _data._mode2 = 0; _data._verbId1 = 0x1B0000; @@ -75,7 +75,7 @@ void BbdouCursor::init(uint32 objectId, uint32 progResKeywordId) { _data._verbState._objectIds[1] = 0; _data._verbState._index = 0; _data._verbState._flag56 = false; - + resetActiveVerbs(); control->setActorIndexTo1(); @@ -128,7 +128,7 @@ void BbdouCursor::reset(uint32 objectId) { _bbdou->hideVerbBubble(control->_objectId, &_data._verbState); // TODO? control->_actor->setControlRoutine(new Common::Functor2Mem<Control*, uint32, void, BbdouCursor>(this, &BbdouCursor::cursorInteractControlRoutine)); - + } void BbdouCursor::addCursorSequenceId(uint32 objectId, uint32 sequenceId) { diff --git a/engines/illusions/bbdou/bbdou_specialcode.cpp b/engines/illusions/bbdou/bbdou_specialcode.cpp index 95e17fad2e..89f94419ef 100644 --- a/engines/illusions/bbdou/bbdou_specialcode.cpp +++ b/engines/illusions/bbdou/bbdou_specialcode.cpp @@ -492,7 +492,7 @@ void BbdouSpecialCode::playSoundEffect(int soundIndex) { 0x900C1, 2, 0, 3, 0x900C0, 4, - 0x900C2, 5, + 0x900C2, 5, 0, 6 }; uint32 soundEffectId = kSoundEffectIds[2 * soundIndex]; @@ -535,11 +535,11 @@ Common::Point BbdouSpecialCode::getBackgroundCursorPos(Common::Point cursorPos) void BbdouSpecialCode::showBubble(uint32 objectId, uint32 overlappedObjectId, uint32 holdingObjectId, VerbState *verbState, uint32 progResKeywordId) { - + Common::Rect collisionRect; Control *overlappedControl, *control2, *control3; Common::Point bubbleSourcePt(320, 240), bubbleDestPt, currPan; - + overlappedControl = _vm->_dict->getObjectControl(overlappedObjectId); overlappedControl->getCollisionRect(collisionRect); @@ -564,7 +564,7 @@ void BbdouSpecialCode::showBubble(uint32 objectId, uint32 overlappedObjectId, ui verbState->_objectIds[0] = _bubble->addItem(0, 0x6005A); verbState->_objectIds[1] = _bubble->addItem(0, 0x6005A); verbState->_index = 0; - + int value = _objectInteractModeMap.getObjectInteractMode(overlappedControl->_objectId); if (holdingObjectId) { verbState->_verbId = 0x1B0003; @@ -575,15 +575,15 @@ void BbdouSpecialCode::showBubble(uint32 objectId, uint32 overlappedObjectId, ui } else { verbState->_verbId = 0x1B0002; } - + uint32 sequenceId = kStruct10s[verbState->_verbId & 0xFFFF]._sequenceId2; _bubble->show(); - + control3 = _vm->_dict->getObjectControl(verbState->_objectIds[0]); control3->startSequenceActor(sequenceId, 2, 0); control3->appearActor(); control3->deactivateObject(); - + verbState->_isBubbleVisible = true; _vm->_input->discardAllEvents(); @@ -633,7 +633,7 @@ void BbdouSpecialCode::cursorInteractControlRoutine(Control *cursorControl, uint cursorPos = getBackgroundCursorPos(cursorPos); bool foundOverlapped = false; Control *overlappedControl = 0; - + if (cursorData._flags & 1) { foundOverlapped = false; } else if (_vm->getCurrentScene() == 0x1000D) { @@ -643,7 +643,7 @@ void BbdouSpecialCode::cursorInteractControlRoutine(Control *cursorControl, uint foundOverlapped = _vm->_controls->getOverlappedObject(cursorControl, cursorPos, &overlappedControl, cursorData._verbState._minPriority); } - + if (foundOverlapped) { if (overlappedControl->_objectId != cursorData._currOverlappedObjectId) { if (cursorData._verbState._isBubbleVisible) @@ -954,10 +954,10 @@ bool BbdouSpecialCode::testVerbId(uint32 verbId, uint32 holdingObjectId, uint32 static const uint32 kVerbIdsHE[] = {0x001B0003, 0x001B0001, 0}; static const uint32 kVerbIdsH9[] = {0x001B0003, 0}; static const uint32 kVerbIdsH8[] = {0x001B0003, 0x001B0001, 0}; - + const uint32 *verbIds; int interactMode = _objectInteractModeMap.getObjectInteractMode(overlappedObjectId); - + if (holdingObjectId) { if (interactMode == 9) verbIds = kVerbIdsH9; @@ -973,7 +973,7 @@ bool BbdouSpecialCode::testVerbId(uint32 verbId, uint32 holdingObjectId, uint32 else verbIds = kVerbIdsEE; } - + for (; *verbIds; ++verbIds) if (*verbIds == verbId) return true; @@ -1019,7 +1019,7 @@ bool BbdouSpecialCode::runCause(Control *cursorControl, CursorData &cursorData, uint32 sceneId = _vm->getCurrentScene(); uint32 outVerbId, outObjectId2, outObjectId; bool success = false; - + if (getCause(_vm->getCurrentScene(), verbId, objectId2, objectId, outVerbId, outObjectId2, outObjectId)) { sceneId = _vm->getCurrentScene(); success = true; @@ -1027,7 +1027,7 @@ bool BbdouSpecialCode::runCause(Control *cursorControl, CursorData &cursorData, sceneId = 0x10003; success = true; } - + if (!success) return false; @@ -1042,7 +1042,7 @@ bool BbdouSpecialCode::runCause(Control *cursorControl, CursorData &cursorData, if (soundIndex) playSoundEffect(soundIndex); - + cursorData._causeThreadId1 = _vm->causeTrigger(sceneId, outVerbId, outObjectId2, outObjectId, threadId); cursorData._causeThreadId2 = cursorData._causeThreadId1; diff --git a/engines/illusions/bbdou/bbdou_specialcode.h b/engines/illusions/bbdou/bbdou_specialcode.h index 5d11e3b369..df9b3f76c1 100644 --- a/engines/illusions/bbdou/bbdou_specialcode.h +++ b/engines/illusions/bbdou/bbdou_specialcode.h @@ -118,7 +118,7 @@ public: BbdouCursor *_cursor; BbdouBubble *_bubble; BbdouInventory *_inventory; - + BbdouCredits *_credits; // Salad @@ -130,7 +130,7 @@ public: uint _shooterObjectIdIndex; BbdouFoodCtl *_foodCtl; - + ObjectInteractModeMap _objectInteractModeMap; // Special code interface functions diff --git a/engines/illusions/bbdou/bbdou_triggerfunctions.cpp b/engines/illusions/bbdou/bbdou_triggerfunctions.cpp index 7c1ee4702e..6025d44de7 100644 --- a/engines/illusions/bbdou/bbdou_triggerfunctions.cpp +++ b/engines/illusions/bbdou/bbdou_triggerfunctions.cpp @@ -76,7 +76,7 @@ TriggerFunctions::ItemsIterator TriggerFunctions::findInternal(uint32 sceneId, u triggerFunction->_objectId2 == objectId2 && triggerFunction->_objectId == objectId) break; } - return it; + return it; } } // End of namespace Illusions diff --git a/engines/illusions/bbdou/illusions_bbdou.cpp b/engines/illusions/bbdou/illusions_bbdou.cpp index 06cfc2891a..0074036f56 100644 --- a/engines/illusions/bbdou/illusions_bbdou.cpp +++ b/engines/illusions/bbdou/illusions_bbdou.cpp @@ -154,7 +154,7 @@ Common::Error IllusionsEngine_BBDOU::run() { _screen = new Screen16Bit(this, 640, 480); _screenPalette = new NullScreenPalette(); _screenText = new ScreenText(this); - _input = new Input(); + _input = new Input(); _actorInstances = new ActorInstanceList(this); _backgroundInstances = new BackgroundInstanceList(this); _camera = new Camera(this); @@ -176,7 +176,7 @@ Common::Error IllusionsEngine_BBDOU::run() { _scriptOpcodes = new ScriptOpcodes_BBDOU(this); _stack = new ScriptStack(); - + // TODO Move to own class _resGetCtr = 0; _unpauseControlActorFlag = false; @@ -291,7 +291,7 @@ int IllusionsEngine_BBDOU::updateScript(uint flags) { bool IllusionsEngine_BBDOU::causeIsDeclared(uint32 sceneId, uint32 verbId, uint32 objectId2, uint32 objectId) { uint32 codeOffs; - return + return _triggerFunctions->find(sceneId, verbId, objectId2, objectId) || findTriggerCause(sceneId, verbId, objectId2, objectId, codeOffs); } diff --git a/engines/illusions/bbdou/illusions_bbdou.h b/engines/illusions/bbdou/illusions_bbdou.h index c1bd22b1fd..ddbb8278a4 100644 --- a/engines/illusions/bbdou/illusions_bbdou.h +++ b/engines/illusions/bbdou/illusions_bbdou.h @@ -61,7 +61,7 @@ public: protected: virtual Common::Error run(); virtual bool hasFeature(EngineFeature f) const; -public: +public: ScriptMan *_scriptMan; TriggerFunctions *_triggerFunctions; Cursor *_cursor; @@ -94,8 +94,8 @@ public: Common::Point getNamedPointPosition(uint32 namedPointId); uint32 getPriorityFromBase(int16 priority); uint32 getCurrentScene(); - uint32 getPrevScene(); - + uint32 getPrevScene(); + bool isCursorObject(uint32 actorTypeId, uint32 objectId); void setCursorControlRoutine(Control *control); void placeCursorControl(Control *control, uint32 sequenceId); @@ -117,7 +117,7 @@ public: uint32 startTempScriptThread(byte *scriptCodeIp, uint32 callingThreadId, uint32 value8, uint32 valueC, uint32 value10); void resumeFromSavegame(uint32 callingThreadId); - + void newScriptThread(uint32 threadId, uint32 callingThreadId, uint notifyFlags, byte *scriptCodeIp, uint32 value8, uint32 valueC, uint32 value10); uint32 newTimerThread(uint32 duration, uint32 callingThreadId, bool isAbortable); @@ -135,7 +135,7 @@ public: void setSceneIdThreadId(uint32 theSceneId, uint32 theThreadId); bool findTriggerCause(uint32 sceneId, uint32 verbId, uint32 objectId2, uint32 objectId, uint32 &codeOffs); void reset(); - + }; } // End of namespace Illusions diff --git a/engines/illusions/bbdou/scriptopcodes_bbdou.cpp b/engines/illusions/bbdou/scriptopcodes_bbdou.cpp index eb37025631..764dda9d38 100644 --- a/engines/illusions/bbdou/scriptopcodes_bbdou.cpp +++ b/engines/illusions/bbdou/scriptopcodes_bbdou.cpp @@ -100,7 +100,7 @@ void ScriptOpcodes_BBDOU::initOpcodes() { OPCODE(45, opSetProperty); OPCODE(46, opPlaceActor); OPCODE(47, opFaceActor); - OPCODE(48, opFaceActorToObject); + OPCODE(48, opFaceActorToObject); OPCODE(49, opStartSequenceActor); // 50 unused OPCODE(51, opStartMoveActor); @@ -219,9 +219,9 @@ void ScriptOpcodes_BBDOU::opStartTimerThread(ScriptThread *scriptThread, OpCall ARG_INT16(maxDuration); if (maxDuration) duration += _vm->getRandom(maxDuration); - + //duration = 1;//DEBUG Speeds up things - + if (isAbortable) _vm->startAbortableTimerThread(duration, opCall._threadId); else @@ -332,7 +332,7 @@ void ScriptOpcodes_BBDOU::opChangeScene(ScriptThread *scriptThread, OpCall &opCa threadId = dthreadId; dsceneId = 0; } - + // NOTE Skipped checking for stalled resources _vm->_input->discardAllEvents(); _vm->_prevSceneId = _vm->getCurrentScene(); @@ -381,13 +381,13 @@ void ScriptOpcodes_BBDOU::opExitCloseUpScene(ScriptThread *scriptThread, OpCall } void ScriptOpcodes_BBDOU::opPanCenterObject(ScriptThread *scriptThread, OpCall &opCall) { - ARG_INT16(speed); + ARG_INT16(speed); ARG_UINT32(objectId); _vm->_camera->panCenterObject(objectId, speed); } void ScriptOpcodes_BBDOU::opPanToObject(ScriptThread *scriptThread, OpCall &opCall) { - ARG_INT16(speed); + ARG_INT16(speed); ARG_UINT32(objectId); Control *control = _vm->_dict->getObjectControl(objectId); Common::Point pos = control->getActorPosition(); @@ -395,16 +395,16 @@ void ScriptOpcodes_BBDOU::opPanToObject(ScriptThread *scriptThread, OpCall &opCa } void ScriptOpcodes_BBDOU::opPanToNamedPoint(ScriptThread *scriptThread, OpCall &opCall) { - ARG_INT16(speed); + ARG_INT16(speed); ARG_UINT32(namedPointId); Common::Point pos = _vm->getNamedPointPosition(namedPointId); _vm->_camera->panToPoint(pos, speed, opCall._threadId); } void ScriptOpcodes_BBDOU::opPanToPoint(ScriptThread *scriptThread, OpCall &opCall) { - ARG_INT16(speed); - ARG_INT16(x); - ARG_INT16(y); + ARG_INT16(speed); + ARG_INT16(x); + ARG_INT16(y); _vm->_camera->panToPoint(Common::Point(x, y), speed, opCall._threadId); } @@ -432,7 +432,7 @@ void ScriptOpcodes_BBDOU::opSetCameraBoundsToMasterBg(ScriptThread *scriptThread } void ScriptOpcodes_BBDOU::opIncBlockCounter(ScriptThread *scriptThread, OpCall &opCall) { - ARG_INT16(index); + ARG_INT16(index); byte value = _vm->_scriptResource->_blockCounters.get(index) + 1; if (value <= 63) _vm->_scriptResource->_blockCounters.set(index, value); @@ -444,8 +444,8 @@ void ScriptOpcodes_BBDOU::opClearBlockCounter(ScriptThread *scriptThread, OpCall } void ScriptOpcodes_BBDOU::opSetProperty(ScriptThread *scriptThread, OpCall &opCall) { - ARG_INT16(value); - ARG_UINT32(propertyId); + ARG_INT16(value); + ARG_UINT32(propertyId); _vm->_scriptResource->_properties.set(propertyId, value != 0); } @@ -521,7 +521,7 @@ void ScriptOpcodes_BBDOU::opSetActorPosition(ScriptThread *scriptThread, OpCall } void ScriptOpcodes_BBDOU::opStartTalkThread(ScriptThread *scriptThread, OpCall &opCall) { - ARG_INT16(duration); + ARG_INT16(duration); ARG_UINT32(objectId); ARG_UINT32(talkId); ARG_UINT32(sequenceId1); @@ -749,8 +749,8 @@ void ScriptOpcodes_BBDOU::opGetProperty(ScriptThread *scriptThread, OpCall &opCa } void ScriptOpcodes_BBDOU::opCompareBlockCounter(ScriptThread *scriptThread, OpCall &opCall) { - ARG_INT16(index); - ARG_INT16(compareOp); + ARG_INT16(index); + ARG_INT16(compareOp); ARG_INT16(rvalue); int16 lvalue = _vm->_scriptResource->_blockCounters.get(index); bool compareResult = false; @@ -793,19 +793,19 @@ void ScriptOpcodes_BBDOU::opPlayVideo(ScriptThread *scriptThread, OpCall &opCall ARG_UINT32(videoId); ARG_UINT32(priority); // TODO _vm->playVideo(videoId, objectId, value, opCall._threadId); - + //DEBUG Resume calling thread, later done by the video player _vm->notifyThreadId(opCall._callerThreadId); - + } void ScriptOpcodes_BBDOU::opStackPop(ScriptThread *scriptThread, OpCall &opCall) { - _vm->_stack->pop(); + _vm->_stack->pop(); } void ScriptOpcodes_BBDOU::opStackDup(ScriptThread *scriptThread, OpCall &opCall) { int16 value = _vm->_stack->peek(); - _vm->_stack->push(value); + _vm->_stack->push(value); } void ScriptOpcodes_BBDOU::opLoadSpecialCodeModule(ScriptThread *scriptThread, OpCall &opCall) { diff --git a/engines/illusions/bbdou/scriptopcodes_bbdou.h b/engines/illusions/bbdou/scriptopcodes_bbdou.h index d8e0e39731..5385103a3e 100644 --- a/engines/illusions/bbdou/scriptopcodes_bbdou.h +++ b/engines/illusions/bbdou/scriptopcodes_bbdou.h @@ -71,7 +71,7 @@ protected: void opPanToPoint(ScriptThread *scriptThread, OpCall &opCall); void opPanStop(ScriptThread *scriptThread, OpCall &opCall); void opSetDisplay(ScriptThread *scriptThread, OpCall &opCall); - void opSetCameraBounds(ScriptThread *scriptThread, OpCall &opCall); + void opSetCameraBounds(ScriptThread *scriptThread, OpCall &opCall); void opSetCameraBoundsToMasterBg(ScriptThread *scriptThread, OpCall &opCall); void opIncBlockCounter(ScriptThread *scriptThread, OpCall &opCall); void opClearBlockCounter(ScriptThread *scriptThread, OpCall &opCall); @@ -134,7 +134,7 @@ protected: void opSetFontId(ScriptThread *scriptThread, OpCall &opCall); void opAddMenuKey(ScriptThread *scriptThread, OpCall &opCall); void opChangeSceneAll(ScriptThread *scriptThread, OpCall &opCall); - + }; } // End of namespace Illusions |