Erwan
- Fix issue 144 (Sound is either 0 or 100%), for PSP ONLY. The methods are now here for linux/windows, but only the music volume method will work currently, and it sets the volume globally. Patch by Yeshua with some cleanup by myself.
This commit is contained in:
@@ -116,7 +116,9 @@ void Credits::compute(Player * _p1, Player * _p2, GameApp * _app){
|
||||
}
|
||||
if (unlocked && options[Options::SFXVOLUME].number > 0){
|
||||
JSample * sample = resources.RetrieveSample("bonus.wav");
|
||||
if (sample) JSoundSystem::GetInstance()->PlaySample(sample);
|
||||
if (sample){
|
||||
JSoundSystem::GetInstance()->PlaySample(sample);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -181,7 +181,9 @@ void GameApp::Create()
|
||||
mCurrentState = NULL;
|
||||
mNextState = mGameStates[GAME_STATE_MENU];
|
||||
|
||||
// effect = NEW CardEffect();
|
||||
//Set Audio volume
|
||||
JSoundSystem::GetInstance()->SetSfxVolume(options[Options::SFXVOLUME].number);
|
||||
JSoundSystem::GetInstance()->SetMusicVolume(options[Options::MUSICVOLUME].number);
|
||||
|
||||
char buf[512];
|
||||
sprintf(buf, "size of MTGCard : %i\n" , sizeof(MTGCard));
|
||||
@@ -246,7 +248,7 @@ void GameApp::Update()
|
||||
return;
|
||||
}
|
||||
|
||||
//Restart Rendering engine when START and TRIANGLE ARE PRESSED SIMULTANEOUSLY
|
||||
//Restart Rendering engine when START and SQUARE ARE PRESSED SIMULTANEOUSLY
|
||||
if (mEngine->GetButtonState(PSP_CTRL_START) && mEngine->GetButtonState(PSP_CTRL_SQUARE)){
|
||||
JRenderer::Destroy();
|
||||
}
|
||||
|
||||
@@ -327,7 +327,7 @@ void GameStateDuel::Update(float dt)
|
||||
|
||||
if (MusicExist(musictrack)){
|
||||
GameApp::music = resources.ssLoadMusic(musictrack.c_str());
|
||||
JSoundSystem::GetInstance()->PlayMusic(GameApp::music, true);
|
||||
JSoundSystem::GetInstance()->PlayMusic(GameApp::music, true);
|
||||
}
|
||||
}
|
||||
//end of music code
|
||||
|
||||
@@ -195,6 +195,9 @@ void GameStateOptions::ButtonPressed(int controllerId, int controlId)
|
||||
switch (controlId){
|
||||
case 1:
|
||||
optionsTabs->save();
|
||||
//Set Audio volume
|
||||
JSoundSystem::GetInstance()->SetSfxVolume(options[Options::SFXVOLUME].number);
|
||||
JSoundSystem::GetInstance()->SetMusicVolume(options[Options::MUSICVOLUME].number);
|
||||
case 2:
|
||||
mParent->SetNextState(GAME_STATE_MENU);
|
||||
break;
|
||||
|
||||
@@ -1090,31 +1090,6 @@ void WGuiMenu::Add(WGuiBase * it){
|
||||
items.push_back(it);
|
||||
}
|
||||
|
||||
//WGuiMenu
|
||||
/*
|
||||
void WGuiMenu::Update(float dt){
|
||||
JGE * mEngine = JGE::GetInstance();
|
||||
|
||||
WGuiBase * c = Current();
|
||||
if(c && !c->isModal()){
|
||||
if (mEngine->GetButtonClick(buttonPrev)){
|
||||
if (currentItem > 0 && c->Leaving(buttonPrev)){
|
||||
currentItem--;
|
||||
c = Current();
|
||||
c->Entering(buttonPrev);
|
||||
}
|
||||
}
|
||||
else if (mEngine->GetButtonClick(buttonNext)){
|
||||
if (currentItem < (int)items.size()-1 && c->Leaving(buttonNext)){
|
||||
currentItem++;
|
||||
c = Current();
|
||||
c->Entering(buttonNext);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(c)
|
||||
c->Update(dt);
|
||||
}*/
|
||||
|
||||
|
||||
void WGuiMenu::Update(float dt){
|
||||
@@ -1238,7 +1213,7 @@ void WGuiTabMenu::Render(){
|
||||
|
||||
void WGuiTabMenu::save(){
|
||||
confirmChange(true);
|
||||
setData();
|
||||
setData();
|
||||
::options.save();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user