equal
deleted
inserted
replaced
48 m_isPlayingMusic = false; |
48 m_isPlayingMusic = false; |
49 if(SDL_NumJoysticks()) |
49 if(SDL_NumJoysticks()) |
50 addGameControllerKeys(); |
50 addGameControllerKeys(); |
51 SDL_QuitSubSystem(SDL_INIT_JOYSTICK); |
51 SDL_QuitSubSystem(SDL_INIT_JOYSTICK); |
52 |
52 |
53 soundMap = new QMap<QString,Mix_Chunk*>(); |
53 m_soundMap = new QMap<QString,Mix_Chunk*>(); |
54 } |
54 } |
55 |
55 |
56 |
56 |
57 SDLInteraction::~SDLInteraction() |
57 SDLInteraction::~SDLInteraction() |
58 { |
58 { |
63 Mix_FreeMusic(m_music); |
63 Mix_FreeMusic(m_music); |
64 Mix_CloseAudio(); |
64 Mix_CloseAudio(); |
65 } |
65 } |
66 SDL_Quit(); |
66 SDL_Quit(); |
67 |
67 |
68 delete soundMap; |
68 delete m_soundMap; |
69 } |
69 } |
70 |
70 |
71 |
71 |
72 QStringList SDLInteraction::getResolutions() const |
72 QStringList SDLInteraction::getResolutions() const |
73 { |
73 { |
182 |
182 |
183 |
183 |
184 void SDLInteraction::playSoundFile(const QString & soundFile) |
184 void SDLInteraction::playSoundFile(const QString & soundFile) |
185 { |
185 { |
186 SDLAudioInit(); |
186 SDLAudioInit(); |
187 if (!soundMap->contains(soundFile)) |
187 if (!m_soundMap->contains(soundFile)) |
188 soundMap->insert(soundFile, Mix_LoadWAV(soundFile.toLocal8Bit().constData())); |
188 m_soundMap->insert(soundFile, Mix_LoadWAV(soundFile.toLocal8Bit().constData())); |
189 |
189 |
190 Mix_PlayChannel(-1, soundMap->value(soundFile), 0); |
190 Mix_PlayChannel(-1, m_soundMap->value(soundFile), 0); |
191 } |
191 } |
192 |
192 |
193 |
193 |
194 void SDLInteraction::setMusicTrack(const QString & musicFile) |
194 void SDLInteraction::setMusicTrack(const QString & musicFile) |
195 { |
195 { |