diff options
-rw-r--r-- | engines/illusions/actor.cpp | 232 | ||||
-rw-r--r-- | engines/illusions/bbdou/bbdou_credits.cpp | 2 | ||||
-rw-r--r-- | engines/illusions/bbdou/bbdou_specialcode.cpp | 2 | ||||
-rw-r--r-- | engines/illusions/bbdou/illusions_bbdou.cpp | 14 | ||||
-rw-r--r-- | engines/illusions/bbdou/illusions_bbdou.h | 2 | ||||
-rw-r--r-- | engines/illusions/camera.cpp | 10 | ||||
-rw-r--r-- | engines/illusions/dictionary.h | 10 | ||||
-rw-r--r-- | engines/illusions/duckman/duckman_credits.cpp | 2 | ||||
-rw-r--r-- | engines/illusions/duckman/duckman_specialcode.cpp | 2 | ||||
-rw-r--r-- | engines/illusions/duckman/illusions_duckman.cpp | 2 | ||||
-rw-r--r-- | engines/illusions/fixedpoint.cpp | 18 | ||||
-rw-r--r-- | engines/illusions/fixedpoint.h | 22 | ||||
-rw-r--r-- | engines/illusions/menusystem.cpp | 49 | ||||
-rw-r--r-- | engines/illusions/menusystem.h | 38 | ||||
-rw-r--r-- | engines/illusions/resources/actorresource.h | 2 | ||||
-rw-r--r-- | engines/illusions/resources/midiresource.cpp | 4 | ||||
-rw-r--r-- | engines/illusions/resources/scriptresource.h | 4 | ||||
-rw-r--r-- | engines/illusions/resources/soundresource.h | 4 |
18 files changed, 207 insertions, 212 deletions
diff --git a/engines/illusions/actor.cpp b/engines/illusions/actor.cpp index 10f57446b0..7cbada1c7e 100644 --- a/engines/illusions/actor.cpp +++ b/engines/illusions/actor.cpp @@ -771,9 +771,6 @@ PointArray *Control::createPath(Common::Point destPt) { PathFinder pathFinder; WidthHeight bgDimensions = _vm->_backgroundInstances->getMasterBgDimensions(); PointArray *path = pathFinder.findPath(_vm->_camera, _actor->_position, destPt, walkPoints, walkRects, bgDimensions); - for (uint i = 0; i < path->size(); ++i) { - //debug(0, "Path(%d) (%d, %d)", i, (*path)[i].x, (*path)[i].y); - } return path; } @@ -784,143 +781,140 @@ void Control::updateActorMovement(uint32 deltaTime) { static const int16 kAngleTbl[] = {60, 0, 120, 0, 60, 0, 120, 0}; bool fastWalked = false; - while (1) { + do { - if (!fastWalked && _vm->testMainActorFastWalk(this)) { - fastWalked = true; - disappearActor(); - _actor->_flags |= Illusions::ACTOR_FLAG_8000; - _actor->_seqCodeIp = 0; - deltaTime = 2; - } + if (!fastWalked && _vm->testMainActorFastWalk(this)) { + fastWalked = true; + disappearActor(); + _actor->_flags |= Illusions::ACTOR_FLAG_8000; + _actor->_seqCodeIp = 0; + deltaTime = 2; + } - if (_vm->testMainActorCollision(this)) - break; + if (_vm->testMainActorCollision(this)) + break; - Common::Point prevPt; - if (_actor->_pathPointIndex == 0) { - if (_actor->_pathInitialPosFlag) { - _actor->_pathCtrX = 0; - _actor->_pathInitialPos = _actor->_position; - _actor->_pathInitialPosFlag = false; + Common::Point prevPt; + if (_actor->_pathPointIndex == 0) { + if (_actor->_pathInitialPosFlag) { + _actor->_pathCtrX = 0; + _actor->_pathInitialPos = _actor->_position; + _actor->_pathInitialPosFlag = false; + } + prevPt = _actor->_pathInitialPos; + } else { + prevPt = (*_actor->_pathNode)[_actor->_pathPointIndex - 1]; } - prevPt = _actor->_pathInitialPos; - } else { - prevPt = (*_actor->_pathNode)[_actor->_pathPointIndex - 1]; - } - Common::Point currPt = (*_actor->_pathNode)[_actor->_pathPointIndex]; + Common::Point currPt = (*_actor->_pathNode)[_actor->_pathPointIndex]; - int16 deltaX = currPt.x - prevPt.x; - int16 deltaY = currPt.y - prevPt.y; + int16 deltaX = currPt.x - prevPt.x; + int16 deltaY = currPt.y - prevPt.y; - if (!_actor->_pathFlag50) { + if (!_actor->_pathFlag50) { - // TODO Move to own function - FP16 angle; - if (currPt.x == prevPt.x) { - if (prevPt.y >= currPt.y) - angle = fixedMul(-0x5A0000, 0x478); - else - angle = fixedMul(0x5A0000, 0x478); - } else { - angle = fixedAtan(fixedDiv(deltaY << 16, deltaX << 16)); - } - _actor->_pathAngle = angle; - - // TODO Move to own function - int16 v13 = (fixedTrunc(fixedMul(angle, 0x394BB8)) + 360) % 360; - if (deltaX >= 0) - v13 += 180; - v13 = (v13 + 90) % 360; - int16 v15 = kAngleTbl[0] / -2; - uint newFacing = 1; - for (uint i = 0; i < 8; ++i) { - v15 += kAngleTbl[i]; - if (v13 < v15) { - newFacing = 1 << i; - break; + // TODO Move to own function + FixedPoint16 angle; + if (currPt.x == prevPt.x) { + if (prevPt.y >= currPt.y) + angle = fixedMul(-0x5A0000, 0x478); + else + angle = fixedMul(0x5A0000, 0x478); + } else { + angle = fixedAtan(fixedDiv(deltaY << 16, deltaX << 16)); + } + _actor->_pathAngle = angle; + + // TODO Move to own function + int16 v13 = (fixedTrunc(fixedMul(angle, 0x394BB8)) + 360) % 360; // 0x394BB8 is 180 / pi + if (deltaX >= 0) + v13 += 180; + v13 = (v13 + 90) % 360; + int16 v15 = kAngleTbl[0] / -2; + uint newFacing = 1; + for (uint i = 0; i < 8; ++i) { + v15 += kAngleTbl[i]; + if (v13 < v15) { + newFacing = 1 << i; + break; + } + } + if (newFacing != _actor->_facing) { + refreshSequenceCode(); + faceActor(newFacing); } - } - if (newFacing != _actor->_facing) { - refreshSequenceCode(); - faceActor(newFacing); - } - _actor->_pathFlag50 = true; + _actor->_pathFlag50 = true; - } + } - FP16 deltaX24, deltaY24; + FixedPoint16 deltaX24, deltaY24; - if (_actor->_flags & Illusions::ACTOR_FLAG_400) { + if (_actor->_flags & Illusions::ACTOR_FLAG_400) { - FP16 v20 = fixedMul((deltaTime + _actor->_pathCtrX) << 16, _actor->_pathCtrY << 16); - FP16 v21 = fixedDiv(v20, 100 << 16); - FP16 v22 = fixedMul(v21, _actor->_scale << 16); - FP16 v23 = fixedDiv(v22, 100 << 16); - _actor->_seqCodeValue1 = 100 * _actor->_pathCtrY * deltaTime / 100; - if (v23) { - FP16 prevDistance = fixedDistance(prevPt.x << 16, prevPt.y << 16, _actor->_posXShl, _actor->_posYShl); - FP16 distance = prevDistance + v23; - if (prevPt.x > currPt.x) - distance = -distance; - deltaX24 = fixedMul(fixedCos(_actor->_pathAngle), distance); - deltaY24 = fixedMul(fixedSin(_actor->_pathAngle), distance); + FixedPoint16 v20 = fixedMul((deltaTime + _actor->_pathCtrX) << 16, _actor->_pathCtrY << 16); + FixedPoint16 v21 = fixedDiv(v20, 100 << 16); + FixedPoint16 v22 = fixedMul(v21, _actor->_scale << 16); + FixedPoint16 v23 = fixedDiv(v22, 100 << 16); + _actor->_seqCodeValue1 = 100 * _actor->_pathCtrY * deltaTime / 100; + if (v23) { + FixedPoint16 prevDistance = fixedDistance(prevPt.x << 16, prevPt.y << 16, _actor->_posXShl, _actor->_posYShl); + FixedPoint16 distance = prevDistance + v23; + if (prevPt.x > currPt.x) + distance = -distance; + deltaX24 = fixedMul(fixedCos(_actor->_pathAngle), distance); + deltaY24 = fixedMul(fixedSin(_actor->_pathAngle), distance); + } else { + deltaX24 = _actor->_posXShl - (prevPt.x << 16); + deltaY24 = _actor->_posYShl - (prevPt.y << 16); + } } else { - deltaX24 = _actor->_posXShl - (prevPt.x << 16); - deltaY24 = _actor->_posYShl - (prevPt.y << 16); + if (100 * (int)deltaTime <= _actor->_seqCodeValue2) + break; + deltaX24 = deltaX << 16; + deltaY24 = deltaY << 16; } - } else { - if (100 * (int)deltaTime <= _actor->_seqCodeValue2) - break; - deltaX24 = deltaX << 16; - deltaY24 = deltaY << 16; - } - if (ABS(deltaX24) < ABS(deltaX << 16) || - ABS(deltaY24) < ABS(deltaY << 16)) { - FP16 newX = (prevPt.x << 16) + deltaX24; - FP16 newY = (prevPt.y << 16) + deltaY24; - if (newX == _actor->_posXShl && newY == _actor->_posYShl) { - _actor->_pathCtrX += deltaTime; - } else { - _actor->_pathCtrX = 0; - _actor->_posXShl = newX; - _actor->_posYShl = newY; - _actor->_position.x = fixedTrunc(_actor->_posXShl); - _actor->_position.y = fixedTrunc(_actor->_posYShl); - } - } else { - _actor->_position = currPt; - _actor->_posXShl = _actor->_position.x << 16; - _actor->_posYShl = _actor->_position.y << 16; - --_actor->_pathPointsCount; - ++_actor->_pathPointIndex; - ++_actor->_pathPoints; - _actor->_pathInitialPosFlag = true; - if (_actor->_pathPointsCount == 0) { - if (_actor->_flags & Illusions::ACTOR_FLAG_400) { - delete _actor->_pathNode; - _actor->_flags &= ~Illusions::ACTOR_FLAG_400; + if (ABS(deltaX24) < ABS(deltaX << 16) || + ABS(deltaY24) < ABS(deltaY << 16)) { + FixedPoint16 newX = (prevPt.x << 16) + deltaX24; + FixedPoint16 newY = (prevPt.y << 16) + deltaY24; + if (newX == _actor->_posXShl && newY == _actor->_posYShl) { + _actor->_pathCtrX += deltaTime; + } else { + _actor->_pathCtrX = 0; + _actor->_posXShl = newX; + _actor->_posYShl = newY; + _actor->_position.x = fixedTrunc(_actor->_posXShl); + _actor->_position.y = fixedTrunc(_actor->_posYShl); } - _actor->_pathNode = 0; - _actor->_pathPoints = 0; - _actor->_pathPointsCount = 0; - _actor->_pathPointIndex = 0; - if (_actor->_notifyId3C) { - _vm->notifyThreadId(_actor->_notifyId3C); - _actor->_walkCallerThreadId1 = 0; + } else { + _actor->_position = currPt; + _actor->_posXShl = _actor->_position.x << 16; + _actor->_posYShl = _actor->_position.y << 16; + --_actor->_pathPointsCount; + ++_actor->_pathPointIndex; + ++_actor->_pathPoints; + _actor->_pathInitialPosFlag = true; + if (_actor->_pathPointsCount == 0) { + if (_actor->_flags & Illusions::ACTOR_FLAG_400) { + delete _actor->_pathNode; + _actor->_flags &= ~Illusions::ACTOR_FLAG_400; + } + _actor->_pathNode = 0; + _actor->_pathPoints = 0; + _actor->_pathPointsCount = 0; + _actor->_pathPointIndex = 0; + if (_actor->_notifyId3C) { + _vm->notifyThreadId(_actor->_notifyId3C); + _actor->_walkCallerThreadId1 = 0; + } + fastWalked = false; } - fastWalked = false; + _actor->_pathFlag50 = false; } - _actor->_pathFlag50 = false; - } - if (!fastWalked) - break; - - } + } while (fastWalked); } diff --git a/engines/illusions/bbdou/bbdou_credits.cpp b/engines/illusions/bbdou/bbdou_credits.cpp index eb2377933f..393026e9f7 100644 --- a/engines/illusions/bbdou/bbdou_credits.cpp +++ b/engines/illusions/bbdou/bbdou_credits.cpp @@ -98,7 +98,7 @@ void BbdouCredits::drawTextToControl(uint32 objectId, const char *text, uint ali charToWChar(text, wtext, ARRAYSIZE(wtext)); // TODO Extract to Actor class - Control *control = _vm->getObjectControl(objectId); + Control *control = _vm->getObjectControl(objectId); FontResource *font = _vm->_dict->findFont(_currFontId); TextDrawer textDrawer; WidthHeight dimensions; diff --git a/engines/illusions/bbdou/bbdou_specialcode.cpp b/engines/illusions/bbdou/bbdou_specialcode.cpp index bc6ed0338d..95e17fad2e 100644 --- a/engines/illusions/bbdou/bbdou_specialcode.cpp +++ b/engines/illusions/bbdou/bbdou_specialcode.cpp @@ -60,7 +60,7 @@ CauseThread_BBDOU::CauseThread_BBDOU(IllusionsEngine_BBDOU *vm, uint32 threadId, _sceneId(sceneId), _verbId(verbId), _objectId2(objectId2), _objectId(objectId) { _type = kTTSpecialThread; } - + void CauseThread_BBDOU::onNotify() { _bbdou->_cursor->_data._causeThreadId1 = 0; terminate(); diff --git a/engines/illusions/bbdou/illusions_bbdou.cpp b/engines/illusions/bbdou/illusions_bbdou.cpp index f3845a69ee..06cfc2891a 100644 --- a/engines/illusions/bbdou/illusions_bbdou.cpp +++ b/engines/illusions/bbdou/illusions_bbdou.cpp @@ -168,7 +168,7 @@ Common::Error IllusionsEngine_BBDOU::run() { _screen->setColorKey1(0xF81F); - initInput(); + initInput(); initUpdateFunctions(); @@ -188,10 +188,10 @@ Common::Error IllusionsEngine_BBDOU::run() { ConfMan.registerDefault("talkspeed", 240); _subtitleDuration = (uint16)ConfMan.getInt("talkspeed"); - _globalSceneId = 0x00010003; - + _globalSceneId = 0x00010003; + setDefaultTextCoords(); - + _resSys->loadResource(0x000D0001, 0, 0); _doScriptThreadInit = false; @@ -214,7 +214,7 @@ Common::Error IllusionsEngine_BBDOU::run() { delete _stack; delete _scriptOpcodes; - delete _soundMan; + delete _soundMan; delete _updateFunctions; delete _threads; delete _triggerFunctions; @@ -230,9 +230,9 @@ Common::Error IllusionsEngine_BBDOU::run() { delete _resSys; delete _resReader; delete _dict; - + debug("Ok"); - + return Common::kNoError; } diff --git a/engines/illusions/bbdou/illusions_bbdou.h b/engines/illusions/bbdou/illusions_bbdou.h index 00ce617596..c1bd22b1fd 100644 --- a/engines/illusions/bbdou/illusions_bbdou.h +++ b/engines/illusions/bbdou/illusions_bbdou.h @@ -83,7 +83,7 @@ public: void causeDeclare(uint32 verbId, uint32 objectId2, uint32 objectId, TriggerFunctionCallback *callback); uint32 causeTrigger(uint32 sceneId, uint32 verbId, uint32 objectId2, uint32 objectId, uint32 callingThreadId); - void setDefaultTextCoords(); + void setDefaultTextCoords(); void loadSpecialCode(uint32 resId); void unloadSpecialCode(uint32 resId); diff --git a/engines/illusions/camera.cpp b/engines/illusions/camera.cpp index 390dff8b99..2aa8e74f7f 100644 --- a/engines/illusions/camera.cpp +++ b/engines/illusions/camera.cpp @@ -488,11 +488,11 @@ void Camera::recalcPan(uint32 currTime) { if (_activeState._panSpeed == 0) { _activeState._time2E = 0; } else { - FP16 x1 = _activeState._currPan2.x << 16; - FP16 y1 = _activeState._currPan2.y << 16; - FP16 x2 = _activeState._panTargetPoint.x << 16; - FP16 y2 = _activeState._panTargetPoint.y << 16; - FP16 distance = fixedDistance(x1, y1, x2, y2); + FixedPoint16 x1 = _activeState._currPan2.x << 16; + FixedPoint16 y1 = _activeState._currPan2.y << 16; + FixedPoint16 x2 = _activeState._panTargetPoint.x << 16; + FixedPoint16 y2 = _activeState._panTargetPoint.y << 16; + FixedPoint16 distance = fixedDistance(x1, y1, x2, y2); _activeState._time2E = 60 * fixedTrunc(distance) / _activeState._panSpeed; } diff --git a/engines/illusions/dictionary.h b/engines/illusions/dictionary.h index 8a5476c283..667042cf45 100644 --- a/engines/illusions/dictionary.h +++ b/engines/illusions/dictionary.h @@ -87,20 +87,20 @@ public: void removeActorType(uint32 id); ActorType *findActorType(uint32 id); - void addFont(uint32 id, FontResource *fontResource); + void addFont(uint32 id, FontResource *fontResource); void removeFont(uint32 id); FontResource *findFont(uint32 id); - void addSequence(uint32 id, Sequence *sequence); + void addSequence(uint32 id, Sequence *sequence); void removeSequence(uint32 id); Sequence *findSequence(uint32 id); - void addTalkEntry(uint32 id, TalkEntry *talkEntry); + void addTalkEntry(uint32 id, TalkEntry *talkEntry); void removeTalkEntry(uint32 id); TalkEntry *findTalkEntry(uint32 id); - void setObjectControl(uint32 objectId, Control *control); - Control *getObjectControl(uint32 objectId); + void setObjectControl(uint32 objectId, Control *control); + Control *getObjectControl(uint32 objectId); protected: DictionaryHashMap<ActorType> _actorTypes; diff --git a/engines/illusions/duckman/duckman_credits.cpp b/engines/illusions/duckman/duckman_credits.cpp index 2798efe0cc..ccbde8daf3 100644 --- a/engines/illusions/duckman/duckman_credits.cpp +++ b/engines/illusions/duckman/duckman_credits.cpp @@ -3,7 +3,7 @@ * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 diff --git a/engines/illusions/duckman/duckman_specialcode.cpp b/engines/illusions/duckman/duckman_specialcode.cpp index 60e05052c0..ec8578290f 100644 --- a/engines/illusions/duckman/duckman_specialcode.cpp +++ b/engines/illusions/duckman/duckman_specialcode.cpp @@ -3,7 +3,7 @@ * ScummVM is the legal property of its developers, whose names * are too numerous to list here. Please refer to the COPYRIGHT * file distributed with this source distribution. - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 diff --git a/engines/illusions/duckman/illusions_duckman.cpp b/engines/illusions/duckman/illusions_duckman.cpp index 38d3bab43c..7ffa312948 100644 --- a/engines/illusions/duckman/illusions_duckman.cpp +++ b/engines/illusions/duckman/illusions_duckman.cpp @@ -213,7 +213,7 @@ Common::Error IllusionsEngine_Duckman::run() { delete _fader; - delete _gameState; + delete _gameState; delete _menuSystem; delete _soundMan; delete _updateFunctions; diff --git a/engines/illusions/fixedpoint.cpp b/engines/illusions/fixedpoint.cpp index 54dbb137cd..f240b14ab1 100644 --- a/engines/illusions/fixedpoint.cpp +++ b/engines/illusions/fixedpoint.cpp @@ -25,23 +25,23 @@ namespace Illusions { -FP16 floatToFixed(float value) { +FixedPoint16 floatToFixed(float value) { return value * 65536.0; } -float fixedToFloat(FP16 value) { +float fixedToFloat(FixedPoint16 value) { return value / 65536.0; } -FP16 fixedMul(FP16 a, FP16 b) { +FixedPoint16 fixedMul(FixedPoint16 a, FixedPoint16 b) { return ((float)a * b) / 65536.0; } -FP16 fixedDiv(FP16 a, FP16 b) { +FixedPoint16 fixedDiv(FixedPoint16 a, FixedPoint16 b) { return ((float)a / b) * 65536.0; } -int16 fixedTrunc(FP16 value) { +int16 fixedTrunc(FixedPoint16 value) { // CHECKME Not sure if this correct int16 result = (value >> 16) & 0xFFFF; if ((value & 0xFFFF) >= 0x8000) @@ -49,7 +49,7 @@ int16 fixedTrunc(FP16 value) { return result; } -FP16 fixedDistance(FP16 x1, FP16 y1, FP16 x2, FP16 y2) { +FixedPoint16 fixedDistance(FixedPoint16 x1, FixedPoint16 y1, FixedPoint16 x2, FixedPoint16 y2) { float xd = fixedToFloat(x1) - fixedToFloat(x2); float yd = fixedToFloat(y1) - fixedToFloat(y2); if (xd != 0.0 || yd != 0.0) @@ -57,16 +57,16 @@ FP16 fixedDistance(FP16 x1, FP16 y1, FP16 x2, FP16 y2) { return 0; } -FP16 fixedAtan(FP16 value) { +FixedPoint16 fixedAtan(FixedPoint16 value) { //return floatToFixed(atan2(1.0, fixedToFloat(value))); return floatToFixed(atan(fixedToFloat(value))); } -FP16 fixedCos(FP16 value) { +FixedPoint16 fixedCos(FixedPoint16 value) { return floatToFixed(cos(fixedToFloat(value))); } -FP16 fixedSin(FP16 value) { +FixedPoint16 fixedSin(FixedPoint16 value) { return floatToFixed(sin(fixedToFloat(value))); } diff --git a/engines/illusions/fixedpoint.h b/engines/illusions/fixedpoint.h index 1320daa7e7..fa3fd2291f 100644 --- a/engines/illusions/fixedpoint.h +++ b/engines/illusions/fixedpoint.h @@ -27,17 +27,17 @@ namespace Illusions { -typedef int32 FP16; - -FP16 floatToFixed(float value); -float fixedToFloat(FP16 value); -FP16 fixedMul(FP16 a, FP16 b); -FP16 fixedDiv(FP16 a, FP16 b); -int16 fixedTrunc(FP16 value); -FP16 fixedDistance(FP16 x1, FP16 y1, FP16 x2, FP16 y2); -FP16 fixedAtan(FP16 value); -FP16 fixedCos(FP16 value); -FP16 fixedSin(FP16 value); +typedef int32 FixedPoint16; + +FixedPoint16 floatToFixed(float value); +float fixedToFloat(FixedPoint16 value); +FixedPoint16 fixedMul(FixedPoint16 a, FixedPoint16 b); +FixedPoint16 fixedDiv(FixedPoint16 a, FixedPoint16 b); +int16 fixedTrunc(FixedPoint16 value); +FixedPoint16 fixedDistance(FixedPoint16 x1, FixedPoint16 y1, FixedPoint16 x2, FixedPoint16 y2); +FixedPoint16 fixedAtan(FixedPoint16 value); +FixedPoint16 fixedCos(FixedPoint16 value); +FixedPoint16 fixedSin(FixedPoint16 value); } // End of namespace Illusions diff --git a/engines/illusions/menusystem.cpp b/engines/illusions/menusystem.cpp index 9131d58801..762f50417d 100644 --- a/engines/illusions/menusystem.cpp +++ b/engines/illusions/menusystem.cpp @@ -262,12 +262,12 @@ void BaseMenuSystem::placeActorHoverBackground() { WidthHeight frameDimensions; v0->getActorFrameDimensions(frameDimensions); - + FontResource *font = _vm->_dict->findFont(_activeMenu->_fontId); int charHeight = font->getCharHeight() + font->getLineIncr(); if (frameDimensions._height < charHeight) charHeight = frameDimensions._height; - + v0->drawActorRect(Common::Rect(textInfoDimensions._width - 1, charHeight), _activeMenu->_fieldE); updateActorHoverBackground(); @@ -375,8 +375,8 @@ void BaseMenuSystem::handleClick(uint menuItemIndex, const Common::Point &mouseP debug(0, "BaseMenuSystem::handleClick() menuItemIndex: %d click point: (%d, %d)", menuItemIndex, mousePos.x, mousePos.y); if (menuItemIndex == 0) { - playSoundEffect14(); - return; + playSoundEffect14(); + return; } MenuItem *menuItem = _activeMenu->getMenuItem(menuItemIndex - 1); @@ -434,7 +434,7 @@ uint BaseMenuSystem::drawMenuText(BaseMenu *menu) { } void BaseMenuSystem::update(Control *cursorControl) { - Common::Point mousePos = _vm->_input->getCursorPosition(); + Common::Point mousePos = _vm->_input->getCursorPosition(); setMousePos(mousePos); uint newHoveredMenuItemIndex; @@ -518,7 +518,7 @@ void BaseMenuSystem::setSavegameSlotNum(int slotNum) { } void BaseMenuSystem::setSavegameDescription(Common::String desc) { - _vm->_savegameDescription = desc; + _vm->_savegameDescription = desc; } void BaseMenuSystem::updateTimeOut(bool resetTimeOut) { @@ -672,27 +672,28 @@ void MenuActionLoadGame::execute() { // MenuActionSaveGame - MenuActionSaveGame::MenuActionSaveGame(BaseMenuSystem *menuSystem, uint choiceIndex) - : BaseMenuAction(menuSystem), _choiceIndex(choiceIndex) { - } +MenuActionSaveGame::MenuActionSaveGame(BaseMenuSystem *menuSystem, uint choiceIndex) + : BaseMenuAction(menuSystem), _choiceIndex(choiceIndex) { +} - void MenuActionSaveGame::execute() { - const Plugin *plugin = NULL; - EngineMan.findGame(ConfMan.get("gameid"), &plugin); - GUI::SaveLoadChooser *dialog; - Common::String desc; - int slot; +void MenuActionSaveGame::execute() { + const Plugin *plugin = NULL; + EngineMan.findGame(ConfMan.get("gameid"), &plugin); + GUI::SaveLoadChooser *dialog; + Common::String desc; + int slot; - dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true); - slot = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName()); - desc = dialog->getResultString().c_str(); + dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true); + slot = dialog->runModalWithPluginAndTarget(plugin, ConfMan.getActiveDomainName()); + desc = dialog->getResultString().c_str(); - delete dialog; + delete dialog; - if (slot >= 0) { - _menuSystem->setSavegameSlotNum(slot); - _menuSystem->setSavegameDescription(desc); - _menuSystem->selectMenuChoiceIndex(_choiceIndex); - } + if (slot >= 0) { + _menuSystem->setSavegameSlotNum(slot); + _menuSystem->setSavegameDescription(desc); + _menuSystem->selectMenuChoiceIndex(_choiceIndex); } +} + } // End of namespace Illusions diff --git a/engines/illusions/menusystem.h b/engines/illusions/menusystem.h index cc761167a0..ff85ca60d3 100644 --- a/engines/illusions/menusystem.h +++ b/engines/illusions/menusystem.h @@ -116,57 +116,57 @@ public: protected: IllusionsEngine *_vm; MenuStack _menuStack; - + uint32 _menuCallerThreadId; - bool _isTimeOutEnabled; - bool _isTimeOutReached; - uint32 _timeOutDuration; - uint _timeOutMenuChoiceIndex; - uint32 _timeOutStartTime; - uint32 _timeOutEndTime; - + bool _isTimeOutEnabled; + bool _isTimeOutReached; + uint32 _timeOutDuration; + uint _timeOutMenuChoiceIndex; + uint32 _timeOutStartTime; + uint32 _timeOutEndTime; + Common::Point _savedCursorPos; bool _cursorInitialVisibleFlag; int _savedGameState; int _savedCursorActorIndex; int _savedCursorSequenceId; - + bool _isActive; - + MenuChoiceOffsets _menuChoiceOffsets; int16 *_menuChoiceOffset; - + uint _queryConfirmationChoiceIndex; - + uint _field54; uint _menuLinesCount; uint _menuItemCount; - + uint _hoveredMenuItemIndex; uint _hoveredMenuItemIndex2; uint _hoveredMenuItemIndex3; BaseMenu *_activeMenu; void setMouseCursorToMenuItem(int menuItemIndex); - + void calcMenuItemRect(uint menuItemIndex, WRect &rect); bool calcMenuItemMousePos(uint menuItemIndex, Common::Point &pt); bool calcMenuItemIndexAtPoint(Common::Point pt, uint &menuItemIndex); void setMousePos(Common::Point &mousePos); - + void activateMenu(BaseMenu *menu); - + void updateTimeOut(bool resetTimeOut); - + void initActorHoverBackground(); void placeActorHoverBackground(); void updateActorHoverBackground(); void hideActorHoverBackground(); - + void initActorTextColorRect(); void placeActorTextColorRect(); void hideActorTextColorRect(); - + virtual BaseMenu *getMenuById(int menuId) = 0; virtual void playSoundEffect(int sfxId) = 0; }; diff --git a/engines/illusions/resources/actorresource.h b/engines/illusions/resources/actorresource.h index ea356a9504..34b4702023 100644 --- a/engines/illusions/resources/actorresource.h +++ b/engines/illusions/resources/actorresource.h @@ -94,7 +94,7 @@ public: class ActorInstance : public ResourceInstance { public: - ActorInstance(IllusionsEngine *vm); + ActorInstance(IllusionsEngine *vm); virtual void load(Resource *resource); virtual void unload(); virtual void pause(); diff --git a/engines/illusions/resources/midiresource.cpp b/engines/illusions/resources/midiresource.cpp index 203ed12ad0..5e6e85a4ee 100644 --- a/engines/illusions/resources/midiresource.cpp +++ b/engines/illusions/resources/midiresource.cpp @@ -30,8 +30,8 @@ namespace Illusions { void MidiGroupResourceLoader::load(Resource *resource) { debug(1, "MidiGroupResourceLoader::load() Loading midi group %08X...", resource->_resId); - // TODO - + // TODO + } bool MidiGroupResourceLoader::isFlag(int flag) { diff --git a/engines/illusions/resources/scriptresource.h b/engines/illusions/resources/scriptresource.h index f185319f67..6c4fddfadd 100644 --- a/engines/illusions/resources/scriptresource.h +++ b/engines/illusions/resources/scriptresource.h @@ -141,11 +141,11 @@ public: class ScriptInstance : public ResourceInstance { public: - ScriptInstance(IllusionsEngine *vm); + ScriptInstance(IllusionsEngine *vm); virtual void load(Resource *resource); virtual void unload(); public: - IllusionsEngine *_vm; + IllusionsEngine *_vm; }; } // End of namespace Illusions diff --git a/engines/illusions/resources/soundresource.h b/engines/illusions/resources/soundresource.h index 97e6f89773..b6e6382b00 100644 --- a/engines/illusions/resources/soundresource.h +++ b/engines/illusions/resources/soundresource.h @@ -61,11 +61,11 @@ public: class SoundGroupInstance : public ResourceInstance { public: - SoundGroupInstance(IllusionsEngine *vm); + SoundGroupInstance(IllusionsEngine *vm); virtual void load(Resource *resource); virtual void unload(); public: - IllusionsEngine *_vm; + IllusionsEngine *_vm; SoundGroupResource *_soundGroupResource; uint32 _resId; }; |