SCI32: Adjust transition timings

Transition timings were originally chosen largely by feel in SQ6,
as there was little other evidence to determine the correct speed.
As additional games started being playable in ScummVM, it became
apparent that these speeds were not quite right.

Additional adjustments may be needed in the future, but these new
timings seem to be somewhat closer to expectations than before.
This commit is contained in:
Colin Snover 2016-12-12 15:13:36 -06:00
parent 8477e61ad0
commit 4b4b8a281b
3 changed files with 19 additions and 20 deletions

View File

@ -4601,7 +4601,7 @@ static const uint16 sq6SlowTransitionSignature1[] = {
};
static const uint16 sq6SlowTransitionPatch1[] = {
0x38, SIG_UINT16(180), // pushi 180
0x38, SIG_UINT16(500), // pushi 500
PATCH_END
};

View File

@ -41,8 +41,7 @@ static int16 divisionsDefaults[2][16] = {
};
GfxTransitions32::GfxTransitions32(SegManager *segMan) :
_segMan(segMan),
_throttleState(0) {
_segMan(segMan) {
for (int i = 0; i < 236; i += 2) {
_styleRanges[i] = 0;
_styleRanges[i + 1] = -1;
@ -67,17 +66,8 @@ GfxTransitions32::~GfxTransitions32() {
_scrolls.clear();
}
void GfxTransitions32::throttle() {
uint8 throttleTime;
if (_throttleState == 2) {
throttleTime = 34;
_throttleState = 0;
} else {
throttleTime = 33;
++_throttleState;
}
g_sci->getEngineState()->speedThrottler(throttleTime);
void GfxTransitions32::throttle(const uint32 ms) {
g_sci->getEngineState()->speedThrottler(ms);
g_sci->getEngineState()->_throttleTrigger = true;
}
@ -936,7 +926,7 @@ void GfxTransitions32::processScrolls() {
}
}
throttle();
throttle(33);
}
void GfxTransitions32::kernelSetScroll(const reg_t planeId, const int16 deltaX, const int16 deltaY, const GuiResourceId pictureId, const bool animate, const bool mirrorX) {
@ -1005,7 +995,7 @@ void GfxTransitions32::kernelSetScroll(const reg_t planeId, const int16 deltaX,
while (!finished && !g_engine->shouldQuit()) {
finished = processScroll(*scroll);
g_sci->_gfxFrameout->frameOut(true);
throttle();
throttle(33);
}
}

View File

@ -239,11 +239,20 @@ private:
SegManager *_segMan;
/**
* Throttles transition playback to prevent transitions from being instant
* on fast computers.
* Throttles transition playback to prevent transitions from being
* instantaneous on modern computers.
*
* kSetShowStyle transitions are throttled at 10ms intervals, under the
* assumption that the default fade transition of 101 divisions was designed
* to finish in one second. Empirically, this seems to roughly match the
* speed of DOSBox, and feels reasonable.
*
* Transitions using kSetScroll (used in the LSL6hires intro) need to be
* slower, so they get throttled at 33ms instead of 10ms. This value was
* chosen by gut feel, as these scrolling transitions are instantaneous in
* DOSBox.
*/
void throttle();
int8 _throttleState;
void throttle(const uint32 ms = 10);
void clearShowRects();
void addShowRect(const Common::Rect &rect);