From 5e56a6512ae8f948dd99357b5e3266e241d36ce2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 28 Dec 2007 22:00:41 +0000 Subject: [PATCH] - Changed FImageCollection so that it accepts a matching texture of any type. This is necessary to load hires sprite replacements for certain icons. SVN r655 (trunk) --- docs/rh-log.txt | 2 ++ src/r_data.cpp | 4 ++-- src/r_defs.h | 2 +- src/v_collection.cpp | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index a44dc48d6..e88a3194c 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 b72e3373f..f189c525d 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 c37a9837a..852deb655 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 ed30dd3d9..55bac6093 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) {