[Scummvm-cvs-logs] SF.net SVN: scummvm: [25119] scummvm/trunk/engines/scumm/gfx.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Jan 18 22:48:23 CET 2007


Revision: 25119
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25119&view=rev
Author:   fingolfin
Date:     2007-01-18 13:48:23 -0800 (Thu, 18 Jan 2007)

Log Message:
-----------
Make use of Surface::getBasePtr

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/gfx.cpp

Modified: scummvm/trunk/engines/scumm/gfx.cpp
===================================================================
--- scummvm/trunk/engines/scumm/gfx.cpp	2007-01-18 21:36:44 UTC (rev 25118)
+++ scummvm/trunk/engines/scumm/gfx.cpp	2007-01-18 21:48:23 UTC (rev 25119)
@@ -570,7 +570,7 @@
 
 	if (_game.version < 7) {
 		// Handle the text mask in older games; newer (V7/V8) games do not use it anymore.
-		const byte *text = (byte *)_charset->_textSurface.pixels + x + y * _charset->_textSurface.pitch;
+		const byte *text = (byte *)_charset->_textSurface.getBasePtr(x, y);
 	
 #ifdef __DS__
 		DS::asmDrawStripToScreen(height, width, text, src, dst, vs->pitch, _screenWidth, _charset->_textSurface.pitch);
@@ -904,7 +904,7 @@
 	if (vs->hasTwoBuffers && _currentRoom != 0 && isLightOn()) {
 		blit(screenBuf, vs->pitch, vs->getBackPixels(rect.left, rect.top), vs->pitch, width, height);
 		if (vs->number == kMainVirtScreen && _charset->_hasMask) {
-			byte *mask = (byte *)_charset->_textSurface.pixels + _charset->_textSurface.pitch * (rect.top - _screenTop) + rect.left;
+			byte *mask = (byte *)_charset->_textSurface.getBasePtr(rect.left, rect.top - _screenTop);
 			fill(mask, _charset->_textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width, height);
 		}
 	} else {
@@ -1098,7 +1098,7 @@
 			error("can only copy bg to main window");
 		blit(backbuff, vs->pitch, bgbuff, vs->pitch, width, height);
 		if (_charset->_hasMask) {
-			byte *mask = (byte *)_charset->_textSurface.pixels + _charset->_textSurface.pitch * (y - _screenTop) + x;
+			byte *mask = (byte *)_charset->_textSurface.getBasePtr(x, y - _screenTop);
 			fill(mask, _charset->_textSurface.pitch, CHARSET_MASK_TRANSPARENCY, width, height);
 		}
 	} else if (_game.heversion == 100) {


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