fix: more C++-style SDL_FPoint construction + implemented &src constructor
parent
a504bae0f6
commit
23a913c9f1
|
@ -8,6 +8,9 @@ namespace ce {
|
||||||
Vecf::Vecf(float x, float y)
|
Vecf::Vecf(float x, float y)
|
||||||
: x{x}, y{y} {}
|
: x{x}, y{y} {}
|
||||||
|
|
||||||
|
Vecf::Vecf(Vecf const &src)
|
||||||
|
: x{src.x}, y{src.y} {}
|
||||||
|
|
||||||
Vecf::Vecf(Vecf const &&src)
|
Vecf::Vecf(Vecf const &&src)
|
||||||
: x{src.x}, y{src.y} {}
|
: x{src.x}, y{src.y} {}
|
||||||
|
|
||||||
|
@ -28,7 +31,7 @@ Vecf &Vecf::operator=(std::initializer_list<float> list) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Vecf::operator SDL_FPoint() {
|
Vecf::operator SDL_FPoint() {
|
||||||
return (SDL_FPoint){this->x, this->y};
|
return SDL_FPoint{this->x, this->y};
|
||||||
}
|
}
|
||||||
|
|
||||||
float Vecf::sqr_distance(Vecf const &from, Vecf const &to) {
|
float Vecf::sqr_distance(Vecf const &from, Vecf const &to) {
|
||||||
|
|
Loading…
Reference in New Issue