SDLPP: formatting, make compileable on Linux

This commit is contained in:
2021-03-13 18:36:29 +01:00
parent d2cf54556e
commit 2f20661b5b
16 changed files with 118 additions and 100 deletions
+7 -5
View File
@@ -67,7 +67,7 @@ void LineRenderer::setPos( double x, double y ) {
void LineRenderer::setPos( const std::pair< double, double > &pos ) {
setPos( pos.first, pos.second );
}
void LineRenderer::setPos( const Vec2D<double> &vec ) {
void LineRenderer::setPos( const Vec2D< double > &vec ) {
setPos( vec.getX(), vec.getY() );
}
Vec2D< double > LineRenderer::getPos() const {
@@ -135,7 +135,7 @@ SDL_Rect LineRenderer::getRect() {
return { leftmost(), topmost(), rightmost() - leftmost(),
bottommost() - topmost() };
}
std::pair< Vec2D<double>, Vec2D<double> >
std::pair< Vec2D< double >, Vec2D< double > >
LineRenderer::getDoubleRect() const {
return { original.getStart(), original.getEnd() - original.getStart() };
}
@@ -151,14 +151,16 @@ void LineRenderer::updateXY() {
if ( width > height ) {
auto multiplier =
static_cast< double >( width ) / static_cast< double >( height );
x1_ = original.getStart().getX() + static_cast< double >( multiplier - 1 ) / 2;
x2_ = original.getEnd().getX() + static_cast< double >( multiplier - 1 ) / 2;
x1_ = original.getStart().getX() +
static_cast< double >( multiplier - 1 ) / 2;
x2_ = original.getEnd().getX() +
static_cast< double >( multiplier - 1 ) / 2;
} else {
x1_ = original.getStart().getX();
x2_ = original.getEnd().getX();
}
y1_ = original.getStart().getY();
y2_ = original.getEnd().getY();
current = {{x1_, y1_}, {x2_, y2_}};
current = { { x1_, y1_ }, { x2_, y2_ } };
}
} // namespace SDLPP