mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Priority edges are now calculated after all but overlap edges.
This commit is contained in:
+13
-5
@@ -121,13 +121,13 @@ namespace boss {
|
||||
boost::depth_first_search(graph, visitor(vis).vertex_index_map(v_index_map));
|
||||
}
|
||||
|
||||
void AddNonOverlapEdges(PluginGraph& graph) {
|
||||
//Add edges for all relationships that aren't overlaps.
|
||||
void AddSpecificEdges(PluginGraph& graph) {
|
||||
//Add edges for all relationships that aren't overlaps or priority differences.
|
||||
boss::vertex_it vit, vitend;
|
||||
for (boost::tie(vit, vitend) = boost::vertices(graph); vit != vitend; ++vit) {
|
||||
vertex_t parentVertex;
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "Adding non-overlap edges to vertex for \"" << graph[*vit].Name() << "\".";
|
||||
BOOST_LOG_TRIVIAL(trace) << "Adding specific edges to vertex for \"" << graph[*vit].Name() << "\".";
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "Adding edges for master flag differences.";
|
||||
|
||||
@@ -191,9 +191,17 @@ namespace boss {
|
||||
boost::add_edge(parentVertex, *vit, graph);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "Adding edges for priority differences.";
|
||||
vit2 = vit;
|
||||
void AddPriorityEdges(PluginGraph& graph) {
|
||||
boss::vertex_it vit, vitend;
|
||||
|
||||
for (boost::tie(vit, vitend) = boost::vertices(graph); vit != vitend; ++vit) {
|
||||
vertex_t parentVertex;
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "Adding priority difference edges to vertex for \"" << graph[*vit].Name() << "\".";
|
||||
boss::vertex_it vit2 = vit;
|
||||
++vit2;
|
||||
for (vit2,vitend; vit2 != vitend; ++vit2) {
|
||||
BOOST_LOG_TRIVIAL(trace) << "Checking for priority difference between \"" << graph[*vit].Name() << "\" and \"" << graph[*vit2].Name() << "\".";
|
||||
|
||||
+3
-1
@@ -55,7 +55,9 @@ namespace boss {
|
||||
|
||||
void CheckForCycles(const PluginGraph& graph);
|
||||
|
||||
void AddNonOverlapEdges(PluginGraph& graph);
|
||||
void AddSpecificEdges(PluginGraph& graph);
|
||||
|
||||
void AddPriorityEdges(PluginGraph& graph);
|
||||
|
||||
void AddOverlapEdges(PluginGraph& graph);
|
||||
|
||||
|
||||
+4
-1
@@ -628,7 +628,10 @@ void Launcher::OnSortPlugins(wxCommandEvent& event) {
|
||||
|
||||
//Now add the interactions between plugins to the graph as edges.
|
||||
BOOST_LOG_TRIVIAL(trace) << "Adding non-overlap edges.";
|
||||
AddNonOverlapEdges(graph);
|
||||
AddSpecificEdges(graph);
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "Adding priority edges.";
|
||||
AddPriorityEdges(graph);
|
||||
|
||||
BOOST_LOG_TRIVIAL(trace) << "Adding overlap edges.";
|
||||
AddOverlapEdges(graph);
|
||||
|
||||
Reference in New Issue
Block a user