#include "texture.hpp"
#include "texture_manager.hpp"
#include "obstack/obstackpp.hpp"
-#define LIGHTMAP_DIV 5
static inline int next_po2(int val)
{
fillrectrequest->size = size;
fillrectrequest->color = color;
fillrectrequest->color.alpha = color.alpha * transform.alpha;
+ fillrectrequest->radius = 0.0f;
request->request_data = fillrectrequest;
requests->push_back(request);
DrawingContext::draw_filled_rect(const Rect& rect, const Color& color,
int layer)
{
+ draw_filled_rect(rect, color, 0.0f, layer);
+}
+
+void
+DrawingContext::draw_filled_rect(const Rect& rect, const Color& color, float radius, int layer)
+{
DrawingRequest* request = new(obst) DrawingRequest();
request->target = target;
- request->type = FILLRECT;
- request->pos = transform.apply(rect.p1);
- request->layer = layer;
+ request->type = FILLRECT;
+ request->pos = transform.apply(rect.p1);
+ request->layer = layer;
request->drawing_effect = transform.drawing_effect;
request->alpha = transform.alpha;
fillrectrequest->size = Vector(rect.get_width(), rect.get_height());
fillrectrequest->color = color;
fillrectrequest->color.alpha = color.alpha * transform.alpha;
+ fillrectrequest->radius = radius;
request->request_data = fillrectrequest;
- requests->push_back(request);
+ requests->push_back(request);
}
void
handle_drawing_requests(lightmap_requests);
lightmap->end_draw();
}
+ lightmap_requests.clear();
handle_drawing_requests(drawing_requests);
+ drawing_requests.clear();
if(use_lightmap) {
lightmap->do_draw();
}
renderer->draw_gradient(request);
break;
case TEXT:
- renderer->draw_text(request);
+ {
+ const TextRequest* textrequest = (TextRequest*) request.request_data;
+ textrequest->font->draw(renderer, textrequest->text, request.pos,
+ textrequest->alignment, request.drawing_effect, request.alpha);
+ }
break;
case FILLRECT:
renderer->draw_filled_rect(request);
lightmap->draw_gradient(request);
break;
case TEXT:
- lightmap->draw_text(request);
+ {
+ const TextRequest* textrequest = (TextRequest*) request.request_data;
+ textrequest->font->draw(renderer, textrequest->text, request.pos,
+ textrequest->alignment, request.drawing_effect, request.alpha);
+ }
break;
case FILLRECT:
lightmap->draw_filled_rect(request);
break;
}
}
- requests.clear();
}
void