From 8eb7e8d524a32345a31dc9d4d691b3e791e569ff Mon Sep 17 00:00:00 2001 From: Wolfgang Becker Date: Fri, 4 Aug 2006 23:58:40 +0000 Subject: [PATCH] switch noise SVN-Revision: 4121 --- data/sounds/switch.ogg | Bin 0 -> 6318 bytes src/trigger/switch.cpp | 7 +++++++ 2 files changed, 7 insertions(+) create mode 100644 data/sounds/switch.ogg diff --git a/data/sounds/switch.ogg b/data/sounds/switch.ogg new file mode 100644 index 0000000000000000000000000000000000000000..e407dae19686ed1d8c43a07befbb50e51ab05062 GIT binary patch literal 6318 zcmai12|Scv_kSjPmL{Z8(oBdMri^`*Hxx0b3}a0)w#J&Vq+euY2-#vtLs^GRNJ1#T z)){NI7-^$~L>r0r|DEyM{_p?)dEfiFbLT$y+a&-vL?${n03@-&XUd zlJT2;Val+mP%4=c&R>A-spkKIb_^!?YliLTpZu%wPx2`TSP3uT*kAvvbqcL8+63q> zl%q$s?Wg)9gD7Mt0ehr1Qb$``Ut3pOkIxMzva%U%zS{`~iGvlKEs{g)&mut(9D)w3 zqGfXYtkEn+iN^7Kh82It(N4){q;L@4X*lkm15(dt9RvwOG!2Q2vMK9;Uc5g-J%d_| zr|dJTM2e-_kK-loE^hS>sc5JO4CzIyiA%eRK)@2FR;WaIB7Yz!qmmF{IITqOKvfn} zS7R;}pIWWcflRQ~nJLfNXFPMMEW`MXMnk{3B(`CYV2c}e@~&+Y^@s`Y#ZMRhF-QpX zK!UrNiz@oS&BgiblhGCVRKRLQEhIz(YC?O@%3EKR@4l+^U_f>Myq3M3{(!E9gQFb@ zv`7!bat6_g1a-kLFMuYlo8=`i z3k|SEl!)(^T9E`cB$vEGGW(ee5AZU~$>J*cf`@lf91GN2s`3j29t`SLoB+N=cb(@H zpYLae_gYIaSu3;SvISx_RfAwnak@~3tLO#xQ3jb}RiiH8tZP4W>Qak5n58fZ)EiqI zSNQz_i>gC~y?5|0z=@Q{1%WLR9$@yxr|{ha3I5u@!^af(&Fc|@d*Ku^HbaywkE%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qNF6<4o-Pi?=iTrzVSfR3i*0$y!zOI6c>y`MZantPwW4 zt8(hG8S{~Wmx{D}{g-R|wd^$V?5JP*>hJxQU3>lM?$-xTbo8)!WVTxJC!uZd`_hDa z+>|iJ71r9lq3sRU&n=V)MFl-MA7(~&?fateELu)TxL>jXapI)@`xbcM%GR9Nv@%Gn@ z_x<;bOVO5Z@}1WVB>iyN9ydFDKk;0jT|#`unMaN6ynQhh4TqN2Z;esby03U7Ir(?0 z)gbe0*Sp@Z*SeJ|R$hexH$1MO^MwYAN+D&xhRRIw9J;4hT+Gc=7dOhv>6?x$*wnHK z2-BZsxiq`pKA@4~q(>R4h`J=&8K(l4PShq^W37+au3zW(rvNc z*~m@jLRL(d80!$p%H z*IqrANlQD(Ir}DaX6Q-ThEjAcrmbqzjpQpVwj}i2x4JJg^8l-D%g?cs_qbH9Y0>RR znliBgq5rYVWS$wFa?05aX4&wl<9*8X2q@`q2SNV>B+tpv literal 0 HcmV?d00001 diff --git a/src/trigger/switch.cpp b/src/trigger/switch.cpp index 49205fb25..8b20a7349 100644 --- a/src/trigger/switch.cpp +++ b/src/trigger/switch.cpp @@ -25,6 +25,11 @@ #include "sprite/sprite.hpp" #include "sprite/sprite_manager.hpp" #include "sector.hpp" +#include "audio/sound_manager.hpp" + +namespace { + const std::string SWITCH_SOUND = "sounds/switch.ogg"; +} Switch::Switch(const lisp::Lisp& reader) : state(OFF) @@ -36,6 +41,7 @@ Switch::Switch(const lisp::Lisp& reader) bbox.set_size(sprite->get_current_hitbox_width(), sprite->get_current_hitbox_height()); if (!reader.get("script", script)) throw std::runtime_error("no script set"); + sound_manager->preload( SWITCH_SOUND ); } Switch::~Switch() @@ -98,6 +104,7 @@ Switch::event(Player& , EventType type) switch (state) { case OFF: sprite->set_action("turnon", 1); + sound_manager->play( SWITCH_SOUND ); state = TURN_ON; break; case TURN_ON: -- 2.11.0