equal
deleted
inserted
replaced
24 SDLInteraction::SDLInteraction() |
24 SDLInteraction::SDLInteraction() |
25 { |
25 { |
26 music = NULL; |
26 music = NULL; |
27 |
27 |
28 SDL_Init(SDL_INIT_VIDEO); |
28 SDL_Init(SDL_INIT_VIDEO); |
29 SDL_Init(SDL_INIT_AUDIO); |
|
30 Mix_OpenAudio(22050, 0x8010, 2, 512); |
|
31 |
|
32 Mix_VolumeMusic(33); |
|
33 } |
29 } |
34 |
30 |
35 SDLInteraction::~SDLInteraction() |
31 SDLInteraction::~SDLInteraction() |
36 { |
32 { |
37 SDL_Quit(); |
33 SDL_Quit(); |
58 return result; |
54 return result; |
59 } |
55 } |
60 void SDLInteraction::StartMusic() |
56 void SDLInteraction::StartMusic() |
61 { |
57 { |
62 if (!music) |
58 if (!music) |
|
59 { |
|
60 SDL_Init(SDL_INIT_AUDIO); |
|
61 Mix_OpenAudio(22050, 0x8010, 2, 512); |
|
62 |
|
63 Mix_VolumeMusic(33); |
63 music = Mix_LoadMUS(QString(datadir->absolutePath() + "/Music/main theme.ogg").toLocal8Bit().constData()); |
64 music = Mix_LoadMUS(QString(datadir->absolutePath() + "/Music/main theme.ogg").toLocal8Bit().constData()); |
|
65 } |
64 |
66 |
65 Mix_FadeInMusic(music, -1, 3000); |
67 Mix_FadeInMusic(music, -1, 3000); |
66 } |
68 } |
67 |
69 |
68 void SDLInteraction::StopMusic() |
70 void SDLInteraction::StopMusic() |