summaryrefslogtreecommitdiffstats
path: root/rand.c
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 /rand.c
parent8a3994c5f6fd7023b5bdff9a02bc1f0ba110f12f (diff)
downloadballs-111013b9ecb8b4208bfb1109e0f8ce8291fc90df.zip
remove gcc vector with struct
Diffstat (limited to 'rand.c')
-rw-r--r--rand.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/rand.c b/rand.c
index f070fd1..b679600 100644
--- a/rand.c
+++ b/rand.c
@@ -18,17 +18,11 @@ randFloat(float lo, float hi) {
return lo + r*diff;
}
-float2
+Vector
randPtInRect(Rectangle r) {
- float2 pt = {
- randFloat(r.min[0], r.max[0]),
- randFloat(r.min[1], r.max[1])
+ Vector pt = {
+ randFloat(r.min.x, r.max.x),
+ randFloat(r.min.y, r.max.y)
};
return pt;
}
-
-float2
-randVec(float xmin, float xmax, float ymin, float ymax) {
- float2 v = {randFloat(xmin, xmax), randFloat(ymin, ymax)};
- return v;
-}