diff --git a/background.bmp b/background.bmp index 26e2f57..a5da352 100644 Binary files a/background.bmp and b/background.bmp differ diff --git a/gamecore.cpp b/gamecore.cpp index 5dbd550..d2783f0 100644 --- a/gamecore.cpp +++ b/gamecore.cpp @@ -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); } diff --git a/graph.cpp b/graph.cpp index 1e8cae5..9a09dc3 100644 --- a/graph.cpp +++ b/graph.cpp @@ -72,3 +72,11 @@ void Graph::add_vertex(int x, int y, int r) edges.push_back(e); current_vertex = v; } + + +Vertex::Vertex(int x, int y, int r) +{ + this->x = x; + this->y = y; + this->r = r; +} diff --git a/graph.h b/graph.h index a2ecd5e..bc96305 100644 --- a/graph.h +++ b/graph.h @@ -14,8 +14,7 @@ using std::list; class Vertex { public: - Vertex(int x, int y, int r) - { this->x = x; this->y = y; } + Vertex(int x, int y, int r); int x; int y;