Skip to content

Texture revamp#1450

Merged
einarf merged 118 commits intodevelopmentfrom
texture-revamp
Jan 13, 2023
Merged

Texture revamp#1450
einarf merged 118 commits intodevelopmentfrom
texture-revamp

Conversation

@einarf
Copy link
Member

@einarf einarf commented Jan 1, 2023

Premature merge of texture recamp branch. It contains code changes that are blockers for other things + a lot of bugs was fixed in this branch + some new features. Merging may break a couple of things related to custom usage of texture coordinates.

Change summary

  • Tightened up arcade types a bit to make it possible to use more type annotations
  • Added a custom texture cache and moved it into the Texture namespace for now
  • Added a hit box cache. This and also be serialized to disk and loaded later
  • Larger changes related to images. Textures now have an ImageData instance containing the image with additional metadata such as a hash. The hash is used by the atlas to check for image uniqueness
  • Support for simple shader libraries
  • Revamped the hitbox module. It's now split up into multiple classes sharing a common type. Algorithms can also now be registered if the user wan't to supply something custom. The user can also set the default hit box algorithm.
  • Texture coordinates for spites are no four 2d points instead of a position and size
  • Textures now support various new methods like crop, flip and rotate that creates new version of the texture
  • Various other additions to the Texture class
  • Added support for texture transforms. The intention is that flipped and rotated textures will use the same image, but different texture coordiantes. The atlas still needs to take this into account.
  • Cleaned up a few things related to sprites
  • SpriteSolidColor is now a lot more memory efficient. We reuse a single 32 x 32 white texture for all of them
  • SpriteCircle should only cache white circle textures and use the color to create variants
  • Extended tests

@einarf einarf merged commit ec6037e into development Jan 13, 2023
@einarf einarf deleted the texture-revamp branch January 13, 2023 21:12
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.

3 participants