Deprecating Inventory.DrawPowerup

Here, developers communicate stuff that does not go onto the main News section or the front page of the site.
[Dev Blog] [Development Builds] [Git Change Log] [GZDoom Github Repo]

Moderator: GZDoom Developers

User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Deprecating Inventory.DrawPowerup

Post by Graf Zahl »

As my work on the status bar code progresses, this function turns out to be somewhat of an obstacle, because it completely hands over control to the actual powerup, of how the powerup's HUD icon gets drawn. Needless to say, this is not good, because it totally prevents new status bars from handling this part differently. The present approach also has other problems that are better dealt with a drawer that is under full control by the status bar

So, as of now, please consider this function deprecated. Unlike other deprecations, this one will render the function inoperable, because there is no way to keep it working while at the same time add a new function that merely queries the item for an appropriate icon to display, which then will be handled under full control by the status bar itself.

I am sorry that this function had to be in the exported interface but this was needed to continue work - only now the time has come to fix this design flaw.

Another part that needs to be considered deprecated is the DrawTexture constant DTA_HUDRules, which is directly related to the same issue. The problem here is simple: None of the low level HUD code is capable of handling arbitrary HUD scales, it's either 320x200 upscaled or completely unscaled (and on high resolutions far too small) graphics. DTA_HUDRules was the main reason why this was basically unfixable, but the newly written status bar drawers, along with the SBARINFO drawers, will be far more easily changed than trying to handle it in the rendering backend.

If you use this draw mode constant, please change your code, because it will not adjust once the HUD scaling gets reworked.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Deprecating Inventory.DrawPowerup

Post by Major Cooke »

I'm not very good at dealing with the sbarinfo stuff itself, so how can I tell what type of draw mode one is using?
User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine
Contact:

Re: Deprecating Inventory.DrawPowerup

Post by ZZYZX »

I believe it relates to ZScript code that uses this draw tag. If this broke SBARINFO in any way, it's a critical compatibility bug.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Deprecating Inventory.DrawPowerup

Post by Major Cooke »

User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Deprecating Inventory.DrawPowerup

Post by Graf Zahl »

This did not break anything. SBARINFO does not use DTA_HUDRules - for the exact same reason that I deprecated it after eliminating everything that used it.
I haven't even touched the SBARINFO code That intentionally completely sidesteps the status bar's internals and runs on a separate copy, to avoid any interference.

Ans when did that break? The report is a bit vague...
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Deprecating Inventory.DrawPowerup

Post by Major Cooke »

The hud positioning. Here's a picture included with the report. See the hud drawing over the pistol?

Here's 2.4 for comparison.

When? I don't know. I just tried switching from 2.4 to 2.5 today's commit and that's what I got.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Deprecating Inventory.DrawPowerup

Post by Major Cooke »

Found it. This commit broke it.
User avatar
Kroc
Posts: 116
Joined: Sun Oct 02, 2016 11:37 am
Graphics Processor: Intel (Modern GZDoom)
Contact:

Re: Deprecating Inventory.DrawPowerup

Post by Kroc »

Graf Zahl wrote:Unlike other deprecations, this one will render the function inoperable, because there is no way to keep it working
Hello Graf; what happens when a WAD is loaded containing the deprecated function? Does it give a warning or an error? I ask because I'm making a launcher-cum-wad-collection and compatibility is very difficult to gauge. If a game is broken without knowing it clearly, it makes my life very difficult. It would help if every time something is deprecated GZDoom would tell me specifically "this was removed, use GZDoom < v3.0" etc. I have a script to select the correct engine/version/parameters etc for any given WAD, but the 'compatiblity bugs x versions' matrix is depressingly humongous.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Deprecating Inventory.DrawPowerup

Post by Graf Zahl »

Since there is now a versioning mechanism, normally nothing should happen.

DrawPowerup was a special case because it could not be kept at all. It was ultimately a very misguided way of implementing this so I chose to remove it and make an announcement.
User avatar
Kroc
Posts: 116
Joined: Sun Oct 02, 2016 11:37 am
Graphics Processor: Intel (Modern GZDoom)
Contact:

Re: Deprecating Inventory.DrawPowerup

Post by Kroc »

I'm sorry Graf, that doesn't answer my question, forgive my ignorance -- if I load a WAD using the deprecated method in GZDoom 3, does GZDoom tell me that the method is deprecated or does the WAD play and I just have to work out for myself what is broken? What I am needing is a clear, definitive and easy way to know if a particular WAD works or does not work with the latest-and-greatest GZDoom.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Deprecating Inventory.DrawPowerup

Post by Graf Zahl »

Neither. It won't tell you that the method is deprecated and it won't stop working. Deprecated functions are kept, but due to the versioning system the message will only be printed if you declare support for the newer version.
User avatar
Kroc
Posts: 116
Joined: Sun Oct 02, 2016 11:37 am
Graphics Processor: Intel (Modern GZDoom)
Contact:

Re: Deprecating Inventory.DrawPowerup

Post by Kroc »

Aha, I finally see. I assumed you had removed the function entirely. So, in a later version when such functionality is removed entirely -- if ever it is -- there'll be some kind of hard warning to make it clear I assume.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Deprecating Inventory.DrawPowerup

Post by Graf Zahl »

It depends. In case of DrawPowerup there still is a function, but it is never called because icons are now drawn differently. This function is a big exception, normally functions get deprecated because their functionality is better exposed by something new.
User avatar
Tormentor667
Posts: 13530
Joined: Wed Jul 16, 2003 3:52 am
Contact:

Re: Deprecating Inventory.DrawPowerup

Post by Tormentor667 »

My question is: What happens to old mods using that function? Does it break old mods?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Deprecating Inventory.DrawPowerup

Post by Graf Zahl »

There are no old mods. This function was only exported in GDoom 2.4.0 and officially available for exactly 5 days before it got deprecated. Enough time for everyone to adjust.
Post Reply

Return to “Developer Blog”