- fixed: The mutipatch texture builder did not set the source lump.

This commit is contained in:
Christoph Oelckers 2020-06-08 23:00:06 +02:00
parent 58bc12ee19
commit a330b46d1a
4 changed files with 10 additions and 7 deletions

View file

@ -170,6 +170,6 @@ public:
}
void AddTexturesLumps(int lump1, int lump2, int patcheslump);
void ParseTexture(FScanner &sc, ETextureType usetype);
void ParseTexture(FScanner &sc, ETextureType usetype, int deflump);
void ResolveAllPatches();
};

View file

@ -606,7 +606,7 @@ void FMultipatchTextureBuilder::ParsePatch(FScanner &sc, BuildInfo &info, TexPar
//
//==========================================================================
void FMultipatchTextureBuilder::ParseTexture(FScanner &sc, ETextureType UseType)
void FMultipatchTextureBuilder::ParseTexture(FScanner &sc, ETextureType UseType, int deflump)
{
BuildInfo &buildinfo = BuiltTextures[BuiltTextures.Reserve(1)];
@ -637,6 +637,7 @@ void FMultipatchTextureBuilder::ParseTexture(FScanner &sc, ETextureType UseType)
sc.MustGetStringName(",");
sc.MustGetNumber();
buildinfo.Height = sc.Number;
buildinfo.DefinitionLump = deflump;
bool offset2set = false;
if (sc.CheckString("{"))
@ -911,6 +912,7 @@ void FMultipatchTextureBuilder::ResolveAllPatches()
{
auto img = new FMultiPatchTexture(buildinfo.Width, buildinfo.Height, buildinfo.Parts, buildinfo.bComplex, buildinfo.textual);
auto itex = new FImageTexture(img);
itex->SetSourceLump(buildinfo.DefinitionLump);
AddImageToTexture(itex, buildinfo);
}
BuiltTextures.Delete(i);

View file

@ -782,23 +782,23 @@ void FTextureManager::ParseTextureDef(int lump, FMultipatchTextureBuilder &build
}
else if (sc.Compare("texture"))
{
build.ParseTexture(sc, ETextureType::Override);
build.ParseTexture(sc, ETextureType::Override, lump);
}
else if (sc.Compare("sprite"))
{
build.ParseTexture(sc, ETextureType::Sprite);
build.ParseTexture(sc, ETextureType::Sprite, lump);
}
else if (sc.Compare("walltexture"))
{
build.ParseTexture(sc, ETextureType::Wall);
build.ParseTexture(sc, ETextureType::Wall, lump);
}
else if (sc.Compare("flat"))
{
build.ParseTexture(sc, ETextureType::Flat);
build.ParseTexture(sc, ETextureType::Flat, lump);
}
else if (sc.Compare("graphic"))
{
build.ParseTexture(sc, ETextureType::MiscPatch);
build.ParseTexture(sc, ETextureType::MiscPatch, lump);
}
else if (sc.Compare("#include"))
{

View file

@ -253,6 +253,7 @@ public:
bool isCanvas() const { return bHasCanvas; }
int GetSourceLump() { return SourceLump; } // needed by the scripted GetName method.
void SetSourceLump(int sl) { SourceLump = sl; }
bool FindHoles(const unsigned char * buffer, int w, int h);
void CopySize(FTexture* BaseTexture)