aboutsummaryrefslogtreecommitdiff
path: root/engines/cryomni3d
diff options
context:
space:
mode:
authorLe Philousophe2019-03-09 00:35:41 +0100
committerEugene Sandulenko2019-06-01 22:43:48 +0200
commit92a306e56ea52e8601f71ce966e7851ae80f5157 (patch)
tree8c3d2820aa6c1af4bb6b02d7be6045b94ba42730 /engines/cryomni3d
parentf50d89841d324c66a0ba01d41564b54921ea1840 (diff)
downloadscummvm-rg350-92a306e56ea52e8601f71ce966e7851ae80f5157.tar.gz
scummvm-rg350-92a306e56ea52e8601f71ce966e7851ae80f5157.tar.bz2
scummvm-rg350-92a306e56ea52e8601f71ce966e7851ae80f5157.zip
CRYOMNI3D: Remove long delayMillis as they lower the framerate
Diffstat (limited to 'engines/cryomni3d')
-rw-r--r--engines/cryomni3d/cryomni3d.cpp14
-rw-r--r--engines/cryomni3d/versailles/engine.cpp18
2 files changed, 18 insertions, 14 deletions
diff --git a/engines/cryomni3d/cryomni3d.cpp b/engines/cryomni3d/cryomni3d.cpp
index 49347a2cd9..e663e5d995 100644
--- a/engines/cryomni3d/cryomni3d.cpp
+++ b/engines/cryomni3d/cryomni3d.cpp
@@ -366,8 +366,11 @@ void CryOmni3DEngine::fadeOutPalette() {
palOut[i] = palWork[i] >> 8;
}
setPalette(palOut, 0, 256);
- g_system->updateScreen();
- g_system->delayMillis(50);
+ // Wait 50ms between each steps but refresh screen every 10ms
+ for(unsigned int i = 0; i < 5; i++) {
+ g_system->updateScreen();
+ g_system->delayMillis(10);
+ }
}
setBlackPalette();
}
@@ -390,8 +393,11 @@ void CryOmni3DEngine::fadeInPalette(const byte *palette) {
palOut[i] = palWork[i] >> 8;
}
setPalette(palOut, 0, 256);
- g_system->updateScreen();
- g_system->delayMillis(50);
+ // Wait 50ms between each steps but refresh screen every 10ms
+ for(unsigned int i = 0; i < 5; i++) {
+ g_system->updateScreen();
+ g_system->delayMillis(10);
+ }
}
setPalette(palette, 0, 256);
g_system->updateScreen();
diff --git a/engines/cryomni3d/versailles/engine.cpp b/engines/cryomni3d/versailles/engine.cpp
index 912425a74a..3192aa6182 100644
--- a/engines/cryomni3d/versailles/engine.cpp
+++ b/engines/cryomni3d/versailles/engine.cpp
@@ -1099,6 +1099,9 @@ int CryOmni3DEngine_Versailles::handleWarp() {
xDelta >>= -_omni3dSpeed;
yDelta >>= -_omni3dSpeed;
}
+ // This correction factor is to slow down movements for modern CPUs
+ xDelta /= 5;
+ yDelta /= 5;
leftButtonPressed = (getCurrentMouseButton() == 1);
Common::Point mouseRev = _omni3dMan.mapMouseCoords(mouse);
@@ -1149,9 +1152,6 @@ int CryOmni3DEngine_Versailles::handleWarp() {
g_system->updateScreen();
}
}
- if (!exit && !leftButtonPressed) {
- g_system->delayMillis(50);
- }
}
g_system->showMouse(false);
return actionId;
@@ -1225,15 +1225,17 @@ void CryOmni3DEngine_Versailles::animateWarpTransition(const Transition *transit
} else if (deltaAlpha < 0) {
deltaAlpha += 2.*M_PI;
}
+
+ // We devide by 5 to slow down movement for modern CPUs
int deltaAlphaI;
if (deltaAlpha < M_PI) {
- deltaAlphaI = -(deltaAlpha * 512.);
+ deltaAlphaI = -(deltaAlpha * 512. / 5.);
} else {
- deltaAlphaI = (2.*M_PI - deltaAlpha) * 512.;
+ deltaAlphaI = (2.*M_PI - deltaAlpha) * 512. / 5.;
}
double deltaBeta = -srcBeta - _omni3dMan.getBeta();
- int deltaBetaI = -(deltaBeta * 512.);
+ int deltaBetaI = -(deltaBeta * 512. / 5.);
if (_omni3dSpeed > 0) {
deltaAlphaI <<= 2;
@@ -1259,10 +1261,6 @@ void CryOmni3DEngine_Versailles::animateWarpTransition(const Transition *transit
if (pollEvents() && checkKeysPressed(2, Common::KEYCODE_ESCAPE, Common::KEYCODE_SPACE)) {
exit = true;
}
-
- if (!exit) {
- g_system->delayMillis(50);
- }
}
}