@@ -176,7 +176,7 @@ std::tuple<fg::Error, fg::DataSource, fg::DataLocation> fg::glTF::decodeUri(std:
176
176
DataSource source = {};
177
177
source.mimeType = getMimeTypeFromString (uri.substr (5 , index - 5 ));
178
178
source.bytes = std::move (uriData);
179
- return std::make_tuple (Error::None, source, DataLocation::VectorWithMime);
179
+ return std::make_tuple (Error::None, std::move ( source) , DataLocation::VectorWithMime);
180
180
} else {
181
181
DataSource source = {};
182
182
source.path = directory / uri;
@@ -586,7 +586,7 @@ fg::Error fg::glTF::parse(Category categories) {
586
586
587
587
void fg::glTF::parseAccessors (simdjson::ondemand::array accessors) {
588
588
using namespace simdjson ;
589
- // parsedAsset->accessors.reserve(accessors.count_elements());
589
+ parsedAsset->accessors .reserve (accessors.count_elements ());
590
590
591
591
for (auto accessorValue : accessors) {
592
592
// Required fields: "componentType", "count"
@@ -649,7 +649,7 @@ void fg::glTF::parseAccessors(simdjson::ondemand::array accessors) {
649
649
650
650
void fg::glTF::parseAnimations (simdjson::ondemand::array animations) {
651
651
using namespace simdjson ;
652
- // parsedAsset->animations.reserve(animations.count_elements());
652
+ parsedAsset->animations .reserve (animations.count_elements ());
653
653
654
654
for (auto animationValue : animations) {
655
655
ondemand::object animationObject;
@@ -664,7 +664,7 @@ void fg::glTF::parseAnimations(simdjson::ondemand::array animations) {
664
664
RETURN_SET_ERROR (Error::InvalidGltf)
665
665
}
666
666
667
- // animation.channels.reserve(channels.count_elements());
667
+ animation.channels .reserve (channels.count_elements ());
668
668
for (auto channelValue : channels) {
669
669
ondemand::object channelObject;
670
670
AnimationChannel channel = {};
@@ -714,7 +714,7 @@ void fg::glTF::parseAnimations(simdjson::ondemand::array animations) {
714
714
RETURN_SET_ERROR (Error::InvalidGltf)
715
715
}
716
716
717
- // animation.samplers.reserve(samplers.count_elements());
717
+ animation.samplers .reserve (samplers.count_elements ());
718
718
for (auto samplerValue : samplers) {
719
719
ondemand::object samplerObject;
720
720
AnimationSampler sampler = {};
@@ -766,7 +766,7 @@ void fg::glTF::parseAnimations(simdjson::ondemand::array animations) {
766
766
767
767
void fg::glTF::parseBuffers (simdjson::ondemand::array buffers) {
768
768
using namespace simdjson ;
769
- // parsedAsset->buffers.reserve(buffers.count_elements());
769
+ parsedAsset->buffers .reserve (buffers.count_elements ());
770
770
771
771
size_t bufferIndex = 0 ;
772
772
for (auto bufferValue : buffers) {
@@ -793,7 +793,7 @@ void fg::glTF::parseBuffers(simdjson::ondemand::array buffers) {
793
793
RETURN_SET_ERROR (Error::InvalidGltf)
794
794
}
795
795
796
- buffer.data = source;
796
+ buffer.data = std::move ( source) ;
797
797
buffer.location = location;
798
798
} else if (bufferIndex == 0 && glb != nullptr ) {
799
799
if (hasBit (options, Options::LoadGLBBuffers)) {
@@ -829,7 +829,7 @@ void fg::glTF::parseBuffers(simdjson::ondemand::array buffers) {
829
829
830
830
void fg::glTF::parseBufferViews (simdjson::ondemand::array bufferViews) {
831
831
using namespace simdjson ;
832
- // parsedAsset->bufferViews.reserve(bufferViews.count_elements());
832
+ parsedAsset->bufferViews .reserve (bufferViews.count_elements ());
833
833
834
834
for (auto bufferViewValue : bufferViews) {
835
835
// Required fields: "bufferIndex", "byteLength"
@@ -885,7 +885,7 @@ void fg::glTF::parseBufferViews(simdjson::ondemand::array bufferViews) {
885
885
886
886
void fg::glTF::parseCameras (simdjson::ondemand::array cameras) {
887
887
using namespace simdjson ;
888
- // parsedAsset->cameras.reserve(cameras.count_elements());
888
+ parsedAsset->cameras .reserve (cameras.count_elements ());
889
889
890
890
for (auto cameraValue : cameras) {
891
891
Camera camera = {};
@@ -975,7 +975,7 @@ void fg::glTF::parseCameras(simdjson::ondemand::array cameras) {
975
975
976
976
void fg::glTF::parseImages (simdjson::ondemand::array images) {
977
977
using namespace simdjson ;
978
- // parsedAsset->images.reserve(images.count_elements());
978
+ parsedAsset->images .reserve (images.count_elements ());
979
979
980
980
for (auto imageValue : images) {
981
981
Image image = {};
@@ -1033,7 +1033,7 @@ void fg::glTF::parseImages(simdjson::ondemand::array images) {
1033
1033
1034
1034
void fg::glTF::parseMaterials (simdjson::ondemand::array materials) {
1035
1035
using namespace simdjson ;
1036
- // parsedAsset->materials.reserve(materials.count_elements());
1036
+ parsedAsset->materials .reserve (materials.count_elements ());
1037
1037
1038
1038
for (auto materialValue : materials) {
1039
1039
ondemand::object materialObject;
@@ -1180,7 +1180,7 @@ void fg::glTF::parseMaterials(simdjson::ondemand::array materials) {
1180
1180
1181
1181
void fg::glTF::parseMeshes (simdjson::ondemand::array meshes) {
1182
1182
using namespace simdjson ;
1183
- // parsedAsset->meshes.reserve(meshes.count_elements());
1183
+ parsedAsset->meshes .reserve (meshes.count_elements ());
1184
1184
1185
1185
for (auto meshValue : meshes) {
1186
1186
// Required fields: "primitives"
@@ -1197,7 +1197,7 @@ void fg::glTF::parseMeshes(simdjson::ondemand::array meshes) {
1197
1197
} else if (meshError != Error::None) {
1198
1198
RETURN_SET_ERROR (meshError)
1199
1199
} else {
1200
- // mesh.primitives.reserve(primitives.count_elements());
1200
+ mesh.primitives .reserve (primitives.count_elements ());
1201
1201
for (auto primitiveValue : primitives) {
1202
1202
// Required fields: "attributes"
1203
1203
Primitive primitive = {};
@@ -1264,7 +1264,7 @@ void fg::glTF::parseMeshes(simdjson::ondemand::array meshes) {
1264
1264
1265
1265
void fg::glTF::parseNodes (simdjson::ondemand::array nodes) {
1266
1266
using namespace simdjson ;
1267
- // parsedAsset->nodes.reserve(nodes.count_elements());
1267
+ parsedAsset->nodes .reserve (nodes.count_elements ());
1268
1268
1269
1269
for (auto nodeValue : nodes) {
1270
1270
Node node = {};
@@ -1288,7 +1288,7 @@ void fg::glTF::parseNodes(simdjson::ondemand::array nodes) {
1288
1288
ondemand::array children;
1289
1289
auto childError = getJsonArray (nodeObject, " children" , &children);
1290
1290
if (childError == Error::None) {
1291
- // node.children.reserve(children.count_elements());
1291
+ node.children .reserve (children.count_elements ());
1292
1292
for (auto childValue : children) {
1293
1293
if (childValue.get_uint64 ().get (index) != SUCCESS) {
1294
1294
RETURN_SET_ERROR (Error::InvalidGltf)
@@ -1382,7 +1382,7 @@ void fg::glTF::parseNodes(simdjson::ondemand::array nodes) {
1382
1382
void fg::glTF::parseSamplers (simdjson::ondemand::array samplers) {
1383
1383
using namespace simdjson ;
1384
1384
uint64_t number;
1385
- // parsedAsset->samplers.reserve(samplers.count_elements());
1385
+ parsedAsset->samplers .reserve (samplers.count_elements ());
1386
1386
1387
1387
for (auto samplerValue : samplers) {
1388
1388
Sampler sampler = {};
@@ -1422,7 +1422,7 @@ void fg::glTF::parseSamplers(simdjson::ondemand::array samplers) {
1422
1422
void fg::glTF::parseScenes (simdjson::ondemand::array scenes) {
1423
1423
using namespace simdjson ;
1424
1424
1425
- // parsedAsset->scenes.reserve(scenes.count_elements());
1425
+ parsedAsset->scenes .reserve (scenes.count_elements ());
1426
1426
for (auto sceneValue : scenes) {
1427
1427
// The scene object can be completely empty
1428
1428
Scene scene = {};
@@ -1441,7 +1441,7 @@ void fg::glTF::parseScenes(simdjson::ondemand::array scenes) {
1441
1441
ondemand::array nodes;
1442
1442
auto nodeError = getJsonArray (sceneObject, " nodes" , &nodes);
1443
1443
if (nodeError == Error::None) {
1444
- // scene.nodeIndices.reserve(nodes.count_elements());
1444
+ scene.nodeIndices .reserve (nodes.count_elements ());
1445
1445
for (auto nodeValue : nodes) {
1446
1446
uint64_t index;
1447
1447
if (nodeValue.get_uint64 ().get (index) != SUCCESS) {
@@ -1460,7 +1460,7 @@ void fg::glTF::parseScenes(simdjson::ondemand::array scenes) {
1460
1460
1461
1461
void fg::glTF::parseSkins (simdjson::ondemand::array skins) {
1462
1462
using namespace simdjson ;
1463
- // parsedAsset->skins.reserve(skins.count_elements());
1463
+ parsedAsset->skins .reserve (skins.count_elements ());
1464
1464
1465
1465
for (auto skinValue : skins) {
1466
1466
Skin skin = {};
@@ -1481,7 +1481,7 @@ void fg::glTF::parseSkins(simdjson::ondemand::array skins) {
1481
1481
if (skinObject[" joints" ].get_array ().get (jointsArray) != SUCCESS) {
1482
1482
RETURN_SET_ERROR (Error::InvalidGltf)
1483
1483
}
1484
- // skin.joints.reserve(jointsArray.count_elements());
1484
+ skin.joints .reserve (jointsArray.count_elements ());
1485
1485
for (auto jointValue : jointsArray) {
1486
1486
if (jointValue.get_uint64 ().get (index) != SUCCESS) {
1487
1487
RETURN_SET_ERROR (Error::InvalidGltf)
@@ -1580,7 +1580,7 @@ fg::Error fg::glTF::parseTextureObject(void* object, std::string_view key, Textu
1580
1580
1581
1581
void fg::glTF::parseTextures (simdjson::ondemand::array textures) {
1582
1582
using namespace simdjson ;
1583
- // parsedAsset->textures.reserve(textures.count_elements());
1583
+ parsedAsset->textures .reserve (textures.count_elements ());
1584
1584
1585
1585
for (auto textureValue : textures) {
1586
1586
Texture texture;
0 commit comments