summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authornotyourav <65437533+notyourav@users.noreply.github.com>2022-01-21 21:31:20 -0800
committerGitHub <noreply@github.com>2022-01-21 21:31:20 -0800
commit93e745e9638bb4f48e27908eebe2bb4eb349812e (patch)
treea6524652b6c265e285c6ea7c0b6d96ac54168b58 /include
parentaa5150f36037c187cddf0a3196dd55a96ecfadc8 (diff)
parentb4b7e9a28b38510a49d750128d23dd57a19979ae (diff)
Merge pull request #309 from notyourav/fp
fixed point stuff
Diffstat (limited to 'include')
-rw-r--r--include/coord.h4
-rw-r--r--include/entity.h8
-rw-r--r--include/functions.h4
-rw-r--r--include/global.h4
4 files changed, 10 insertions, 10 deletions
diff --git a/include/coord.h b/include/coord.h
index 85a56ce2..5ead1236 100644
--- a/include/coord.h
+++ b/include/coord.h
@@ -12,8 +12,8 @@ void PositionEntityOnTop(Entity*, Entity*);
void PositionRelative(Entity*, Entity*, s32, s32);
void CopyPositionAndSpriteOffset(Entity* param_1, Entity* param_2);
void sub_0806FA90(Entity*, Entity*, s32, s32);
-void ResolveEntityOnTop(Entity*, Entity*);
-void ResolveEntityBelow(Entity*, Entity*);
+void SortEntityAbove(Entity*, Entity*);
+void SortEntityBelow(Entity*, Entity*);
u32 sub_0806F5A4(u32 idx);
u32 sub_0806F3E4(Entity*);
diff --git a/include/entity.h b/include/entity.h
index c3477e9e..5ff5dcdc 100644
--- a/include/entity.h
+++ b/include/entity.h
@@ -160,14 +160,14 @@ typedef struct Entity_ {
/*0x1d*/ u8 field_0x1d;
/*0x1e*/ u8 frameIndex;
/*0x1f*/ u8 lastFrameIndex;
- /*0x20*/ s32 zVelocity; /**< Z axis speed. */
+ /*0x20*/ s32 zVelocity; /**< Z axis speed, measured in px/frame */
/*0x24*/ s16 speed; /**< Magnitude of speed. */
/*0x26*/ u8 spriteAnimation[3];
/*0x29*/ SpritePriority spritePriority;
/*0x2a*/ u16 collisions;
- /*0x2c*/ union SplitWord x; /**< X position, fixed point. */
- /*0x30*/ union SplitWord y; /**< Y position, fixed point. */
- /*0x34*/ union SplitWord z; /**< Z position, fixed point. */
+ /*0x2c*/ union SplitWord x; /**< X position, fixed point Q16.16. */
+ /*0x30*/ union SplitWord y; /**< Y position, fixed point Q16.16. */
+ /*0x34*/ union SplitWord z; /**< Z position, fixed point Q16.16. */
/*0x38*/ u8 collisionLayer; /**< Collision layer. */
/*0x39*/ s8 interactType;
/*0x3a*/ u8 field_0x3a;
diff --git a/include/functions.h b/include/functions.h
index 819701fa..c301b841 100644
--- a/include/functions.h
+++ b/include/functions.h
@@ -96,7 +96,7 @@ extern u32 sub_0805F8F8(u32);
extern u32 sub_0805F7A0(u32);
extern u32* sub_0805F25C(u32);
u32 sub_0806FCB8(Entity*, u32, u32, u32);
-extern void sub_0806F62C(Entity*, u32, u32);
+extern void LinearMoveAngle(Entity*, u32, u32);
extern void sub_080A1ED0(u32, u32, u32);
extern u32 sub_0806F5B0(u32);
extern void sub_08078790(Entity*, u32);
@@ -125,7 +125,7 @@ extern bool32 sub_080806BC(u32, u32, u32, u32);
extern bool32 sub_0806FC80(Entity*, Entity*, s32);
extern u32 sub_080002B4(Entity*, u32, u32);
extern u32 sub_080AF134(Entity*);
-extern void sub_0806F5BC(Entity*, u32, u32);
+extern void LinearMoveDirection(Entity*, u32, u32);
extern void sub_080A2AF4(Entity*, u32, u32);
extern u32 sub_080002CC(Entity*, s32, s32);
extern bool32 sub_0807BD14(Entity*, u32);
diff --git a/include/global.h b/include/global.h
index 0f656445..8521b77c 100644
--- a/include/global.h
+++ b/include/global.h
@@ -59,8 +59,8 @@
// Converts a number to Q8.8 fixed-point format
#define Q_8_8(n) ((s16)((n)*256))
-// Converts a number to Q4.12 fixed-point format
-#define Q_4_12(n) ((s16)((n)*4096))
+// Converts a number to Q16.16 fixed-point format
+#define Q_16_16(n) ((s32)((n) * (1 << 16)))
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) >= (b) ? (a) : (b))