diff options
author | johndoe123 | 2014-03-12 13:14:22 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2018-07-20 06:43:33 +0000 |
commit | 08e8f39945c6c89ffc4fa20d6fe50ca39183b00d (patch) | |
tree | dc50d468e8745764aabf1517a2b3cfc7b307f51d /engines/illusions/camera.h | |
parent | 21e1b08b8399bad5a8b88cf6e30b2db9edd0ad60 (diff) | |
download | scummvm-rg350-08e8f39945c6c89ffc4fa20d6fe50ca39183b00d.tar.gz scummvm-rg350-08e8f39945c6c89ffc4fa20d6fe50ca39183b00d.tar.bz2 scummvm-rg350-08e8f39945c6c89ffc4fa20d6fe50ca39183b00d.zip |
ILLUSIONS: More work on the Camera class
- Add fixed point code (untested and probably wrong)
Diffstat (limited to 'engines/illusions/camera.h')
-rw-r--r-- | engines/illusions/camera.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/engines/illusions/camera.h b/engines/illusions/camera.h index 816c5dda21..6c9556c88d 100644 --- a/engines/illusions/camera.h +++ b/engines/illusions/camera.h @@ -46,20 +46,36 @@ struct CameraState { Common::Point _currPan2; Common::Point _panTargetPoint; Common::Point _trackingLimits; - Common::Point _pt; + Common::Point _centerPt; uint32 _panObjectId; Common::Point *_panToPositionPtr; uint _pointFlags; //field_4A dw }; +struct CameraModeStackItem { + int _cameraMode; + uint32 _panObjectId; + int16 _panSpeed; + Common::Point _panTargetPoint; + uint32 _panNotifyId; +}; + class Camera { public: Camera(IllusionsEngine *vm); void clearStack(); void set(Common::Point &panPoint, WidthHeight &dimensions); + void panCenterObject(uint32 objectId, int16 panSpeed); + void panTrackObject(uint32 objectId); + void panToPoint(Common::Point pt, int16 panSpeed, uint32 panNotifyId); + void panEdgeFollow(uint32 objectId, int16 panSpeed); + void stopPan(); void pause(); void unpause(); + void pushCameraMode(); + void popCameraMode(); + void clearCameraModeStack(); void update(uint32 currTime); void setBounds(Common::Point &minPt, Common::Point &maxPt); void setBoundsToDimensions(WidthHeight &dimensions); @@ -68,13 +84,16 @@ public: protected: IllusionsEngine *_vm; CameraState _activeState; - Common::FixedStack<CameraState, 8> _stack; + Common::FixedStack<CameraModeStackItem, 8> _stack; void updateMode1(uint32 currTime); void updateMode2(uint32 currTime); void updateMode3(uint32 currTime); bool updatePan(uint32 currTime); bool isPanFinished(); Common::Point getPtOffset(Common::Point pt); + void recalcPan(uint32 currTime); + bool calcPointFlags(Common::Point &pt, WRect &rect, uint &outFlags); + void clipPanTargetPoint(); }; } // End of namespace Illusions |