~widelands-dev/widelands/appveyor_reenable_glbinding

Viewing all changes in revision 8933.

Merged lp:~widelands-dev/widelands/terrain_affinity_as_int:
Fix desyncs caused by floating point arithmetic

- Floating point arithmetic can become inconsistent across platforms/compilers/hardware
- Upscale terrain affinity constants to turn them into ints
- Upscale the result of the affinity calculation and then use std::floor to cut it off at
  largely reduced precision for consistent rounding behavior. This should fix inconsistencies
  with double rounding and rounding direction.
- Catch a possible division by 0.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: