]> git.mxchange.org Git - simgear.git/blobdiff - simgear/io/sg_binobj.cxx
Unit test for SGBinObj, and fix a bug in large-indice handling the test revealed.
[simgear.git] / simgear / io / sg_binobj.cxx
index e01a52865f0f71188ab13dfde738e6eb7c858c0b..54f3b8debf5c3d7ec00f13b93f6e14b5b7f3874b 100644 (file)
@@ -752,7 +752,9 @@ bool SGBinObject::write_bin_file(const SGPath& file)
     cout << "tex coords = " << texcoords.size() << endl;
 
     version = 10;
-    if (wgs84_nodes.size() < 0xffff) {
+    if ((wgs84_nodes.size() < 0xffff) &&
+        (normals.size() < 0xffff) &&
+        (texcoords.size() < 0xffff)) {
         version = 7; // use smaller indices if possible
     }