diff --git a/src/common/textures/gametexture.h b/src/common/textures/gametexture.h index e34ce0949..3b2b69029 100644 --- a/src/common/textures/gametexture.h +++ b/src/common/textures/gametexture.h @@ -206,6 +206,7 @@ public: void CopySize(FGameTexture* BaseTexture) { 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. @@ -248,8 +249,8 @@ public: { ScaleX = x; ScaleY = y; - DisplayWidth = x * TexelWidth; - DisplayHeight = y * TexelHeight; + DisplayWidth = TexelWidth / x; + DisplayHeight = TexelHeight / y; } const SpritePositioningInfo& GetSpritePositioning(int which) { if (spi == nullptr) SetupSpriteData(); return spi[which]; } diff --git a/src/common/textures/hires/hqresize.cpp b/src/common/textures/hires/hqresize.cpp index 2e7b2fb06..fe5beda4e 100644 --- a/src/common/textures/hires/hqresize.cpp +++ b/src/common/textures/hires/hqresize.cpp @@ -514,7 +514,7 @@ int calcShouldUpscale(FGameTexture *tex) return 0; // 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 CTF_Upscale; diff --git a/src/common/textures/multipatchtexturebuilder.cpp b/src/common/textures/multipatchtexturebuilder.cpp index d95c681dc..1ee363493 100644 --- a/src/common/textures/multipatchtexturebuilder.cpp +++ b/src/common/textures/multipatchtexturebuilder.cpp @@ -901,7 +901,6 @@ void FMultipatchTextureBuilder::ResolveAllPatches() !buildinfo.bComplex) { AddImageToTexture(buildinfo.Parts[0].TexImage, buildinfo); - buildinfo.texture->Setup(buildinfo.Parts[0].TexImage); done = true; } } diff --git a/src/common/textures/texturemanager.cpp b/src/common/textures/texturemanager.cpp index c7cffd07c..80458a6ab 100644 --- a/src/common/textures/texturemanager.cpp +++ b/src/common/textures/texturemanager.cpp @@ -625,8 +625,8 @@ void FTextureManager::AddHiresTextures (int wadnum) auto gtex = MakeGameTexture(newtex, nullptr, ETextureType::Override); gtex->SetWorldPanning(true); 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(1, xs_RoundToInt(oldtex->GetDisplayLeftOffset(1) * gtex->GetScaleX()), xs_RoundToInt(oldtex->GetDisplayTopOffset(1) * gtex->GetScaleY())); + gtex->SetOffsets(0, oldtex->GetTexelLeftOffset(0), oldtex->GetTexelTopOffset(0)); + gtex->SetOffsets(1, oldtex->GetTexelLeftOffset(1), oldtex->GetTexelTopOffset(1)); ReplaceTexture(tlist[i], gtex, true); } }