mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
- fixed texture scaling setup in a few places.
This commit is contained in:
parent
5611fe0f41
commit
763e9e0f35
4 changed files with 6 additions and 6 deletions
|
@ -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]; }
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -901,7 +901,6 @@ void FMultipatchTextureBuilder::ResolveAllPatches()
|
|||
!buildinfo.bComplex)
|
||||
{
|
||||
AddImageToTexture(buildinfo.Parts[0].TexImage, buildinfo);
|
||||
buildinfo.texture->Setup(buildinfo.Parts[0].TexImage);
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue