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

Deprecating Inventory.DrawPowerup

Postby Graf Zahl » Fri Mar 24, 2017 3:08 pm

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Deprecating Inventory.DrawPowerup

Postby Major Cooke » Fri Mar 24, 2017 6:15 pm

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
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007

Re: Deprecating Inventory.DrawPowerup

Postby ZZYZX » Fri Mar 24, 2017 6:33 pm

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
ZZYZX
le chat du rabbin
 
 
 
Joined: 14 Oct 2012
Location: Ukraine

Re: Deprecating Inventory.DrawPowerup

Postby Major Cooke » Fri Mar 24, 2017 6:35 pm

User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007

Re: Deprecating Inventory.DrawPowerup

Postby Graf Zahl » Fri Mar 24, 2017 6:44 pm

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Deprecating Inventory.DrawPowerup

Postby Major Cooke » Fri Mar 24, 2017 6:49 pm

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
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007

Re: Deprecating Inventory.DrawPowerup

Postby Major Cooke » Sat Mar 25, 2017 12:37 pm

Found it. This commit broke it.
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007

Re: Deprecating Inventory.DrawPowerup

Postby Kroc » Fri Apr 21, 2017 10:17 am

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
Kroc
PortaDOOM, DOOM-Crusher
 
Joined: 02 Oct 2016
Github ID: Kroc
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: Intel (Modern GZDoom)

Re: Deprecating Inventory.DrawPowerup

Postby Graf Zahl » Fri Apr 21, 2017 10:51 am

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Deprecating Inventory.DrawPowerup

Postby Kroc » Fri Apr 21, 2017 12:34 pm

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
Kroc
PortaDOOM, DOOM-Crusher
 
Joined: 02 Oct 2016
Github ID: Kroc
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: Intel (Modern GZDoom)

Re: Deprecating Inventory.DrawPowerup

Postby Graf Zahl » Fri Apr 21, 2017 12:49 pm

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Deprecating Inventory.DrawPowerup

Postby Kroc » Fri Apr 21, 2017 12:52 pm

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
Kroc
PortaDOOM, DOOM-Crusher
 
Joined: 02 Oct 2016
Github ID: Kroc
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: Intel (Modern GZDoom)

Re: Deprecating Inventory.DrawPowerup

Postby Graf Zahl » Fri Apr 21, 2017 1:00 pm

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
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Deprecating Inventory.DrawPowerup

Postby Tormentor667 » Sat Apr 22, 2017 8:25 am

My question is: What happens to old mods using that function? Does it break old mods?
User avatar
Tormentor667
needs more detail
 
Joined: 16 Jul 2003
Location: Germany

Re: Deprecating Inventory.DrawPowerup

Postby Graf Zahl » Sat Apr 22, 2017 8:29 am

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.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Next

Return to Developer Blog

Who is online

Users browsing this forum: No registered users and 1 guest