From d925a8adfb704baab5eb4b0a499c1bbb31c58466 Mon Sep 17 00:00:00 2001 From: Tungstend Date: Sat, 5 Nov 2022 03:12:52 +0800 Subject: [PATCH] account ui & some fix & skin lib --- FCL/src/main/AndroidManifest.xml | 4 + .../tungsten/fcl/activity/MainActivity.java | 35 +- .../java/com/tungsten/fcl/ui/UIManager.java | 12 + FCL/src/main/res/layout/ui_account.xml | 14 + .../fcllibrary/anim/DynamicIslandAnim.java | 8 +- .../component/view/FCLTabLayout.java | 2 +- .../tungsten/fcllibrary/skin/BufferUtils.java | 30 + .../fcllibrary/skin/GameCharacter.java | 472 ++++++++++ .../skin/MinecraftSkinRenderer.java | 137 +++ .../fcllibrary/skin/SkinGLSurfaceView.java | 70 ++ .../fcllibrary/skin/TextureHelper.java | 79 ++ .../fcllibrary/skin/body/BodyPart.java | 886 ++++++++++++++++++ .../fcllibrary/skin/body/BodyPartSection.java | 43 + .../fcllibrary/skin/body/LimbCube.java | 162 ++++ .../fcllibrary/skin/body/MainCube.java | 110 +++ .../fcllibrary/skin/body/cube/Body.java | 21 + .../skin/body/cube/BodyOverlay.java | 21 + .../fcllibrary/skin/body/cube/Hat.java | 21 + .../fcllibrary/skin/body/cube/Head.java | 19 + .../fcllibrary/skin/body/cube/LLeg.java | 25 + .../skin/body/cube/LLegOverlay.java | 25 + .../fcllibrary/skin/body/cube/RLeg.java | 25 + .../skin/body/cube/RLegOverlay.java | 25 + .../skin/body/cube/alex/AlexLArm.java | 25 + .../skin/body/cube/alex/AlexLArmOverlay.java | 25 + .../skin/body/cube/alex/AlexRArm.java | 25 + .../skin/body/cube/alex/AlexRArmOverlay.java | 25 + .../fcllibrary/skin/body/cube/steve/LArm.java | 25 + .../skin/body/cube/steve/LArmOverlay.java | 25 + .../fcllibrary/skin/body/cube/steve/RArm.java | 25 + .../skin/body/cube/steve/RArmOverlay.java | 25 + .../fcllibrary/skin/cape/CapeCube.java | 112 +++ .../fcllibrary/skin/cape/CapePart.java | 83 ++ .../fcllibrary/skin/cape/CapePartSection.java | 45 + .../fcllibrary/skin/cape/cube/Cape.java | 22 + FCLLibrary/src/main/res/anim/ui_hide.xml | 4 +- FCLLibrary/src/main/res/anim/ui_show.xml | 4 +- 37 files changed, 2699 insertions(+), 17 deletions(-) create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/BufferUtils.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/GameCharacter.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/MinecraftSkinRenderer.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/SkinGLSurfaceView.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/TextureHelper.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/BodyPart.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/BodyPartSection.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/LimbCube.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/MainCube.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/Body.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/BodyOverlay.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/Hat.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/Head.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/LLeg.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/LLegOverlay.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/RLeg.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/RLegOverlay.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/alex/AlexLArm.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/alex/AlexLArmOverlay.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/alex/AlexRArm.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/alex/AlexRArmOverlay.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/steve/LArm.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/steve/LArmOverlay.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/steve/RArm.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/steve/RArmOverlay.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/cape/CapeCube.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/cape/CapePart.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/cape/CapePartSection.java create mode 100644 FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/cape/cube/Cape.java diff --git a/FCL/src/main/AndroidManifest.xml b/FCL/src/main/AndroidManifest.xml index 2b3c14d0..ab2a86ed 100644 --- a/FCL/src/main/AndroidManifest.xml +++ b/FCL/src/main/AndroidManifest.xml @@ -56,6 +56,7 @@ tools:targetApi="32"> @@ -66,12 +67,15 @@ { + uiManager = new UIManager(this, uiLayout); + uiManager.init(); - tabLayout = findViewById(R.id.tab_layout); - tabLayout.addOnTabSelectedListener(this); - tabLayout.selectTab(tabLayout.getTabAt(3)); - ThemeEngine.getInstance().registerEvent(tabLayout, () -> { - tabLayout.setBackgroundColor(ThemeEngine.getInstance().getTheme().getColor()); + tabLayout = findViewById(R.id.tab_layout); + tabLayout.addOnTabSelectedListener(this); + tabLayout.selectTab(tabLayout.getTabAt(3)); + ThemeEngine.getInstance().registerEvent(tabLayout, () -> { + tabLayout.setBackgroundColor(ThemeEngine.getInstance().getTheme().getColor()); + }); }); try { @@ -112,4 +115,20 @@ public class MainActivity extends FCLActivity implements TabLayout.OnTabSelected tabLayout.selectTab(tabLayout.getTabAt(3)); } } + + @Override + protected void onPause() { + super.onPause(); + if (uiManager != null) { + uiManager.onPause(); + } + } + + @Override + protected void onResume() { + super.onResume(); + if (uiManager != null) { + uiManager.onResume(); + } + } } \ No newline at end of file diff --git a/FCL/src/main/java/com/tungsten/fcl/ui/UIManager.java b/FCL/src/main/java/com/tungsten/fcl/ui/UIManager.java index 01827ef1..0c9ca086 100644 --- a/FCL/src/main/java/com/tungsten/fcl/ui/UIManager.java +++ b/FCL/src/main/java/com/tungsten/fcl/ui/UIManager.java @@ -124,4 +124,16 @@ public class UIManager { } } } + + public void onPause() { + for (FCLBaseUI baseUI : allUIs) { + baseUI.onPause(); + } + } + + public void onResume() { + for (FCLBaseUI baseUI : allUIs) { + baseUI.onResume(); + } + } } diff --git a/FCL/src/main/res/layout/ui_account.xml b/FCL/src/main/res/layout/ui_account.xml index 3e401dd6..ab1dea98 100644 --- a/FCL/src/main/res/layout/ui_account.xml +++ b/FCL/src/main/res/layout/ui_account.xml @@ -1,7 +1,21 @@ + + \ No newline at end of file diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/anim/DynamicIslandAnim.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/anim/DynamicIslandAnim.java index b382dbed..3f77f2de 100644 --- a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/anim/DynamicIslandAnim.java +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/anim/DynamicIslandAnim.java @@ -48,10 +48,10 @@ public class DynamicIslandAnim { if (shrinkAdjustAnimatorY != null && shrinkAdjustAnimatorY.isRunning()) { shrinkAdjustAnimatorY.cancel(); } - expandScaleAnimatorX = ObjectAnimator.ofFloat(view, "scaleX", scale, 0.95f).setDuration(300); - shrinkScaleAnimatorX = ObjectAnimator.ofFloat(view, "scaleX", 0.95f, scale).setDuration(300); - expandScaleAnimatorY = ObjectAnimator.ofFloat(view, "scaleY", 0.95f, 0.95f).setDuration(300); - shrinkScaleAnimatorY = ObjectAnimator.ofFloat(view, "scaleY", 0.95f, 0.95f).setDuration(300); + expandScaleAnimatorX = ObjectAnimator.ofFloat(view, "scaleX", scale / 2f, 0.95f).setDuration(300); + shrinkScaleAnimatorX = ObjectAnimator.ofFloat(view, "scaleX", 0.95f, scale / 2f).setDuration(300); + expandScaleAnimatorY = ObjectAnimator.ofFloat(view, "scaleY", 0.5f, 0.95f).setDuration(300); + shrinkScaleAnimatorY = ObjectAnimator.ofFloat(view, "scaleY", 0.95f, 0.5f).setDuration(300); expandAdjustAnimatorX = ObjectAnimator.ofFloat(view, "scaleX", 0.95f, 1f).setDuration(200); shrinkAdjustAnimatorX = ObjectAnimator.ofFloat(view, "scaleX", 1f, 0.95f).setDuration(200); expandAdjustAnimatorY = ObjectAnimator.ofFloat(view, "scaleY", 0.95f, 1f).setDuration(200); diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/component/view/FCLTabLayout.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/component/view/FCLTabLayout.java index 20a19f36..8f83fab7 100644 --- a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/component/view/FCLTabLayout.java +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/component/view/FCLTabLayout.java @@ -26,7 +26,7 @@ public class FCLTabLayout extends TabLayout { ThemeEngine.getInstance().getTheme().getDkColor(), Color.GRAY }; - setSelectedTabIndicatorColor(ThemeEngine.getInstance().getTheme().getColor()); + setSelectedTabIndicatorColor(ThemeEngine.getInstance().getTheme().getDkColor()); setTabTextColors(new ColorStateList(state, color)); setTabIconTint(new ColorStateList(state, color)); }; diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/BufferUtils.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/BufferUtils.java new file mode 100644 index 00000000..d01c516e --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/BufferUtils.java @@ -0,0 +1,30 @@ +package com.tungsten.fcllibrary.skin; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.nio.ShortBuffer; + +public class BufferUtils { + public static float d2r(final float n) { + return 3.1415927f * n / 180.0f; + } + + static FloatBuffer toFloatBuffer(final float[] array) { + final ByteBuffer allocateDirect = ByteBuffer.allocateDirect(array.length * 4); + allocateDirect.order(ByteOrder.nativeOrder()); + final FloatBuffer floatBuffer = allocateDirect.asFloatBuffer(); + floatBuffer.put(array); + floatBuffer.position(0); + return floatBuffer; + } + + static ShortBuffer toShortBuffer(final short[] array) { + final ByteBuffer allocateDirect = ByteBuffer.allocateDirect(array.length * 2); + allocateDirect.order(ByteOrder.nativeOrder()); + final ShortBuffer shortBuffer = allocateDirect.asShortBuffer(); + shortBuffer.put(array); + shortBuffer.position(0); + return shortBuffer; + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/GameCharacter.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/GameCharacter.java new file mode 100644 index 00000000..1bb8852f --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/GameCharacter.java @@ -0,0 +1,472 @@ +package com.tungsten.fcllibrary.skin; + +import com.tungsten.fcllibrary.skin.body.BodyPart; +import com.tungsten.fcllibrary.skin.body.cube.Body; +import com.tungsten.fcllibrary.skin.body.cube.BodyOverlay; +import com.tungsten.fcllibrary.skin.body.cube.Hat; +import com.tungsten.fcllibrary.skin.body.cube.Head; +import com.tungsten.fcllibrary.skin.body.cube.LLeg; +import com.tungsten.fcllibrary.skin.body.cube.LLegOverlay; +import com.tungsten.fcllibrary.skin.body.cube.RLeg; +import com.tungsten.fcllibrary.skin.body.cube.RLegOverlay; +import com.tungsten.fcllibrary.skin.body.cube.alex.AlexLArm; +import com.tungsten.fcllibrary.skin.body.cube.alex.AlexLArmOverlay; +import com.tungsten.fcllibrary.skin.body.cube.alex.AlexRArm; +import com.tungsten.fcllibrary.skin.body.cube.alex.AlexRArmOverlay; +import com.tungsten.fcllibrary.skin.body.cube.steve.LArm; +import com.tungsten.fcllibrary.skin.body.cube.steve.LArmOverlay; +import com.tungsten.fcllibrary.skin.body.cube.steve.RArm; +import com.tungsten.fcllibrary.skin.body.cube.steve.RArmOverlay; +import com.tungsten.fcllibrary.skin.cape.CapePart; +import com.tungsten.fcllibrary.skin.cape.cube.Cape; + +import javax.microedition.khronos.opengles.GL10; + +public class GameCharacter { + public static int selected_resource; + private boolean isAlexSkin; + private boolean isRunning; + private AlexLArm mAlexLArm; + private AlexLArmOverlay mAlexLArmOverlay; + private AlexRArm mAlexRArm; + private AlexRArmOverlay mAlexRArmOverlay; + private Body mBody; + private BodyOverlay mBodyOverlay; + private boolean mBodyOverlayVisible; + private boolean mBodyVisible; + private boolean mCheckAlexOrSteve; + private Hat mHat; + private boolean mHatVisible; + private Head mHead; + private boolean mHeadVisible; + private LArm mLArm; + private LArmOverlay mLArmOverlay; + private boolean mLArmOverlayVisible; + private boolean mLArmVisible; + private LLeg mLLeg; + private LLegOverlay mLLegOverlay; + private boolean mLLegOverlayVisible; + private boolean mLLegVisible; + private RArm mRArm; + private RArmOverlay mRArmOverlay; + private boolean mRArmOverlayVisible; + private boolean mRArmVisible; + private RLeg mRLeg; + private RLegOverlay mRLegOverlay; + private boolean mRLegOverlayVisible; + private boolean mRLegVisible; + private Cape mCape; + private boolean mCapeVisible; + private float[] mRotate; + private float[] rotate_step; + + public float scale = 1f; + + public GameCharacter() { + this.isAlexSkin = false; + this.isRunning = false; + this.mBodyOverlayVisible = true; + this.mBodyVisible = true; + this.mHatVisible = true; + this.mHeadVisible = true; + this.mLArmOverlayVisible = true; + this.mLArmVisible = true; + this.mLLegOverlayVisible = true; + this.mLLegVisible = true; + this.mRArmOverlayVisible = true; + this.mRArmVisible = true; + this.mRLegOverlayVisible = true; + this.mRLegVisible = true; + this.mCapeVisible = true; + this.mRotate = new float[] { 0.0f, 0.0f, 0.0f }; + this.rotate_step = new float[] { 5.0f, 5.0f, 5.0f }; + this.mHead = new Head(scale); + this.mHat = new Hat(scale); + this.mBody = new Body(scale); + this.mBodyOverlay = new BodyOverlay(scale); + this.mLArm = new LArm(scale); + this.mRArm = new RArm(scale); + this.mLArmOverlay = new LArmOverlay(scale); + this.mRArmOverlay = new RArmOverlay(scale); + this.mLLeg = new LLeg(scale); + this.mRLeg = new RLeg(scale); + this.mLLegOverlay = new LLegOverlay(scale); + this.mRLegOverlay = new RLegOverlay(scale); + this.mCape = new Cape(scale); + } + + public GameCharacter(final int selected_resource) { + this.isAlexSkin = false; + this.isRunning = false; + this.mBodyOverlayVisible = true; + this.mBodyVisible = true; + this.mHatVisible = true; + this.mHeadVisible = true; + this.mLArmOverlayVisible = true; + this.mLArmVisible = true; + this.mLLegOverlayVisible = true; + this.mLLegVisible = true; + this.mRArmOverlayVisible = true; + this.mRArmVisible = true; + this.mRLegOverlayVisible = true; + this.mRLegVisible = true; + this.mCapeVisible = true; + this.mRotate = new float[] { 0.0f, 0.0f, 0.0f }; + this.rotate_step = new float[] { 5.0f, 5.0f, 5.0f }; + GameCharacter.selected_resource = selected_resource; + this.mHead = new Head(scale); + this.mHat = new Hat(scale); + this.mBody = new Body(scale); + this.mBodyOverlay = new BodyOverlay(scale); + this.mLArm = new LArm(scale); + this.mRArm = new RArm(scale); + this.mLArmOverlay = new LArmOverlay(scale); + this.mRArmOverlay = new RArmOverlay(scale); + this.mLLeg = new LLeg(scale); + this.mRLeg = new RLeg(scale); + this.mLLegOverlay = new LLegOverlay(scale); + this.mRLegOverlay = new RLegOverlay(scale); + this.mCape = new Cape(scale); + } + + public GameCharacter(final boolean mCheckAlexOrSteve) { + this.isAlexSkin = false; + this.isRunning = false; + this.mBodyOverlayVisible = true; + this.mBodyVisible = true; + this.mHatVisible = true; + this.mHeadVisible = true; + this.mLArmOverlayVisible = true; + this.mLArmVisible = true; + this.mLLegOverlayVisible = true; + this.mLLegVisible = true; + this.mRArmOverlayVisible = true; + this.mRArmVisible = true; + this.mRLegOverlayVisible = true; + this.mRLegVisible = true; + this.mCapeVisible = true; + this.mRotate = new float[] { 0.0f, 0.0f, 0.0f }; + this.rotate_step = new float[] { 5.0f, 5.0f, 5.0f }; + if (!(this.mCheckAlexOrSteve = mCheckAlexOrSteve)) { + this.mHead = new Head(scale); + this.mHat = new Hat(scale); + this.mBody = new Body(scale); + this.mBodyOverlay = new BodyOverlay(scale); + this.mLArm = new LArm(scale); + this.mRArm = new RArm(scale); + this.mLArmOverlay = new LArmOverlay(scale); + this.mRArmOverlay = new RArmOverlay(scale); + this.mLLeg = new LLeg(scale); + this.mRLeg = new RLeg(scale); + this.mLLegOverlay = new LLegOverlay(scale); + this.mRLegOverlay = new RLegOverlay(scale); + this.mCape = new Cape(scale); + return; + } + this.mHead = new Head(scale); + this.mHat = new Hat(scale); + this.mBody = new Body(scale); + this.mBodyOverlay = new BodyOverlay(scale); + this.mAlexLArm = new AlexLArm(scale); + this.mAlexRArm = new AlexRArm(scale); + this.mAlexLArmOverlay = new AlexLArmOverlay(scale); + this.mAlexRArmOverlay = new AlexRArmOverlay(scale); + this.mLLeg = new LLeg(scale); + this.mRLeg = new RLeg(scale); + this.mLLegOverlay = new LLegOverlay(scale); + this.mRLegOverlay = new RLegOverlay(scale); + this.mCape = new Cape(scale); + } + + public GameCharacter(final boolean mCheckAlexOrSteve, final int selected_resource) { + this.isAlexSkin = false; + this.isRunning = false; + this.mBodyOverlayVisible = true; + this.mBodyVisible = true; + this.mHatVisible = true; + this.mHeadVisible = true; + this.mLArmOverlayVisible = true; + this.mLArmVisible = true; + this.mLLegOverlayVisible = true; + this.mLLegVisible = true; + this.mRArmOverlayVisible = true; + this.mRArmVisible = true; + this.mRLegOverlayVisible = true; + this.mRLegVisible = true; + this.mCapeVisible = true; + this.mRotate = new float[] { 0.0f, 0.0f, 0.0f }; + this.rotate_step = new float[] { 5.0f, 5.0f, 5.0f }; + this.mCheckAlexOrSteve = mCheckAlexOrSteve; + GameCharacter.selected_resource = selected_resource; + if (!mCheckAlexOrSteve) { + this.mHead = new Head(scale); + this.mHat = new Hat(scale); + this.mBody = new Body(scale); + this.mBodyOverlay = new BodyOverlay(scale); + this.mLArm = new LArm(scale); + this.mRArm = new RArm(scale); + this.mLArmOverlay = new LArmOverlay(scale); + this.mRArmOverlay = new RArmOverlay(scale); + this.mLLeg = new LLeg(scale); + this.mRLeg = new RLeg(scale); + this.mLLegOverlay = new LLegOverlay(scale); + this.mRLegOverlay = new RLegOverlay(scale); + this.mCape = new Cape(scale); + return; + } + this.mHead = new Head(scale); + this.mHat = new Hat(scale); + this.mBody = new Body(scale); + this.mBodyOverlay = new BodyOverlay(scale); + this.mAlexLArm = new AlexLArm(scale); + this.mAlexRArm = new AlexRArm(scale); + this.mAlexLArmOverlay = new AlexLArmOverlay(scale); + this.mAlexRArmOverlay = new AlexRArmOverlay(scale); + this.mLLeg = new LLeg(scale); + this.mRLeg = new RLeg(scale); + this.mLLegOverlay = new LLegOverlay(scale); + this.mRLegOverlay = new RLegOverlay(scale); + this.mCape = new Cape(scale); + } + + public void ResetRunForBody() { + if (!this.mCheckAlexOrSteve) { + this.mHead = new Head(scale); + this.mHat = new Hat(scale); + this.mBody = new Body(scale); + this.mBodyOverlay = new BodyOverlay(scale); + this.mLArm = new LArm(scale); + this.mRArm = new RArm(scale); + this.mLArmOverlay = new LArmOverlay(scale); + this.mRArmOverlay = new RArmOverlay(scale); + this.mLLeg = new LLeg(scale); + this.mRLeg = new RLeg(scale); + this.mLLegOverlay = new LLegOverlay(scale); + this.mRLegOverlay = new RLegOverlay(scale); + return; + } + this.mHead = new Head(scale); + this.mHat = new Hat(scale); + this.mBody = new Body(scale); + this.mBodyOverlay = new BodyOverlay(scale); + this.mAlexLArm = new AlexLArm(scale); + this.mAlexRArm = new AlexRArm(scale); + this.mAlexLArmOverlay = new AlexLArmOverlay(scale); + this.mAlexRArmOverlay = new AlexRArmOverlay(scale); + this.mLLeg = new LLeg(scale); + this.mRLeg = new RLeg(scale); + this.mLLegOverlay = new LLegOverlay(scale); + this.mRLegOverlay = new RLegOverlay(scale); + } + + public void setScale(float scale) { + this.scale = scale; + if (!mCheckAlexOrSteve) { + this.mHead = new Head(scale); + this.mHat = new Hat(scale); + this.mBody = new Body(scale); + this.mBodyOverlay = new BodyOverlay(scale); + this.mLArm = new LArm(scale); + this.mRArm = new RArm(scale); + this.mLArmOverlay = new LArmOverlay(scale); + this.mRArmOverlay = new RArmOverlay(scale); + this.mLLeg = new LLeg(scale); + this.mRLeg = new RLeg(scale); + this.mLLegOverlay = new LLegOverlay(scale); + this.mRLegOverlay = new RLegOverlay(scale); + this.mCape = new Cape(scale); + return; + } + this.mHead = new Head(scale); + this.mHat = new Hat(scale); + this.mBody = new Body(scale); + this.mBodyOverlay = new BodyOverlay(scale); + this.mAlexLArm = new AlexLArm(scale); + this.mAlexRArm = new AlexRArm(scale); + this.mAlexLArmOverlay = new AlexLArmOverlay(scale); + this.mAlexRArmOverlay = new AlexRArmOverlay(scale); + this.mLLeg = new LLeg(scale); + this.mRLeg = new RLeg(scale); + this.mLLegOverlay = new LLegOverlay(scale); + this.mRLegOverlay = new RLegOverlay(scale); + this.mCape = new Cape(scale); + } + + public void SetRotate(final float n, final float n2, final float n3) { + this.mRotate[0] = n; + this.mRotate[1] = n2; + this.mRotate[2] = n3; + } + + public void SetRotateStep(final float n, final float n2) { + if (Math.abs(n) >= 1.0f) { + final float[] mRotate = this.mRotate; + mRotate[1] += this.rotate_step[1] * Math.signum(n) * 2.0f; + } + if (Math.abs(n2) >= 1.0f) { + final float[] mRotate2 = this.mRotate; + mRotate2[0] += this.rotate_step[0] * Math.signum(n2) * 2.0f; + } + } + + public void SetRunning(final boolean isRunning) { + this.isRunning = isRunning; + } + + public void drawBody(final GL10 gl10) { + gl10.glMatrixMode(5888); + gl10.glRotatef(this.mRotate[0], 1.0f, 0.0f, 0.0f); + gl10.glRotatef(this.mRotate[1], 0.0f, 1.0f, 0.0f); + gl10.glRotatef(this.mRotate[2], 0.0f, 0.0f, 1.0f); + if (this.mBodyVisible) { + this.mBody.draw(gl10, this.isRunning); + } + if (this.mHeadVisible) { + this.mHead.draw(gl10, this.isRunning); + } + if (this.mLLegVisible) { + this.mLLeg.draw(gl10, this.isRunning); + } + if (this.mRLegVisible) { + this.mRLeg.draw(gl10, this.isRunning); + } + if (this.mRArm != null) { + if (this.mLArmVisible) { + this.mLArm.draw(gl10, this.isRunning); + } + if (this.mRArmVisible) { + this.mRArm.draw(gl10, this.isRunning); + } + if (this.mHatVisible) { + this.mHat.draw(gl10, this.isRunning); + } + if (this.mLArmOverlayVisible) { + this.mLArmOverlay.draw(gl10, this.isRunning); + } + if (this.mRArmOverlayVisible) { + this.mRArmOverlay.draw(gl10, this.isRunning); + } + } + else { + if (this.mLArmVisible) { + this.mAlexLArm.draw(gl10, this.isRunning); + } + if (this.mRArmVisible) { + this.mAlexRArm.draw(gl10, this.isRunning); + } + if (this.mHatVisible) { + this.mHat.draw(gl10, this.isRunning); + } + if (this.mLArmOverlayVisible) { + this.mAlexLArmOverlay.draw(gl10, this.isRunning); + } + if (this.mRArmOverlayVisible) { + this.mAlexRArmOverlay.draw(gl10, this.isRunning); + } + } + if (this.mLLegOverlayVisible) { + this.mLLegOverlay.draw(gl10, this.isRunning); + } + if (this.mRLegOverlayVisible) { + this.mRLegOverlay.draw(gl10, this.isRunning); + } + if (this.mBodyOverlayVisible) { + this.mBodyOverlay.draw(gl10, this.isRunning); + } + } + + public void drawCape(final GL10 gl10) { + if (this.mCapeVisible) { + this.mCape.draw(gl10, this.isRunning); + } + } + + public Boolean getRunning() { + return this.isRunning; + } + + public float getXRotation() { + return this.mRotate[0]; + } + + public float getYRotation() { + return this.mRotate[1]; + } + + public float getZRotation() { + return this.mRotate[2]; + } + + public void hideBodyPart(final BodyPart bodyPart, final boolean b) { + if (bodyPart == BodyPart.BODY) { + this.mBodyVisible = b; + } + if (bodyPart == BodyPart.HAT) { + this.mHatVisible = b; + } + if (bodyPart == BodyPart.HEAD) { + this.mHeadVisible = b; + } + if (bodyPart == BodyPart.JACKET) { + this.mBodyOverlayVisible = b; + } + if (bodyPart == BodyPart.LEFT_ARM) { + this.mLArmVisible = b; + } + if (bodyPart == BodyPart.RIGHT_ARM) { + this.mRArmVisible = b; + } + if (bodyPart == BodyPart.LEFT_LEG) { + this.mLLegVisible = b; + } + if (bodyPart == BodyPart.RIGHT_LEG) { + this.mRLegVisible = b; + } + if (bodyPart == BodyPart.LEFT_SLEEVE) { + this.mLArmOverlayVisible = b; + } + if (bodyPart == BodyPart.RIGHT_SLEEVE) { + this.mRArmOverlayVisible = b; + } + if (bodyPart == BodyPart.LEFT_LEG_OVERLAY) { + this.mLLegOverlayVisible = b; + } + if (bodyPart == BodyPart.RIGHT_LEG_OVERLAY) { + this.mRLegOverlayVisible = b; + } + } + + public void hideCapePart(final CapePart capePart, final boolean b) { + if (capePart == CapePart.CAPE) { + this.mCapeVisible = b; + } + } + + public void setXRotation(final int n) { + this.mRotate[0] = n; + } + + public void setYRotation(final int n) { + this.mRotate[1] = n; + } + + public void setZRotation(final int n) { + this.mRotate[2] = n; + } + + public void showAllBodyParts() { + this.mHeadVisible = true; + this.mHatVisible = true; + this.mBodyVisible = true; + this.mBodyOverlayVisible = true; + this.mLArmVisible = true; + this.mRArmVisible = true; + this.mLArmOverlayVisible = true; + this.mRArmOverlayVisible = true; + this.mLLegVisible = true; + this.mRLegVisible = true; + this.mLLegOverlayVisible = true; + this.mRLegOverlayVisible = true; + this.mCapeVisible = true; + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/MinecraftSkinRenderer.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/MinecraftSkinRenderer.java new file mode 100644 index 00000000..84072842 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/MinecraftSkinRenderer.java @@ -0,0 +1,137 @@ +package com.tungsten.fcllibrary.skin; + +import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.opengl.GLSurfaceView; +import android.opengl.GLU; +import android.os.SystemClock; + +import javax.microedition.khronos.egl.EGLConfig; +import javax.microedition.khronos.opengles.GL10; + +public class MinecraftSkinRenderer implements GLSurfaceView.Renderer { + public static float[] light0Position; + public boolean changeSkinImage; + public GameCharacter mCharacter; + private int[] mCharacterTexData; + private Context mContext; + public String path; + public float[] plane_texcoords; + protected float[] plane_vertices; + public Bitmap skin; + public Bitmap cape; + boolean superRun; + boolean updateBitmapSkin; + + static { + MinecraftSkinRenderer.light0Position = new float[]{0.0f, 0.0f, 5100.0f, 0.0f}; + } + + public MinecraftSkinRenderer(final Context mContext) { + this.changeSkinImage = false; + this.plane_texcoords = new float[] {0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f}; + this.plane_vertices = new float[] {-200.0f, -100.0f, -100.0f, -200.0f, 100.0f, -100.0f, 200.0f, 100.0f, -100.0f, 200.0f, -100.0f, -100.0f}; + this.updateBitmapSkin = false; + this.superRun = false; + this.mContext = mContext; + this.mCharacter = new GameCharacter(); + } + + public MinecraftSkinRenderer(final Context mContext, final int n) { + this.changeSkinImage = false; + this.plane_texcoords = new float[] {0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f}; + this.plane_vertices = new float[] {-200.0f, -100.0f, -100.0f, -200.0f, 100.0f, -100.0f, 200.0f, 100.0f, -100.0f, 200.0f, -100.0f, -100.0f}; + this.updateBitmapSkin = false; + this.superRun = false; + this.mContext = mContext; + this.mCharacter = new GameCharacter(n); + } + + public MinecraftSkinRenderer(final Context mContext, final int n, final boolean b) { + this.changeSkinImage = false; + this.plane_texcoords = new float[] {0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f}; + this.plane_vertices = new float[] {-200.0f, -100.0f, -100.0f, -200.0f, 100.0f, -100.0f, 200.0f, 100.0f, -100.0f, 200.0f, -100.0f, -100.0f}; + this.updateBitmapSkin = false; + this.superRun = false; + this.mContext = mContext; + this.mCharacter = new GameCharacter(b, n); + } + + public MinecraftSkinRenderer(final Context mContext, final boolean b) { + this.changeSkinImage = false; + this.plane_texcoords = new float[] {0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 1.0f}; + this.plane_vertices = new float[] {-200.0f, -100.0f, -100.0f, -200.0f, 100.0f, -100.0f, 200.0f, 100.0f, -100.0f, 200.0f, -100.0f, -100.0f}; + this.updateBitmapSkin = false; + this.superRun = false; + this.mContext = mContext; + this.mCharacter = new GameCharacter(b); + } + + public void onDrawFrame(final GL10 gl10) { + if (this.changeSkinImage) { + this.changeSkinImage = false; + } + if (this.updateBitmapSkin) { + mCharacterTexData = TextureHelper.loadGLTextureFromBitmap(this.skin, this.cape, gl10); + this.updateBitmapSkin = false; + } + gl10.glClear(16640); + gl10.glEnable(3553); + gl10.glLoadIdentity(); + gl10.glColor4f(0.63671875f, 0.76953125f, 0.22265625f, 1.0f); + gl10.glTranslatef(0.0f, 0.0f, -60.0f); + gl10.glPushMatrix(); + gl10.glBindTexture(3553, mCharacterTexData[0]); + this.mCharacter.drawBody(gl10); + if (cape != null && cape.getWidth() == 64 && cape.getHeight() == 32) { + gl10.glBindTexture(3553, mCharacterTexData[1]); + this.mCharacter.drawCape(gl10); + } + gl10.glPopMatrix(); + gl10.glLoadIdentity(); + if (this.superRun) { + GLU.gluLookAt(gl10, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); + gl10.glRotatef(0.09f * (int) (SystemClock.uptimeMillis() % 4000L), 0.0f, 0.0f, 1.0f); + this.mCharacter.drawBody(gl10); + } + } + + public void onSurfaceChanged(final GL10 gl10, final int n, final int n2) { + gl10.glViewport(0, 0, n, n2); + gl10.glMatrixMode(5889); + gl10.glLoadIdentity(); + final float n3 = n2 / 2.0f / (float) Math.tan(BufferUtils.d2r(22.5f)); + GLU.gluPerspective(gl10, 45.0f, n / n2, 0.5f, Math.max(1500.0f, n3)); + gl10.glMatrixMode(5888); + gl10.glLoadIdentity(); + GLU.gluLookAt(gl10, n / 2.0f, n2 / 2.0f, n3, n / 2.0f, n2 / 2.0f, 0.0f, 0.0f, 1.0f, 0.0f); + gl10.glEnable(2896); + gl10.glEnable(16384); + gl10.glLightfv(16384, 4608, new float[] {3.5f, 3.5f, 3.5f, 1.0f}, 0); + gl10.glLightfv(16384, 4611, MinecraftSkinRenderer.light0Position = new float[] {0.0f, 0.0f, n3, 0.0f}, 0); + } + + @Override + public void onSurfaceCreated(GL10 gl10, EGLConfig eglConfig) { + this.mCharacterTexData = TextureHelper.loadTexture(BitmapFactory.decodeStream(MinecraftSkinRenderer.class.getResourceAsStream("/assets/img/alex.png"))); + gl10.glEnable(3042); + gl10.glCullFace(1028); + gl10.glShadeModel(7425); + gl10.glEnable(6408); + gl10.glEnable(2929); + gl10.glDepthFunc(515); + gl10.glHint(3152, 4354); + gl10.glClearDepthf(1.0f); + } + + public void setSuperRun(final boolean superRun) { + this.superRun = superRun; + } + + public void updateTexture(final Bitmap skin, Bitmap cape) { + this.skin = skin; + this.cape = cape; + this.updateBitmapSkin = true; + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/SkinGLSurfaceView.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/SkinGLSurfaceView.java new file mode 100644 index 00000000..51f6a425 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/SkinGLSurfaceView.java @@ -0,0 +1,70 @@ +package com.tungsten.fcllibrary.skin; + +import android.content.Context; +import android.opengl.GLSurfaceView; +import android.util.AttributeSet; +import android.view.MotionEvent; + +public class SkinGLSurfaceView extends GLSurfaceView { + private float mDensity; + private float mPreviousX; + private float mPreviousY; + private MinecraftSkinRenderer mRenderer; + + public SkinGLSurfaceView(final Context context) { + super(context); + } + + public SkinGLSurfaceView(final Context context, final AttributeSet set) { + super(context, set); + } + + public boolean onTouchEvent(final MotionEvent motionEvent) { + if (motionEvent.getPointerCount() == 1) { + final float x = motionEvent.getX(); + final float y = motionEvent.getY(); + if (motionEvent.getAction() == 2 && this.mRenderer != null) { + this.mRenderer.mCharacter.SetRotateStep((x - this.mPreviousX) / (this.mDensity), (y - this.mPreviousY) / (this.mDensity * 3.0f)); + } + this.mPreviousX = x; + this.mPreviousY = y; + } + if (motionEvent.getPointerCount() == 2) { + switch (motionEvent.getActionMasked()) { + case MotionEvent.ACTION_DOWN: + priId = motionEvent.getPointerId(motionEvent.getActionIndex()); + break; + case MotionEvent.ACTION_POINTER_DOWN: + secId = motionEvent.getPointerId(motionEvent.getActionIndex()); + float deltaX = motionEvent.getX(motionEvent.findPointerIndex(priId)) - motionEvent.getX(motionEvent.findPointerIndex(secId)); + float deltaY = motionEvent.getY(motionEvent.findPointerIndex(priId)) - motionEvent.getY(motionEvent.findPointerIndex(secId)); + initDist = Math.sqrt(deltaX * deltaX + deltaY * deltaY); + initScale = mRenderer.mCharacter.scale; + break; + case MotionEvent.ACTION_MOVE: + float dX = motionEvent.getX(motionEvent.findPointerIndex(priId)) - motionEvent.getX(motionEvent.findPointerIndex(secId)); + float dY = motionEvent.getY(motionEvent.findPointerIndex(priId)) - motionEvent.getY(motionEvent.findPointerIndex(secId)); + double dist = Math.sqrt(dX * dX + dY * dY); + double delta = dist - initDist; + if (initScale + (delta / (1 * Math.sqrt(getWidth() * getWidth() + getHeight() * getHeight()))) <= 2 && initScale + (delta / (1 * Math.sqrt(getWidth() * getWidth() + getHeight() * getHeight()))) >= 0.7) { + float scale = (float) (initScale + (delta / (1 * Math.sqrt(getWidth() * getWidth() + getHeight() * getHeight())))); + mRenderer.mCharacter.setScale(scale); + } + break; + } + } + + return true; + } + + private int priId; + private int secId; + private double initDist; + private float initScale; + + public void setRenderer(final MinecraftSkinRenderer minecraftSkinRenderer, final float mDensity) { + this.mRenderer = minecraftSkinRenderer; + this.mDensity = mDensity; + super.setRenderer((Renderer)minecraftSkinRenderer); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/TextureHelper.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/TextureHelper.java new file mode 100644 index 00000000..6c99a6af --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/TextureHelper.java @@ -0,0 +1,79 @@ +package com.tungsten.fcllibrary.skin; + +import android.content.Context; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.opengl.GLES20; +import android.opengl.GLUtils; +import android.util.Log; + +import javax.microedition.khronos.opengles.GL10; + +public class TextureHelper { + public static boolean isLoadingError; + + static { + TextureHelper.isLoadingError = false; + } + + public static int[] loadGLTextureFromBitmap(final Bitmap skin, final Bitmap cape, final GL10 gl10) { + final int[] array = { 0 , 0 }; + gl10.glGenTextures(2, array, 0); + gl10.glBindTexture(3553, array[0]); + gl10.glTexParameterf(3553, 10241, 9728.0f); + gl10.glTexParameterf(3553, 10240, 9728.0f); + GLUtils.texImage2D(3553, 0, skin, 0); + gl10.glBindTexture(3553, array[1]); + gl10.glTexParameterf(3553, 10241, 9728.0f); + gl10.glTexParameterf(3553, 10240, 9728.0f); + if (cape != null) { + GLUtils.texImage2D(3553, 0, cape, 0); + } + if (array[0] == 0 || (cape != null && array[1] == 0)) { + throw new RuntimeException("Error loading texture."); + } + else { + Log.e("loadTex","success"); + } + return array; + } + + public static int[] loadTexture(final Context context, final int n) { + TextureHelper.isLoadingError = false; + final int[] array = { 0 }; + GLES20.glGenTextures(1, array, 0); + if (array[0] != 0) { + final BitmapFactory.Options bitmapFactory = new BitmapFactory.Options(); + bitmapFactory.inScaled = false; + final Bitmap decodeResource = BitmapFactory.decodeResource(context.getResources(), n, bitmapFactory); + GLES20.glBindTexture(3553, array[0]); + GLES20.glTexParameteri(3553, 10241, 9728); + GLES20.glTexParameterf(3553, 10240, 9728.0f); + GLUtils.texImage2D(3553, 0, decodeResource, 0); + decodeResource.recycle(); + } + if (array[0] == 0) { + throw new RuntimeException("Error loading texture."); + } + return array; + } + + public static int[] loadTexture(final Bitmap bitmap) { + TextureHelper.isLoadingError = false; + final int[] array = { 0 }; + GLES20.glGenTextures(1, array, 0); + if (array[0] != 0) { + new BitmapFactory.Options().inScaled = false; + GLES20.glBindTexture(3553, array[0]); + GLES20.glTexParameteri(3553, 10241, 9728); + GLES20.glTexParameterf(3553, 10240, 9728.0f); + GLUtils.texImage2D(3553, 0, bitmap, 0); + bitmap.recycle(); + } + if (array[0] == 0) { + throw new RuntimeException("Error loading texture."); + } + return array; + } + +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/BodyPart.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/BodyPart.java new file mode 100644 index 00000000..add6e356 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/BodyPart.java @@ -0,0 +1,886 @@ +package com.tungsten.fcllibrary.skin.body; + +public enum BodyPart { + BODY(2, "Body", new BodyPartSection[] { BodySkin.FRONT.getBodyPartSection(), BodySkin.RIGHT.getBodyPartSection(), BodySkin.BACK.getBodyPartSection(), BodySkin.LEFT.getBodyPartSection(), BodySkin.TOP.getBodyPartSection(), BodySkin.BOTTOM.getBodyPartSection() }), + HAT(1, "Hat", new BodyPartSection[] { HatSkin.FRONT.getBodyPartSection(), HatSkin.RIGHT.getBodyPartSection(), HatSkin.BACK.getBodyPartSection(), HatSkin.LEFT.getBodyPartSection(), HatSkin.TOP.getBodyPartSection(), HatSkin.BOTTOM.getBodyPartSection() }), + HEAD(0, "Head", new BodyPartSection[] { HeadSkin.FRONT.getBodyPartSection(), HeadSkin.RIGHT.getBodyPartSection(), HeadSkin.BACK.getBodyPartSection(), HeadSkin.LEFT.getBodyPartSection(), HeadSkin.TOP.getBodyPartSection(), HeadSkin.BOTTOM.getBodyPartSection() }), + JACKET(3, "Body Overlay", new BodyPartSection[] { JacketSkin.FRONT.getBodyPartSection(), JacketSkin.RIGHT.getBodyPartSection(), JacketSkin.BACK.getBodyPartSection(), JacketSkin.LEFT.getBodyPartSection(), JacketSkin.TOP.getBodyPartSection(), JacketSkin.BOTTOM.getBodyPartSection() }), + LEFT_ARM(4, "Left Arm", new BodyPartSection[] { LeftArmSkin.FRONT.getBodyPartSection(), LeftArmSkin.RIGHT.getBodyPartSection(), LeftArmSkin.BACK.getBodyPartSection(), LeftArmSkin.LEFT.getBodyPartSection(), LeftArmSkin.TOP.getBodyPartSection(), LeftArmSkin.BOTTOM.getBodyPartSection() }), + LEFT_LEG(8, "Left Leg", new BodyPartSection[] { LeftLegSkin.FRONT.getBodyPartSection(), LeftLegSkin.RIGHT.getBodyPartSection(), LeftLegSkin.BACK.getBodyPartSection(), LeftLegSkin.LEFT.getBodyPartSection(), LeftLegSkin.TOP.getBodyPartSection(), LeftLegSkin.BOTTOM.getBodyPartSection() }), + LEFT_LEG_OVERLAY(10, "Left Leg Overlay", new BodyPartSection[] { LeftLegOverlaySkin.FRONT.getBodyPartSection(), LeftLegOverlaySkin.RIGHT.getBodyPartSection(), LeftLegOverlaySkin.BACK.getBodyPartSection(), LeftLegOverlaySkin.LEFT.getBodyPartSection(), LeftLegOverlaySkin.TOP.getBodyPartSection(), LeftLegOverlaySkin.BOTTOM.getBodyPartSection() }), + LEFT_SLEEVE(6, "Left Arm Overlay", new BodyPartSection[] { LeftSleeveSkin.FRONT.getBodyPartSection(), LeftSleeveSkin.RIGHT.getBodyPartSection(), LeftSleeveSkin.BACK.getBodyPartSection(), LeftSleeveSkin.LEFT.getBodyPartSection(), LeftSleeveSkin.TOP.getBodyPartSection(), LeftSleeveSkin.BOTTOM.getBodyPartSection() }), + RIGHT_ARM(5, "Right Arm", new BodyPartSection[] { RightArmSkin.FRONT.getBodyPartSection(), RightArmSkin.RIGHT.getBodyPartSection(), RightArmSkin.BACK.getBodyPartSection(), RightArmSkin.LEFT.getBodyPartSection(), RightArmSkin.TOP.getBodyPartSection(), RightArmSkin.BOTTOM.getBodyPartSection() }), + RIGHT_LEG(9, "Right Leg", new BodyPartSection[] { RightLegSkin.FRONT.getBodyPartSection(), RightLegSkin.RIGHT.getBodyPartSection(), RightLegSkin.BACK.getBodyPartSection(), RightLegSkin.LEFT.getBodyPartSection(), RightLegSkin.TOP.getBodyPartSection(), RightLegSkin.BOTTOM.getBodyPartSection() }), + RIGHT_LEG_OVERLAY(11, "Right Leg Overlay", new BodyPartSection[] { RightLegOverlaySkin.FRONT.getBodyPartSection(), RightLegOverlaySkin.RIGHT.getBodyPartSection(), RightLegOverlaySkin.BACK.getBodyPartSection(), RightLegOverlaySkin.LEFT.getBodyPartSection(), RightLegOverlaySkin.TOP.getBodyPartSection(), RightLegOverlaySkin.BOTTOM.getBodyPartSection() }), + RIGHT_SLEEVE(7, "Right Arm Overlay", new BodyPartSection[] { RightSleeveSkin.FRONT.getBodyPartSection(), RightSleeveSkin.RIGHT.getBodyPartSection(), RightSleeveSkin.BACK.getBodyPartSection(), RightSleeveSkin.LEFT.getBodyPartSection(), RightSleeveSkin.TOP.getBodyPartSection(), RightSleeveSkin.BOTTOM.getBodyPartSection() }); + + private BodyPartSection[] bodyParts; + private String displayName; + private int id; + + private BodyPart(final int id, final String displayName, final BodyPartSection[] bodyParts) { + this.id = id; + this.displayName = displayName; + this.bodyParts = bodyParts; + } + + BodyPartSection getBodyPartSection(final int n) { + return this.bodyParts[n]; + } + + String getDisplayName() { + return this.displayName; + } + + int getPartId() { + return this.id; + } + + public enum AlexLeftArmSkin { + BACK(2, "Back", 51, 20, 3, 12), + BOTTOM(5, "Bottom", 47, 16, 3, 4), + FRONT(0, "Front", 44, 20, 3, 12), + LEFT(3, "Left", 47, 20, 4, 12), + RIGHT(1, "Right", 40, 20, 4, 12), + TOP(4, "Top", 44, 16, 3, 4); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + AlexLeftArmSkin(final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + BodyPartSection getBodyPartSection() { + return new BodyPartSection("Left Arm", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } + + public enum AlexLeftSleeveSkin { + BACK(2, "Back", 51, 36, 3, 12), + BOTTOM(5, "Bottom", 47, 32, 3, 4), + FRONT(0, "Front", 44, 36, 3, 12), + LEFT(3, "Left", 47, 36, 4, 12), + RIGHT(1, "Right", 40, 36, 4, 12), + TOP(4, "Top", 44, 32, 3, 4); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + AlexLeftSleeveSkin(final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + BodyPartSection getBodyPartSection() { + return new BodyPartSection("Left Arm Overlay", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } + + public enum AlexRightArmSkin { + BACK(2, "Back", 43, 52, 3, 12), + BOTTOM(5, "Bottom", 39, 48, 3, 4), + FRONT(0, "Front", 36, 52, 3, 12), + LEFT(3, "Left", 39, 52, 4, 12), + RIGHT(1, "Right", 32, 52, 4, 12), + TOP(4, "Top", 36, 48, 3, 4); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + AlexRightArmSkin(final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + BodyPartSection getBodyPartSection() { + return new BodyPartSection("Right Arm", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } + + public enum AlexRightSleeveSkin { + BACK(2, "Back", 59, 52, 3, 12), + BOTTOM(5, "Bottom", 55, 48, 3, 4), + FRONT(0, "Front", 52, 52, 3, 12), + LEFT(3, "Left", 55, 52, 4, 12), + RIGHT(1, "Right", 48, 52, 4, 12), + TOP(4, "Top", 52, 48, 3, 4); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + AlexRightSleeveSkin(final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + BodyPartSection getBodyPartSection() { + return new BodyPartSection("Right Arm Overlay", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } + + public enum BodySkin { + BACK("BACK", 2, 2, "Back", 32, 20, 8, 12), + BOTTOM("BOTTOM", 5, 5, "Bottom", 28, 14, 8, 4), + FRONT("FRONT", 0, 0, "Front", 20, 20, 8, 12), + LEFT("LEFT", 3, 3, "Left", 28, 20, 4, 12), + RIGHT("RIGHT", 1, 1, "Right", 16, 20, 4, 12), + TOP("TOP", 4, 4, "Top", 20, 14, 8, 4); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + BodySkin(final String s2, final int n2, final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + BodyPartSection getBodyPartSection() { + return new BodyPartSection("Body", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } + + public enum HatSkin { + BACK("BACK", 2, 2, "Back", 56, 8, 8, 8), + BOTTOM("BOTTOM", 5, 5, "Bottom", 48, 0, 8, 8), + FRONT("FRONT", 0, 0, "Front", 40, 8, 8, 8), + LEFT("LEFT", 3, 3, "Left", 48, 8, 8, 8), + RIGHT("RIGHT", 1, 1, "Right", 32, 8, 8, 8), + TOP("TOP", 4, 4, "Top", 40, 0, 8, 8); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + HatSkin(final String s2, final int n2, final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + BodyPartSection getBodyPartSection() { + return new BodyPartSection("Hat", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } + + public enum HeadSkin { + BACK("BACK", 2, 2, "Back", 24, 8, 8, 8), + BOTTOM("BOTTOM", 5, 5, "Bottom", 16, 0, 8, 8), + FRONT("FRONT", 0, 0, "Front", 8, 8, 8, 8), + LEFT("LEFT", 3, 3, "Left", 16, 8, 8, 8), + RIGHT("RIGHT", 1, 1, "Right", 0, 8, 8, 8), + TOP("TOP", 4, 4, "Top", 8, 0, 8, 8); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + HeadSkin(final String s2, final int n2, final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + BodyPartSection getBodyPartSection() { + return new BodyPartSection("Head", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } + + public enum JacketSkin { + BACK("BACK", 2, 2, "Back", 32, 36, 8, 12), + BOTTOM("BOTTOM", 5, 5, "Bottom", 28, 32, 8, 4), + FRONT("FRONT", 0, 0, "Front", 20, 36, 8, 12), + LEFT("LEFT", 3, 3, "Left", 28, 36, 4, 12), + RIGHT("RIGHT", 1, 1, "Right", 16, 36, 4, 12), + TOP("TOP", 4, 4, "Top", 20, 32, 8, 4); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + JacketSkin(final String s2, final int n2, final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + BodyPartSection getBodyPartSection() { + return new BodyPartSection("Body Overlay", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } + + public enum LeftArmSkin { + BACK("BACK", 2, 2, "Back", 44, 52, 4, 12), + BOTTOM("BOTTOM", 5, 5, "Bottom", 40, 48, 4, 4), + FRONT("FRONT", 0, 0, "Front", 36, 52, 4, 12), + LEFT("LEFT", 3, 3, "Left", 40, 52, 4, 12), + RIGHT("RIGHT", 1, 1, "Right", 32, 52, 4, 12), + TOP("TOP", 4, 4, "Top", 36, 48, 4, 4); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + LeftArmSkin(final String s2, final int n2, final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + BodyPartSection getBodyPartSection() { + return new BodyPartSection("Left Arm", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } + + public enum LeftLegOverlaySkin { + BACK("BACK", 2, 2, "Back", 12, 52, 4, 12), + BOTTOM("BOTTOM", 5, 5, "Bottom", 8, 48, 4, 4), + FRONT("FRONT", 0, 0, "Front", 4, 52, 4, 12), + LEFT("LEFT", 3, 3, "Left", 8, 52, 4, 12), + RIGHT("RIGHT", 1, 1, "Right", 0, 52, 4, 12), + TOP("TOP", 4, 4, "Top", 4, 48, 4, 4); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + LeftLegOverlaySkin(final String s2, final int n2, final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + BodyPartSection getBodyPartSection() { + return new BodyPartSection("Left Leg Overlay", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } + + public enum LeftLegSkin { + BACK("BACK", 2, 2, "Back", 28, 52, 4, 12), + BOTTOM("BOTTOM", 5, 5, "Bottom", 24, 48, 4, 4), + FRONT("FRONT", 0, 0, "Front", 20, 52, 4, 12), + LEFT("LEFT", 3, 3, "Left", 24, 52, 4, 12), + RIGHT("RIGHT", 1, 1, "Right", 16, 52, 4, 12), + TOP("TOP", 4, 4, "Top", 20, 48, 4, 4); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + LeftLegSkin(final String s2, final int n2, final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + BodyPartSection getBodyPartSection() { + return new BodyPartSection("Left Leg", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } + + public enum LeftSleeveSkin { + BACK("BACK", 2, 2, "Back", 60, 52, 4, 12), + BOTTOM("BOTTOM", 5, 5, "Bottom", 56, 48, 4, 4), + FRONT("FRONT", 0, 0, "Front", 52, 52, 4, 12), + LEFT("LEFT", 3, 3, "Left", 56, 52, 4, 12), + RIGHT("RIGHT", 1, 1, "Right", 48, 52, 4, 12), + TOP("TOP", 4, 4, "Top", 52, 48, 4, 4); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + LeftSleeveSkin(final String s2, final int n2, final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + BodyPartSection getBodyPartSection() { + return new BodyPartSection("Left Arm Overlay", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } + + public enum RightArmSkin { + BACK("BACK", 2, 2, "Back", 52, 20, 4, 12), + BOTTOM("BOTTOM", 5, 5, "Bottom", 48, 16, 4, 4), + FRONT("FRONT", 0, 0, "Front", 44, 20, 4, 12), + LEFT("LEFT", 3, 3, "Left", 48, 20, 4, 12), + RIGHT("RIGHT", 1, 1, "Right", 40, 20, 4, 12), + TOP("TOP", 4, 4, "Top", 44, 16, 4, 4); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + RightArmSkin(final String s2, final int n2, final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + BodyPartSection getBodyPartSection() { + return new BodyPartSection("Right Arm", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } + + public enum RightLegOverlaySkin { + BACK("BACK", 2, 2, "Back", 12, 36, 4, 12), + BOTTOM("BOTTOM", 5, 5, "Bottom", 8, 32, 4, 4), + FRONT("FRONT", 0, 0, "Front", 4, 36, 4, 12), + LEFT("LEFT", 3, 3, "Left", 8, 36, 4, 12), + RIGHT("RIGHT", 1, 1, "Right", 0, 36, 4, 12), + TOP("TOP", 4, 4, "Top", 4, 32, 4, 4); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + RightLegOverlaySkin(final String s2, final int n2, final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + BodyPartSection getBodyPartSection() { + return new BodyPartSection("Right Leg Overlay", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } + + public enum RightLegSkin { + BACK("BACK", 2, 2, "Back", 12, 20, 4, 12), + BOTTOM("BOTTOM", 5, 5, "Bottom", 8, 16, 4, 4), + FRONT("FRONT", 0, 0, "Front", 4, 20, 4, 12), + LEFT("LEFT", 3, 3, "Left", 8, 20, 4, 12), + RIGHT("RIGHT", 1, 1, "Right", 0, 20, 4, 12), + TOP("TOP", 4, 4, "Top", 4, 16, 4, 4); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + RightLegSkin(final String s2, final int n2, final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + BodyPartSection getBodyPartSection() { + return new BodyPartSection("Right Leg", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } + + public enum RightSleeveSkin { + BACK("BACK", 2, 2, "Back", 52, 36, 4, 12), + BOTTOM("BOTTOM", 5, 5, "Bottom", 48, 32, 4, 4), + FRONT("FRONT", 0, 0, "Front", 44, 36, 4, 12), + LEFT("LEFT", 3, 3, "Left", 48, 36, 4, 12), + RIGHT("RIGHT", 1, 1, "Right", 40, 36, 4, 12), + TOP("TOP", 4, 4, "Top", 44, 32, 4, 4); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + RightSleeveSkin(final String s2, final int n2, final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + BodyPartSection getBodyPartSection() { + return new BodyPartSection("Right Arm Overlay", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/BodyPartSection.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/BodyPartSection.java new file mode 100644 index 00000000..b500a79b --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/BodyPartSection.java @@ -0,0 +1,43 @@ +package com.tungsten.fcllibrary.skin.body; + +public class BodyPartSection { + String bodyPartName; + int height; + String sideName; + int startX; + int startY; + int width; + + public BodyPartSection(final String bodyPartName, final String sideName, final int startX, final int startY, final int width, final int height) { + this.bodyPartName = bodyPartName; + this.sideName = sideName; + this.startX = startX; + this.startY = startY; + this.width = width; + this.height = height; + } + + public String getBodyPartName() { + return this.bodyPartName; + } + + public int getHeight() { + return this.height; + } + + public String getSideName() { + return this.sideName; + } + + public int getStartX() { + return this.startX; + } + + public int getStartY() { + return this.startY; + } + + public int getWidth() { + return this.width; + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/LimbCube.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/LimbCube.java new file mode 100644 index 00000000..24d82310 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/LimbCube.java @@ -0,0 +1,162 @@ +package com.tungsten.fcllibrary.skin.body; + +import java.nio.Buffer; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.util.ArrayList; + +import javax.microedition.khronos.opengles.GL10; + +public class LimbCube { + protected int[] face_indecies; + protected float[] face_vertices; + protected float fixedDir; + protected boolean isFixOneAxis; + protected float mMainAngle; + protected FloatBuffer mNormalVertexBuffer; + protected float[] mOffset; + protected float[] mScale; + protected float mSubAngle; + protected ArrayList mTextureBuffers; + protected FloatBuffer mVertexBuffer; + protected float[] main_angle_axis; + protected float main_max_angle; + protected float main_min_angle; + protected float main_step_value; + protected float[] normal_vertices; + protected float[] sub_angle_axis; + protected float sub_max_angle; + protected float sub_min_angle; + protected float sub_step_value; + private float[] vertices; + + public LimbCube(final float n, final float n2, final float n3, final float n4, final float n5, final float n6) { + this.mScale = new float[] { 0.0f, 0.0f, 0.0f }; + this.mOffset = new float[] { 0.0f, 0.0f, 0.0f }; + this.mMainAngle = 0.0f; + this.main_step_value = -3.0f; + this.main_max_angle = 3.0f; + this.main_min_angle = -3.0f; + this.main_angle_axis = new float[] { 0.0f, 0.0f, 0.0f }; + this.mSubAngle = 0.0f; + this.sub_step_value = -0.15f; + this.sub_max_angle = 3.0f; + this.sub_min_angle = -3.0f; + this.sub_angle_axis = new float[] { 0.0f, 0.0f, 0.0f }; + this.isFixOneAxis = true; + this.fixedDir = 1.0f; + this.vertices = new float[] { -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, -1.0f, -1.0f, 0.0f, -1.0f }; + this.face_indecies = new int[] { 0, 8, 9, 1, 8, 3, 2, 9, 3, 7, 6, 2, 1, 5, 4, 0, 1, 9, 10, 5, 9, 2, 6, 10, 4, 11, 8, 0, 11, 7, 3, 8, 5, 10, 11, 4, 10, 6, 7, 11 }; + this.face_vertices = new float[this.face_indecies.length * 3]; + this.normal_vertices = new float[] { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f }; + this.mTextureBuffers = new ArrayList(); + this.mScale[0] = n; + this.mScale[1] = n2; + this.mScale[2] = n3; + this.mOffset[0] = n4; + this.mOffset[1] = n5; + this.mOffset[2] = n6; + final ByteBuffer allocateDirect = ByteBuffer.allocateDirect(this.face_vertices.length * 4); + allocateDirect.order(ByteOrder.nativeOrder()); + (this.mVertexBuffer = allocateDirect.asFloatBuffer()).put(this.face_vertices); + this.mVertexBuffer.position(0); + final ByteBuffer allocateDirect2 = ByteBuffer.allocateDirect(this.normal_vertices.length * 4); + allocateDirect2.order(ByteOrder.nativeOrder()); + (this.mNormalVertexBuffer = allocateDirect2.asFloatBuffer()).put(this.normal_vertices); + this.mNormalVertexBuffer.position(0); + } + + public LimbCube(final float n, final float n2, final float n3, final float n4, final float n5, final float n6, final float main_step_value, final float n7, final float n8, final float n9, final float main_max_angle, final float main_min_angle, final float sub_step_value, final float sub_max_angle, final float sub_min_angle, final boolean isFixOneAxis, final float fixedDir) { + this(n, n2, n3, n4, n5, n6); + this.main_step_value = main_step_value; + this.main_angle_axis[0] = n7; + this.main_angle_axis[1] = n8; + this.main_angle_axis[2] = n9; + this.main_max_angle = main_max_angle; + this.main_min_angle = main_min_angle; + this.sub_step_value = sub_step_value; + this.sub_max_angle = sub_max_angle; + this.sub_min_angle = sub_min_angle; + this.isFixOneAxis = isFixOneAxis; + this.fixedDir = fixedDir; + } + + public FloatBuffer AddTextures(final float[] array) { + final ByteBuffer allocateDirect = ByteBuffer.allocateDirect(array.length * 4); + allocateDirect.order(ByteOrder.nativeOrder()); + final FloatBuffer floatBuffer = allocateDirect.asFloatBuffer(); + floatBuffer.put(array); + floatBuffer.position(0); + this.mTextureBuffers.add(floatBuffer); + return floatBuffer; + } + + public void ClearAllTextures() { + this.mTextureBuffers.clear(); + } + + public void draw(final GL10 gl10, final boolean b) { + gl10.glEnable(3042); + gl10.glBlendFunc(1, 771); + gl10.glEnableClientState(32884); + gl10.glEnableClientState(32885); + gl10.glEnableClientState(32888); + gl10.glNormalPointer(5126, 0, (Buffer)this.mNormalVertexBuffer); + for (int i = 0; i < this.face_indecies.length; ++i) { + final int n = this.face_indecies[i]; + final float n2 = this.vertices[n * 3 + 1] * this.mScale[1] / 2.0f; + final float n3 = this.vertices[n * 3 + 2] * this.mScale[2] / 2.0f; + float n4; + float n5; + n4 = n2; + n5 = n3; + this.mVertexBuffer.put(i * 3, this.vertices[n * 3] * this.mScale[0] / 2.0f); + this.mVertexBuffer.put(i * 3 + 1, n4); + this.mVertexBuffer.put(i * 3 + 2, n5); + } + gl10.glVertexPointer(3, 5126, 0, (Buffer)this.mVertexBuffer); + gl10.glPushMatrix(); + gl10.glTranslatef(this.mOffset[0], this.mOffset[1], this.mOffset[2]); + if (b) { + gl10.glTranslatef(0.0f, this.mScale[1] / 4.0f * 3.0f, 0.0f); + gl10.glRotatef(this.mMainAngle, this.main_angle_axis[0], this.main_angle_axis[1], this.main_angle_axis[2]); + gl10.glTranslatef(0.0f, -this.mScale[1] / 4.0f * 3.0f, 0.0f); + this.mMainAngle += this.main_step_value; + if (this.mMainAngle >= this.main_max_angle) { + this.main_step_value *= -1.0f; + this.mMainAngle = this.main_max_angle; + } + else if (this.mMainAngle <= this.main_min_angle) { + this.main_step_value *= -1.0f; + this.mMainAngle = this.main_min_angle; + } + this.mSubAngle += this.sub_step_value; + if (this.mSubAngle >= this.sub_max_angle) { + this.sub_step_value *= -1.0f; + this.mSubAngle = this.sub_max_angle; + } + else if (this.mSubAngle <= this.sub_min_angle) { + this.sub_step_value *= -1.0f; + this.mSubAngle = this.sub_min_angle; + } + } + for (int j = 0; j < this.mTextureBuffers.size(); ++j) { + gl10.glTexCoordPointer(2, 5126, 0, (Buffer)this.mTextureBuffers.get(j)); + for (int k = 0; k < 10; ++k) { + gl10.glDrawArrays(6, k * 4, 4); + } + } + gl10.glPopMatrix(); + gl10.glDisable(3042); + gl10.glDisableClientState(32888); + gl10.glDisableClientState(32884); + } + + public void setZeroRun() { + this.mMainAngle = 1.5f; + this.main_step_value = 0.7f; + this.mSubAngle = 0.5f; + this.sub_step_value = -0.5f; + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/MainCube.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/MainCube.java new file mode 100644 index 00000000..6d8b9fcc --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/MainCube.java @@ -0,0 +1,110 @@ +package com.tungsten.fcllibrary.skin.body; + +import java.nio.Buffer; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.util.ArrayList; + +import javax.microedition.khronos.opengles.GL10; + +public class MainCube { + protected float[] angle_axis; + protected float[] face_vertices; + protected float mAngle; + protected FloatBuffer mNormalVertexBuffer; + protected float[] mOffset; + protected float[] mScale; + protected ArrayList mTextureBuffers; + protected FloatBuffer mVertexBuffer; + protected float max_angle; + protected float min_angle; + protected float[] normal_vertices; + protected float step_value; + + public MainCube(final float n, final float n2, final float n3, final float n4, final float n5, final float n6) { + this.mScale = new float[] { 0.0f, 0.0f, 0.0f }; + this.mOffset = new float[] { 0.0f, 0.0f, 0.0f }; + this.mAngle = 0.0f; + this.step_value = -0.15f; + this.max_angle = 3.0f; + this.min_angle = -3.0f; + this.angle_axis = new float[] { 0.0f, 0.0f, 0.0f }; + this.face_vertices = new float[] { -1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f }; + this.normal_vertices = new float[] { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f }; + this.mTextureBuffers = new ArrayList(); + this.mScale[0] = n; + this.mScale[1] = n2; + this.mScale[2] = n3; + this.mOffset[0] = n4; + this.mOffset[1] = n5; + this.mOffset[2] = n6; + for (int i = 0; i < 24; ++i) { + this.face_vertices[i * 3] = this.face_vertices[i * 3] * this.mScale[0] / 2.0f; + this.face_vertices[i * 3 + 1] = this.face_vertices[i * 3 + 1] * this.mScale[1] / 2.0f; + this.face_vertices[i * 3 + 2] = this.face_vertices[i * 3 + 2] * this.mScale[2] / 2.0f; + } + final ByteBuffer allocateDirect = ByteBuffer.allocateDirect(this.face_vertices.length * 4); + allocateDirect.order(ByteOrder.nativeOrder()); + (this.mVertexBuffer = allocateDirect.asFloatBuffer()).put(this.face_vertices); + this.mVertexBuffer.position(0); + final ByteBuffer allocateDirect2 = ByteBuffer.allocateDirect(this.normal_vertices.length * 4); + allocateDirect2.order(ByteOrder.nativeOrder()); + (this.mNormalVertexBuffer = allocateDirect2.asFloatBuffer()).put(this.normal_vertices); + this.mNormalVertexBuffer.position(0); + } + + public MainCube(final float n, final float n2, final float n3, final float n4, final float n5, final float n6, final float step_value, final float n7, final float n8, final float n9, final float max_angle, final float min_angle) { + this(n, n2, n3, n4, n5, n6); + this.step_value = step_value; + this.max_angle = max_angle; + this.min_angle = min_angle; + this.angle_axis[0] = n7; + this.angle_axis[1] = n8; + this.angle_axis[2] = n9; + } + + public FloatBuffer AddTextures(final float[] array) { + final ByteBuffer allocateDirect = ByteBuffer.allocateDirect(array.length * 4); + allocateDirect.order(ByteOrder.nativeOrder()); + final FloatBuffer floatBuffer = allocateDirect.asFloatBuffer(); + floatBuffer.put(array); + floatBuffer.position(0); + this.mTextureBuffers.add(floatBuffer); + return floatBuffer; + } + + public void ClearAllTextures() { + this.mTextureBuffers.clear(); + } + + public void draw(final GL10 gl10, final boolean b) { + gl10.glEnable(3042); + gl10.glBlendFunc(1, 771); + gl10.glEnableClientState(32884); + gl10.glEnableClientState(32885); + gl10.glEnableClientState(32888); + gl10.glVertexPointer(3, 5126, 0, (Buffer)this.mVertexBuffer); + gl10.glNormalPointer(5126, 0, (Buffer)this.mNormalVertexBuffer); + gl10.glPushMatrix(); + gl10.glTranslatef(this.mOffset[0], this.mOffset[1], this.mOffset[2]); + for (int i = 0; i < this.mTextureBuffers.size(); ++i) { + gl10.glTexCoordPointer(2, 5126, 0, (Buffer) this.mTextureBuffers.get(i)); + for (int j = 0; j < 6; ++j) { + gl10.glDrawArrays(6, j * 4, 4); + } + } + gl10.glPopMatrix(); + gl10.glDisable(3042); + gl10.glDisableClientState(32888); + gl10.glDisableClientState(32885); + gl10.glDisableClientState(32884); + } + + public void setZeroRun() { + this.mAngle = 0.0f; + this.step_value = -0.15f; + this.max_angle = 3.0f; + this.min_angle = -3.0f; + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/Body.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/Body.java new file mode 100644 index 00000000..d90d241a --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/Body.java @@ -0,0 +1,21 @@ +package com.tungsten.fcllibrary.skin.body.cube; + +import com.tungsten.fcllibrary.skin.body.MainCube; + +public class Body extends MainCube { + + protected float[] body_texcoords; + + public Body(float scale) { + super(8.0f * scale, 12.0f * scale, 4.0f * scale, 0.0f * scale, 2.0f * scale, 0.0f * scale, -0.15f, 0.0f, 1.0f, 0.0f, 3.0f, -3.0f); + this.body_texcoords = new float[] { + 0.3125f, 0.5f, 0.3125f, 0.3125f, 0.4375f, 0.3125f, 0.4375f, 0.5f, + 0.3125f, 0.3125f, 0.3125f, 0.25f, 0.4375f, 0.25f, 0.4375f, 0.3125f, + 0.4375f, 0.3125f, 0.4375f, 0.25f, 0.5625f, 0.25f, 0.5625f, 0.3125f, + 0.4375f, 0.5f, 0.4375f, 0.3125f, 0.5f, 0.3125f, 0.5f, 0.5f, + 0.25f, 0.5f, 0.25f, 0.3125f, 0.3125f, 0.3125f, 0.3125f, 0.5f, + 0.5f, 0.5f, 0.5f, 0.3125f, 0.625f, 0.3125f, 0.625f, 0.5f + }; + this.AddTextures(this.body_texcoords); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/BodyOverlay.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/BodyOverlay.java new file mode 100644 index 00000000..6bfa2f46 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/BodyOverlay.java @@ -0,0 +1,21 @@ +package com.tungsten.fcllibrary.skin.body.cube; + +import com.tungsten.fcllibrary.skin.body.MainCube; + +public class BodyOverlay extends MainCube { + + protected float[] jacket_texcoords; + + public BodyOverlay(float scale) { + super(8.470589f * scale, 12.705883f * scale, 4.2352943f * scale, 0.0f * scale, 2.0f * scale, 0.0f * scale, -0.15f, 0.0f, 1.0f, 0.0f, 3.0f, -3.0f); + this.jacket_texcoords = new float[] { + 0.3125f, 0.75f, 0.3125f, 0.5625f, 0.4375f, 0.5625f, 0.4375f, 0.75f, + 0.3125f, 0.5625f, 0.3125f, 0.5f, 0.4375f, 0.5f, 0.4375f, 0.5625f, + 0.4375f, 0.5625f, 0.4375f, 0.5f, 0.5625f, 0.5f, 0.5625f, 0.5625f, + 0.4375f, 0.75f, 0.4375f, 0.5625f, 0.5f, 0.5625f, 0.5f, 0.75f, + 0.25f, 0.75f, 0.25f, 0.5625f, 0.3125f, 0.5625f, 0.3125f, 0.75f, + 0.5f, 0.75f, 0.5f, 0.5625f, 0.625f, 0.5625f, 0.625f, 0.75f + }; + this.AddTextures(this.jacket_texcoords); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/Hat.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/Hat.java new file mode 100644 index 00000000..d89edd7c --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/Hat.java @@ -0,0 +1,21 @@ +package com.tungsten.fcllibrary.skin.body.cube; + +import com.tungsten.fcllibrary.skin.body.MainCube; + +public class Hat extends MainCube { + + protected float[] hat_texcoords; + + public Hat(float scale) { + super(9.0f * scale, 9.0f * scale, 9.0f * scale, 0.0f * scale, 12.0f * scale, 0.0f * scale, 0.25f, 0.0f, 1.0f, 0.0f, 5.0f, -5.0f); + this.hat_texcoords = new float[] { + 0.625f, 0.25f, 0.625f, 0.125f, 0.75f, 0.125f, 0.75f, 0.25f, + 0.625f, 0.125f, 0.625f, 0.0f, 0.75f, 0.0f, 0.75f, 0.125f, + 0.75f, 0.125f, 0.75f, 0.0f, 0.875f, 0.0f, 0.875f, 0.125f, + 0.75f, 0.25f, 0.75f, 0.125f, 0.875f, 0.125f, 0.875f, 0.25f, + 0.5f, 0.25f, 0.5f, 0.125f, 0.625f, 0.125f, 0.625f, 0.25f, + 0.875f, 0.25f, 0.875f, 0.125f, 1.0f, 0.125f, 1.0f, 0.25f + }; + this.AddTextures(this.hat_texcoords); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/Head.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/Head.java new file mode 100644 index 00000000..184fdfe0 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/Head.java @@ -0,0 +1,19 @@ +package com.tungsten.fcllibrary.skin.body.cube; + +import com.tungsten.fcllibrary.skin.body.MainCube; + +public class Head extends MainCube { + + protected float[] head_texcoords; + + public Head(float scale) { + super(8.0f * scale, 8.0f * scale, 8.0f * scale, 0.0f * scale, 12.0f * scale, 0.0f * scale, 0.25f, 0.0f, 1.0f, 0.0f, 5.0f, -5.0f); + this.AddTextures(this.head_texcoords = new float[] { + 0.125f, 0.25f, 0.125f, 0.125f, 0.25f, 0.125f, 0.25f, 0.25f, + 0.125f, 0.125f, 0.125f, 0.0f, 0.25f, 0.0f, 0.25f, 0.125f, + 0.25f, 0.125f, 0.25f, 0.0f, 0.375f, 0.0f, 0.375f, 0.125f, + 0.25f, 0.25f, 0.25f, 0.125f, 0.375f, 0.125f, 0.375f, 0.25f, + 0.0f, 0.25f, 0.0f, 0.125f, 0.125f, 0.125f, 0.125f, 0.25f, + 0.375f, 0.25f, 0.375f, 0.125f, 0.5f, 0.125f, 0.5f, 0.25f }); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/LLeg.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/LLeg.java new file mode 100644 index 00000000..78371ba2 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/LLeg.java @@ -0,0 +1,25 @@ +package com.tungsten.fcllibrary.skin.body.cube; + +import com.tungsten.fcllibrary.skin.body.LimbCube; + +public class LLeg extends LimbCube { + + protected float[] lleg_texcoords; + + public LLeg(float scale) { + super(4.0f * scale, 12.0f * scale, 4.0f * scale, 2.0f * scale, -10.0f * scale, 0.0f * scale, 4.5f, 1.0f, 0.0f, 0.0f, 30.0f, -30.0f, -1.5f, 30.0f, -30.0f, true, 1.0f); + this.lleg_texcoords = new float[] { + 0.3125f, 1.0f, 0.3125f, 0.90625f, 0.375f, 0.90625f, 0.375f, 1.0f, + 0.3125f, 0.90625f, 0.3125f, 0.8125f, 0.375f, 0.8125f, 0.375f, 0.90625f, + 0.3125f, 0.8125f, 0.3125f, 0.75f, 0.375f, 0.75f, 0.375f, 0.8125f, + 0.375f, 0.8125f, 0.375f, 0.75f, 0.4375f, 0.75f, 0.4375f, 0.8125f, + 0.375f, 1.0f, 0.375f, 0.90625f, 0.4375f, 0.90625f, 0.4375f, 1.0f, + 0.375f, 0.90625f, 0.375f, 0.8125f, 0.4375f, 0.8125f, 0.4375f, 0.90625f, + 0.25f, 1.0f, 0.25f, 0.90625f, 0.3125f, 0.90625f, 0.3125f, 1.0f, + 0.25f, 0.90625f, 0.25f, 0.8125f, 0.3125f, 0.8125f, 0.3125f, 0.90625f, + 0.4375f, 1.0f, 0.4375f, 0.90625f, 0.5f, 0.90625f, 0.5f, 1.0f, + 0.4375f, 0.90625f, 0.4375f, 0.8125f, 0.5f, 0.8125f, 0.5f, 0.90625f + }; + this.AddTextures(this.lleg_texcoords); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/LLegOverlay.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/LLegOverlay.java new file mode 100644 index 00000000..8e7ca763 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/LLegOverlay.java @@ -0,0 +1,25 @@ +package com.tungsten.fcllibrary.skin.body.cube; + +import com.tungsten.fcllibrary.skin.body.LimbCube; + +public class LLegOverlay extends LimbCube { + + protected float[] lleg1_texcoords; + + public LLegOverlay(float scale) { + super(4.2352943f * scale, 12.705883f * scale, 4.2352943f * scale, 2.0f * scale, -10.0f * scale, 0.0f * scale, 4.5f, 1.0f, 0.0f, 0.0f, 30.0f, -30.0f, -1.5f, 30.0f, -30.0f, true, 1.0f); + this.lleg1_texcoords = new float[] { + 0.0625f, 1.0f, 0.0625f, 0.90625f, 0.125f, 0.90625f, 0.125f, 1.0f, + 0.0625f, 0.90625f, 0.0625f, 0.8125f, 0.125f, 0.8125f, 0.125f, 0.90625f, + 0.0625f, 0.8125f, 0.0625f, 0.75f, 0.125f, 0.75f, 0.125f, 0.8125f, + 0.125f, 0.8125f, 0.125f, 0.75f, 0.1875f, 0.75f, 0.1875f, 0.8125f, + 0.125f, 1.0f, 0.125f, 0.90625f, 0.1875f, 0.90625f, 0.1875f, 1.0f, + 0.125f, 0.90625f, 0.125f, 0.8125f, 0.1875f, 0.8125f, 0.1875f, 0.90625f, + 0.0f, 1.0f, 0.0f, 0.90625f, 0.0625f, 0.90625f, 0.0625f, 1.0f, + 0.0f, 0.90625f, 0.0f, 0.8125f, 0.0625f, 0.8125f, 0.0625f, 0.90625f, + 0.1875f, 1.0f, 0.1875f, 0.90625f, 0.25f, 0.90625f, 0.25f, 1.0f, + 0.1875f, 0.90625f, 0.1875f, 0.8125f, 0.25f, 0.8125f, 0.25f, 0.90625f + }; + this.AddTextures(this.lleg1_texcoords); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/RLeg.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/RLeg.java new file mode 100644 index 00000000..a8097902 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/RLeg.java @@ -0,0 +1,25 @@ +package com.tungsten.fcllibrary.skin.body.cube; + +import com.tungsten.fcllibrary.skin.body.LimbCube; + +public class RLeg extends LimbCube { + + protected float[] rleg_texcoords; + + public RLeg(float scale) { + super(4.0f * scale, 12.0f * scale, 4.0f * scale, -2.0f * scale, -10.0f * scale, 0.0f * scale, -4.5f, 1.0f, 0.0f, 0.0f, 30.0f, -30.0f, 1.5f, 30.0f, -30.0f, true, 1.0f); + this.rleg_texcoords = new float[] { + 0.0625f, 0.5f, 0.0625f, 0.40625f, 0.125f, 0.40625f, 0.125f, 0.5f, + 0.0625f, 0.40625f, 0.0625f, 0.3125f, 0.125f, 0.3125f, 0.125f, 0.40625f, + 0.0625f, 0.3125f, 0.0625f, 0.25f, 0.125f, 0.25f, 0.125f, 0.3125f, + 0.125f, 0.3125f, 0.125f, 0.25f, 0.1875f, 0.25f, 0.1875f, 0.3125f, + 0.125f, 0.5f, 0.125f, 0.40625f, 0.1875f, 0.40625f, 0.1875f, 0.5f, + 0.125f, 0.40625f, 0.125f, 0.3125f, 0.1875f, 0.3125f, 0.1875f, 0.40625f, + 0.0f, 0.5f, 0.0f, 0.40625f, 0.0625f, 0.40625f, 0.0625f, 0.5f, + 0.0f, 0.40625f, 0.0f, 0.3125f, 0.0625f, 0.3125f, 0.0625f, 0.40625f, + 0.1875f, 0.5f, 0.1875f, 0.40625f, 0.25f, 0.40625f, 0.25f, 0.5f, + 0.1875f, 0.40625f, 0.1875f, 0.3125f, 0.25f, 0.3125f, 0.25f, 0.40625f + }; + this.AddTextures(this.rleg_texcoords); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/RLegOverlay.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/RLegOverlay.java new file mode 100644 index 00000000..57c5d357 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/RLegOverlay.java @@ -0,0 +1,25 @@ +package com.tungsten.fcllibrary.skin.body.cube; + +import com.tungsten.fcllibrary.skin.body.LimbCube; + +public class RLegOverlay extends LimbCube +{ + protected float[] rleg1_texcoords; + + public RLegOverlay(float scale) { + super(4.2352943f * scale, 12.705883f * scale, 4.2352943f * scale, -2.0f * scale, -10.0f * scale, 0.0f * scale, -4.5f, 1.0f, 0.0f, 0.0f, 30.0f, -30.0f, 1.5f, 30.0f, -30.0f, true, 1.0f); + this.rleg1_texcoords = new float[] { + 0.0625f, 0.75f, 0.0625f, 0.65625f, 0.125f, 0.65625f, 0.125f, 0.75f, + 0.0625f, 0.65625f, 0.0625f, 0.5625f, 0.125f, 0.5625f, 0.125f, 0.65625f, + 0.0625f, 0.5625f, 0.0625f, 0.5f, 0.125f, 0.5f, 0.125f, 0.5625f, + 0.125f, 0.5625f, 0.125f, 0.5f, 0.1875f, 0.5f, 0.1875f, 0.5625f, + 0.125f, 0.75f, 0.125f, 0.65625f, 0.1875f, 0.65625f, 0.1875f, 0.75f, + 0.125f, 0.65625f, 0.125f, 0.5625f, 0.1875f, 0.5625f, 0.1875f, 0.65625f, + 0.0f, 0.75f, 0.0f, 0.65625f, 0.0625f, 0.65625f, 0.0625f, 0.75f, + 0.0f, 0.65625f, 0.0f, 0.5625f, 0.0625f, 0.5625f, 0.0625f, 0.65625f, + 0.1875f, 0.75f, 0.1875f, 0.65625f, 0.25f, 0.65625f, 0.25f, 0.75f, + 0.1875f, 0.65625f, 0.1875f, 0.5625f, 0.25f, 0.5625f, 0.25f, 0.65625f + }; + this.AddTextures(this.rleg1_texcoords); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/alex/AlexLArm.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/alex/AlexLArm.java new file mode 100644 index 00000000..3d1e760f --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/alex/AlexLArm.java @@ -0,0 +1,25 @@ +package com.tungsten.fcllibrary.skin.body.cube.alex; + +import com.tungsten.fcllibrary.skin.body.LimbCube; + +public class AlexLArm extends LimbCube { + + protected float[] larm_texcoords; + + public AlexLArm(float scale) { + super(3.0f * scale, 12.0f * scale, 4.0f * scale, 5.5f * scale, 2.0f * scale, 0.0f * scale, -1.5f, 1.0f, 0.0f, 0.0f, 10.0f, -10.0f, 1.0f, 20.0f, -20.0f, true, -1.0f); + this.larm_texcoords = new float[] { + 0.5625f, 1.0f, 0.5625f, 0.90625f, 0.609375f, 0.90625f, 0.609375f, 1.0f, + 0.5625f, 0.90625f, 0.5625f, 0.8125f, 0.609375f, 0.8125f, 0.609375f, 0.90625f, + 0.5625f, 0.8125f, 0.5625f, 0.75f, 0.609375f, 0.75f, 0.609375f, 0.8125f, + 0.609375f, 0.8125f, 0.609375f, 0.75f, 0.65625f, 0.75f, 0.65625f, 0.8125f, + 0.609375f, 1.0f, 0.609375f, 0.90625f, 0.671875f, 0.90625f, 0.671875f, 1.0f, + 0.609375f, 0.90625f, 0.609375f, 0.8125f, 0.671875f, 0.8125f, 0.671875f, 0.90625f, + 0.5f, 1.0f, 0.5f, 0.90625f, 0.5625f, 0.90625f, 0.5625f, 1.0f, + 0.5f, 0.90625f, 0.5f, 0.8125f, 0.5625f, 0.8125f, 0.5625f, 0.90625f, + 0.671875f, 1.0f, 0.671875f, 0.90625f, 0.71875f, 0.90625f, 0.71875f, 1.0f, + 0.671875f, 0.90625f, 0.671875f, 0.8125f, 0.71875f, 0.8125f, 0.71875f, 0.90625f + }; + this.AddTextures(this.larm_texcoords); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/alex/AlexLArmOverlay.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/alex/AlexLArmOverlay.java new file mode 100644 index 00000000..e386ee0c --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/alex/AlexLArmOverlay.java @@ -0,0 +1,25 @@ +package com.tungsten.fcllibrary.skin.body.cube.alex; + +import com.tungsten.fcllibrary.skin.body.LimbCube; + +public class AlexLArmOverlay extends LimbCube { + + protected float[] larm1_texcoords; + + public AlexLArmOverlay(float scale) { + super(3.1764708f * scale, 12.705883f * scale, 4.2352943f * scale, 5.5f * scale, 2.0f * scale, 0.0f * scale, -1.5f, 1.0f, 0.0f, 0.0f, 10.0f, -10.0f, 1.0f, 20.0f, -20.0f, true, -1.0f); + this.larm1_texcoords = new float[] { + 0.8125f, 1.0f, 0.8125f, 0.90625f, 0.875f, 0.90625f, 0.875f, 1.0f, + 0.8125f, 0.90625f, 0.8125f, 0.8125f, 0.875f, 0.8125f, 0.875f, 0.90625f, + 0.8125f, 0.8125f, 0.8125f, 0.75f, 0.875f, 0.75f, 0.875f, 0.8125f, + 0.875f, 0.8125f, 0.875f, 0.75f, 0.9375f, 0.75f, 0.9375f, 0.8125f, + 0.875f, 1.0f, 0.875f, 0.90625f, 0.9375f, 0.90625f, 0.9375f, 1.0f, + 0.875f, 0.90625f, 0.875f, 0.8125f, 0.9375f, 0.8125f, 0.9375f, 0.90625f, + 0.75f, 1.0f, 0.75f, 0.90625f, 0.8125f, 0.90625f, 0.8125f, 1.0f, + 0.75f, 0.90625f, 0.75f, 0.8125f, 0.8125f, 0.8125f, 0.8125f, 0.90625f, + 0.9375f, 1.0f, 0.9375f, 0.90625f, 1.0f, 0.90625f, 1.0f, 1.0f, + 0.9375f, 0.90625f, 0.9375f, 0.8125f, 1.0f, 0.8125f, 1.0f, 0.90625f + }; + this.AddTextures(this.larm1_texcoords); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/alex/AlexRArm.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/alex/AlexRArm.java new file mode 100644 index 00000000..e4fbd5c4 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/alex/AlexRArm.java @@ -0,0 +1,25 @@ +package com.tungsten.fcllibrary.skin.body.cube.alex; + +import com.tungsten.fcllibrary.skin.body.LimbCube; + +public class AlexRArm extends LimbCube { + + protected float[] rarm_texcoords; + + public AlexRArm(float scale) { + super(3.0f * scale, 12.0f * scale, 4.0f * scale, -5.5f * scale, 2.0f * scale, 0.0f * scale, 1.5f, 1.0f, 0.0f, 0.0f, 10.0f, -10.0f, -1.0f, 20.0f, -20.0f, true, -1.0f); + this.rarm_texcoords = new float[] { + 0.6875f, 0.5f, 0.6875f, 0.40625f, 0.734375f, 0.40625f, 0.734375f, 0.5f, + 0.6875f, 0.40625f, 0.6875f, 0.3125f, 0.734375f, 0.3125f, 0.734375f, 0.40625f, + 0.6875f, 0.3125f, 0.6875f, 0.25f, 0.734375f, 0.25f, 0.734375f, 0.3125f, + 0.734375f, 0.3125f, 0.734375f, 0.25f, 0.78125f, 0.25f, 0.78125f, 0.3125f, + 0.734375f, 0.5f, 0.734375f, 0.40625f, 0.796875f, 0.40625f, 0.796875f, 0.5f, + 0.734375f, 0.40625f, 0.734375f, 0.3125f, 0.796875f, 0.3125f, 0.796875f, 0.40625f, + 0.625f, 0.5f, 0.625f, 0.40625f, 0.6875f, 0.40625f, 0.6875f, 0.5f, + 0.625f, 0.40625f, 0.625f, 0.3125f, 0.6875f, 0.3125f, 0.6875f, 0.40625f, + 0.796875f, 0.5f, 0.796875f, 0.40625f, 0.84375f, 0.40625f, 0.84375f, 0.5f, + 0.796875f, 0.40625f, 0.796875f, 0.3125f, 0.84375f, 0.3125f, 0.84375f, 0.40625f + }; + this.AddTextures(this.rarm_texcoords); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/alex/AlexRArmOverlay.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/alex/AlexRArmOverlay.java new file mode 100644 index 00000000..3e450ab9 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/alex/AlexRArmOverlay.java @@ -0,0 +1,25 @@ +package com.tungsten.fcllibrary.skin.body.cube.alex; + +import com.tungsten.fcllibrary.skin.body.LimbCube; + +public class AlexRArmOverlay extends LimbCube { + + protected float[] rarm1_texcoords; + + public AlexRArmOverlay(float scale) { + super(3.1764708f * scale, 12.705883f * scale, 4.2352943f * scale, -5.5f * scale, 2.0f * scale, 0.0f * scale, 1.5f, 1.0f, 0.0f, 0.0f, 10.0f, -10.0f, -1.0f, 20.0f, -20.0f, true, -1.0f); + this.rarm1_texcoords = new float[] { + 0.6875f, 0.75f, 0.6875f, 0.65625f, 0.734375f, 0.65625f, 0.734375f, 0.75f, + 0.6875f, 0.65625f, 0.6875f, 0.5625f, 0.734375f, 0.5625f, 0.734375f, 0.65625f, + 0.6875f, 0.5625f, 0.6875f, 0.5f, 0.734375f, 0.5f, 0.734375f, 0.5625f, + 0.734375f, 0.5625f, 0.734375f, 0.5f, 0.78125f, 0.5f, 0.78125f, 0.5625f, + 0.734375f, 0.75f, 0.734375f, 0.65625f, 0.796875f, 0.65625f, 0.796875f, 0.75f, + 0.734375f, 0.65625f, 0.734375f, 0.5625f, 0.796875f, 0.5625f, 0.796875f, 0.65625f, + 0.625f, 0.75f, 0.625f, 0.65625f, 0.6875f, 0.65625f, 0.6875f, 0.75f, + 0.625f, 0.65625f, 0.625f, 0.5625f, 0.6875f, 0.5625f, 0.6875f, 0.65625f, + 0.796875f, 1.0f, 0.796875f, 0.90625f, 0.84375f, 0.90625f, 0.84375f, 1.0f, + 0.796875f, 0.90625f, 0.796875f, 0.8125f, 0.84375f, 0.8125f, 0.84375f, 0.90625f + }; + this.AddTextures(this.rarm1_texcoords); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/steve/LArm.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/steve/LArm.java new file mode 100644 index 00000000..9519c243 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/steve/LArm.java @@ -0,0 +1,25 @@ +package com.tungsten.fcllibrary.skin.body.cube.steve; + +import com.tungsten.fcllibrary.skin.body.LimbCube; + +public class LArm extends LimbCube { + + protected float[] larm_texcoords; + + public LArm(float scale) { + super(4.0f * scale, 12.0f * scale, 4.0f * scale, 6.0f * scale, 2.0f * scale, 0.0f * scale, -1.5f, 1.0f, 0.0f, 0.0f, 10.0f, -10.0f, 1.0f, 20.0f, -20.0f, true, -1.0f); + this.larm_texcoords = new float[] { + 0.5625f, 1.0f, 0.5625f, 0.90625f, 0.625f, 0.90625f, 0.625f, 1.0f, + 0.5625f, 0.90625f, 0.5625f, 0.8125f, 0.625f, 0.8125f, 0.625f, 0.90625f, + 0.5625f, 0.8125f, 0.5625f, 0.75f, 0.625f, 0.75f, 0.625f, 0.8125f, + 0.625f, 0.8125f, 0.625f, 0.75f, 0.6875f, 0.75f, 0.6875f, 0.8125f, + 0.625f, 1.0f, 0.625f, 0.90625f, 0.6875f, 0.90625f, 0.6875f, 1.0f, + 0.625f, 0.90625f, 0.625f, 0.8125f, 0.6875f, 0.8125f, 0.6875f, 0.90625f, + 0.5f, 1.0f, 0.5f, 0.90625f, 0.5625f, 0.90625f, 0.5625f, 1.0f, + 0.5f, 0.90625f, 0.5f, 0.8125f, 0.5625f, 0.8125f, 0.5625f, 0.90625f, + 0.6875f, 1.0f, 0.6875f, 0.90625f, 0.75f, 0.90625f, 0.75f, 1.0f, + 0.6875f, 0.90625f, 0.6875f, 0.8125f, 0.75f, 0.8125f, 0.75f, 0.90625f + }; + this.AddTextures(this.larm_texcoords); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/steve/LArmOverlay.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/steve/LArmOverlay.java new file mode 100644 index 00000000..d84e2c76 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/steve/LArmOverlay.java @@ -0,0 +1,25 @@ +package com.tungsten.fcllibrary.skin.body.cube.steve; + +import com.tungsten.fcllibrary.skin.body.LimbCube; + +public class LArmOverlay extends LimbCube { + + protected float[] larm1_texcoords; + + public LArmOverlay(float scale) { + super(4.2352943f * scale, 12.705883f * scale, 4.2352943f * scale, 6.0f * scale, 2.0f * scale, 0.0f * scale, -1.5f, 1.0f, 0.0f, 0.0f, 10.0f, -10.0f, 1.0f, 20.0f, -20.0f, true, -1.0f); + this.larm1_texcoords = new float[] { + 0.8125f, 1.0f, 0.8125f, 0.90625f, 0.875f, 0.90625f, 0.875f, 1.0f, + 0.8125f, 0.90625f, 0.8125f, 0.8125f, 0.875f, 0.8125f, 0.875f, 0.90625f, + 0.8125f, 0.8125f, 0.8125f, 0.75f, 0.875f, 0.75f, 0.875f, 0.8125f, + 0.875f, 0.8125f, 0.875f, 0.75f, 0.9375f, 0.75f, 0.9375f, 0.8125f, + 0.875f, 1.0f, 0.875f, 0.90625f, 0.9375f, 0.90625f, 0.9375f, 1.0f, + 0.875f, 0.90625f, 0.875f, 0.8125f, 0.9375f, 0.8125f, 0.9375f, 0.90625f, + 0.75f, 1.0f, 0.75f, 0.90625f, 0.8125f, 0.90625f, 0.8125f, 1.0f, + 0.75f, 0.90625f, 0.75f, 0.8125f, 0.8125f, 0.8125f, 0.8125f, 0.90625f, + 0.9375f, 1.0f, 0.9375f, 0.90625f, 1.0f, 0.90625f, 1.0f, 1.0f, + 0.9375f, 0.90625f, 0.9375f, 0.8125f, 1.0f, 0.8125f, 1.0f, 0.90625f + }; + this.AddTextures(this.larm1_texcoords); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/steve/RArm.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/steve/RArm.java new file mode 100644 index 00000000..5b30218d --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/steve/RArm.java @@ -0,0 +1,25 @@ +package com.tungsten.fcllibrary.skin.body.cube.steve; + +import com.tungsten.fcllibrary.skin.body.LimbCube; + +public class RArm extends LimbCube { + + protected float[] rarm_texcoords; + + public RArm(float scale) { + super(4.0f * scale, 12.0f * scale, 4.0f * scale, -6.0f * scale, 2.0f * scale, 0.0f * scale, 1.5f, 1.0f, 0.0f, 0.0f, 10.0f, -10.0f, -1.0f, 20.0f, -20.0f, true, -1.0f); + this.rarm_texcoords = new float[] { + 0.6875f, 0.5f, 0.6875f, 0.40625f, 0.75f, 0.40625f, 0.75f, 0.5f, + 0.6875f, 0.40625f, 0.6875f, 0.3125f, 0.75f, 0.3125f, 0.75f, 0.40625f, + 0.6875f, 0.3125f, 0.6875f, 0.25f, 0.75f, 0.25f, 0.75f, 0.3125f, + 0.75f, 0.3125f, 0.75f, 0.25f, 0.8125f, 0.25f, 0.8125f, 0.3125f, + 0.75f, 0.5f, 0.75f, 0.40625f, 0.8125f, 0.40625f, 0.8125f, 0.5f, + 0.75f, 0.40625f, 0.75f, 0.3125f, 0.8125f, 0.3125f, 0.8125f, 0.40625f, + 0.625f, 0.5f, 0.625f, 0.40625f, 0.6875f, 0.40625f, 0.6875f, 0.5f, + 0.625f, 0.40625f, 0.625f, 0.3125f, 0.6875f, 0.3125f, 0.6875f, 0.40625f, + 0.8125f, 0.5f, 0.8125f, 0.40625f, 0.875f, 0.40625f, 0.875f, 0.5f, + 0.8125f, 0.40625f, 0.8125f, 0.3125f, 0.875f, 0.3125f, 0.875f, 0.40625f + }; + this.AddTextures(this.rarm_texcoords); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/steve/RArmOverlay.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/steve/RArmOverlay.java new file mode 100644 index 00000000..9ea62081 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/body/cube/steve/RArmOverlay.java @@ -0,0 +1,25 @@ +package com.tungsten.fcllibrary.skin.body.cube.steve; + +import com.tungsten.fcllibrary.skin.body.LimbCube; + +public class RArmOverlay extends LimbCube { + + protected float[] rarm1_texcoords; + + public RArmOverlay(float scale) { + super(4.2352943f * scale, 12.705883f * scale, 4.2352943f * scale, -6.0f * scale, 2.0f * scale, 0.0f * scale, 1.5f, 1.0f, 0.0f, 0.0f, 10.0f, -10.0f, -1.0f, 20.0f, -20.0f, true, -1.0f); + this.rarm1_texcoords = new float[] { + 0.6875f, 0.75f, 0.6875f, 0.65625f, 0.75f, 0.65625f, 0.75f, 0.75f, + 0.6875f, 0.65625f, 0.6875f, 0.5625f, 0.75f, 0.5625f, 0.75f, 0.65625f, + 0.6875f, 0.5625f, 0.6875f, 0.5f, 0.75f, 0.5f, 0.75f, 0.5625f, + 0.75f, 0.5625f, 0.75f, 0.5f, 0.8125f, 0.5f, 0.8125f, 0.5625f, + 0.75f, 0.75f, 0.75f, 0.65625f, 0.8125f, 0.65625f, 0.8125f, 0.75f, + 0.75f, 0.65625f, 0.75f, 0.5625f, 0.8125f, 0.5625f, 0.8125f, 0.65625f, + 0.625f, 0.75f, 0.625f, 0.65625f, 0.6875f, 0.65625f, 0.6875f, 0.75f, + 0.625f, 0.65625f, 0.625f, 0.5625f, 0.6875f, 0.5625f, 0.6875f, 0.65625f, + 0.8125f, 0.75f, 0.8125f, 0.65625f, 0.875f, 0.65625f, 0.875f, 0.75f, + 0.8125f, 0.65625f, 0.8125f, 0.5625f, 0.875f, 0.5625f, 0.875f, 0.65625f + }; + this.AddTextures(this.rarm1_texcoords); + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/cape/CapeCube.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/cape/CapeCube.java new file mode 100644 index 00000000..1da97d39 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/cape/CapeCube.java @@ -0,0 +1,112 @@ +package com.tungsten.fcllibrary.skin.cape; + +import java.nio.Buffer; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import java.util.ArrayList; + +import javax.microedition.khronos.opengles.GL10; + +public class CapeCube { + protected float[] angle_axis; + protected float[] face_vertices; + protected float mAngle; + protected FloatBuffer mNormalVertexBuffer; + protected float[] mOffset; + protected float[] mScale; + protected ArrayList mTextureBuffers; + protected FloatBuffer mVertexBuffer; + protected float max_angle; + protected float min_angle; + protected float[] normal_vertices; + protected float step_value; + + public CapeCube(final float n, final float n2, final float n3, final float n4, final float n5, final float n6) { + this.mScale = new float[] { 0.0f, 0.0f, 0.0f }; + this.mOffset = new float[] { 0.0f, 0.0f, 0.0f }; + this.mAngle = 0.0f; + this.step_value = -0.15f; + this.max_angle = 3.0f; + this.min_angle = -3.0f; + this.angle_axis = new float[] { 0.0f, 0.0f, 0.0f }; + this.face_vertices = new float[] { -1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, -1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, 1.0f, -1.0f, -1.0f, 1.0f, -1.0f, -1.0f, -1.0f, -1.0f }; + this.normal_vertices = new float[] { 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, -1.0f }; + this.mTextureBuffers = new ArrayList(); + this.mScale[0] = n; + this.mScale[1] = n2; + this.mScale[2] = n3; + this.mOffset[0] = n4; + this.mOffset[1] = n5; + this.mOffset[2] = n6; + for (int i = 0; i < 24; ++i) { + this.face_vertices[i * 3] = this.face_vertices[i * 3] * this.mScale[0] / 2.0f; + this.face_vertices[i * 3 + 1] = this.face_vertices[i * 3 + 1] * this.mScale[1] / 2.0f; + this.face_vertices[i * 3 + 2] = this.face_vertices[i * 3 + 2] * this.mScale[2] / 2.0f; + } + final ByteBuffer allocateDirect = ByteBuffer.allocateDirect(this.face_vertices.length * 4); + allocateDirect.order(ByteOrder.nativeOrder()); + (this.mVertexBuffer = allocateDirect.asFloatBuffer()).put(this.face_vertices); + this.mVertexBuffer.position(0); + final ByteBuffer allocateDirect2 = ByteBuffer.allocateDirect(this.normal_vertices.length * 4); + allocateDirect2.order(ByteOrder.nativeOrder()); + (this.mNormalVertexBuffer = allocateDirect2.asFloatBuffer()).put(this.normal_vertices); + this.mNormalVertexBuffer.position(0); + } + + public CapeCube(final float n, final float n2, final float n3, final float n4, final float n5, final float n6, final float step_value, final float n7, final float n8, final float n9, final float max_angle, final float min_angle) { + this(n, n2, n3, n4, n5, n6); + this.step_value = step_value; + this.max_angle = max_angle; + this.min_angle = min_angle; + this.angle_axis[0] = n7; + this.angle_axis[1] = n8; + this.angle_axis[2] = n9; + } + + public FloatBuffer AddTextures(final float[] array) { + final ByteBuffer allocateDirect = ByteBuffer.allocateDirect(array.length * 4); + allocateDirect.order(ByteOrder.nativeOrder()); + final FloatBuffer floatBuffer = allocateDirect.asFloatBuffer(); + floatBuffer.put(array); + floatBuffer.position(0); + this.mTextureBuffers.add(floatBuffer); + return floatBuffer; + } + + public void ClearAllTextures() { + this.mTextureBuffers.clear(); + } + + public void draw(final GL10 gl10, final boolean b) { + gl10.glEnable(3042); + gl10.glBlendFunc(1, 771); + gl10.glEnableClientState(32884); + gl10.glEnableClientState(32885); + gl10.glEnableClientState(32888); + gl10.glVertexPointer(3, 5126, 0, (Buffer)this.mVertexBuffer); + gl10.glNormalPointer(5126, 0, (Buffer)this.mNormalVertexBuffer); + gl10.glPushMatrix(); + gl10.glTranslatef(this.mOffset[0], this.mOffset[1], this.mOffset[2]); + gl10.glTranslatef(0.0f, this.mScale[1] / 4.0f * 3.0f, 0.0f); + gl10.glRotatef(12f, 1f, 0f, 0f); + gl10.glTranslatef(0.0f, -this.mScale[1] / 4.0f * 3.0f, 0.0f); + for (int i = 0; i < this.mTextureBuffers.size(); ++i) { + gl10.glTexCoordPointer(2, 5126, 0, (Buffer)this.mTextureBuffers.get(i)); + for (int j = 0; j < 6; ++j) { + gl10.glDrawArrays(6, j * 4, 4); + } + } + gl10.glPopMatrix(); + gl10.glDisable(3042); + gl10.glDisableClientState(32888); + gl10.glDisableClientState(32884); + } + + public void setZeroRun() { + this.mAngle = 0.0f; + this.step_value = -0.15f; + this.max_angle = 3.0f; + this.min_angle = -3.0f; + } +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/cape/CapePart.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/cape/CapePart.java new file mode 100644 index 00000000..82291c84 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/cape/CapePart.java @@ -0,0 +1,83 @@ +package com.tungsten.fcllibrary.skin.cape; + +public enum CapePart { + + CAPE(0, "Cape", new CapePartSection[] { CapeSkin.FRONT.getCapePartSection(), CapeSkin.RIGHT.getCapePartSection(), CapeSkin.BACK.getCapePartSection(), CapeSkin.LEFT.getCapePartSection(), CapeSkin.TOP.getCapePartSection(), CapeSkin.BOTTOM.getCapePartSection() }); + + private CapePartSection[] capeParts; + private String displayName; + private int id; + + private CapePart(final int id, final String displayName, final CapePartSection[] capeParts) { + this.id = id; + this.displayName = displayName; + this.capeParts = capeParts; + } + + CapePartSection getCapePartSection(final int n) { + return this.capeParts[n]; + } + + String getDisplayName() { + return this.displayName; + } + + int getPartId() { + return this.id; + } + + public enum CapeSkin + { + BACK("BACK", 2, 2, "Back", 1, 1, 10, 16), + BOTTOM("BOTTOM", 5, 5, "Bottom", 11, 0, 10, 1), + FRONT("FRONT", 0, 0, "Front", 12, 1, 10, 16), + LEFT("LEFT", 3, 3, "Left", 0, 1, 1, 16), + RIGHT("RIGHT", 1, 1, "Right", 11, 1, 1, 16), + TOP("TOP", 4, 4, "Top", 1, 0, 10, 1); + + private String displayName; + private int height; + private int id; + private int startX; + private int startY; + private int width; + + private CapeSkin(final String s2, final int n2, final int id, final String displayName, final int startX, final int startY, final int width, final int height) { + this.id = id; + this.width = width; + this.height = height; + this.displayName = displayName; + this.startX = startX; + this.startY = startY; + } + + CapePartSection getCapePartSection() { + return new CapePartSection("Cape", this.displayName, this.startX, this.startY, this.width, this.height); + } + + String getDisplayName() { + return this.displayName; + } + + int getHeight() { + return this.height; + } + + int getPartId() { + return this.id; + } + + int getStartX() { + return this.startX; + } + + int getStartY() { + return this.startY; + } + + int getWidth() { + return this.width; + } + } + +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/cape/CapePartSection.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/cape/CapePartSection.java new file mode 100644 index 00000000..8d290795 --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/cape/CapePartSection.java @@ -0,0 +1,45 @@ +package com.tungsten.fcllibrary.skin.cape; + +public class CapePartSection { + + String capePartName; + int height; + String sideName; + int startX; + int startY; + int width; + + public CapePartSection(final String capePartName, final String sideName, final int startX, final int startY, final int width, final int height) { + this.capePartName = capePartName; + this.sideName = sideName; + this.startX = startX; + this.startY = startY; + this.width = width; + this.height = height; + } + + public String getCapePartName() { + return this.capePartName; + } + + public int getHeight() { + return this.height; + } + + public String getSideName() { + return this.sideName; + } + + public int getStartX() { + return this.startX; + } + + public int getStartY() { + return this.startY; + } + + public int getWidth() { + return this.width; + } + +} diff --git a/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/cape/cube/Cape.java b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/cape/cube/Cape.java new file mode 100644 index 00000000..9b9feeef --- /dev/null +++ b/FCLLibrary/src/main/java/com/tungsten/fcllibrary/skin/cape/cube/Cape.java @@ -0,0 +1,22 @@ +package com.tungsten.fcllibrary.skin.cape.cube; + +import com.tungsten.fcllibrary.skin.cape.CapeCube; + +public class Cape extends CapeCube { + + protected float[] cape_texcoords; + + public Cape(float scale) { + super(10.0f * scale, 16.0f * scale, scale, 0.0f * scale, 0.0f * scale, -1.75f * scale, -0.15f * scale, 0.0f, 1.0f, 0.0f, 3.0f, -3.0f); + this.cape_texcoords = new float[] { + 0.1875f, 0.53125f, 0.1875f, 0.03125f, 0.34375f, 0.03125f, 0.34375f, 0.53125f, + 0.015625f, 0.03125f, 0.015625f, 0f, 0.171875f, 0f, 0.171875f, 0.03125f, + 0.171875f, 0.03125f, 0.171875f, 0f, 0.328125f, 0f, 0.328125f, 0.03125f, + 0f, 0.53125f, 0f, 0.03125f, 0.015625f, 0.03125f, 0.015625f, 0.53125f, + 0.171875f, 0.53125f, 0.171875f, 0.03125f, 0.1875f, 0.03125f, 0.1875f, 0.53125f, + 0.015625f, 0.53125f, 0.015625f, 0.03125f, 0.171875f, 0.03125f, 0.171875f, 0.53125f + }; + this.AddTextures(this.cape_texcoords); + } + +} diff --git a/FCLLibrary/src/main/res/anim/ui_hide.xml b/FCLLibrary/src/main/res/anim/ui_hide.xml index b5e7284b..0f568efc 100644 --- a/FCLLibrary/src/main/res/anim/ui_hide.xml +++ b/FCLLibrary/src/main/res/anim/ui_hide.xml @@ -1,11 +1,11 @@