- 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.
This commit is contained in:
Christoph Oelckers 2021-04-04 21:00:41 +02:00
parent 9828cd7129
commit 8e31c34b06
2 changed files with 3 additions and 2 deletions

View file

@ -363,6 +363,7 @@ static int32_t defsparser(scriptfile *script)
{ "rffdefineid", T_RFFDEFINEID }, // dummy { "rffdefineid", T_RFFDEFINEID }, // dummy
}; };
script->SetNoOctals(true);
while (1) while (1)
{ {
#ifdef USE_DEF_PROGRESS #ifdef USE_DEF_PROGRESS

View file

@ -499,7 +499,7 @@ CCMD(tilecrc)
int tileImportFromTexture(const char* fn, int tilenum, int alphacut, int istexture) 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; if (!texid.isValid()) return -1;
auto tex = TexMan.GetGameTexture(texid); 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) if (xsiz <= 0 || ysiz <= 0)
return -2; 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); tex = MakeGameTexture(tex->GetTexture(), FStringf("#%05d", tilenum), ETextureType::Override);
TexMan.AddGameTexture(tex); TexMan.AddGameTexture(tex);
TileFiles.tiledata[tilenum].backup = TileFiles.tiledata[tilenum].texture = tex; TileFiles.tiledata[tilenum].backup = TileFiles.tiledata[tilenum].texture = tex;