Browse Source

Build: Remove HW Skinning Patch as it has been merged into the engine

MeFisto94 9 years ago
parent
commit
b2be180edf
2 changed files with 2 additions and 87 deletions
  1. 2 2
      build_engine.sh
  2. 0 85
      patches/FixHWSkinningSerialization.diff

+ 2 - 2
build_engine.sh

@@ -5,8 +5,8 @@ echo "Downloading the Engine, this may take some time"
 git clone -b v3.1 --single-branch --depth 1 http://github.com/jMonkeyEngine/jMonkeyEngine/ engine # single-branch requires git > 1.7.10, if you see an error, just leave it out.
 git clone -b v3.1 --single-branch --depth 1 http://github.com/jMonkeyEngine/jMonkeyEngine/ engine # single-branch requires git > 1.7.10, if you see an error, just leave it out.
 
 
 cd engine
 cd engine
-echo "Patching the Engine...."
-patch -s -N -p 1 < ../patches/FixHWSkinningSerialization.diff
+#echo "Patching the Engine...."
+#patch -s -N -p 1 < ../patches/FixHWSkinningSerialization.diff
 
 
 echo "Building the Engine and installing them to your local maven repo...."
 echo "Building the Engine and installing them to your local maven repo...."
 ./gradlew install # Depends on jarJavadoc, jarSourcecode, assemble, dist etc.
 ./gradlew install # Depends on jarJavadoc, jarSourcecode, assemble, dist etc.

+ 0 - 85
patches/FixHWSkinningSerialization.diff

@@ -1,85 +0,0 @@
-From 9e187647d01b2994d8ba4eb0c925c3e4522d562a Mon Sep 17 00:00:00 2001
-From: MeFisto94 <[email protected]>
-Date: Wed, 25 May 2016 17:40:00 +0200
-Subject: [PATCH] Fix Hardware Skinning in 3.1 by implementing proper Array
- Serialization for MatParams and making the Shared Materials Check only a
- warning (it would pop up once each time you load the j3o and if you really
- use Shared Materials you have weird animations and some log spamming)
-
----
- .../java/com/jme3/animation/SkeletonControl.java   |  3 +-
- .../src/main/java/com/jme3/material/MatParam.java  | 37 ++++++++++++++++++++++
- 2 files changed, 39 insertions(+), 1 deletion(-)
-
-diff --git a/jme3-core/src/main/java/com/jme3/animation/SkeletonControl.java b/jme3-core/src/main/java/com/jme3/animation/SkeletonControl.java
-index b753ad2..1d14fa6 100644
---- a/jme3-core/src/main/java/com/jme3/animation/SkeletonControl.java
-+++ b/jme3-core/src/main/java/com/jme3/animation/SkeletonControl.java
-@@ -255,7 +255,8 @@ public class SkeletonControl extends AbstractControl implements Cloneable, JmeCl
-                     // is operating on this material, in that case, user
-                     // is sharing materials between models which is NOT allowed
-                     // when hardware skinning used.
--                    throw new UnsupportedOperationException(
-+                    
-+                    Logger.getLogger(SkeletonControl.class.getName()).log(Level.SEVERE,
-                             "Material instances cannot be shared when hardware skinning is used. " +
-                             "Ensure all models use unique material instances."
-                     );
-diff --git a/jme3-core/src/main/java/com/jme3/material/MatParam.java b/jme3-core/src/main/java/com/jme3/material/MatParam.java
-index 8d965e3..6c069a1 100644
---- a/jme3-core/src/main/java/com/jme3/material/MatParam.java
-+++ b/jme3-core/src/main/java/com/jme3/material/MatParam.java
-@@ -309,6 +309,8 @@ When arrays can be inserted in J3M files
-         } else if (value instanceof Boolean) {
-             Boolean b = (Boolean) value;
-             oc.write(b.booleanValue(), "value_bool", false);
-+        } else if (value.getClass().isArray() && value instanceof Savable[]) {
-+            oc.write((Savable[])value, "value_savable_array", null);
-         }
-     }
- 
-@@ -327,6 +329,41 @@ When arrays can be inserted in J3M files
-             case Int:
-                 value = ic.readInt("value_int", 0);
-                 break;
-+            case Vector2Array:
-+                Savable[] savableArray = ic.readSavableArray("value_savable_array", null);
-+                if (savableArray != null) {
-+                    value = new Vector2f[savableArray.length];
-+                    System.arraycopy(savableArray, 0, value, 0, savableArray.length);
-+                }
-+                break;
-+            case Vector3Array:
-+                savableArray = ic.readSavableArray("value_savable_array", null);
-+                if (savableArray != null) {
-+                    value = new Vector3f[savableArray.length];
-+                    System.arraycopy(savableArray, 0, value, 0, savableArray.length);
-+                }
-+                break;
-+            case Vector4Array:
-+                savableArray = ic.readSavableArray("value_savable_array", null);
-+                if (savableArray != null) {
-+                    value = new Vector4f[savableArray.length];
-+                    System.arraycopy(savableArray, 0, value, 0, savableArray.length);
-+                }
-+                break;
-+            case Matrix3Array:
-+                savableArray = ic.readSavableArray("value_savable_array", null);
-+                if (savableArray != null) {
-+                    value = new Matrix3f[savableArray.length];
-+                    System.arraycopy(savableArray, 0, value, 0, savableArray.length);
-+                }
-+                break;
-+            case Matrix4Array:
-+                savableArray = ic.readSavableArray("value_savable_array", null);
-+                if (savableArray != null) {
-+                    value = new Matrix4f[savableArray.length];
-+                    System.arraycopy(savableArray, 0, value, 0, savableArray.length);
-+                }
-+                break;
-             default:
-                 value = ic.readSavable("value_savable", null);
-                 break;
--- 
-1.8.4
-