abc013 / WarriorsSnuggery

A customisable, singleplayer 2D-top-view kind-of-shooter in pixelart.
MIT License
12 stars 2 forks source link

Improve texture sheet usage #35

Closed abc013 closed 3 years ago

abc013 commented 3 years ago

Right now, the algorithm to create the texture sheets is very unpolished and leaves large gaps of unused pixel data. This can be increased by smarter sorting of the textures, perhaps splitting the whole buffer into smaller pieces (e.g. 24x24px pieces and lower) and filling it up by taking the smallest available piece.

abc013 commented 3 years ago

A new method was implemented in https://github.com/abc013/WarriorsSnuggery/commit/bfea2fc30e470acce179db135c2bdcbdfd30f03e: Everytime we write something to the buffer, the remaining space is split in up to two fragments. Then, always take the smallest possible fragment to write to.