Browse Source

condense some helper functions in hexgame.cpp

master
cinnaboot 8 years ago
parent
commit
cb9db12f7c
  1. 26
      src/hexgame.cpp

26
src/hexgame.cpp

@ -104,7 +104,7 @@ setStartHex(hex_info *hex)
} }
void void
startHexFill(int32 x, int32 y) startDrawHelper(int32 x, int32 y)
{ {
resetHexes(); resetHexes();
hex_info *hex = getSingleHex(x, y); hex_info *hex = getSingleHex(x, y);
@ -137,15 +137,6 @@ updateHexFill(int32 x, int32 y)
} }
} }
void
startHexLineDraw(int32 x, int32 y)
{
resetHexes();
hex_info *hex = getSingleHex(x, y);
if (hex)
setStartHex(hex);
}
void void
updateHexLineDraw(int32 x, int32 y) updateHexLineDraw(int32 x, int32 y)
{ {
@ -176,15 +167,6 @@ updateHexLineDraw(int32 x, int32 y)
} }
} }
void
startHexConeFill(int32 x, int32 y)
{
resetHexes();
hex_info *hex = getSingleHex(x, y);
if (hex)
setStartHex(hex);
}
void void
updateHexConeFill(int32 x, int32 y) updateHexConeFill(int32 x, int32 y)
{ {
@ -222,15 +204,15 @@ handleMouseDown(SDL_MouseButtonEvent &e)
switch (g_game_state->draw_mode) switch (g_game_state->draw_mode)
{ {
case FILL: case FILL:
startHexFill(coords.x, coords.y); startDrawHelper(coords.x, coords.y);
break; break;
case LINE: case LINE:
startHexLineDraw(coords.x, coords.y); startDrawHelper(coords.x, coords.y);
break; break;
case CONE_FILL: case CONE_FILL:
startHexConeFill(coords.x, coords.y); startDrawHelper(coords.x, coords.y);
break; break;
case PATHFINDING: case PATHFINDING:

Loading…
Cancel
Save