Use vertex's individual radius for all relevant calculations

This commit is contained in:
2011-06-23 12:46:32 -04:00
parent 4b1947fe44
commit fc71203220
4 changed files with 14 additions and 4 deletions

View File

@ -37,7 +37,7 @@ bool GameCore::init()
{
if (SDL_Init(SDL_INIT_EVERYTHING) < 0) return false;
display = SDL_SetVideoMode(800,600,32, SDL_HWSURFACE | SDL_DOUBLEBUF);
display = SDL_SetVideoMode(1024,768,32, SDL_HWSURFACE | SDL_DOUBLEBUF);
if (display == NULL)
{
#ifdef DEBUG
@ -82,7 +82,7 @@ void GameCore::render()
cursor != vertices.end(); cursor++)
{
Vertex v = *(*cursor);
DrawUtils::draw_circle_filled(display, v.x, v.y, NODE_RADIUS,
DrawUtils::draw_circle_filled(display, v.x, v.y, v.r,
0x000000);
}
@ -124,7 +124,10 @@ void GameCore::on_lbutton_down(int x, int y)
if (cv != NULL &&
(MathUtils::distance(cv->x, cv->y, x, y)
> MAX_MOVE_DISTANCE))
{
graph.select_vertex(x, y);
return;
}
graph.do_vertex(x, y, NODE_RADIUS);
}