1 // $Id: light.cpp 3327 2006-04-13 15:02:40Z ravu_al_hemio $
4 // Copyright (C) 2006 Ingo Ruhnke <grumbel@gmx.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #include "spotlight.hpp"
23 #include "sprite/sprite_manager.hpp"
24 #include "resources.hpp"
25 #include "video/drawing_context.hpp"
26 #include "object_factory.hpp"
30 Spotlight::Spotlight(const lisp::Lisp& )
32 center = sprite_manager->create("images/objects/spotlight/spotlight_center.sprite");
33 base = sprite_manager->create("images/objects/spotlight/spotlight_base.sprite");
34 lights = sprite_manager->create("images/objects/spotlight/spotlight_lights.sprite");
35 lightcone = sprite_manager->create("images/objects/spotlight/lightcone.sprite");
38 Spotlight::~Spotlight()
47 Spotlight::update(float )
49 // FIXME: add rotation code
53 Spotlight::draw(DrawingContext& context)
55 context.push_target();
56 context.set_target(DrawingContext::LIGHTMAP);
59 lightcone->draw(context, pos, 0);
60 // rotate this one 180 degree
61 lightcone->draw(context, pos, 0);
63 context.set_target(DrawingContext::NORMAL);
64 base->draw(context, pos, 0);
65 center->draw(context, pos, 0);
70 IMPLEMENT_FACTORY(Spotlight, "spotlight");