From 73032c2f3dd69ad237d20f5fe75d695bff33942f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 17 Sep 2006 15:45:27 +0000 Subject: [PATCH] - Fixed: Texture scale calculations for HIRESTEX were incorrect. SVN r330 (trunk) --- docs/rh-log.txt | 1 + src/r_data.cpp | 14 ++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 98be689d6..c3bb4fed6 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,5 @@ September 17, 2006 (Changes by Graf Zahl) +- Fixed: Texture scale calculations for HIRESTEX were incorrect. - Fixed: The sky scrolling calculations caused an integer multiplication overflow. - Fixed: Voodoo dolls should not start ENTER scripts. - Fixed: ActorDamage must not parse the enclosing parentheses as part of the diff --git a/src/r_data.cpp b/src/r_data.cpp index 823259881..f67a6606f 100644 --- a/src/r_data.cpp +++ b/src/r_data.cpp @@ -386,10 +386,10 @@ void FTextureManager::LoadHiresTex() FTexture * newtex = FTexture::CreateTexture (lumpnum, FTexture::TEX_Any); // Replace the entire texture and adjust the scaling and offset factors. - newtex->ScaleX = 8 * newtex->GetWidth() / oldtex->GetWidth(); - newtex->ScaleY = 8 * newtex->GetHeight() / oldtex->GetHeight(); - newtex->LeftOffset = MulScale3(oldtex->LeftOffset, newtex->ScaleX); - newtex->TopOffset = MulScale3(oldtex->TopOffset, newtex->ScaleY); + newtex->ScaleX = 8 * newtex->GetWidth() / oldtex->GetScaledWidth(); + newtex->ScaleY = 8 * newtex->GetHeight() / oldtex->GetScaledHeight(); + newtex->LeftOffset = MulScale3(oldtex->GetScaledLeftOffset(), newtex->ScaleX); + newtex->TopOffset = MulScale3(oldtex->GetScaledTopOffset(), newtex->ScaleY); ReplaceTexture(tex, newtex, true); } } @@ -415,10 +415,8 @@ void FTextureManager::LoadHiresTex() FTexture *newtex = FTexture::CreateTexture(lumpnum, FTexture::TEX_Override); // Replace the entire texture and adjust the scaling and offset factors. - newtex->ScaleX = 8 * width / newtex->GetWidth(); - newtex->ScaleY = 8 * height / newtex->GetHeight(); - newtex->LeftOffset = MulScale3(newtex->LeftOffset, newtex->ScaleX); - newtex->TopOffset = MulScale3(newtex->TopOffset, newtex->ScaleY); + newtex->ScaleX = 8 * newtex->GetWidth() / width; + newtex->ScaleY = 8 * newtex->GetHeight() / height; memcpy(newtex->Name, src, sizeof(newtex->Name)); int oldtex = TexMan.CheckForTexture(src, FTexture::TEX_Override);