[Scummvm-cvs-logs] SF.net SVN: scummvm:[39042] residual/trunk/engine/tinygl

aquadran at users.sourceforge.net aquadran at users.sourceforge.net
Sun Mar 1 17:38:30 CET 2009


Revision: 39042
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39042&view=rev
Author:   aquadran
Date:     2009-03-01 16:38:30 +0000 (Sun, 01 Mar 2009)

Log Message:
-----------
this time it really fix :) and bonus it fixes another texture glitch

Modified Paths:
--------------
    residual/trunk/engine/tinygl/clip.cpp
    residual/trunk/engine/tinygl/ztriangle.cpp

Modified: residual/trunk/engine/tinygl/clip.cpp
===================================================================
--- residual/trunk/engine/tinygl/clip.cpp	2009-03-01 16:19:52 UTC (rev 39041)
+++ residual/trunk/engine/tinygl/clip.cpp	2009-03-01 16:38:30 UTC (rev 39042)
@@ -35,10 +35,9 @@
 	}
   
 	// texture
-
 	if (c->texture_2d_enabled) {
-		v->zp.s = (int)((double)v->tex_coord.X * (ZB_POINT_S_MAX - ZB_POINT_S_MIN) + ZB_POINT_S_MIN);
-		v->zp.t = (int)((double)v->tex_coord.Y * (ZB_POINT_T_MAX - ZB_POINT_T_MIN) + ZB_POINT_T_MIN);
+		v->zp.s = (int)(v->tex_coord.X * (ZB_POINT_S_MAX - ZB_POINT_S_MIN) + ZB_POINT_S_MIN);
+		v->zp.t = (int)(v->tex_coord.Y * (ZB_POINT_S_MAX - ZB_POINT_S_MIN) + ZB_POINT_S_MIN);
 	}
 }
 

Modified: residual/trunk/engine/tinygl/ztriangle.cpp
===================================================================
--- residual/trunk/engine/tinygl/ztriangle.cpp	2009-03-01 16:19:52 UTC (rev 39041)
+++ residual/trunk/engine/tinygl/ztriangle.cpp	2009-03-01 16:38:30 UTC (rev 39042)
@@ -367,7 +367,9 @@
 					for (int _a = 0; _a < 8; _a++) {
 						zz = z >> ZB_POINT_Z_FRAC_BITS;
 						if ((ZCMP(zz, pz[_a])) && (ZCMP(z, pz_2[_a]))) {
-							char *ptr = (char *)(texture) + (((((t & 0x3FC00000) | (s & 0x003FC000)) >> (17 - PSZSH)) >> 1) * 3);
+							unsigned ttt = (t & 0x003FC000) >> (9 - PSZSH);
+							unsigned sss = (s & 0x003FC000) >> (17 - PSZSH);
+							char *ptr = (char *)(texture) + (((ttt | sss) >> 1) * 3);
 							PIXEL pixel = *(PIXEL *)ptr;
 							char alpha = *(ptr + 2);
 							if (alpha == '\xff') {
@@ -415,7 +417,9 @@
 					{
 						zz = z >> ZB_POINT_Z_FRAC_BITS;
 						if ((ZCMP(zz, pz[0])) && (ZCMP(z, pz_2[0]))) {
-							char *ptr = (char *)(texture) + (((((t & 0x3FC00000) | (s & 0x003FC000)) >> (17 - PSZSH)) >> 1) * 3);
+							unsigned ttt = (t & 0x003FC000) >> (9 - PSZSH);
+							unsigned sss = (s & 0x003FC000) >> (17 - PSZSH);
+							char *ptr = (char *)(texture) + (((ttt | sss) >> 1) * 3);
 							PIXEL pixel = *(PIXEL *)ptr;
 							char alpha = *(ptr + 2);
 							if (alpha == '\xff') {


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