Skip to content

Commit

Permalink
Fixed texture pack oversight that prevented the game from freeing the…
Browse files Browse the repository at this point in the history
… textures.
  • Loading branch information
michael-fadely committed Jun 19, 2015
1 parent 386ca28 commit 6d6ce7c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/SADXModLoader/TextureReplacement.cpp
Expand Up @@ -60,9 +60,13 @@ bool BuildTextureList(const std::wstring& pvmName, NJS_TEXLIST* texList)
if (texList == nullptr)
return false;

string pvmName_a(pvmName.begin(), pvmName.end());

PrintDebug("Loading texture pack: %s\n", pvmName_a.c_str());

if (!FileExists(pvmName + L"\\index.txt"))
{
PrintDebug("\aTexture index missing for %s\n", string(pvmName.begin(), pvmName.end()).c_str());
PrintDebug("\aTexture index missing for %s\n", pvmName_a.c_str());
return false;
}

Expand Down Expand Up @@ -156,6 +160,7 @@ bool BuildTextureList(const std::wstring& pvmName, NJS_TEXLIST* texList)
NJS_TEXMEMLIST* texture = new NJS_TEXMEMLIST;
*texture = {};

texture->count = 1; // Required for the game to release the texture.
texture->globalIndex = customEntries[i].globalIndex;
texture->texinfo.texsurface.nWidth = info.Width;
texture->texinfo.texsurface.nHeight = info.Height;
Expand Down

0 comments on commit 6d6ce7c

Please sign in to comment.