- 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:
wagic.the.homebrew@gmail.com
2009-12-12 15:10:32 +00:00
parent f6c4350b38
commit 74accec275
12 changed files with 348 additions and 360 deletions
+3 -1
View File
@@ -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);
}
}
}
+4 -2
View File
@@ -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();
}
+1 -1
View File
@@ -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
+3
View File
@@ -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;
+1 -26
View File
@@ -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();
}