From: LMH Date: Sat, 15 Jun 2013 07:46:07 +0000 (-1000) Subject: Improved color candle light appearance X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=94e58f71029fc074b303ba91f165b1e0ceadcf56;p=supertux.git Improved color candle light appearance --- diff --git a/data/images/objects/candle/candle-light-1.sprite b/data/images/objects/candle/candle-light-1.sprite index f4d410090..cbad4488f 100644 --- a/data/images/objects/candle/candle-light-1.sprite +++ b/data/images/objects/candle/candle-light-1.sprite @@ -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) + ) ) diff --git a/data/images/objects/candle/candle-light-2.sprite b/data/images/objects/candle/candle-light-2.sprite index 42a6ad840..80529f2b0 100644 --- a/data/images/objects/candle/candle-light-2.sprite +++ b/data/images/objects/candle/candle-light-2.sprite @@ -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) + ) ) diff --git a/data/images/objects/candle/candle-light-white-1.png b/data/images/objects/candle/candle-light-white-1.png new file mode 100644 index 000000000..c44072dab Binary files /dev/null and b/data/images/objects/candle/candle-light-white-1.png differ diff --git a/data/images/objects/candle/candle-light-white-2.png b/data/images/objects/candle/candle-light-white-2.png new file mode 100644 index 000000000..7085836b1 Binary files /dev/null and b/data/images/objects/candle/candle-light-white-2.png differ diff --git a/src/object/candle.cpp b/src/object/candle.cpp index 9a39cd01a..10c549d3b 100644 --- a/src/object/candle.cpp +++ b/src/object/candle.cpp @@ -37,12 +37,16 @@ Candle::Candle(const Reader& lisp) //get color from lisp std::vector 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) {