summaryrefslogtreecommitdiffstats
path: root/balls.h
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2024-10-31 19:53:25 -0400
committerSam Anthony <sam@samanthony.xyz>2024-10-31 19:53:25 -0400
commit111013b9ecb8b4208bfb1109e0f8ce8291fc90df (patch)
treedb67132d08569ade41c50b9e8948df3b094095d0 /balls.h
parent8a3994c5f6fd7023b5bdff9a02bc1f0ba110f12f (diff)
downloadballs-111013b9ecb8b4208bfb1109e0f8ce8291fc90df.zip
remove gcc vector with struct
Diffstat (limited to 'balls.h')
-rw-r--r--balls.h11
1 files changed, 6 insertions, 5 deletions
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);