diff --git a/panda/src/pgraph/textureStageCollection.cxx b/panda/src/pgraph/textureStageCollection.cxx index 2cc1e6cd39..4f8dfb3e30 100644 --- a/panda/src/pgraph/textureStageCollection.cxx +++ b/panda/src/pgraph/textureStageCollection.cxx @@ -19,6 +19,8 @@ #include "textureStageCollection.h" #include "indent.h" +#include "indirectLess.h" +#include //////////////////////////////////////////////////////////////////// // 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()); +} + //////////////////////////////////////////////////////////////////// // Function: TextureStageCollection::output // Access: Published diff --git a/panda/src/pgraph/textureStageCollection.h b/panda/src/pgraph/textureStageCollection.h index 707fb80149..79b205b8ad 100644 --- a/panda/src/pgraph/textureStageCollection.h +++ b/panda/src/pgraph/textureStageCollection.h @@ -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;