Skip to content

Conversation

@mariovisic
Copy link
Contributor

All of the C R2D_Image code can be removed, I've updated the window icon to use the new rendering functions as well.

Tiles can now be rotated and flipped as well, using the logic that already exists in Vertices.

I've removed the arguments for the direct draw calls, as it doesn't make a huge amount of sense and it was simpler to leave them off, we could re-add them later if there's a need.

Also add the ability to flip and rotate tiles

Lastly extract the logic to check if an image exists to the `Image`
class for re-use.
We don't need this any more as we're using `Image` and `Texture` to
render out tiles now :)
Use keyword arguments so the user can easily specify either flip or rotation.
Add these to the tileset rendering test to ensure it doesn't break :)
I'd like to factor the code which sets the window icon, so let's test it
first :)
The window icon was the last place we were using the R2D_Image C struct. I've
updated this code to use the new image functions to directly get a surface and
removed the remaining unused image code.
These methods were used by Sprite/Tileset/Text and Image, but now they
use the new function and directly provide vertices information. So these
can be removed.
This texture rendering function now replaces the old one, so we can
remove the 'new' word.
@mariovisic mariovisic merged commit c02baa8 into ruby2d:main Aug 12, 2021
@mariovisic mariovisic deleted the tileset_rendering_refactor branch August 12, 2021 07:41
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

Successfully merging this pull request may close these issues.

2 participants