[Scummvm-cvs-logs] SF.net SVN: scummvm:[51660] scummvm/trunk/engines/sci/graphics

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Mon Aug 2 23:04:09 CEST 2010


Revision: 51660
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51660&view=rev
Author:   m_kiewitz
Date:     2010-08-02 21:04:09 +0000 (Mon, 02 Aug 2010)

Log Message:
-----------
SCI: adding non-scaleable view capability

fixes laura bow 2 (especially floppy but CD is also affected somewhat by this)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/graphics/animate.cpp
    scummvm/trunk/engines/sci/graphics/view.cpp
    scummvm/trunk/engines/sci/graphics/view.h

Modified: scummvm/trunk/engines/sci/graphics/animate.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.cpp	2010-08-02 20:45:17 UTC (rev 51659)
+++ scummvm/trunk/engines/sci/graphics/animate.cpp	2010-08-02 21:04:09 UTC (rev 51660)
@@ -243,6 +243,13 @@
 			}
 		}
 
+		if (!view->isScaleable()) {
+			// Laura Bow 2 (especially floppy) depends on this, some views are not supposed to be scaleable
+			//  this "feature" was removed in later versions of SCI1.1
+			it->scaleSignal = 0;
+			it->scaleY = it->scaleX = 128;
+		}
+
 		bool setNsRect = true;
 
 		// Create rect according to coordinates and given cel

Modified: scummvm/trunk/engines/sci/graphics/view.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/view.cpp	2010-08-02 20:45:17 UTC (rev 51659)
+++ scummvm/trunk/engines/sci/graphics/view.cpp	2010-08-02 21:04:09 UTC (rev 51660)
@@ -84,9 +84,10 @@
 	_embeddedPal = false;
 	_EGAmapping = NULL;
 	_isSci2Hires = false;
+	_isScaleable = true;
 
 	// we adjust inside getCelRect for SCI0EARLY (that version didn't have the +1 when calculating bottom)
-	adjustForSci0Early = getSciVersion() == SCI_VERSION_0_EARLY ? -1 : 0;
+	_adjustForSci0Early = getSciVersion() == SCI_VERSION_0_EARLY ? -1 : 0;
 
 	// If we find an SCI1/SCI1.1 view (not amiga), we switch to that type for
 	// EGA. This could get used to make view patches for EGA games, where the
@@ -192,15 +193,30 @@
 		break;
 
 	case kViewVga11: // View-format SCI1.1+
-		// HeaderSize:WORD LoopCount:BYTE Unknown:BYTE Version:WORD Unknown:WORD PaletteOffset:WORD
+		// HeaderSize:WORD LoopCount:BYTE Flags:BYTE Version:WORD Unknown:WORD PaletteOffset:WORD
 		headerSize = READ_SCI11ENDIAN_UINT16(_resourceData + 0) + 2; // headerSize is not part of the header, so it's added
 		assert(headerSize >= 16);
 		_loopCount = _resourceData[2];
 		assert(_loopCount);
 		_isSci2Hires = _resourceData[5] == 1 ? true : false;
 		palOffset = READ_SCI11ENDIAN_UINT32(_resourceData + 8);
-		// FIXME: After LoopCount there is another byte and its set for view 50
-		// within Laura Bow 2 CD, check what it means.
+		// flags is actually a bit-mask
+		//  it seems it was only used for some early sci1.1 games (or even just laura bow 2)
+		//  later interpreters dont support it at all anymore
+		// we assume that if flags is 0h the view does not support flags and default to scaleable
+		// if it's 1h then we assume that the view is not to be scaled
+		// if it's 40h then we assume that the view is scaleable
+		switch (_resourceData[3]) {
+		case 1:
+			_isScaleable = false;
+			break;
+		case 0x40:
+		case 0:
+			break; // don't do anything, we already have _isScaleable set
+		default:
+			error("unsupported flags byte inside sci1.1 view");
+			break;
+		}
 
 		loopData = _resourceData + headerSize;
 		loopSize = _resourceData[12];
@@ -321,11 +337,15 @@
 	return _isSci2Hires;
 }
 
+bool GfxView::isScaleable() {
+	return _isScaleable;
+}
+
 void GfxView::getCelRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Common::Rect &outRect) const {
 	const CelInfo *celInfo = getCelInfo(loopNo, celNo);
 	outRect.left = x + celInfo->displaceX - (celInfo->width >> 1);
 	outRect.right = outRect.left + celInfo->width;
-	outRect.bottom = y + celInfo->displaceY - z + 1 + adjustForSci0Early;
+	outRect.bottom = y + celInfo->displaceY - z + 1 + _adjustForSci0Early;
 	outRect.top = outRect.bottom - celInfo->height;
 }
 

Modified: scummvm/trunk/engines/sci/graphics/view.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/view.h	2010-08-02 20:45:17 UTC (rev 51659)
+++ scummvm/trunk/engines/sci/graphics/view.h	2010-08-02 21:04:09 UTC (rev 51660)
@@ -74,6 +74,7 @@
 	uint16 getCelCount(int16 loopNo) const;
 	Palette *getPalette();
 
+	bool isScaleable();
 	bool isSci2Hires();
 
 private:
@@ -102,7 +103,11 @@
 	byte *_EGAmapping;
 
 	// this is set for sci0early to adjust for the getCelRect() change
-	int16 adjustForSci0Early;
+	int16 _adjustForSci0Early;
+
+	// this is not set for some views in laura bow 2 floppy and signals that the view shall never get scaled
+	//  even if scaleX/Y are set (inside kAnimate)
+	bool _isScaleable;
 };
 
 } // End of namespace Sci


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list