[Scummvm-git-logs] scummvm master -> d7509e6df67e4a84a5f4e74b9f952a2d35122e41

elasota noreply at scummvm.org
Sat May 27 23:16:54 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:
d4702c8c5a VCRUISE: Fix allowedSave opcode (actual behavior is that it permits saves on screens with no rotation animation)
e6d86501c4 VCRUISE: Fix static animations playing at the wrong framerate
d7509e6df6 VCRUISE: Add comment confirming that the existing behavior for handling duplicated functions correct


Commit: d4702c8c5ae6761b899b32a1cc853fef3fbb2ba4
    https://github.com/scummvm/scummvm/commit/d4702c8c5ae6761b899b32a1cc853fef3fbb2ba4
Author: elasota (ejlasota at gmail.com)
Date: 2023-05-27T18:41:05-04:00

Commit Message:
VCRUISE: Fix allowedSave opcode (actual behavior is that it permits saves on screens with no rotation animation)

Changed paths:
    engines/vcruise/runtime.cpp
    engines/vcruise/runtime.h
    engines/vcruise/runtime_scriptexec.cpp
    engines/vcruise/script.cpp
    engines/vcruise/script.h


diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index 542a7bc22fd..5871af8666a 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -1037,6 +1037,7 @@ Runtime::Runtime(OSystem *system, Audio::Mixer *mixer, const Common::FSNode &roo
 	  _animTerminateAtStartOfFrame(true), _animPendingDecodeFrame(0), _animDisplayingFrame(0), _animFirstFrame(0), _animLastFrame(0), _animStopFrame(0), _animVolume(getDefaultSoundVolume()),
 	  _animStartTime(0), _animFramesDecoded(0), _animDecoderState(kAnimDecoderStateStopped),
 	  _animPlayWhileIdle(false), _idleLockInteractions(false), _idleIsOnInteraction(false), _idleIsOnOpenCircuitPuzzleLink(false), _idleIsCircuitPuzzleLinkDown(false),
+	  _forceAllowSaves(false),
 	  _idleHaveClickInteraction(false), _idleHaveDragInteraction(false), _idleInteractionID(0), _haveIdleStaticAnimation(false),
 	  _inGameMenuState(kInGameMenuStateInvisible), _inGameMenuActiveElement(0), _inGameMenuButtonActive {false, false, false, false, false},
 	  _lmbDown(false), _lmbDragging(false), _lmbReleaseWasClick(false), _lmbDownTime(0), _lmbDragTolerance(0),
@@ -2844,6 +2845,7 @@ void Runtime::changeToScreen(uint roomNumber, uint screenNumber) {
 		_haveIdleStaticAnimation = false;
 		_idleCurrentStaticAnimation.clear();
 		_havePendingPlayAmbientSounds = true;
+		_forceAllowSaves = false;
 
 		recordSaveGameSnapshot();
 	}
@@ -4518,7 +4520,7 @@ void Runtime::drawCompass() {
 	}
 
 	// Try to keep this logic in sync with canSave(true)
-	haveLocation = haveHorizontalRotate;
+	haveLocation = (haveHorizontalRotate || _forceAllowSaves);
 	//haveLocation = haveLocation || haveUp || haveDown;
 
 	const Common::Rect blackoutRects[4] = {
@@ -5181,7 +5183,7 @@ void Runtime::onKeymappedEvent(KeymappedEvent kme) {
 
 bool Runtime::canSave(bool onCurrentScreen) const {
 	if (onCurrentScreen) {
-		return (_mostRecentlyRecordedSaveState.get() != nullptr && _haveHorizPanAnimations);
+		return (_mostRecentlyRecordedSaveState.get() != nullptr && (_haveHorizPanAnimations || _forceAllowSaves));
 	} else {
 		return _mostRecentValidSaveState.get() != nullptr && _isInGame;
 	}
diff --git a/engines/vcruise/runtime.h b/engines/vcruise/runtime.h
index 478bb62a3c5..302e8cb9960 100644
--- a/engines/vcruise/runtime.h
+++ b/engines/vcruise/runtime.h
@@ -1022,7 +1022,7 @@ private:
 	void scriptOpSaveAs(ScriptArg_t arg);
 	void scriptOpSave0(ScriptArg_t arg);
 	void scriptOpExit(ScriptArg_t arg);
-	void scriptOpBlockSaves(ScriptArg_t arg);
+	void scriptOpAllowSaves(ScriptArg_t arg);
 
 	void scriptOpAnimName(ScriptArg_t arg);
 	void scriptOpValueName(ScriptArg_t arg);
@@ -1253,6 +1253,8 @@ private:
 	bool _idleIsCircuitPuzzleLinkDown;
 	Common::Point _idleCircuitPuzzleCoord;
 
+	bool _forceAllowSaves;
+
 	InGameMenuState _inGameMenuState;
 	uint _inGameMenuActiveElement;
 	bool _inGameMenuButtonActive[5];
diff --git a/engines/vcruise/runtime_scriptexec.cpp b/engines/vcruise/runtime_scriptexec.cpp
index 8a3626215dc..c000f6f2283 100644
--- a/engines/vcruise/runtime_scriptexec.cpp
+++ b/engines/vcruise/runtime_scriptexec.cpp
@@ -1361,8 +1361,8 @@ void Runtime::scriptOpBackStart(ScriptArg_t arg) {
 	_scriptEnv.exitToMenu = true;
 }
 
-void Runtime::scriptOpBlockSaves(ScriptArg_t arg) {
-	warning("SAVES SHOULD BE BLOCKED ON THIS SCREEN");
+void Runtime::scriptOpAllowSaves(ScriptArg_t arg) {
+	_forceAllowSaves = true;
 }
 
 void Runtime::scriptOpAnimName(ScriptArg_t arg) {
@@ -2184,7 +2184,7 @@ bool Runtime::runScript() {
 			DISPATCH_OP(SaveAs);
 			DISPATCH_OP(Save0);
 			DISPATCH_OP(Exit);
-			DISPATCH_OP(BlockSaves);
+			DISPATCH_OP(AllowSaves);
 
 			DISPATCH_OP(AnimName);
 			DISPATCH_OP(ValueName);
diff --git a/engines/vcruise/script.cpp b/engines/vcruise/script.cpp
index 3d19e9b22db..e2141662544 100644
--- a/engines/vcruise/script.cpp
+++ b/engines/vcruise/script.cpp
@@ -683,7 +683,7 @@ static ScriptNamedInstruction g_reahNamedInstructions[] = {
 	{"saveAs", ProtoOp::kProtoOpScript, ScriptOps::kSaveAs},
 	{"save0", ProtoOp::kProtoOpNoop, ScriptOps::kSave0},
 	{"exit", ProtoOp::kProtoOpScript, ScriptOps::kExit},
-	{"allowedSave", ProtoOp::kProtoOpScript, ScriptOps::kBlockSaves},
+	{"allowedSave", ProtoOp::kProtoOpScript, ScriptOps::kAllowSaves},
 };
 
 
@@ -811,7 +811,7 @@ static ScriptNamedInstruction g_schizmNamedInstructions[] = {
 	{"ret", ProtoOp::kProtoOpScript, ScriptOps::kReturn},
 
 	{"backStart", ProtoOp::kProtoOpScript, ScriptOps::kBackStart},
-	{"allowedSave", ProtoOp::kProtoOpScript, ScriptOps::kBlockSaves},
+	{"allowedSave", ProtoOp::kProtoOpScript, ScriptOps::kAllowSaves},
 };
 
 bool ScriptCompiler::compileInstructionToken(ProtoScript &script, const Common::String &token) {
diff --git a/engines/vcruise/script.h b/engines/vcruise/script.h
index 04cc87bcc75..6d4bc2492ca 100644
--- a/engines/vcruise/script.h
+++ b/engines/vcruise/script.h
@@ -146,7 +146,7 @@ enum ScriptOp {
 	kSaveAs,
 	kSave0,
 	kExit,
-	kBlockSaves,
+	kAllowSaves,
 
 	kAnimName,
 	kValueName,


Commit: e6d86501c4800fafabf73316432684364275254e
    https://github.com/scummvm/scummvm/commit/e6d86501c4800fafabf73316432684364275254e
Author: elasota (ejlasota at gmail.com)
Date: 2023-05-27T18:41:49-04:00

Commit Message:
VCRUISE: Fix static animations playing at the wrong framerate

Changed paths:
    engines/vcruise/runtime.cpp


diff --git a/engines/vcruise/runtime.cpp b/engines/vcruise/runtime.cpp
index 5871af8666a..427fffaea47 100644
--- a/engines/vcruise/runtime.cpp
+++ b/engines/vcruise/runtime.cpp
@@ -2909,7 +2909,7 @@ bool Runtime::triggerPreIdleActions() {
 		sanim.nextStartTime = timestamp + sanim.params.initialDelay * 1000u;
 
 		if (sanim.params.initialDelay == 0) {
-			changeAnimation(sanim.animDefs[0], false);
+			changeAnimation(sanim.animDefs[0], sanim.animDefs[0].firstFrame, false, _animSpeedStaticAnim);
 			_animPlayWhileIdle = true;
 			sanim.currentAlternation = 1;
 		}


Commit: d7509e6df67e4a84a5f4e74b9f952a2d35122e41
    https://github.com/scummvm/scummvm/commit/d7509e6df67e4a84a5f4e74b9f952a2d35122e41
Author: elasota (ejlasota at gmail.com)
Date: 2023-05-27T19:16:40-04:00

Commit Message:
VCRUISE: Add comment confirming that the existing behavior for handling duplicated functions correct

Changed paths:
    engines/vcruise/script.cpp


diff --git a/engines/vcruise/script.cpp b/engines/vcruise/script.cpp
index e2141662544..389341d6c41 100644
--- a/engines/vcruise/script.cpp
+++ b/engines/vcruise/script.cpp
@@ -460,7 +460,9 @@ void ScriptCompiler::compileRoomScriptSet(RoomScriptSet *rss) {
 
 			if (_gs->getFunction(fnIndex)) {
 				// This triggers on fnSoundFountain_Start and fnSoundFountain_Stop in Room30.
-				// fnSoundFountain_Start is called in Room31, so might not matter there?  But fnSoundFountain_Stop is called in Room30.
+				// fnSoundFountain_Start is called in Room31, so that doesn't collide, but
+				// fnSoundFountain_Stop is called in Room30.  Based on testing, the correct
+				// behavior is to call the Room30 version, so we do want to override here.
 				warning("Function '%s' was defined multiple times", fnName.c_str());
 			}
 




More information about the Scummvm-git-logs mailing list