Texture image compression
Another memory usage reduction PR.
This time I changed Texture to use a generic Image interface instead of directly BitmapImage and I made a another implementation of this interface that is compressed with a palette.
Of course the compressed implementation is slower to access pixel so the idea is to only use it for rarely accessed texture. What I've done is to use it for texture that are mainly related to player/armor stand like equipment and player head.
With this the majority of texture access are still fast but some memory is saved.
When loading 4 region of Greenfield I have:
before: retained size of BitmapImage is 108MB
after: retained size of BitmapImage+CompressedImage is 69MB (63MB + 6MB).
That's around a 10MB reduction per region for Greenfield. (of course, a map without entities wouldn't see improvements).
I have not measured any performance drop (but small scale test as well while the camera is far away from the ground to get a bird eye view so not a lot of rays must have intersected with entities).