From: Tim Goya Date: Sat, 10 May 2008 16:40:01 +0000 (+0000) Subject: fix lightmap-in-front-of-menu bug X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a5ef20c6c286995d6ec0a2772fab864040717145;p=supertux.git fix lightmap-in-front-of-menu bug SVN-Revision: 5456 --- diff --git a/src/video/drawing_context.cpp b/src/video/drawing_context.cpp index 309c4c139..f1fecb77e 100644 --- a/src/video/drawing_context.cpp +++ b/src/video/drawing_context.cpp @@ -325,14 +325,17 @@ DrawingContext::do_drawing() lightmap->start_draw(ambient_color); handle_drawing_requests(lightmap_requests); lightmap->end_draw(); + + DrawingRequest* request = new(obst) DrawingRequest(); + request->target = NORMAL; + request->type = DRAW_LIGHTMAP; + request->layer = LAYER_HUD - 1; + drawing_requests.push_back(request); } lightmap_requests.clear(); handle_drawing_requests(drawing_requests); drawing_requests.clear(); - if(use_lightmap) { - lightmap->do_draw(); - } obstack_free(&obst, NULL); obstack_init(&obst); @@ -391,6 +394,9 @@ DrawingContext::handle_drawing_requests(DrawingRequests& requests) case INVERSEELLIPSE: renderer->draw_inverse_ellipse(request); break; + case DRAW_LIGHTMAP: + lightmap->do_draw(); + break; case GETLIGHT: lightmap->get_light(request); break; @@ -420,6 +426,9 @@ DrawingContext::handle_drawing_requests(DrawingRequests& requests) case INVERSEELLIPSE: assert(!"InverseEllipse doesn't make sense on the lightmap"); break; + case DRAW_LIGHTMAP: + lightmap->do_draw(); + break; case GETLIGHT: lightmap->get_light(request); break; diff --git a/src/video/drawing_request.hpp b/src/video/drawing_request.hpp index 448700dc7..581438a47 100644 --- a/src/video/drawing_request.hpp +++ b/src/video/drawing_request.hpp @@ -70,7 +70,7 @@ enum Target { enum RequestType { - SURFACE, SURFACE_PART, TEXT, GRADIENT, FILLRECT, INVERSEELLIPSE, GETLIGHT + SURFACE, SURFACE_PART, TEXT, GRADIENT, FILLRECT, INVERSEELLIPSE, DRAW_LIGHTMAP, GETLIGHT }; struct SurfacePartRequest