goat3d
diff src/goat3d_writexml.cc @ 18:bdfc8dd14965
done with goatprim
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Fri, 27 Sep 2013 03:17:36 +0300 |
parents | 1d85d7dd0038 |
children | b35427826b60 |
line diff
1.1 --- a/src/goat3d_writexml.cc Fri Sep 27 02:29:52 2013 +0300 1.2 +++ b/src/goat3d_writexml.cc Fri Sep 27 03:17:36 2013 +0300 1.3 @@ -17,7 +17,8 @@ 1.4 1.5 // write environment stuff 1.6 xmlout(io, 1, "<env>\n"); 1.7 - xmlout(io, 1, "</env>\n"); 1.8 + xmlout(io, 2, "<ambient float3=\"%g %g %g\"/>\n", ambient.x, ambient.y, ambient.z); 1.9 + xmlout(io, 1, "</env>\n\n"); 1.10 1.11 for(size_t i=0; i<materials.size(); i++) { 1.12 write_material(this, io, materials[i], 1); 1.13 @@ -49,14 +50,14 @@ 1.14 xmlout(io, level + 2, "<name string=\"%s\"/>\n", mat->get_attrib_name(i)); 1.15 1.16 const MaterialAttrib &attr = (*mat)[i]; 1.17 - xmlout(io, level + 2, "<val float4=\"%.3f %.3f %.3f %.3f\"/>\n", attr.value.x, 1.18 + xmlout(io, level + 2, "<val float4=\"%g %g %g %g\"/>\n", attr.value.x, 1.19 attr.value.y, attr.value.z, attr.value.w); 1.20 if(!attr.map.empty()) { 1.21 xmlout(io, level + 2, "<map string=\"%s\"/>\n", attr.map.c_str()); 1.22 } 1.23 xmlout(io, level + 1, "</attr>\n"); 1.24 } 1.25 - xmlout(io, level, "</mtl>\n"); 1.26 + xmlout(io, level, "</mtl>\n\n"); 1.27 return true; 1.28 } 1.29 1.30 @@ -80,7 +81,7 @@ 1.31 xmlout(io, level + 1, "<material string=\"%s\"/>\n", mesh->material->name.c_str()); 1.32 } 1.33 xmlout(io, level + 1, "<file string=\"%s\"/>\n", mesh_filename); 1.34 - xmlout(io, level, "</mesh>\n"); 1.35 + xmlout(io, level, "</mesh>\n\n"); 1.36 return true; 1.37 } 1.38