Modify vec_copy so it supports float[]

This commit is contained in:
8dcc 2023-07-30 20:04:28 +02:00
parent 04720aa4a3
commit bb6c9efc50
1 changed files with 4 additions and 3 deletions

View File

@ -22,10 +22,11 @@ typedef struct {
#define gl_drawline_points(p0, p1, w, col) \ #define gl_drawline_points(p0, p1, w, col) \
gl_drawline(p0[0], p0[1], p1[0], p1[1], 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) \ #define vec_copy(dst, src) \
dst.x = src.x; \ dst[0] = src[0]; \
dst.y = src.y; \ dst[1] = src[1]; \
dst.z = src.z; dst[2] = src[2];
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/