|
|
|
@ -88,10 +88,8 @@ getSingleHex(int32 x, int32 y) |
|
|
|
for (hex_info &hxi : *g_game_state->hex_array) |
|
|
|
for (hex_info &hxi : *g_game_state->hex_array) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (hex_equal(h, hxi.hex)) |
|
|
|
if (hex_equal(h, hxi.hex)) |
|
|
|
{ |
|
|
|
|
|
|
|
return &hxi; |
|
|
|
return &hxi; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -111,16 +109,12 @@ startHexFill(int32 x, int32 y) |
|
|
|
resetHexes(); |
|
|
|
resetHexes(); |
|
|
|
hex_info *hex = getSingleHex(x, y); |
|
|
|
hex_info *hex = getSingleHex(x, y); |
|
|
|
if (hex) |
|
|
|
if (hex) |
|
|
|
{ |
|
|
|
|
|
|
|
setStartHex(hex); |
|
|
|
setStartHex(hex); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
void |
|
|
|
updateHexFill(int32 x, int32 y) |
|
|
|
updateHexFill(int32 x, int32 y) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (g_game_state->is_selecting) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
hex_info *hxi = getSingleHex(x, y); |
|
|
|
hex_info *hxi = getSingleHex(x, y); |
|
|
|
if (hxi && (hxi != g_game_state->current_hex)) |
|
|
|
if (hxi && (hxi != g_game_state->current_hex)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -141,7 +135,6 @@ updateHexFill(int32 x, int32 y) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
void |
|
|
|
@ -150,16 +143,12 @@ startHexLineDraw(int32 x, int32 y) |
|
|
|
resetHexes(); |
|
|
|
resetHexes(); |
|
|
|
hex_info *hex = getSingleHex(x, y); |
|
|
|
hex_info *hex = getSingleHex(x, y); |
|
|
|
if (hex) |
|
|
|
if (hex) |
|
|
|
{ |
|
|
|
|
|
|
|
setStartHex(hex); |
|
|
|
setStartHex(hex); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
void |
|
|
|
updateHexLineDraw(int32 x, int32 y) |
|
|
|
updateHexLineDraw(int32 x, int32 y) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (g_game_state->is_selecting) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
hex_info *hxi = getSingleHex(x, y); |
|
|
|
hex_info *hxi = getSingleHex(x, y); |
|
|
|
if (hxi && (hxi != g_game_state->current_hex)) |
|
|
|
if (hxi && (hxi != g_game_state->current_hex)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -168,7 +157,7 @@ updateHexLineDraw(int32 x, int32 y) |
|
|
|
|
|
|
|
|
|
|
|
for (hex_info &h1 : *g_game_state->hex_array) |
|
|
|
for (hex_info &h1 : *g_game_state->hex_array) |
|
|
|
{ |
|
|
|
{ |
|
|
|
for (uint32 i = 0; i < hexLine.size(); i++) |
|
|
|
for (uint i = 0; i < hexLine.size(); i++) |
|
|
|
{
|
|
|
|
{
|
|
|
|
Hex h2 = hexLine[i]; |
|
|
|
Hex h2 = hexLine[i]; |
|
|
|
if (hex_equal(h1.hex, h2)) |
|
|
|
if (hex_equal(h1.hex, h2)) |
|
|
|
@ -185,7 +174,6 @@ updateHexLineDraw(int32 x, int32 y) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
void |
|
|
|
@ -194,16 +182,12 @@ startHexConeFill(int32 x, int32 y) |
|
|
|
resetHexes(); |
|
|
|
resetHexes(); |
|
|
|
hex_info *hex = getSingleHex(x, y); |
|
|
|
hex_info *hex = getSingleHex(x, y); |
|
|
|
if (hex) |
|
|
|
if (hex) |
|
|
|
{ |
|
|
|
|
|
|
|
setStartHex(hex); |
|
|
|
setStartHex(hex); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
void |
|
|
|
updateHexConeFill(int32 x, int32 y) |
|
|
|
updateHexConeFill(int32 x, int32 y) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (g_game_state->is_selecting) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
hex_info *hxi = getSingleHex(x, y); |
|
|
|
hex_info *hxi = getSingleHex(x, y); |
|
|
|
if (hxi && (hxi != g_game_state->current_hex)) |
|
|
|
if (hxi && (hxi != g_game_state->current_hex)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -214,9 +198,8 @@ updateHexConeFill(int32 x, int32 y) |
|
|
|
// TODO: define a system of linear inequalities in hex-space to represent
|
|
|
|
// TODO: define a system of linear inequalities in hex-space to represent
|
|
|
|
// cones/arbitrary polygons
|
|
|
|
// cones/arbitrary polygons
|
|
|
|
if (&h == g_game_state->start_hex) |
|
|
|
if (&h == g_game_state->start_hex) |
|
|
|
{ |
|
|
|
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
|
|
|
|
if (hex_equal(h.hex, hxi->hex)) |
|
|
|
if (hex_equal(h.hex, hxi->hex)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
h.selected = true; |
|
|
|
h.selected = true; |
|
|
|
@ -229,7 +212,6 @@ updateHexConeFill(int32 x, int32 y) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void |
|
|
|
void |
|
|
|
@ -370,7 +352,7 @@ processSDLEvents(SDL_Handles &handles) |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
break; |
|
|
|
case SDL_MOUSEMOTION: |
|
|
|
case SDL_MOUSEMOTION: |
|
|
|
if (!gooey_wants) |
|
|
|
if (!gooey_wants && g_game_state->is_selecting) |
|
|
|
handleMouseMove(e.motion); |
|
|
|
handleMouseMove(e.motion); |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
|