diff --git a/panda/src/pgraph/renderState.I b/panda/src/pgraph/renderState.I index faf68f2fe2..d232ecb00a 100644 --- a/panda/src/pgraph/renderState.I +++ b/panda/src/pgraph/renderState.I @@ -483,7 +483,7 @@ flush_level() { #ifndef CPPPARSER /** - * Handy templated version of get_attrib that costs to the right type. + * Handy templated version of get_attrib that casts to the right type. * Returns true if the attribute was present, false otherwise. */ template @@ -492,15 +492,26 @@ get_attrib(const AttribType *&attrib) const { attrib = (const AttribType *)get_attrib((int)AttribType::get_class_slot()); return (attrib != nullptr); } +template +INLINE bool RenderState:: +get_attrib(CPT(AttribType) &attrib) const { + attrib = (const AttribType *)get_attrib((int)AttribType::get_class_slot()); + return (attrib != nullptr); +} /** - * Handy templated version of get_attrib_def that costs to the right type. + * Handy templated version of get_attrib_def that casts to the right type. */ template INLINE void RenderState:: get_attrib_def(const AttribType *&attrib) const { attrib = (const AttribType *)get_attrib_def((int)AttribType::get_class_slot()); } +template +INLINE void RenderState:: +get_attrib_def(CPT(AttribType) &attrib) const { + attrib = (const AttribType *)get_attrib_def((int)AttribType::get_class_slot()); +} #endif // CPPPARSER /** diff --git a/panda/src/pgraph/renderState.h b/panda/src/pgraph/renderState.h index ab59a6648d..c9e3719082 100644 --- a/panda/src/pgraph/renderState.h +++ b/panda/src/pgraph/renderState.h @@ -162,7 +162,11 @@ public: template INLINE bool get_attrib(const AttribType *&attrib) const; template + INLINE bool get_attrib(CPT(AttribType) &attrib) const; + template INLINE void get_attrib_def(const AttribType *&attrib) const; + template + INLINE void get_attrib_def(CPT(AttribType) &attrib) const; #endif // CPPPARSER private: