Skip to content

Commit

Permalink
frame check (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mythril382 authored Aug 4, 2024
1 parent 6676d38 commit bd12b55
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions arc-core/src/arc/audio/Sound.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,18 @@ public int at(float x, float y, float pitch){
* Plays this sound at a certain position, with correct panning and volume applied.
* Automatically uses the "sfxvolume" setting.
*/
public int at(float x, float y, float pitch, float volume){
public int at(float x, float y, float pitch, float volume, boolean checkFrame){
float vol = calcVolume(x, y) * volume;
if(vol < 0.01f) return -1; //discard
return play(vol, pitch, calcPan(x, y));
return play(vol, pitch, calcPan(x, y), false, checkFrame);
}

/**
* Plays this sound at a certain position, with correct panning and volume applied.
* Automatically uses the "sfxvolume" setting.
*/
public int at(float x, float y, float pitch, float volume){
return at(x, y, pitch, volume, true);
}

/**
Expand Down

0 comments on commit bd12b55

Please sign in to comment.