[Fixed] [r850 and before] Texture manager can't find SKIN faces

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

[r850 and before] Texture manager can't find SKIN faces

Postby MartinHowe » Tue Mar 25, 2008 9:29 am

Please refer to this thread, for which Graf provided a temporary fix by reverting the change; I have also experienced crashes when using SKINs and SBARINFO at the same time.

The underlying cause is that the texture manager includes a search algorithm at line 105 of texturemanager.cpp and this fails to find a graphic if it is a face image provided by a skin. In the case of SBARINFO, DrawMugShot calls the texture manager, which cannot find the status face in the texure collection and returns a null pointer -- which gets returned into the "face" variable at line 1244 of sbarinfo_display.cpp and the rest of the mugshot code duly tries to dereference :evil:

This problem does NOT occur if the skin is not in force and the DOOM2 IWAD STFs are thus used.

To reproduce:
1) Download this SKIN wad.
2) Download this SBARINFO wad.
3) Start ZDoom without the HUD wad, and set the player to use the CUTMANMIKE skin then quit ZDoom.
4) Start ZDoom again but with the HUD wad.
5) Result = access violation in GetScaledWidth() on line 817 of r_defs.h

I don't know the heck about the internals of the texture manager, so sorry Graf/Randy - this one's your baby :)
User avatar
MartinHowe
In space, no-one can hear you KILL an ALIEN
 
Joined: 11 Aug 2003
Location: Waveney, United Kingdom

Re: [r850 and before] Texture manager can't find SKIN faces

Postby Graf Zahl » Tue Mar 25, 2008 9:53 am

No, this one's Blzut's baby. ;)

The Doom status bar does find the face textures because it explicitly looks for them (See FDoomStatusBar::SetFace.) But from what I gathered from the SBARINFO code it doesn't set the texture namespace for this case properly.

And BTW, the fix in the other thread is not temporary. The code should have never been removed and was the direct cause of the face not working anymore.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [r850 and before] Texture manager can't find SKIN faces

Postby MartinHowe » Tue Mar 25, 2008 11:32 am

You mean the "usetype" argument should be the skin's namespace (presumably 0 is ns_global, which is why it works for STF)?
User avatar
MartinHowe
In space, no-one can hear you KILL an ALIEN
 
Joined: 11 Aug 2003
Location: Waveney, United Kingdom

Re: [r850 and before] Texture manager can't find SKIN faces

Postby Graf Zahl » Tue Mar 25, 2008 11:53 am

No. The textures for skin faces don't exist normally - they have to be created when used for the first time. That's where FTextureManager::AddPatch comes into play. It gets passed a WAD namespace identifier which is retrieved from the skin.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [r850 and before] Texture manager can't find SKIN faces

Postby Blzut3 » Tue Mar 25, 2008 1:22 pm

I'm posting here to say that I have read this and will get to fixing it as soon as possible. However, as soon as possible might not be until Thursday or later.
Blzut3
Pronounced: B-l-zut
 
 
 
Joined: 24 Nov 2004
Github ID: Blzut3
Operating System: Debian-like Linux (Debian, Ubuntu, Kali, Mint, etc) 64-bit
Graphics Processor: ATI/AMD with Vulkan Support

Re: [r850 and before] Texture manager can't find SKIN faces

Postby MartinHowe » Tue Mar 25, 2008 5:51 pm

OK, I have found a fix for the STF thing - basically all skin faces are entered into the image list with their own namespaces during the statusbar display initialisation; I'll post a cleaned-up diff of this later. Cuttys CUT status face works with a fullscreen weasel HUD, yee-haa!

