aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorjohndoe1232014-03-18 10:59:28 +0100
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commitf880c606f747ebdd8bdd6027ea26fda7d1eabda3 (patch)
tree994b1b95af4e5be825aae91ace88edb7d0d3ea0e /engines
parentf98c0defe561889fa40694484ee251174c59f5a4 (diff)
downloadscummvm-rg350-f880c606f747ebdd8bdd6027ea26fda7d1eabda3.tar.gz
scummvm-rg350-f880c606f747ebdd8bdd6027ea26fda7d1eabda3.tar.bz2
scummvm-rg350-f880c606f747ebdd8bdd6027ea26fda7d1eabda3.zip
ILLUSIONS: Work on Actor and Control classes
Diffstat (limited to 'engines')
-rw-r--r--engines/illusions/actor.cpp349
-rw-r--r--engines/illusions/actor.h34
-rw-r--r--engines/illusions/actorresource.cpp27
-rw-r--r--engines/illusions/actorresource.h16
-rw-r--r--engines/illusions/backgroundresource.cpp8
-rw-r--r--engines/illusions/backgroundresource.h2
-rw-r--r--engines/illusions/camera.cpp18
-rw-r--r--engines/illusions/illusions.cpp42
-rw-r--r--engines/illusions/illusions.h11
9 files changed, 460 insertions, 47 deletions
diff --git a/engines/illusions/actor.cpp b/engines/illusions/actor.cpp
index d7d7fb5702..04d7636e1c 100644
--- a/engines/illusions/actor.cpp
+++ b/engines/illusions/actor.cpp
@@ -25,6 +25,7 @@
#include "illusions/camera.h"
#include "illusions/input.h"
#include "illusions/screen.h"
+#include "illusions/scriptman.h"
namespace Illusions {
@@ -49,7 +50,72 @@ void DefaultSequences::set(uint32 sequenceId, uint32 newSequenceId) {
Actor::Actor(IllusionsEngine *vm)
: _vm(vm), _pauseCtr(0) {
-
+ _pauseCtr = 0;
+ _flags = 0;
+ _scale = 100;
+ _frameIndex = 0;
+ _newFrameIndex = 0;
+ _surfInfo._pixelSize = 0;
+ _surfInfo._dimensions._width = 0;
+ _surfInfo._dimensions._height = 0;
+ _surface = 0;
+ _frames = 0;
+ _scaleLayer = 0;
+ _priorityLayer = 0;
+ _position.x = 0;
+ _position.y = 0;
+ _position2.x = 0;
+ _position2.y = 0;
+ _facing = 64;
+ _fontId = 0;
+ _parentObjectId = 0;
+ _linkIndex = 0;
+ _linkIndex2 = 0;
+ for (uint i = 0; i < kSubObjectsCount; ++i)
+ _subobjects[i] = 0;
+ _notifyThreadId1 = 0;
+ _notifyThreadId2 = 0;
+ _surfaceTextFlag = 0;
+ _field30 = 0;
+ _seqCodeIp = 0;
+ _sequenceId = 0;
+ _seqCodeValue1 = 0;
+ _seqCodeValue2 = 600;
+ _seqCodeValue3 = 0;
+
+ _pathCtrY = 0;
+
+#if 0 // TODO
+ _field2 = 0;
+ _spriteFlags = 0;
+ _drawFlags = 0;
+ _controlRoutine = Actor_defaultControlRoutine;
+ _notifyId3C = 0;
+ _path40 = 0;
+ _path4C = 0;
+ _pathFlag50 = 0;
+ _pathCtrX = 0;
+ _pathInitialPosFlag = 1;
+ _pathInitialPos.x = 0;
+ _pathInitialPos.y = 0;
+ _actorIndex = 0;
+ _namedPointsCount = 0;
+ _namedPoints = 0;
+ _field164 = 0;
+ _pathWalkRects = 0;
+ _pathWalkPoints = 0;
+ _pathNode = 0;
+ _pathPoints = 0;
+ _pathPointIndex = 0;
+ _pathPointsCount = 0;
+ _regionLayer = 0;
+ _transitionRegionId = 0;
+ _field18C = 0;
+ _field190 = 0;
+ _field192 = 0;
+ _field198 = 0;
+#endif
+
}
void Actor::pause() {
@@ -90,6 +156,22 @@ void Actor::destroySurface() {
Control::Control(IllusionsEngine *vm)
: _vm(vm) {
+ _flags = 0;
+ _pauseCtr = 0;
+ _priority = 0;
+ _objectId = 0;
+ _unkPt.x = 0;
+ _unkPt.y = 0;
+ _pt.x = 0;
+ _pt.y = 0;
+ _feetPt.x = 0;
+ _feetPt.y = 0;
+ _position.x = 0;
+ _position.y = 0;
+ _actorTypeId = 0;
+ _actor = 0;
+ // TODO _buf = 0;
+ _tag = _vm->_scriptMan->_activeScenes.getCurrentScene();
}
Control::~Control() {
@@ -99,10 +181,8 @@ void Control::pause() {
// TODO scrmgrSetObjectArtThread(control->objectId, 0);
- /* TODO
if (_objectId == 0x40004)
- _cursor.control = 0;
- */
+ _vm->setCursorControl(0);
if (_actor && !(_actor->_flags & 0x0200))
_actor->destroySurface();
@@ -113,10 +193,8 @@ void Control::unpause() {
// TODO scrmgrSetObjectArtThread(control->objectId, control);
- /* TODO
if (_objectId == 0x40004)
- _cursor.control = this;
- */
+ _vm->setCursorControl(this);
if (_actor && !(_actor->_flags & 0x0200)) {
SurfInfo surfInfo;
@@ -132,9 +210,7 @@ void Control::unpause() {
void Control::appearActor() {
if (_objectId == 0x40004) {
- // TODO ++cursor._visibleCtr;
- // TODO if (cursor._visibleCtr > 0)
- {
+ if (_vm->showCursor()) {
_flags |= 1;
_actor->_flags |= 1;
if (_actor->_frameIndex) {
@@ -158,11 +234,9 @@ void Control::appearActor() {
void Control::disappearActor() {
if (_objectId == 0x40004) {
- // TODO --cursor.visibleCtr;
- // TODO if (cursor.visibleCtr <= 0)
- {
- _flags &= 0xFFFEu;
- _actor->_flags &= 0xFFFE;
+ if (_vm->hideCursor()) {
+ _flags &= ~1;
+ _actor->_flags &= ~1;
}
} else {
_actor->_flags |= ~1;
@@ -340,7 +414,7 @@ void Control::setActorUsePan(int usePan) {
void Control::setActorFrameIndex(int16 frameIndex) {
if (frameIndex) {
_actor->_frameIndex = frameIndex;
- const Frame &frame = _actor->_frames[frameIndex - 1];
+ const Frame &frame = (*_actor->_frames)[frameIndex - 1];
_actor->_surfInfo = frame._surfInfo;
// TODO memcpy(&control->unkPt, (const void *)frame->config, 0x4Cu);
_actor->_flags |= 0x2000;
@@ -349,7 +423,250 @@ void Control::setActorFrameIndex(int16 frameIndex) {
}
}
+void Control::stopActor() {
+ _actor->_seqCodeIp = 0;
+ /* TODO
+ if (_actor->_pathNode) {
+ if (_actor->_flags & 0x0400) {
+ // TODO delete _actor->_pathNode;
+ _actor->_flags &= ~0x0400;
+ }
+ _actor->_pathNode = 0;
+ _actor->_pathPoints = 0;
+ _actor->_pathPointsCount = 0;
+ _actor->_pathPointIndex = 0;
+ _actor->_path40 = 0;
+ }
+ */
+
+ _vm->notifyThreadId(_actor->_notifyThreadId1);
+ _vm->notifyThreadId(_actor->_notifyId3C);
+
+}
+
+void Control::startSequenceActor(uint32 sequenceId, int value, uint32 notifyThreadId) {
+ startSequenceActorIntern(sequenceId, value, 0, notifyThreadId);
+}
+
+void Control::stopSequenceActor() {
+ if (_actor->_flags & 0x40) {
+ stopActor();
+ _actor->_frameIndex = 0;
+ if ((_actor->_flags & 1) || (_actor->_flags & 0x1000)) {
+ _actor->_flags &= ~1;
+ _actor->_flags |= 0x1000;
+ }
+ }
+ for (uint i = 0; i < kSubObjectsCount; ++i)
+ if (_actor->_subobjects[i]) {
+ Control *subControl = _vm->findControl(_actor->_subobjects[i]);
+ subControl->stopSequenceActor();
+ }
+}
+
+void Control::sequenceActor() {
+ // TODO
+}
+
+void Control::startSequenceActorIntern(uint32 sequenceId, int value, int value2, uint32 notifyThreadId) {
+
+ stopActor();
+
+ _actor->_flags &= ~0x80;
+ _actor->_flags &= ~0x0400;
+ _actor->_flags |= 0x0100;
+
+ sequenceId = _actor->_defaultSequences.use(sequenceId);
+
+ _actor->_sequenceId = sequenceId;
+ _actor->_notifyThreadId1 = notifyThreadId;
+ _actor->_notifyId3C = 0;
+ _actor->_path40 = 0;
+
+ Sequence *sequence = _vm->findSequence(sequenceId);
+
+ _actor->_seqCodeIp = sequence->_sequenceCode;
+ _actor->_frames = _vm->findSequenceFrames(sequence);
+
+ _actor->_seqCodeValue3 = 0;
+ _actor->_seqCodeValue1 = 0;
+ _actor->_seqCodeValue2 = value == 1 ? 350 : 600;
+ // TODO _actor->initSequenceStack();
+ stopSequenceActor();
+ _actor->_linkIndex2 = 0;
+ if (value2) {
+ _actor->_flags |= 0x80;
+ _actor->_field30 = value2;
+ _actor->_notifyThreadId1 = 0;
+ _actor->_notifyThreadId2 = notifyThreadId;
+ }
+
+ // TODO sequenceActor();
+
+}
+
// Controls
+Controls::Controls(IllusionsEngine *vm)
+ : _vm(vm) {
+}
+
+void Controls::placeActor(uint32 actorTypeId, Common::Point placePt, uint32 sequenceId, uint32 objectId, uint32 notifyThreadId) {
+ Control *control = newControl();
+ Actor *actor = newActor();
+
+ ActorType *actorType = _vm->findActorType(actorTypeId);
+ control->_flags = actorType->_flags;
+ control->_priority = actorType->_priority;
+ control->_objectId = objectId;
+ // TODO memcpy(&control->unkPt, (const void *)actorType->_config, 0x4Cu);
+ control->_actorTypeId = actorTypeId;
+ control->_actor = actor;
+ /* TODO
+ if (actorTypeId == 0x50001 && objectId == 0x40004)
+ actor->setControlRoutine(Cursor_controlRoutine);
+ */
+ if (actorType->_surfInfo._dimensions._width > 0 || actorType->_surfInfo._dimensions._height > 0) {
+ actor->createSurface(actorType->_surfInfo);
+ } else {
+ actor->_flags |= 0x0200;
+ }
+ actor->_position = placePt;
+ actor->_position2 = placePt;
+ Common::Point currPan = _vm->_camera->getCurrentPan();
+ // TODO if (!artcntrl_calcPointDirection(placePt, panPos, &actor->facing))
+ actor->_facing = 64;
+ actor->_scale = actorType->_scale;
+ // TODO actor->_namedPointsCount = actorType->_namedPointsCount;
+ // TODO actor->_namedPoints = actorType->_namedPoints;
+
+ BackgroundResource *bgRes = _vm->_backgroundItems->getActiveBgResource();
+ if (actorType->_pathWalkPointsIndex) {
+ // TODO actor->_pathWalkPoints = bgRes->getPathWalkPoints(actorType->_pathWalkPointsIndex - 1);
+ actor->_flags |= 0x02;
+ }
+
+ if (actorType->_scaleLayerIndex) {
+ actor->_scaleLayer = bgRes->getScaleLayer(actorType->_scaleLayerIndex - 1);
+ actor->_flags |= 0x04;
+ }
+
+ if (actorType->_pathWalkRectIndex) {
+ // TODO actor->_pathWalkRects = bgRes->getPathWalkRects(actorType->_pathWalkRectIndex - 1);
+ actor->_flags |= 0x10;
+ }
+
+ if (actorType->_priorityLayerIndex) {
+ actor->_priorityLayer = bgRes->getPriorityLayer(actorType->_priorityLayerIndex - 1);
+ actor->_flags |= 0x08;
+ }
+
+ if (actorType->_regionLayerIndex) {
+ // TODO actor->_regionLayer = bgRes->getPriorityLayer(actorType->_regionLayerIndex - 1);
+ actor->_flags |= 0x20;
+ }
+
+ actor->_pathCtrY = 140;
+
+ _controls.push_back(control);
+ // TODO scrmgrSetObjectArtThread(objectId, controlb);
+
+ if (actorTypeId == 0x50001 && objectId == 0x40004)
+ _vm->placeCursor(control, sequenceId);
+
+ control->_flags |= 0x01;
+ actor->_flags |= 0x1000;
+
+ control->startSequenceActor(sequenceId, 2, notifyThreadId);
+}
+
+void Controls::placeSequenceLessActor(uint32 objectId, Common::Point placePt, WidthHeight dimensions, int16 priority) {
+ Control *control = newControl();
+ Actor *actor = newActor();
+ control->_flags = 0;
+ control->_priority = priority;
+ control->_objectId = objectId;
+ control->_unkPt.x = 0;
+ control->_unkPt.y = 0;
+ control->_pt.y = dimensions._height - 1;
+ control->_pt.x = dimensions._width - 1;
+ control->_feetPt.x = dimensions._width / 2;
+ control->_feetPt.y = dimensions._height / 2;
+ control->_position.x = 0;
+ control->_position.y = 0;
+ control->_actorTypeId = 0x50004;
+ control->_actor = actor;
+ // TODO actor->setControlRoutine(0);
+ actor->_surfInfo._pixelSize = dimensions._width * dimensions._height;
+ actor->_surfInfo._dimensions = dimensions;
+ actor->createSurface(actor->_surfInfo);
+ actor->_position = placePt;
+ actor->_position2 = placePt;
+ actor->_facing = 64;
+ actor->_scale = 100;
+ // TODO actor->_namedPointsCount = 0;
+ // TODO actor->_namedPoints = 0;
+ actor->_pathCtrY = 140;
+
+ _controls.push_back(control);
+ // TODO scrmgrSetObjectArtThread(objectId, controlb);
+ control->appearActor();
+}
+
+void Controls::placeActorLessObject(uint32 objectId, Common::Point feetPt, Common::Point pt, int16 priority, uint flags) {
+ Control *control = newControl();
+ control->_flags = flags;
+ control->_unkPt = feetPt;
+ control->_feetPt = feetPt;
+ control->_priority = priority;
+ control->_objectId = objectId;
+ control->_pt = pt;
+ control->_position.x = 0;
+ control->_position.y = 0;
+ control->_actorTypeId = 0;
+ control->_actor = 0;
+ _controls.push_back(control);
+ // TODO scrmgrSetObjectArtThread(objectId, controlb);
+}
+
+Actor *Controls::newActor() {
+ return new Actor(_vm);
+}
+
+Control *Controls::newControl() {
+ return new Control(_vm);
+}
+
+void Controls::destroyControl(Control *control) {
+ _controls.remove(control);
+
+ /* TODO
+ if (control->_pauseCtr <= 0)
+ scrmgrSetObjectArtThread(control->objectId, 0);
+ */
+
+ if (control->_objectId == 0x40004 && control->_pauseCtr <= 0)
+ _vm->setCursorControl(0);
+
+ if (control->_actor) {
+ /* TODO
+ if (actor->_pathNode && (actor->_flags & 0x400))
+ delete actor->_pathNode;
+ */
+ if (!(control->_actor->_flags & 0x200))
+ control->_actor->destroySurface();
+ /* TODO
+ if (control->_actor->_field2)
+ largeObj_sub_4061E0();
+ */
+ delete control->_actor;
+ control->_actor = 0;
+ }
+ /* TODO
+ if (control->_buf)
+ free(control->_buf);
+ */
+ delete control;
+}
} // End of namespace Illusions
diff --git a/engines/illusions/actor.h b/engines/illusions/actor.h
index 6216b31aa6..e70efab02e 100644
--- a/engines/illusions/actor.h
+++ b/engines/illusions/actor.h
@@ -24,6 +24,7 @@
#define ILLUSIONS_ACTOR_H
#include "illusions/actorresource.h"
+#include "illusions/backgroundresource.h"
#include "illusions/graphics.h"
#include "common/algorithm.h"
#include "common/list.h"
@@ -79,11 +80,18 @@ public:
int16 _newFrameIndex;
SurfInfo _surfInfo;
Graphics::Surface *_surface;
- Frame *_frames;
+
+ FramesList *_frames;
+
+ ScaleLayer *_scaleLayer;
+ PriorityLayer *_priorityLayer;
Common::Point _position;
+ Common::Point _position2;
uint _facing;
+ uint32 _fontId;
+
DefaultSequences _defaultSequences;
uint32 _parentObjectId;
@@ -92,11 +100,22 @@ public:
uint32 _subobjects[kSubObjectsCount];
uint32 _notifyThreadId1;
+ uint32 _notifyId3C;
uint32 _notifyThreadId2;
int _field30;
int _surfaceTextFlag;
+
+ byte *_seqCodeIp;
+ uint32 _sequenceId;
+ int _seqCodeValue1;
+ int _seqCodeValue2;
+ int _seqCodeValue3;
+
+ int _pathCtrY;
+ int _path40;
+
};
@@ -125,6 +144,10 @@ public:
void getCollisionRectAccurate(Common::Rect &collisionRect);
void setActorUsePan(int usePan);
void setActorFrameIndex(int16 frameIndex);
+ void stopActor();
+ void startSequenceActor(uint32 sequenceId, int value, uint32 notifyThreadId);
+ void stopSequenceActor();
+ void sequenceActor();
public:
IllusionsEngine *_vm;
uint _flags;
@@ -141,14 +164,23 @@ public:
Common::Point _feetPt;
Common::Point _position;
// TODO 0000001C - 00000054 unknown
+ void startSequenceActorIntern(uint32 sequenceId, int value, int value2, uint32 notifyThreadId);
};
class Controls {
public:
+ Controls(IllusionsEngine *vm);
+ void placeActor(uint32 actorTypeId, Common::Point placePt, uint32 sequenceId, uint32 objectId, uint32 notifyThreadId);
+ void placeSequenceLessActor(uint32 objectId, Common::Point placePt, WidthHeight dimensions, int16 priority);
+ void placeActorLessObject(uint32 objectId, Common::Point feetPt, Common::Point pt, int16 priority, uint flags);
public:
typedef Common::List<Control*> Items;
typedef Items::iterator ItemsIterator;
+ IllusionsEngine *_vm;
Items _controls;
+ Actor *newActor();
+ Control *newControl();
+ void destroyControl(Control *control);
};
} // End of namespace Illusions
diff --git a/engines/illusions/actorresource.cpp b/engines/illusions/actorresource.cpp
index e200fae532..fc4968ee61 100644
--- a/engines/illusions/actorresource.cpp
+++ b/engines/illusions/actorresource.cpp
@@ -109,19 +109,19 @@ void ActorType::load(byte *dataStart, Common::SeekableReadStream &stream) {
_scale = stream.readByte();
_priority = stream.readByte();
_value1E = stream.readUint16LE();
- _bgItem28sIndex = stream.readUint16LE();
- _bgItem22sIndex = stream.readUint16LE();
- _bgItem30sIndex = stream.readUint16LE();
- _bgItem26sIndex = stream.readUint16LE();
- _bgItem38sIndex = stream.readUint16LE();
+ _pathWalkPointsIndex = stream.readUint16LE();
+ _scaleLayerIndex = stream.readUint16LE();
+ _pathWalkRectIndex = stream.readUint16LE();
+ _priorityLayerIndex = stream.readUint16LE();
+ _regionLayerIndex = stream.readUint16LE();
_flags = stream.readUint16LE();
-
+
debug("ActorType::load() _actorTypeId: %08X; _color(%d,%d,%d); _scale: %d; _priority: %d; _value1E: %d",
_actorTypeId, _color.r, _color.g, _color.b, _scale, _priority, _value1E);
- debug("ActorType::load() _bgItem28sIndex: %d; _bgItem22sIndex: %d; _bgItem30sIndex: %d",
- _bgItem28sIndex, _bgItem22sIndex, _bgItem30sIndex);
- debug("ActorType::load() _bgItem26sIndex: %d; _bgItem38sIndex: %d; _flags: %04X",
- _bgItem26sIndex, _bgItem38sIndex,_flags);
+ debug("ActorType::load() _pathWalkPointsIndex: %d; _scaleLayerIndex: %d; _pathWalkRectIndex: %d",
+ _pathWalkPointsIndex, _scaleLayerIndex, _pathWalkRectIndex);
+ debug("ActorType::load() _priorityLayerIndex: %d; _regionLayerIndex: %d; _flags: %04X",
+ _priorityLayerIndex, _regionLayerIndex,_flags);
}
// ActorResource
@@ -178,6 +178,13 @@ void ActorResource::load(byte *data, uint32 dataSize) {
}
+bool ActorResource::containsSequence(Sequence *sequence) {
+ for (uint i = 0; i < _sequences.size(); ++i)
+ if (sequence == &_sequences[i])
+ return true;
+ return false;
+}
+
// ActorItem
ActorItem::ActorItem() {
diff --git a/engines/illusions/actorresource.h b/engines/illusions/actorresource.h
index 78ce89ae4d..c62f8a996a 100644
--- a/engines/illusions/actorresource.h
+++ b/engines/illusions/actorresource.h
@@ -68,25 +68,29 @@ struct ActorType {
byte _scale;
byte _priority;
int16 _value1E;
- uint16 _bgItem28sIndex;
- uint16 _bgItem22sIndex;
- uint16 _bgItem30sIndex;
- uint16 _bgItem26sIndex;
- uint16 _bgItem38sIndex;
+ uint16 _pathWalkPointsIndex;
+ uint16 _scaleLayerIndex;
+ uint16 _pathWalkRectIndex;
+ uint16 _priorityLayerIndex;
+ uint16 _regionLayerIndex;
uint16 _flags;
void load(byte *dataStart, Common::SeekableReadStream &stream);
};
+class FramesList : public Common::Array<Frame> {
+};
+
class ActorResource {
public:
ActorResource();
~ActorResource();
void load(byte *data, uint32 dataSize);
+ bool containsSequence(Sequence *sequence);
public:
uint32 _totalSize;
Common::Array<ActorType> _actorTypes;
Common::Array<Sequence> _sequences;
- Common::Array<Frame> _frames;
+ FramesList _frames;
};
class ActorItem {
diff --git a/engines/illusions/backgroundresource.cpp b/engines/illusions/backgroundresource.cpp
index 66f987a934..bdce1c4669 100644
--- a/engines/illusions/backgroundresource.cpp
+++ b/engines/illusions/backgroundresource.cpp
@@ -182,6 +182,14 @@ int BackgroundResource::findMasterBgIndex() {
return index;
}
+PriorityLayer *BackgroundResource::getPriorityLayer(uint index) {
+ return &_priorityLayers[index];
+}
+
+ScaleLayer *BackgroundResource::getScaleLayer(uint index) {
+ return &_scaleLayers[index];
+}
+
// BackgroundItem
BackgroundItem::BackgroundItem(IllusionsEngine *vm) : _vm(vm), _tag(0), _pauseCtr(0), _bgRes(0) {
diff --git a/engines/illusions/backgroundresource.h b/engines/illusions/backgroundresource.h
index fd802539c2..de6204e94b 100644
--- a/engines/illusions/backgroundresource.h
+++ b/engines/illusions/backgroundresource.h
@@ -106,6 +106,8 @@ public:
~BackgroundResource();
void load(byte *data, uint32 dataSize);
int findMasterBgIndex();
+ PriorityLayer *getPriorityLayer(uint index);
+ ScaleLayer *getScaleLayer(uint index);
public:
uint _bgInfosCount;
diff --git a/engines/illusions/camera.cpp b/engines/illusions/camera.cpp
index fceb6b6341..0aff84ff64 100644
--- a/engines/illusions/camera.cpp
+++ b/engines/illusions/camera.cpp
@@ -116,10 +116,7 @@ void Camera::panTrackObject(uint32 objectId) {
void Camera::panToPoint(Common::Point pt, int16 panSpeed, uint32 panNotifyId) {
- if (_activeState._panNotifyId) {
- // TODO scrmgrNotifyID(_activeState._panNotifyId);
- _activeState._panNotifyId = 0;
- }
+ _vm->notifyThreadId(_activeState._panNotifyId);
_activeState._panTargetPoint = getPtOffset(pt);
clipPanTargetPoint();
@@ -137,9 +134,7 @@ void Camera::panToPoint(Common::Point pt, int16 panSpeed, uint32 panNotifyId) {
} else {
_activeState._currPan = _activeState._panTargetPoint;
stopPan();
- if (panNotifyId) {
- // TODO scrmgrNotifyID(panNotifyId);
- }
+ _vm->notifyThreadId(_activeState._panNotifyId);
}
}
@@ -275,10 +270,7 @@ void Camera::update(uint32 currTime) {
if (isPanFinished()) {
if (_activeState._cameraMode == 5) {
// Notify a thread that the camera panning has finished
- if (_activeState._panNotifyId) {
- // TODO scrmgrNotifyID(_activeState._panNotifyId);
- _activeState._panNotifyId = 0;
- }
+ _vm->notifyThreadId(_activeState._panNotifyId);
_activeState._cameraMode = 6;
} else if (_activeState._cameraMode == 4) {
_activeState._cameraMode = 3;
@@ -371,8 +363,8 @@ void Camera::updateMode2(uint32 currTime) {
recalcPan(currTime);
}
} else if (_activeState._pointFlags) {
- _activeState._pointFlags = 0;
- _activeState._panTargetPoint = _activeState._currPan;
+ _activeState._pointFlags = 0;
+ _activeState._panTargetPoint = _activeState._currPan;
}
}
diff --git a/engines/illusions/illusions.cpp b/engines/illusions/illusions.cpp
index 5a0c2ea710..3592ea9f15 100644
--- a/engines/illusions/illusions.cpp
+++ b/engines/illusions/illusions.cpp
@@ -86,7 +86,7 @@ Common::Error IllusionsEngine::run() {
_resSys->addResourceLoader(0x00100000, new ActorResourceLoader(this));
_resSys->addResourceLoader(0x00110000, new BackgroundResourceLoader(this));
- _screen = new Screen(this);
+ _screen = new Screen(this);
_input = new Input();
_scriptMan = new ScriptMan(this);
_actorItems = new ActorItems(this);
@@ -196,4 +196,44 @@ ActorType *IllusionsEngine::findActorType(uint32 actorTypeId) {
return 0;
}
+Sequence *IllusionsEngine::findSequence(uint32 sequenceId) {
+ // TODO Dummy, to be replaced later
+ return 0;
+}
+
+void IllusionsEngine::notifyThreadId(uint32 &threadId) {
+ if (threadId) {
+ uint32 tempThreadId = threadId;
+ threadId = 0;
+ _scriptMan->_threads->notifyId(tempThreadId);
+ }
+}
+
+FramesList *IllusionsEngine::findSequenceFrames(Sequence *sequence) {
+ // TODO Dummy, to be replaced later
+ return 0;
+}
+
+void IllusionsEngine::setCursorControl(Control *control) {
+ // TODO Dummy, to be replaced later
+}
+
+void IllusionsEngine::placeCursor(Control *control, uint32 sequenceId) {
+ // TODO Dummy, to be replaced later
+}
+
+bool IllusionsEngine::showCursor() {
+ // TODO Dummy, to be replaced later
+ // TODO ++cursor._visibleCtr;
+ // TODO if (cursor._visibleCtr > 0)
+ return false;
+}
+
+bool IllusionsEngine::hideCursor() {
+ // TODO Dummy, to be replaced later
+ // TODO --cursor._visibleCtr;
+ // TODO if (cursor.visibleCtr <= 0)
+ return false;
+}
+
} // End of namespace Illusions
diff --git a/engines/illusions/illusions.h b/engines/illusions/illusions.h
index efae32154f..3e19ecc75b 100644
--- a/engines/illusions/illusions.h
+++ b/engines/illusions/illusions.h
@@ -60,6 +60,8 @@ class Input;
class Screen;
class ScriptResource;
class ScriptMan;
+class Sequence;
+class FramesList;
class IllusionsEngine : public Engine {
protected:
@@ -89,6 +91,15 @@ public:
Common::Point *getObjectActorPositionPtr(uint32 objectId);
Control *findControl(uint32 objectId);
ActorType *findActorType(uint32 actorTypeId);
+ Sequence *findSequence(uint32 sequenceId);
+ FramesList *findSequenceFrames(Sequence *sequence);
+
+ void notifyThreadId(uint32 &threadId);
+
+ void setCursorControl(Control *control);
+ void placeCursor(Control *control, uint32 sequenceId);
+ bool showCursor();
+ bool hideCursor();
#if 0