Deprecating Inventory.DrawPowerup
Moderator: GZDoom Developers
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49071
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Deprecating Inventory.DrawPowerup
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.
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.
- Major Cooke
- Posts: 8176
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: Deprecating Inventory.DrawPowerup
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?
Re: Deprecating Inventory.DrawPowerup
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.
- Major Cooke
- Posts: 8176
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49071
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Deprecating Inventory.DrawPowerup
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...
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...
- Major Cooke
- Posts: 8176
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: Deprecating Inventory.DrawPowerup
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.
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.
- Major Cooke
- Posts: 8176
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Location: QZDoom Maintenance Team
Re: Deprecating Inventory.DrawPowerup
Found it. This commit broke it.
- Kroc
- Posts: 116
- Joined: Sun Oct 02, 2016 11:37 am
- Graphics Processor: Intel (Modern GZDoom)
- Contact:
Re: Deprecating Inventory.DrawPowerup
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.Graf Zahl wrote:Unlike other deprecations, this one will render the function inoperable, because there is no way to keep it working
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49071
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Deprecating Inventory.DrawPowerup
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.
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.
- Kroc
- Posts: 116
- Joined: Sun Oct 02, 2016 11:37 am
- Graphics Processor: Intel (Modern GZDoom)
- Contact:
Re: Deprecating Inventory.DrawPowerup
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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49071
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Deprecating Inventory.DrawPowerup
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.
- Kroc
- Posts: 116
- Joined: Sun Oct 02, 2016 11:37 am
- Graphics Processor: Intel (Modern GZDoom)
- Contact:
Re: Deprecating Inventory.DrawPowerup
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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49071
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Deprecating Inventory.DrawPowerup
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.
- Tormentor667
- Posts: 13533
- Joined: Wed Jul 16, 2003 3:52 am
- Contact:
Re: Deprecating Inventory.DrawPowerup
My question is: What happens to old mods using that function? Does it break old mods?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49071
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Deprecating Inventory.DrawPowerup
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.