diff --git a/sdlpp/sdlpp_renderobject.cpp b/sdlpp/sdlpp_renderobject.cpp index e4f5b32..d2329b9 100644 --- a/sdlpp/sdlpp_renderobject.cpp +++ b/sdlpp/sdlpp_renderobject.cpp @@ -46,6 +46,9 @@ void RenderObject::setPos( const Vec2D< double > &vec ) { Vec2D< double > RenderObject::getPos() const { return original; } +Vec2D< double > RenderObject::getAbsolutePos() const { + return current; +} std::vector< uint64_t > RenderObject::colidesWith( const RenderObject &other ) const { if ( !hasCollisions() || !other.hasCollisions() || getHidden() || @@ -289,7 +292,8 @@ void RenderObject::rotateCounterClockwise( int angle ) { rotateClockwise( 360 - ( angle % 360 ) ); } Vec2D< double > RenderObject::computeAlignmentAdditions() { - double x_addition = 0, y_addition = 0; + double x_addition = 0; + double y_addition = 0; auto dimensions = renderer->getDoubleDimensions(); auto width_diff = dimensions.getX() - 1; auto height_diff = dimensions.getY() - 1; diff --git a/sdlpp/sdlpp_renderobject.hpp b/sdlpp/sdlpp_renderobject.hpp index e89ea9c..8fa9aac 100644 --- a/sdlpp/sdlpp_renderobject.hpp +++ b/sdlpp/sdlpp_renderobject.hpp @@ -46,6 +46,7 @@ public: virtual void setPos( const std::pair< double, double > &pos ); virtual void setPos( const Vec2D< double > &vec ); virtual Vec2D< double > getPos() const; + virtual Vec2D< double > getAbsolutePos() const; std::vector< uint64_t > colidesWith( const RenderObject &other ) const; template < class T > void addCollision( const T &p ) { collisions.push_back( std::make_shared< T >( p ) );