From: Tim Goya Date: Sat, 25 Aug 2007 21:56:34 +0000 (+0000) Subject: Remove draw_text from renderer.hpp and lightmap.hpp since text drawing is done in... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=c655b296af60a436a8ce2bf0e6ede4f72eae0580;p=supertux.git Remove draw_text from renderer.hpp and lightmap.hpp since text drawing is done in a renderer-independent way SVN-Revision: 5158 --- diff --git a/src/video/drawing_context.cpp b/src/video/drawing_context.cpp index de45b4fc4..7ca3e2634 100644 --- a/src/video/drawing_context.cpp +++ b/src/video/drawing_context.cpp @@ -346,7 +346,11 @@ DrawingContext::handle_drawing_requests(DrawingRequests& requests) 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); @@ -368,7 +372,11 @@ DrawingContext::handle_drawing_requests(DrawingRequests& requests) 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); diff --git a/src/video/gl_lightmap.cpp b/src/video/gl_lightmap.cpp index 537a6a97b..014fb736c 100644 --- a/src/video/gl_lightmap.cpp +++ b/src/video/gl_lightmap.cpp @@ -266,15 +266,6 @@ namespace GL } void - Lightmap::draw_text(const DrawingRequest& /*request*/) - { - //const TextRequest* textrequest = (TextRequest*) request.request_data; - - //textrequest->font->draw(textrequest->text, request.pos, - // textrequest->alignment, request.drawing_effect, request.alpha); - } - - void Lightmap::draw_filled_rect(const DrawingRequest& request) { const FillRectRequest* fillrectrequest diff --git a/src/video/gl_renderer.cpp b/src/video/gl_renderer.cpp index 6fb64803c..3eee8f118 100644 --- a/src/video/gl_renderer.cpp +++ b/src/video/gl_renderer.cpp @@ -236,15 +236,6 @@ namespace GL } void - Renderer::draw_text(const DrawingRequest& request) - { - const TextRequest* textrequest = (TextRequest*) request.request_data; - - textrequest->font->draw(this, textrequest->text, request.pos, - textrequest->alignment, request.drawing_effect, request.alpha); - } - - void Renderer::draw_filled_rect(const DrawingRequest& request) { const FillRectRequest* fillrectrequest diff --git a/src/video/lightmap.hpp b/src/video/lightmap.hpp index bca28d46b..049b21ece 100644 --- a/src/video/lightmap.hpp +++ b/src/video/lightmap.hpp @@ -49,7 +49,6 @@ public: virtual void do_draw() = 0; virtual void draw_surface(const DrawingRequest& request) = 0; virtual void draw_surface_part(const DrawingRequest& request) = 0; - virtual void draw_text(const DrawingRequest& request) = 0; virtual void draw_gradient(const DrawingRequest& request) = 0; virtual void draw_filled_rect(const DrawingRequest& request) = 0; virtual void get_light(const DrawingRequest& request) const = 0; diff --git a/src/video/renderer.hpp b/src/video/renderer.hpp index c1f10bf4b..2bd96d70b 100644 --- a/src/video/renderer.hpp +++ b/src/video/renderer.hpp @@ -46,7 +46,6 @@ public: virtual void draw_surface(const DrawingRequest& request) = 0; virtual void draw_surface_part(const DrawingRequest& request) = 0; - virtual void draw_text(const DrawingRequest& request) = 0; virtual void draw_gradient(const DrawingRequest& request) = 0; virtual void draw_filled_rect(const DrawingRequest& request)= 0; virtual void do_take_screenshot() = 0; diff --git a/src/video/sdl_lightmap.cpp b/src/video/sdl_lightmap.cpp index d8bdcde7c..8e7c70fac 100644 --- a/src/video/sdl_lightmap.cpp +++ b/src/video/sdl_lightmap.cpp @@ -562,15 +562,6 @@ namespace SDL } void - Lightmap::draw_text(const DrawingRequest& /*request*/) - { - //const TextRequest* textrequest = (TextRequest*) request.request_data; - - //textrequest->font->draw(textrequest->text, request.pos, - // textrequest->alignment, request.drawing_effect, request.alpha); - } - - void Lightmap::draw_filled_rect(const DrawingRequest& request) { const FillRectRequest* fillrectrequest diff --git a/src/video/sdl_renderer.cpp b/src/video/sdl_renderer.cpp index fecf7ea73..dede6c832 100644 --- a/src/video/sdl_renderer.cpp +++ b/src/video/sdl_renderer.cpp @@ -369,15 +369,6 @@ namespace SDL } void - Renderer::draw_text(const DrawingRequest& request) - { - const TextRequest* textrequest = (TextRequest*) request.request_data; - - textrequest->font->draw(this, textrequest->text, request.pos, - textrequest->alignment, request.drawing_effect, request.alpha); - } - - void Renderer::draw_filled_rect(const DrawingRequest& request) { const FillRectRequest* fillrectrequest