- transitioned all tileLeftOffset and tileTopOffset calls to use the texture manager.

This commit is contained in:
Christoph Oelckers 2022-12-06 20:49:49 +01:00
parent e37de147dc
commit f479f995a1
13 changed files with 71 additions and 53 deletions

View file

@ -160,12 +160,13 @@ void processTileImport(const char* cmd, FScriptPosition& pos, TileImport& imp)
// This is not quite the same as originally, for two reasons:
// 1: Since these are texture properties now, there's no need to clear them.
// 2: The original code assumed that an imported texture cannot have an offset. But this can import Doom patches and PNGs with grAb, so the situation is very different.
if (imp.xoffset == INT_MAX) imp.xoffset = tileLeftOffset(imp.tile);
auto tex = tileGetTexture(imp.tile);
if (imp.xoffset == INT_MAX) imp.xoffset = tex->GetTexelLeftOffset();
else imp.xoffset = clamp(imp.xoffset, -128, 127);
if (imp.yoffset == INT_MAX) imp.yoffset = tileTopOffset(imp.tile);
if (imp.yoffset == INT_MAX) imp.yoffset = tex->GetTexelTopOffset();
else imp.yoffset = clamp(imp.yoffset, -128, 127);
auto tex = tileGetTexture(imp.tile);
if (tex)
{
tex->SetOffsets(imp.xoffset, imp.yoffset);