[Scummvm-cvs-logs] SF.net SVN: scummvm:[54943] scummvm/trunk/engines/mohawk

bgk at users.sourceforge.net bgk at users.sourceforge.net
Fri Dec 17 12:31:09 CET 2010


Revision: 54943
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54943&view=rev
Author:   bgk
Date:     2010-12-17 11:31:08 +0000 (Fri, 17 Dec 2010)

Log Message:
-----------
MOHAWK: Change resolution to 544x332 to match the original.

This fixes the vertical alignment issues, and graphic corruption on some cards.

Modified Paths:
--------------
    scummvm/trunk/engines/mohawk/graphics.cpp
    scummvm/trunk/engines/mohawk/graphics.h

Modified: scummvm/trunk/engines/mohawk/graphics.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/graphics.cpp	2010-12-17 10:58:34 UTC (rev 54942)
+++ scummvm/trunk/engines/mohawk/graphics.cpp	2010-12-17 11:31:08 UTC (rev 54943)
@@ -210,6 +210,8 @@
 	getVM()->_system->unlockScreen();
 }
 
+const Common::Rect MystGraphics::_viewport = Common::Rect(544, 332);
+
 MystGraphics::MystGraphics(MohawkEngine_Myst* vm) : GraphicsManager(), _vm(vm) {
 	_bmpDecoder = new MystBitmap();
 
@@ -217,7 +219,7 @@
 	// However, it dithered videos to 8bpp and they looked considerably
 	// worse (than they already did :P). So we're not even going to
 	// support 8bpp mode in Myst (Myst ME required >8bpp anyway).
-	initGraphics(544, 333, true, NULL); // What an odd screen size!
+	initGraphics(_viewport.width(), _viewport.height(), true, NULL); // What an odd screen size!
 
 	_pixelFormat = _vm->_system->getScreenFormat();
 
@@ -355,6 +357,8 @@
 	dest.right = CLIP<int>(dest.right, 0, _vm->_system->getWidth());
 	dest.bottom = CLIP<int>(dest.bottom, 0, _vm->_system->getHeight());
 
+	src.clip(_viewport);
+
 	Graphics::Surface *surface = findImage(image)->getSurface();
 
 	debug(3, "Image Blit:");
@@ -382,6 +386,8 @@
 	dest.right = CLIP<int>(dest.right, 0, _vm->_system->getWidth());
 	dest.bottom = CLIP<int>(dest.bottom, 0, _vm->_system->getHeight());
 
+	src.clip(_viewport);
+
 	Graphics::Surface *surface = findImage(image)->getSurface();
 
 	debug(3, "Image Blit:");
@@ -403,14 +409,15 @@
 }
 
 void MystGraphics::copyImageToScreen(uint16 image, Common::Rect dest) {
-	copyImageSectionToScreen(image, Common::Rect(0, 0, 544, 333), dest);
+	copyImageSectionToScreen(image, _viewport, dest);
 }
 
 void MystGraphics::copyImageToBackBuffer(uint16 image, Common::Rect dest) {
-	copyImageSectionToBackBuffer(image, Common::Rect(0, 0, 544, 333), dest);
+	copyImageSectionToBackBuffer(image, _viewport, dest);
 }
 
-void MystGraphics::copyBackBufferToScreen(const Common::Rect &r) {
+void MystGraphics::copyBackBufferToScreen(Common::Rect r) {
+	r.clip(_viewport);
 	_vm->_system->copyRectToScreen((byte *)_backBuffer->getBasePtr(r.left, r.top), _backBuffer->pitch, r.left, r.top, r.width(), r.height());
 }
 
@@ -519,8 +526,10 @@
 }
 
 void MystGraphics::drawRect(Common::Rect rect, RectState state) {
+	rect.clip(_viewport);
+
 	// Useful with debugging. Shows where hotspots are on the screen and whether or not they're active.
-	if (rect.left < 0 || rect.top < 0 || rect.right > 544 || rect.bottom > 333 || !rect.isValidRect() || rect.width() == 0 || rect.height() == 0)
+	if (!rect.isValidRect() || rect.width() == 0 || rect.height() == 0)
 		return;
 
 	Graphics::Surface *screen = _vm->_system->lockScreen();

Modified: scummvm/trunk/engines/mohawk/graphics.h
===================================================================
--- scummvm/trunk/engines/mohawk/graphics.h	2010-12-17 10:58:34 UTC (rev 54942)
+++ scummvm/trunk/engines/mohawk/graphics.h	2010-12-17 11:31:08 UTC (rev 54943)
@@ -114,7 +114,7 @@
 	void copyImageSectionToBackBuffer(uint16 image, Common::Rect src, Common::Rect dest);
 	void copyImageToScreen(uint16 image, Common::Rect dest);
 	void copyImageToBackBuffer(uint16 image, Common::Rect dest);
-	void copyBackBufferToScreen(const Common::Rect &r);
+	void copyBackBufferToScreen(Common::Rect r);
 	void runTransition(uint16 type, Common::Rect rect, uint16 steps, uint16 delay);
 	void drawRect(Common::Rect rect, RectState state);
 	void drawLine(const Common::Point &p1, const Common::Point &p2, uint32 color);
@@ -145,6 +145,7 @@
 
 	Graphics::Surface *_backBuffer;
 	Graphics::PixelFormat _pixelFormat;
+	static const Common::Rect _viewport;
 };
 
 struct SFXERecord {


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