1.1 --- a/src/pvr2/render.c Tue Jan 01 05:08:38 2008 +0000
1.2 +++ b/src/pvr2/render.c Thu Feb 14 14:06:41 2008 +0000
1.5 #include <sys/time.h>
1.8 #include "pvr2/pvr2.h"
1.12 * Prepare the OpenGL context to receive instructions for a new frame.
1.14 static void pvr2_render_prepare_context( render_buffer_t buffer,
1.15 - float bgplanez, float nearz )
1.16 + float nearz, float farz )
1.18 /* Select and initialize the render context */
1.19 display_driver->set_render_target(buffer);
1.21 glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
1.22 glMatrixMode(GL_PROJECTION);
1.24 - glOrtho( 0, buffer->width, buffer->height, 0, -bgplanez, -nearz );
1.25 + glOrtho( 0, buffer->width, buffer->height, 0, -nearz, -farz );
1.26 glMatrixMode(GL_MODELVIEW);
1.28 glCullFace( GL_BACK );
1.29 @@ -121,8 +122,10 @@
1.31 gettimeofday(&tva, NULL);
1.33 - float bgplanez = 1/MMIO_READF( PVR2, RENDER_FARCLIP );
1.34 - pvr2_render_prepare_context( buffer, bgplanez, 0 );
1.35 + float farz, nearz;
1.36 + pvr2_render_find_z_range( &nearz, &farz );
1.37 + float bgplanez = MMIO_READF( PVR2, RENDER_FARCLIP );
1.38 + pvr2_render_prepare_context( buffer, nearz, farz );
1.40 int clip_x = MMIO_READ( PVR2, RENDER_HCLIP ) & 0x03FF;
1.41 int clip_y = MMIO_READ( PVR2, RENDER_VCLIP ) & 0x03FF;