get_text() should return a reference

This commit is contained in:
David Rose 2010-03-10 20:26:18 +00:00
parent 2e9cf84f88
commit e972a6dd0b
2 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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;