- make upscaling of sky textures depend on the single tile size, not the entire composite texture.

This commit is contained in:
Christoph Oelckers 2021-11-28 17:38:09 +01:00
parent 7d3b604361
commit 793aaf242c
3 changed files with 9 additions and 4 deletions

View file

@ -136,8 +136,12 @@ public:
void SetSpriteRect(); void SetSpriteRect();
ETextureType GetUseType() const { return UseType; } ETextureType GetUseType() const { return UseType; }
void SetUpscaleFlag(int what) { shouldUpscaleFlag = what; } void SetUpscaleFlag(int what, bool manual = false)
int GetUpscaleFlag() { return shouldUpscaleFlag == 1; } {
if ((shouldUpscaleFlag & 2) && !manual) return; // if set manually this may not be reset.
shouldUpscaleFlag = what | (manual? 2 : 0);
}
int GetUpscaleFlag() { return shouldUpscaleFlag & 1; }
FTexture* GetTexture() { return Base.get(); } FTexture* GetTexture() { return Base.get(); }
int GetSourceLump() const { return Base->GetSourceLump(); } int GetSourceLump() const { return Base->GetSourceLump(); }

View file

@ -1190,10 +1190,10 @@ void FTextureManager::Init(void (*progressFunc_)(), void (*checkForHacks)(BuildI
AddGameTexture(CreateShaderTexture(true, true)); AddGameTexture(CreateShaderTexture(true, true));
// Add two animtexture entries so that movie playback can call functions using texture IDs. // Add two animtexture entries so that movie playback can call functions using texture IDs.
auto mt = MakeGameTexture(new AnimTexture(), "AnimTextureFrame1", ETextureType::Override); auto mt = MakeGameTexture(new AnimTexture(), "AnimTextureFrame1", ETextureType::Override);
mt->SetUpscaleFlag(false); mt->SetUpscaleFlag(false, true);
AddGameTexture(mt); AddGameTexture(mt);
mt = MakeGameTexture(new AnimTexture(), "AnimTextureFrame2", ETextureType::Override); mt = MakeGameTexture(new AnimTexture(), "AnimTextureFrame2", ETextureType::Override);
mt->SetUpscaleFlag(false); mt->SetUpscaleFlag(false, true);
AddGameTexture(mt); AddGameTexture(mt);
int wadcnt = fileSystem.GetNumWads(); int wadcnt = fileSystem.GetNumWads();

View file

@ -72,6 +72,7 @@ FGameTexture* GetSkyTexture(int basetile, int lognumtiles, const int16_t *tilema
build[i].Translation = GPalette.GetTranslation(GetTranslationType(remap), GetTranslationIndex(remap)); build[i].Translation = GPalette.GetTranslation(GetTranslationType(remap), GetTranslationIndex(remap));
} }
auto tt = MakeGameTexture(new FImageTexture(new FMultiPatchTexture(tilewidth*numtiles, tileHeight(basetile), build, false, false)), synthname, ETextureType::Override); auto tt = MakeGameTexture(new FImageTexture(new FMultiPatchTexture(tilewidth*numtiles, tileHeight(basetile), build, false, false)), synthname, ETextureType::Override);
tt->SetUpscaleFlag(tileGetTexture(basetile)->GetUpscaleFlag(), true);
TexMan.AddGameTexture(tt, true); TexMan.AddGameTexture(tt, true);
return tt; return tt;
} }