diff options
-rw-r--r-- | engines/tsage/converse.cpp | 10 | ||||
-rw-r--r-- | engines/tsage/converse.h | 2 | ||||
-rw-r--r-- | engines/tsage/core.cpp | 61 | ||||
-rw-r--r-- | engines/tsage/core.h | 20 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes1.cpp | 6 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes10.cpp | 4 | ||||
-rw-r--r-- | engines/tsage/ringworld_scenes8.cpp | 8 |
7 files changed, 56 insertions, 55 deletions
diff --git a/engines/tsage/converse.cpp b/engines/tsage/converse.cpp index be072c37f8..7183266cf4 100644 --- a/engines/tsage/converse.cpp +++ b/engines/tsage/converse.cpp @@ -181,7 +181,7 @@ void SequenceManager::signal() { break; case 15: v1 = getNextValue(); - _sceneObject->_field7A = v1; + _sceneObject->_moveRate = v1; break; case 16: v1 = getNextValue(); @@ -302,7 +302,7 @@ void SequenceManager::process(Event &event) { } -void SequenceManager::attached(EventHandler *newOwner, EventHandler *fmt, va_list va) { +void SequenceManager::attached(EventHandler *newOwner, EventHandler *endHandler, va_list va) { // Get the sequence number to use _resNum = va_arg(va, int); @@ -322,7 +322,7 @@ void SequenceManager::attached(EventHandler *newOwner, EventHandler *fmt, va_lis } setup(); - Action::attached(newOwner, fmt, va); + Action::attached(newOwner, endHandler, va); } /** @@ -544,7 +544,7 @@ void StripManager::reset() { _actionIndex = 0; _delayFrames = 0; _owner = NULL; - _fmt = NULL; + _endHandler = NULL; _field2E6 = false; _stripNum = -1; _obj44Index = 0; @@ -648,7 +648,7 @@ void StripManager::signal() { } if (_obj44Index < 0) { - EventHandler *owner = _fmt; + EventHandler *owner = _endHandler; int stripNum = ABS(_obj44Index); remove(); diff --git a/engines/tsage/converse.h b/engines/tsage/converse.h index 7b8d944647..fd2abcd872 100644 --- a/engines/tsage/converse.h +++ b/engines/tsage/converse.h @@ -62,7 +62,7 @@ public: virtual void remove(); virtual void signal(); virtual void process(Event &event); - virtual void attached(EventHandler *newOwner, EventHandler *fmt, va_list va); + virtual void attached(EventHandler *newOwner, EventHandler *endHandler, va_list va); }; diff --git a/engines/tsage/core.cpp b/engines/tsage/core.cpp index 9118df2b15..26b669f0b0 100644 --- a/engines/tsage/core.cpp +++ b/engines/tsage/core.cpp @@ -83,17 +83,17 @@ void EventHandler::dispatch() { if (_action) _action->dispatch(); } -void EventHandler::setAction(Action *action, EventHandler *fmt, ...) { +void EventHandler::setAction(Action *action, EventHandler *endHandler, ...) { if (_action) { - _action->_fmt = NULL; + _action->_endHandler = NULL; _action->remove(); } _action = action; if (action) { va_list va; - va_start(va, fmt); - _action->attached(this, fmt, va); + va_start(va, endHandler); + _action->attached(this, endHandler, va); va_end(va); } } @@ -103,7 +103,8 @@ void EventHandler::setAction(Action *action, EventHandler *fmt, ...) { Action::Action() { _actionIndex = 0; _owner = NULL; - _fmt = NULL; + _endHandler = NULL; + _attached = false; } void Action::synchronise(Serialiser &s) { @@ -115,8 +116,8 @@ void Action::synchronise(Serialiser &s) { s.syncAsSint32LE(_actionIndex); s.syncAsSint32LE(_delayFrames); s.syncAsUint32LE(_startFrame); - s.syncAsSint16LE(_field16); - SYNC_POINTER(_fmt); + s.syncAsByte(_attached); + SYNC_POINTER(_endHandler); } void Action::remove() { @@ -130,9 +131,9 @@ void Action::remove() { _globals->_sceneManager.removeAction(this); } - _field16 = 0; - if (_fmt) - _fmt->signal(); + _attached = false; + if (_endHandler) + _endHandler->signal(); } void Action::process(Event &event) { @@ -158,13 +159,13 @@ void Action::dispatch() { } } -void Action::attached(EventHandler *newOwner, EventHandler *fmt, va_list va) { +void Action::attached(EventHandler *newOwner, EventHandler *endHandler, va_list va) { _actionIndex = 0; _delayFrames = 0; _startFrame = _globals->_events.getFrameNumber(); _owner = newOwner; - _fmt = fmt; - _field16 = 1; + _endHandler = endHandler; + _attached = true; signal(); } @@ -188,7 +189,7 @@ void ObjectMover::synchronise(Serialiser &s) { s.syncAsSint16LE(_moveSign.x); s.syncAsSint16LE(_moveSign.y); s.syncAsSint32LE(_minorDiff); s.syncAsSint32LE(_majorDiff); - s.syncAsSint32LE(_field1A); + s.syncAsSint32LE(_changeCtr); SYNC_POINTER(_action); SYNC_POINTER(_sceneObject); } @@ -222,10 +223,10 @@ void ObjectMover::dispatch() { ySign = _moveSign.y; else { int v = yAmount / yChange; - _field1A += yAmount % yChange; - if (_field1A >= yChange) { + _changeCtr += yAmount % yChange; + if (_changeCtr >= yChange) { ++v; - _field1A -= yChange; + _changeCtr -= yChange; } ySign = _moveSign.y * v; @@ -248,10 +249,10 @@ void ObjectMover::dispatch() { xSign = _moveSign.x; else { int v = xAmount / xChange; - _field1A += xAmount % xChange; - if (_field1A >= xChange) { + _changeCtr += xAmount % xChange; + if (_changeCtr >= xChange) { ++v; - _field1A -= xChange; + _changeCtr -= xChange; } xSign = _moveSign.x * v; @@ -301,7 +302,7 @@ void ObjectMover::setup(const Common::Point &destPos) { _destPosition = destPos; _moveDelta = Common::Point(diffX, diffY); _moveSign = Common::Point(xSign, ySign); - _field1A = 0; + _changeCtr = 0; if (!diffX && !diffY) // Object is already at the correct destination @@ -927,7 +928,7 @@ bool PlayerMover::sub_F8E5(const Common::Point &pt1, const Common::Point &pt2, c void PlayerMover2::synchronise(Serialiser &s) { SYNC_POINTER(_destObject); - s.syncAsSint16LE(_field7E); + s.syncAsSint16LE(_maxArea); s.syncAsSint16LE(_minArea); } @@ -944,7 +945,7 @@ void PlayerMover2::dispatch() { void PlayerMover2::startMove(SceneObject *sceneObj, va_list va) { _sceneObject = sceneObj; - _field7E = va_arg(va, int); + _maxArea = va_arg(va, int); _minArea = va_arg(va, int); _destObject = va_arg(va, SceneObject *); @@ -1663,7 +1664,7 @@ SceneObject::SceneObject() : SceneHotspot() { _moveDiff.y = 3; _numFrames = 10; _numFrames = 10; - _field7A = 10; + _moveRate = 10; _regionBitList = 0; _sceneRegionId = 0; _percent = 100; @@ -1825,8 +1826,8 @@ void SceneObject::addMover(ObjectMover *mover, ...) { if (mover) { // Set up the assigned mover _walkStartFrame = _globals->_events.getFrameNumber(); - if (_field7A != 0) - _walkStartFrame = 60 / _field7A; + if (_moveRate != 0) + _walkStartFrame = 60 / _moveRate; // Signal the mover that movement is beginning va_list va; @@ -2024,7 +2025,7 @@ void SceneObject::synchronise(Serialiser &s) { s.syncAsSint32LE(_regionIndex); SYNC_POINTER(_mover); s.syncAsSint16LE(_moveDiff.x); s.syncAsSint16LE(_moveDiff.y); - s.syncAsSint32LE(_field7A); + s.syncAsSint32LE(_moveRate); SYNC_POINTER(_endAction); s.syncAsUint32LE(_regionBitList); } @@ -2047,7 +2048,7 @@ void SceneObject::postInit(SceneObjectList *OwnerList) { _yDiff = 0; _moveDiff.x = 5; _moveDiff.y = 3; - _field7A = 10; + _moveRate = 10; _regionIndex = 0x40; _numFrames = 10; _regionBitList = 0; @@ -2074,8 +2075,8 @@ void SceneObject::dispatch() { _action->dispatch(); if (_mover && (_walkStartFrame <= currTime)) { - if (_field7A) { - int frameInc = 60 / _field7A; + if (_moveRate) { + int frameInc = 60 / _moveRate; _walkStartFrame = currTime + frameInc; } _mover->dispatch(); diff --git a/engines/tsage/core.h b/engines/tsage/core.h index 4105c27ba4..d72938d489 100644 --- a/engines/tsage/core.h +++ b/engines/tsage/core.h @@ -123,7 +123,7 @@ public: virtual void process(Event &event) {} virtual void dispatch(); virtual void setAction(Action *action) { setAction(action, NULL); } - virtual void setAction(Action *action, EventHandler *fmt, ...); + virtual void setAction(Action *action, EventHandler *endHandler, ...); virtual void destroy() {}; }; @@ -133,8 +133,8 @@ public: int _actionIndex; int _delayFrames; uint32 _startFrame; - int _field16; - EventHandler *_fmt; + bool _attached; + EventHandler *_endHandler; Action(); @@ -143,12 +143,12 @@ public: virtual void remove(); virtual void process(Event &event); virtual void dispatch(); - virtual void attached(EventHandler *newOwner, EventHandler *fmt, va_list va); + virtual void attached(EventHandler *newOwner, EventHandler *endHandler, va_list va); - void attach(EventHandler *newOwner, EventHandler *fmt, ...) { + void attach(EventHandler *newOwner, EventHandler *endHandler, ...) { va_list va; - va_start(va, fmt); - attached(newOwner, fmt, va); + va_start(va, endHandler); + attached(newOwner, endHandler, va); va_end(va); } int getActionIndex() const { return _actionIndex; } @@ -168,7 +168,7 @@ public: Common::Point _moveSign; int _minorDiff; int _majorDiff; - int _field1A; + int _changeCtr; Action *_action; SceneObject *_sceneObject; public: @@ -253,7 +253,7 @@ public: class PlayerMover2 : public PlayerMover { public: SceneObject *_destObject; - int _field7E; + int _maxArea; int _minArea; PlayerMover2() : PlayerMover() { _destObject = NULL; } @@ -512,7 +512,7 @@ public: int _regionIndex; EventHandler *_mover; Common::Point _moveDiff; - int _field7A; + int _moveRate; Action *_endAction; uint32 _regionBitList; public: diff --git a/engines/tsage/ringworld_scenes1.cpp b/engines/tsage/ringworld_scenes1.cpp index 6fd12ce040..fd51670fb8 100644 --- a/engines/tsage/ringworld_scenes1.cpp +++ b/engines/tsage/ringworld_scenes1.cpp @@ -1093,7 +1093,7 @@ void Scene40::Action2::signal() { scene->_doorway.setPriority2(200); scene->_doorway.setPosition(Common::Point(159, 191)); scene->_doorway._moveDiff = Common::Point(40, 40); - scene->_doorway._field7A = 60; + scene->_doorway._moveRate = 60; scene->_doorway.animate(ANIM_MODE_5, NULL); Common::Point pt(271, 165); @@ -1226,7 +1226,7 @@ void Scene40::Action6::signal() { scene->_object1.setStrip2(6); scene->_object1._moveDiff = Common::Point(40, 40); scene->_object1.setPosition(Common::Point(313, 53)); - scene->_object1._field7A = 60; + scene->_object1._moveRate = 60; Common::Point pt(141, 194); NpcMover *mover = new NpcMover(); @@ -1301,7 +1301,7 @@ void Scene40::Action8::signal() { scene->_doorway.setVisage(16); scene->_doorway.setStrip2(6); scene->_doorway.setPriority2(200); - scene->_doorway._field7A = 60; + scene->_doorway._moveRate = 60; if (_globals->_player._position.x >= 145) { scene->_doorway.setPriority2(-1); diff --git a/engines/tsage/ringworld_scenes10.cpp b/engines/tsage/ringworld_scenes10.cpp index 0035f104c9..045ea71586 100644 --- a/engines/tsage/ringworld_scenes10.cpp +++ b/engines/tsage/ringworld_scenes10.cpp @@ -1706,7 +1706,7 @@ void Scene9900::strAction2::signal() { _txtArray1[_txtArray1Index]._fontNumber = 2; _txtArray1[_txtArray1Index]._color1 = 7; _txtArray1[_txtArray1Index].setup(msg); - _txtArray1[_txtArray1Index]._field7A = 20; + _txtArray1[_txtArray1Index]._moveRate = 20; _txtArray1[_txtArray1Index]._moveDiff.y = 2; _txtArray1[_txtArray1Index].setPriority2(255); int frameWidth = _txtArray1[_txtArray1Index].getFrame().getBounds().width(); @@ -1723,7 +1723,7 @@ void Scene9900::strAction2::signal() { msg = _resourceManager->getMessage(8030, _lineNum++); _txtArray2[_txtArray1Index].setup(msg); - _txtArray2[_txtArray1Index]._field7A = 20; + _txtArray2[_txtArray1Index]._moveRate = 20; _txtArray2[_txtArray1Index]._moveDiff.y = 2; _txtArray2[_txtArray1Index].setPriority2(255); frameWidth = _txtArray2[_txtArray1Index].getFrame().getBounds().width(); diff --git a/engines/tsage/ringworld_scenes8.cpp b/engines/tsage/ringworld_scenes8.cpp index 651f8f73c5..0891f64597 100644 --- a/engines/tsage/ringworld_scenes8.cpp +++ b/engines/tsage/ringworld_scenes8.cpp @@ -1424,7 +1424,7 @@ void Scene7300::postInit(SceneObjectList *OwnerList) { _object3._numFrames = 2; _object3._moveDiff = Common::Point(1, 1); _object3.animate(ANIM_MODE_8, 0, 0); - _object3._field7A = 2; + _object3._moveRate = 2; _object3.setAction(&_action2); _globals->_player.postInit(); @@ -1438,7 +1438,7 @@ void Scene7300::postInit(SceneObjectList *OwnerList) { _object1.animate(ANIM_MODE_1, 0); _object1._moveDiff = Common::Point(1, 1); _object1.setPosition(Common::Point(76, 78), 0); - _object1._field7A = 1; + _object1._moveRate = 1; _object1.setAction(&_action3); _object2.postInit(); @@ -1590,7 +1590,7 @@ void Scene7600::postInit(SceneObjectList *OwnerList) { *--------------------------------------------------------------------------*/ void Scene7700::Action1::signal() { - SceneObject *fmtObj = (SceneObject *) _fmt; + SceneObject *fmtObj = (SceneObject *) _endHandler; switch (_actionIndex++) { case 0: { PlayerMover *mover1 = new PlayerMover(); @@ -2327,7 +2327,7 @@ void Scene7700::postInit(SceneObjectList *OwnerList) { _cloud.setPriority2(1); _cloud.setPosition(Common::Point(133, 160), 0); _cloud._moveDiff.x = 1; - _cloud._field7A = 7; + _cloud._moveRate = 7; _cloud.setAction(&_action5); _object1.postInit(); |