Problems with COMPATF_SHORTTEX [.96]

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49225
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Problems with COMPATF_SHORTTEX [.96]

Post by Graf Zahl »

After experiencing some odd situations in Memento Mori 2 which needs this compatibility flag in a few maps I looked at all the code involved.

Then I found this in FTextureManager::AddTexturesLump:

Code: Select all

		if (i == 1 && texture1)
		{
			// The very first texture is just a dummy. Copy its dimensions to texture 0.
			// It still needs to be created in case someone uses it by name.
			offset = LONG(directory[0]);
			const maptexture_t *tex = (const maptexture_t *)((const BYTE *)maptex + offset);
			FDummyTexture *tex0 = static_cast<FDummyTexture *>(Textures[0].Texture);
			tex0->SetSize (SAFESHORT(tex->width), SAFESHORT(tex->height));
		}
It reads the number of textures in the TEXTURE1 lump and treats it as the offset to the first texture. Result: Some random value gets set as height of texture 0 which breaks the compatibility flag.

It should be:

Code: Select all

			offset = LONG(directory[1]);
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49225
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Post by Graf Zahl »

fixed
Post Reply

Return to “Closed Bugs [GZDoom]”