add TextureStageCollection::sort()

This commit is contained in:
David Rose 2006-01-20 20:46:13 +00:00
parent a209d63185
commit 3c39318b34
2 changed files with 16 additions and 0 deletions

View File

@ -19,6 +19,8 @@
#include "textureStageCollection.h"
#include "indent.h"
#include "indirectLess.h"
#include <algorithm>
////////////////////////////////////////////////////////////////////
// Function: TextureStageCollection::Constructor
@ -253,6 +255,18 @@ operator [] (int index) const {
return _texture_stages[index];
}
////////////////////////////////////////////////////////////////////
// Function: TextureStageCollection::sort
// Access: Published
// Description: Sorts the TextureStages in this collection into order
// by TextureStage::sort(), from lowest to highest.
////////////////////////////////////////////////////////////////////
void TextureStageCollection::
sort() {
::sort(_texture_stages.begin(), _texture_stages.end(),
IndirectLess<TextureStage>());
}
////////////////////////////////////////////////////////////////////
// Function: TextureStageCollection::output
// Access: Published

View File

@ -48,6 +48,8 @@ PUBLISHED:
TextureStage *get_texture_stage(int index) const;
TextureStage *operator [] (int index) const;
void sort();
void output(ostream &out) const;
void write(ostream &out, int indent_level = 0) const;