baylej / tmx

C tmx map loader
http://libtmx.rtfd.io/
BSD 2-Clause "Simplified" License
241 stars 54 forks source link

Support alpha channel for colours #39

Closed baylej closed 4 years ago

baylej commented 5 years ago

Add support for the alpha channel (RGB --> ARGB). If the alpha channel is omitted, then the value for the alpha channel must be FF.

ForeverZer0 commented 5 years ago

Have a suggestion/enhancement to possibly consider that I will place here as it is related to this issue.

As the vast majority of users of this project will be using in conjunction with a graphics library such as OpenGL, perhaps instead of returning the color as an integer, return as a vec4 structure with four 32-bit floats. Conversion either way is trivial, but it would likely be more convenient to most users than an integer.

Another benefit would be eliminating any ambiguity of shifting bits and concern over the endianess of the machine to get the components.

baylej commented 5 years ago

Good suggestion, please create a new issue so it can be tracked, thanks.

ForeverZer0 commented 5 years ago

41