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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Sun Jul 25 18:37:36 CEST 2010


Revision: 51276
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51276&view=rev
Author:   m_kiewitz
Date:     2010-07-25 16:37:36 +0000 (Sun, 25 Jul 2010)

Log Message:
-----------
SCI: using coordadjuster in GfxView

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

Modified: scummvm/trunk/engines/sci/graphics/view.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/view.cpp	2010-07-25 16:31:46 UTC (rev 51275)
+++ scummvm/trunk/engines/sci/graphics/view.cpp	2010-07-25 16:37:36 UTC (rev 51276)
@@ -28,6 +28,7 @@
 #include "sci/engine/state.h"
 #include "sci/graphics/screen.h"
 #include "sci/graphics/palette.h"
+#include "sci/graphics/coordadjuster.h"
 #include "sci/graphics/view.h"
 
 namespace Sci {
@@ -35,6 +36,7 @@
 GfxView::GfxView(ResourceManager *resMan, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId)
 	: _resMan(resMan), _screen(screen), _palette(palette), _resourceId(resourceId) {
 	assert(resourceId != -1);
+	_coordAdjuster = g_sci->_gfxCoordAdjuster;
 	initData(resourceId);
 }
 
@@ -267,16 +269,9 @@
 			break;
 
 		case SCI_VERSION_2_1:
-			// half the width returned here, fixes lsl6 action icon placements
-			// the scripts work low-res and add the returned value from here to the coordinate
-			// TODO: check, if this is actually right. I'm slightly confused by this, but even GK1CD has some idivs in this
-			//  code, so it seems plausible.
-			if (_screen->getDisplayWidth() > 320) {
-				for (loopNo = 0; loopNo < _loopCount; loopNo++) {
-					for (celNo = 0; celNo < _loop[loopNo].celCount; celNo++) {
-						_loop[loopNo].cel[celNo].scriptWidth /= 2;
-						_loop[loopNo].cel[celNo].scriptHeight /= 2;
-					}
+			for (loopNo = 0; loopNo < _loopCount; loopNo++) {
+				for (celNo = 0; celNo < _loop[loopNo].celCount; celNo++) {
+					_coordAdjuster->fromDisplayToScript(_loop[loopNo].cel[celNo].scriptHeight, _loop[loopNo].cel[celNo].scriptWidth);
 				}
 			}
 		default:

Modified: scummvm/trunk/engines/sci/graphics/view.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/view.h	2010-07-25 16:31:46 UTC (rev 51275)
+++ scummvm/trunk/engines/sci/graphics/view.h	2010-07-25 16:37:36 UTC (rev 51276)
@@ -82,6 +82,7 @@
 	void unditherBitmap(byte *bitmap, int16 width, int16 height, byte clearKey);
 
 	ResourceManager *_resMan;
+	GfxCoordAdjuster *_coordAdjuster;
 	GfxScreen *_screen;
 	GfxPalette *_palette;
 


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