Pass color to draw_seg_side

This commit is contained in:
Kp 2016-02-12 04:02:28 +00:00
parent fd834f0924
commit 7694fff456

View file

@ -169,14 +169,13 @@ static void check_segment(const vsegptridx_t seg)
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
static void draw_seg_side(const vcsegptr_t seg,int side) static void draw_seg_side(const vcsegptr_t seg, int side, const uint8_t color)
{ {
auto &svp = seg->verts; auto &svp = seg->verts;
if (!rotate_list(svp).uand) if (!rotate_list(svp).uand)
{ //all off screen? { //all off screen?
int i; int i;
const auto color = grd_curcanv->cv_color;
auto &stv = Side_to_verts[side]; auto &stv = Side_to_verts[side];
for (i=0;i<3;i++) for (i=0;i<3;i++)
draw_line(svp[stv[i]], svp[stv[i+1]], color); draw_line(svp[stv[i]], svp[stv[i+1]], color);
@ -808,22 +807,19 @@ void draw_world(grs_canvas *screen_canvas,editor_view *v,const vsegptridx_t mine
if (current_group > -1) if (current_group > -1)
if (Groupsegp[current_group]) { if (Groupsegp[current_group]) {
draw_segment(vcsegptr(Groupsegp[current_group]), GROUPSEG_COLOR); draw_segment(vcsegptr(Groupsegp[current_group]), GROUPSEG_COLOR);
gr_setcolor(GROUPSIDE_COLOR); draw_seg_side(vcsegptr(Groupsegp[current_group]), Groupside[current_group], GROUPSIDE_COLOR);
draw_seg_side(vcsegptr(Groupsegp[current_group]), Groupside[current_group]);
} }
// Highlight marked segment and side. // Highlight marked segment and side.
if (Markedsegp) { if (Markedsegp) {
draw_segment(Markedsegp, MARKEDSEG_COLOR); draw_segment(Markedsegp, MARKEDSEG_COLOR);
gr_setcolor(MARKEDSIDE_COLOR); draw_seg_side(Markedsegp,Markedside, MARKEDSIDE_COLOR);
draw_seg_side(Markedsegp,Markedside);
} }
// Highlight current segment and current side. // Highlight current segment and current side.
draw_segment(Cursegp, CURSEG_COLOR); draw_segment(Cursegp, CURSEG_COLOR);
gr_setcolor(CURSIDE_COLOR); draw_seg_side(Cursegp,Curside, CURSIDE_COLOR);
draw_seg_side(Cursegp,Curside);
gr_setcolor(CUREDGE_COLOR); gr_setcolor(CUREDGE_COLOR);
draw_side_edge(Cursegp,Curside,Curedge); draw_side_edge(Cursegp,Curside,Curedge);