Many buildscript changes

This commit is contained in:
Anuken
2020-04-29 18:29:19 -04:00
parent 414b538e6b
commit b66c1c2649
5 changed files with 52 additions and 43 deletions

View File

@@ -19,9 +19,7 @@ configurations{ natives }
repositories{ repositories{
mavenCentral() mavenCentral()
jcenter() jcenter()
maven{ maven{ url "https://maven.google.com" }
url "https://maven.google.com"
}
} }
dependencies{ dependencies{
@@ -29,10 +27,10 @@ dependencies{
implementation arcModule("backends:backend-android") implementation arcModule("backends:backend-android")
implementation 'com.jakewharton.android.repackaged:dalvik-dx:9.0.0_r3' implementation 'com.jakewharton.android.repackaged:dalvik-dx:9.0.0_r3'
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-arm64-v8a" natives "com.github.Anuken.Arc:natives-android:${getArcHash()}"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86" natives "com.github.Anuken.Arc:natives-freetype-android:${getArcHash()}"
natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86_64"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a" natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-armeabi-v7a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a" natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-arm64-v8a"
natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86" natives "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-x86"
@@ -134,6 +132,13 @@ task copyAndroidNatives(){
into outputDir into outputDir
include "*.so" include "*.so"
} }
}else{
println("copying $jar")
copy{
from zipTree(jar)
into file("libs/")
include "**"
}
} }
} }
} }

View File

