A sprite frame symbol for no draw, like TNT1 base

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: A sprite frame symbol for no draw, like TNT1 base

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

by Graf Zahl » Mon Feb 21, 2022 12:58 pm

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.

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

by wildweasel » Mon Feb 21, 2022 10:55 am

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.

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

by Sir Robin » Mon Feb 21, 2022 9:07 am

Is there any functional difference between TNT1 and a textures lump sprite declared as a null texture?

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

by Graf Zahl » Mon Feb 21, 2022 1:21 am

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.

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

by Sir Robin » Sun Feb 20, 2022 8:16 pm

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.

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

by Gez » Sat Feb 19, 2022 4:26 pm

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.

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

by Graf Zahl » Sat Feb 19, 2022 3:02 pm

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

Touché.

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

by RockstarRaccoon » Sat Feb 19, 2022 2:43 pm

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...

A sprite frame symbol for no draw, like TNT1 base

by Sir Robin » Mon Feb 07, 2022 8:32 pm

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.

Top