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

bgk at users.sourceforge.net bgk at users.sourceforge.net
Mon Nov 29 21:56:39 CET 2010


Revision: 54620
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54620&view=rev
Author:   bgk
Date:     2010-11-29 20:56:39 +0000 (Mon, 29 Nov 2010)

Log Message:
-----------
MOHAWK: Only draw a resource conditional subimages if it has the "subimages enabled" flag set.

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

Modified: scummvm/trunk/engines/mohawk/myst.cpp
===================================================================
--- scummvm/trunk/engines/mohawk/myst.cpp	2010-11-29 20:56:21 UTC (rev 54619)
+++ scummvm/trunk/engines/mohawk/myst.cpp	2010-11-29 20:56:39 UTC (rev 54620)
@@ -396,6 +396,18 @@
 	_gfx->clearCache();
 }
 
+void MohawkEngine_Myst::drawCardBackground() {
+if (_view.conditionalImageCount != 0) {
+	for (uint16 i = 0; i < _view.conditionalImageCount; i++) {
+		if (_scriptParser->getVar(_view.conditionalImages[i].var) < _view.conditionalImages[i].numStates)
+			_gfx->copyImageToScreen(_view.conditionalImages[i].values[_scriptParser->getVar(_view.conditionalImages[i].var)], Common::Rect(0, 0, 544, 333));
+		else
+			warning("Conditional image %d variable %d: %d exceeds maximum state of %d", i, _view.conditionalImages[i].var, _scriptParser->getVar(_view.conditionalImages[i].var), _view.conditionalImages[i].numStates-1);
+	}
+} else if (_view.mainImage != 0)
+	_gfx->copyImageToScreen(_view.mainImage, Common::Rect(0, 0, 544, 333));
+}
+
 void MohawkEngine_Myst::changeToCard(uint16 card) {
 	debug(2, "changeToCard(%d)", card);
 
@@ -423,15 +435,7 @@
 	loadCursorHints();
 
 	// Handle images
-	if (_view.conditionalImageCount != 0) {
-		for (uint16 i = 0; i < _view.conditionalImageCount; i++) {
-			if (_scriptParser->getVar(_view.conditionalImages[i].var) < _view.conditionalImages[i].numStates)
-				_gfx->copyImageToScreen(_view.conditionalImages[i].values[_scriptParser->getVar(_view.conditionalImages[i].var)], Common::Rect(0, 0, 544, 333));
-			else
-				warning("Conditional image %d variable %d: %d exceeds maximum state of %d", i, _view.conditionalImages[i].var, _scriptParser->getVar(_view.conditionalImages[i].var), _view.conditionalImages[i].numStates-1);
-		}
-	} else if (_view.mainImage != 0)
-		_gfx->copyImageToScreen(_view.mainImage, Common::Rect(0, 0, 544, 333));
+	drawCardBackground();
 
 	// Handle sound
 	int16 soundAction = 0;
@@ -901,7 +905,7 @@
 
 void MohawkEngine_Myst::drawResourceImages() {
 	for (uint16 i = 0; i < _resources.size(); i++)
-		if (_resources[i]->isEnabled())
+		if (_resources[i]->isDrawSubimages())
 			_resources[i]->drawDataToScreen();
 
 	// Make sure the screen is updated

Modified: scummvm/trunk/engines/mohawk/myst.h
===================================================================
--- scummvm/trunk/engines/mohawk/myst.h	2010-11-29 20:56:21 UTC (rev 54619)
+++ scummvm/trunk/engines/mohawk/myst.h	2010-11-29 20:56:39 UTC (rev 54620)
@@ -199,6 +199,8 @@
 	void setResourceEnabled(uint16 resourceId, bool enable);
 	void redrawArea(uint16 var);
 	void redrawResource(MystResourceType8 *_resource);
+	void drawResourceImages();
+	void drawCardBackground();
 
 	void setCacheState(bool state) { _cache.enabled = state; }
 	bool getCacheState(void) { return _cache.enabled; }
@@ -234,7 +236,6 @@
 	void drawResourceRects();
 	void checkCurrentResource();
 	int16 _curResource;
-	void drawResourceImages();
 
 	uint16 _cursorHintCount;
 	MystCursorHint *_cursorHints;

Modified: scummvm/trunk/engines/mohawk/myst_areas.h
===================================================================
--- scummvm/trunk/engines/mohawk/myst_areas.h	2010-11-29 20:56:21 UTC (rev 54619)
+++ scummvm/trunk/engines/mohawk/myst_areas.h	2010-11-29 20:56:39 UTC (rev 54620)
@@ -45,6 +45,7 @@
 	virtual Common::Rect getRect() { return _rect; }
 	bool isEnabled();
 	void setEnabled(bool enabled);
+	bool isDrawSubimages() { return _flags & kMystSubimageEnableFlag; };
 	uint16 getDest() { return _dest; }
 	virtual uint16 getType8Var() { return 0xFFFF; }
 	bool unreachableZipDest();


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