@@ -168,12 +168,11 @@ project(":desktop"){
dependencies{ dependencies{
compile project(":core") compile project(":core")
compile arcModule("natives:natives-desktop")
compile arcModule("natives:natives-freetype-desktop")
if(debugged()) compile project(":debug") if(debugged()) compile project(":debug")
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop"
compile "com.github.Anuken:steamworks4j:$steamworksVersion" compile "com.github.Anuken:steamworks4j:$steamworksVersion"
compile arcModule("backends:backend-sdl") compile arcModule("backends:backend-sdl")
@@ -204,14 +203,12 @@ project(":ios"){
dependencies{ dependencies{
compile project(":core") compile project(":core")
compileOnly project(":annotations")
compile arcModule("natives:natives-ios")
compile arcModule("natives:natives-freetype-ios")
compile arcModule("backends:backend-robovm") compile arcModule("backends:backend-robovm")
compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion" compileOnly project(":annotations")
compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"
} }
} }
@@ -295,11 +292,11 @@ project(":tools"){
dependencies{ dependencies{
compile project(":core") compile project(":core")
compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" compile arcModule("natives:natives-desktop")
compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop" compile arcModule("natives:natives-freetype-desktop")
compile "org.reflections:reflections:0.9.12"
compile arcModule("backends:backend-headless") compile arcModule("backends:backend-headless")
compile "org.reflections:reflections:0.9.12"
} }
} }

View File

@@ -13,17 +13,17 @@ import static mindustry.Vars.*;
/** Controls playback of multiple music tracks.*/ /** Controls playback of multiple music tracks.*/
public class MusicControl{ public class MusicControl{
private static final float finTime = 120f, foutTime = 120f, musicInterval = 60 * 60 * 3f, musicChance = 0.6f, musicWaveChance = 0.5f; protected static final float finTime = 120f, foutTime = 120f, musicInterval = 60 * 60 * 3f, musicChance = 0.6f, musicWaveChance = 0.5f;
/** normal, ambient music, plays at any time */ /** normal, ambient music, plays at any time */
public Array<Music> ambientMusic = Array.with(); public Array<Music> ambientMusic = Array.with();
/** darker music, used in times of conflict */ /** darker music, used in times of conflict */
public Array<Music> darkMusic = Array.with(); public Array<Music> darkMusic = Array.with();
private Music lastRandomPlayed; protected Music lastRandomPlayed;
private Interval timer = new Interval(); protected Interval timer = new Interval();
private @Nullable Music current; protected @Nullable Music current;
private float fade; protected float fade;
private boolean silenced; protected boolean silenced;
public MusicControl(){ public MusicControl(){
Events.on(ClientLoadEvent.class, e -> reload()); Events.on(ClientLoadEvent.class, e -> reload());
@@ -36,7 +36,7 @@ public class MusicControl{
})); }));
} }
private void reload(){ protected void reload(){
current = null; current = null;
fade = 0f; fade = 0f;
ambientMusic = Array.with(Musics.game1, Musics.game3, Musics.game4, Musics.game6); ambientMusic = Array.with(Musics.game1, Musics.game3, Musics.game4, Musics.game6);
@@ -81,7 +81,7 @@ public class MusicControl{
} }
/** Plays a random track.*/ /** Plays a random track.*/
private void playRandom(){ protected void playRandom(){
if(isDark()){ if(isDark()){
playOnce(darkMusic.random(lastRandomPlayed)); playOnce(darkMusic.random(lastRandomPlayed));
}else{ }else{
@@ -90,7 +90,7 @@ public class MusicControl{
} }
/** Whether to play dark music.*/ /** Whether to play dark music.*/
private boolean isDark(){ protected boolean isDark(){
if(state.teams.get(player.team()).hasCore() && state.teams.get(player.team()).core().healthf() < 0.85f){ if(state.teams.get(player.team()).hasCore() && state.teams.get(player.team()).core().healthf() < 0.85f){
//core damaged -> dark //core damaged -> dark
return true; return true;
@@ -107,7 +107,7 @@ public class MusicControl{
/** Plays and fades in a music track. This must be called every frame. /** Plays and fades in a music track. This must be called every frame.
* If something is already playing, fades out that track and fades in this new music.*/ * If something is already playing, fades out that track and fades in this new music.*/
private void play(@Nullable Music music){ protected void play(@Nullable Music music){
if(!shouldPlay()){ if(!shouldPlay()){
if(current != null){ if(current != null){
current.setVolume(0); current.setVolume(0);
@@ -159,7 +159,7 @@ public class MusicControl{
} }
/** Plays a music track once and only once. If something is already playing, does nothing.*/ /** Plays a music track once and only once. If something is already playing, does nothing.*/
private void playOnce(Music music){ protected void playOnce(Music music){
if(current != null || music == null || !shouldPlay()) return; //do not interrupt already-playing tracks if(current != null || music == null || !shouldPlay()) return; //do not interrupt already-playing tracks
//save last random track played to prevent duplicates //save last random track played to prevent duplicates
@@ -179,12 +179,12 @@ public class MusicControl{
current.play(); current.play();
} }
private boolean shouldPlay(){ protected boolean shouldPlay(){
return Core.settings.getInt("musicvol") > 0; return Core.settings.getInt("musicvol") > 0;
} }
/** Fades out the current track, unless it has already been silenced. */ /** Fades out the current track, unless it has already been silenced. */
private void silence(){ protected void silence(){
play(null); play(null);
} }
} }

View File

@@ -1,3 +1,3 @@
org.gradle.daemon=true org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=26861a21f52e7efed4469c604c40e9ad5b54001e archash=eafc01d165a28ff49935ed80e59509eb4ebcdd72

View File

@@ -30,23 +30,30 @@ if(hasSdk){
if(!hasProperty("release")){ if(!hasProperty("release")){
if(new File(settingsDir, '../Arc').exists()){ if(new File(settingsDir, '../Arc').exists()){
use( use(
':Arc', ':Arc',
':Arc:arc-core', ':Arc:arc-core',
':Arc:extensions', ':Arc:extensions',
':Arc:extensions:freetype', ':Arc:extensions:freetype',
':Arc:extensions:recorder', ':Arc:extensions:recorder',
':Arc:extensions:arcnet', ':Arc:extensions:arcnet',
':Arc:extensions:packer', ':Arc:extensions:packer',
':Arc:extensions:g3d', ':Arc:extensions:g3d',
':Arc:extensions:fx', ':Arc:extensions:fx',
':Arc:backends', ':Arc:natives',
':Arc:backends:backend-sdl', ':Arc:natives:natives-desktop',
':Arc:natives:natives-android',
':Arc:natives:natives-ios',
':Arc:natives:natives-freetype-desktop',
':Arc:natives:natives-freetype-android',
':Arc:natives:natives-freetype-ios',
':Arc:backends',
':Arc:backends:backend-sdl',
':Arc:backends:backend-android', ':Arc:backends:backend-android',
':Arc:backends:backend-robovm', ':Arc:backends:backend-robovm',
':Arc:backends:backend-headless' ':Arc:backends:backend-headless'
) )
} }
if(new File(settingsDir, '../Mindustry-Debug').exists()){ if(new File(settingsDir, '../Mindustry-Debug').exists()){
include(":debug") include(":debug")
project(":debug").projectDir = new File(settingsDir, "../Mindustry-Debug") project(":debug").projectDir = new File(settingsDir, "../Mindustry-Debug")