Problems with COMPATF_SHORTTEX [.96]

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Problems with COMPATF_SHORTTEX [.96]

by Graf Zahl » Mon Apr 10, 2006 2:31 pm

fixed

Problems with COMPATF_SHORTTEX [.96]

by Graf Zahl » Wed May 11, 2005 2:42 pm

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]);

Top