[Scummvm-git-logs] scummvm master -> aea5b9568b789b3ed2d0ee6e38ef25b48a2364de
elasota
noreply at scummvm.org
Fri May 12 03:44:20 UTC 2023
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:
6b21cbbd52 VCRUISE: Fix English Digital description
daf5d7951a VCRUISE: Fix tray sometimes not hiding when subtitles are disabled.
aea5b9568b VCRUISE: Allow idle animations to play during delays in Schizm. Change framerate lock with fast animation mode to 25fps
Commit: 6b21cbbd527b2559efa6517552df8e2cf0984eba
https://github.com/scummvm/scummvm/commit/6b21cbbd527b2559efa6517552df8e2cf0984eba
Author: elasota (ejlasota at gmail.com)
Date: 2023-05-11T23:43:53-04:00
Commit Message:
VCRUISE: Fix English Digital description
Changed paths:
engines/vcruise/detection_tables.h
diff --git a/engines/vcruise/detection_tables.h b/engines/vcruise/detection_tables.h
index c49c9990139..dd59b31aa8c 100644
--- a/engines/vcruise/detection_tables.h
+++ b/engines/vcruise/detection_tables.h
@@ -46,7 +46,7 @@ static const VCruiseGameDescription gameDescriptions[] = {
{ // Reah: Face the Unknown, English digital (GOG) version
{
"reah",
- "English Digital + German Community Patch",
+ "English Digital",
AD_ENTRY2s("Reah.exe", "60ec19c53f1323cc7f0314f98d396283", 304128,
"0170_b.wav", "5b705300b4fee3ceb821a1b55884a722", 129248),
Common::UNK_LANG,
Commit: daf5d7951a2f87afd4dafa2afd5ce35b3aa9e59c
https://github.com/scummvm/scummvm/commit/daf5d7951a2f87afd4dafa2afd5ce35b3aa9e59c
Author: elasota (ejlasota at gmail.com)
Date: 2023-05-11T23:43:53-04:00
Commit Message:
VCRUISE: Fix tray sometimes not hiding when subtitles are disabled.
Changed paths:
engines/vcruise/runtime.cpp
diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index dd31a79783c..754a2b7b6a9 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -4031,7 +4031,11 @@ void Runtime::redrawTray() {
void Runtime::clearTray() {
uint32 blackColor = _traySection.surf->format.RGBToColor(0, 0, 0);
- _traySection.surf->fillRect(Common::Rect(0, 0, _traySection.surf->w, _traySection.surf->h), blackColor);
+ Common::Rect trayRect(0, 0, _traySection.surf->w, _traySection.surf->h);
+
+ _traySection.surf->fillRect(trayRect, blackColor);
+
+ this->commitSectionToScreen(_traySection, trayRect);
}
void Runtime::drawInventory(uint slot) {
Commit: aea5b9568b789b3ed2d0ee6e38ef25b48a2364de
https://github.com/scummvm/scummvm/commit/aea5b9568b789b3ed2d0ee6e38ef25b48a2364de
Author: elasota (ejlasota at gmail.com)
Date: 2023-05-11T23:43:53-04:00
Commit Message:
VCRUISE: Allow idle animations to play during delays in Schizm. Change framerate lock with fast animation mode to 25fps flat to fix it actually being slower in the German version.
Changed paths:
engines/vcruise/runtime.cpp
engines/vcruise/runtime.h
diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index 754a2b7b6a9..6f0b8bee881 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -980,8 +980,8 @@ FontCacheItem::FontCacheItem() : font(nullptr), size(0) {
Runtime::Runtime(OSystem *system, Audio::Mixer *mixer, const Common::FSNode &rootFSNode, VCruiseGameID gameID, Common::Language defaultLanguage)
: _system(system), _mixer(mixer), _roomNumber(1), _screenNumber(0), _direction(0), _hero(0), _swapOutRoom(0), _swapOutScreen(0), _swapOutDirection(0),
_haveHorizPanAnimations(false), _loadedRoomNumber(0), _activeScreenNumber(0),
- _gameState(kGameStateBoot), _gameID(gameID), _havePendingScreenChange(false), _forceScreenChange(false), _havePendingReturnToIdleState(false), _havePendingCompletionCheck(false),
- _havePendingPlayAmbientSounds(false), _ambientSoundFinishTime(0), _escOn(false), _debugMode(false), _fastAnimationMode(false),
+ _gameState(kGameStateBoot), _gameID(gameID), _havePendingScreenChange(false), _forceScreenChange(false), _havePendingPreIdleActions(false), _havePendingReturnToIdleState(false),
+ _havePendingCompletionCheck(false), _havePendingPlayAmbientSounds(false), _ambientSoundFinishTime(0), _escOn(false), _debugMode(false), _fastAnimationMode(false),
_musicTrack(0), _musicActive(true), _scoreSectionEndTime(0), _musicVolume(getDefaultSoundVolume()), _musicVolumeRampStartTime(0), _musicVolumeRampStartVolume(0), _musicVolumeRampRatePerMSec(0), _musicVolumeRampEnd(0),
_panoramaDirectionFlags(0),
_loadedAnimation(0), _loadedAnimationHasSound(false), _animPendingDecodeFrame(0), _animDisplayingFrame(0), _animFirstFrame(0), _animLastFrame(0), _animStopFrame(0), _animVolume(getDefaultSoundVolume()),
@@ -1335,7 +1335,7 @@ bool Runtime::runIdle() {
if (_havePendingScreenChange) {
_havePendingScreenChange = false;
- _havePendingReturnToIdleState = true;
+ _havePendingPreIdleActions = true;
changeToScreen(_roomNumber, _screenNumber);
return true;
@@ -1346,6 +1346,12 @@ bool Runtime::runIdle() {
triggerAmbientSounds();
}
+ if (_havePendingPreIdleActions) {
+ _havePendingPreIdleActions = false;
+
+ triggerPreIdleActions();
+ }
+
if (_havePendingReturnToIdleState) {
_havePendingReturnToIdleState = false;
@@ -1356,6 +1362,7 @@ bool Runtime::runIdle() {
uint32 timestamp = g_system->getMillis();
+ // Try to keep this in sync with runDelay
if (_animPlayWhileIdle) {
assert(_haveIdleAnimations[_direction]);
@@ -1493,11 +1500,48 @@ bool Runtime::runIdle() {
}
bool Runtime::runDelay() {
+ uint32 timestamp = g_system->getMillis();
+
if (g_system->getMillis() >= _delayCompletionTime) {
_gameState = kGameStateScript;
return true;
}
+ if (_havePendingPreIdleActions) {
+ _havePendingPreIdleActions = false;
+
+ triggerPreIdleActions();
+ }
+
+ // Play static animations. Try to keep this in sync with runIdle
+ if (_animPlayWhileIdle) {
+ assert(_haveIdleAnimations[_direction]);
+
+ StaticAnimation &sanim = _idleAnimations[_direction];
+ bool looping = (sanim.params.repeatDelay == 0);
+
+ bool animEnded = false;
+ continuePlayingAnimation(looping, false, animEnded);
+
+ if (!looping && animEnded) {
+ _animPlayWhileIdle = false;
+ sanim.nextStartTime = timestamp + sanim.params.repeatDelay * 1000u;
+ sanim.currentAlternation = 1 - sanim.currentAlternation;
+
+ if (_idleLockInteractions)
+ _idleLockInteractions = false;
+ }
+ } else if (_haveIdleAnimations[_direction]) {
+ StaticAnimation &sanim = _idleAnimations[_direction];
+ if (sanim.nextStartTime <= timestamp) {
+ const AnimationDef &animDef = sanim.animDefs[sanim.currentAlternation];
+ changeAnimation(animDef, animDef.firstFrame, false, _animSpeedStaticAnim);
+ _animPlayWhileIdle = true;
+
+ _idleLockInteractions = sanim.params.lockInteractions;
+ }
+ }
+
return false;
}
@@ -1721,7 +1765,7 @@ bool Runtime::runGyroAnimation() {
void Runtime::exitGyroIdle() {
_gameState = kGameStateScript;
- _havePendingReturnToIdleState = true;
+ _havePendingPreIdleActions = true;
// In Reah, gyro interactions stop the script.
if (_gameID == GID_REAH)
@@ -2129,8 +2173,16 @@ void Runtime::terminateScript() {
drawCompass();
- if (_havePendingScreenChange)
+ if (_havePendingScreenChange) {
+ // TODO: Check Reah to see if this condition is okay there too.
+ // This is needed to avoid resetting static animations twice, which causes problems with,
+ // for example, the second screen on Hannah's path resetting the idle animations after
+ // the VO stops.
+ if (_gameID == GID_SCHIZM)
+ _havePendingScreenChange = false;
+
changeToScreen(_roomNumber, _screenNumber);
+ }
if (_scriptEnv.exitToMenu && _gameState == kGameStateIdle) {
changeToCursor(_cursors[kCursorArrow]);
@@ -2211,7 +2263,7 @@ void Runtime::startTerminatingHorizontalPan(bool isRight) {
_panoramaState = kPanoramaStateInactive;
// Need to return to idle after direction change
- _havePendingReturnToIdleState = true;
+ _havePendingPreIdleActions = true;
}
bool Runtime::popOSEvent(OSEvent &evt) {
@@ -2699,7 +2751,7 @@ void Runtime::changeToScreen(uint roomNumber, uint screenNumber) {
for (uint i = 0; i < kNumDirections; i++)
_haveIdleAnimations[i] = false;
- _havePendingReturnToIdleState = true;
+ _havePendingPreIdleActions = true;
_haveIdleStaticAnimation = false;
_idleCurrentStaticAnimation.clear();
_havePendingPlayAmbientSounds = true;
@@ -2708,12 +2760,15 @@ void Runtime::changeToScreen(uint roomNumber, uint screenNumber) {
}
}
-void Runtime::returnToIdleState() {
- debug(1, "Returned to idle state in room %u screen 0%x facing direction %u", _roomNumber, _screenNumber, _direction);
+void Runtime::triggerPreIdleActions() {
+ debug(1, "Triggering pre-idle actions in room %u screen 0%x facing direction %u", _roomNumber, _screenNumber, _direction);
+
+ _havePendingReturnToIdleState = true;
uint32 timestamp = g_system->getMillis();
_animPlayWhileIdle = false;
+ _idleLockInteractions = false;
if (_haveIdleAnimations[_direction]) {
StaticAnimation &sanim = _idleAnimations[_direction];
@@ -2726,8 +2781,11 @@ void Runtime::returnToIdleState() {
sanim.currentAlternation = 1;
}
}
+}
+
+void Runtime::returnToIdleState() {
+ debug(1, "Returned to idle state in room %u screen 0%x facing direction %u", _roomNumber, _screenNumber, _direction);
- _idleLockInteractions = false;
_idleIsOnInteraction = false;
_idleHaveClickInteraction = false;
_idleHaveDragInteraction = false;
@@ -3163,8 +3221,12 @@ void Runtime::changeAnimation(const AnimationDef &animDef, uint initialFrame, bo
_animFrameRateLock = Fraction(_scriptEnv.fpsOverride, 1);
_scriptEnv.fpsOverride = 0;
} else {
- if (!_fastAnimationMode && _animDecoder && !_loadedAnimationHasSound)
- _animFrameRateLock = defaultFrameRate;
+ if (_animDecoder && !_loadedAnimationHasSound) {
+ if (_fastAnimationMode)
+ _animFrameRateLock = Fraction(25, 1);
+ else
+ _animFrameRateLock = defaultFrameRate;
+ }
}
if (_animFrameRateLock.numerator) {
@@ -5229,7 +5291,7 @@ void Runtime::scriptOpStatic(ScriptArg_t arg) {
changeAnimation(animDef, animDef.lastFrame, false, _animSpeedStaticAnim);
- _havePendingReturnToIdleState = true;
+ _havePendingPreIdleActions = true;
_haveHorizPanAnimations = false;
_haveIdleStaticAnimation = true;
_idleCurrentStaticAnimation = animDef.animName;
diff --git a/engines/vcruise/runtime.h b/engines/vcruise/runtime.h
index 2313f20fb2f..eeb8f623334 100644
--- a/engines/vcruise/runtime.h
+++ b/engines/vcruise/runtime.h
@@ -786,6 +786,7 @@ private:
void resolveSoundByNameOrID(const StackValue &stackValue, bool load, StackInt_t &outSoundID, SoundInstance *&outWave);
void changeToScreen(uint roomNumber, uint screenNumber);
+ void triggerPreIdleActions();
void returnToIdleState();
void changeToCursor(const Common::SharedPtr<Graphics::WinCursorGroup> &cursor);
bool dischargeIdleMouseMove();
@@ -1099,7 +1100,18 @@ private:
uint _activeScreenNumber;
bool _havePendingScreenChange;
bool _forceScreenChange;
+
+ // returnToIdleState executes any actions that must be executed upon returning to idle state from either
+ // a panorama or the first script that executes upon reaching a screen.
+ //
+ // Unfortunately, this was done slightly prematurely since Schizm plays idle animations during pre-idle
+ // delays and Reah never needs to do that, so _havePendingPreIdleActions exists to handle those actions
+ // during pre-idle upon arriving at a screen.
+ //
+ // Pre-idle actions are executed once upon either entering Idle OR Delay state.
+ bool _havePendingPreIdleActions;
bool _havePendingReturnToIdleState;
+
bool _havePendingCompletionCheck;
GameState _gameState;
More information about the Scummvm-git-logs
mailing list