added const qualifier to box stamp method

This commit is contained in:
Frank DeMarco 2020-09-06 03:02:02 -04:00
parent 35a5acbd53
commit df8bf267f0
3 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@
classes, private and public class members, pixel class iterator, sprite classes, private and public class members, pixel class iterator, sprite
movement history, input history, use seconds instead of milliseconds, store movement history, input history, use seconds instead of milliseconds, store
a node's animations in list, frame object for sprite class, inline short a node's animations in list, frame object for sprite class, inline short
functions, add box2d to library functions, add box2d to library, load in separate thread and display progress
:) SWEATY HANDS :) OILY SNACKS :) AND BAD HYGIENE :) :) SWEATY HANDS :) OILY SNACKS :) AND BAD HYGIENE :)

View File

@ -293,7 +293,7 @@ void Box::move(const glm::vec2& delta)
set_y(get_y() + delta.y); set_y(get_y() + delta.y);
} }
Box Box::stamp(const glm::vec2& delta) Box Box::stamp(const glm::vec2& delta) const
{ {
Box clone = *this; Box clone = *this;
clone.move(delta); clone.move(delta);

View File

@ -65,7 +65,7 @@ struct Box : SDL_FRect
void expand(glm::vec2, bool = false); void expand(glm::vec2, bool = false);
void expand(float, bool = false); void expand(float, bool = false);
void move(const glm::vec2&); void move(const glm::vec2&);
Box stamp(const glm::vec2&); Box stamp(const glm::vec2&) const;
bool collide(const glm::vec2&) const; bool collide(const glm::vec2&) const;
bool collide(const Segment&, glm::vec2* = nullptr) const; bool collide(const Segment&, glm::vec2* = nullptr) const;
bool collide(const Segment&, glm::vec2&) const; bool collide(const Segment&, glm::vec2&) const;