Trying to switch to more object-oriented

This commit is contained in:
2021-03-12 22:33:46 +01:00
parent fbe122a5b9
commit 258ce51cfe
32 changed files with 693 additions and 249 deletions
+24 -7
View File
@@ -31,13 +31,32 @@ public:
RectangleRender( double x, double y, double w, double h,
const std::shared_ptr< Renderer > &r,
const std::string &img, const SDL_Rect &source_rect );
RectangleRender( const Vec2D<double> &top_left, const Vec2D<double> &size,
const std::shared_ptr< Renderer > &r );
RectangleRender( const Vec2D<double> &top_left, const Vec2D<double> &size,
const std::shared_ptr< Renderer > &r,
const std::shared_ptr< Texture > &t, int source_x,
int source_y, int source_width, int source_height );
RectangleRender( const Vec2D<double> &top_left, const Vec2D<double> &size,
const std::shared_ptr< Renderer > &r,
const std::shared_ptr< Texture > &t,
const SDL_Rect &source_rect = { -1, -1, -1, -1 } );
RectangleRender( const Vec2D<double> &top_left, const Vec2D<double> &size,
const std::shared_ptr< Renderer > &r,
const std::string &img_or_color, bool is_polygon = false );
RectangleRender( const Vec2D<double> &top_left, const Vec2D<double> &size,
const std::shared_ptr< Renderer > &r,
const std::string &img, int source_x, int source_y,
int source_width, int source_height );
RectangleRender( const Vec2D<double> &top_left, const Vec2D<double> &size,
const std::shared_ptr< Renderer > &r,
const std::string &img, const SDL_Rect &source_rect );
virtual void setColor( const std::string &color ) override;
virtual void setOutlineColor( const std::string &color ) override;
virtual void specialAction( int /*UNUSED*/ ) override {}
virtual void custom_move( int /*UNUSED*/ ) override {}
virtual std::pair< std::pair< double, double >,
std::pair< double, double > >
getDoubleRect() const override;
virtual std::pair< Vec2D<double>, Vec2D<double> > getDoubleRect() const override;
virtual int leftmost() override;
virtual int topmost() override;
virtual int rightmost() override;
@@ -55,10 +74,8 @@ public:
protected:
virtual void copyTo( std::shared_ptr< RenderObject > other ) override;
void updateXY();
double og_w;
double og_h;
double w_;
double h_;
Vec2D<double> original_size;
Vec2D<double> size;
std::string color = "";
};
} // end of namespace SDLPP