[Scummvm-cvs-logs] SF.net SVN: scummvm:[47415] scummvm/trunk/backends/platform/n64/ osys_n64_base.cpp

Hkz at users.sourceforge.net Hkz at users.sourceforge.net
Thu Jan 21 10:01:00 CET 2010


Revision: 47415
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47415&view=rev
Author:   Hkz
Date:     2010-01-21 09:01:00 +0000 (Thu, 21 Jan 2010)

Log Message:
-----------
N64: optimizations to cursor handling code

Modified Paths:
--------------
    scummvm/trunk/backends/platform/n64/osys_n64_base.cpp

Modified: scummvm/trunk/backends/platform/n64/osys_n64_base.cpp
===================================================================
--- scummvm/trunk/backends/platform/n64/osys_n64_base.cpp	2010-01-21 08:26:40 UTC (rev 47414)
+++ scummvm/trunk/backends/platform/n64/osys_n64_base.cpp	2010-01-21 09:01:00 UTC (rev 47415)
@@ -385,7 +385,10 @@
 
 	for (height = 0; height < _cursorHeight; height++) {
 		for (width = 0; width < _cursorWidth; width++) {
-			_cursor_hic[(_cursorWidth * height) + width] = _pal_src[_cursor_pal[(_cursorWidth * height) + width]];
+			uint8 pix = _cursor_pal[(_cursorWidth * height) + width];
+
+			// Enable alpha bit in cursor buffer if pixel should be invisible
+			_cursor_hic[(_cursorWidth * height) + width] = (pix != _cursorKeycolor) ? _pal_src[pix] : 0x0001;
 		}
 	}
 }
@@ -568,9 +571,8 @@
 				// Draw pixel
 				if (((mY + h) >= 0) && ((mY + h) < _mouseMaxY) && ((mX + w) >= 0) && ((mX + w) < _mouseMaxX)) {
 					uint16 cursor_pixel_hic = _cursor_hic[(h * _cursorWidth) + w];
-					uint8 cursor_pixel_pal = _cursor_pal[(h * _cursorWidth) + w];
 
-					if (cursor_pixel_pal != _cursorKeycolor)
+					if (!(cursor_pixel_hic & 0x00001))
 						mouse_framebuffer[((mY + h) * _frameBufferWidth) + ((mX + w) + _offscrPixels + horiz_pix_skip)] = cursor_pixel_hic;
 				}
 			}


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