Search
lxdream.org :: lxdream/src/pvr2/rendcore.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/rendcore.c
changeset 429:e581b90c3fb3
prev352:f0df7a6d4703
next477:9a373f2ff009
author nkeynes
date Mon Oct 08 11:52:13 2007 +0000 (14 years ago)
permissions -rw-r--r--
last change Fix compilation warnings
file annotate diff log raw
1.1 --- a/src/pvr2/rendcore.c Sun Feb 11 10:09:32 2007 +0000
1.2 +++ b/src/pvr2/rendcore.c Mon Oct 08 11:52:13 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: rendcore.c,v 1.19 2007-02-11 10:09:32 nkeynes Exp $
1.6 + * $Id: rendcore.c,v 1.20 2007-10-08 11:52:13 nkeynes Exp $
1.7 *
1.8 * PVR2 renderer core.
1.9 *
1.10 @@ -19,6 +19,10 @@
1.11 #include "pvr2/pvr2.h"
1.12 #include "asic.h"
1.13
1.14 +#define GL_GLEXT_PROTOTYPES 1
1.15 +#include <GL/gl.h>
1.16 +#include <GL/glext.h>
1.17 +
1.18 int pvr2_poly_depthmode[8] = { GL_NEVER, GL_LESS, GL_EQUAL, GL_LEQUAL,
1.19 GL_GREATER, GL_NOTEQUAL, GL_GEQUAL,
1.20 GL_ALWAYS };
1.21 @@ -228,10 +232,10 @@
1.22 out[i].rgba[3] = FARGB_A(argb);
1.23 if( POLY1_SPECULAR(poly1) ) {
1.24 uint32_t offset = vertexes[k++];
1.25 - out[i].offset_rgba[0] = FARGB_R(argb);
1.26 - out[i].offset_rgba[1] = FARGB_G(argb);
1.27 - out[i].offset_rgba[2] = FARGB_B(argb);
1.28 - out[i].offset_rgba[3] = FARGB_A(argb);
1.29 + out[i].offset_rgba[0] = FARGB_R(offset);
1.30 + out[i].offset_rgba[1] = FARGB_G(offset);
1.31 + out[i].offset_rgba[2] = FARGB_B(offset);
1.32 + out[i].offset_rgba[3] = FARGB_A(offset);
1.33 }
1.34 vertexes += vertex_size;
1.35 }
1.36 @@ -564,7 +568,6 @@
1.37 tile_list = (uint32_t *)(video_base + (entry&0x007FFFFF));
1.38 } else {
1.39 uint32_t *polygon = (uint32_t *)(video_base + poly_bank + ((entry & 0x000FFFFF) << 2));
1.40 - int is_modified = entry & 0x01000000;
1.41 int vertex_length = (entry >> 21) & 0x07;
1.42 int context_length = 3;
1.43 if( (entry & 0x01000000) && (shadow_cfg==0) ) {
1.44 @@ -588,7 +591,6 @@
1.45 } else if( (entry & 0xE0000000) == 0xA0000000 ) {
1.46 /* Sprite(s) */
1.47 int strip_count = ((entry >> 25) & 0x0F)+1;
1.48 - int polygon_length = 4 * vertex_length + context_length;
1.49 int i;
1.50 float *vertexz = (float *)(polygon+context_length+2);
1.51 for( i=0; i<strip_count; i++ ) {
1.52 @@ -602,7 +604,7 @@
1.53 }
1.54 } else {
1.55 /* Polygon */
1.56 - int i, first=-1, last = -1;
1.57 + int i;
1.58 float *vertexz = (float *)polygon+context_length+2;
1.59 for( i=0; i<6; i++ ) {
1.60 if( (entry & (0x40000000>>i)) && *vertexz > z ) {
1.61 @@ -679,7 +681,7 @@
1.62 int num_vertexes, int vertex_size )
1.63 {
1.64 char buf[256], *p;
1.65 - int i,j, k;
1.66 + int i, k;
1.67 for( i=0; i<num_vertexes; i++ ) {
1.68 p = buf;
1.69 float *vertf = (float *)vert_array[i];
1.70 @@ -711,7 +713,7 @@
1.71 {
1.72 uint32_t poly_bank = MMIO_READ(PVR2,RENDER_POLYBASE);
1.73 int shadow_cfg = MMIO_READ( PVR2, RENDER_SHADOW ) & 0x100;
1.74 - int i, j;
1.75 + int i;
1.76
1.77 if( entry >> 28 == 0x0F ) {
1.78 fprintf( f, "EOT\n" );
1.79 @@ -719,7 +721,6 @@
1.80 fprintf( f, "LINK %08X\n", entry &0x7FFFFF );
1.81 } else {
1.82 uint32_t *polygon = (uint32_t *)(video_base + poly_bank + ((entry & 0x000FFFFF) << 2));
1.83 - int is_modified = entry & 0x01000000;
1.84 int vertex_length = (entry >> 21) & 0x07;
1.85 int context_length = 3;
1.86 if( (entry & 0x01000000) && (shadow_cfg==0) ) {
1.87 @@ -755,7 +756,6 @@
1.88 } else {
1.89 /* Polygon */
1.90 int last = -1;
1.91 - float *vertexz = (float *)polygon+context_length+2;
1.92 uint32_t *array[8];
1.93 for( i=0; i<6; i++ ) {
1.94 if( entry & (0x40000000>>i) ) {
.