Search
lxdream.org :: lxdream/src/pvr2/rendcore.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/rendcore.c
changeset 308:10a5b5475fb0
prev298:44d94dd0e8aa
next318:363935d31859
author nkeynes
date Sun Jan 21 11:28:43 2007 +0000 (14 years ago)
permissions -rw-r--r--
last change Enable blend by default - remove toggle on tex-alpha bit as its just plain
wrong
Implement UV clamping
file annotate diff log raw
1.1 --- a/src/pvr2/rendcore.c Wed Jan 17 09:21:09 2007 +0000
1.2 +++ b/src/pvr2/rendcore.c Sun Jan 21 11:28:43 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: rendcore.c,v 1.9 2007-01-17 09:21:09 nkeynes Exp $
1.6 + * $Id: rendcore.c,v 1.10 2007-01-21 11:28:43 nkeynes Exp $
1.7 *
1.8 * PVR2 renderer core.
1.9 *
1.10 @@ -72,10 +72,11 @@
1.11 float f;
1.12 uint32_t i;
1.13 } temp;
1.14 - int e = ((half & 0x7C00) >> 10) - 15 + 127;
1.15 + /* int e = ((half & 0x7C00) >> 10) - 15 + 127;
1.16
1.17 temp.i = ((half & 0x8000) << 16) | (e << 23) |
1.18 - ((half & 0x03FF) << 13);
1.19 + ((half & 0x03FF) << 13); */
1.20 + temp.i = ((uint32_t)half)<<16;
1.21 return temp.f;
1.22 }
1.23
1.24 @@ -125,6 +126,16 @@
1.25 glEnable(GL_TEXTURE_2D);
1.26 texcache_get_texture( (texture&0x000FFFFF)<<3, width, height, texture );
1.27 glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, POLY2_TEX_BLEND(poly2) );
1.28 + if( POLY2_TEX_CLAMP_U(poly2) ) {
1.29 + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
1.30 + } else {
1.31 + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
1.32 + }
1.33 + if( POLY2_TEX_CLAMP_V(poly2) ) {
1.34 + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );
1.35 + } else {
1.36 + glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
1.37 + }
1.38 } else {
1.39 glDisable( GL_TEXTURE_2D );
1.40 }
1.41 @@ -134,11 +145,6 @@
1.42 int srcblend = POLY2_SRC_BLEND(poly2);
1.43 int destblend = POLY2_DEST_BLEND(poly2);
1.44 glBlendFunc( srcblend, destblend );
1.45 - if( POLY2_TEX_ALPHA_ENABLE(poly2) ) {
1.46 - glEnable(GL_BLEND);
1.47 - } else {
1.48 - glDisable(GL_BLEND);
1.49 - }
1.50 }
1.51
1.52 void render_vertexes( uint32_t poly1, uint32_t *vertexes, int num_vertexes, int vertex_size,
1.53 @@ -199,7 +205,7 @@
1.54 vertex_length *= 2 ;
1.55 }
1.56 vertex_length += 3;
1.57 -
1.58 +
1.59 if( (entry & 0xE0000000) == 0x80000000 ) {
1.60 /* Triangle(s) */
1.61 int strip_count = ((entry >> 25) & 0x0F)+1;
.