QTfrontend/SDLs.cpp
changeset 1235 070629f3902d
parent 1225 f882a92ef872
child 1387 c809c536a58f
--- a/QTfrontend/SDLs.cpp	Mon Aug 25 18:30:06 2008 +0000
+++ b/QTfrontend/SDLs.cpp	Fri Aug 29 19:40:37 2008 +0000
@@ -23,12 +23,13 @@
 
 SDLInteraction::SDLInteraction()
 {
+	music = NULL;
+
 	SDL_Init(SDL_INIT_VIDEO);
 	SDL_Init(SDL_INIT_AUDIO);
 	Mix_OpenAudio(22050, 0x8010, 2, 512);
 	
-	Mix_Volume(-1, 50);
-	music = Mix_LoadMUS(QString(datadir->absolutePath() + "/Music/main theme.ogg").toAscii().constData());
+	Mix_VolumeMusic(50);
 }
 
 SDLInteraction::~SDLInteraction()
@@ -58,6 +59,9 @@
 }
 void SDLInteraction::StartMusic()
 {
+	if (!music)
+		music = Mix_LoadMUS(QString(datadir->absolutePath() + "/Music/main theme.ogg").toAscii().constData());
+
 	Mix_FadeInMusic(music, -1, 3000);
 }