Skip to content

Commit 2b479b0

Browse files
GLTF Loader: don't use auto where not needed
1 parent bf244cd commit 2b479b0

File tree

2 files changed

+221
-216
lines changed

2 files changed

+221
-216
lines changed

AssetLoader/interface/GLTFLoader.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2024 Diligent Graphics LLC
2+
* Copyright 2019-2025 Diligent Graphics LLC
33
* Copyright 2015-2019 Egor Yusov
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -392,8 +392,8 @@ struct Material
392392
Uint32 ActiveAttribs = ActiveTextureAttribs;
393393
while (ActiveAttribs != 0)
394394
{
395-
const auto Idx = PlatformMisc::GetLSB(ActiveAttribs);
396-
const auto PackedIndex = GetActiveTextureAttribPackedIndex(Idx);
395+
const Uint32 Idx = PlatformMisc::GetLSB(ActiveAttribs);
396+
const size_t PackedIndex = GetActiveTextureAttribPackedIndex(Idx);
397397
if (!Handler(Idx, TextureAttribs[PackedIndex], TextureIds[PackedIndex]))
398398
break;
399399
ActiveAttribs &= ~(1u << Idx);
@@ -457,7 +457,7 @@ struct Mesh
457457
BB = Primitives[0].BB;
458458
for (size_t prim = 1; prim < Primitives.size(); ++prim)
459459
{
460-
const auto& PrimBB{Primitives[prim].BB};
460+
const BoundBox& PrimBB{Primitives[prim].BB};
461461
BB.Min = (std::min)(BB.Min, PrimBB.Min);
462462
BB.Max = (std::max)(BB.Max, PrimBB.Max);
463463
}
@@ -971,14 +971,14 @@ struct Model
971971

972972
ITexture* GetTexture(Uint32 Index, IRenderDevice* pDevice = nullptr, IDeviceContext* pCtx = nullptr) const
973973
{
974-
auto& TexInfo = Textures[Index];
974+
const TextureInfo& TexInfo = Textures[Index];
975975

976976
if (TexInfo.pTexture)
977977
return TexInfo.pTexture;
978978

979979
if (TexInfo.pAtlasSuballocation)
980980
{
981-
if (auto* pAtlas = TexInfo.pAtlasSuballocation->GetAtlas())
981+
if (IDynamicTextureAtlas* pAtlas = TexInfo.pAtlasSuballocation->GetAtlas())
982982
{
983983
return pDevice != nullptr || pCtx != nullptr ?
984984
pAtlas->Update(pDevice, pCtx) :
@@ -997,12 +997,12 @@ struct Model
997997
{
998998
if (Index < Textures.size())
999999
{
1000-
const auto& TexInfo = Textures[Index];
1000+
const TextureInfo& TexInfo = Textures[Index];
10011001
if (TexInfo.pTexture)
10021002
{
10031003
return TexInfo.pTexture->GetDesc();
10041004
}
1005-
else if (auto* pAtlas = (TexInfo.pAtlasSuballocation ? TexInfo.pAtlasSuballocation->GetAtlas() : nullptr))
1005+
else if (IDynamicTextureAtlas* pAtlas = (TexInfo.pAtlasSuballocation ? TexInfo.pAtlasSuballocation->GetAtlas() : nullptr))
10061006
{
10071007
return pAtlas->GetAtlasDesc();
10081008
}
@@ -1017,7 +1017,7 @@ struct Model
10171017
VERIFY(IndexData.IndexSize != 0, "Index size is not initialized");
10181018
if (IndexData.pAllocation)
10191019
{
1020-
const auto Offset = IndexData.pAllocation->GetOffset();
1020+
const Uint32 Offset = IndexData.pAllocation->GetOffset();
10211021
VERIFY((Offset % IndexData.IndexSize) == 0, "Index data allocation offset is not a multiple of index size (", IndexData.IndexSize, ")");
10221022
return Offset / IndexData.IndexSize;
10231023
}
@@ -1072,13 +1072,13 @@ struct Model
10721072
Uint32 GetNumVertexAttributes() const { return NumVertexAttributes; }
10731073
Uint32 GetNumTextureAttributes() const { return NumTextureAttributes; }
10741074

1075-
const auto& GetVertexAttribute(size_t Idx) const
1075+
const VertexAttributeDesc& GetVertexAttribute(size_t Idx) const
10761076
{
10771077
VERIFY_EXPR(Idx < GetNumVertexAttributes());
10781078
return VertexAttributes[Idx];
10791079
}
10801080

1081-
const auto& GetTextureAttribute(size_t Idx) const
1081+
const TextureAttributeDesc& GetTextureAttribute(size_t Idx) const
10821082
{
10831083
VERIFY_EXPR(Idx < GetNumTextureAttributes());
10841084
return TextureAttributes[Idx];

0 commit comments

Comments
 (0)