Testing filters + new natives
This commit is contained in:
BIN
core/assets/sounds/pew_.ogg
Normal file
BIN
core/assets/sounds/pew_.ogg
Normal file
Binary file not shown.
@@ -2,6 +2,7 @@ package mindustry.audio;
|
|||||||
|
|
||||||
import arc.*;
|
import arc.*;
|
||||||
import arc.audio.*;
|
import arc.audio.*;
|
||||||
|
import arc.audio.SoloudAudio.*;
|
||||||
import arc.math.*;
|
import arc.math.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
@@ -25,6 +26,11 @@ public class MusicControl{
|
|||||||
protected float fade;
|
protected float fade;
|
||||||
protected boolean silenced;
|
protected boolean silenced;
|
||||||
|
|
||||||
|
protected boolean wasPaused;
|
||||||
|
protected AudioFilter filter = new BiquadFilter(){{
|
||||||
|
set(0, 500, 1);
|
||||||
|
}};
|
||||||
|
|
||||||
public MusicControl(){
|
public MusicControl(){
|
||||||
Events.on(ClientLoadEvent.class, e -> reload());
|
Events.on(ClientLoadEvent.class, e -> reload());
|
||||||
|
|
||||||
@@ -54,6 +60,13 @@ public class MusicControl{
|
|||||||
|
|
||||||
/** Update and play the right music track.*/
|
/** Update and play the right music track.*/
|
||||||
public void update(){
|
public void update(){
|
||||||
|
boolean paused = state.isGame() && Core.scene.hasDialog();
|
||||||
|
|
||||||
|
if(paused != wasPaused){
|
||||||
|
Core.audio.setFilter(0, paused ? filter : null);
|
||||||
|
wasPaused = paused;
|
||||||
|
}
|
||||||
|
|
||||||
if(state.isMenu()){
|
if(state.isMenu()){
|
||||||
silenced = false;
|
silenced = false;
|
||||||
if(ui.planet.isShown()){
|
if(ui.planet.isShown()){
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=c4f0336b9ce1bdd45fae5e9f8c3ae00afb4ad5cb
|
archash=f93ea128de153974d550bc294de4acaf810da24b
|
||||||
|
|||||||
Reference in New Issue
Block a user