Use fixed point math for position, endurance, health
This PR hopes to improve netplay and rec compatibility & determinism across platforms.
Positions and velocities (vec2f) are now stored as 24.8 fixed point numbers, which means there are 24 bits for the whole part and 8 for the fractional part.
This PR has the annoying quirk of taking an existing name and appending 'f' to mark it as fixedpoint, some of these should be un-renamed before merging-- this was done to ensure non-updated code would compiler error while writing the PR.
This is more precise, but it's also probably less accurate. The original game retains values as integers, where positions are pixel coords multiplied by 256. That is probably what openomf also needs to do to remain as close to omf2097 as possible.
This is more precise, but it's also probably less accurate. The original game retains values as integers, where positions are pixel coords multiplied by 256. That is probably what openomf also needs to do to remain as close to omf2097 as possible.
I believe you have the exact same misconception I had at first glance, that is precisely what is being described with the fixed point type, it's just not the name we had for it
This is more precise, but it's also probably less accurate. The original game retains values as integers, where positions are pixel coords multiplied by 256. That is probably what openomf also needs to do to remain as close to omf2097 as possible.
I believe you have the exact same misconception I had at first glance, that is precisely what is being described with the fixed point type, it's just not the name we had for it
Ah. I see. I assumed a standard fixed point library.
~~Will rebase onto latest master once #1054 is merged.~~ EDIT: rebased.