projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
#303: Typo fixes from mathnerd314
[supertux.git]
/
src
/
object
/
light.cpp
diff --git
a/src/object/light.cpp
b/src/object/light.cpp
index
8b3983f
..
a0abfcf
100644
(file)
--- a/
src/object/light.cpp
+++ b/
src/object/light.cpp
@@
-27,7
+27,7
@@
#include "player.hpp"
#include "sector.hpp"
#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");
}
{
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);
{
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();
}
context.pop_target();
}
-
-IMPLEMENT_FACTORY(Light, "light");