QTfrontend/SDLs.cpp
changeset 2210 1cb7118a77dd
parent 2192 4763a778c033
child 2211 288360b78f30
equal deleted inserted replaced
2209:2573d4ff78f9 2210:1cb7118a77dd
    24 SDLInteraction::SDLInteraction()
    24 SDLInteraction::SDLInteraction()
    25 {
    25 {
    26 	music = -1;
    26 	music = -1;
    27 
    27 
    28 	SDL_Init(SDL_INIT_VIDEO);
    28 	SDL_Init(SDL_INIT_VIDEO);
    29 	openal_init(50);
    29 	openal_init(40);
    30 
    30 
    31 }
    31 }
    32 
    32 
    33 SDLInteraction::~SDLInteraction()
    33 SDLInteraction::~SDLInteraction()
    34 {
    34 {
    60 void SDLInteraction::StartMusic()
    60 void SDLInteraction::StartMusic()
    61 {
    61 {
    62 	if (music < 0) {
    62 	if (music < 0) {
    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 		openal_setvolume(music,66);
    65 	}
    66     }
    66 	openal_setvolume(music, 60);
    67 	openal_fadein(music, 50);
    67 	openal_fadein(music, 70);
    68 }
    68 }
    69 
    69 
    70 void SDLInteraction::StopMusic()
    70 void SDLInteraction::StopMusic()
    71 {
    71 {
    72 	if (music >= 0) openal_fadeout(music, 50);
    72 	if (music >= 0) openal_fadeout(music, 70);
    73 }
    73 }