X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fio%2Fsg_binobj.cxx;h=5f7a34d27c8639f376e0247bdff32213fee27b02;hb=f18a9493b3a067ae56cb350cd6a390649ba6b35d;hp=faed1e68f067ce9bb8e6e5087c11548208c75e0b;hpb=aa859c488f21d0b1f8d54c657e23a738dcadacca;p=simgear.git diff --git a/simgear/io/sg_binobj.cxx b/simgear/io/sg_binobj.cxx index faed1e68..5f7a34d2 100644 --- a/simgear/io/sg_binobj.cxx +++ b/simgear/io/sg_binobj.cxx @@ -31,6 +31,8 @@ #include #include +#include +#include // for system() #include #include @@ -693,9 +695,7 @@ bool SGBinObject::write_bin( const string& base, const string& name, sgWriteUShort( fp, 1 ); // nelements sgWriteUInt( fp, sizeof(double) * 3 + sizeof(float) ); // nbytes - sgdVec3 center; - sgdSetVec3( center, gbs_center.x(), gbs_center.y(), gbs_center.z() ); - sgWritedVec3( fp, center ); + sgWritedVec3( fp, gbs_center ); sgWriteFloat( fp, gbs_radius ); // dump vertex list @@ -704,8 +704,7 @@ bool SGBinObject::write_bin( const string& base, const string& name, sgWriteUShort( fp, 1 ); // nelements sgWriteUInt( fp, wgs84_nodes.size() * sizeof(float) * 3 ); // nbytes for ( i = 0; i < (int)wgs84_nodes.size(); ++i ) { - SGVec3f p = toVec3f(wgs84_nodes[i] - gbs_center); - sgWriteVec3( fp, p.data() ); + sgWriteVec3( fp, toVec3f(wgs84_nodes[i] - gbs_center)); } // dump vertex color list @@ -714,7 +713,7 @@ bool SGBinObject::write_bin( const string& base, const string& name, sgWriteUShort( fp, 1 ); // nelements sgWriteUInt( fp, colors.size() * sizeof(float) * 4 ); // nbytes for ( i = 0; i < (int)colors.size(); ++i ) { - sgWriteVec4( fp, colors[i].data() ); + sgWriteVec4( fp, colors[i]); } // dump vertex normal list @@ -737,7 +736,7 @@ bool SGBinObject::write_bin( const string& base, const string& name, sgWriteUShort( fp, 1 ); // nelements sgWriteUInt( fp, texcoords.size() * sizeof(float) * 2 ); // nbytes for ( i = 0; i < (int)texcoords.size(); ++i ) { - sgWriteVec2( fp, texcoords[i].data() ); + sgWriteVec2( fp, texcoords[i]); } // dump point groups if they exist