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();
}
std::shared_ptr< RenderObject > LineRenderer::copySelf() {
// TODO ACTUALLY copy, don't just copy pointers to textures and whatnot,
// create new textures!!!
return std::make_shared< LineRenderer >( *this );
auto ret = std::make_shared< LineRenderer >( *this );
copyTo(ret);
return ret;
}
void LineRenderer::copyTo(std::shared_ptr<RenderObject> other) {
RenderObject::copyTo(other);
}
SDL_Rect LineRenderer::getRect() {

View File

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