Fixed a compile bug, general code cleanup

This commit is contained in:
Anna Rose 2011-06-23 14:42:07 -04:00
parent 00d2efa31f
commit 9d36120f6d
2 changed files with 8 additions and 6 deletions

View File

@ -18,7 +18,7 @@ class DrawUtils
static bool draw(SDL_Surface* dest, SDL_Surface* drawable, int x, int y,
int x2, int y2, int w, int h);
static void draw_line(SDL_Surface* dest, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint16 width, Uint32 colour);
static void draw_circle_filled(SDL_Surface* dest, Sint16 x, Sint16 y, Uint16 r, Uint32 colour, Uint8 alpha = 255);
static void draw_circle_filled(SDL_Surface* dest, Sint16 x, Sint16 y, Uint16 r, Uint32 colour);
// transpare (v) - to make transparent
static bool transpare(SDL_Surface* surface, int r, int g, int b);

12
graph.h
View File

@ -35,16 +35,18 @@ class Graph
bool vertex_present(int x, int y, int size);
list<Vertex*> get_vertices() { return vertices; }
list<Edge> get_edges() { return edges; }
list<Vertex*> get_vertices() const { return vertices; }
list<Edge> get_edges() const { return edges; }
void select_vertex(int x, int y);
void do_vertex(int x, int y, int r);
Vertex* get_current_vertex() { return current_vertex; }
Vertex* get_current_vertex() const { return current_vertex; }
void clear_current_vertex() { current_vertex = NULL; }
private:
bool vertex_would_overlap(int x, int y, int r);
bool crosses_edge(Edge e);
bool vertex_would_overlap(int x, int y, int r) const;
bool crosses_edge(Edge e) const;
void add_vertex(int x, int y, int r);
Vertex* current_vertex;