OverlayX/Y + Flags/Offset Enhancements

Moderator: GZDoom Developers

User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

OverlayX/Y + Flags/Offset Enhancements

Post by Major Cooke »

Pull Request
  • OverlayX/Y - Retrieves the X/Y coordinates of the overlay. Interprets layer 0 as 'this layer'.
  • A_OverlayOffset - Now interprets 0 as 'this layer' instead of nothing.
  • A_OverlayFlags - Now interprets 0 as 'this layer' instead of nothing.
Leonard2 suggested to me the idea of layer 0 meaning 'this layer' after seeing OverlayID so I thought I'd include it in one.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: OverlayX/Y + Flags/Offset Enhancements

Post by Rachael »

What project is this that's requiring all these overlay enhancements?

I'm not trying to be mean or anything but these overlay additions all seem to be singularly focused.

I guess the more important question is what applications does this actually have for ZDoom in general, rather than said mod, but I guess both questions are actually really important in this case.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: OverlayX/Y + Flags/Offset Enhancements

Post by Major Cooke »

Doom 4 for Doom. There's a feature I plan on which is going to be extremely reliant on this, though I won't begin working on it until after this next forthcoming release. The feature is going to be huge and these enhancements will greatly reduce the amount of pain I go through. If you're curious about what it is, you (eruanna) and graf/randi can send me a PM inquiring what it is, considering the 'trusted programmer' rule stuffs. Can't talk about it in public -- DBThanatos has an 'NDA' of sorts in effect. I'll have him post confirmation later if needed that we indeed go by it.

I've already laid out plans and everything. I'm just waiting for the next release to get out the door on that one.

Many of my submissions seem niche, but I just happen to desire a better way to manipulate and use them without resorting to overdriven code bloat that could be solved with simple functionality improvements.
Spoiler:
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: OverlayX/Y + Flags/Offset Enhancements

Post by Rachael »

I am not a trusted programmer so my word is zilch on this, and so is my qualification for being the one that crosses your NDA line - therefore, the best kept secret is the one I'm not told - at least, in this instance. I can only predict the sentiments that will come as a result of this and I've found usually (though not always) I am right. However, that being said, nothing looks too bad from what I can see, only one line gives me any red flag but only because I don't really know what it does.

That being said, yes, your submissions do tend to be a bit niche, but that's not altogether a bad thing by itself. The problems that it causes, however, is it creates a bit of bloat - and the more that needs to be done, the more hacks you tend to have to program in. Every hack changes the way a certain function behaves, and every hack that has to be added has nearly a 100% success rate of interfering with another feature or bug fix down the line, so even if the effects of the hack are not immediate, they will cause problems eventually.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: OverlayX/Y + Flags/Offset Enhancements

Post by Major Cooke »

This is neither code bloat nor a hack. It's exposing the X and Y position storage. Even Leonard said this is something that aught to be relatively good and it will be EXTREMELY useful for actor overlays if that gets in. Though at this point I wouldn't be surprised if Zscript supercedes it entirely. So I wouldn't be surprised if everything from here on out is WFZS'd for the time being.

What line red-flags for you?
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: OverlayX/Y + Flags/Offset Enhancements

Post by Rachael »

Just this one: https://github.com/rheit/zdoom/pull/842 ... 196f7R1036 - like I said, it's probably just because I don't know what it does. The reason it red-flags me is because you replaced a nullptr check.
Though at this point I wouldn't be surprised if Zscript supercedes it entirely.
I had actually written up a much longer post predicting exactly this, but I deleted most of it before I submitted that. >_>
This is neither code bloat nor a hack.
I know. I didn't say this was, I was just saying in general.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: OverlayX/Y + Flags/Offset Enhancements

Post by Major Cooke »

Oh. That line actually includes the same check plus a few others that are necessary in order to retrieve the function mPSPIndex which is what makes OverlayID tick. It makes sure a player exists, along with it being an action function and there being a non-null stateinfo stuffs.

So no worries there. :P
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: OverlayX/Y + Flags/Offset Enhancements

Post by Rachael »

Well it passes my cursory test, then. But a more seasoned developer will need to do a more thorough check - as I've said, I'm not qualified to make that determination. (Yet)
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: OverlayX/Y + Flags/Offset Enhancements

Post by Major Cooke »

I would like Graf to confirm that though, it would be nice to hear from him directly on this.
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: OverlayX/Y + Flags/Offset Enhancements

Post by Graf Zahl »

Looks ok to me. Be aware that this conflicts with your other overlay related PR.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: OverlayX/Y + Flags/Offset Enhancements

Post by Major Cooke »

I'm aware. I figured you were waiting on something for the alpha/style types, so I committed these separately since they're a lot simpler.
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: OverlayX/Y + Flags/Offset Enhancements

Post by Graf Zahl »

I'm mainly waiting for someone else to drop a word but that doesn't seem to happen ever... :(
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: OverlayX/Y + Flags/Offset Enhancements

Post by Major Cooke »

I think I'm going to split the flipping from it and make a separate pull request so that part doesn't have to wait as long, if you think that's alright. A mere flip of the X axis, nothing more. I understand the renderstyle testing should still happen, but it was foolish of me to get something so simple barred by something much more complex.
D2JK
Posts: 543
Joined: Sat Aug 30, 2014 8:21 am

Re: OverlayX/Y + Flags/Offset Enhancements

Post by D2JK »

Did anyone ever figure out a way to selectively disable the interpolation for overlaid/HUD sprites? The sprites tend to jump visibly if you change their offsets on the fly.

Currently, I figured I could weave in an invisible frame, and change to the new offset during this frame, hiding the jumping effect. The downside to this is that it requires 1 tic where the overlay is showing nothing, every time you want to change an offset.

Alternatively, I would have to manage my sprites in a way that keeps their offsets fixed throughout the animation.
User avatar
Major Cooke
Posts: 8170
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: OverlayX/Y + Flags/Offset Enhancements

Post by Major Cooke »

That's a question for Leonard2.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”