Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tile Id Offset Meta Sprite Feature Request #65

Closed
xfixium opened this issue May 11, 2024 · 2 comments
Closed

Tile Id Offset Meta Sprite Feature Request #65

xfixium opened this issue May 11, 2024 · 2 comments

Comments

@xfixium
Copy link

xfixium commented May 11, 2024

I don't know if this has been implemented yet, or exists. Say a metasprite has been defined eg:

// Frame 0 of multi framed sprite, for entity with loads of states, but tiles may be located differently for each instance:
const unsigned char sprite_00[] = { 0, 0, 0, 8, 0, 2, 16, 0, 4, 0, 16, 6, 8, 16, 8, 16, 16, 10, 0, 32, 12, 8, 32, 14, METASPRITE_END };

Is there a way to offset the tile id, so that the tile id starts with the array tile id + offset?

Sort of like:
SMS_addMetaSprite(x, y, [offset], sprite_00);

Where [offset] would be applied to the defined tile id for each sprite.

@sverx
Copy link
Owner

sverx commented May 11, 2024

Quite recently in fact I hacked in something along that line, but you need to recompile the library adding the METASPRITE_DELTA_TILES define to the compilation.
Then the offset can be stored into the MetaSpriteBaseTile variable (unsigned char) and the SMS_addMetaSprite function will then work the way you expect.
You can see this in the code here.

@xfixium
Copy link
Author

xfixium commented May 11, 2024

Oh very nice, that should do it!

@sverx sverx closed this as completed Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants