From 111013b9ecb8b4208bfb1109e0f8ce8291fc90df Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Thu, 31 Oct 2024 19:53:25 -0400 Subject: remove gcc vector with struct --- balls.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'balls.h') diff --git a/balls.h b/balls.h index c19b948..aaf90e2 100644 --- a/balls.h +++ b/balls.h @@ -1,7 +1,9 @@ -typedef float float2 __attribute__ ((vector_size (2*sizeof(float)))); +typedef struct { + int x, y; +} Vector; typedef struct { - float2 min, max; + Vector min, max; } Rectangle; /* @@ -21,9 +23,8 @@ Partition partitionCollisions(size_t nBalls); void freePartition(Partition part); void printPartition(Partition part); -int isCollision(float2 p1, float r1, float2 p2, float r2); +int isCollision(Vector p1, float r1, Vector p2, float r2); Rectangle insetRect(Rectangle r, float n); float randFloat(float lo, float hi); -float2 randPtInRect(Rectangle r); -float2 randVec(float xmin, float xmax, float ymin, float ymax); +Vector randPtInRect(Rectangle r); -- cgit v1.2.3