From 00d2efa31fdd949d47d00bd9c5a205f918ddcba5 Mon Sep 17 00:00:00 2001 From: Anna Wiggins Date: Thu, 23 Jun 2011 14:34:53 -0400 Subject: [PATCH] Added some notes on draw_circle_filled --- drawutils.cpp | 9 +++++++-- gamecore.cpp | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/drawutils.cpp b/drawutils.cpp index 2a747aa..3e99de6 100644 --- a/drawutils.cpp +++ b/drawutils.cpp @@ -86,8 +86,13 @@ void DrawUtils::draw_line(SDL_Surface* dest, Sint16 x1, Sint16 y1, Sint16 x2, Si } } - -void DrawUtils::draw_circle_filled(SDL_Surface* dest, Sint16 int_x, Sint16 int_y, Uint16 int_r, Uint32 colour, Uint8 alpha) +// There's a funny story behind this function. I'd like to use the +// 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 (int_x); float y = static_cast (int_y); diff --git a/gamecore.cpp b/gamecore.cpp index d2783f0..fdb46bc 100644 --- a/gamecore.cpp +++ b/gamecore.cpp @@ -75,7 +75,7 @@ void GameCore::render() { Vertex* v = graph.get_current_vertex(); DrawUtils::draw_circle_filled(display, v->x, v->y, - MAX_MOVE_DISTANCE, 0xcb1919, 128); + MAX_MOVE_DISTANCE, 0xcb1919); } for (list::iterator cursor = vertices.begin();