[Scummvm-cvs-logs] scummvm master -> 5b6d3078c9174f0b932b88bf9aeef7c11c3cb190

fuzzie fuzzie at fuzzie.org
Fri Aug 2 00:03:51 CEST 2013


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

Summary:
275c65c272 TONY: Simplify thumbnail loading code.
d1795a21bc TONY: Fix savegames on BE (this breaks compatibility).
9c02f5b593 TONY: Fix thumbnails on BE.
5b6d3078c9 TONY: Add a hack to work around amigaos4 issues.


Commit: 275c65c2727db483b43819b0df91a93148229808
    https://github.com/scummvm/scummvm/commit/275c65c2727db483b43819b0df91a93148229808
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2013-08-01T15:01:10-07:00

Commit Message:
TONY: Simplify thumbnail loading code.

Changed paths:
    engines/tony/detection.cpp



diff --git a/engines/tony/detection.cpp b/engines/tony/detection.cpp
index 1094950..2a443c4 100644
--- a/engines/tony/detection.cpp
+++ b/engines/tony/detection.cpp
@@ -154,26 +154,16 @@ void TonyMetaEngine::removeSaveState(const char *target, int slot) const {
 SaveStateDescriptor TonyMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
 	Common::String saveName;
 	byte difficulty;
-	byte thumbData[160 * 120 * 2];
-
-	if (Tony::RMOptionScreen::loadThumbnailFromSaveState(slot, thumbData, saveName, difficulty)) {
-		// Convert the 565 thumbnail data to the needed overlay format
-		Common::MemoryReadStream thumbStream(thumbData, 160 * 120 * 2);
-		Graphics::PixelFormat destFormat = g_system->getOverlayFormat();
-		Graphics::Surface *to = new Graphics::Surface();
-		to->create(160, 120, destFormat);
-
-		OverlayColor *pixels = (OverlayColor *)to->pixels;
-		for (int y = 0; y < to->h; ++y) {
-			for (int x = 0; x < to->w; ++x) {
-				uint8 r, g, b;
-				Graphics::colorToRGB<Graphics::ColorMasks<555> >(thumbStream.readUint16LE(), r, g, b);
-
-				// converting to current OSystem Color
-				*pixels++ = destFormat.RGBToColor(r, g, b);
-			}
-		}
 
+	Graphics::Surface *to = new Graphics::Surface();
+	to->create(160, 120, Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0));
+
+	if (Tony::RMOptionScreen::loadThumbnailFromSaveState(slot, (byte *)to->pixels, saveName, difficulty)) {
+#ifdef SCUMM_BIG_ENDIAN
+		uint16 *pixels = (uint16 *)to->pixels;
+		for (int i = 0; i < to->w * to->h; ++i)
+			pixels[i] = READ_LE_UINT16(pixels + i);
+#endif
 		// Create the return descriptor
 		SaveStateDescriptor desc(slot, saveName);
 		desc.setDeletableFlag(true);
@@ -183,6 +173,7 @@ SaveStateDescriptor TonyMetaEngine::querySaveMetaInfos(const char *target, int s
 		return desc;
 	}
 
+	delete to;
 	return SaveStateDescriptor();
 }
 


Commit: d1795a21bc26ae32e36bd0cf777fb05b556107fd
    https://github.com/scummvm/scummvm/commit/d1795a21bc26ae32e36bd0cf777fb05b556107fd
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2013-08-01T15:01:10-07:00

Commit Message:
TONY: Fix savegames on BE (this breaks compatibility).

Changed paths:
    engines/tony/mpal/mpal.cpp



diff --git a/engines/tony/mpal/mpal.cpp b/engines/tony/mpal/mpal.cpp
index fff8676..5e6d44f 100644
--- a/engines/tony/mpal/mpal.cpp
+++ b/engines/tony/mpal/mpal.cpp
@@ -2035,7 +2035,13 @@ int mpalGetSaveStateSize() {
 void mpalSaveState(byte *buf) {
 	lockVar();
 	WRITE_LE_UINT32(buf, GLOBALS._nVars);
-	memcpy(buf + 4, (byte *)GLOBALS._lpmvVars, GLOBALS._nVars * sizeof(MpalVar));
+	buf += 4;
+	for (uint i = 0; i < GLOBALS._nVars; ++i) {
+		LpMpalVar var = &GLOBALS._lpmvVars[i];
+		WRITE_LE_UINT32(buf, var->_dwVal);
+		memcpy(buf + 4, var->_lpszVarName, sizeof(var->_lpszVarName));
+		buf += (4 + sizeof(var->_lpszVarName));
+	}
 	unlockVar();
 }
 
@@ -2050,10 +2056,16 @@ int mpalLoadState(byte *buf) {
 	globalFree(GLOBALS._hVars);
 
 	GLOBALS._nVars = READ_LE_UINT32(buf);
+	buf += 4;
 
 	GLOBALS._hVars = globalAllocate(GMEM_ZEROINIT | GMEM_MOVEABLE, GLOBALS._nVars * sizeof(MpalVar));
 	lockVar();
-	memcpy((byte *)GLOBALS._lpmvVars, buf + 4, GLOBALS._nVars * sizeof(MpalVar));
+	for (uint i = 0; i < GLOBALS._nVars; ++i) {
+		LpMpalVar var = &GLOBALS._lpmvVars[i];
+		var->_dwVal = READ_LE_UINT32(buf);
+		memcpy(var->_lpszVarName, buf + 4, sizeof(var->_lpszVarName));
+		buf += (4 + sizeof(var->_lpszVarName));
+	}
 	unlockVar();
 
 	return GLOBALS._nVars * sizeof(MpalVar) + 4;


Commit: 9c02f5b59355590219fb37a0f1ec2b325acae9eb
    https://github.com/scummvm/scummvm/commit/9c02f5b59355590219fb37a0f1ec2b325acae9eb
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2013-08-01T15:01:10-07:00

Commit Message:
TONY: Fix thumbnails on BE.

Changed paths:
    engines/tony/game.cpp
    engines/tony/gfxcore.h
    engines/tony/window.cpp



diff --git a/engines/tony/game.cpp b/engines/tony/game.cpp
index 501a588..ca7c07a 100644
--- a/engines/tony/game.cpp
+++ b/engines/tony/game.cpp
@@ -508,7 +508,8 @@ void RMOptionScreen::refreshThumbnails() {
 			_curThumb[i] = NULL;
 			_curThumbName[i].clear();
 			_curThumbDiff[i] = 11;
-		}
+		} else
+			_curThumb[i]->prepareImage();
 	}
 }
 
