Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Dec 24, 2023
2 parents c3123b7 + 5917728 commit 13c2e55
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
27 changes: 27 additions & 0 deletions arc-core/src/arc/audio/RandomSound.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package arc.audio;

import arc.files.*;
import arc.util.*;

/** Plays a sound from an array at random. */
public class RandomSound extends Sound{
public Sound[] sounds = {};

public RandomSound(Sound... sounds){
this.sounds = sounds;
}

public RandomSound(){
}

@Override
public void load(Fi file){}

@Override
public int play(float volume, float pitch, float pan, boolean loop, boolean checkFrame){
if(sounds.length > 0){
return Structs.random(sounds).play(volume, pitch, pan, loop, checkFrame);
}
return -1;
}
}
5 changes: 3 additions & 2 deletions arc-core/src/arc/graphics/g2d/Draw.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class Draw{
private static final Color[] carr = new Color[3];
private static final float[] vertices = new float[SpriteBatch.SPRITE_SIZE];
private static @Nullable FloatFloatf zTransformer;
private static float actualZ;

public static float scl = 1f;
public static float xscl = 1f, yscl = 1f;
Expand Down Expand Up @@ -151,12 +152,12 @@ public static void zTransform(){
}

public static float z(){
return batch.sortAscending ? batch.z : -batch.z;
return actualZ;
}

/** Note that this does nothing on most Batch implementations. */
public static void z(float z){
Core.batch.z(zTransformer == null ? z : zTransformer.get(z));
Core.batch.z(zTransformer == null ? actualZ = z : zTransformer.get(actualZ = z));
}

public static Color getColor(){
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ext{
libraries = [:]
}

versions.robovm = "2.3.19"
versions.robovm = "2.3.20"
versions.junit = "4.11"
versions.jnigen = "28dd11fa4c33a7ae9e58897912b52ba7d53d54fe"

Expand Down

0 comments on commit 13c2e55

Please sign in to comment.