From 22fe3d55460d8732f3520ce7d5be0a71ecad7de2 Mon Sep 17 00:00:00 2001 From: roah Date: Mon, 31 Aug 2015 10:49:40 +0200 Subject: [PATCH] - compatibility with jme 3.1-alpha1 --- build.gradle | 111 +++--------------- .../extras/emitter/AlphaInfluencer.java | 2 +- .../extras/emitter/ColorInfluencer.java | 2 +- .../extras/emitter/DestinationInfluencer.java | 4 +- .../extras/emitter/DirectionInfluencer.java | 2 +- .../extras/emitter/ElementEmitter.java | 2 +- .../extras/emitter/ImpulseInfluencer.java | 2 +- src/tonegod/gui/core/Screen.java | 2 +- 8 files changed, 26 insertions(+), 101 deletions(-) diff --git a/build.gradle b/build.gradle index b4b64dcf..3591b79c 100644 --- a/build.gradle +++ b/build.gradle @@ -5,32 +5,32 @@ apply plugin: "idea" apply plugin: 'maven' -version = '0.0.1' +version = '0.0.2' ext { appName = 'tonegodgui' - jmonkeyengine_version = '3.0.10' + jme_group = 'com.github.jMonkeyEngine.jmonkeyengine' + jmonkeyengine_version = 'c5c893f' // 3.1-alpha1 } sourceCompatibility = 1.7 repositories { - mavenLocal() +// mavenLocal() mavenCentral() - maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } - maven { url "https://oss.sonatype.org/content/repositories/releases/" } - maven { url 'http://updates.jmonkeyengine.org/maven' } +// maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } +// maven { url "https://oss.sonatype.org/content/repositories/releases/" } +// maven { url 'http://updates.jmonkeyengine.org/maven' } maven { url "https://jitpack.io" } } - - -mainClassName = 'app.MainRTS' -if (!hasProperty('mainClass')) { - ext.mainClass = 'app.MainRTS' -} +//mainClassName = 'app.MainRTS' +//if (!hasProperty('mainClass')) { +// ext.mainClass = 'app.MainRTS' +//} dependencies { compile fileTree(dir: 'lib', include: ['*.jar']) - compile "com.jme3:jme3-core:$jmonkeyengine_version" + compile "${jme_group}:jme3-core:${jmonkeyengine_version}" + compile "${jme_group}:jme3-lwjgl:${jmonkeyengine_version}" } sourceSets { @@ -85,87 +85,12 @@ repositories { jcenter() } -//publishing { -// publications { -// mavenJava(MavenPublication) { -// if (plugins.hasPlugin('war')) { -// from components.web -// } else { -// from components.java -// groupId 'tonegodgui' -// artifactId 'tonegodgui' -// version version -// } -// -// artifact sourcesJar -//// artifact javadocJar -// } -// } -//} - -//publishing { -// publications { -// MyPublication(MavenPublication) { -// from components.java -// groupId 'tonegodgui' -// artifactId 'tonegodgui' -// version version -// } -// } -//} - -//bintray { -// user = bintray_user //this usually comes from gradle.properties file in ~/.gradle -// key = bintray_api_key //this usually comes from gradle.properties file in ~/.gradle -// -//// configurations = ['deployables'] //When uploading configuration files -// // - OR - -// publications = ['mavenJava'] //When uploading Maven-based publication files -// // - AND/OR - -//// filesSpec { //When uploading any arbitrary files ('filesSpec' is a standard Gradle CopySpec) -//// from 'arbitrary-files' -//// into 'standalone_files/level1' -//// rename '(.+)\\.(.+)', '$1-suffix.$2' -//// } -// dryRun = false //Whether to run this as dry-run, without deploying -// publish = true //If version should be auto published after an upload -// pkg { -//// repo = 'myrepo' -// repo = 'tonegodgui' -// userOrg = 'brainless-studios' //An optional organization name when the repo belongs to one of the user's orgs -// name = 'tonegodgui' -// desc = 'what a fantastic package indeed!' -// websiteUrl = 'https://github.com/bintray/bintray-examples' -// issueTrackerUrl = 'https://github.com/bintray/bintray-examples/issues' -// vcsUrl = 'https://github.com/bintray/bintray-examples.git' -// licenses = ['BSD-3'] -// labels = ['example', 'gradle', 'bintray'] -// publicDownloadNumbers = true -// attributes= ['a': ['ay1', 'ay2'], 'b': ['bee'], c: 'cee'] //Optional package-level attributes -// //Optional version descriptor -// version { -// name = project.version //Bintray logical version name -// desc = 'optional, version-specific description' -//// released = 'optional, date of the version release' //2 possible values: date in the format of 'yyyy-MM-dd'T'HH:mm:ss.SSSZZ' OR a java.util.Date instance -//// vcsTag = '1.3.0' -//// attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin'] //Optional version-level attributes -//// gpg { -//// sign = true //Determines whether to GPG sign the files. The default is false -//// passphrase = 'passphrase' //Optional. The passphrase for GPG signing' -//// } -// mavenCentralSync { -// sync = false //Optional (true by default). Determines whether to sync the version to Maven Central. -// user = 'userToken' //OSS user token -// password = 'paasword' //OSS user password -// close = '1' //Optional property. By default the staging repository is closed and artifacts are released to Maven Central. You can optionally turn this behaviour off (by puting 0 as value) and release the version manually. -// } -// } -// } -//} - task wrapper(type: Wrapper) { gradleVersion = '2.2.1' } - - +//gradle.projectsEvaluated { +// tasks.withType(JavaCompile) { +// options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" +// } +//} \ No newline at end of file diff --git a/src/tonegod/gui/controls/extras/emitter/AlphaInfluencer.java b/src/tonegod/gui/controls/extras/emitter/AlphaInfluencer.java index d239e69c..839b75c2 100755 --- a/src/tonegod/gui/controls/extras/emitter/AlphaInfluencer.java +++ b/src/tonegod/gui/controls/extras/emitter/AlphaInfluencer.java @@ -29,7 +29,7 @@ public void update(ElementParticle particle, float tpf) { if (isEnabled) { tempV2a.set(startAlpha, startAlpha); tempV2b.set(endAlpha, endAlpha); - tempV2a.interpolate(tempV2b, interpolation.apply(particle.blend)); + tempV2a.interpolateLocal(tempV2b, interpolation.apply(particle.blend)); particle.color.set( particle.color.r, diff --git a/src/tonegod/gui/controls/extras/emitter/ColorInfluencer.java b/src/tonegod/gui/controls/extras/emitter/ColorInfluencer.java index ef275952..49ffaa44 100755 --- a/src/tonegod/gui/controls/extras/emitter/ColorInfluencer.java +++ b/src/tonegod/gui/controls/extras/emitter/ColorInfluencer.java @@ -25,7 +25,7 @@ public ColorInfluencer(ElementEmitter emitter) { @Override public void update(ElementParticle particle, float tpf) { if (isEnabled) { - particle.color.interpolate(startColor, endColor, interpolation.apply(particle.blend)); + particle.color.interpolateLocal(startColor, endColor, interpolation.apply(particle.blend)); } } diff --git a/src/tonegod/gui/controls/extras/emitter/DestinationInfluencer.java b/src/tonegod/gui/controls/extras/emitter/DestinationInfluencer.java index e78bdd0c..bb2f8f62 100755 --- a/src/tonegod/gui/controls/extras/emitter/DestinationInfluencer.java +++ b/src/tonegod/gui/controls/extras/emitter/DestinationInfluencer.java @@ -29,8 +29,8 @@ public void update(ElementParticle p, float tpf) { if (destination != Vector2f.ZERO) { temp.set(p.initialPosition); temp2.set(destination).subtractLocal(p.particle.getOrigin()); - temp.interpolate(temp2, p.blend); - p.position.interpolate(temp, strength); + temp.interpolateLocal(temp2, p.blend); + p.position.interpolateLocal(temp, strength); } } } diff --git a/src/tonegod/gui/controls/extras/emitter/DirectionInfluencer.java b/src/tonegod/gui/controls/extras/emitter/DirectionInfluencer.java index 231eb7a4..e78027cb 100755 --- a/src/tonegod/gui/controls/extras/emitter/DirectionInfluencer.java +++ b/src/tonegod/gui/controls/extras/emitter/DirectionInfluencer.java @@ -32,7 +32,7 @@ public void initialize(ElementParticle particle) { if (isEnabled) { if (direction != Vector2f.ZERO) { temp.set(direction.normalize()).multLocal(particle.randforce*strength); - particle.velocity.interpolate(particle.velocity, temp, 0.5f); + particle.velocity.interpolateLocal(particle.velocity, temp, 0.5f); } } } diff --git a/src/tonegod/gui/controls/extras/emitter/ElementEmitter.java b/src/tonegod/gui/controls/extras/emitter/ElementEmitter.java index 12311d41..ebf3500f 100755 --- a/src/tonegod/gui/controls/extras/emitter/ElementEmitter.java +++ b/src/tonegod/gui/controls/extras/emitter/ElementEmitter.java @@ -862,7 +862,7 @@ public void initialize(boolean hide) { } if (useFixedDirection) - velocity.interpolate(fixedDirection, fixedDirectionStrength); + velocity.interpolateLocal(fixedDirection, fixedDirectionStrength); velocity.multLocal(randforce); diff --git a/src/tonegod/gui/controls/extras/emitter/ImpulseInfluencer.java b/src/tonegod/gui/controls/extras/emitter/ImpulseInfluencer.java index 9fa07ce8..eac6e26d 100755 --- a/src/tonegod/gui/controls/extras/emitter/ImpulseInfluencer.java +++ b/src/tonegod/gui/controls/extras/emitter/ImpulseInfluencer.java @@ -30,7 +30,7 @@ public void update(ElementParticle particle, float tpf) { float incY = FastMath.nextRandomFloat(); if (FastMath.rand.nextBoolean()) incY = -incY; temp.set(particle.velocity).addLocal(incX, incY); - particle.velocity.interpolate(temp, (variationStrength)); + particle.velocity.interpolateLocal(temp, (variationStrength)); } } diff --git a/src/tonegod/gui/core/Screen.java b/src/tonegod/gui/core/Screen.java index 17291129..a7cbb441 100755 --- a/src/tonegod/gui/core/Screen.java +++ b/src/tonegod/gui/core/Screen.java @@ -268,7 +268,7 @@ public Screen(Application app, String styleMap) { defaultGUIFont = app.getAssetManager().loadFont(styleManager.getStyle("Font").getString("defaultFont")); scenes.add((Node)app.getViewPort().getScenes().get(0)); - + scaleManager = new ScaleUtil(this); scaleManager.initialize(); }