diff --git a/include/Vector2.hpp b/include/Vector2.hpp index aff73bb..f9380b0 100644 --- a/include/Vector2.hpp +++ b/include/Vector2.hpp @@ -49,10 +49,9 @@ class Vector2 : public ::Vector2 { set(vec); } - Vector2(float X = 0, float Y = 0) { - x = X; - y = Y; - } + Vector2(float x, float y) : ::Vector2{x, y} {}; + Vector2(float x) : ::Vector2{x, 0} {}; + Vector2() : ::Vector2{0, 0} {}; GETTERSETTER(float, X, x) GETTERSETTER(float, Y, y) @@ -255,6 +254,7 @@ class Vector2 : public ::Vector2 { y = vec.y; } }; + } // namespace raylib #endif // RAYLIB_CPP_INCLUDE_VECTOR2_HPP_ diff --git a/include/Vector3.hpp b/include/Vector3.hpp index 80367cc..c003d74 100644 --- a/include/Vector3.hpp +++ b/include/Vector3.hpp @@ -47,11 +47,11 @@ class Vector3 : public ::Vector3 { Vector3(::Vector3 vec) { set(vec); } - Vector3(float X = 0, float Y = 0, float Z = 0) { - x = X; - y = Y; - z = Z; - } + + Vector3(float x, float y, float z) : ::Vector3{x, y, z} {}; + Vector3(float x, float y) : ::Vector3{x, y, 0} {}; + Vector3(float x) : ::Vector3{x, 0, 0} {}; + Vector3() {}; Vector3(::Color color) { set(ColorToHSV(color)); diff --git a/include/Vector4.hpp b/include/Vector4.hpp index 616504e..38cb594 100644 --- a/include/Vector4.hpp +++ b/include/Vector4.hpp @@ -49,12 +49,11 @@ class Vector4 : public ::Vector4 { set(vec); } - Vector4(float X = 0, float Y = 0, float Z = 0, float W = 0) { - x = X; - y = Y; - z = Z; - w = W; - } + Vector4(float x, float y, float z, float w) : ::Vector4{x, y, z, w} {}; + Vector4(float x, float y, float z) : ::Vector4{x, y, z, 0} {}; + Vector4(float x, float y) : ::Vector4{x, y, 0, 0} {}; + Vector4(float x) : ::Vector4{x, 0, 0, 0} {}; + Vector4() {}; Vector4(::Color color) { set(ColorNormalize(color)); diff --git a/include/Wave.hpp b/include/Wave.hpp index f40502c..f886207 100644 --- a/include/Wave.hpp +++ b/include/Wave.hpp @@ -94,6 +94,7 @@ class Wave : public ::Wave { ::ExportWave(*this, fileName.c_str()); return *this; } + inline Wave& ExportAsCode(const std::string& fileName) { ::ExportWaveAsCode(*this, fileName.c_str()); return *this;