Jump to content
IGNORED

Dynamic sprite properties


LordKraken

Recommended Posts

Hello,

 

So I have been playing around last evening and I'm wondering which sprite properties are static (i.e defined at compile time in rapinit.s).

 

Let me use an example:

sprite[sprBugIndex].scaled = R_spr_scale;
sprite[sprBugIndex].scale_x = 64;
sprite[sprBugIndex].scale_y = 64;

This code actually does not work, unless the scale flag is already set to spr_scale in rapinit.s for this sprite.

 

Are there other flags that can only be define at compile time? Maybe we could update Table A in the doc?

 

thx!

Link to comment
Share on other sites

18 minutes ago, LordKraken said:

Hello,

 

So I have been playing around last evening and I'm wondering which sprite properties are static (i.e defined at compile time in rapinit.s).

 

Let me use an example:


sprite[sprBugIndex].scaled = R_spr_scale;
sprite[sprBugIndex].scale_x = 64;
sprite[sprBugIndex].scale_y = 64;

This code actually does not work, unless the scale flag is already set to spr_scale in rapinit.s for this sprite.

 

Are there other flags that can only be define at compile time? Maybe we could update Table A in the doc?

 

thx!

I'm pretty sure that should work, as all properties are definable at runtime now.

 

So you may have just found a bug :)

 

I'll investigate and report back.

 

Link to comment
Share on other sites

To be fair I would probably never do that in a real game, just played around with the sprites, so that's how I ended having that code :)

 

(there might be a use case though, for instance if we reorder the sprite list to fake a z-buffer, etc.)

 

Also, stupid question, is there a performance impact if the flag is always on but the zoom factor is 1 (well 32).

Link to comment
Share on other sites

7 minutes ago, LordKraken said:

To be fair I would probably never do that in a real game, just played around with the sprites, so that's how I ended having that code :)

 

(there might be a use case though, for instance if we reorder the sprite list to fake a z-buffer, etc.)

 

Also, stupid question, is there a performance impact if the flag is always on but the zoom factor is 1 (well 32).

Yes, scaled sprites take longer to be processed by the object processor than standard ones, even at unity zoom.

Edited by Zerosquare
  • Like 2
Link to comment
Share on other sites

12 hours ago, LordKraken said:

Also, stupid question, is there a performance impact if the flag is always on but the zoom factor is 1 (well 32).

12 hours ago, Zerosquare said:

Yes, scaled sprites take longer to be processed by the object processor than standard ones, even at unity zoom.

Definitely not a stupid question, I never knew until I started playing around with the scaling myself and then later found some documentation covering the issue some time later. Curious, what brought up the question though as it seems you may have snagged somewhere? I was quick to learn it can cause some nasty problems (degradation quickly) if you're trying to do too much by way of a lot of 16-bit graphics and multiple higher quality sounds at the same time.

 

And to further clarify for anyone else who may stumble upon this, this is not an underlying issue or weakness with JagStudio, this is a Jaguar issue at its core.

  • Like 2
Link to comment
Share on other sites

Ideally what should happen is that whenever the scale_x and scale_y values are both equal to 32, it should revert back to an unscaled bitmap automatically.
Then you don't need the .scaled flag.

e.g.

 

Scaled:

sprite[sprBugIndex].scale_x = 64;
sprite[sprBugIndex].scale_y = 64;

 

Not Scaled:

sprite[sprBugIndex].scale_x = ;
sprite[sprBugIndex].scale_y = ;
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...