[Scummvm-cvs-logs] scummvm master -> 5684475169a371f0b09c9550901279ade10f5275

lordhoto lordhoto at gmail.com
Fri Sep 7 22:45:14 CEST 2012


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:
c06889a289 CINE: Fix sprite loading in FW.
5684475169 CINE: Workaround disabled menus in FW when loading from launcher/cl.


Commit: c06889a289286bcbe49661abfda4316e5290c27c
    https://github.com/scummvm/scummvm/commit/c06889a289286bcbe49661abfda4316e5290c27c
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-09-07T13:38:41-07:00

Commit Message:
CINE: Fix sprite loading in FW.

This partly fixes bug #3565362 "CINE: Savegame loading broken in FW".
This fixes a regression from 2fd8bae31994e5581d0ef43da439d01ddd0d1ef5.

Changed paths:
    engines/cine/anim.cpp



diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp
index 7548a98..9b21036 100644
--- a/engines/cine/anim.cpp
+++ b/engines/cine/anim.cpp
@@ -545,9 +545,10 @@ int loadSpl(const char *resourceName, int16 idx) {
  * Load 1bpp mask
  * @param resourceName Mask filename
  * @param idx Target index in animDataTable (-1 if any empty space will do)
+ * @param frameIndex frame of animation to load (-1 for all frames)
  * @return The number of the animDataTable entry after the loaded mask (-1 if error)
  */
-int loadMsk(const char *resourceName, int16 idx) {
+int loadMsk(const char *resourceName, int16 idx, int16 frameIndex) {
 	int16 foundFileIdx = findFileInBundle(resourceName);
 	if (foundFileIdx < 0) {
 		return -1;
@@ -562,9 +563,18 @@ int loadMsk(const char *resourceName, int16 idx) {
 	loadAnimHeader(animHeader, readS);
 	ptr = dataPtr + 0x16;
 
+	int16 startFrame = 0;
+	int16 endFrame = animHeader.numFrames;
+
+	if (frameIndex >= 0) {
+		startFrame = frameIndex;
+		endFrame = frameIndex + 1;
+		ptr += frameIndex * animHeader.frameWidth * animHeader.frameHeight;
+	}
+
 	entry = idx < 0 ? emptyAnimSpace() : idx;
 	assert(entry >= 0);
-	for (int16 i = 0; i < animHeader.numFrames; i++, entry++) {
+	for (int16 i = startFrame; i < endFrame; i++, entry++) {
 		g_cine->_animDataTable[entry].load(ptr, ANIM_MASK, animHeader.frameWidth, animHeader.frameHeight, foundFileIdx, i, currentPartName);
 		ptr += animHeader.frameWidth * animHeader.frameHeight;
 	}
@@ -577,9 +587,10 @@ int loadMsk(const char *resourceName, int16 idx) {
  * Load animation
  * @param resourceName Animation filename
  * @param idx Target index in animDataTable (-1 if any empty space will do)
+ * @param frameIndex frame of animation to load (-1 for all frames)
  * @return The number of the animDataTable entry after the loaded animation (-1 if error)
  */
-int loadAni(const char *resourceName, int16 idx) {
+int loadAni(const char *resourceName, int16 idx, int16 frameIndex) {
 	int16 foundFileIdx = findFileInBundle(resourceName);
 	if (foundFileIdx < 0) {
 		return -1;
@@ -595,6 +606,15 @@ int loadAni(const char *resourceName, int16 idx) {
 	loadAnimHeader(animHeader, readS);
 	ptr = dataPtr + 0x16;
 
+	int16 startFrame = 0;
+	int16 endFrame = animHeader.numFrames;
+
+	if (frameIndex >= 0) {
+		startFrame = frameIndex;
+		endFrame = frameIndex + 1;
+		ptr += frameIndex * animHeader.frameWidth * animHeader.frameHeight;
+	}
+
 	transparentColor = getAnimTransparentColor(resourceName);
 
 	// TODO: Merge this special case hack into getAnimTransparentColor somehow.
@@ -608,7 +628,7 @@ int loadAni(const char *resourceName, int16 idx) {
 	entry = idx < 0 ? emptyAnimSpace() : idx;
 	assert(entry >= 0);
 
-	for (int16 i = 0; i < animHeader.numFrames; i++, entry++) {
+	for (int16 i = startFrame; i < endFrame; i++, entry++) {
 		// special case transparency handling
 		if (!strcmp(resourceName, "L2202.ANI")) {
 			transparentColor = i < 2 ? 0 : 7;
@@ -781,11 +801,11 @@ int loadResource(const char *resourceName, int16 idx, int16 frameIndex) {
 	if (strstr(resourceName, ".SPL")) {
 		result = loadSpl(resourceName, idx);
 	} else if (strstr(resourceName, ".MSK")) {
-		result = loadMsk(resourceName, idx);
+		result = loadMsk(resourceName, idx, frameIndex);
 	} else if (strstr(resourceName, ".ANI")) {
-		result = loadAni(resourceName, idx);
+		result = loadAni(resourceName, idx, frameIndex);
 	} else if (strstr(resourceName, ".ANM")) {
-		result = loadAni(resourceName, idx);
+		result = loadAni(resourceName, idx, frameIndex);
 	} else if (strstr(resourceName, ".SET")) {
 		result = loadSet(resourceName, idx, frameIndex);
 	} else if (strstr(resourceName, ".SEQ")) {


Commit: 5684475169a371f0b09c9550901279ade10f5275
    https://github.com/scummvm/scummvm/commit/5684475169a371f0b09c9550901279ade10f5275
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-09-07T13:38:41-07:00

Commit Message:
CINE: Workaround disabled menus in FW when loading from launcher/cl.

This works around a regression from 92df76fbb3802bf28819c2684d188251c249cdbb.
This should resolve the remaining issues of bug #3565362
"CINE: Savegame loading broken in FW".

Changed paths:
    engines/cine/cine.cpp



diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index bbe2cd4..aa7221f 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -189,7 +189,18 @@ void CineEngine::initialize() {
 	g_cine->_messageTable.clear();
 	resetObjectTable();
 
-	disableSystemMenu = 1;
+	if (getGameType() == Cine::GType_OS) {
+		disableSystemMenu = 1;
+	} else {
+		// WORKAROUND: We do not save this variable in FW's savegames.
+		// Initializing this to 1, like we do it in the OS case, will
+		// cause the menu disabled when loading from the launcher or
+		// command line.
+		// A proper fix here would be to save this variable in FW's saves.
+		// Since it seems these are unversioned so far, there would be need
+		// to properly add versioning to them first.
+		disableSystemMenu = 0;
+	}
 
 	var8 = 0;
 






More information about the Scummvm-git-logs mailing list