From 69be5aee32ec5b3eb1c65f4569f92746cc8d294c Mon Sep 17 00:00:00 2001 From: Wolfgang Becker Date: Sun, 17 Sep 2006 17:19:16 +0000 Subject: [PATCH] A lantern with black light is turned off. SVN-Revision: 4241 --- data/images/objects/lantern/lantern-off.png | Bin 0 -> 4232 bytes data/images/objects/lantern/lantern.sprite | 7 ++++++- data/images/objects/lantern/lantern.xcf | Bin 15965 -> 17046 bytes src/object/lantern.cpp | 18 ++++++++++++++---- src/object/lantern.hpp | 1 + 5 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 data/images/objects/lantern/lantern-off.png diff --git a/data/images/objects/lantern/lantern-off.png b/data/images/objects/lantern/lantern-off.png new file mode 100644 index 0000000000000000000000000000000000000000..74f9379911f8686e4157e29d6db68308e7aa87ef GIT binary patch literal 4232 zcmV;35O?p1P)WFU8GbZ8({Xk{QrNlj4iWF>9@01xa*L_t(|+U=Tqj9gcJ z$3N#j=g!Q|&djd8Uhg`Nlh|=^aNZQ+0Ky_r@oXqXfu&9N9)@8Mh9O$(|Mi)o zD9H01&+|yrl%?fmj-NQrcfRu-@hd~X-FM!l0h-Mwmt1lQ^YinBLBP`TGI^Q-V7m@Q zQPAu4==FN|z7IgJ*F#DPfFA^`t*$Z{449jnm*6S>gsA~fDnA@(|3q79s*~deKs@OXP9hGQWOPK z?J1Ht1}&)8JhCjKH`rh_9HFG7*=$j-R{;oopTTH^KN^vy8EKl3=Q)GH5W^5;c}|if z^!t6f-7ZRNk~pT~c^JP8IUtH627>|n_wPqbNvGRoWp$Os#ZzQSPN9m@E0TmP%`hyJ znpZ_CiD{UarioON$;nByQmC;v)ao_TG)1K;MV^yoSs6w_K$@mlqY+-c&L7?NIsKg`E3cFgj|Pkj8E7I+mf5|Dj}5{OQK|2-IVKJyuaZ+_F@(MJ_;zy1=0 zo+F7T=q!U$4U&kD{l=S)wA*c_r>9w1Sm5Ns0$~^uX!yqm?tc%ft6zsNpBVxMgF$}Z z+WPBu?K$wi$%`cJHMma7C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pffY>=fXeh?6aA+y`IVcRzO_#EH&eL9^EqtS>g%NUKy z`%g+reBUR{G7Q7O^E_s)^M<#blpSY2PkvMe0eMM+t zacH$#Y;-r+@CR)4dpK@|-g=iPO&DzS%bO%=N}R-`NlF+;Xsyv&lcyO)v}e|9*g! e!WRDD;(q|`BEu!96k#L)0000;2-0Tj#wSW^IsF995W&MlHDeJ@C`(}3ItzzoxfuuEjd zy`#*xc>N9ZDC`l^)P#FzP}n6VOnWC1_yoDUs^LmUQzKj1aILAG`(^gHt(YZ2QxOp? zjYwKZQ%@s;m8faMg_|S;KLcvmJk|tmxC5cuVVP&Q2NbX-w6rA_sZ63g;OV`2J`vL4 zk8r`h>#utpl9t6Q*$uc|!Gkfs-<+1=Uc+=18l zx=R)phDyc0eEE|L56f&jMc?tt&soY9qSjUWpPs5=@utjIUA*h{OMEJ1ibiHA(sV2DfxN?1?4eC}`tio)6HHYGN%y!&KeuTqAk z56(?>=(VDZb50N0%~5zu<+C0~0S+8;&5t$ikx{i?{c>{Dj;D#jVaQJVH#))52?Jfg zU#0hk82Lo9nqYCp?hk+cs7ATH@AoPn&Y_cqN$!e3giT(BiUPFSjWRVM-Co#9I9>GZr2=T;|N3W(Ma@d32LGo%`OQQ-39@PKfFQqF|n=bxPEJ zB1%)D%?tJHj2p*f$T8Rok+{WVa-%48AwFgrm)t;Z#j1D50pvz+tjFHBryf^5^|f>r z`hC6x(uz0!4hJBO{(&x*_uMde;0UA@yTJzrYizR)lO=vDr#y!*$v|}6h>O{I398U(io3)nRMJRedh?~;3C9s`pE& vColor; - reader.get_vector("color", vColor ); - lightcolor = Color( vColor ); - + reader.get_vector("color", vColor); + lightcolor = Color(vColor); lightsprite = sprite_manager->create("images/objects/lightmap_light/lightmap_light.sprite"); - lightsprite->set_color(lightcolor); lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE)); + updateColor(); } Lantern::~Lantern() @@ -43,6 +42,17 @@ Lantern::~Lantern() } void +Lantern::updateColor(){ + lightsprite->set_color(lightcolor); + //Turn lantern off if light is black + if(lightcolor.red == 0 && lightcolor.green == 0 && lightcolor.blue == 0){ + sprite->set_action("off"); + } else { + sprite->set_action("normal"); + } +} + +void Lantern::draw(DrawingContext& context){ //Draw the Sprite. MovingSprite::draw(context); diff --git a/src/object/lantern.hpp b/src/object/lantern.hpp index 13356cd85..c5352dfc5 100644 --- a/src/object/lantern.hpp +++ b/src/object/lantern.hpp @@ -36,6 +36,7 @@ public: private: Color lightcolor; Sprite* lightsprite; + void updateColor(); }; #endif -- 2.11.0