Now I have to find out why it crashes in drawswitchableimage :(

EDIT: Posted STF fix diff. Still have to find out why drawswitchableimage crashes zdoom!
User avatar
MartinHowe
In space, no-one can hear you KILL an ALIEN
 
Joined: 11 Aug 2003
Location: Waveney, United Kingdom

Re: [r850 and before] Texture manager can't find SKIN faces

Postby Graf Zahl » Wed Mar 26, 2008 3:05 am

Added the diff.

Bug left open for the crash.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [r850 and before] Texture manager can't find SKIN faces

Postby MartinHowe » Wed Mar 26, 2008 5:04 pm

In case Blutz3 is reading this, I have narrowed down the drawswitchableimage crash - it happens when you do not possess the corresponding weapon. Commenting out all but 1 and 2 works, because you start with fist and pistol. Uncommenting 3 crashes, but if you do +give supershotgun on the command-line starting zdoom, it doesn't crash. I shall investigate further -- when I have the time... :)
User avatar
MartinHowe
In space, no-one can hear you KILL an ALIEN
 
Joined: 11 Aug 2003
Location: Waveney, United Kingdom

Re: [r850 and before] Texture manager can't find SKIN faces

Postby MartinHowe » Wed Mar 26, 2008 5:21 pm

OK, the problem is that 'Weasel is using "" instead of "nullimage" when he wants no image displayed. This either means changing the parser to treat "" as equivalent to "nullimage", which is kinda consistent with the rest of ZDoom, or else documenting in the Wiki that "" isn't acceptable and rejecting an empty string as an error.

Opinions?

EDIT:

I patched sbarinfo_parser.cpp line 1077 of my working copy
from if((stricmp(patchname, "nullimage") == 0) to if ((stricmp(patchname, "nullimage") == 0) || (patchname[0]==0))
for the moment, but should it be allowed, that's the question... :?
User avatar
MartinHowe
In space, no-one can hear you KILL an ALIEN
 
Joined: 11 Aug 2003
Location: Waveney, United Kingdom

Re: [r850 and before] Texture manager can't find SKIN faces

Postby wildweasel » Wed Mar 26, 2008 8:06 pm

I think that "" should be accepted in addition to "nullimage" to draw nothing - since it's already got a precedent (in Decorate, something like Inventory.Icon "" would clear an existing inventory icon for an item that inherits from another, etc).
User avatar
wildweasel
change o' pace.
Moderator Team Lead
 
Joined: 16 Jul 2003

Re: [r850 and before] Texture manager can't find SKIN faces

Postby Graf Zahl » Thu Mar 27, 2008 2:08 am

"" should always be a placeholder for 'nothing'.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: [r850 and before] Texture manager can't find SKIN faces

Postby MartinHowe » Thu Mar 27, 2008 4:15 am

That's what I thought.

Graf, please would you apply the informal patch I gave above and close this thread? It's all that's needed for this problem. Of course, when Mancubus is back up (so that it can be committed) it is anybody's guess :(
User avatar
MartinHowe
In space, no-one can hear you KILL an ALIEN
 
Joined: 11 Aug 2003
Location: Waveney, United Kingdom

Re: [r850 and before] Texture manager can't find SKIN faces

Postby Blzut3 » Thu Mar 27, 2008 12:54 pm

Yeah, nullimage is a carry over from before I switched to the token parser.
Blzut3
Pronounced: B-l-zut
 
 
 
Joined: 24 Nov 2004
Github ID: Blzut3
Operating System: Debian-like Linux (Debian, Ubuntu, Kali, Mint, etc) 64-bit
Graphics Processor: ATI/AMD with Vulkan Support

Re: [r850 and before] Texture manager can't find SKIN faces

Postby randi » Thu Mar 27, 2008 6:07 pm

Done. I trust this is all fixed now?
User avatar
randi
Site Admin
 
Joined: 10 Jul 2003

Re: [r850 and before] Texture manager can't find SKIN faces

Postby MartinHowe » Thu Mar 27, 2008 6:19 pm

Well unless Blutz3 has anything to add -- well then it's fixed all right - just have a look at this Feature Suggestions thread :wink: (especially the last screenshot, taken with DOOM style weaponry in a rather un-Doom-like map :) )
User avatar
MartinHowe
In space, no-one can hear you KILL an ALIEN
 
Joined: 11 Aug 2003
Location: Waveney, United Kingdom


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 0 guests