- imported two fixes from GZDoom

This commit is contained in:
Christoph Oelckers 2022-11-25 12:33:52 +01:00
parent 4aad87cf83
commit b5ad3b9f3b
3 changed files with 13 additions and 4 deletions

View file

@ -436,7 +436,7 @@ int IQMModel::FindFrame(const char* name, bool nodefault)
{ {
// [MK] allow looking up frames by animation name plus offset (using a colon as separator) // [MK] allow looking up frames by animation name plus offset (using a colon as separator)
const char* colon = strrchr(name,':'); const char* colon = strrchr(name,':');
int nlen = (colon==nullptr)?strlen(name):(colon-name); size_t nlen = (colon==nullptr)?strlen(name):(colon-name);
for (unsigned i = 0; i < Anims.Size(); i++) for (unsigned i = 0; i < Anims.Size(); i++)
{ {
if (!strnicmp(name, Anims[i].Name.GetChars(), nlen)) if (!strnicmp(name, Anims[i].Name.GetChars(), nlen))

View file

@ -1300,11 +1300,12 @@ void FTextureManager::InitPalettedVersions()
// //
//========================================================================== //==========================================================================
FTextureID FTextureManager::GetRawTexture(FTextureID texid) FTextureID FTextureManager::GetRawTexture(FTextureID texid, bool dontlookup)
{ {
int texidx = texid.GetIndex(); int texidx = texid.GetIndex();
if ((unsigned)texidx >= Textures.Size()) return texid; if ((unsigned)texidx >= Textures.Size()) return texid;
if (Textures[texidx].FrontSkyLayer != -1) return FSetTextureID(Textures[texidx].FrontSkyLayer); if (Textures[texidx].RawTexture != -1) return FSetTextureID(Textures[texidx].RawTexture);
if (dontlookup) return texid;
// Reject anything that cannot have been a front layer for the sky in original Hexen, i.e. it needs to be an unscaled wall texture only using Doom patches. // Reject anything that cannot have been a front layer for the sky in original Hexen, i.e. it needs to be an unscaled wall texture only using Doom patches.
auto tex = Textures[texidx].Texture; auto tex = Textures[texidx].Texture;

View file

@ -77,7 +77,15 @@ public:
void FlushAll(); void FlushAll();
FTextureID GetFrontSkyLayer(FTextureID); FTextureID GetFrontSkyLayer(FTextureID);
FTextureID GetRawTexture(FTextureID); FTextureID GetRawTexture(FTextureID tex, bool dontlookup = false);
void SetRawTexture(FTextureID texid)
{
int texidx = texid.GetIndex();
if ((unsigned)texidx < Textures.Size())
{
Textures[texidx].RawTexture = texidx;
}
}
enum enum