Document RIDE_RATING macro

This commit is contained in:
Kevin Burke 2014-05-27 20:57:27 +09:00
parent b40d92f359
commit 1df8b061d8
2 changed files with 5 additions and 2 deletions

View File

@ -64,7 +64,7 @@ typedef unsigned long long uint64;
#define OPENRCT2_PLATFORM "Windows"
#define OPENRCT2_TIMESTAMP __DATE__ " " __TIME__
// Represent fixed point numbers
// Represent fixed point numbers. dp = decimal point
typedef sint16 fixed16_1dp;
typedef sint16 fixed16_2dp;
typedef sint32 fixed32_1dp;
@ -74,7 +74,8 @@ typedef sint32 fixed32_2dp;
typedef fixed16_1dp money16;
typedef fixed32_1dp money32;
// Construct a fixed point number.
// Construct a fixed point number. For example, to create the value 3.65 you
// would write FIXED_2DP(3,65)
#define FIXED_XDP(x, whole, fraction) ((whole) * (10 * x) + (fraction))
#define FIXED_1DP(whole, fraction) FIXED_XDP(1, whole, fraction)
#define FIXED_2DP(whole, fraction) FIXED_XDP(2, whole, fraction)

View File

@ -25,6 +25,8 @@
typedef fixed16_2dp ride_rating;
// Convenience function for writing ride ratings. The result is a 16 bit signed
// integer. To create the ride rating 3.65 type RIDE_RATING(3,65)
#define RIDE_RATING(whole, fraction) FIXED_2DP(whole, fraction)
// Used for return values, for functions that modify all three.