]> git.mxchange.org Git - quix0rs-blobwars.git/commitdiff
Do not load music when we do not need to show a cutscene.
authorGuus Sliepen <guus@sliepen.eu.org>
Sat, 3 Jul 2010 16:29:22 +0000 (18:29 +0200)
committerGuus Sliepen <guus@sliepen.eu.org>
Sat, 3 Jul 2010 16:29:22 +0000 (18:29 +0200)
src/cutscene.cpp

index 86577672d354b4f1132ca9bae2f8fd239716b48a..1def602ed00b1b16ade030c2a416dd81b1a8e4e9 100644 (file)
@@ -216,13 +216,12 @@ void checkStartCutscene()
                return;
        }
        
-       audio.loadMusic("music/cutscene");
-       
        char sceneName[1024];
        snprintf(sceneName, sizeof sceneName, "%s Start", game.stageName);
        
        if (setupScene(sceneName))
        {
+               audio.loadMusic("music/cutscene");
                showScene(true);
        }
        
@@ -238,15 +237,7 @@ void checkEndCutscene()
                return;
        }
        
-       if (strcmp(game.stageName, "Final Battle") != 0)
-       {
-               audio.loadMusic("music/cutscene");
-       }
-       else
-       {
-               audio.loadMusic("music/end");
-       }
-       
+
        char sceneName[1024];
        snprintf(sceneName, sizeof sceneName, "%s End", game.stageName);
        
@@ -263,6 +254,15 @@ void checkEndCutscene()
        
        if (setupScene(sceneName))
        {
+               if (strcmp(game.stageName, "Final Battle") != 0)
+               {
+                       audio.loadMusic("music/cutscene");
+               }
+               else
+               {
+                       audio.loadMusic("music/end");
+               }
+
                showScene(allowSkip);
        }