Skip to content

Commit 0f154aa

Browse files
Synchronize changes from 1.6 branch [ci skip]
27a37af 1.6: Fix build after 4e37df8
2 parents 0c1b6b9 + 27a37af commit 0f154aa

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

Client/game_sa/CRenderWareSA.TextureReplacing.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ CModelTexturesInfo* CRenderWareSA::GetModelTexturesInfo(ushort usModelId)
118118

119119
const ushort usTxdId = pModelInfo->GetTextureDictionaryID();
120120

121-
if (auto it = ms_ModelTexturesInfoMap.find(usTxdId); it != ms_ModelTexturesInfoMap.end())
121+
auto it = ms_ModelTexturesInfoMap.find(usTxdId);
122+
if (it != ms_ModelTexturesInfoMap.end())
122123
return &it->second;
123124

124125
// Get txd
@@ -146,13 +147,13 @@ CModelTexturesInfo* CRenderWareSA::GetModelTexturesInfo(ushort usModelId)
146147
return nullptr;
147148

148149
// Add new info
149-
auto [it, inserted] = ms_ModelTexturesInfoMap.emplace(usTxdId, CModelTexturesInfo{});
150-
auto& newInfo = it->second;
150+
auto itInserted = ms_ModelTexturesInfoMap.emplace(usTxdId, CModelTexturesInfo{});
151+
CModelTexturesInfo& newInfo = itInserted.first->second;
151152
newInfo.usTxdId = usTxdId;
152153
newInfo.pTxd = pTxd;
153154

154155
// Save original textures
155-
GetTxdTextures(newInfo.originalTextures, newInfo.pTxd);
156+
GetTxdTextures(newInfo.originalTextures, pTxd);
156157

157158
return &newInfo;
158159
}
@@ -172,7 +173,8 @@ bool CRenderWareSA::ModelInfoTXDLoadTextures(SReplacementTextures* pReplacementT
172173
return false;
173174

174175
// Try to load it
175-
if (auto* pTxd = ReadTXD(strFilename, buffer); pTxd)
176+
auto* pTxd = ReadTXD(strFilename, buffer);
177+
if (pTxd)
176178
{
177179
// Get the list of textures into our own list
178180
GetTxdTextures(pReplacementTextures->textures, pTxd);
@@ -229,7 +231,8 @@ bool CRenderWareSA::ModelInfoTXDAddTextures(SReplacementTextures* pReplacementTe
229231
//
230232
// Add section for this txd
231233
//
232-
auto& perTxdInfo = pReplacementTextures->perTxdList.emplace_back();
234+
pReplacementTextures->perTxdList.emplace_back();
235+
SReplacementTextures::SPerTxd& perTxdInfo = pReplacementTextures->perTxdList.back();
233236

234237
perTxdInfo.usTxdId = pInfo->usTxdId;
235238
perTxdInfo.bTexturesAreCopies = !pReplacementTextures->usedInTxdIds.empty();
@@ -289,7 +292,7 @@ bool CRenderWareSA::ModelInfoTXDAddTextures(SReplacementTextures* pReplacementTe
289292
void CRenderWareSA::ModelInfoTXDRemoveTextures(SReplacementTextures* pReplacementTextures)
290293
{
291294
// For each using txd
292-
for (auto& perTxdInfo : pReplacementTextures->perTxdList)
295+
for (SReplacementTextures::SPerTxd& perTxdInfo : pReplacementTextures->perTxdList)
293296
{
294297
// Get textures info
295298
ushort usTxdId = perTxdInfo.usTxdId;

0 commit comments

Comments
 (0)