[Scummvm-cvs-logs] scummvm master -> 57d586d5982220792e961d95b904427c2972d872

hkzlab hkzlabnet at gmail.com
Mon Jan 9 00:19:32 CET 2012


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:
57d586d598 SWORD2: Force fake transparency for PSX sprites


Commit: 57d586d5982220792e961d95b904427c2972d872
    https://github.com/scummvm/scummvm/commit/57d586d5982220792e961d95b904427c2972d872
Author: Fabio Battaglia (hkzlabnet at gmail.com)
Date: 2012-01-08T15:17:29-08:00

Commit Message:
SWORD2: Force fake transparency for PSX sprites

In PSX version blending is done through hardware transparency,
this would have to be simulated using 16-bit mode. As this is
not yet available in this engine, fake transparency is used
as a placeholder

Changed paths:
    engines/sword2/sprite.cpp



diff --git a/engines/sword2/sprite.cpp b/engines/sword2/sprite.cpp
index 73a4eca..cb0923c 100644
--- a/engines/sword2/sprite.cpp
+++ b/engines/sword2/sprite.cpp
@@ -772,14 +772,18 @@ int32 Screen::drawSprite(SpriteInfo *s) {
 	src = sprite + rs.top * srcPitch + rs.left;
 	dst = _buffer + _screenWide * rd.top + rd.left;
 
-	if (s->type & RDSPR_BLEND && !Sword2Engine::isPsx()) { // Blending is unavailable in PSX version
+	if (s->type & RDSPR_BLEND) { 
 		// The original code had two different blending cases. One for
 		// s->blend & 0x01 and one for s->blend & 0x02. However, the
 		// only values that actually appear in the cluster files are
 		// 0, 513 and 1025 so the s->blend & 0x02 case was never used.
 		// Which is just as well since that code made no sense to me.
 
-		if (!(_renderCaps & RDBLTFX_SPRITEBLEND)) {
+		// TODO: In PSX version, blending is done through hardware transparency.
+		// The only correct way to simulate this would be using 16-bit mode.
+		// As this is not yet available for this engine, fake transparency is used
+		// as placeholder.
+		if (!(_renderCaps & RDBLTFX_SPRITEBLEND) || Sword2Engine::isPsx()) { 
 			for (i = 0; i < rs.height(); i++) {
 				for (j = 0; j < rs.width(); j++) {
 					if (src[j] && ((i & 1) == (j & 1)))






More information about the Scummvm-git-logs mailing list