lordmauve / wasabi2d

Cutting-edge 2D game framework for Python
https://wasabi2d.readthedocs.io/
GNU Lesser General Public License v3.0
156 stars 24 forks source link

Online pack sprites from loader #1

Closed lordmauve closed 5 years ago

lordmauve commented 5 years ago

wasabi2d includes an image loader that it inherits from Pygame Zero for loading images from the images/ directory. However this is not currently used in texture packing.

Currently rectpack's offline mode is used and we pass a hard-coded list of images to pack. Even pre-packing all the images in the images directory would be better than this. However, online packing the images that actually get requested is a little more scalable. Sadly rectpack's online solver does not return the location to pack the next image - an issue that is relatively but not completely shallow - see rectpack#27.

We must no longer convert the alpha channel (does this premultiply)?: https://github.com/lordmauve/wasabi2d/blob/master/wasabi2d/loaders.py#L183

lordmauve commented 5 years ago

Done - by replacing rectpack with my own implementation.