From e2f2960704ece6bafdba4edae44e18691267cebb Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sat, 1 Oct 2005 19:27:52 +0000 Subject: [PATCH] Added a dirtyDisplayList() to the setColor() and setTesselationHint() methods. --- include/osg/ShapeDrawable | 4 ++-- src/osg/ShapeDrawable.cpp | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/include/osg/ShapeDrawable b/include/osg/ShapeDrawable index de2e7edaa..4aa3409a9 100644 --- a/include/osg/ShapeDrawable +++ b/include/osg/ShapeDrawable @@ -143,12 +143,12 @@ class OSG_EXPORT ShapeDrawable : public Drawable virtual const char* className() const { return "ShapeDrawable"; } /** Set the color of the shape.*/ - void setColor(const Vec4& color) { _color = color; } + void setColor(const Vec4& color); /** Get the color of the shape.*/ const Vec4& getColor() const { return _color; } - void setTessellationHints(TessellationHints* hints) { _tessellationHints = hints; } + void setTessellationHints(TessellationHints* hints); TessellationHints* getTessellationHints() { return _tessellationHints.get(); } const TessellationHints* getTessellationHints() const { return _tessellationHints.get(); } diff --git a/src/osg/ShapeDrawable.cpp b/src/osg/ShapeDrawable.cpp index 836d82baf..6da2fc805 100644 --- a/src/osg/ShapeDrawable.cpp +++ b/src/osg/ShapeDrawable.cpp @@ -1761,6 +1761,23 @@ ShapeDrawable::~ShapeDrawable() { } +void ShapeDrawable::setColor(const Vec4& color) +{ + if (_color!=color) + { + _color = color; dirtyDisplayList(); + } +} + +void ShapeDrawable::setTessellationHints(TessellationHints* hints) +{ + if (_tessellationHints!=hints) + { + _tessellationHints = hints; + dirtyDisplayList(); + } +} + void ShapeDrawable::drawImplementation(State& state) const { if (_shape.valid())