|
|
|
|
@ -44,7 +44,6 @@ hgResetHexes(hexgrid& hg)
|
|
|
|
|
|
|
|
|
|
for (hex_info &hxi : *hg.hex_array) { |
|
|
|
|
hxi.selected = false; |
|
|
|
|
hxi.current_color = hxi.stored_color; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -60,15 +59,9 @@ hgUpdateHexFill(hexgrid& hg, int32 x, int32 y)
|
|
|
|
|
for (hex_info &h : *hg.hex_array) |
|
|
|
|
{ |
|
|
|
|
if (hex_distance(hg.start_hex->hex, h.hex) <= l) |
|
|
|
|
{ |
|
|
|
|
h.selected = true; |
|
|
|
|
h.current_color = hg.selected_fill_color; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
h.selected = false; |
|
|
|
|
h.current_color = h.stored_color; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -90,13 +83,11 @@ hgUpdateHexLineDraw(hexgrid& hg, int32 x, int32 y)
|
|
|
|
|
if (hex_equal(h1.hex, h2)) |
|
|
|
|
{ |
|
|
|
|
h1.selected = true; |
|
|
|
|
h1.current_color = hg.selected_fill_color; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
else if (i == hexLine.size() - 1) |
|
|
|
|
{ |
|
|
|
|
h1.selected = false; |
|
|
|
|
h1.current_color = h1.stored_color; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -138,15 +129,9 @@ hgUpdateHexConeFill(hexgrid& hg, int32 x, int32 y, float cone_angle, std::vector
|
|
|
|
|
test_p.y = h.YPos; |
|
|
|
|
|
|
|
|
|
if (crossingTest(vertices, test_p)) |
|
|
|
|
{ |
|
|
|
|
h.selected = true; |
|
|
|
|
h.current_color = hg.selected_fill_color; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
h.selected = false; |
|
|
|
|
h.current_color = h.stored_color; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
debug_vertices[0] = p1; |
|
|
|
|
@ -202,8 +187,6 @@ createHexagonGrid(hexgrid hg)
|
|
|
|
|
Point p = hex_to_pixel(hg.hexlib_layout, hxi.hex); |
|
|
|
|
hxi.XPos = p.x; |
|
|
|
|
hxi.YPos = p.y; |
|
|
|
|
hxi.current_color = hg.fill_color; |
|
|
|
|
hxi.stored_color = hg.fill_color; |
|
|
|
|
hxi.vertices = polygon_corners(hg.hexlib_layout, hxi.hex); |
|
|
|
|
hxi.vertices.shrink_to_fit(); |
|
|
|
|
hg.hex_array->push_back(hxi); |
|
|
|
|
|