summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortalha <sarcxd@gmail.com>2024-10-26 23:51:07 +0500
committertalha <sarcxd@gmail.com>2024-10-26 23:51:07 +0500
commitcaa97b9fc4f25e0db64ff38fbd8c3c4d49ceef4a (patch)
treeb76b0e9481c1921ae7ad4465d0cc586e9a4cc291
parent224595f05cd274f1778a357e974e6571a8d13b5a (diff)
Simplified Vec2 operator overloads
-rwxr-xr-xsource/math.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/math.h b/source/math.h
index d682ae3..7deb0bc 100755
--- a/source/math.h
+++ b/source/math.h
@@ -34,7 +34,7 @@ union Vec2 {
};
r32 data[2];
- Vec2 operator+(const r32& scaler) const {
+ Vec2 operator+(r32 scaler) {
Vec2 res;
res.x = this->x + scaler;
res.y = this->y + scaler;
@@ -42,7 +42,7 @@ union Vec2 {
return res;
}
- Vec2 operator+(const Vec2& v) const {
+ Vec2 operator+(Vec2 v) {
Vec2 res;
res.x = this->x + v.x;
res.y = this->y + v.y;
@@ -50,7 +50,7 @@ union Vec2 {
return res;
}
- Vec2 operator-(const r32& scaler) const {
+ Vec2 operator-(r32 scaler) {
Vec2 res;
res.x = this->x - scaler;
res.y = this->y - scaler;
@@ -58,7 +58,7 @@ union Vec2 {
return res;
}
- Vec2 operator-(const Vec2& v) const {
+ Vec2 operator-(Vec2 v) {
Vec2 res;
res.x = this->x - v.x;
res.y = this->y - v.y;
@@ -66,7 +66,7 @@ union Vec2 {
return res;
}
- Vec2 operator*(r32 scaler) const {
+ Vec2 operator*(r32 scaler) {
Vec2 res;
res.x = this->x * scaler;
res.y = this->y * scaler;
@@ -74,7 +74,7 @@ union Vec2 {
return res;
}
- Vec2 operator*(const Vec2& v) const {
+ Vec2 operator*(Vec2 v) {
Vec2 res;
res.x = this->x * v.x;
res.y = this->y * v.y;