A sprite frame symbol for no draw, like TNT1 base

Moderator: GZDoom Developers

Post Reply
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

A sprite frame symbol for no draw, like TNT1 base

Post by Sir Robin »

Could we get a sprite frame that points to null or "no draw" frame in the same way that the TNT1 sprite base points to?

So for example if I have this sequence:

Code: Select all

XMPL ABC 4;
TNT1 A 4;
XMPL EFG 4;
that puts a no-draw frame in my sequence.

Could we get a frame symbol that does that same thing? Perhaps the "!" which means not in so many languages. Then I could use a sequence like this

Code: Select all

XMPL ABC!DEF 4;
to produce the same results as above, just with a little cleaner code.
User avatar
RockstarRaccoon
Posts: 598
Joined: Sun Jul 31, 2016 2:43 pm

Re: A sprite frame symbol for no draw, like TNT1 base

Post by RockstarRaccoon »

I feel like the answer is going to be no, simply because any valid character there could be used as a frame identifier, and this doesn't add new functionality, nor is this a very common problem.

What are you even using this for? Because what you're talking about basically makes the sprite flash suddenly in and out of existence...
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49071
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A sprite frame symbol for no draw, like TNT1 base

Post by Graf Zahl »

RockstarRaccoon wrote:I nor is this a very common problem.

Touché.
Gez
 
 
Posts: 17835
Joined: Fri Jul 06, 2007 3:22 pm

Re: A sprite frame symbol for no draw, like TNT1 base

Post by Gez »

With TEXTURES you can explicitly create null textures. So you could make a null sprite this way. Let's say XMPLZ0 is defined as a null sprite. Then you can have XMPL ABCZDEF 4.
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: A sprite frame symbol for no draw, like TNT1 base

Post by Sir Robin »

RockstarRaccoon wrote:What are you even using this for? Because what you're talking about basically makes the sprite flash suddenly in and out of existence...
You know, that's a good question. This post is about 2 weeks old, so I'm racking my brain trying to figure out what I was doing 2 weeks ago where I wanted sprites to pop on and off in their animation. Then it finally occurred to me - I was working on weapon HUD sprites. Some weapons will go out of player FOV - for example when reloading or charging certain weapons, or melee weapons being drawn back and/or slashing through FOV and out of FOV. So my weapons have a number of off-screen moments and thus no-draw frames.
Gez wrote:With TEXTURES you can explicitly create null textures. So you could make a null sprite this way. Let's say XMPLZ0 is defined as a null sprite. Then you can have XMPL ABCZDEF 4.
Absolutely right. And now that I think about it, this problem is entirely my own making. I wrote a script to generate weapons for me. First thing it does is figure out all the frames of animation needed for ready, charge, and fire, then draws those frames to png files, and then builds a textures lump to point sprites to them. It's my own code that looks for a no-draw frame (an attempt to draw a png with 0 pixels) and replaces it in the sequence with the TNT1 reference. Instead I should let it define a sprite with the NullTexture flag and then I can use that in the sequence like any other frame.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49071
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A sprite frame symbol for no draw, like TNT1 base

Post by Graf Zahl »

Gez wrote:With TEXTURES you can explicitly create null textures. So you could make a null sprite this way. Let's say XMPLZ0 is defined as a null sprite. Then you can have XMPL ABCZDEF 4.

Keep in mind that TNT1 is not a NullTexture. The checks for it are very different.
User avatar
Sir Robin
Posts: 537
Joined: Wed Dec 22, 2021 7:02 pm
Graphics Processor: Intel (Modern GZDoom)
Location: Medellin, Colombia

Re: A sprite frame symbol for no draw, like TNT1 base

Post by Sir Robin »

Is there any functional difference between TNT1 and a textures lump sprite declared as a null texture?
User avatar
wildweasel
Posts: 21706
Joined: Tue Jul 15, 2003 7:33 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): A lot of them
Graphics Processor: Not Listed
Contact:

Re: A sprite frame symbol for no draw, like TNT1 base

Post by wildweasel »

Yes - something displaying TNT1 is completely skipped by the renderer. With a null texture, the renderer still has to determine that there is a sprite here, load the graphic into memory, and attempt to draw it - in this case, the graphic is (usually) a 1x1 sized canvas consisting of a single transparent pixel. On its own, this won't be noticeable, but in great enough numbers, using TNT1 instead would be marginally faster.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49071
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: A sprite frame symbol for no draw, like TNT1 base

Post by Graf Zahl »

TNT1 means that the sprite will be discarded right at the very beginning of the sprite processing logic. Any empty sprite first needs to run through all substitution checks for voxels and models before it can be discarded.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”