[Scummvm-git-logs] scummvm master -> 97edede1bd51c125888f9a947f36945304c96c59

npjg noreply at scummvm.org
Wed Jan 1 17:47:01 UTC 2025


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
5d83694613 MEDIASTATION: Rename the asset isPlaying member/method to isActive.
97edede1bd MEDIASTATION: Remove commented-out debug code from Timer.


Commit: 5d8369461334acd86ee8028852358a358db7b819
    https://github.com/scummvm/scummvm/commit/5d8369461334acd86ee8028852358a358db7b819
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2025-01-01T12:46:16-05:00

Commit Message:
MEDIASTATION: Rename the asset isPlaying member/method to isActive.

This more accurately reflects what it's actually trying to describe.

Changed paths:
    engines/mediastation/asset.h
    engines/mediastation/assets/movie.cpp
    engines/mediastation/assets/sprite.cpp
    engines/mediastation/assets/timer.cpp
    engines/mediastation/mediastation.cpp


diff --git a/engines/mediastation/asset.h b/engines/mediastation/asset.h
index 08b6e7a0f41..c75f1856440 100644
--- a/engines/mediastation/asset.h
+++ b/engines/mediastation/asset.h
@@ -48,8 +48,8 @@ public:
 	// Called to have the asset do any processing, like drawing new frames,
 	// handling time-based event handlers, and such. Some assets don't have any
 	// processing to do.
