Why don't I have a custom title by now?!
Shadow Hog said:
Turns out the camspeed bug only shows up in non-English languages. Why? No idea. Stray atof(), apparently.
You need to set the locale to C. This can be done very simply by calling this during initialization of the program:
setlocale (LC_ALL, "C");
The decimal separator depends on the language -- in English it's '.', but in other languages it can be ','. And inversely, in English ',' is used as a thousand separators, but in other languages it can be '.' or a space.
For instance, pi * 10000 can be represented in these ways:
5: 31 415,926 535 897 932 384 626 433...
6: 31 415.926 535 897 932 384 626 433...
Since this is all very ambiguous, you need to set the locale explicitly if you want consistent behavior. The C locale requires floating point numbers to be expressed as they are in code (first example), using a point for decimal separator and no thousand separator at all.