fxp: Add FXP_INIT_PERCENT

This lets us specify fxp values easily in source.
This commit is contained in:
David Goldblatt
2020-12-08 15:28:28 -08:00
committed by David Goldblatt
parent caef4c2868
commit bdb7307ff2
2 changed files with 27 additions and 1 deletions

View File

@@ -22,6 +22,7 @@
*/
typedef uint32_t fxp_t;
#define FXP_INIT_INT(x) ((x) << 16)
#define FXP_INIT_PERCENT(pct) (((pct) << 16) / 100)
/*
* Amount of precision used in parsing and printing numbers. The integer bound