X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fvideo%2Fdrawing_context.hpp;h=4839239dc52d6c97ddacc9581fb82329abb488c0;hb=6cd71a8644049d1951b5a9702a57ad02a7971c1e;hp=fee4981867fb8c8b0bcb7619c12708412583c708;hpb=f7659d1e6e1268e6fec002e806a8a469408aa335;p=supertux.git diff --git a/src/video/drawing_context.hpp b/src/video/drawing_context.hpp index fee498186..4839239dc 100644 --- a/src/video/drawing_context.hpp +++ b/src/video/drawing_context.hpp @@ -125,13 +125,16 @@ public: /// return currently set alpha float get_alpha() const; + /// on next update, set color to lightmap's color at position + void get_light(const Vector& position, Color* color ); + enum Target { NORMAL, LIGHTMAP }; void push_target(); void pop_target(); void set_target(Target target); - + void set_ambient_color( Color new_color ); private: @@ -162,7 +165,7 @@ private: enum RequestType { - SURFACE, SURFACE_PART, TEXT, GRADIENT, FILLRECT, LIGHTMAPREQUEST + SURFACE, SURFACE_PART, TEXT, GRADIENT, FILLRECT, LIGHTMAPREQUEST, GETLIGHT }; struct SurfacePartRequest @@ -215,6 +218,11 @@ private: } }; + struct GetLightRequest + { + Color* color_ptr; + }; + typedef std::vector DrawingRequests; void handle_drawing_requests(DrawingRequests& requests); @@ -224,6 +232,7 @@ private: void draw_gradient(DrawingRequest& request); void draw_filled_rect(DrawingRequest& request); void draw_lightmap(DrawingRequest& request); + void get_light(DrawingRequest& request); DrawingRequests drawing_requests; DrawingRequests lightmap_requests;