From 97b8f0d945474582c2213b70418d399e5641f0d5 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Thu, 26 Apr 2018 13:46:06 +0300 Subject: [PATCH] Add const overload for AnimatedObject::get_shader_data --- source/animatedobject.cpp | 7 +++++++ source/animatedobject.h | 1 + 2 files changed, 8 insertions(+) diff --git a/source/animatedobject.cpp b/source/animatedobject.cpp index 99466f20..257e1368 100644 --- a/source/animatedobject.cpp +++ b/source/animatedobject.cpp @@ -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) diff --git a/source/animatedobject.h b/source/animatedobject.h index 3ec336fd..74e59fc8 100644 --- a/source/animatedobject.h +++ b/source/animatedobject.h @@ -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 &); -- 2.45.2