From f2966602660e32a07ba8d7ac3380796acbc5c535 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Apr 2020 21:07:57 +0200 Subject: [PATCH] - set all texture IDs after finishing the initial texture manager initialization. As it turned out, not all textures have a valid ID at that point so it needs to be redone. --- src/common/textures/texturemanager.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/common/textures/texturemanager.cpp b/src/common/textures/texturemanager.cpp index 34483fc0c..a94a1592a 100644 --- a/src/common/textures/texturemanager.cpp +++ b/src/common/textures/texturemanager.cpp @@ -1184,6 +1184,13 @@ void FTextureManager::Init(void (*progressFunc_)(), void (*checkForHacks)(BuildI glPart = TexMan.CheckForTexture("glstuff/glpart.png", ETextureType::MiscPatch); mirrorTexture = TexMan.CheckForTexture("glstuff/mirror.png", ETextureType::MiscPatch); AddLocalizedVariants(); + + // Make sure all ID's are correct by resetting them here to the proper index. + for (unsigned int i = 0, count = Textures.Size(); i < count; ++i) + { + Textures[i].Texture->SetID(i); + } + } //==========================================================================