[Scummvm-cvs-logs] scummvm master -> 185337f6a5afc72deec54e11d3ff70d76463d9bf

bluddy yotambarnoy at gmail.com
Mon May 2 14:47:17 CEST 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
185337f6a5 PSP: fixed cursor disappearance bug in 16-bit games


Commit: 185337f6a5afc72deec54e11d3ff70d76463d9bf
    https://github.com/scummvm/scummvm/commit/185337f6a5afc72deec54e11d3ff70d76463d9bf
Author: Bluddy (yotambarnoy at gmail.com)
Date: 2011-05-02T05:48:06-07:00

Commit Message:
PSP: fixed cursor disappearance bug in 16-bit games

The 5650 16-bit format doesn't include alpha bits and is treated as having alpha by the PSP hardware. Other formats such as 5551 don't have their alpha bit set in the cursor buffer. Instead of adding it, we just turn on the 'reverse alpha' feature for these bits. The problem was not making an exception for 5650.

Changed paths:
    backends/platform/psp/cursor.cpp



diff --git a/backends/platform/psp/cursor.cpp b/backends/platform/psp/cursor.cpp
index cf879e0..420b039 100644
--- a/backends/platform/psp/cursor.cpp
+++ b/backends/platform/psp/cursor.cpp
@@ -327,8 +327,20 @@ inline void Cursor::setRendererModePalettized(bool palettized) {
 		_renderer.setAlphaReverse(false);
 		_renderer.setColorTest(false);
 	} else {			// 16 bits, no palette
+		// Color test is an easy way for the hardware to make our keycolor 
+		// transparent.
+		_renderer.setColorTest(true);	
+		
+		// Alpha blending is not strictly required, but makes the cursor look
+		// much better
 		_renderer.setAlphaBlending(true);
-		_renderer.setAlphaReverse(true); // We can't change all alpha values, so just reverse
-		_renderer.setColorTest(true);	// Color test to make our key color transparent
+		
+		// Pixel formats without alpha (5650) are considered to have their alpha set.
+		// Since pixel formats with alpha don't have their alpha bits set, we reverse
+		// the alpha format for them so that 0 alpha is 1.
+		if (_buffer.getPixelFormat() != PSPPixelFormat::Type_5650) 
+			_renderer.setAlphaReverse(true);
+		else
+			_renderer.setAlphaReverse(false);
 	}
 }






More information about the Scummvm-git-logs mailing list