]> git.jsancho.org Git - lugaru.git/commitdiff
Introduce resume_stream
authorAlexander Monakov <amonakov@gmail.com>
Mon, 3 Jan 2011 18:58:52 +0000 (21:58 +0300)
committerAlexander Monakov <amonakov@gmail.com>
Mon, 3 Jan 2011 18:58:52 +0000 (21:58 +0300)
Source/GameTick.cpp
Source/Person.cpp
Source/Sounds.cpp
Source/Sounds.h

index b74cb5e9331e43761ae81e111ed56282b41d3ef5..49ea5d2c275bad70c6ee6a41932ef86d1ad07eb6 100644 (file)
@@ -2314,7 +2314,7 @@ void      Game::Tick()
                                }
                                if(!mainmenu){
                                        OPENAL_SetPaused(channels[stream_music3], true);
-                                       OPENAL_SetPaused(channels[music1], false);
+                                       resume_stream(music1);
                                }
                        }
                        if(mainmenu==3){
@@ -2388,7 +2388,7 @@ void      Game::Tick()
                                        //resume
                                        mainmenu=0;
                                        OPENAL_SetPaused(channels[stream_music3], true);
-                                       OPENAL_SetPaused(channels[music1], false);
+                                       resume_stream(music1);
                                }
                        }
 
index 25713a4905ec3d87d9ea704e29eef14c35f30b33..a6a9c504a2e32c26be88915a9a408704d1382473 100644 (file)
@@ -123,7 +123,8 @@ void Person::CheckKick()
       velocity=facing*-10;
       velocity.y=5;
       skeleton.free=0;
-      if(id==0)OPENAL_SetPaused(channels[whooshsound], false);
+      if(id==0)
+       resume_stream(whooshsound);
 
       award_bonus(id, cannon);
     }
@@ -3340,7 +3341,8 @@ void      Person::DoAnimations(){
                                                                                targetframe=3;
                                                                                velocity=facing*-8;
                                                                                velocity.y=4;
-                                                                               if(id==0)OPENAL_SetPaused(channels[whooshsound], false);
+                                                                               if(id==0)
+                                                                                 resume_stream(whooshsound);
                                                                        }
                                                                        if(targetanimation==walljumprightanim){
                                                                                targetanimation=rightflipanim;
@@ -3358,7 +3360,8 @@ void      Person::DoAnimations(){
                                                                                velocity=facing*8;
                                                                                velocity.y=4;
                                                                        }
-                                                                       if(id==0)OPENAL_SetPaused(channels[whooshsound], false);
+                                                                       if(id==0)
+                                                                         resume_stream(whooshsound);
                                                                }
                                                                if(targetanimation==walljumpleftanim){
                                                                        if(attackkeydown){
@@ -3398,7 +3401,8 @@ void      Person::DoAnimations(){
                                                                                velocity=DoRotation(facing,0,-30,0)*-8;
                                                                                velocity.y=4;
                                                                        }
-                                                                       if(id==0)OPENAL_SetPaused(channels[whooshsound], false);
+                                                                       if(id==0)
+                                                                         resume_stream(whooshsound);
                                                                }
                                                                if(targetanimation==sneakattackanim){
                                                                        float ycoords=oldcoords.y;
index 96e18fd03157752e700489a6df1b984cf9a43b91..c85355356d23051e1e0bd8299decb0234871efa5 100644 (file)
@@ -107,3 +107,15 @@ emit_stream_np(int soundid, float vol)
   OPENAL_SetPaused (channels[soundid], false);
 }
 
+void
+resume_stream(int soundid)
+{
+  OPENAL_SetPaused (channels[soundid], false);
+}
+
+void
+pause_sound(int soundid)
+{
+  OPENAL_SetPaused (channels[soundid], true);
+}
+
index cdf7d18a1c14c928de9b988c11e050daf65bb4bc..ee9eb21c57d9878adcd04432acbeb2baab2a860f 100644 (file)
@@ -37,6 +37,8 @@ extern void emit_sound_at(int soundid, const XYZ &pos = XYZ(), float vol = 256.f
 extern void emit_sound_np(int soundid, float vol = 256.f);
 extern void emit_stream_at(int soundid, const XYZ &pos = XYZ(), float vol = 256.f);
 extern void emit_stream_np(int soundid, float vol = 256.f);
+extern void resume_stream(int soundid);
+extern void pause_sound(int soundid);
 
 extern int footstepsound, footstepsound2, footstepsound3, footstepsound4;
 #endif