gba-trycatch

diff src/mesh.c @ 15:b755fb002f17

foo
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 25 Jun 2014 17:02:48 +0300
parents 2070a81127f2
children
line diff
     1.1 --- a/src/mesh.c	Mon Jun 23 10:33:24 2014 +0300
     1.2 +++ b/src/mesh.c	Wed Jun 25 17:02:48 2014 +0300
     1.3 @@ -7,6 +7,7 @@
     1.4  	m->prim = X3D_TRIANGLES;
     1.5  	m->verts = 0;
     1.6  	m->colors = 0;
     1.7 +	m->texcoords = 0;
     1.8  	m->nverts = 0;
     1.9  }
    1.10  
    1.11 @@ -14,6 +15,7 @@
    1.12  {
    1.13  	free(m->verts);
    1.14  	free(m->colors);
    1.15 +	free(m->texcoords);
    1.16  }
    1.17  
    1.18  void draw_mesh(struct mesh *m)
    1.19 @@ -22,9 +24,13 @@
    1.20  	if(m->colors) {
    1.21  		x3d_color_array(m->nverts, m->colors);
    1.22  	}
    1.23 +	if(m->texcoords) {
    1.24 +		x3d_texcoord_array(m->nverts, m->texcoords);
    1.25 +	}
    1.26  
    1.27  	x3d_draw(m->prim, m->nverts);
    1.28  
    1.29  	x3d_vertex_array(0, 0);
    1.30  	x3d_color_array(0, 0);
    1.31 +	x3d_texcoord_array(0, 0);
    1.32  }