X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Flight.cpp;h=a0abfcf39e23ffb07c5904a02edd964ac035d2ab;hb=08ccb17345a52f5ffd8a5dd6ecf675cad55f16a7;hp=8b3983f9e84929ce77ac1ce759693903e48027bf;hpb=07ddaed2a657e4d2a3d038fed223fc5827159caf;p=supertux.git diff --git a/src/object/light.cpp b/src/object/light.cpp index 8b3983f9e..a0abfcf39 100644 --- a/src/object/light.cpp +++ b/src/object/light.cpp @@ -27,7 +27,7 @@ #include "player.hpp" #include "sector.hpp" -Light::Light(const lisp::Lisp& ) +Light::Light(const Vector& center, const Color& color) : position(center), color(color) { sprite = sprite_manager->create("images/objects/lightmap_light/lightmap_light.sprite"); } @@ -47,10 +47,11 @@ Light::draw(DrawingContext& context) { context.push_target(); context.set_target(DrawingContext::LIGHTMAP); - - sprite->draw(context, Sector::current()->player->get_pos(), 0); - + + sprite->set_color(color); + sprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE)); + sprite->set_angle(90); // FIXME: color won't get applied for angle=0 + sprite->draw(context, position, 0); + context.pop_target(); } - -IMPLEMENT_FACTORY(Light, "light");