@@ -1671,7 +1671,7 @@ using namespace nbl::asset;
1671
1671
const auto & extras = tweets.at_key (" extras" );
1672
1672
1673
1673
if (scene.error () != simdjson::error_code::NO_SUCH_FIELD)
1674
- glTF.defaultScene = scene.get_uint64 ();
1674
+ glTF.defaultScene = static_cast < uint32_t >( scene.get_uint64 () );
1675
1675
1676
1676
if (scenes.error () != simdjson::error_code::NO_SUCH_FIELD)
1677
1677
{
@@ -1724,7 +1724,7 @@ using namespace nbl::asset;
1724
1724
const auto & extras = jsonBufferView.at_key (" extras" );
1725
1725
1726
1726
if (buffer.error () != simdjson::error_code::NO_SUCH_FIELD)
1727
- glTFBufferView.buffer = buffer.get_uint64 ().value ();
1727
+ glTFBufferView.buffer = static_cast < uint32_t >( buffer.get_uint64 ().value () );
1728
1728
1729
1729
if (byteOffset.error () != simdjson::error_code::NO_SUCH_FIELD)
1730
1730
glTFBufferView.byteOffset = byteOffset.get_uint64 ().value ();
@@ -1733,10 +1733,10 @@ using namespace nbl::asset;
1733
1733
glTFBufferView.byteLength = byteLength.get_uint64 ().value ();
1734
1734
1735
1735
if (byteStride.error () != simdjson::error_code::NO_SUCH_FIELD)
1736
- glTFBufferView.byteStride = byteStride.get_uint64 ().value ();
1736
+ glTFBufferView.byteStride = static_cast < uint32_t >( byteStride.get_uint64 ().value () );
1737
1737
1738
1738
if (target.error () != simdjson::error_code::NO_SUCH_FIELD)
1739
- glTFBufferView.target = target.get_uint64 ().value ();
1739
+ glTFBufferView.target = static_cast < uint32_t >( target.get_uint64 ().value () );
1740
1740
1741
1741
if (name.error () != simdjson::error_code::NO_SUCH_FIELD)
1742
1742
glTFBufferView.name = name.get_string ().value ();
@@ -1815,10 +1815,10 @@ using namespace nbl::asset;
1815
1815
const auto & name = texture.at_key (" name" );
1816
1816
1817
1817
if (sampler.error () != simdjson::error_code::NO_SUCH_FIELD)
1818
- glTFTexture.sampler = sampler.get_uint64 ().value ();
1818
+ glTFTexture.sampler = static_cast < uint32_t >( sampler.get_uint64 ().value () );
1819
1819
1820
1820
if (source.error () != simdjson::error_code::NO_SUCH_FIELD)
1821
- glTFTexture.source = source.get_uint64 ().value ();
1821
+ glTFTexture.source = static_cast < uint32_t >( source.get_uint64 ().value () );
1822
1822
1823
1823
if (name.error () != simdjson::error_code::NO_SUCH_FIELD)
1824
1824
glTFTexture.name = name.get_string ().value ();
@@ -1874,10 +1874,10 @@ using namespace nbl::asset;
1874
1874
const auto & texCoord = bctData.at_key (" texCoord" );
1875
1875
1876
1876
if (index.error () != simdjson::error_code::NO_SUCH_FIELD)
1877
- glTFBaseColorTexture.index = index.get_uint64 ().value ();
1877
+ glTFBaseColorTexture.index = static_cast < uint32_t >( index.get_uint64 ().value () );
1878
1878
1879
1879
if (texCoord.error () != simdjson::error_code::NO_SUCH_FIELD)
1880
- glTFBaseColorTexture.texCoord = texCoord.get_uint64 ().value ();
1880
+ glTFBaseColorTexture.texCoord = static_cast < uint32_t >( texCoord.get_uint64 ().value () );
1881
1881
}
1882
1882
1883
1883
if (metallicFactor.error () != simdjson::error_code::NO_SUCH_FIELD)
@@ -1895,27 +1895,27 @@ using namespace nbl::asset;
1895
1895
const auto & texCoord = mrtData.at_key (" texCoord" );
1896
1896
1897
1897
if (index.error () != simdjson::error_code::NO_SUCH_FIELD)
1898
- glTFMetallicRoughnessTexture.index = index.get_uint64 ().value ();
1898
+ glTFMetallicRoughnessTexture.index = static_cast < uint32_t >( index.get_uint64 ().value () );
1899
1899
1900
1900
if (texCoord.error () != simdjson::error_code::NO_SUCH_FIELD)
1901
- glTFMetallicRoughnessTexture.texCoord = texCoord.get_uint64 ().value ();
1901
+ glTFMetallicRoughnessTexture.texCoord = static_cast < uint32_t >( texCoord.get_uint64 ().value () );
1902
1902
}
1903
1903
}
1904
1904
1905
1905
if (normalTexture.error () != simdjson::error_code::NO_SUCH_FIELD)
1906
1906
{
1907
1907
auto & glTFNormalTexture = glTFMaterial.normalTexture .emplace ();
1908
- const const auto & normalTextureData = normalTexture.get_object ();
1908
+ const auto & normalTextureData = normalTexture.get_object ();
1909
1909
1910
1910
const auto & index = normalTextureData.at_key (" index" );
1911
1911
const auto & texCoord = normalTextureData.at_key (" texCoord" );
1912
1912
const auto & scale = normalTextureData.at_key (" scale" );
1913
1913
1914
1914
if (index.error () != simdjson::error_code::NO_SUCH_FIELD)
1915
- glTFNormalTexture.index = index.get_uint64 ().value ();
1915
+ glTFNormalTexture.index = static_cast < uint32_t >( index.get_uint64 ().value () );
1916
1916
1917
1917
if (texCoord.error () != simdjson::error_code::NO_SUCH_FIELD)
1918
- glTFNormalTexture.texCoord = texCoord.get_uint64 ().value ();
1918
+ glTFNormalTexture.texCoord = static_cast < uint32_t >( texCoord.get_uint64 ().value () );
1919
1919
1920
1920
if (scale.error () != simdjson::error_code::NO_SUCH_FIELD)
1921
1921
glTFNormalTexture.scale = texCoord.get_double ().value ();
@@ -1931,10 +1931,10 @@ using namespace nbl::asset;
1931
1931
const auto & strength = occlusionTextureData.at_key (" strength" );
1932
1932
1933
1933
if (index.error () != simdjson::error_code::NO_SUCH_FIELD)
1934
- glTFOcclusionTexture.index = index .get_uint64 ().value ();
1934
+ glTFOcclusionTexture.index = static_cast < uint32_t >(texCoord .get_uint64 ().value () );
1935
1935
1936
1936
if (texCoord.error () != simdjson::error_code::NO_SUCH_FIELD)
1937
- glTFOcclusionTexture.texCoord = texCoord.get_uint64 ().value ();
1937
+ glTFOcclusionTexture.texCoord = static_cast < uint32_t >( texCoord.get_uint64 ().value () );
1938
1938
1939
1939
if (strength.error () != simdjson::error_code::NO_SUCH_FIELD)
1940
1940
glTFOcclusionTexture.strength = texCoord.get_double ().value ();
@@ -1949,10 +1949,10 @@ using namespace nbl::asset;
1949
1949
const auto & texCoord = emissiveTextureData.at_key (" texCoord" );
1950
1950
1951
1951
if (index.error () != simdjson::error_code::NO_SUCH_FIELD)
1952
- glTFEmissiveTexture.index = index .get_uint64 ().value ();
1952
+ glTFEmissiveTexture.index = static_cast < uint32_t >(texCoord .get_uint64 ().value () );
1953
1953
1954
1954
if (texCoord.error () != simdjson::error_code::NO_SUCH_FIELD)
1955
- glTFEmissiveTexture.texCoord = texCoord.get_uint64 ().value ();
1955
+ glTFEmissiveTexture.texCoord = static_cast < uint32_t >( texCoord.get_uint64 ().value () );
1956
1956
}
1957
1957
1958
1958
if (emissiveFactor.error () != simdjson::error_code::NO_SUCH_FIELD)
@@ -2137,7 +2137,7 @@ using namespace nbl::asset;
2137
2137
const auto & extras = accessor.at_key (" extras" );
2138
2138
2139
2139
if (bufferView.error () != simdjson::error_code::NO_SUCH_FIELD)
2140
- glTFAccessor.bufferView = bufferView.get_uint64 ().value ();
2140
+ glTFAccessor.bufferView = static_cast < uint32_t >( bufferView.get_uint64 ().value () );
2141
2141
2142
2142
if (byteOffset.error () != simdjson::error_code::NO_SUCH_FIELD)
2143
2143
glTFAccessor.byteOffset = byteOffset.get_uint64 ().value ();
@@ -2149,7 +2149,7 @@ using namespace nbl::asset;
2149
2149
glTFAccessor.normalized = normalized.get_bool ().value ();
2150
2150
2151
2151
if (count.error () != simdjson::error_code::NO_SUCH_FIELD)
2152
- glTFAccessor.count = count.get_uint64 ().value ();
2152
+ glTFAccessor.count = static_cast < uint32_t >( count.get_uint64 ().value () );
2153
2153
2154
2154
if (type.error () != simdjson::error_code::NO_SUCH_FIELD)
2155
2155
{
@@ -2236,25 +2236,25 @@ using namespace nbl::asset;
2236
2236
const auto & extras = primitive.at_key (" extras" );
2237
2237
2238
2238
if (indices.error () != simdjson::error_code::NO_SUCH_FIELD)
2239
- glTFPrimitive.indices = indices.get_uint64 ().value ();
2239
+ glTFPrimitive.indices = static_cast < uint32_t >( indices.get_uint64 ().value () );
2240
2240
2241
2241
if (material.error () != simdjson::error_code::NO_SUCH_FIELD)
2242
- glTFPrimitive.material = material.get_uint64 ().value ();
2242
+ glTFPrimitive.material = static_cast < uint32_t >( material.get_uint64 ().value () );
2243
2243
2244
2244
if (mode.error () != simdjson::error_code::NO_SUCH_FIELD)
2245
- glTFPrimitive.mode = mode.get_uint64 ().value ();
2245
+ glTFPrimitive.mode = static_cast < uint32_t >( mode.get_uint64 ().value () );
2246
2246
else
2247
2247
glTFPrimitive.mode = 4 ;
2248
2248
2249
2249
if (targets.error () != simdjson::error_code::NO_SUCH_FIELD)
2250
2250
for (const auto & [targetKey, targetID] : targets.get_object ())
2251
- glTFPrimitive.targets .emplace ()[targetKey.data ()] = targetID.get_uint64 ().value ();
2251
+ glTFPrimitive.targets .emplace ()[targetKey.data ()] = static_cast < uint32_t >( targetID.get_uint64 ().value () );
2252
2252
2253
2253
if (attributes.error () != simdjson::error_code::NO_SUCH_FIELD)
2254
2254
{
2255
2255
for (const auto & [attributeKey, accessorID] : attributes.get_object ())
2256
2256
{
2257
- const auto & requestedAccessor = accessorID.get_uint64 ().value ();
2257
+ const auto requestedAccessor = accessorID.get_uint64 ().value ();
2258
2258
2259
2259
std::pair<std::string, uint8_t > attributeMap;
2260
2260
{
@@ -2351,14 +2351,14 @@ using namespace nbl::asset;
2351
2351
const auto & extras = jsonNode.at_key (" extras" );
2352
2352
2353
2353
if (camera.error () != simdjson::error_code::NO_SUCH_FIELD)
2354
- glTFnode.camera = camera.get_uint64 ().value ();
2354
+ glTFnode.camera = static_cast < uint32_t >( camera.get_uint64 ().value () );
2355
2355
2356
2356
if (children.error () != simdjson::error_code::NO_SUCH_FIELD)
2357
2357
for (const auto & child : children)
2358
2358
glTFnode.children .push_back (child.get_uint64 ().value ());
2359
2359
2360
2360
if (skin.error () != simdjson::error_code::NO_SUCH_FIELD)
2361
- glTFnode.skin = skin.get_uint64 ().value ();
2361
+ glTFnode.skin = static_cast < uint32_t >( skin.get_uint64 ().value () );
2362
2362
2363
2363
if (matrix.error () != simdjson::error_code::NO_SUCH_FIELD)
2364
2364
{
@@ -2410,7 +2410,7 @@ using namespace nbl::asset;
2410
2410
}
2411
2411
2412
2412
if (mesh.error () != simdjson::error_code::NO_SUCH_FIELD)
2413
- glTFnode.mesh = mesh.get_uint64 ().value ();
2413
+ glTFnode.mesh = static_cast < uint32_t >( mesh.get_uint64 ().value () );
2414
2414
2415
2415
if (name.error () != simdjson::error_code::NO_SUCH_FIELD)
2416
2416
glTFnode.name = name.get_string ().value ();
0 commit comments