[Scummvm-git-logs] scummvm master -> d9a96d7412a585e73a45c5132d4f2da716eff093
fracturehill
noreply at scummvm.org
Sun Jan 14 21:30:46 UTC 2024
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
f3bf65b234 NANCY: Fix nancy7 special effect timings
1f5a3c64cc NANCY: Fix fades in nancy7 dog scare sequence
d9a96d7412 NANCY: Make function const
Commit: f3bf65b234da6fdf13e8835c746787758e1807e5
https://github.com/scummvm/scummvm/commit/f3bf65b234da6fdf13e8835c746787758e1807e5
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2024-01-14T22:30:00+01:00
Commit Message:
NANCY: Fix nancy7 special effect timings
The timing code in nancy7's special effects is broken, and
produces highly variable results based on the machine it
runs on. Our code fixes that issue, but as a result effects
often run much slower than they were intended to. This
commit shortens effect timings by half, approximating
what the original devs most likely intended for the
effects to actually look like.
Changed paths:
engines/nancy/misc/specialeffect.cpp
diff --git a/engines/nancy/misc/specialeffect.cpp b/engines/nancy/misc/specialeffect.cpp
index 248106bb498..d8a4cc90ddf 100644
--- a/engines/nancy/misc/specialeffect.cpp
+++ b/engines/nancy/misc/specialeffect.cpp
@@ -75,6 +75,19 @@ void SpecialEffect::updateGraphics() {
// nancy7+ version, draws as many frames as possible, ease in/out interpolation
if (_startTime == 0) {
_startTime = g_nancy->getTotalPlayTime();
+
+ // The original code times how long the first frame takes to draw,
+ // divides the total time by that time, and uses the result to
+ // decide how many frames need to be drawn. This results in highly
+ // variable timing depending on the machine the game is played on.
+ // On modern PCs, it even results in a divide by 0 that effectively
+ // stops the special effect from playing. Using the original _totalTime
+ // value results in the effect taking much longer than the developers
+ // intended (as made obvious in the dog scare sequence in the beginning
+ // of nancy7), so we manually shorten the timings to better match what
+ // the developers would've seen when on their machines.
+ _totalTime /= 2;
+ _fadeToBlackTime /= 2;
}
if (g_nancy->getTotalPlayTime() > _startTime + _totalTime) {
Commit: 1f5a3c64cc89fca3e0d13afd24056756e65a2ff2
https://github.com/scummvm/scummvm/commit/1f5a3c64cc89fca3e0d13afd24056756e65a2ff2
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2024-01-14T22:30:00+01:00
Commit Message:
NANCY: Fix fades in nancy7 dog scare sequence
Some fades to black were not being shown correctly,
since from nancy7 on ActionRecords seem to start executing
only after SpecialEffects were done animating.
Changed paths:
engines/nancy/misc/specialeffect.cpp
engines/nancy/misc/specialeffect.h
engines/nancy/state/scene.cpp
engines/nancy/state/scene.h
diff --git a/engines/nancy/misc/specialeffect.cpp b/engines/nancy/misc/specialeffect.cpp
index d8a4cc90ddf..d580e3a5c4f 100644
--- a/engines/nancy/misc/specialeffect.cpp
+++ b/engines/nancy/misc/specialeffect.cpp
@@ -123,6 +123,7 @@ void SpecialEffect::updateGraphics() {
void SpecialEffect::onSceneChange() {
g_nancy->_graphicsManager->screenshotScreen(_fadeFrom);
_drawSurface.rawBlitFrom(_fadeFrom, _rect, Common::Point());
+ _halfInitialized = true;
}
void SpecialEffect::afterSceneChange() {
diff --git a/engines/nancy/misc/specialeffect.h b/engines/nancy/misc/specialeffect.h
index 75ba696ee60..c721eccbb6b 100644
--- a/engines/nancy/misc/specialeffect.h
+++ b/engines/nancy/misc/specialeffect.h
@@ -58,9 +58,11 @@ public:
void afterSceneChange();
bool isDone() const;
+ bool isHalfInitialized() const { return _halfInitialized; }
bool isInitialized() const { return _initialized; }
protected:
+ bool _halfInitialized = false;
bool _initialized = false;
uint32 _nextFrameTime = 0;
diff --git a/engines/nancy/state/scene.cpp b/engines/nancy/state/scene.cpp
index aac21165c93..a4e65cb8e69 100644
--- a/engines/nancy/state/scene.cpp
+++ b/engines/nancy/state/scene.cpp
@@ -227,6 +227,10 @@ bool Scene::onStateExit(const NancyState::NancyState nextState) {
return _destroyOnExit;
}
+bool Scene::isRunningSpecialEffect() const {
+ return _specialEffects.size() && _specialEffects.front().isHalfInitialized() && !_specialEffects.front().isDone();
+}
+
void Scene::changeScene(const SceneChangeDescription &sceneDescription) {
if (sceneDescription.sceneID == kNoScene || _state == kLoad) {
return;
@@ -982,13 +986,20 @@ void Scene::run() {
return;
}
- _actionManager.processActionRecords();
+ // Run action records. From nancy7 onward want to skip this if we're in the
+ // middle of a special effect. This way, the nancy7 dog scare sequence
+ // (scene 2090 and onwards) gets the fades to black present in the original.
+ // We don't do the same for earlier games, since we _want_ records to execute
+ // there; an example is the text in the nancy3 intro.
+ // Note: if this causes any issues, move the check inside SecondaryMovie.
+ if (!isRunningSpecialEffect() || g_nancy->getGameType() <= kGameTypeNancy6) {
+ _actionManager.processActionRecords();
+ }
if (_lightning) {
_lightning->run();
}
- // Do this after the first records are processed to fix the text in nancy3 intro
if (_specialEffects.size()) {
if (_specialEffects.front().isInitialized()) {
if (_specialEffects.front().isDone()) {
diff --git a/engines/nancy/state/scene.h b/engines/nancy/state/scene.h
index 4e63e28d678..f9865bfb42c 100644
--- a/engines/nancy/state/scene.h
+++ b/engines/nancy/state/scene.h
@@ -115,6 +115,7 @@ public:
void setDestroyOnExit() { _destroyOnExit = true; }
bool isRunningAd() { return _isRunningAd; }
+ bool isRunningSpecialEffect() const;
void changeScene(const SceneChangeDescription &sceneDescription);
void pushScene(int16 itemID = -1);
Commit: d9a96d7412a585e73a45c5132d4f2da716eff093
https://github.com/scummvm/scummvm/commit/d9a96d7412a585e73a45c5132d4f2da716eff093
Author: Kaloyan Chehlarski (strahy at outlook.com)
Date: 2024-01-14T22:30:01+01:00
Commit Message:
NANCY: Make function const
Changed paths:
engines/nancy/state/scene.h
diff --git a/engines/nancy/state/scene.h b/engines/nancy/state/scene.h
index f9865bfb42c..89f40a6a06a 100644
--- a/engines/nancy/state/scene.h
+++ b/engines/nancy/state/scene.h
@@ -114,7 +114,7 @@ public:
// Used when winning/losing game
void setDestroyOnExit() { _destroyOnExit = true; }
- bool isRunningAd() { return _isRunningAd; }
+ bool isRunningAd() const { return _isRunningAd; }
bool isRunningSpecialEffect() const;
void changeScene(const SceneChangeDescription &sceneDescription);
More information about the Scummvm-git-logs
mailing list