Improved color candle light appearance
authorLMH <lmh.0013@gmail.com>
Sat, 15 Jun 2013 07:46:07 +0000 (21:46 -1000)
committerLMH <lmh.0013@gmail.com>
Sat, 15 Jun 2013 07:46:07 +0000 (21:46 -1000)
data/images/objects/candle/candle-light-1.sprite
data/images/objects/candle/candle-light-2.sprite
data/images/objects/candle/candle-light-white-1.png [new file with mode: 0644]
data/images/objects/candle/candle-light-white-2.png [new file with mode: 0644]
src/object/candle.cpp

index f4d4100..cbad448 100644 (file)
@@ -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)
+    )
 )
index 42a6ad8..80529f2 100644 (file)
@@ -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 (file)
index 0000000..c44072d
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 (file)
index 0000000..7085836
Binary files /dev/null and b/data/images/objects/candle/candle-light-white-2.png differ
index 9a39cd0..10c549d 100644 (file)
@@ -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) {