goat3d

diff src/goat3d_writexml.cc @ 15:f1b4c27382ce

blah
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 26 Sep 2013 14:06:14 +0300
parents 188c697b3b49
children 1d85d7dd0038
line diff
     1.1 --- a/src/goat3d_writexml.cc	Thu Sep 26 04:47:05 2013 +0300
     1.2 +++ b/src/goat3d_writexml.cc	Thu Sep 26 14:06:14 2013 +0300
     1.3 @@ -49,7 +49,7 @@
     1.4  		xmlout(io, level + 2, "<name string=\"%s\"/>\n", mat->get_attrib_name(i));
     1.5  
     1.6  		const MaterialAttrib &attr = (*mat)[i];
     1.7 -		xmlout(io, level + 2, "<val float4=\"%.3f %.3f %.3f\"/>\n", attr.value.x,
     1.8 +		xmlout(io, level + 2, "<val float4=\"%.3f %.3f %.3f %.3f\"/>\n", attr.value.x,
     1.9  				attr.value.y, attr.value.z, attr.value.w);
    1.10  		if(!attr.map.empty()) {
    1.11  			xmlout(io, level + 2, "<map string=\"%s\"/>\n", attr.map.c_str());
    1.12 @@ -94,15 +94,7 @@
    1.13  
    1.14  	// texture coordinates
    1.15  	if(!mesh->texcoords.empty()) {
    1.16 -		CTMfloat *uvarray = new CTMfloat[vnum * 2 * sizeof *uvarray];
    1.17 -		CTMfloat *uvptr = uvarray;
    1.18 -
    1.19 -		for(int i=0; i<vnum; i++) {
    1.20 -			*uvptr++ = mesh->texcoords[i].x;
    1.21 -			*uvptr++ = mesh->texcoords[i].y;
    1.22 -		}
    1.23 -		ctmAddUVMap(ctm, uvarray, "texcoord", 0);
    1.24 -		delete [] uvarray;
    1.25 +		ctmAddUVMap(ctm, &mesh->texcoords[0].x, "texcoord", 0);
    1.26  	}
    1.27  
    1.28  	// vertex colors