Split sdlpp into smaller files
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
#ifndef SDLPP_HPP_RECT_RENDERER
|
||||
#define SDLPP_HPP_RECT_RENDERER
|
||||
|
||||
#include "sdlpp_common.hpp"
|
||||
#include "sdlpp_renderobject.hpp"
|
||||
#include "sdlpp_rectcolider.hpp"
|
||||
|
||||
namespace SDLPP {
|
||||
class RectangleRender : public RenderObject {
|
||||
public:
|
||||
RectangleRender() = delete;
|
||||
virtual ~RectangleRender(){};
|
||||
RectangleRender( double x, double y, double w, double h,
|
||||
const std::shared_ptr< Renderer > &r );
|
||||
RectangleRender( double x, double y, double w, double h,
|
||||
const std::shared_ptr< Renderer > &r,
|
||||
const std::shared_ptr< Texture > &t );
|
||||
RectangleRender( double x, double y, double w, double h,
|
||||
const std::shared_ptr< Renderer > &r,
|
||||
const std::string &img_or_color, bool is_polygon = false );
|
||||
virtual void setColor( const std::string &color ) override;
|
||||
virtual void setOutlineColor( const std::string &color ) override;
|
||||
virtual void specialAction( int /*UNUSED*/ ) override{};
|
||||
virtual void render() override;
|
||||
virtual void move( int ticks ) override;
|
||||
virtual void custom_move( int /*UNUSED*/ ) override {}
|
||||
virtual std::pair< std::pair< double, double >,
|
||||
std::pair< double, double > >
|
||||
getDoubleRect() const override;
|
||||
virtual void setPos( double x, double y ) override;
|
||||
virtual void setPos( const std::pair< double, double > &pos ) override;
|
||||
virtual std::pair< double, double > getPos() const override;
|
||||
virtual int leftmost() override;
|
||||
virtual int topmost() override;
|
||||
virtual int rightmost() override;
|
||||
virtual int bottommost() override;
|
||||
virtual int collisionPushX() override;
|
||||
virtual int collisionPushY() override;
|
||||
virtual int collisionWidth() override;
|
||||
virtual int collisionHeight() override;
|
||||
virtual void updateSizeAndPosition() override;
|
||||
virtual SDL_Rect getRect() override;
|
||||
virtual void centerX() override;
|
||||
virtual std::shared_ptr< RenderObject > copySelf() override;
|
||||
std::string getColor() const;
|
||||
|
||||
protected:
|
||||
void updateXY();
|
||||
double og_x;
|
||||
double og_y;
|
||||
double og_w;
|
||||
double og_h;
|
||||
double x_;
|
||||
double y_;
|
||||
double w_;
|
||||
double h_;
|
||||
bool centerx = false;
|
||||
SDL_Rect rect;
|
||||
std::string color = "";
|
||||
};
|
||||
} // end of namespace SDLPP
|
||||
#endif
|
||||
Reference in New Issue
Block a user