mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -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 const Filename &get_fullpath() const;
|
||||||
INLINE void set_fullpath(const Filename &fullpath);
|
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:
|
private:
|
||||||
Filename _filename;
|
Filename _filename;
|
||||||
Filename _fullpath;
|
Filename _fullpath;
|
||||||
|
@ -421,6 +421,20 @@ sort_by_tref() {
|
|||||||
NamableOrderByName());
|
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
|
// Function: EggTextureCollection::add_texture
|
||||||
// Access: Public
|
// Access: Public
|
||||||
|
@ -83,6 +83,7 @@ PUBLISHED:
|
|||||||
|
|
||||||
void uniquify_trefs();
|
void uniquify_trefs();
|
||||||
void sort_by_tref();
|
void sort_by_tref();
|
||||||
|
void sort_by_basename();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Can be used to traverse all the textures in the collection, in
|
// Can be used to traverse all the textures in the collection, in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user