- fixed texture scaling setup in a few places.

This commit is contained in:
Christoph Oelckers 2020-04-26 13:48:51 +02:00
parent 5611fe0f41
commit 763e9e0f35
4 changed files with 6 additions and 6 deletions

View file

@ -206,6 +206,7 @@ public:
void CopySize(FGameTexture* BaseTexture) void CopySize(FGameTexture* BaseTexture)
{ {
Base->CopySize(BaseTexture->Base.get()); Base->CopySize(BaseTexture->Base.get());
SetDisplaySize(BaseTexture->GetDisplayWidth(), BaseTexture->GetDisplayHeight());
} }
// Glowing is a pure material property that should not filter down to the actual texture objects. // Glowing is a pure material property that should not filter down to the actual texture objects.
@ -248,8 +249,8 @@ public:
{ {
ScaleX = x; ScaleX = x;
ScaleY = y; ScaleY = y;
DisplayWidth = x * TexelWidth; DisplayWidth = TexelWidth / x;
DisplayHeight = y * TexelHeight; DisplayHeight = TexelHeight / y;
} }
const SpritePositioningInfo& GetSpritePositioning(int which) { if (spi == nullptr) SetupSpriteData(); return spi[which]; } const SpritePositioningInfo& GetSpritePositioning(int which) { if (spi == nullptr) SetupSpriteData(); return spi[which]; }

View file

@ -514,7 +514,7 @@ int calcShouldUpscale(FGameTexture *tex)
return 0; return 0;
// already scaled? // already scaled?
if (tex->GetDisplayWidth() >= 2* tex->GetTexelWidth() || tex->GetDisplayHeight() >= 2*tex->GetTexelHeight()) if (tex->GetScaleX() >= 2.f || tex->GetScaleY() > 2.f)
return 0; return 0;
return CTF_Upscale; return CTF_Upscale;

View file

@ -901,7 +901,6 @@ void FMultipatchTextureBuilder::ResolveAllPatches()
!buildinfo.bComplex) !buildinfo.bComplex)
{ {
AddImageToTexture(buildinfo.Parts[0].TexImage, buildinfo); AddImageToTexture(buildinfo.Parts[0].TexImage, buildinfo);
buildinfo.texture->Setup(buildinfo.Parts[0].TexImage);
done = true; done = true;
} }
} }

View file

@ -625,8 +625,8 @@ void FTextureManager::AddHiresTextures (int wadnum)
auto gtex = MakeGameTexture(newtex, nullptr, ETextureType::Override); auto gtex = MakeGameTexture(newtex, nullptr, ETextureType::Override);
gtex->SetWorldPanning(true); gtex->SetWorldPanning(true);
gtex->SetDisplaySize(oldtex->GetDisplayWidth(), oldtex->GetDisplayHeight()); gtex->SetDisplaySize(oldtex->GetDisplayWidth(), oldtex->GetDisplayHeight());
gtex->SetOffsets(0, xs_RoundToInt(oldtex->GetDisplayLeftOffset(0) * gtex->GetScaleX()), xs_RoundToInt(oldtex->GetDisplayTopOffset(0) * gtex->GetScaleY())); gtex->SetOffsets(0, oldtex->GetTexelLeftOffset(0), oldtex->GetTexelTopOffset(0));
gtex->SetOffsets(1, xs_RoundToInt(oldtex->GetDisplayLeftOffset(1) * gtex->GetScaleX()), xs_RoundToInt(oldtex->GetDisplayTopOffset(1) * gtex->GetScaleY())); gtex->SetOffsets(1, oldtex->GetTexelLeftOffset(1), oldtex->GetTexelTopOffset(1));
ReplaceTexture(tlist[i], gtex, true); ReplaceTexture(tlist[i], gtex, true);
} }
} }