JohnSundell / ImagineEngine

A project to create a blazingly fast Swift game engine that is a joy to use πŸš€

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add option to warn if texture is missing when in debug mode

JohnSundell opened this issue Β· comments

We should make it easier to identify why a texture is not rendered on the screen. In TextureManager, when an image for a texture couldn't be found, we should make it possible to either log an error to the console or to trigger an assert. This should be off by default but be configurable by the user:

Things to do:

  • Make it possible to toggle an errorMode on TextureManager (for example using an enum) that lets the user pick between no error, triggering an assert or logging an error if a texture is missing.
  • In TextureManager, when a texture can't be found, read the error mode and act accordingly.
  • This should only be evaluated in debug builds.

Good to know:

  • All the texture loading code takes place in TextureManager.
  • The default behavior is currently to silently return nil when a texture is missing, this is what should optionally be changed.

Will pick this one πŸ‘

@vijaytholpadi Awesome πŸš€

Issued PR: #72

Fixed by @vijaytholpadi in #72 πŸŽ‰