Search
lxdream.org :: lxdream/src/pvr2/scene.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/scene.c
changeset 1155:f9aefb4613e5
prev1142:fd82bfba61c4
next1159:580436b01b6c
author nkeynes
date Tue Jan 18 17:48:48 2011 +1000 (9 years ago)
permissions -rw-r--r--
last change Clear polygon buffer map more efficiently
file annotate diff log raw
1.1 --- a/src/pvr2/scene.c Tue Oct 26 18:41:01 2010 +1000
1.2 +++ b/src/pvr2/scene.c Tue Jan 18 17:48:48 2011 +1000
1.3 @@ -28,6 +28,7 @@
1.4 #include "pvr2/scene.h"
1.5
1.6 #define U8TOFLOAT(n) (((float)((n)+1))/256.0)
1.7 +#define POLY_IDX(addr) ( ((uint32_t *)addr) - ((uint32_t *)pvr2_scene.pvr2_pbuf))
1.8
1.9 static void unpack_bgra(uint32_t bgra, float *rgba)
1.10 {
1.11 @@ -103,9 +104,12 @@
1.12 */
1.13 void pvr2_scene_reset()
1.14 {
1.15 + /* Faster to just clear the active entries */
1.16 + for( int i=0; i<pvr2_scene.poly_count; i++ ) {
1.17 + pvr2_scene.buf_to_poly_map[POLY_IDX(pvr2_scene.poly_array[i].context)] = 0;
1.18 + }
1.19 pvr2_scene.poly_count = 0;
1.20 pvr2_scene.vertex_count = 0;
1.21 - memset( pvr2_scene.buf_to_poly_map, 0, BUF_POLY_MAP_SIZE );
1.22 }
1.23
1.24 void pvr2_scene_shutdown()
.