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
startHexFill(int32 x, int32 y)
startDrawHelper(int32 x, int32 y)
{
resetHexes();
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
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
updateHexConeFill(int32 x, int32 y)
{
@ -222,15 +204,15 @@ handleMouseDown(SDL_MouseButtonEvent &e)
switch (g_game_state->draw_mode)
{
case FILL:
startHexFill(coords.x, coords.y);
startDrawHelper(coords.x, coords.y);
break;
case LINE:
startHexLineDraw(coords.x, coords.y);
startDrawHelper(coords.x, coords.y);
break;
case CONE_FILL:
startHexConeFill(coords.x, coords.y);
startDrawHelper(coords.x, coords.y);
break;
case PATHFINDING:

Loading…
Cancel
Save