Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ BinaryAssetBuilder implementation for Kane's Wrath in .Net
* [x] WeaponTemplate
* [x] LocomotorTemplate
* [ ] GameObject 0x132408DB
* [ ] FXParticleSystemTemplate 0xA148D511
* [x] FXParticleSystemTemplate
* [ ] Weather 0x368A8BA2
* [ ] ShadowMap 0xC6389FA6
* [ ] WaterTransparency 0x331DA6CE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ public void Initialize(TargetPlatform platform)
0x50612DE9u,
#endif
false),
(typeof(FXParticleSystemTemplate),
#if TIBERIUMWARS
0xA148D511u,
#elif KANESWRATH
0xA0C56702u,
#endif
false),



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public static unsafe void Marshal(Node node, FXParticleEmissionVelocitySphere* o
Marshal(node, (FXParticleEmissionVelocityBase*)objT, state);
}

#if TIBERIUMWARS
public static unsafe void Marshal(Node node, FXParticleEmissionVelocityHemisphere* objT, Tracker state)
{
if (node is null)
Expand All @@ -62,6 +63,7 @@ public static unsafe void Marshal(Node node, FXParticleEmissionVelocityHemispher
}
Marshal(node, (FXParticleEmissionVelocitySphere*)objT, state);
}
#endif

