aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2012-02-29 21:22:08 +1100
committerPaul Gilbert2012-02-29 21:22:08 +1100
commitb60a2f012a92729591ab4e3221a980d98a5ceaf0 (patch)
tree240fc4adc71d7bc46519ff2241d89eb11a65e760 /engines
parenta20de36b268e5e91904052d4858bad445145b765 (diff)
downloadscummvm-rg350-b60a2f012a92729591ab4e3221a980d98a5ceaf0.tar.gz
scummvm-rg350-b60a2f012a92729591ab4e3221a980d98a5ceaf0.tar.bz2
scummvm-rg350-b60a2f012a92729591ab4e3221a980d98a5ceaf0.zip
TSAGE: Slow down the animation player to match the original game
Diffstat (limited to 'engines')
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.cpp15
-rw-r--r--engines/tsage/ringworld2/ringworld2_logic.h2
2 files changed, 10 insertions, 7 deletions
diff --git a/engines/tsage/ringworld2/ringworld2_logic.cpp b/engines/tsage/ringworld2/ringworld2_logic.cpp
index 582458afed..fb5f4a0eab 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.cpp
+++ b/engines/tsage/ringworld2/ringworld2_logic.cpp
@@ -1657,14 +1657,14 @@ void AnimationPlayer::process(Event &event) {
void AnimationPlayer::dispatch() {
uint32 gameFrame = R2_GLOBALS._events.getFrameNumber();
- uint32 gameDiff = (gameFrame > _gameFrame) ? gameFrame - _gameFrame : _gameFrame - gameFrame;
+ uint32 gameDiff = gameFrame - _gameFrame;
if (gameDiff >= _frameDelay) {
drawFrame(_playbackTick % _subData._framesPerSlices);
++_playbackTick;
_position = _playbackTick / _subData._framesPerSlices;
- if (_position == _ticksPerSlices)
+ if (_position == _nextSlicesPosition)
nextSlices();
_playbackTickPrior = _playbackTick;
@@ -1694,8 +1694,11 @@ bool AnimationPlayer::load(int animId, Action *endAction) {
// Set other properties
_playbackTickPrior = -1;
_playbackTick = 0;
- _frameDelay = 60 / _subData._frameRate;
- _gameFrame = R2_GLOBALS._events.getFrameNumber() - _frameDelay;
+
+ // The final multiplication is used to deliberately slow down playback, since the original
+ // was slowed down by the amount of time spent to decode and display the frames
+ _frameDelay = (60 / _subData._frameRate) * 8;
+ _gameFrame = R2_GLOBALS._events.getFrameNumber();
if (_subData._totalSize) {
_dataNeeded = _subData._totalSize;
@@ -1719,7 +1722,7 @@ bool AnimationPlayer::load(int animId, Action *endAction) {
}
_position = 0;
- _ticksPerSlices = 1;
+ _nextSlicesPosition = 1;
// Load up the first slices set
_sliceCurrent->_dataSize = _subData._slices._dataSize;
@@ -1868,7 +1871,7 @@ void AnimationPlayer::drawFrame(int sliceIndex) {
* Read the next frame's slice set
*/
void AnimationPlayer::nextSlices() {
- _position = _ticksPerSlices++;
+ _position = _nextSlicesPosition++;
_playbackTick = _position * _subData._framesPerSlices;
_playbackTickPrior = _playbackTick - 1;
diff --git a/engines/tsage/ringworld2/ringworld2_logic.h b/engines/tsage/ringworld2/ringworld2_logic.h
index 3d2ffd9f78..b63c0ac2a7 100644
--- a/engines/tsage/ringworld2/ringworld2_logic.h
+++ b/engines/tsage/ringworld2/ringworld2_logic.h
@@ -400,7 +400,7 @@ public:
int _playbackTick;
int _playbackTickPrior;
int _position;
- int _ticksPerSlices;
+ int _nextSlicesPosition;
uint _frameDelay;
uint32 _gameFrame;
public: