Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Deficuet authored and Deficuet committed Jan 2, 2024
1 parent 4d2c50e commit 034247c
Show file tree
Hide file tree
Showing 250 changed files with 11,722 additions and 9,266 deletions.
11 changes: 7 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm' version '1.7.20'
id 'org.jetbrains.kotlin.jvm' version '1.8.21'
id 'maven-publish'
}

Expand All @@ -9,16 +9,19 @@ version '0.0.1'

repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-reflect"
implementation "org.jetbrains.kotlin:kotlin-stdlib"
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7'
implementation 'org.json:json:20220924'
implementation 'org.json:json:20230618'
implementation 'org.lz4:lz4-java:1.8.0'
implementation 'com.nixxcode.jvmbrotli:jvmbrotli:0.2.0'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0'
implementation 'com.github.Deficuet:JImageUtils:0.0.3.a'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.2'
}

test {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.deficuet.unitykt.extension;

import io.github.deficuet.unitykt.util.NativeUtils;
import io.github.deficuet.unitykt.internal.NativeUtils;

public final class TextureDecoder {
private TextureDecoder() { }
Expand All @@ -9,7 +9,7 @@ private TextureDecoder() { }
try {
System.loadLibrary("TextureDecoder");
} catch (UnsatisfiedLinkError e) {
NativeUtils.Companion.loadLibraryFromJar("TextureDecoder.dll");
NativeUtils.Companion.loadLibraryFromJar("TextureDecoder", "dll");
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package io.github.deficuet.unitykt.internal.impl;

import io.github.deficuet.unitykt.classes.AnimationType;
import io.github.deficuet.unitykt.internal.file.ObjectInfo;
import io.github.deficuet.unitykt.internal.file.SerializedFile;
import kotlin.UInt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

abstract class AnimationClipFields extends NamedObjectImpl {
AnimationClipFields(@NotNull SerializedFile assetFile, @NotNull ObjectInfo info) {
super(assetFile, info);
}

AnimationType fmAnimationType;
Boolean fmLegacy;
Boolean fmCompressed;
Boolean fmUseHighQualityCurve;
QuaternionCurveImpl[] fmRotationCurves;
CompressedAnimationCurveImpl[] fmCompressedRotationCurves;
Vector3CurveImpl[] fmEulerCurves;
Vector3CurveImpl[] fmPositionCurves;
Vector3CurveImpl[] fmScaleCurves;
FloatCurveImpl[] fmFloatCurves;
PPtrCurveImpl[] fmPPtrCurves;
Float fmSampleRate;
Integer fmWrapMode;
@Nullable AABBImpl fmBounds;
UInt fmMuscleClipSize;
@Nullable ClipMuscleConstantImpl fmMuscleClip;
@Nullable AnimationClipBindingConstantImpl fmClipBindingConstant;
AnimationEventImpl[] fmEvents;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package io.github.deficuet.unitykt.internal.impl;

import io.github.deficuet.unitykt.classes.AnimationClip;
import io.github.deficuet.unitykt.classes.PPtr;
import io.github.deficuet.unitykt.internal.file.ObjectInfo;
import io.github.deficuet.unitykt.internal.file.SerializedFile;
import org.jetbrains.annotations.NotNull;

abstract class AnimationFields extends BehaviourImpl {
AnimationFields(@NotNull SerializedFile assetFile, @NotNull ObjectInfo info) {
super(assetFile, info);
}

PPtr<AnimationClip>[] fmAnimations;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package io.github.deficuet.unitykt.internal.impl;

import io.github.deficuet.unitykt.classes.AnimationClip;
import io.github.deficuet.unitykt.classes.ControllerConstant;
import io.github.deficuet.unitykt.classes.PPtr;
import io.github.deficuet.unitykt.internal.file.ObjectInfo;
import io.github.deficuet.unitykt.internal.file.SerializedFile;
import kotlin.UInt;
import org.jetbrains.annotations.NotNull;

import java.util.List;
import java.util.Map;

abstract class AnimatorControllerFields extends RuntimeAnimatorControllerImpl {
AnimatorControllerFields(@NotNull SerializedFile assetFile, @NotNull ObjectInfo info) {
super(assetFile, info);
}

UInt fmControllerSize;
ControllerConstant fmController;
Map<UInt, List<String>> fmTOS;
PPtr<AnimationClip>[] fmAnimationClip;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package io.github.deficuet.unitykt.internal.impl;

import io.github.deficuet.unitykt.classes.Avatar;
import io.github.deficuet.unitykt.classes.PPtr;
import io.github.deficuet.unitykt.classes.RuntimeAnimatorController;
import io.github.deficuet.unitykt.internal.file.ObjectInfo;
import io.github.deficuet.unitykt.internal.file.SerializedFile;
import org.jetbrains.annotations.NotNull;

abstract class AnimatorFields extends BehaviourImpl {
AnimatorFields(@NotNull SerializedFile assetFile, @NotNull ObjectInfo info) {
super(assetFile, info);
}

PPtr<Avatar> fmAvatar;
PPtr<RuntimeAnimatorController> fmController;
Boolean fmHasTransformHierarchy;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package io.github.deficuet.unitykt.internal.impl;

import io.github.deficuet.unitykt.classes.AnimationClipOverride;
import io.github.deficuet.unitykt.classes.PPtr;
import io.github.deficuet.unitykt.classes.RuntimeAnimatorController;
import io.github.deficuet.unitykt.internal.file.ObjectInfo;
import io.github.deficuet.unitykt.internal.file.SerializedFile;
import org.jetbrains.annotations.NotNull;

abstract class AnimatorOverrideControllerFields extends RuntimeAnimatorControllerImpl {
AnimatorOverrideControllerFields(@NotNull SerializedFile assetFile, @NotNull ObjectInfo info) {
super(assetFile, info);
}

PPtr<RuntimeAnimatorController> fmController;
AnimationClipOverride[] fmClips;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package io.github.deficuet.unitykt.internal.impl;

import io.github.deficuet.unitykt.classes.AssetInfo;
import io.github.deficuet.unitykt.classes.PPtr;
import io.github.deficuet.unitykt.classes.UnityObject;
import io.github.deficuet.unitykt.internal.file.ObjectInfo;
import io.github.deficuet.unitykt.internal.file.SerializedFile;
import kotlin.UInt;
import org.jetbrains.annotations.NotNull;

import java.util.List;
import java.util.Map;

abstract class AssetBundleFields extends NamedObjectImpl {
AssetBundleFields(@NotNull SerializedFile assetFile, @NotNull ObjectInfo info) {
super(assetFile, info);
}

PPtr<UnityObject>[] fmPreloadTable;
Map<String, List<AssetInfo>> fmContainer;
AssetInfo fmMainAsset;
UInt fmRuntimeCompatibility;
String fmAssetBundleName;
String[] fmDependencies;
Boolean fmIsStreamedSceneAssetBundle;
Integer fmExplicitDataLayout;
Integer fmPathFlags;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package io.github.deficuet.unitykt.internal.impl;

import io.github.deficuet.unitykt.classes.AudioCompressionFormat;
import io.github.deficuet.unitykt.classes.FMODSoundType;
import io.github.deficuet.unitykt.internal.file.ObjectInfo;
import io.github.deficuet.unitykt.internal.file.SerializedFile;
import io.github.deficuet.unitykt.util.ResourceReader;
import org.jetbrains.annotations.NotNull;

abstract class AudioClipFields extends NamedObjectImpl {
AudioClipFields(@NotNull SerializedFile assetFile, @NotNull ObjectInfo info) {
super(assetFile, info);
}

Integer fmFormat;
FMODSoundType fmType;
Boolean fm3D;
Boolean fmUseHardware;
Integer fmLoadType;
Integer fmChannels;
Integer fmFrequency;
Integer fmBitsPerSample;
Float fmLength;
Boolean fmIsTrackerFormat;
Integer fmSubSoundIndex;
Boolean fmPreloadAudioData;
Boolean fmLoadInBackground;
Boolean fmLegacy3D;
AudioCompressionFormat fmCompressionFormat;
String fmSource;
Long fmOffset;
Long fmSize;
ResourceReader pfAudioData;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package io.github.deficuet.unitykt.internal.impl;

import io.github.deficuet.unitykt.classes.AvatarConstant;
import io.github.deficuet.unitykt.internal.file.ObjectInfo;
import io.github.deficuet.unitykt.internal.file.SerializedFile;
import kotlin.UInt;
import org.jetbrains.annotations.NotNull;

import java.util.List;
import java.util.Map;

abstract class AvatarFields extends NamedObjectImpl {
AvatarFields(@NotNull SerializedFile assetFile, @NotNull ObjectInfo info) {
super(assetFile, info);
}

UInt fmAvatarSize;
AvatarConstant fmAvatar;
Map<UInt, List<String>> fmTOS;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package io.github.deficuet.unitykt.internal.impl;

import io.github.deficuet.unitykt.internal.file.ObjectInfo;
import io.github.deficuet.unitykt.internal.file.SerializedFile;
import org.jetbrains.annotations.NotNull;

abstract class BehaviourFields extends ComponentImpl {
BehaviourFields(@NotNull SerializedFile assetFile, @NotNull ObjectInfo info) {
super(assetFile, info);
}

Byte fmEnabled;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io.github.deficuet.unitykt.internal.impl;

import io.github.deficuet.unitykt.classes.PPtr;
import io.github.deficuet.unitykt.classes.UnityObject;
import io.github.deficuet.unitykt.internal.file.ObjectInfo;
import io.github.deficuet.unitykt.internal.file.SerializedFile;
import org.jetbrains.annotations.NotNull;

abstract class CanvasFields extends BehaviourImpl {
CanvasFields(@NotNull SerializedFile assetFile, @NotNull ObjectInfo info) {
super(assetFile, info);
}

Integer fmRenderMode;
PPtr<UnityObject> fmCamera;
Float fmPlaneDistance;
Boolean fmPixelPerfect;
Boolean fmReceivesEvent;
Boolean fmOverrideSorting;
Boolean fmOverridePixelPerfect;
Float fmSortingBucketNormalizedSize;
Integer fmAdditionalShaderChannelsFlag;
Integer fmSortingLayerID;
Short fmSortingOrder;
Byte fmTargetDisplay;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package io.github.deficuet.unitykt.internal.impl;

import io.github.deficuet.unitykt.classes.GameObject;
import io.github.deficuet.unitykt.classes.PPtr;
import io.github.deficuet.unitykt.internal.file.ObjectInfo;
import io.github.deficuet.unitykt.internal.file.SerializedFile;
import org.jetbrains.annotations.NotNull;

abstract class ComponentFields extends EditorExtensionImpl {
ComponentFields(@NotNull SerializedFile assetFile, @NotNull ObjectInfo info) {
super(assetFile, info);
}

PPtr<GameObject> fmGameObject;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package io.github.deficuet.unitykt.internal.impl;

import io.github.deficuet.unitykt.internal.file.ObjectInfo;
import io.github.deficuet.unitykt.internal.file.SerializedFile;
import org.jetbrains.annotations.NotNull;

abstract class EditorExtensionFields extends UnityObjectImpl {
EditorExtensionFields(@NotNull SerializedFile assetFile, @NotNull ObjectInfo info) {
super(assetFile, info);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package io.github.deficuet.unitykt.internal.impl;

import io.github.deficuet.unitykt.classes.*;
import io.github.deficuet.unitykt.internal.file.ObjectInfo;
import io.github.deficuet.unitykt.internal.file.SerializedFile;
import kotlin.UInt;
import kotlin.UShort;
import org.jetbrains.annotations.NotNull;

abstract class GameObjectFields extends EditorExtensionImpl {
GameObjectFields(@NotNull SerializedFile assetFile, @NotNull ObjectInfo info) {
super(assetFile, info);
}

PPtr<Component>[] fmComponents;
UInt fmLayer;
String fmName;
UShort fmTag;
Boolean fmIsActive;
Transform fmTransform;
MeshRenderer fmMeshRenderer;
MeshFilter fmMeshFilter;
SkinnedMeshRenderer fmSkinnedMeshRenderer;
Animator fmAnimator;
Animation fmAnimation;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package io.github.deficuet.unitykt.internal.impl;

import io.github.deficuet.unitykt.classes.PPtr;
import io.github.deficuet.unitykt.classes.Shader;
import io.github.deficuet.unitykt.classes.UnityPropertySheet;
import io.github.deficuet.unitykt.internal.file.ObjectInfo;
import io.github.deficuet.unitykt.internal.file.SerializedFile;
import org.jetbrains.annotations.NotNull;

abstract class MaterialFields extends NamedObjectImpl {
MaterialFields(@NotNull SerializedFile assetFile, @NotNull ObjectInfo info) {
super(assetFile, info);
}

PPtr<Shader> fmShader;
UnityPropertySheet fmSavedProperties;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package io.github.deficuet.unitykt.internal.impl;

import io.github.deficuet.unitykt.internal.file.ObjectInfo;
import io.github.deficuet.unitykt.internal.file.SerializedFile;
import io.github.deficuet.unitykt.math.Matrix4x4;
import kotlin.UInt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

abstract class MeshFields extends NamedObjectImpl {
MeshFields(@NotNull SerializedFile assetFile, @NotNull ObjectInfo info) {
super(assetFile, info);
}

SubMashImpl[] fmSubMeshes;
@Nullable BlendShapeDataImpl fmShapes;
UInt[] fmIndices;
Matrix4x4[] fmBindPose = new Matrix4x4[0];
UInt[] fmBoneNameHashes = new UInt[0];
int fmVertexCount = 0;
float[] fmVertices = new float[0];
BoneWeights4Impl[] fmSkin = new BoneWeights4Impl[0];
float[] fmNormals = new float[0];
float[] fmColors = new float[0];
float[] fmUV0 = new float[0];
float[] fmUV1 = new float[0];
float[] fmUV2 = new float[0];
float[] fmUV3 = new float[0];
float[] fmUV4 = new float[0];
float[] fmUV5 = new float[0];
float[] fmUV6 = new float[0];
float[] fmUV7 = new float[0];
float[] fmTangents = new float[0];
}
Loading

0 comments on commit 034247c

Please sign in to comment.