From 22faf6a02b375a942cf5cbb20540eaf2956a594c Mon Sep 17 00:00:00 2001 From: herbglitch Date: Wed, 19 Mar 2025 18:05:56 -0600 Subject: [PATCH] removed pointless pointers in rect --- include/arc/math/rectangle.h | 4 ++-- src/math/rectangle.c | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/arc/math/rectangle.h b/include/arc/math/rectangle.h index 3c87235..577bf16 100644 --- a/include/arc/math/rectangle.h +++ b/include/arc/math/rectangle.h @@ -37,7 +37,7 @@ typedef struct ARC_FRect { * @param rect ARC_Rect to be centered * @param bounds ARC_Rect area to center rect on */ -void ARC_Rect_CenterOn(ARC_Rect *rect, ARC_Rect *bounds); +void ARC_Rect_CenterOn(ARC_Rect *rect, ARC_Rect bounds); /** * @brief centers rect on given bounds @@ -45,7 +45,7 @@ void ARC_Rect_CenterOn(ARC_Rect *rect, ARC_Rect *bounds); * @param rect ARC_FRect to be centered * @param bounds ARC_FRect area to center rect on */ -void ARC_FRect_CenterOn(ARC_FRect *rect, ARC_FRect *bounds); +void ARC_FRect_CenterOn(ARC_FRect *rect, ARC_FRect bounds); /** * @brief casts Rect to FRect diff --git a/src/math/rectangle.c b/src/math/rectangle.c index 2a928cc..994ce91 100644 --- a/src/math/rectangle.c +++ b/src/math/rectangle.c @@ -4,14 +4,14 @@ //VERY TEMP // #include -void ARC_Rect_CenterOn(ARC_Rect *rect, ARC_Rect *bounds){ - rect->x = (bounds->x + (bounds->w / 2)) - (rect->w / 2); - rect->y = (bounds->y + (bounds->h / 2)) - (rect->h / 2); +void ARC_Rect_CenterOn(ARC_Rect *rect, ARC_Rect bounds){ + rect->x = (bounds.x + (bounds.w / 2)) - (rect->w / 2); + rect->y = (bounds.y + (bounds.h / 2)) - (rect->h / 2); } -void ARC_FRect_CenterOn(ARC_FRect *rect, ARC_FRect *bounds){ - rect->x = (bounds->x + (bounds->w / 2.0f)) - (rect->w / 2.0f); - rect->y = (bounds->y + (bounds->h / 2.0f)) - (rect->h / 2.0f); +void ARC_FRect_CenterOn(ARC_FRect *rect, ARC_FRect bounds){ + rect->x = (bounds.x + (bounds.w / 2.0f)) - (rect->w / 2.0f); + rect->y = (bounds.y + (bounds.h / 2.0f)) - (rect->h / 2.0f); } ARC_FRect ARC_Rect_CastToFRect(ARC_Rect rect){