JohnSundell / ImagineEngine

A project to create a blazingly fast Swift game engine that is a joy to use 🚀
Other
1.82k stars 105 forks source link

Automatically load textures with higher resolution than the screen #149

Open JohnSundell opened 6 years ago

JohnSundell commented 6 years ago

Currently, we only automatically fall back to textures with a lower resolution than the screen that the game is running on (for example, if the game is running on an iPhone X and there's no @3x asset, then the @2x or @1x version will be automatically loaded).

We should do the same thing for falling back to a higher resolution as well, that is if the screen is an @1x screen but there's only an @2x asset, that asset should be loaded.

Texture loading takes place in TextureManager and BundleTextureImageLoader.

ghost commented 6 years ago

OK, I'd like to help with this one

ghost commented 6 years ago

@JohnSundell, what do you think? In the occasion we have @2x screen and only @1x and @3x assets, which should have a higher priority?

JohnSundell commented 6 years ago

@Loyolny I think in that scenario it makes more sense to load the @3x asset, since downscaling usually provides better image quality than upscaling.

JohnSundell commented 6 years ago

And awesome that you are working on this 😄