mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
leverage the pre-existing vector<foo>.sort(&method) hooks for better self containment. also sort by dependency count, and above all else, skip sorting entirely if we've already populated mModulesLoaded since that already takes dependencies into account when generating the vector
also defualt to using that one for the general findmodules case
This commit is contained in:
parent
b48d462fbe
commit
ebcee97d5c
3 changed files with 51 additions and 42 deletions
|
|
@ -61,7 +61,8 @@ public:
|
|||
/// Module definitions.
|
||||
typedef Vector<ModuleDefinition*> typeModuleDefinitionVector;
|
||||
typedef Vector<const ModuleDefinition*> typeConstModuleDefinitionVector;
|
||||
|
||||
protected:
|
||||
static S32 moduleDependencySort(ModuleDefinition* const* a, ModuleDefinition* const* b);
|
||||
private:
|
||||
/// Database locking.
|
||||
struct LockDatabase
|
||||
|
|
@ -175,7 +176,7 @@ public:
|
|||
ModuleDefinition* findModule( const char* pModuleId, const U32 versionId );
|
||||
ModuleDefinition* findModuleByFilePath(StringTableEntry filePath);
|
||||
ModuleDefinition* findLoadedModule( const char* pModuleId );
|
||||
void findModules( const bool loadedOnly, typeConstModuleDefinitionVector& moduleDefinitions );
|
||||
void findModules( const bool loadedOnly, typeModuleDefinitionVector& moduleDefinitions );
|
||||
void findModuleTypes( const char* pModuleType, const bool loadedOnly, typeConstModuleDefinitionVector& moduleDefinitions );
|
||||
|
||||
/// Module synchronization.
|
||||
|
|
@ -219,4 +220,4 @@ private:
|
|||
|
||||
extern ModuleManager ModuleDatabase;
|
||||
|
||||
#endif // _MODULE_MANAGER_H
|
||||
#endif // _MODULE_MANAGER_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue