Skip to content

Commit

Permalink
Now the machines with no markers are correctly shown (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
tatjam committed Sep 21, 2020
1 parent 7c1a838 commit 75e7e53
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/game/scenes/editor/interfaces/WireInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,20 @@ bool WireInterface::do_interface(const CameraUniforms& cu, glm::dvec3 ray_start,
Machine* m = *it;
if(m->editor_location_marker.empty())
{
machines_with_marker.push_back(m);
it = pair.second.erase(it);
it++;
}
else
{
it++;
machines_with_marker.push_back(m);
it = pair.second.erase(it);
}
}

Part* p = pair.first;
glm::dvec3 pos = to_dvec3(p->get_piece("p_root")->packed_tform.getOrigin());
// Draw the polygon with the machines on its edges
// and a central "indicator"
int polygon_machines = machines_with_marker.size();
int polygon_machines = pair.second.size();

float dangle = glm::two_pi<float>() / polygon_machines;

Expand Down Expand Up @@ -176,7 +176,7 @@ bool WireInterface::do_interface(const CameraUniforms& cu, glm::dvec3 ray_start,
}

// Draw the machines at a marker location
for(Machine* m : pair.second)
for(Machine* m : machines_with_marker)
{

glm::dvec3 mpos = p->get_piece("p_root")->get_marker_position(m->editor_location_marker);
Expand Down

0 comments on commit 75e7e53

Please sign in to comment.