QTfrontend/SDLs.cpp
changeset 2392 a55dbef5cf31
parent 2294 2e6ffb3ef304
child 2399 ddde0ac1472b
equal deleted inserted replaced
2391:f7d15d9d643c 2392:a55dbef5cf31
    54 	}
    54 	}
    55 
    55 
    56 	return result;
    56 	return result;
    57 }
    57 }
    58 
    58 
    59 void SDLInteraction::StartMusic()
    59 void SDLInteraction::StartMusic(bool hardware)
    60 {
    60 {
    61 	if (music < 0) {
    61 	if (music < 0) {
    62 	    openal_init(5);
    62 		openal_init(hardware ? 1 : 0, 5);
    63 		music = openal_loadfile(QString(datadir->absolutePath() + "/Music/main theme.ogg").toLocal8Bit().constData());
    63 		music = openal_loadfile(QString(datadir->absolutePath() + "/Music/main theme.ogg").toLocal8Bit().constData());
    64 		openal_toggleloop(music);
    64 		openal_toggleloop(music);
       
    65 	
    65 	}
    66 	}
    66 	openal_setvolume(music, 60);
    67 	openal_setvolume(music, 60);
    67 	openal_fadein(music, 25);
    68 	openal_fadein(music, 30);
    68 }
    69 }
    69 
    70 
    70 void SDLInteraction::StopMusic()
    71 void SDLInteraction::StopMusic()
    71 {
    72 {
    72 	if (music >= 0) openal_fadeout(music, 40);
    73 	if (music >= 0) openal_fadeout(music, 40);