mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
add sort_filename
This commit is contained in:
parent
ed058d20ad
commit
d122e0084b
@ -46,6 +46,14 @@ PUBLISHED:
|
||||
INLINE const Filename &get_fullpath() const;
|
||||
INLINE void set_fullpath(const Filename &fullpath);
|
||||
|
||||
public:
|
||||
class IndirectOrderByBasename {
|
||||
public:
|
||||
bool operator () (const EggFilenameNode *a, const EggFilenameNode *b) const {
|
||||
return a->get_filename().get_basename() < b->get_filename().get_basename();
|
||||
}
|
||||
};
|
||||
|
||||
private:
|
||||
Filename _filename;
|
||||
Filename _fullpath;
|
||||
|
@ -421,6 +421,20 @@ sort_by_tref() {
|
||||
NamableOrderByName());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: EggTextureCollection::sort_by_basename
|
||||
// Access: Public
|
||||
// Description: Sorts all the textures into alphabetical order by
|
||||
// the basename part (including extension) of the
|
||||
// filename. Subsequent operations using begin()/end()
|
||||
// will traverse in this sorted order.
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void EggTextureCollection::
|
||||
sort_by_basename() {
|
||||
sort(_ordered_textures.begin(), _ordered_textures.end(),
|
||||
EggFilenameNode::IndirectOrderByBasename());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: EggTextureCollection::add_texture
|
||||
// Access: Public
|
||||
|
@ -83,6 +83,7 @@ PUBLISHED:
|
||||
|
||||
void uniquify_trefs();
|
||||
void sort_by_tref();
|
||||
void sort_by_basename();
|
||||
|
||||
public:
|
||||
// Can be used to traverse all the textures in the collection, in
|
||||
|
Loading…
x
Reference in New Issue
Block a user