17 INLINE TextureAttrib::
19 _next_implicit_sort = 0;
20 _off_all_stages =
false;
21 _sort_seq = UpdateSeq::old();
22 _filtered_seq = UpdateSeq::old();
29 INLINE TextureAttrib::
31 _on_stages(copy._on_stages),
34 _next_implicit_sort(copy._next_implicit_sort),
35 _off_stages(copy._off_stages),
36 _off_all_stages(copy._off_all_stages),
53 return (_on_stages.
empty());
62 if (_on_stages.
empty()) {
75 return _render_stages.size();
83 nassertr(n >= 0 && n < (
int)_render_stages.size(),
nullptr);
84 return _render_stages[n]->_stage;
94 return _render_ff_stages.size();
104 nassertr(n >= 0 && n < (
int)_render_ff_stages.size(),
nullptr);
105 return _render_ff_stages[n]->_stage;
116 nassertr(n >= 0 && n < (
int)_render_ff_stages.size(), -1);
117 return _render_ff_stages[n]->_ff_tc_index;
126 return _on_stages.find(StageNode(stage)) != _on_stages.
end();
135 Stages::const_iterator si;
136 si = _on_stages.find(StageNode(stage));
137 if (si != _on_stages.
end()) {
138 return (*si)._texture;
150 Stages::const_iterator si;
151 si = _on_stages.find(StageNode(stage));
154 return si->_has_sampler ? si->_sampler
155 : si->_texture->get_default_sampler();
163 Stages::const_iterator si;
164 si = _on_stages.find(StageNode(stage));
165 if (si != _on_stages.
end()) {
166 return (*si)._override;
168 nassert_raise(
"Specified TextureStage not included in attrib");
177 return _off_stages.
size();
186 nassertr(n >= 0 && n < (
int)_off_stages.
size(),
nullptr);
187 return _off_stages[n]._stage;
196 return _off_stages.find(StageNode(stage)) != _off_stages.
end() ||
206 return _off_all_stages;
215 return _on_stages.
empty() && _off_stages.
empty() && !_off_all_stages;
224 INLINE
void TextureAttrib::
225 check_sorted()
const {
234 INLINE TextureAttrib::StageNode::
235 StageNode(
const TextureStage *stage,
unsigned int implicit_sort,
int override) :
239 _implicit_sort(implicit_sort),
249 INLINE
bool TextureAttrib::CompareTextureStagePriorities::
250 operator () (
const TextureAttrib::StageNode *a,
251 const TextureAttrib::StageNode *b)
const {
252 if (a->_stage->get_priority() != b->_stage->get_priority()) {
253 return a->_stage->get_priority() > b->_stage->get_priority();
255 if (a->_stage->get_sort() != b->_stage->get_sort()) {
256 return a->_stage->get_sort() < b->_stage->get_sort();
258 return a->_implicit_sort < b->_implicit_sort;
265 INLINE
bool TextureAttrib::CompareTextureStageSort::
266 operator () (
const TextureAttrib::StageNode *a,
267 const TextureAttrib::StageNode *b)
const {
268 if (a->_stage->get_sort() != b->_stage->get_sort()) {
269 return a->_stage->get_sort() < b->_stage->get_sort();
271 return a->_implicit_sort < b->_implicit_sort;
278 INLINE
bool TextureAttrib::CompareTextureStagePointer::
279 operator () (
const TextureAttrib::StageNode &a,
280 const TextureAttrib::StageNode &b)
const {
281 return a._stage < b._stage;