summaryrefslogtreecommitdiff
path: root/include/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/utils.h')
-rw-r--r--include/utils.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/utils.h b/include/utils.h
index 5a4a4ac..cb1770e 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -60,4 +60,21 @@ static inline Rectangle GetCurrentSourceRectangle(const Animation* animation) {
return animation->srcRects[animation->currentFrame];
}
+static inline Rectangle GetEntityHitboxGlobal(const Entity* e, int hbIndex) {
+ Rectangle hitBoxGlobal = e->hitBoxes[hbIndex];
+ hitBoxGlobal.x += e->position.x;
+ hitBoxGlobal.y += e->position.y;
+
+ return hitBoxGlobal;
+}
+
+static inline Rectangle GetEntityHurtboxGlobal(const Entity* e, int hbIndex) {
+ Rectangle hurtBoxGlobal = e->hurtBoxes[hbIndex];
+ hurtBoxGlobal.x += e->position.x;
+ hurtBoxGlobal.y += e->position.y;
+
+ return hurtBoxGlobal;
+}
+
+
#endif // UTILS_H_