Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improved color candle light appearance
  • Loading branch information
LMH0013 committed Jun 15, 2013
1 parent 1d0dbc2 commit 94e58f7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions data/images/objects/candle/candle-light-1.sprite
Expand Up @@ -4,4 +4,9 @@
(images "candle-light-1.png")
(hitbox 256 256 0 0)
)
(action
(name "white")
(images "candle-light-white-1.png")
(hitbox 256 256 0 0)
)
)
5 changes: 5 additions & 0 deletions data/images/objects/candle/candle-light-2.sprite
Expand Up @@ -4,4 +4,9 @@
(images "candle-light-2.png")
(hitbox 256 256 0 0)
)
(action
(name "white")
(images "candle-light-white-2.png")
(hitbox 256 256 0 0)
)
)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/object/candle.cpp
Expand Up @@ -37,12 +37,16 @@ Candle::Candle(const Reader& lisp)
//get color from lisp
std::vector<float> vColor;
lisp.get("color", vColor);
//change the light color if defined
if (vColor.size() >= 3) {
lightcolor = Color(vColor);
candle_light_1->set_blend(Blend(GL_SRC_ALPHA, GL_ONE));
candle_light_2->set_blend(Blend(GL_SRC_ALPHA, GL_ONE));
candle_light_1->set_color(lightcolor);
candle_light_2->set_color(lightcolor);
//the following allows the original candle appearance to be preserved
candle_light_1->set_action("white");
candle_light_2->set_action("white");
}

if (burning) {
Expand Down

0 comments on commit 94e58f7

Please sign in to comment.