diff --git a/docs/rh-log.txt b/docs/rh-log.txt index a44dc48d67..e88a3194cc 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,6 @@ December 28, 2007 (Changes by Graf Zahl) +- Changed FImageCollection so that it accepts a matching texture of any type. + This is necessary to load hires sprite replacements for certain icons. - Added a check to Wads.CheckNumForName to return -1 for names longer than 8 characters which contain path separators. - Fixed: Hires texture replacement must replace all matching textures, not diff --git a/src/r_data.cpp b/src/r_data.cpp index b72e3373ff..f189c525d4 100644 --- a/src/r_data.cpp +++ b/src/r_data.cpp @@ -290,13 +290,13 @@ void FTextureManager::ReplaceTexture (int picnum, FTexture *newtexture, bool fre } } -int FTextureManager::AddPatch (const char *patchname, int namespc) +int FTextureManager::AddPatch (const char *patchname, int namespc, bool tryany) { if (patchname == NULL) { return -1; } - int lumpnum = CheckForTexture (patchname, FTexture::TEX_MiscPatch, false); + int lumpnum = CheckForTexture (patchname, FTexture::TEX_MiscPatch, tryany); if (lumpnum >= 0) { diff --git a/src/r_defs.h b/src/r_defs.h index c37a9837ab..852deb655c 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -810,7 +810,7 @@ public: int CreateTexture (int lumpnum, int usetype=FTexture::TEX_Any); // Also calls AddTexture int AddTexture (FTexture *texture); - int AddPatch (const char *patchname, int namespc=0); + int AddPatch (const char *patchname, int namespc=0, bool tryany = false); // Replaces one texture with another. The new texture will be assigned // the same name, slot, and use type as the texture it is replacing. diff --git a/src/v_collection.cpp b/src/v_collection.cpp index ed30dd3d96..55bac6093f 100644 --- a/src/v_collection.cpp +++ b/src/v_collection.cpp @@ -60,7 +60,7 @@ void FImageCollection::Init (const char **patchNames, int numPatches, int namesp for (int i = 0; i < numPatches; ++i) { - int picnum = TexMan.AddPatch (patchNames[i], namespc); + int picnum = TexMan.AddPatch (patchNames[i], namespc, true); if (picnum == -1 && namespc != ns_sprites) {