SDLPP LineRenderer: actually copy in copySelf

This commit is contained in:
zv0n 2020-12-18 16:05:38 +01:00
parent d4f3e07ae4
commit 27949f891a
2 changed files with 7 additions and 3 deletions

View File

@ -111,9 +111,12 @@ void LineRenderer::centerX() {
updateSizeAndPosition(); updateSizeAndPosition();
} }
std::shared_ptr< RenderObject > LineRenderer::copySelf() { std::shared_ptr< RenderObject > LineRenderer::copySelf() {
// TODO ACTUALLY copy, don't just copy pointers to textures and whatnot, auto ret = std::make_shared< LineRenderer >( *this );
// create new textures!!! copyTo(ret);
return std::make_shared< LineRenderer >( *this ); return ret;
}
void LineRenderer::copyTo(std::shared_ptr<RenderObject> other) {
RenderObject::copyTo(other);
} }
SDL_Rect LineRenderer::getRect() { SDL_Rect LineRenderer::getRect() {

View File

@ -41,6 +41,7 @@ public:
void setOutlineColor( const std::string & /*UNUSED*/ ) override {} void setOutlineColor( const std::string & /*UNUSED*/ ) override {}
protected: protected:
virtual void copyTo(std::shared_ptr<RenderObject> other) override;
void updateXY(); void updateXY();
double og_x1; double og_x1;
double og_y1; double og_y1;