Search
lxdream.org :: lxdream :: r1139:9af81878480b
lxdream 0.9.1
released Jun 29
Download Now
changeset1139:9af81878480b
parent1138:3bcb705a7ebc
child1140:7dc1c71ece76
authornkeynes
dateSun Oct 24 15:22:59 2010 +1000 (9 years ago)
Eliminate GL_REPLACE tex mode in favour of GL_MODULATE (by setting colour
values to 1.0) - one less case for shaders to care about later
src/pvr2/glrender.c
src/pvr2/scene.c
1.1 --- a/src/pvr2/glrender.c Sun Oct 24 15:15:27 2010 +1000
1.2 +++ b/src/pvr2/glrender.c Sun Oct 24 15:22:59 2010 +1000
1.3 @@ -147,7 +147,10 @@
1.4 {
1.5 glShadeModel( POLY1_SHADE_MODEL(poly1) );
1.6 if( POLY1_TEXTURED(poly1) ) {
1.7 - glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, pvr2_poly_texblend[POLY2_TEX_BLEND(poly2)] );
1.8 + if( POLY2_TEX_BLEND(poly2) == 2 )
1.9 + glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL );
1.10 + else
1.11 + glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
1.12 }
1.13
1.14 switch( POLY2_FOG_MODE(poly2) ) {
2.1 --- a/src/pvr2/scene.c Sun Oct 24 15:15:27 2010 +1000
2.2 +++ b/src/pvr2/scene.c Sun Oct 24 15:22:59 2010 +1000
2.3 @@ -275,11 +275,23 @@
2.4 vert->u = *data.fval++;
2.5 vert->v = *data.fval++;
2.6 }
2.7 - if( POLY2_TEX_BLEND(poly2) == 1 ) {
2.8 +
2.9 + switch( POLY2_TEX_BLEND(poly2) ) {
2.10 + case 0:/* Convert replace => modulate by setting colour values to 1.0 */
2.11 + vert->rgba[0] = vert->rgba[1] = vert->rgba[2] = vert->rgba[3] = 1.0;
2.12 + data.ival++; /* Skip the colour word */
2.13 + break;
2.14 + case 1:
2.15 force_alpha = TRUE;
2.16 + /* fall-through */
2.17 + default: /* Can't handle decal this way */
2.18 + unpack_bgra(*data.ival++, vert->rgba);
2.19 + break;
2.20 }
2.21 + } else {
2.22 + unpack_bgra(*data.ival++, vert->rgba);
2.23 }
2.24 - unpack_bgra(*data.ival++, vert->rgba);
2.25 +
2.26 if( POLY1_SPECULAR(poly1) ) {
2.27 unpack_bgra(*data.ival++, vert->offset_rgba);
2.28 } else {
.