projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Made buttjump a bit easier to perform
[supertux.git]
/
src
/
object
/
spotlight.cpp
diff --git
a/src/object/spotlight.cpp
b/src/object/spotlight.cpp
index
6a29688
..
d86848c
100644
(file)
--- a/
src/object/spotlight.cpp
+++ b/
src/object/spotlight.cpp
@@
-1,4
+1,4
@@
-// $Id
: light.cpp 3327 2006-04-13 15:02:40Z ravu_al_hemio
$
+// $Id$
//
// SuperTux
// Copyright (C) 2006 Ingo Ruhnke <grumbel@gmx.de>
//
// SuperTux
// Copyright (C) 2006 Ingo Ruhnke <grumbel@gmx.de>
@@
-36,11
+36,11
@@
Spotlight::Spotlight(const lisp::Lisp& lisp)
lisp.get("angle", angle);
lisp.get("angle", angle);
-
lisp.get("red", color.red)
;
- lisp.get("green", color.green);
-
lisp.get("blue", color.blue
);
- lisp.get("alpha", color.alpha);
-
+
std::vector<float> vColor
;
+ if( lisp.get_vector( "color", vColor ) ){
+
color = Color( vColor
);
+ }
+
center = sprite_manager->create("images/objects/spotlight/spotlight_center.sprite");
base = sprite_manager->create("images/objects/spotlight/spotlight_base.sprite");
lights = sprite_manager->create("images/objects/spotlight/spotlight_lights.sprite");
center = sprite_manager->create("images/objects/spotlight/spotlight_center.sprite");
base = sprite_manager->create("images/objects/spotlight/spotlight_base.sprite");
lights = sprite_manager->create("images/objects/spotlight/spotlight_lights.sprite");
@@
-68,9
+68,9
@@
Spotlight::update(float delta)
void
Spotlight::draw(DrawingContext& context)
{
void
Spotlight::draw(DrawingContext& context)
{
- context.push_target();
+ context.push_target();
context.set_target(DrawingContext::LIGHTMAP);
context.set_target(DrawingContext::LIGHTMAP);
-
+
light->set_color(color);
light->set_blend(Blend(GL_SRC_ALPHA, GL_ONE));
light->set_angle(angle);
light->set_color(color);
light->set_blend(Blend(GL_SRC_ALPHA, GL_ONE));
light->set_angle(angle);
@@
-78,7
+78,7
@@
Spotlight::draw(DrawingContext& context)
//lightcone->set_angle(angle);
//lightcone->draw(context, position, 0);
//lightcone->set_angle(angle);
//lightcone->draw(context, position, 0);
-
+
context.set_target(DrawingContext::NORMAL);
lights->set_angle(angle);
context.set_target(DrawingContext::NORMAL);
lights->set_angle(angle);