Added some notes on draw_circle_filled
This commit is contained in:
parent
a9bd00f37d
commit
00d2efa31f
|
@ -86,8 +86,13 @@ void DrawUtils::draw_line(SDL_Surface* dest, Sint16 x1, Sint16 y1, Sint16 x2, Si
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// There's a funny story behind this function. I'd like to use the
|
||||||
void DrawUtils::draw_circle_filled(SDL_Surface* dest, Sint16 int_x, Sint16 int_y, Uint16 int_r, Uint32 colour, Uint8 alpha)
|
// filledCircleRGBA function from SDL_gfx 2.0.22, but 2.0.17 doesn't have that
|
||||||
|
// fcn. So, we get this alpha-less option for now, instead.
|
||||||
|
// I tried using SDL_gfx's boxRGBA, but that is a lot slower, and doesn't
|
||||||
|
// succeed anyway - drawing 1800 overlapping rectangles blends any alpha value
|
||||||
|
// to opaque
|
||||||
|
void DrawUtils::draw_circle_filled(SDL_Surface* dest, Sint16 int_x, Sint16 int_y, Uint16 int_r, Uint32 colour)
|
||||||
{
|
{
|
||||||
float x = static_cast<float> (int_x);
|
float x = static_cast<float> (int_x);
|
||||||
float y = static_cast<float> (int_y);
|
float y = static_cast<float> (int_y);
|
||||||
|
|
|
@ -75,7 +75,7 @@ void GameCore::render()
|
||||||
{
|
{
|
||||||
Vertex* v = graph.get_current_vertex();
|
Vertex* v = graph.get_current_vertex();
|
||||||
DrawUtils::draw_circle_filled(display, v->x, v->y,
|
DrawUtils::draw_circle_filled(display, v->x, v->y,
|
||||||
MAX_MOVE_DISTANCE, 0xcb1919, 128);
|
MAX_MOVE_DISTANCE, 0xcb1919);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (list<Vertex*>::iterator cursor = vertices.begin();
|
for (list<Vertex*>::iterator cursor = vertices.begin();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user