]> Dogcows Code - chaz/yoink/blobdiff - src/GameLayer.cc
resource loading bugs and new sound class
[chaz/yoink] / src / GameLayer.cc
index fcb77ed65cfa086be3e30f07e85cefde40c8af81..8299d638211f57db283bd2e74ae7413af070fff1 100644 (file)
@@ -80,15 +80,10 @@ void GameLayer::advanceScene(moof::settings& settings)
 GameLayer::GameLayer()
 {
        moof::log_info("about to load sound resource...");
-       music_ = moof::resource::load("NightFusionIntro.ogg");
-       if (music_)
-       {
-               music_->loop(true);
-               music_->enqueue("NightFusionLoop");
-       }
-       else moof::log_error("music not loaded");
-
-       //music_->position(moof::vector3(10.0, 5.0, 0.0));
+       music_.sample("NightFusionIntro.ogg");
+       music_.loop(true);
+       music_.enqueue("NightFusionLoop.ogg");
+       music_.position(moof::vector3(10.0, 5.0, 0.0));
 
        mThinkTimer.init(boost::bind(&GameLayer::thinkTimer, this),
                        0.1, moof::timer::repeat);
@@ -104,7 +99,7 @@ void GameLayer::did_add_to_view()
 {
        bool isMute = false;
        settings().get("nomusic", isMute);
-       if (!isMute) music_->play();
+       if (!isMute) music_.stream();
 
        loadSceneLoader();
        advanceScene(settings());               // load the first scene
@@ -218,12 +213,12 @@ bool GameLayer::handle_event(const moof::event& event)
                        {
                                state_.heroine->animation.startSequence("Flattened");
                                moof::log_info("thump!");
-                               //mPunchSound.play();
+                               punch_sound_.play();
                                return true;
                        }
                        else if (event.key.keysym.sym == SDLK_m)
                        {
-                               music_->toggle();
+                               music_.toggle();
                                return true;
                        }
                        else if (event.key.keysym.sym == SDLK_PAGEUP)
This page took 0.017926 seconds and 4 git commands to generate.