From ef2c6bc89f120a09b61740ba10bbe71d1aaf92eb Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Thu, 23 Jun 2011 10:04:14 -0400 Subject: [PATCH] Clean up move_template stuff, move selection circle behind everything else --- gamecore.cpp | 23 ++++++++++------------- gamecore.h | 1 - 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/gamecore.cpp b/gamecore.cpp index e736a29..0e903c7 100644 --- a/gamecore.cpp +++ b/gamecore.cpp @@ -9,7 +9,6 @@ GameCore::GameCore() display = NULL; background = NULL; node = NULL; - move_template = NULL; is_running = true; } @@ -48,9 +47,8 @@ bool GameCore::init() background = DrawUtils::load("background.bmp"); node = DrawUtils::load("node.bmp"); - move_template = DrawUtils::load("mvtemplate.bmp"); - if (background == NULL || node == NULL || move_template == NULL) + if (background == NULL || node == NULL) { #ifdef DEBUG std::cerr << "GameCore::init(): error: Couldn't load an image file\n"; @@ -59,8 +57,8 @@ bool GameCore::init() } DrawUtils::transpare(node, 255, 0, 255); - DrawUtils::transpare(move_template, 255, 0, 255); - SDL_SetAlpha(move_template, SDL_SRCALPHA, 128); + // DrawUtils::transpare(move_template, 255, 0, 255); + // SDL_SetAlpha(move_template, SDL_SRCALPHA, 128); return true; } @@ -73,6 +71,13 @@ void GameCore::render() list vertices = graph.get_vertices(); list edges = graph.get_edges(); + if (graph.get_current_vertex() != NULL) + { + Vertex* v = graph.get_current_vertex(); + DrawUtils::draw_circle_filled(display, v->x, v->y, + Graph::MAX_MOVE_DISTANCE, 0xcb1919, 128); + } + for (list::iterator cursor = vertices.begin(); cursor != vertices.end(); cursor++) { @@ -88,14 +93,6 @@ void GameCore::render() 0x000000); } - if (graph.get_current_vertex() != NULL) - { - Vertex* v = graph.get_current_vertex(); - DrawUtils::draw_circle_filled(display, v->x, v->y, - Graph::MAX_MOVE_DISTANCE, 0xcb1919, 128); - } - - SDL_Flip(display); } diff --git a/gamecore.h b/gamecore.h index dd38c3c..18cc09b 100644 --- a/gamecore.h +++ b/gamecore.h @@ -38,7 +38,6 @@ class GameCore : public MainEvent // textures to draw SDL_Surface* background; SDL_Surface* node; - SDL_Surface* move_template; // data Graph graph;