mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 00:06:44 -04:00
pgraph: add version of RenderState::get_attrib(_def) taking a CPT
This commit is contained in:
parent
f804b10d45
commit
19e1b1d877
@ -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<class AttribType>
|
||||
@ -492,15 +492,26 @@ get_attrib(const AttribType *&attrib) const {
|
||||
attrib = (const AttribType *)get_attrib((int)AttribType::get_class_slot());
|
||||
return (attrib != nullptr);
|
||||
}
|
||||
template<class AttribType>
|
||||
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<class AttribType>
|
||||
INLINE void RenderState::
|
||||
get_attrib_def(const AttribType *&attrib) const {
|
||||
attrib = (const AttribType *)get_attrib_def((int)AttribType::get_class_slot());
|
||||
}
|
||||
template<class AttribType>
|
||||
INLINE void RenderState::
|
||||
get_attrib_def(CPT(AttribType) &attrib) const {
|
||||
attrib = (const AttribType *)get_attrib_def((int)AttribType::get_class_slot());
|
||||
}
|
||||
#endif // CPPPARSER
|
||||
|
||||
/**
|
||||
|
@ -162,7 +162,11 @@ public:
|
||||
template<class AttribType>
|
||||
INLINE bool get_attrib(const AttribType *&attrib) const;
|
||||
template<class AttribType>
|
||||
INLINE bool get_attrib(CPT(AttribType) &attrib) const;
|
||||
template<class AttribType>
|
||||
INLINE void get_attrib_def(const AttribType *&attrib) const;
|
||||
template<class AttribType>
|
||||
INLINE void get_attrib_def(CPT(AttribType) &attrib) const;
|
||||
#endif // CPPPARSER
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user