From e972a6dd0b16ea0bb687398d9e78ce979b00b5f0 Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 10 Mar 2010 20:26:18 +0000 Subject: [PATCH] get_text() should return a reference --- panda/src/gobj/shader.I | 4 ++-- panda/src/gobj/shader.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/panda/src/gobj/shader.I b/panda/src/gobj/shader.I index c5d431ce76..7b618d626f 100755 --- a/panda/src/gobj/shader.I +++ b/panda/src/gobj/shader.I @@ -45,10 +45,10 @@ get_filename(const ShaderType &type) const { // Access: Public // Description: Return the Shader's text for the given shader type. //////////////////////////////////////////////////////////////////// -INLINE const string Shader:: +INLINE const string &Shader:: get_text(const ShaderType &type) const { if (_text->_separate) { - nassertr(type != ST_none || !_text->_shared.empty(), ""); + nassertr(type != ST_none || !_text->_shared.empty(), _text->_shared); switch (type) { case ST_vertex: return _text->_vertex; diff --git a/panda/src/gobj/shader.h b/panda/src/gobj/shader.h index 07296c5e65..8fe78a1763 100755 --- a/panda/src/gobj/shader.h +++ b/panda/src/gobj/shader.h @@ -56,7 +56,7 @@ PUBLISHED: static PT(Shader) make(const ShaderLanguage &lang, const string &vertex, const string &fragment, const string &geometry = ""); INLINE const Filename get_filename(const ShaderType &type = ST_none) const; - INLINE const string get_text(const ShaderType &type = ST_none) const; + INLINE const string &get_text(const ShaderType &type = ST_none) const; INLINE const bool get_error_flag() const; INLINE const ShaderLanguage get_language() const;