mirror of
https://github.com/panda3d/panda3d.git
synced 2025-11-02 03:25:30 -05:00
minor recode for intel comp
This commit is contained in:
parent
587690ffdd
commit
c905077f82
@ -130,7 +130,7 @@ set_volume(float volume) {
|
|||||||
// Account for the category of sound:
|
// Account for the category of sound:
|
||||||
volume*=_manager->get_volume();
|
volume*=_manager->get_volume();
|
||||||
// Change to Miles volume, range 0 to 127:
|
// Change to Miles volume, range 0 to 127:
|
||||||
S32 milesVolume=(S32(127*volume))%128;
|
S32 milesVolume=((S32)(127*volume))%128;
|
||||||
// Account for type:
|
// Account for type:
|
||||||
S32 audioType=AIL_quick_type(_audio);
|
S32 audioType=AIL_quick_type(_audio);
|
||||||
if (audioType==AIL_QUICK_XMIDI_TYPE
|
if (audioType==AIL_QUICK_XMIDI_TYPE
|
||||||
@ -142,7 +142,7 @@ set_volume(float volume) {
|
|||||||
} else {
|
} else {
|
||||||
// ...it's a wav or mp3.
|
// ...it's a wav or mp3.
|
||||||
// Convert balance of -1.0..1.0 to 0..127:
|
// Convert balance of -1.0..1.0 to 0..127:
|
||||||
S32 milesBalance=(S32(63.5*(_balance+1.0)))%128;
|
S32 milesBalance=((S32)(63.5*(_balance+1.0)))%128;
|
||||||
AIL_quick_set_volume(_audio, milesVolume, milesBalance);
|
AIL_quick_set_volume(_audio, milesVolume, milesBalance);
|
||||||
audio_debug(" volume for this wav or mp3 is now "<<milesVolume
|
audio_debug(" volume for this wav or mp3 is now "<<milesVolume
|
||||||
<<", balance="<<milesBalance);
|
<<", balance="<<milesBalance);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user