From 8e31c34b06d04f7d13e71badb973fc2cb965abd9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 4 Apr 2021 21:00:41 +0200 Subject: [PATCH] - fixed tileImportFromTexture. * the parser read numbers with leading zeros as octal, which is not wanted here * texture lookup by file name must be forced for root directory entries. --- source/build/src/defs.cpp | 1 + source/core/textures/buildtiles.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/build/src/defs.cpp b/source/build/src/defs.cpp index 137a0d701..0ed7faeb5 100644 --- a/source/build/src/defs.cpp +++ b/source/build/src/defs.cpp @@ -363,6 +363,7 @@ static int32_t defsparser(scriptfile *script) { "rffdefineid", T_RFFDEFINEID }, // dummy }; + script->SetNoOctals(true); while (1) { #ifdef USE_DEF_PROGRESS diff --git a/source/core/textures/buildtiles.cpp b/source/core/textures/buildtiles.cpp index 653dd717c..07efd696f 100644 --- a/source/core/textures/buildtiles.cpp +++ b/source/core/textures/buildtiles.cpp @@ -499,7 +499,7 @@ CCMD(tilecrc) int tileImportFromTexture(const char* fn, int tilenum, int alphacut, int istexture) { - FTextureID texid = TexMan.CheckForTexture(fn, ETextureType::Any); + FTextureID texid = TexMan.CheckForTexture(fn, ETextureType::Any, FTextureManager::TEXMAN_ForceLookup); if (!texid.isValid()) return -1; auto tex = TexMan.GetGameTexture(texid); @@ -508,7 +508,7 @@ int tileImportFromTexture(const char* fn, int tilenum, int alphacut, int istextu if (xsiz <= 0 || ysiz <= 0) return -2; - // create a new game texture here - we want to give it a new name! + // create a new game texture here - we want to give it a different name! tex = MakeGameTexture(tex->GetTexture(), FStringf("#%05d", tilenum), ETextureType::Override); TexMan.AddGameTexture(tex); TileFiles.tiledata[tilenum].backup = TileFiles.tiledata[tilenum].texture = tex;