Draw nodes with draw_circle_filled, eliminate node texture
This commit is contained in:
parent
ef2c6bc89f
commit
d8e97ff0c9
12
gamecore.cpp
12
gamecore.cpp
|
@ -8,7 +8,6 @@ GameCore::GameCore()
|
||||||
{
|
{
|
||||||
display = NULL;
|
display = NULL;
|
||||||
background = NULL;
|
background = NULL;
|
||||||
node = NULL;
|
|
||||||
is_running = true;
|
is_running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -46,17 +45,16 @@ bool GameCore::init()
|
||||||
}
|
}
|
||||||
|
|
||||||
background = DrawUtils::load("background.bmp");
|
background = DrawUtils::load("background.bmp");
|
||||||
node = DrawUtils::load("node.bmp");
|
|
||||||
|
|
||||||
if (background == NULL || node == NULL)
|
if (background == NULL)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
std::cerr << "GameCore::init(): error: Couldn't load an image file\n";
|
std::cerr << "GameCore::init(): error: Couldn't load background image\n";
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawUtils::transpare(node, 255, 0, 255);
|
// DrawUtils::transpare(node, 255, 0, 255);
|
||||||
// DrawUtils::transpare(move_template, 255, 0, 255);
|
// DrawUtils::transpare(move_template, 255, 0, 255);
|
||||||
// SDL_SetAlpha(move_template, SDL_SRCALPHA, 128);
|
// SDL_SetAlpha(move_template, SDL_SRCALPHA, 128);
|
||||||
|
|
||||||
|
@ -82,7 +80,8 @@ void GameCore::render()
|
||||||
cursor != vertices.end(); cursor++)
|
cursor != vertices.end(); cursor++)
|
||||||
{
|
{
|
||||||
Vertex v = *(*cursor);
|
Vertex v = *(*cursor);
|
||||||
DrawUtils::draw(display, node, v.x_min, v.y_min);
|
DrawUtils::draw_circle_filled(display, v.x, v.y, NODE_SIZE>>1,
|
||||||
|
0x000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (list<Edge>::iterator cursor = edges.begin();
|
for (list<Edge>::iterator cursor = edges.begin();
|
||||||
|
@ -106,7 +105,6 @@ void GameCore::iterate()
|
||||||
void GameCore::cleanup()
|
void GameCore::cleanup()
|
||||||
{
|
{
|
||||||
SDL_FreeSurface(background);
|
SDL_FreeSurface(background);
|
||||||
SDL_FreeSurface(node);
|
|
||||||
SDL_FreeSurface(display);
|
SDL_FreeSurface(display);
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,6 @@ class GameCore : public MainEvent
|
||||||
|
|
||||||
// textures to draw
|
// textures to draw
|
||||||
SDL_Surface* background;
|
SDL_Surface* background;
|
||||||
SDL_Surface* node;
|
|
||||||
|
|
||||||
// data
|
// data
|
||||||
Graph graph;
|
Graph graph;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user