- made all member variables of FTexture protected. Also temorarily disabled the CleanUnused call of the precacher - this needs some reworking, now that the texture system is better equipped for it.

This commit is contained in:
Christoph Oelckers 2020-04-18 09:23:00 +02:00
parent 718949f74d
commit e60d758287
3 changed files with 45 additions and 50 deletions

View file

@ -246,6 +246,48 @@ class FTexture : public RefCountedBase
friend class FMaterial;
friend class FFont;
protected:
uint16_t Width, Height;
int SourceLump;
FHardwareTextureContainer SystemTextures;
uint8_t bNoDecals : 1; // Decals should not stick to texture
uint8_t bNoRemap0 : 1; // Do not remap color 0 (used by front layer of parallax skies)
uint8_t bWorldPanning : 1; // Texture is panned in world units rather than texels
uint8_t bMasked : 1; // Texture (might) have holes
uint8_t bAlphaTexture : 1; // Texture is an alpha channel without color information
uint8_t bHasCanvas : 1; // Texture is based off FCanvasTexture
uint8_t bWarped : 2; // This is a warped texture. Used to avoid multiple warps on one texture
uint8_t bComplex : 1; // Will be used to mark extended MultipatchTextures that have to be
// fully composited before subjected to any kind of postprocessing instead of
// doing it per patch.
uint8_t bMultiPatch : 2; // This is a multipatch texture (we really could use real type info for textures...)
uint8_t bFullNameTexture : 1;
uint8_t bBrightmapChecked : 1; // Set to 1 if brightmap has been checked
uint8_t bGlowing : 1; // Texture glow color
uint8_t bAutoGlowing : 1; // Glow info is determined from texture image.
uint8_t bFullbright : 1; // always draw fullbright
uint8_t bDisableFullbright : 1; // This texture will not be displayed as fullbright sprite
uint8_t bSkybox : 1; // is a cubic skybox
uint8_t bNoCompress : 1;
int8_t bTranslucent : 2;
int8_t bExpandSprite = -1;
uint16_t Rotations;
int16_t SkyOffset;
FloatRect* areas = nullptr;
int areacount = 0;
int GlowHeight = 128;
PalEntry GlowColor = 0;
float Glossiness = 10.f;
float SpecularLevel = 0.1f;
float shaderspeed = 1.f;
int shaderindex = 0;
public:
@ -309,56 +351,9 @@ public:
static bool SmoothEdges(unsigned char * buffer,int w, int h);
protected:
int SourceLump;
public:
FHardwareTextureContainer SystemTextures;
protected:
protected:
uint8_t bNoDecals:1; // Decals should not stick to texture
uint8_t bNoRemap0:1; // Do not remap color 0 (used by front layer of parallax skies)
uint8_t bWorldPanning:1; // Texture is panned in world units rather than texels
uint8_t bMasked:1; // Texture (might) have holes
uint8_t bAlphaTexture:1; // Texture is an alpha channel without color information
uint8_t bHasCanvas:1; // Texture is based off FCanvasTexture
uint8_t bWarped:2; // This is a warped texture. Used to avoid multiple warps on one texture
uint8_t bComplex:1; // Will be used to mark extended MultipatchTextures that have to be
// fully composited before subjected to any kind of postprocessing instead of
// doing it per patch.
uint8_t bMultiPatch:2; // This is a multipatch texture (we really could use real type info for textures...)
uint8_t bFullNameTexture : 1;
uint8_t bBrightmapChecked : 1; // Set to 1 if brightmap has been checked
public:
uint8_t bGlowing : 1; // Texture glow color
uint8_t bAutoGlowing : 1; // Glow info is determined from texture image.
uint8_t bFullbright : 1; // always draw fullbright
uint8_t bDisableFullbright : 1; // This texture will not be displayed as fullbright sprite
protected:
uint8_t bSkybox : 1; // is a cubic skybox
uint8_t bNoCompress : 1;
int8_t bTranslucent : 2;
int8_t bExpandSprite = -1;
uint16_t Rotations;
int16_t SkyOffset;
FloatRect *areas = nullptr;
int areacount = 0;
public:
int GlowHeight = 128;
PalEntry GlowColor = 0;
private:
float Glossiness = 10.f;
float SpecularLevel = 0.1f;
float shaderspeed = 1.f;
int shaderindex = 0;
virtual void ResolvePatches() {}
protected:
uint16_t Width, Height;
FTexture (int lumpnum = -1);

View file

@ -62,7 +62,7 @@ static void PrecacheTexture(FGameTexture *tex, int cache)
//===========================================================================
static void PrecacheList(FMaterial *gltex, SpriteHits& translations)
{
gltex->BaseLayer()->SystemTextures.CleanUnused(translations, gltex->GetScaleFlags());
//gltex->BaseLayer()->SystemTextures.CleanUnused(translations, gltex->GetScaleFlags()); this needs to be redone.
SpriteHits::Iterator it(translations);
SpriteHits::Pair* pair;
while (it.NextPair(pair)) screen->PrecacheMaterial(gltex, pair->Key);
@ -253,7 +253,7 @@ void hw_PrecacheTexture(uint8_t *texhitlist, TMap<PClassActor*, bool> &actorhitl
if (texhitlist[i] & (FTextureManager::HIT_Wall | FTextureManager::HIT_Flat | FTextureManager::HIT_Sky))
{
int flags = shouldUpscale(gtex, UF_Texture);
if (tex->GetImage() && tex->SystemTextures.GetHardwareTexture(0, flags) == nullptr)
if (tex->GetImage() && tex->GetHardwareTexture(0, flags) == nullptr)
{
FImageSource::RegisterForPrecache(tex->GetImage(), V_IsTrueColor());
}

View file

@ -94,7 +94,7 @@ sector_t *SWSceneDrawer::RenderView(player_t *player)
FBTextureIndex = (FBTextureIndex + 1) % 2;
auto &fbtex = FBTexture[FBTextureIndex];
auto GetSystemTexture = [&]() { return fbtex->GetTexture()->SystemTextures.GetHardwareTexture(0, 0); };
auto GetSystemTexture = [&]() { return fbtex->GetTexture()->GetHardwareTexture(0, 0); };
if (fbtex == nullptr || GetSystemTexture() == nullptr ||
fbtex->GetTexelWidth() != screen->GetWidth() ||