+@@ -219,6 +218,8 @@
+ DrawingContext::draw_filled_rect(const Rect& rect, const Color& color,
+ int layer)
+ {
++ if(target != NORMAL) return;
++
+ DrawingRequest request;
+
+ request.type = FILLRECT;
+@@ -238,39 +239,20 @@
+ }
+
+ void
+-DrawingContext::get_light(const Vector& position, Color* color)
++DrawingContext::get_light(const Vector& , Color* color)
+ {
+- if( ambient_color.red == 1.0f && ambient_color.green == 1.0f
+- && ambient_color.blue == 1.0f ) {
+- *color = Color( 1.0f, 1.0f, 1.0f);
+- return;
++ static int i = 0;
++ i += 1; i &= 0xFFFF;
++ if (i & 0x8000) {
++ *color = Color(0.0f, 0.0f, 0.0f);
++ } else {
++ *color = Color(1.0f, 1.0f, 1.0f);
+ }
+- DrawingRequest request;
+- request.type = GETLIGHT;
+- request.pos = transform.apply(position);
+- request.layer = LAYER_GUI; //make sure all get_light requests are handled last.
+-
+- GetLightRequest* getlightrequest = new GetLightRequest;
+- getlightrequest->color_ptr = color;
+- request.request_data = getlightrequest;
+- lightmap_requests.push_back(request);
+ }
+
+ void
+-DrawingContext::get_light(DrawingRequest& request)
++DrawingContext::get_light(DrawingRequest& )
+ {
+- GetLightRequest* getlightrequest = (GetLightRequest*) request.request_data;
+-
+- float pixels[3];
+- for( int i = 0; i<3; i++)
+- pixels[i] = 0.0f; //set to black
+-
+- //TODO: hacky. Make coordinate conversion more generic
+- glReadPixels((GLint) request.pos.x / 4, 600-(GLint)request.pos.y / 4, 1, 1, GL_RGB, GL_FLOAT, pixels);
+- *(getlightrequest->color_ptr) = Color( pixels[0], pixels[1], pixels[2]);
+- //printf("get_light %f/%f r%f g%f b%f\n", request.pos.x, request.pos.y, pixels[0], pixels[1], pixels[2]);
+-
+- delete getlightrequest;
+ }
+
+ void
+@@ -288,6 +264,45 @@
+ delete surfacepartrequest;
+ }
+
++namespace
++{
++ void fillrect(SDL_Surface* screen, float x, float y, float w, float h, int r, int g, int b, int a)
++ {
++ if(w < 0) {
++ x += w;
++ w = -w;
++ }
++ if(h < 0) {
++ y += h;
++ h = -h;
++ }
++
++ SDL_Rect src, rect;
++ SDL_Surface *temp = NULL;
++
++ rect.x = (int)x;
++ rect.y = (int)y;
++ rect.w = (int)w;
++ rect.h = (int)h;
++
++ if(a != 255) {
++ temp = SDL_CreateRGBSurface(screen->flags, rect.w, rect.h, screen->format->BitsPerPixel, screen->format->Rmask, screen->format->Gmask, screen->format->Bmask, screen->format->Amask);
++
++ src.x = 0;
++ src.y = 0;
++ src.w = rect.w;
++ src.h = rect.h;
++
++ SDL_FillRect(temp, &src, SDL_MapRGB(screen->format, r, g, b));
++ SDL_SetAlpha(temp, SDL_SRCALPHA, a);
++ SDL_BlitSurface(temp,0,screen,&rect);
++ SDL_FreeSurface(temp);
++ } else {
++ SDL_FillRect(screen, &rect, SDL_MapRGB(screen->format, r, g, b));
++ }
++ }
++}
++
+ void
+ DrawingContext::draw_gradient(DrawingRequest& request)
+ {
+@@ -295,16 +310,9 @@