[Player] Keysounds now respect the volume settings. Sourced from hanubeki-modified-sm-ssc rev. 16fc5b714582 [hanubeki]
This commit is contained in:
@@ -16,6 +16,8 @@ StepMania 5.0 alpha 2 | 201203??
|
|||||||
is a temporary feature. [AJ]
|
is a temporary feature. [AJ]
|
||||||
* [GameConstantsAndTypes] Made StageResult Lua-aware. [AJ]
|
* [GameConstantsAndTypes] Made StageResult Lua-aware. [AJ]
|
||||||
* [GameState] Added GetStageResult(pn) Lua binding. [AJ]
|
* [GameState] Added GetStageResult(pn) Lua binding. [AJ]
|
||||||
|
* [Player] Keysounds now respect the volume settings. [hanubeki]
|
||||||
|
Sourced from hanubeki-modified-sm-ssc rev. 16fc5b714582
|
||||||
|
|
||||||
2012/03/27
|
2012/03/27
|
||||||
----------
|
----------
|
||||||
|
|||||||
+6
-4
@@ -1437,13 +1437,15 @@ void Player::UpdateHoldNotes( int iSongRow, float fDeltaTime, vector<TrackRowTap
|
|||||||
tn.HoldResult.fLife = fLife;
|
tn.HoldResult.fLife = fLife;
|
||||||
tn.HoldResult.hns = hns;
|
tn.HoldResult.hns = hns;
|
||||||
// Stop the playing keysound for the hold note.
|
// Stop the playing keysound for the hold note.
|
||||||
// I think this causes crashes too -aj
|
// I think this causes crashes too. -aj (Possibly fixed. -?)
|
||||||
// Possibly fixed.
|
|
||||||
|
Preference<float> *pVolume = Preference<float>::GetPreferenceByName("SoundVolume");
|
||||||
|
float fVol = pVolume->Get();
|
||||||
|
|
||||||
if( tn.iKeysoundIndex >= 0 && tn.iKeysoundIndex < (int) m_vKeysounds.size() )
|
if( tn.iKeysoundIndex >= 0 && tn.iKeysoundIndex < (int) m_vKeysounds.size() )
|
||||||
{
|
{
|
||||||
float factor = (tn.subType == TapNote::hold_head_roll ? 2.0f * fLifeFraction : 10.0f * fLifeFraction - 8.5f);
|
float factor = (tn.subType == TapNote::hold_head_roll ? 2.0f * fLifeFraction : 10.0f * fLifeFraction - 8.5f);
|
||||||
// todo: Make sure the player's volume settings are respected. -aj
|
m_vKeysounds[tn.iKeysoundIndex].SetProperty ("Volume", max(0.0f, min(1.0f, factor)) * fVol);
|
||||||
m_vKeysounds[tn.iKeysoundIndex].SetProperty ("Volume", max(0.0f, min(1.0f, factor)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user