fix lightmap-in-front-of-menu bug
authorTim Goya <tuxdev103@gmail.com>
Sat, 10 May 2008 16:40:01 +0000 (16:40 +0000)
committerTim Goya <tuxdev103@gmail.com>
Sat, 10 May 2008 16:40:01 +0000 (16:40 +0000)
SVN-Revision: 5456

src/video/drawing_context.cpp
src/video/drawing_request.hpp

index 309c4c1..f1fecb7 100644 (file)
@@ -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;
index 448700d..581438a 100644 (file)
@@ -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