- Fixed: Skin mugshots didn't load. (This adds a texture usetype for skin graphics.)

SVN r4205 (trunk)
This commit is contained in:
Braden Obrzut 2013-03-25 18:20:39 +00:00
parent 332b1091b4
commit 316faf59b4
3 changed files with 14 additions and 4 deletions

View file

@ -98,7 +98,7 @@ FTexture *FMugShotFrame::GetTexture(const char *default_face, const char *skin_f
}
sprite.UnlockBuffer();
}
return TexMan[TexMan.CheckForTexture(sprite, 0, true)];
return TexMan[TexMan.CheckForTexture(sprite, 0, FTextureManager::TEXMAN_TryAny|FTextureManager::TEXMAN_AllowSkins)];
}
//===========================================================================

View file

@ -176,6 +176,7 @@ FTextureID FTextureManager::CheckForTexture (const char *name, int usetype, BITF
{
// All NULL textures should actually return 0
if (tex->UseType == FTexture::TEX_FirstDefined && !(flags & TEXMAN_ReturnFirst)) return 0;
if (tex->UseType == FTexture::TEX_SkinGraphic && !(flags & TEXMAN_AllowSkins)) return 0;
return FTextureID(tex->UseType==FTexture::TEX_Null ? 0 : i);
}
else if ((flags & TEXMAN_Overridable) && tex->UseType == FTexture::TEX_Override)
@ -831,6 +832,7 @@ void FTextureManager::AddTexturesForWad(int wadnum)
for (int i= firsttx; i <= lasttx; i++)
{
bool skin = false;
char name[9];
Wads.GetLumpName(name, i);
name[8]=0;
@ -869,11 +871,17 @@ void FTextureManager::AddTexturesForWad(int wadnum)
// Don't bother looking this lump if something later overrides it.
if (Wads.CheckNumForName(name, ns_graphics) != i) continue;
}
else if (ns >= ns_firstskin)
{
// Don't bother looking this lump if something later overrides it.
if (Wads.CheckNumForName(name, ns) != i) continue;
skin = true;
}
else continue;
// Try to create a texture from this lump and add it.
// Unfortunately we have to look at everything that comes through here...
FTexture *out = FTexture::CreateTexture(i, FTexture::TEX_MiscPatch);
FTexture *out = FTexture::CreateTexture(i, skin ? FTexture::TEX_SkinGraphic : FTexture::TEX_MiscPatch);
if (out != NULL)
{
@ -922,7 +930,7 @@ void FTextureManager::SortTexturesByType(int start, int end)
static int texturetypes[] = {
FTexture::TEX_Sprite, FTexture::TEX_Null, FTexture::TEX_FirstDefined,
FTexture::TEX_WallPatch, FTexture::TEX_Wall, FTexture::TEX_Flat,
FTexture::TEX_Override, FTexture::TEX_MiscPatch
FTexture::TEX_Override, FTexture::TEX_MiscPatch, FTexture::TEX_SkinGraphic
};
for(unsigned int i=0;i<countof(texturetypes);i++)

View file

@ -195,6 +195,7 @@ public:
TEX_FontChar,
TEX_Override, // For patches between TX_START/TX_END
TEX_Autopage, // Automap background - used to enable the use of FAutomapTexture
TEX_SkinGraphic,
TEX_Null,
TEX_FirstDefined,
};
@ -363,6 +364,7 @@ public:
TEXMAN_TryAny = 1,
TEXMAN_Overridable = 2,
TEXMAN_ReturnFirst = 4,
TEXMAN_AllowSkins = 8
};
FTextureID CheckForTexture (const char *name, int usetype, BITFIELD flags=TEXMAN_TryAny);