[Supertux-Commit] r5456 - trunk/supertux/src/video

tuxdev at millhouse.dreamhost.com tuxdev at millhouse.dreamhost.com
Sat May 10 09:40:02 PDT 2008


Author: tuxdev
Date: 2008-05-10 09:40:01 -0700 (Sat, 10 May 2008)
New Revision: 5456

Modified:
   trunk/supertux/src/video/drawing_context.cpp
   trunk/supertux/src/video/drawing_request.hpp
Log:
fix lightmap-in-front-of-menu bug

Modified: trunk/supertux/src/video/drawing_context.cpp
===================================================================
--- trunk/supertux/src/video/drawing_context.cpp	2008-05-10 16:38:59 UTC (rev 5455)
+++ trunk/supertux/src/video/drawing_context.cpp	2008-05-10 16:40:01 UTC (rev 5456)
@@ -325,14 +325,17 @@
     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 @@
           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 @@
           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;

Modified: trunk/supertux/src/video/drawing_request.hpp
===================================================================
--- trunk/supertux/src/video/drawing_request.hpp	2008-05-10 16:38:59 UTC (rev 5455)
+++ trunk/supertux/src/video/drawing_request.hpp	2008-05-10 16:40:01 UTC (rev 5456)
@@ -70,7 +70,7 @@
 
 enum RequestType
 {
-  SURFACE, SURFACE_PART, TEXT, GRADIENT, FILLRECT, INVERSEELLIPSE, GETLIGHT
+  SURFACE, SURFACE_PART, TEXT, GRADIENT, FILLRECT, INVERSEELLIPSE, DRAW_LIGHTMAP, GETLIGHT
 };
 
 struct SurfacePartRequest




More information about the Supertux-Commit mailing list