From bb6c9efc50c76571f8c52a6bce1fb1fcf6058e56 Mon Sep 17 00:00:00 2001 From: 8dcc <8dcc.git@gmail.com> Date: Sun, 30 Jul 2023 20:04:28 +0200 Subject: [PATCH] Modify vec_copy so it supports float[] --- src/include/util.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/include/util.h b/src/include/util.h index 56b851f..bc73e1c 100644 --- a/src/include/util.h +++ b/src/include/util.h @@ -22,10 +22,11 @@ typedef struct { #define gl_drawline_points(p0, p1, w, col) \ gl_drawline(p0[0], p0[1], p1[0], p1[1], w, col); +/* Use indexes so it works for float[] as well as vec3_t */ #define vec_copy(dst, src) \ - dst.x = src.x; \ - dst.y = src.y; \ - dst.z = src.z; + dst[0] = src[0]; \ + dst[1] = src[1]; \ + dst[2] = src[2]; /*----------------------------------------------------------------------------*/