Closed ivan-mogilko closed 6 months ago
I don't know if useful or not, but I think the engine does loads 4-bit bitmap already. I remember to have written it here
Ah, this reading function unpacks 4-bit to 8-bit on read. Well then, this means that the new conversion function may not be necessary for loading bitmaps at runtime. It's only needed if an unpacked data is read, and needs to be converted. But the loading function cannot be used in this particular case, as bitmap already comes from the managed side.
EDIT: On another hand, something I wanted to suggest for the future is to not read data directly into Bitmap object (or write directly from Bitmap object), but using a raw pixel array. This would make image loading and saving functions independent from Bitmap class. That is something for a separate task though.
Fixes #2416
Implemented a conversion from imported 4-bit bitmaps into 8-bit ones supported by the Editor & Engine.
There were 2 potential approaches here, one is to convert on C# side, another in the native C++ side. I chose to do this in native, and have a helper function in Common lib, to make this potentially usable in the engine. For example, this may be used when loading an image from file.