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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Oct 31 13:19:35 CET 2009


Revision: 45557
          http://scummvm.svn.sourceforge.net/scummvm/?rev=45557&view=rev
Author:   thebluegr
Date:     2009-10-31 12:19:35 +0000 (Sat, 31 Oct 2009)

Log Message:
-----------
Properly fixed putPixel() for scaled screens

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gui/gui_screen.cpp
    scummvm/trunk/engines/sci/gui/gui_screen.h

Modified: scummvm/trunk/engines/sci/gui/gui_screen.cpp
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_screen.cpp	2009-10-31 12:17:38 UTC (rev 45556)
+++ scummvm/trunk/engines/sci/gui/gui_screen.cpp	2009-10-31 12:19:35 UTC (rev 45557)
@@ -117,17 +117,18 @@
 
 void SciGuiScreen::putPixel(int x, int y, byte drawMask, byte color, byte priority, byte control) {
 	int offset = y * _width + x;
-	int displayOffset = y * _displayWidth * _scaleFactor + x * _scaleFactor;
 
 	if (drawMask & SCI_SCREEN_MASK_VISUAL) {
 		_visualScreen[offset] = color;
-		_displayScreen[displayOffset] = color;
 
-		// If we need to scale, update the display screen appropriately
-		if (_scaleFactor != 1)
-			_displayScreen[(y + 1) * _displayWidth + x] = color;		// one pixel down
-			_displayScreen[y * _displayWidth + x + 1] = color;			// one pixel right
-			_displayScreen[(y + 1) * _displayWidth + x + 1] = color;	// one pixel down and right
+		if (_scaleFactor == 1) {
+			_displayScreen[offset] = color;
+		} else {
+			_displayScreen[y * _displayWidth * 2 + x * 2] = color;				// the actual pixel
+			_displayScreen[(y + 1) * _displayWidth * 2 + x * 2] = color;		// one pixel down
+			_displayScreen[y * _displayWidth * 2 + (x * 2) + 1] = color;		// one pixel right
+			_displayScreen[(y + 1) * _displayWidth * 2 + (x * 2) + 1] = color;	// one pixel down and right
+		}
 	}
 	if (drawMask & SCI_SCREEN_MASK_PRIORITY)
 		_priorityScreen[offset] = priority;

Modified: scummvm/trunk/engines/sci/gui/gui_screen.h
===================================================================
--- scummvm/trunk/engines/sci/gui/gui_screen.h	2009-10-31 12:17:38 UTC (rev 45556)
+++ scummvm/trunk/engines/sci/gui/gui_screen.h	2009-10-31 12:19:35 UTC (rev 45557)
@@ -76,6 +76,8 @@
 
 	void debugShowMap(int mapNo);
 
+	int getScaleFactor() { return _scaleFactor; }
+
 	uint16 _width;
 	uint16 _height;
 	uint _pixels;


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