From d8e97ff0c9c8d827cea96eeb7673cd1bf7773ded Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Thu, 23 Jun 2011 10:10:07 -0400 Subject: [PATCH] Draw nodes with draw_circle_filled, eliminate node texture --- gamecore.cpp | 12 +++++------- gamecore.h | 1 - node.bmp | Bin 1954 -> 0 bytes 3 files changed, 5 insertions(+), 8 deletions(-) delete mode 100644 node.bmp diff --git a/gamecore.cpp b/gamecore.cpp index 0e903c7..ed3f265 100644 --- a/gamecore.cpp +++ b/gamecore.cpp @@ -8,7 +8,6 @@ GameCore::GameCore() { display = NULL; background = NULL; - node = NULL; is_running = true; } @@ -46,17 +45,16 @@ bool GameCore::init() } background = DrawUtils::load("background.bmp"); - node = DrawUtils::load("node.bmp"); - if (background == NULL || node == NULL) + if (background == NULL) { #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 return false; } - DrawUtils::transpare(node, 255, 0, 255); + // DrawUtils::transpare(node, 255, 0, 255); // DrawUtils::transpare(move_template, 255, 0, 255); // SDL_SetAlpha(move_template, SDL_SRCALPHA, 128); @@ -82,7 +80,8 @@ void GameCore::render() cursor != vertices.end(); 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::iterator cursor = edges.begin(); @@ -106,7 +105,6 @@ void GameCore::iterate() void GameCore::cleanup() { SDL_FreeSurface(background); - SDL_FreeSurface(node); SDL_FreeSurface(display); SDL_Quit(); } diff --git a/gamecore.h b/gamecore.h index 18cc09b..3a79b72 100644 --- a/gamecore.h +++ b/gamecore.h @@ -37,7 +37,6 @@ class GameCore : public MainEvent // textures to draw SDL_Surface* background; - SDL_Surface* node; // data Graph graph; diff --git a/node.bmp b/node.bmp deleted file mode 100644 index 7ad499b053f15766957bd92ce636258417646f7f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1954 zcmZ?rUBu1+24+A~1BfM|n2|vOES>|D7v_dwumF(w&+s2Bg2`i{v8o3OVlfMgZfruB zCZd~#O&3lvG~*Cv;nYD$0&XG=%pznr0eOhiK<*--kT_|OIn*?ZI9o?mjfTL$hX6Ix zJ(bO(+&G{KAVVM&h$a^xOhB-xXcoj!k_?2q1F9E|59AVQ92Sk3LJ$!=CgRir03QYE AsQ>@~