From bb06ab69ec9bf872887a8d347c7dd461d4a60015 Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Sun, 13 Apr 2025 12:56:13 +0900 Subject: [PATCH] Fixes since raylib updated to version 5.5 --- src/3d_helpers.cc | 24 ++++++++++++------------ src/3d_helpers.h | 8 ++++---- src/test/test.cc | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/3d_helpers.cc b/src/3d_helpers.cc index 0108209..dbdfde1 100644 --- a/src/3d_helpers.cc +++ b/src/3d_helpers.cc @@ -125,9 +125,9 @@ Matrix scale_matrix_xyz(float x, float y, float z) { 0.0F, 0.0F, z, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F}; } -Matrix operator*(const Matrix &a, const Matrix &b) { - return MatrixMultiply(a, b); -} +// Matrix operator*(const Matrix &a, const Matrix &b) { +// return MatrixMultiply(a, b); +// } bool ray_to_xz_plane(const Ray &ray, float &x_out, float &z_out) { if (FloatEquals(ray.direction.y, 0.0F)) { @@ -232,17 +232,17 @@ std::array get_circle_facing_viewer(Vector3 pos, Vector3 normal, return vertices; } -Vector3 operator+(Vector3 a, Vector3 b) { - return Vector3{a.x + b.x, a.y + b.y, a.z + b.z}; -} +// Vector3 operator+(Vector3 a, Vector3 b) { +// return Vector3{a.x + b.x, a.y + b.y, a.z + b.z}; +// } -Vector3 operator-(Vector3 a, Vector3 b) { - return Vector3{a.x - b.x, a.y - b.y, a.z - b.z}; -} +// Vector3 operator-(Vector3 a, Vector3 b) { +// return Vector3{a.x - b.x, a.y - b.y, a.z - b.z}; +// } -Vector3 operator*(Vector3 vec3, float factor) { - return Vector3Scale(vec3, factor); -} +// Vector3 operator*(Vector3 vec3, float factor) { +// return Vector3Scale(vec3, factor); +// } Vector3 operator*(Matrix mat, Vector3 vec3) { return Vector3Transform(vec3, mat); diff --git a/src/3d_helpers.h b/src/3d_helpers.h index 89bcbc5..5adcda9 100644 --- a/src/3d_helpers.h +++ b/src/3d_helpers.h @@ -20,7 +20,7 @@ extern Matrix translate_matrix_xyz(float x, float y, float z); extern Matrix scale_matrix_xyz(float x, float y, float z); -extern Matrix operator*(const Matrix &a, const Matrix &b); +// extern Matrix operator*(const Matrix &a, const Matrix &b); /// Returns true if intersects with xz plane. extern bool ray_to_xz_plane(const Ray &ray, float &x_out, float &z_out); @@ -58,10 +58,10 @@ extern std::array get_circle_facing_viewer(Vector3 pos, // weirdness regarding column-major matrices. // extern Vector4 operator*(const Matrix &m, const Vector4 &v); -extern Vector3 operator+(Vector3 a, Vector3 b); -extern Vector3 operator-(Vector3 a, Vector3 b); +// extern Vector3 operator+(Vector3 a, Vector3 b); +// extern Vector3 operator-(Vector3 a, Vector3 b); -extern Vector3 operator*(Vector3 vec3, float factor); +// extern Vector3 operator*(Vector3 vec3, float factor); extern Vector3 operator*(Matrix mat, Vector3 vec3); diff --git a/src/test/test.cc b/src/test/test.cc index bf5536b..f76f53f 100644 --- a/src/test/test.cc +++ b/src/test/test.cc @@ -15,7 +15,7 @@ } #define ASSERT_FLOAT_EQUALS(f, v) \ - if ((f) < (v)-0.1F || (f) > (v) + 0.1F) { \ + if ((f) < (v) - 0.1F || (f) > (v) + 0.1F) { \ std::cerr << "ASSERT_FLOAT_EQUALS: " << (f) \ << " is not (roughly) equal to " << (v) << " at line " \ << __LINE__ << "!\n"; \ -- 2.49.0