mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-12-01 08:31:45 +00:00
- fixed offsets for hires replacements of already scaled textures.
This commit is contained in:
parent
9c7f5e941e
commit
db93f2969e
1 changed files with 12 additions and 4 deletions
|
@ -625,8 +625,12 @@ 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->GetTexelLeftOffset(0) * gtex->GetScaleX()), xs_RoundToInt(oldtex->GetTexelTopOffset(0) * gtex->GetScaleY()));
|
double xscale1 = oldtex->GetTexelLeftOffset(0) * gtex->GetScaleX() / oldtex->GetScaleX();
|
||||||
gtex->SetOffsets(1, xs_RoundToInt(oldtex->GetTexelLeftOffset(1) * gtex->GetScaleX()), xs_RoundToInt(oldtex->GetTexelTopOffset(1) * gtex->GetScaleY()));
|
double xscale2 = oldtex->GetTexelLeftOffset(1) * gtex->GetScaleX() / oldtex->GetScaleX();
|
||||||
|
double yscale1 = oldtex->GetTexelTopOffset(0) * gtex->GetScaleY() / oldtex->GetScaleY();
|
||||||
|
double yscale2 = oldtex->GetTexelTopOffset(1) * gtex->GetScaleY() / oldtex->GetScaleY();
|
||||||
|
gtex->SetOffsets(0, xs_RoundToInt(xscale1), xs_RoundToInt(yscale1));
|
||||||
|
gtex->SetOffsets(1, xs_RoundToInt(xscale2), xs_RoundToInt(yscale2));
|
||||||
ReplaceTexture(tlist[i], gtex, true);
|
ReplaceTexture(tlist[i], gtex, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -721,8 +725,12 @@ void FTextureManager::ParseTextureDef(int lump, FMultipatchTextureBuilder &build
|
||||||
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->GetTexelLeftOffset(0) * gtex->GetScaleX()), xs_RoundToInt(oldtex->GetTexelTopOffset(0) * gtex->GetScaleY()));
|
double xscale1 = oldtex->GetTexelLeftOffset(0) * gtex->GetScaleX() / oldtex->GetScaleX();
|
||||||
gtex->SetOffsets(1, xs_RoundToInt(oldtex->GetTexelLeftOffset(1) * gtex->GetScaleX()), xs_RoundToInt(oldtex->GetTexelTopOffset(1) * gtex->GetScaleY()));
|
double xscale2 = oldtex->GetTexelLeftOffset(1) * gtex->GetScaleX() / oldtex->GetScaleX();
|
||||||
|
double yscale1 = oldtex->GetTexelTopOffset(0) * gtex->GetScaleY() / oldtex->GetScaleY();
|
||||||
|
double yscale2 = oldtex->GetTexelTopOffset(1) * gtex->GetScaleY() / oldtex->GetScaleY();
|
||||||
|
gtex->SetOffsets(0, xs_RoundToInt(xscale1), xs_RoundToInt(yscale1));
|
||||||
|
gtex->SetOffsets(1, xs_RoundToInt(xscale2), xs_RoundToInt(yscale2));
|
||||||
ReplaceTexture(tlist[i], gtex, true);
|
ReplaceTexture(tlist[i], gtex, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue