[Scummvm-git-logs] scummvm master -> 0377f34e8ea47b8560f2a98fabc9c8b08d085b25

moralrecordings noreply at scummvm.org
Wed Feb 28 14:05:23 UTC 2024


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

Summary:
0377f34e8e DIRECTOR: Revert multiple filmloop support


Commit: 0377f34e8ea47b8560f2a98fabc9c8b08d085b25
    https://github.com/scummvm/scummvm/commit/0377f34e8ea47b8560f2a98fabc9c8b08d085b25
Author: Scott Percival (code at moral.net.au)
Date: 2024-02-28T22:02:55+08:00

Commit Message:
DIRECTOR: Revert multiple filmloop support

This reverts commit 21c08536e9ceed58ae678d1d455bb2fd842c5da0.

Unfortunately most of the animations in Eastern Mind stopped working, we
need a rethink of how we do this.

Changed paths:
    engines/director/cast.cpp
    engines/director/castmember/filmloop.cpp
    engines/director/sprite.cpp


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 11acf0f5b42..9a4bc799312 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -121,12 +121,6 @@ CastMember *Cast::getCastMember(int castId, bool load) {
 		_loadMutex = false;
 		result->load();
 		while (!_loadQueue.empty()) {
-			// prevents double loading of a filmloop of filmloop
-			if (_loadQueue.back()->_type == kCastFilmLoop) {
-				CastMember *subfilmloop = _loadQueue.back();
-				_loadQueue.pop_back();
-				subfilmloop->load();
-			}
 			_loadQueue.back()->load();
 			_loadQueue.pop_back();
 		}
diff --git a/engines/director/castmember/filmloop.cpp b/engines/director/castmember/filmloop.cpp
index 48a9a8e9c82..cf09e467dd5 100644
--- a/engines/director/castmember/filmloop.cpp
+++ b/engines/director/castmember/filmloop.cpp
@@ -73,87 +73,34 @@ Common::Array<Channel> *FilmLoopCastMember::getSubChannels(Common::Rect &bbox, C
 
 	// get the list of sprite IDs for this frame
 	Common::Array<int> spriteIds;
-	Common::Array<Sprite> subfilmloopsprites;
-	bool subFilmLoops = false;
-	// checking for filmloop at depth
-	for (auto &frameiter : ((FilmLoopCastMember *)channel->_sprite->_cast)->_frames) {
-		for (auto &spriteiter : frameiter.sprites) {
-			if (spriteiter._value._cast) {
-				if (spriteiter._value._cast->_type == kCastFilmLoop) {
-					subfilmloopsprites.push_back(spriteiter._value);
-				}
-			}
-		}
+	for (auto &iter : _frames[channel->_filmLoopFrame].sprites) {
+		spriteIds.push_back(iter._key);
 	}
+	Common::sort(spriteIds.begin(), spriteIds.end());
 
-	if (!subfilmloopsprites.empty()) {
-		subFilmLoops = true;
-	}
-	// if a filmloop is composed of filmloops
-	if (subFilmLoops) {
-		for (uint i = 0; i < subfilmloopsprites.size(); i++) {
-			*channel->_sprite = subfilmloopsprites[i];
-			_frames = ((FilmLoopCastMember *)subfilmloopsprites[i]._cast)->_frames;
-			for (uint j = 0; j < _frames.size(); j++) {
-				for (auto &iter : _frames[j].sprites) {
-					spriteIds.push_back(iter._key);
-				}
-				// copy the sprites in order to the list
-				for (auto &iter : spriteIds) {
-					Sprite src = _frames[j].sprites[iter];
-					if (!src._cast)
-						continue;
-					// translate sprite relative to the global bounding box
-					int16 relX = (src._startPoint.x - _initialRect.left) * widgetRect.width() / _initialRect.width();
-					int16 relY = (src._startPoint.y - _initialRect.top) * widgetRect.height() / _initialRect.height();
-					int16 absX = relX + bbox.left;
-					int16 absY = relY + bbox.top;
-					int16 width = src._width * widgetRect.width() / _initialRect.width();
-					int16 height = src._height * widgetRect.height() / _initialRect.height();
-
-					// Film loop frames are constructed as a series of Channels, much like how a normal frame
-					// is rendered by the Score. We don't include a pointer to the current Score here,
-					// that's only for querying the constraint channel which is not used.
-					Channel chan(nullptr, &src);
-					chan._currentPoint = Common::Point(absX, absY);
-					chan._width = width;
-					chan._height = height;
-
-					_subchannels.push_back(chan);
-				}
-			}
-			subFilmLoops = false;
-		}
-	} else {
-
-		for (auto &iter : _frames[channel->_filmLoopFrame].sprites) {
-			spriteIds.push_back(iter._key);
-		}
-		Common::sort(spriteIds.begin(), spriteIds.end());
+	// copy the sprites in order to the list
+	for (auto &iter : spriteIds) {
+		Sprite src = _frames[channel->_filmLoopFrame].sprites[iter];
+		if (!src._cast)
+			continue;
+		// translate sprite relative to the global bounding box
+		int16 relX = (src._startPoint.x - _initialRect.left) * widgetRect.width() / _initialRect.width();
+		int16 relY = (src._startPoint.y - _initialRect.top) * widgetRect.height() / _initialRect.height();
+		int16 absX = relX + bbox.left;
+		int16 absY = relY + bbox.top;
+		int16 width = src._width * widgetRect.width() / _initialRect.width();
+		int16 height = src._height * widgetRect.height() / _initialRect.height();
+
+		// Film loop frames are constructed as a series of Channels, much like how a normal frame
+		// is rendered by the Score. We don't include a pointer to the current Score here,
+		// that's only for querying the constraint channel which is not used.
+		Channel chan(nullptr, &src);
+		chan._currentPoint = Common::Point(absX, absY);
+		chan._width = width;
+		chan._height = height;
+
+		_subchannels.push_back(chan);
 
-		// copy the sprites in order to the list
-		for (auto &iter : spriteIds) {
-			Sprite src = _frames[channel->_filmLoopFrame].sprites[iter];
-			if (!src._cast)
-				continue;
-			// translate sprite relative to the global bounding box
-			int16 relX = (src._startPoint.x - _initialRect.left) * widgetRect.width() / _initialRect.width();
-			int16 relY = (src._startPoint.y - _initialRect.top) * widgetRect.height() / _initialRect.height();
-			int16 absX = relX + bbox.left;
-			int16 absY = relY + bbox.top;
-			int16 width = src._width * widgetRect.width() / _initialRect.width();
-			int16 height = src._height * widgetRect.height() / _initialRect.height();
-
-			// Film loop frames are constructed as a series of Channels, much like how a normal frame
-			// is rendered by the Score. We don't include a pointer to the current Score here,
-			// that's only for querying the constraint channel which is not used.
-			Channel chan(nullptr, &src);
-			chan._currentPoint = Common::Point(absX, absY);
-			chan._width = width;
-			chan._height = height;
-
-			_subchannels.push_back(chan);
-		}
 	}
 	// Initialise the widgets on all of the subchannels.
 	// This has to be done once the list has been constructed, otherwise
diff --git a/engines/director/sprite.cpp b/engines/director/sprite.cpp
index d80dd9be03a..e0f555c63a6 100644
--- a/engines/director/sprite.cpp
+++ b/engines/director/sprite.cpp
@@ -472,12 +472,10 @@ void Sprite::setCast(CastMemberID memberID) {
 				}
 			}
 			break;
-		case kCastFilmLoop:
 		case kCastShape:
 		case kCastText: 	// fall-through
 			break;
 		default:
-			debugC(3, kDebugImages, "Sprite::setCast(): Setting bbox of castId %s , type: %s to 0", memberID.asString().c_str(), castType2str(_cast->_type));
 			_width = dims.width();
 			_height = dims.height();
 			break;




More information about the Scummvm-git-logs mailing list