Search
lxdream.org :: lxdream :: r655:31a4b664d489
lxdream 0.9.1
released Jun 29
Download Now
changeset655:31a4b664d489
parent654:d40b3b68fbdf
child656:031d23fa6d0b
authornkeynes
dateTue Apr 01 08:03:56 2008 +0000 (11 years ago)
Add support for mirrored textures
src/pvr2/glrender.c
src/pvr2/pvr2.h
1.1 --- a/src/pvr2/glrender.c Tue Apr 01 01:04:13 2008 +0000
1.2 +++ b/src/pvr2/glrender.c Tue Apr 01 08:03:56 2008 +0000
1.3 @@ -151,11 +151,15 @@
1.4 glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, pvr2_poly_texblend[POLY2_TEX_BLEND(poly2)] );
1.5 if( POLY2_TEX_CLAMP_U(poly2) ) {
1.6 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
1.7 + } else if( POLY2_TEX_MIRROR_U(poly2) ) {
1.8 + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT_ARB );
1.9 } else {
1.10 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
1.11 }
1.12 if( POLY2_TEX_CLAMP_V(poly2) ) {
1.13 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );
1.14 + } else if( POLY2_TEX_MIRROR_V(poly2) ) {
1.15 + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT_ARB );
1.16 } else {
1.17 glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
1.18 }
2.1 --- a/src/pvr2/pvr2.h Tue Apr 01 01:04:13 2008 +0000
2.2 +++ b/src/pvr2/pvr2.h Tue Apr 01 08:03:56 2008 +0000
2.3 @@ -352,6 +352,8 @@
2.4 #define POLY2_COLOUR_CLAMP_ENABLE(poly2) ((poly2)&0x00200000)
2.5 #define POLY2_ALPHA_ENABLE(poly2) ((poly2)&0x00100000)
2.6 #define POLY2_TEX_ALPHA_ENABLE(poly2) (((poly2)&0x00080000) == 0 )
2.7 +#define POLY2_TEX_MIRROR_U(poly2) ((poly2)&0x00040000)
2.8 +#define POLY2_TEX_MIRROR_V(poly2) ((poly2)&0x00020000)
2.9 #define POLY2_TEX_CLAMP_U(poly2) ((poly2)&0x00010000)
2.10 #define POLY2_TEX_CLAMP_V(poly2) ((poly2)&0x00008000)
2.11 #define POLY2_TEX_WIDTH(poly2) ( 1<< ((((poly2) >> 3) & 0x07 ) + 3) )
.