public static unsafe void Marshal(Node node, FXParticleEmissionVelocityBase** objT, Tracker state)
{
Expand All @@ -73,9 +75,11 @@ public static unsafe void Marshal(Node node, FXParticleEmissionVelocityBase** ob
Marshal(node.GetAttributeValue("TypeId", "0"), &typeId, Tracker.NullTracker);
switch (typeId)
{
#if TIBERIUMWARS
case 0xB7B54FC2u:
MarshalPolymorphicType<FXParticleEmissionVelocityHemisphere, FXParticleEmissionVelocityBase>(node, objT, state);
break;
#endif
case 0x8BB38534u:
MarshalPolymorphicType<FXParticleEmissionVelocitySphere, FXParticleEmissionVelocityBase>(node, objT, state);
break;
Expand Down
201 changes: 100 additions & 101 deletions source/SageBinaryData/SageBinaryData/FXParticleSystem.cs
Original file line number Diff line number Diff line change
@@ -1,114 +1,113 @@
using Relo;
using System.Runtime.InteropServices;

namespace SageBinaryData
namespace SageBinaryData;

[StructLayout(LayoutKind.Sequential)]
public struct RandomAlphaKeyframe
{
[StructLayout(LayoutKind.Sequential)]
public struct RandomAlphaKeyframe
{
public ClientRandomVariable Base;
public Percentage RelativeAge;
public uint Frame;
}
public ClientRandomVariable Base;
public Percentage RelativeAge;
public uint Frame;
}

[StructLayout(LayoutKind.Sequential)]
public struct RGBColorKeyframe
{
public Percentage RelativeAge;
public uint Frame;
public Color3f Color;
}
[StructLayout(LayoutKind.Sequential)]
public struct RGBColorKeyframe
{
public Percentage RelativeAge;
public uint Frame;
public Color3f Color;
}

[StructLayout(LayoutKind.Sequential)]
public struct FXParticlePhysicsBase : IPolymorphic
{
public FXParticleBaseModule Base;
}
[StructLayout(LayoutKind.Sequential)]
public struct FXParticlePhysicsBase : IPolymorphic
{
public FXParticleBaseModule Base;
}

[StructLayout(LayoutKind.Sequential)]
public struct FXParticleDefaultPhysics
{
public FXParticlePhysicsBase Base;
public float Gravity;
public ClientRandomVariable VelocityDamping;
public Coord3D DriftVelocity;
public SageBool Swirly;
public SageBool ParticlesAttachToBone;
}
[StructLayout(LayoutKind.Sequential)]
public struct FXParticleDefaultPhysics
{
public FXParticlePhysicsBase Base;
public float Gravity;
public ClientRandomVariable VelocityDamping;
public Coord3D DriftVelocity;
public SageBool Swirly;
public SageBool ParticlesAttachToBone;
}

[StructLayout(LayoutKind.Sequential)]
public struct FXParticleSwarmPhysics
{
public FXParticlePhysicsBase Base;
public float AttractStrength;
}
[StructLayout(LayoutKind.Sequential)]
public struct FXParticleSwarmPhysics
{
public FXParticlePhysicsBase Base;
public float AttractStrength;
}

[StructLayout(LayoutKind.Sequential)]
public struct FXParticleAlpha
{
public List<RandomAlphaKeyframe> Alpha;
}
[StructLayout(LayoutKind.Sequential)]
public struct FXParticleAlpha
{
public List<RandomAlphaKeyframe> Alpha;
}

[StructLayout(LayoutKind.Sequential)]
public struct FXParticleColor
{
public float HouseColorSaturation;
public List<RGBColorKeyframe> Color;
public ClientRandomVariable ColorScale;
public SageBool UseHouseColor;
}
[StructLayout(LayoutKind.Sequential)]
public struct FXParticleColor
{
public float HouseColorSaturation;
public List<RGBColorKeyframe> Color;
public ClientRandomVariable ColorScale;
public SageBool UseHouseColor;
}

[StructLayout(LayoutKind.Sequential)]
public struct FXParticleWind
{
public FXParticleSystem_WindMotion Motion;
public float Strength;
public float FullStrengthDist;
public float ZeroStrengthDist;
public float AngleChangeMin;
public float AngleChangeMax;
public float PingPongStartAngleMin;
public float PingPongStartAngleMax;
public float PingPongEndAngleMin;
public float PingPongEndAngleMax;
public float TurbulenceAmplitude;
public float TurbulenceFrequency;
}
[StructLayout(LayoutKind.Sequential)]
public struct FXParticleWind
{
public FXParticleSystem_WindMotion Motion;
public float Strength;
public float FullStrengthDist;
public float ZeroStrengthDist;
public float AngleChangeMin;
public float AngleChangeMax;
public float PingPongStartAngleMin;
public float PingPongStartAngleMax;
public float PingPongEndAngleMin;
public float PingPongEndAngleMax;
public float TurbulenceAmplitude;
public float TurbulenceFrequency;
}

[StructLayout(LayoutKind.Sequential)]
public struct FXParticleSystemTemplate
{
public BaseAssetType Base;
public FXParticleSystem_Priority Priority;
public FXParticleSystem_ShaderType Shader;
public FXParticleSystem_Type Type;
public AssetReference<Texture> ParticleTexture;
public AssetReference<BaseRenderAssetType> Drawable;
public TypedAssetId<BaseAssetType> SlaveSystem; // should be TypedAssetId<FXParticleSystemTemplate> but .net thinks it might be a circular reference
public TypedAssetId<BaseAssetType> PerParticleAttachedSystem; // should be TypedAssetId<FXParticleSystemTemplate> but .net thinks it might be a circular reference
public uint SystemLifetime;
public uint SortLevel;
public unsafe AssetReference<BaseAudioEventInfo, AudioEventInfo>* EmitterSound;
public Coord3D SlavePosOffset;
public ClientRandomVariable Lifetime;
public ClientRandomVariable Size;
public ClientRandomVariable StartSizeRate;
public ClientRandomVariable BurstDelay;
public ClientRandomVariable BurstCount;
public ClientRandomVariable InitialDelay;
public unsafe FXParticleAlpha* Alphas;
public unsafe FXParticleColor* Colors;
public unsafe FXParticleWind* Wind;
public unsafe FXParticlePhysicsBase* Physics;
public unsafe FXParticleDrawBase* Draw;
public unsafe FXParticleEmissionVolumeBase* Volume;
public unsafe FXParticleEmissionVelocityBase* Velocity;
public PolymorphicList<FXParticleEventBase> Event;
public unsafe FXParticleUpdateBase* Update;
public SageBool IsOneShot;
public SageBool IsGroundAligned;
public SageBool IsEmitAboveGroundOnly;
public SageBool IsParticleUpTowardsEmitter;
public SageBool UseMaximumHeight;
}
[StructLayout(LayoutKind.Sequential)]
public struct FXParticleSystemTemplate
{
public BaseAssetType Base;
public FXParticleSystem_Priority Priority;
public FXParticleSystem_ShaderType Shader;
public FXParticleSystem_Type Type;
public AssetReference<Texture> ParticleTexture;
public AssetReference<BaseRenderAssetType> Drawable;
public TypedAssetId<BaseAssetType> SlaveSystem; // should be TypedAssetId<FXParticleSystemTemplate> but .net thinks it might be a circular reference
public TypedAssetId<BaseAssetType> PerParticleAttachedSystem; // should be TypedAssetId<FXParticleSystemTemplate> but .net thinks it might be a circular reference
public uint SystemLifetime;
public uint SortLevel;
public unsafe AssetReference<BaseAudioEventInfo, AudioEventInfo>* EmitterSound;
public Coord3D SlavePosOffset;
public ClientRandomVariable Lifetime;
public ClientRandomVariable Size;
public ClientRandomVariable StartSizeRate;
public ClientRandomVariable BurstDelay;
public ClientRandomVariable BurstCount;
public ClientRandomVariable InitialDelay;
public unsafe FXParticleAlpha* Alphas;
public unsafe FXParticleColor* Colors;
public unsafe FXParticleWind* Wind;
public unsafe FXParticlePhysicsBase* Physics;
public unsafe FXParticleDrawBase* Draw;
public unsafe FXParticleEmissionVolumeBase* Volume;
public unsafe FXParticleEmissionVelocityBase* Velocity;
public PolymorphicList<FXParticleEventBase> Event;
public unsafe FXParticleUpdateBase* Update;
public SageBool IsOneShot;
public SageBool IsGroundAligned;
public SageBool IsEmitAboveGroundOnly;
public SageBool IsParticleUpTowardsEmitter;
public SageBool UseMaximumHeight;
}
Loading