Commit 84655b11 authored by nanahira's avatar nanahira

mgevent

parent d1c96c23
...@@ -2001,12 +2001,14 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) { ...@@ -2001,12 +2001,14 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return true; return true;
break; break;
} }
#ifdef _WIN32
case CHECKBOX_ENABLE_MUSIC: { case CHECKBOX_ENABLE_MUSIC: {
if(!mainGame->chkEnableMusic->isChecked()) if(!mainGame->chkEnableMusic->isChecked())
mainGame->engineMusic->stopAllSounds(); mainGame->engineMusic->stopAllSounds();
return true; return true;
break; break;
} }
#endif
} }
break; break;
} }
...@@ -2044,6 +2046,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) { ...@@ -2044,6 +2046,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
return true; return true;
break; break;
} }
#ifdef _WIN32
case SCROLL_VOLUME: { case SCROLL_VOLUME: {
mainGame->gameConf.sound_volume = (double)mainGame->scrSoundVolume->getPos() / 100; mainGame->gameConf.sound_volume = (double)mainGame->scrSoundVolume->getPos() / 100;
mainGame->gameConf.music_volume = (double)mainGame->scrMusicVolume->getPos() / 100; mainGame->gameConf.music_volume = (double)mainGame->scrMusicVolume->getPos() / 100;
...@@ -2051,6 +2054,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) { ...@@ -2051,6 +2054,7 @@ bool ClientField::OnCommonEvent(const irr::SEvent& event) {
mainGame->engineMusic->setSoundVolume(mainGame->gameConf.music_volume); mainGame->engineMusic->setSoundVolume(mainGame->gameConf.music_volume);
break; break;
} }
#endif
} }
break; break;
} }
......
...@@ -793,8 +793,10 @@ void Game::MainLoop() { ...@@ -793,8 +793,10 @@ void Game::MainLoop() {
usleep(500000); usleep(500000);
#endif #endif
SaveConfig(); SaveConfig();
#ifdef _WIN32
if(engineMusic) if(engineMusic)
engineMusic->drop(); engineMusic->drop();
#endif
// device->drop(); // device->drop();
} }
void Game::BuildProjectionMatrix(irr::core::matrix4& mProjection, f32 left, f32 right, f32 bottom, f32 top, f32 znear, f32 zfar) { void Game::BuildProjectionMatrix(irr::core::matrix4& mProjection, f32 left, f32 right, f32 bottom, f32 top, f32 znear, f32 zfar) {
......
...@@ -468,9 +468,11 @@ public: ...@@ -468,9 +468,11 @@ public:
irr::gui::IGUIButton* btnCancelOrFinish; irr::gui::IGUIButton* btnCancelOrFinish;
//soundEngine //soundEngine
#ifdef _WIN32
irrklang::ISoundEngine* engineSound; irrklang::ISoundEngine* engineSound;
irrklang::ISoundEngine* engineMusic; irrklang::ISoundEngine* engineMusic;
irrklang::ISound* soundBGM; irrklang::ISound* soundBGM;
#endif
}; };
extern Game* mainGame; extern Game* mainGame;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment