SDLPP: Formatting

This commit is contained in:
zvon 2021-03-15 14:50:40 +01:00
parent 4cd351c7a3
commit 6cfe2046d4
4 changed files with 16 additions and 5 deletions

View File

@ -1,8 +1,10 @@
#include "sdlpp_fontconfiguration.hpp" #include "sdlpp_fontconfiguration.hpp"
namespace SDLPP { namespace SDLPP {
FontConfiguration::FontConfiguration( std::shared_ptr< Font > font, const std::string &color, FontConfiguration::FontConfiguration( std::shared_ptr< Font > font,
const std::string &outline_color, double outline_size ) { const std::string &color,
const std::string &outline_color,
double outline_size ) {
_font = font; _font = font;
_color = color; _color = color;
_outline_color = outline_color; _outline_color = outline_color;
@ -32,4 +34,4 @@ void FontConfiguration::setColor( const std::string &color ) {
void FontConfiguration::setOutlineColor( const std::string &outline_color ) { void FontConfiguration::setOutlineColor( const std::string &outline_color ) {
_outline_color = outline_color; _outline_color = outline_color;
} }
} } // namespace SDLPP

View File

@ -28,6 +28,7 @@ public:
updateMost(); updateMost();
return *this; return *this;
} }
void updateMost() { void updateMost() {
if ( _start.getY() < _end.getY() ) { if ( _start.getY() < _end.getY() ) {
top = &_start; top = &_start;
@ -44,28 +45,36 @@ public:
right = &_start; right = &_start;
} }
} }
const Vec2D< T > &getStart() const { const Vec2D< T > &getStart() const {
return _start; return _start;
} }
const Vec2D< T > &getEnd() const { const Vec2D< T > &getEnd() const {
return _end; return _end;
} }
double length() const { double length() const {
return vecDistance( _start, _end ); return vecDistance( _start, _end );
} }
double lengthSquared() const { double lengthSquared() const {
return vecDistanceSquared( _start, _end ); return vecDistanceSquared( _start, _end );
} }
void setInfinite( bool infinite ) { void setInfinite( bool infinite ) {
_infinite = infinite; _infinite = infinite;
} }
bool isInfinite() { bool isInfinite() {
return _infinite; return _infinite;
} }
void add( const Vec2D< T > &vec ) { void add( const Vec2D< T > &vec ) {
_start += vec; _start += vec;
_end += vec; _end += vec;
} }
const Vec2D< T > &topmost() const { const Vec2D< T > &topmost() const {
return *top; return *top;
} }

View File

@ -14,7 +14,7 @@ public:
Renderer( Window &window ); Renderer( Window &window );
virtual ~Renderer(); virtual ~Renderer();
SDL_Renderer *getRendererPtr(); SDL_Renderer *getRendererPtr();
Vec2D<int> getDimensions() const; Vec2D< int > getDimensions() const;
int getWidth() const; int getWidth() const;
int getHeight() const; int getHeight() const;
int getSmallerSide() const; int getSmallerSide() const;

View File

@ -163,7 +163,7 @@ const std::shared_ptr< RenderObject > &Scene::leftmost() {
const std::shared_ptr< RenderObject > &Scene::rightmost() { const std::shared_ptr< RenderObject > &Scene::rightmost() {
return rightmost_obj; return rightmost_obj;
} }
Vec2D<int> Scene::getDimensions() const { Vec2D< int > Scene::getDimensions() const {
return renderer->getDimensions(); return renderer->getDimensions();
} }
int Scene::getWidth() const { int Scene::getWidth() const {