Clean up move_template stuff, move selection circle behind everything else

This commit is contained in:
Anna Rose 2011-06-23 10:04:14 -04:00
parent 994cd3208a
commit ef2c6bc89f
2 changed files with 10 additions and 14 deletions

View File

@ -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<Vertex*> vertices = graph.get_vertices();
list<Edge> 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<Vertex*>::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);
}

View File

@ -38,7 +38,6 @@ class GameCore : public MainEvent
// textures to draw
SDL_Surface* background;
SDL_Surface* node;
SDL_Surface* move_template;
// data
Graph graph;