From 6b30acd38653dd30494829b70542c216f57b3ccc Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Sat, 5 Jan 2019 17:17:57 -0500 Subject: [PATCH] remove current_color, stored_color from hex_info --- src/hexgame.cpp | 11 ----------- src/hexgrid.cpp | 17 ----------------- src/hexgrid.h | 2 -- 3 files changed, 30 deletions(-) diff --git a/src/hexgame.cpp b/src/hexgame.cpp index 6613b69..90c2922 100644 --- a/src/hexgame.cpp +++ b/src/hexgame.cpp @@ -179,7 +179,6 @@ void setStartHex(hex_info *hex) { hex->selected = true; - hex->current_color = g_game_state->grid.selected_fill_color; g_game_state->grid.start_hex = g_game_state->grid.current_hex = hex; g_game_state->grid.is_selecting = true; } @@ -225,17 +224,7 @@ handleMouseDown(SDL_MouseButtonEvent &e) v2f v = cameraUnproject(g_render_state->cam, coords.x, coords.y, dims.x, dims.y); hex_info *hex = hgGetSingleHex(g_game_state->grid, v.x, v.y); if (hex) - { hex->selected = !hex->selected; - if (hex->selected) - { - hex->current_color = g_game_state->grid.selected_fill_color; - } - else - { - hex->current_color = hex->stored_color; - } - } }break; } } diff --git a/src/hexgrid.cpp b/src/hexgrid.cpp index ef1fefc..c05d7fb 100644 --- a/src/hexgrid.cpp +++ b/src/hexgrid.cpp @@ -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); diff --git a/src/hexgrid.h b/src/hexgrid.h index f90f2fa..9755d4b 100644 --- a/src/hexgrid.h +++ b/src/hexgrid.h @@ -33,8 +33,6 @@ struct hex_info Hex hex = {}; real64 XPos = 0; real64 YPos = 0; - uint32 current_color = 0; // RGBA - uint32 stored_color = 0; // RGBA bool selected = false; std::vector vertices; };