diff options
author | red031000 <rubenru09@aol.com> | 2020-05-24 15:14:47 +0100 |
---|---|---|
committer | red031000 <rubenru09@aol.com> | 2020-05-24 15:14:47 +0100 |
commit | c29ab952787c437b15a70a88dbb07f309a877574 (patch) | |
tree | e49187e81c3ad40578eea0cc54ceb1ec8a6d81ff /arm9/lib/include/fx.h | |
parent | 77ebfad667ae038119b4413b87c99d0497f2d522 (diff) | |
parent | 8cfbe69596f9d3079d0098f30ea58debd5487271 (diff) |
Merge branch 'master' of https://github.com/martmists/pokediamond
Diffstat (limited to 'arm9/lib/include/fx.h')
-rw-r--r-- | arm9/lib/include/fx.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arm9/lib/include/fx.h b/arm9/lib/include/fx.h index e0ba52f3..3df89293 100644 --- a/arm9/lib/include/fx.h +++ b/arm9/lib/include/fx.h @@ -55,6 +55,13 @@ typedef s64 fx64c; #define FX_MUL_FX32_FX64C(a, b) ((fx32)((((a) * (b) + ((fx64)1 << (FX64C_INT_SHIFT - 1))) >> FX64C_INT_SHIFT))) +#define FX_FX16_TO_F32(x) ((f32)((x) / (f32)(1 << FX16_SHIFT))) +#define FX_F32_TO_FX16(x) ((fx16)(((x) > 0) ? \ + (fx16)((x) * (1 << FX16_INT_SHIFT) + 0.5f ) : \ + (fx16)((x) * (1 << FX16_INT_SHIFT) - 0.5f ))) + +#define FX16_CONST(x) FX_F32_TO_FX16(x) + struct Vecx32 { fx32 x; |