-	virtual bool isPlaying() const {
-		return _isPlaying;
+	virtual bool isActive() const {
+		return _isActive;
 	}
 
 	// These are not pure virtual so if an asset doesnʻt read any chunks or
@@ -65,7 +65,7 @@ public:
 
 protected:
 	AssetHeader *_header = nullptr;
-	bool _isPlaying = false;
+	bool _isActive = false;
 	uint _startTime = 0;
 	uint _lastProcessedTime = 0;
 	// TODO: Rename this to indicate the time is in milliseconds.
diff --git a/engines/mediastation/assets/movie.cpp b/engines/mediastation/assets/movie.cpp
index 8723357e07e..8a7b977f7b3 100644
--- a/engines/mediastation/assets/movie.cpp
+++ b/engines/mediastation/assets/movie.cpp
@@ -186,13 +186,13 @@ void Movie::timePlay() {
 	debugC(5, kDebugScript, "Called Movie::timePlay()");
 	// TODO: Play movies one chunk at a time, which more directly approximates
 	// the original's reading from the CD one chunk at a time.
-	if (_isPlaying) {
+	if (_isActive) {
 		error("Movie::play(): Attempted to play a movie that is already playing");
 		return;
 	}
 
 	// SET ANIMATION VARIABLES.
-	_isPlaying = true;
+	_isActive = true;
 	_startTime = g_system->getMillis();
 	_lastProcessedTime = 0;
 	g_engine->addPlayingAsset(this);
@@ -229,7 +229,7 @@ void Movie::timePlay() {
 
 void Movie::timeStop() {
 	// RESET ANIMATION VARIABLES.
-	_isPlaying = false;
+	_isActive = false;
 	_startTime = 0;
 	_lastProcessedTime = 0;
 
@@ -249,7 +249,7 @@ void Movie::process() {
 }
 
 void Movie::processTimeEventHandlers() {
-	if (!_isPlaying) {
+	if (!_isActive) {
 		warning("Movie::processTimeEventHandlers(): Attempted to process time event handlers while movie is not playing");
 		return;
 	}
@@ -278,7 +278,7 @@ bool Movie::drawNextFrame() {
 	debugC(5, kDebugGraphics, "GRAPHICS (Movie %d): Starting blitting (movie time: %d)", _header->_id, movieTime);
 	bool donePlaying = movieTime > _duration;
 	if (donePlaying) {
-		_isPlaying = false;
+		_isActive = false;
 		_startTime = 0;
 		_lastProcessedTime = 0;
 
diff --git a/engines/mediastation/assets/sprite.cpp b/engines/mediastation/assets/sprite.cpp
index 99509993dba..2d14f49fffe 100644
--- a/engines/mediastation/assets/sprite.cpp
+++ b/engines/mediastation/assets/sprite.cpp
@@ -98,7 +98,7 @@ Operand Sprite::callMethod(BuiltInMethod methodId, Common::Array<Operand> &args)
 
 void Sprite::spatialShow() {
 	debugC(5, kDebugScript, "Called Sprite::spatialShow");
-	_isPlaying = true;
+	_isActive = true;
 	g_engine->addPlayingAsset(this);
 
 	// Persist the first frame.
@@ -114,7 +114,7 @@ void Sprite::spatialShow() {
 
 void Sprite::timePlay() {
 	debugC(5, kDebugScript, "Called Sprite::timePlay");
-	_isPlaying = true;
+	_isActive = true;
 	_persistFrame = nullptr;
 	_startTime = g_system->getMillis();
 	_lastProcessedTime = 0;
@@ -137,7 +137,7 @@ void Sprite::timePlay() {
 
 void Sprite::movieReset() {
 	debugC(5, kDebugScript, "Called Sprite::movieReset");
-	_isPlaying = true;
+	_isActive = true;
 	// We do NOT reset the persisting frame, because it should keep showing!
 	_startTime = 0;
 	_currentFrameIndex = 0;
@@ -199,7 +199,7 @@ void Sprite::drawNextFrame() {
 		// Sprites always keep their last frame showing until they are hidden
 		// with spatialHide.
 		_persistFrame = _frames[_currentFrameIndex - 1];
-		_isPlaying = true;
+		_isActive = true;
 
 		// But otherwise, the sprite's params should be reset.
 		_startTime = 0;
diff --git a/engines/mediastation/assets/timer.cpp b/engines/mediastation/assets/timer.cpp
index 72912176215..483d0e7840b 100644
--- a/engines/mediastation/assets/timer.cpp
+++ b/engines/mediastation/assets/timer.cpp
@@ -47,13 +47,13 @@ Operand Timer::callMethod(BuiltInMethod methodId, Common::Array<Operand> &args)
 }
 
 void Timer::timePlay() {
-	if (_isPlaying) {
+	if (_isActive) {
 		warning("Timer::timePlay(): Attempted to play a timer that is already playing");
 		//return;
 	}
 
 	// SET TIMER VARIABLES.
-	_isPlaying = true;
+	_isActive = true;
 	_startTime = g_system->getMillis();
 	_lastProcessedTime = 0;
 	g_engine->addPlayingAsset(this);
@@ -76,18 +76,18 @@ void Timer::timePlay() {
 }
 
 void Timer::timeStop() {
-	if (!_isPlaying) {
+	if (!_isActive) {
 		warning("Timer::stop(): Attempted to stop a timer that is not playing");
 		return;
 	}
 
-	_isPlaying = false;
+	_isActive = false;
 	_startTime = 0;
 	_lastProcessedTime = 0;
 }
 
 void Timer::process() {
-	if (!_isPlaying) {
+	if (!_isActive) {
 		error("Timer::processTimeEventHandlers(): Attempted to process time event handlers while not playing");
 		return;
 	}
diff --git a/engines/mediastation/mediastation.cpp b/engines/mediastation/mediastation.cpp
index 326187efb2b..b0d4b546c42 100644
--- a/engines/mediastation/mediastation.cpp
+++ b/engines/mediastation/mediastation.cpp
@@ -145,7 +145,7 @@ Common::Error MediaStationEngine::run() {
 		});
 		for (auto it = _assetsPlaying.begin(); it != _assetsPlaying.end();) {
 			(*it)->process();
-			if (!(*it)->isPlaying()) {
+			if (!(*it)->isActive()) {
 				it = _assetsPlaying.erase(it);
 			} else {
 				++it;


Commit: 97edede1bd51c125888f9a947f36945304c96c59
    https://github.com/scummvm/scummvm/commit/97edede1bd51c125888f9a947f36945304c96c59
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2025-01-01T12:46:47-05:00

Commit Message:
MEDIASTATION: Remove commented-out debug code from Timer.

Changed paths:
    engines/mediastation/assets/timer.cpp


diff --git a/engines/mediastation/assets/timer.cpp b/engines/mediastation/assets/timer.cpp
index 483d0e7840b..0ccb46d1379 100644
--- a/engines/mediastation/assets/timer.cpp
+++ b/engines/mediastation/assets/timer.cpp
@@ -94,10 +94,6 @@ void Timer::process() {
 
 	uint currentTime = g_system->getMillis();
 	uint movieTime = currentTime - _startTime;
-	//if (movieTime > _duration) {
-	// We are done processing the timer.
-	//    _isPlaying = false;
-	//}
 	debugC(7, kDebugScript, "** Timer %d: ON TIME Event Handlers **", _header->_id);
 	for (EventHandler *timeEvent : _header->_timeHandlers) {
 		double timeEventInFractionalSeconds = timeEvent->_argumentValue.u.f;
@@ -112,17 +108,6 @@ void Timer::process() {
 	}
 	debugC(7, kDebugScript, "** Timer %d: End ON TIME Event Handlers **", _header->_id);
 	_lastProcessedTime = currentTime - _startTime;
-
-	// This has to be at the end becuase the duration of the timer is the
-	// longest time event there is in the timer. And of course it will be called
-	// some amount of time after this time value.
-	// if (movieTime > _duration) {
-	//     // We are done processing the timer.
-	//     _isPlaying = false;
-	//     _startTime = 0;
-	//     _lastProcessedTime = 0;
-	//     debugC(5, kDebugScript, "Timer::timePlay(): Reached end of timer");
-	// }
 }
 
 } // End of namespace MediaStation




More information about the Scummvm-git-logs mailing list