diff options
| author | hatal175 <hatal175@users.noreply.github.com> | 2025-11-19 04:13:35 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-18 18:13:35 -0800 |
| commit | 8a39ebfa8b8ecf4d5fa8006745ba7c31862c75a7 (patch) | |
| tree | af4a9613c73f7e3e409a14365696ba5af36c9ac7 /include/JSystem/JGeometry.h | |
| parent | 158899a16d2798b20812c7751fe3d9bcda54d1b1 (diff) | |
fvb Matching (#2820)
* fvb Matching
* J2DScreen debug work
Diffstat (limited to 'include/JSystem/JGeometry.h')
| -rw-r--r-- | include/JSystem/JGeometry.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/include/JSystem/JGeometry.h b/include/JSystem/JGeometry.h index 5ae2e827d0..2522028442 100644 --- a/include/JSystem/JGeometry.h +++ b/include/JSystem/JGeometry.h @@ -389,16 +389,20 @@ template <typename T> struct TVec2 { TVec2() {} TVec2(T v) { set(v); } - TVec2(T x, T y) { set(x, y); } + + template <typename U> + TVec2(U x, U y) { set(x, y); } void set(T v) { y = x = v; } - void set(T x, T y) { + template <typename U> + void set(U x, U y) { this->x = x; this->y = y; } - void set(const TVec2& other) { + template <typename U> + void set(const TVec2<U>& other) { x = other.x; y = other.y; } @@ -481,9 +485,12 @@ template<> struct TBox<TVec2<f32> > { }; template <typename T> -struct TBox2 : TBox<TVec2<T> > { +struct TBox2 : public TBox<TVec2<T> > { TBox2() {} - TBox2(const TVec2<f32>& i, const TVec2<f32>& f) { set(i, f); } + TBox2(const TVec2<f32>& _i, const TVec2<f32>& _f) { + i.set(_i); + f.set(_f); + } TBox2(f32 x0, f32 y0, f32 x1, f32 y1) { set(x0, y0, x1, y1); } void absolute() { |
