Add JSON converters to normalise inconsistent serialisation between platforms
Pathoschild opened this issue ยท 4 comments
Some types (like Color
and Point
) are serialised inconsistently between Linux/Mac and Windows. This can cause errors when reading a JSON file that was generated on a different platform. Add custom JSON converters to make sure they're serialised and deserialised consistently.
@spacechase0 Where are FloatRect
and IntRect
defined?
Comparison of serialised format:
type | on Windows | on Linux/Mac |
---|---|---|
Color | "26, 51, 76, 102" |
{ "B": 30, "G": 20, "R": 10, "A": 50 } |
Point | "1, 2" |
{ "X": 1, "Y": 2 } |
Rectangle | "{X:1 Y:2 Width:3 Height:4}" |
{ "X": 1, "Y": 2, "Width": 3, "Height": 4 } |
Vector2 | "1, 2" |
"1, 2" |