[Scummvm-cvs-logs] scummvm master -> 2087e2325bd97a31c3518d87918ba87727faff3c

clone2727 clone2727 at gmail.com
Sun Feb 13 22:24:29 CET 2011


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:
0be58b2694 SCI: Fix VMD coordinates
b4ca2da72e SCI: Switch to true color mode for the GK2 demo Indeo3 video
d096b78aca MOHAWK: Add support for Mac LB v2 games
2087e2325b MOHAWK: Fix comments for the LB sampler v2


Commit: 0be58b2694c2517c24a66035b3ea716bf9ac5fb6
    https://github.com/scummvm/scummvm/commit/0be58b2694c2517c24a66035b3ea716bf9ac5fb6
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2011-02-13T13:14:06-08:00

Commit Message:
SCI: Fix VMD coordinates

The suffix check for "vmd" failed for uppercase files.

Changed paths:
    engines/sci/engine/kvideo.cpp



diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp
index e905764..3392a9b 100644
--- a/engines/sci/engine/kvideo.cpp
+++ b/engines/sci/engine/kvideo.cpp
@@ -50,6 +50,8 @@ void playVideo(Video::VideoDecoder *videoDecoder, VideoState videoState) {
 	uint16 pitch = videoDecoder->getWidth() * bytesPerPixel;
 	uint16 screenWidth = g_system->getWidth();
 	uint16 screenHeight = g_system->getHeight();
+
+	videoState.fileName.toLowercase();
 	bool isVMD = videoState.fileName.hasSuffix(".vmd");
 
 	if (screenWidth == 640 && width <= 320 && height <= 240 && ((videoState.flags & kDoubled) || !isVMD)) {
@@ -73,9 +75,10 @@ void playVideo(Video::VideoDecoder *videoDecoder, VideoState videoState) {
 			y = (screenHeight - height) / 2;
 		}
 	} else {
-			x = (screenWidth - width) / 2;
-			y = (screenHeight - height) / 2;
+		x = (screenWidth - width) / 2;
+		y = (screenHeight - height) / 2;
 	}
+
 	bool skipVideo = false;
 
 	if (videoDecoder->hasDirtyPalette())


Commit: b4ca2da72ebf587fd067f82551b2ccff3cc29a40
    https://github.com/scummvm/scummvm/commit/b4ca2da72ebf587fd067f82551b2ccff3cc29a40
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2011-02-13T13:14:06-08:00

Commit Message:
SCI: Switch to true color mode for the GK2 demo Indeo3 video

Changed paths:
    engines/sci/engine/kvideo.cpp



diff --git a/engines/sci/engine/kvideo.cpp b/engines/sci/engine/kvideo.cpp
index 3392a9b..155dec5 100644
--- a/engines/sci/engine/kvideo.cpp
+++ b/engines/sci/engine/kvideo.cpp
@@ -140,7 +140,7 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) {
 			initGraphics(screenWidth, screenHeight, screenWidth > 320, NULL);
 
 			if (g_system->getScreenFormat().bytesPerPixel == 1) {
-				error("This video requires >8bpp color to be displayed, but could not switch to RGB color mode");
+				warning("This video requires >8bpp color to be displayed, but could not switch to RGB color mode");
 				return NULL_REG;
 			}
 
@@ -180,6 +180,19 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) {
 			Common::String filename = s->_segMan->getString(argv[1]);
 			videoDecoder = new Video::AviDecoder(g_system->getMixer());
 
+			if (filename.equalsIgnoreCase("gk2a.avi")) {
+				// HACK: Switch to 16bpp graphics for Indeo3.
+				// The only known movie to do use this codec is the GK2 demo trailer
+				// If another video turns up that uses Indeo, we may have to add a better
+				// check.
+				initGraphics(screenWidth, screenHeight, screenWidth > 320, NULL);
+
+				if (g_system->getScreenFormat().bytesPerPixel == 1) {
+					warning("This video requires >8bpp color to be displayed, but could not switch to RGB color mode");
+					return NULL_REG;
+				}
+			}
+
 			if (!videoDecoder->loadFile(filename.c_str())) {
 				warning("Failed to open movie file %s", filename.c_str());
 				delete videoDecoder;
@@ -195,7 +208,7 @@ reg_t kShowMovie(EngineState *s, int argc, reg_t *argv) {
 	if (videoDecoder) {
 		playVideo(videoDecoder, s->_videoState);
 
-		// HACK: Switch back to 8bpp if we played a QuickTime video.
+		// HACK: Switch back to 8bpp if we played a true color video.
 		// We also won't be copying the screen to the SCI screen...
 		if (g_system->getScreenFormat().bytesPerPixel != 1)
 			initGraphics(screenWidth, screenHeight, screenWidth > 320);


Commit: d096b78acaa510e02cb9be9a2e2dc17e53f80e3e
    https://github.com/scummvm/scummvm/commit/d096b78acaa510e02cb9be9a2e2dc17e53f80e3e
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2011-02-13T13:14:07-08:00

Commit Message:
MOHAWK: Add support for Mac LB v2 games

Changed paths:
    engines/mohawk/detection_tables.h
    engines/mohawk/graphics.cpp
    engines/mohawk/livingbooks.cpp
    engines/mohawk/livingbooks.h
    engines/mohawk/sound.cpp



diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h
index 8f294f0..26c278f 100644
--- a/engines/mohawk/detection_tables.h
+++ b/engines/mohawk/detection_tables.h
@@ -690,9 +690,6 @@ static const MohawkGameDescription gameDescriptions[] = {
 		0
 	},
 
-	// FIXME: Mac version of Dr. Seuss's ABC uses V1 archive format, but has
-	//        V2 script format. Currently the engine aborts after the "A--B--C" intro with:
-	//        failed to read script entry correctly (8 bytes left): type 0x0067, event 0x0004, opcode 0x0006, param 0x0001!
 	{
 		{
 			"seussabc",
@@ -703,7 +700,7 @@ static const MohawkGameDescription gameDescriptions[] = {
 			ADGF_NO_FLAGS,
 			Common::GUIO_NONE
 		},
-		GType_LIVINGBOOKSV1,
+		GType_LIVINGBOOKSV2,
 		0,
 		0
 	},
diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp
index fe015b4..be2fe01 100644
--- a/engines/mohawk/graphics.cpp
+++ b/engines/mohawk/graphics.cpp
@@ -956,7 +956,7 @@ void RivenGraphics::drawExtrasImage(uint16 id, Common::Rect dstRect) {
 }
 
 LBGraphics::LBGraphics(MohawkEngine_LivingBooks *vm, uint16 width, uint16 height) : GraphicsManager(), _vm(vm) {
-	_bmpDecoder = (_vm->getGameType() == GType_LIVINGBOOKSV1) ? new OldMohawkBitmap() : new MohawkBitmap();
+	_bmpDecoder = _vm->isPreMohawk() ? new OldMohawkBitmap() : new MohawkBitmap();
 
 	initGraphics(width, height, true);
 }
@@ -966,7 +966,7 @@ LBGraphics::~LBGraphics() {
 }
 
 MohawkSurface *LBGraphics::decodeImage(uint16 id) {
-	if (_vm->getGameType() == GType_LIVINGBOOKSV1)
+	if (_vm->isPreMohawk())
 		return _bmpDecoder->decodeImage(_vm->wrapStreamEndian(ID_BMAP, id));
 
 	return _bmpDecoder->decodeImage(_vm->getResource(ID_TBMP, id));
@@ -1002,7 +1002,7 @@ bool LBGraphics::imageIsTransparentAt(uint16 image, bool useOffsets, int x, int
 void LBGraphics::setPalette(uint16 id) {
 	// Old Living Books games use the old CTBL-style palette format while newer
 	// games use the better tPAL format which can store partial palettes.
-	if (_vm->getGameType() == GType_LIVINGBOOKSV1) {
+	if (_vm->isPreMohawk()) {
 		Common::SeekableSubReadStreamEndian *ctblStream = _vm->wrapStreamEndian(ID_CTBL, id);
 		uint16 colorCount = ctblStream->readUint16();
 		byte *palette = new byte[colorCount * 4];
diff --git a/engines/mohawk/livingbooks.cpp b/engines/mohawk/livingbooks.cpp
index 4c2cc78..45c430e 100644
--- a/engines/mohawk/livingbooks.cpp
+++ b/engines/mohawk/livingbooks.cpp
@@ -55,7 +55,7 @@ Common::Rect MohawkEngine_LivingBooks::readRect(Common::SeekableSubReadStreamEnd
 	Common::Rect rect;
 
 	// the V1 mac games have their rects in QuickDraw order
-	if (getGameType() == GType_LIVINGBOOKSV1 && getPlatform() == Common::kPlatformMacintosh) {
+	if (isPreMohawk() && getPlatform() == Common::kPlatformMacintosh) {
 		rect.top = stream->readSint16();
 		rect.left = stream->readSint16();
 		rect.bottom = stream->readSint16();
@@ -685,7 +685,12 @@ Common::String MohawkEngine_LivingBooks::convertWinFileName(const Common::String
 }
 
 MohawkArchive *MohawkEngine_LivingBooks::createMohawkArchive() const {
-	return (getGameType() == GType_LIVINGBOOKSV1) ? new LivingBooksArchive_v1() : new MohawkArchive();
+	return isPreMohawk() ? new LivingBooksArchive_v1() : new MohawkArchive();
+}
+
+bool MohawkEngine_LivingBooks::isPreMohawk() const {
+	return getGameType() == GType_LIVINGBOOKSV1
+		|| (getGameType() == GType_LIVINGBOOKSV2 && getPlatform() == Common::kPlatformMacintosh);
 }
 
 void MohawkEngine_LivingBooks::addNotifyEvent(NotifyEvent event) {
@@ -1195,7 +1200,7 @@ void LBAnimationNode::draw(const Common::Rect &_bounds) {
 
 	uint16 resourceId = _parent->getResource(_currentCel - 1);
 
-	if (_vm->getGameType() != GType_LIVINGBOOKSV1) {
+	if (!_vm->isPreMohawk()) {
 		Common::Point offset = _parent->getOffset(_currentCel - 1);
 		xOffset -= offset.x;
 		yOffset -= offset.y;
@@ -1391,7 +1396,7 @@ bool LBAnimationNode::transparentAt(int x, int y) {
 
 	uint16 resourceId = _parent->getResource(_currentCel - 1);
 
-	if (_vm->getGameType() != GType_LIVINGBOOKSV1) {
+	if (!_vm->isPreMohawk()) {
 		Common::Point offset = _parent->getOffset(_currentCel - 1);
 		x += offset.x;
 		y += offset.y;
@@ -1492,7 +1497,7 @@ void LBAnimation::loadShape(uint16 resourceId) {
 
 	Common::SeekableSubReadStreamEndian *shapeStream = _vm->wrapStreamEndian(ID_SHP, resourceId);
 
-	if (_vm->getGameType() == GType_LIVINGBOOKSV1) {
+	if (_vm->isPreMohawk()) {
 		if (shapeStream->size() < 6)
 			error("V1 SHP Record size too short (%d)", shapeStream->size());
 
diff --git a/engines/mohawk/livingbooks.h b/engines/mohawk/livingbooks.h
index 68b9ac6..186502d 100644
--- a/engines/mohawk/livingbooks.h
+++ b/engines/mohawk/livingbooks.h
@@ -589,6 +589,7 @@ public:
 	void queueDelayedEvent(DelayedEvent event);
 
 	bool isBigEndian() const { return getGameType() != GType_LIVINGBOOKSV1 || getPlatform() == Common::kPlatformMacintosh; }
+	bool isPreMohawk() const;
 
 	LBMode getCurMode() { return _curMode; }
 
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp
index e5528e6..ca642f1 100644
--- a/engines/mohawk/sound.cpp
+++ b/engines/mohawk/sound.cpp
@@ -92,6 +92,12 @@ Audio::AudioStream *Sound::makeAudioStream(uint16 id, CueList *cueList) {
 	case GType_LIVINGBOOKSV1:
 		audStream = makeOldMohawkWaveStream(_vm->getResource(ID_WAV, id));
 		break;
+	case GType_LIVINGBOOKSV2:
+		if (_vm->getPlatform() == Common::kPlatformMacintosh) {
+			audStream = makeOldMohawkWaveStream(_vm->getResource(ID_WAV, id));
+			break;
+		}
+		// fall through
 	default:
 		audStream = makeMohawkWaveStream(_vm->getResource(ID_TWAV, id), cueList);
 	}


Commit: 2087e2325bd97a31c3518d87918ba87727faff3c
    https://github.com/scummvm/scummvm/commit/2087e2325bd97a31c3518d87918ba87727faff3c
Author: Matthew Hoops (clone2727 at gmail.com)
Date: 2011-02-13T13:14:07-08:00

Commit Message:
MOHAWK: Fix comments for the LB sampler v2

Changed paths:
    engines/mohawk/detection_tables.h



diff --git a/engines/mohawk/detection_tables.h b/engines/mohawk/detection_tables.h
index 26c278f..ae37a22 100644
--- a/engines/mohawk/detection_tables.h
+++ b/engines/mohawk/detection_tables.h
@@ -1219,6 +1219,7 @@ static const MohawkGameDescription gameDescriptions[] = {
 		0
 	},
 
+	// While this entry has a v2 interpreter, it still has v1 data
 	{
 		{
 			"lbsampler",
@@ -1229,7 +1230,7 @@ static const MohawkGameDescription gameDescriptions[] = {
 			ADGF_NO_FLAGS,
 			Common::GUIO_NONE
 		},
-		GType_LIVINGBOOKSV1, // v2 Mac games are really still v1
+		GType_LIVINGBOOKSV1,
 		0,
 		"Living Books Sampler"
 	},






More information about the Scummvm-git-logs mailing list