diff --git a/engines/tony/gfxcore.h b/engines/tony/gfxcore.h
index 2548968..9e8f522 100644
--- a/engines/tony/gfxcore.h
+++ b/engines/tony/gfxcore.h
@@ -208,8 +208,10 @@ public:
  * 16-bit color source
  */
 class RMGfxSourceBuffer16 : public RMGfxSourceBuffer {
-protected:
+public:
 	virtual void prepareImage();
+
+protected:
 	bool _bTrasp0;
 
 public:
diff --git a/engines/tony/window.cpp b/engines/tony/window.cpp
index 61497a8..a732862 100644
--- a/engines/tony/window.cpp
+++ b/engines/tony/window.cpp
@@ -330,6 +330,14 @@ void RMSnapshot::grabScreenshot(byte *lpBuf, int dezoom, uint16 *lpDestBuf) {
 				src += RM_BBX * dezoom;
 		}
 	}
+
+#ifdef SCUMM_BIG_ENDIAN
+	if (lpDestBuf != NULL) {
+		for (int i = 0; i < dimx * dimy; i++) {
+			lpDestBuf[i] = SWAP_BYTES_16(lpDestBuf[i]);
+		}
+	}
+#endif
 }
 
 } // End of namespace Tony


Commit: 5b6d3078c9174f0b932b88bf9aeef7c11c3cb190
    https://github.com/scummvm/scummvm/commit/5b6d3078c9174f0b932b88bf9aeef7c11c3cb190
Author: Alyssa Milburn (fuzzie at fuzzie.org)
Date: 2013-08-01T15:01:11-07:00

Commit Message:
TONY: Add a hack to work around amigaos4 issues.

Changed paths:
    engines/tony/sound.cpp



diff --git a/engines/tony/sound.cpp b/engines/tony/sound.cpp
index 90ae241..547f319 100644
--- a/engines/tony/sound.cpp
+++ b/engines/tony/sound.cpp
@@ -500,7 +500,13 @@ bool FPStream::loadFile(const Common::String &fileName, uint32 codec, int bufSiz
 		break;
 
 	case FPCODEC_ADPCM:
+#ifdef __amigaos4__
+		// HACK: AmigaOS 4 has weird performance problems with reading in the audio thread,
+		// so we read the whole stream into memory.
+		_rewindableStream = Audio::makeADPCMStream(_file.readStream(_size), DisposeAfterUse::YES, 0, Audio::kADPCMDVI, 44100, 2);
+#else
 		_rewindableStream = Audio::makeADPCMStream(&_file, DisposeAfterUse::NO, 0, Audio::kADPCMDVI, 44100, 2);
+#endif
 		break;
 
 	default:






More information about the Scummvm-git-logs mailing list