Add const overload for AnimatedObject::get_shader_data
authorMikko Rasa <tdb@tdb.fi>
Thu, 26 Apr 2018 10:46:06 +0000 (13:46 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 26 Apr 2018 10:46:06 +0000 (13:46 +0300)
source/animatedobject.cpp
source/animatedobject.h

index 99466f2098dd1d6a526354c86ce62bcf3043853c..257e1368def51c6c3a40fef4ebd5f04473320ff9 100644 (file)
@@ -44,6 +44,13 @@ ProgramData &AnimatedObject::get_shader_data()
        return *shdata;
 }
 
+const ProgramData &AnimatedObject::get_shader_data() const
+{
+       if(!shdata)
+               throw invalid_operation("AnimatedObject::get_shader_data");
+       return *shdata;
+}
+
 void AnimatedObject::set_uniform(const string &name, const KeyFrame::AnimatedUniform &uni)
 {
        if(!shdata)
index 3ec336fd353e1349bec2d0811f579512c5819233..74e59fc8a76071196baf10da16a3ab7598ab14bf 100644 (file)
@@ -38,6 +38,7 @@ public:
 
        void set_pose_matrix(unsigned, const Matrix &);
        ProgramData &get_shader_data();
+       const ProgramData &get_shader_data() const;
 
        // Deprecated
        void set_uniform(const std::string &, const KeyFrame::AnimatedUniform &);