Skip to content

Conversation

@ZERICO2005
Copy link
Contributor

@ZERICO2005 ZERICO2005 commented Jun 8, 2025

This is in its own commit due to the complexity of gfx_RotateScaleSprite and gfx_RotatedScaledSprite(Transparent)_NoClip.

The inner loop of gfx_RotatedScaledSpriteTransparent_NoClip is 8F faster when a pixel is drawn. I also believe that creating a clipped variant of this routine is possible with a constant performance penalty.

I have fixed most of the issues outlined in #612. There are a few limitations to note:

  • The sprite will render incorrectly if the output is larger than 255x255. This is not worth fixing however, since a 256x256 sprite doesn't fit onto a 320x240 screen anyways.
  • input sprites larger than 210x210 (255 * (sqrt(8) - 2) or ~211.2489) may experience texture wrapping. This should be harmless, as shown below with a 254x254 sprite
    image

@mateoconlechuga mateoconlechuga merged commit 6bebb17 into master Jun 8, 2025
9 checks passed
@mateoconlechuga mateoconlechuga deleted the optimize_rotate_sprite branch June 8, 2025 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants