Home

Resume

Blog

Teikitu


/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS Effect - Type.h
    »Author«    Andrew Aye (EMail: mailto:andrew.aye@gmail.com, Web: http://www.andrewaye.com)
    »Version«   4.51 / »GUID« A9981407-3EC9-42AF-8B6F-8BE6DD919615                                                                                                        */
/*   -------------------------------------------------------------------------------------------------------------------------------------------------------------------- */
/*  Copyright: © 2002-2017, Andrew Aye.  All Rights Reserved.
    This software is free for non-commercial use.  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
      following conditions are met:
        Redistribution of source code must retain this copyright notice, this list of conditions and the following disclaimers.
        Redistribution in binary form must reproduce this copyright notice, this list of conditions and the following disclaimers in the documentation and other materials
          provided with the distribution.
    The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
    The intellectual property rights of the algorithms used reside with Andrew Aye.
    You may not use this software, in whole or in part, in support of any commercial product without the express written consent of the author.
    There is no warranty or other guarantee of fitness of this software for any purpose. It is provided solely "as is".                                                   */
/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
#if !defined(TGS_EFFECT_TYPE_H)
#define TGS_EFFECT_TYPE_H
#pragma once

#if !defined(TGS_EFFECT_H)
#error This file should not be included directly - use the correct platform include wrapper
#endif

#include "TgS Ring 4 - Type.h"


/* == Effect ============================================================================================================================================================ */

/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Public Types                                                                                                                                                          */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

typedef TgBOOL (*TgFCN_CB_ON_TERMINATE)( C_TgFX_CLIENT_INST_ID, C_TgUINTPTR );
typedef TgVOID (*TgFCN_CB_ON_CONTACT)( PCU_TgFLOAT32, C_TgFX_CLIENT_INST_ID, C_TgUINTPTR, TgVEC_M_F32_04 );


/* ---- Client ---------------------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_STRUCT(STg2_FX_Instance,)
{
    TgVEC_F32_04                                m_vPos_W; /*« Position relative to World Reference Frame */
    TgVEC_F32_04                                m_vNormal; /*« Surface Normal - Used when creating decals */
    TgVEC_F32_04                                m_vScale; /*« Scale in Object / Effect space */
    TgVEC_F32_04                                m_qRot_W; /*« Rotation relative to World Reference Frame */
    TgATTACHMENT_ID                             m_tiAttachment;
    TgFX_CLIENT_INST_ID                         m_tiParent;
    TgRN_TARGET_ID                              m_tiTarget;

    TgFCN_CB_ON_TERMINATE                       m_pfnTerminate; /*« Executed on client thread */
    TgUINTPTR                                   m_uiTerminate_Parameter;
    TgFCN_CB_ON_CONTACT                         m_pfnContact; /*« Executed on client thread after a render thread contact event */
    TgUINTPTR                                   m_uiContact_Parameter;

    TgSINT16                                    m_iPriority; /*« Zero is median priority */
    TgUINT16                                    m_uiInternal;
    TgBOOL                                      m_uiRender_Visible;
};


/* ---- Render ---------------------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_STRUCT(STg2_FX_Rnd_Output,)
{
    /* Input */
    CP_STg2_RN_Cxt_Camera                       m_psCamera;
    TgUINT32                                    m_uiPad0[2];
    TgVEC_M_F32_04                              m_vdT;
    TgFLOAT32                                   m_fdT;
    TgUINT32                                    m_uiPad1;

    /* Output */
    P_STg2_RN_Particle_Header                   m_psFX_Header;
    TgATOMIC_UINTXX                             m_nuiFX_Header; /*« May read as larger than max, but still limited to max */
    TgUINT32                                    m_uiPad2[2];

    P_TgUINT08                                  m_puiBuffer;
    TgUINT32                                    m_nuiUsed;
    TgUINT32                                    m_nuiFree;
    TgUINT32                                    m_uiPad3[2];

    P_TgUINTXX                                  m_puiContext_To_Particle_Header_Index;
};


/* ---- Effect Parameter ------------------------------------------------------------------------------------------------------------------------------------------------ */

TgTYPE_STRUCT_ALIGN(STg2_FX_AnimData,16,)
{
    ETgFX_ANIM_DATA                             m_enType;
    TgUINT32                                    m_uiSize;
    TgUINT32                                    m_uiPad0[2];
};

TgTYPE_STRUCT_ALIGN(STg2_FX_AnimData__Constant,16,)
{
    STg2_FX_AnimData                            m_sParam;
    TgVEC_F32_04                                m_vParam;
};

TgTYPE_STRUCT_ALIGN(STg2_FX_AnimData__Key_Frame_F1,16,)
{
    STg2_FX_AnimData                            m_sParam;
    TgUINT32                                    m_nuiKey_Frame;
    TgUINT32                                    m_uiPad0;
    P_TgVEC_F32_04                              m_pvVal;
    P_TgVEC_F32_04                              m_pvTime;
    TgUINT32                                    m_uiPad1[2];
};

TgTYPE_STRUCT_ALIGN(STg2_FX_AnimData__Key_Frame_F2,16,)
{
    STg2_FX_AnimData                            m_sParam;
    TgUINT32                                    m_nuiKey_Frame;
    TgUINT32                                    m_uiPad0;
    P_TgVEC_F32_04                              m_pvVal;
    P_TgVEC_F32_04                              m_pvTime;
    TgUINT32                                    m_uiPad1[2];
};

TgTYPE_STRUCT_ALIGN(STg2_FX_AnimData__Key_Frame_F3,16,)
{
    STg2_FX_AnimData                            m_sParam;
    TgUINT32                                    m_nuiKey_Frame;
    TgUINT32                                    m_uiPad0;
    P_TgVEC_F32_04                              m_pvVal;
    P_TgVEC_F32_04                              m_pvTime;
    TgUINT32                                    m_uiPad1[2];
};

TgTYPE_STRUCT_ALIGN(STg2_FX_AnimData__Key_Frame_F4,16,)
{
    STg2_FX_AnimData                            m_sParam;
    TgUINT32                                    m_nuiKey_Frame;
    TgUINT32                                    m_uiPad0;
    P_TgVEC_F32_04                              m_pvVal;
    P_TgVEC_F32_04                              m_pvTime;
    TgUINT32                                    m_uiPad1[2];
};

TgTYPE_STRUCT_ALIGN(STg2_FX_AnimData__Sinusoidal,16,)
{
    STg2_FX_AnimData                            m_sParam;
    TgVEC_F32_04                                m_vAmplitude;
    TgVEC_F32_04                                m_vFrequency;
    TgVEC_F32_04                                m_vPhase;
};

TgTYPE_STRUCT_ALIGN(STg2_FX_AnimData__Square,16,)
{
    STg2_FX_AnimData                            m_sParam;
    TgVEC_F32_04                                m_vAmplitude;
};

TgTYPE_STRUCT_ALIGN(STg2_FX_AnimData__Spline,16,)
{
    STg2_FX_AnimData                            m_sParam;
};

TgTYPE_STRUCT_ALIGN(STg2_FX_AnimData__Flicker,16,)
{
    STg2_FX_AnimData                            m_sParam;
    TgVEC_F32_04                                m_vMult_MID, m_vMult_RNG;
    TgVEC_F32_04                                m_vTime_MID, m_vTime_RNG;
};


/* ---- Effect Data - Beam ---------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_STRUCT(STg2_FX_Beam__File_Data,)
{
    /* Spawn Data */
    TgFLOAT32                                   m_fTime_Total_MID, m_fTime_Total_RNG; /*« Time value when effect ends */
    TgFLOAT32                                   m_fTime_Start_MID, m_fTime_Start_RNG; /*« Time value when effect goes to stead-state */
    TgFLOAT32                                   m_fTime_End_MID, m_fTime_End_RNG; /*« Time value when effect starts to finish */
    TgUINTXX                                    m_uiHash_Material; /*« Render material name hash */
    TgVEC_M_F32_04                              m_vEnd_Position_MID, m_vEnd_Position_RNG;
    TgVEC_M_F32_04                              m_vScale_U, m_vScale_V; /*« UV Scale (U0, 0, U1, 0), (0, V0, 0, V1) */

    /* Fixed Data */
    TgUINT32                                    m_uiSort_Order; /*« Used to control sort ordering during the depth sort */

    /* Shape Data */
    TgUINT32                                    m_nuiPoints; /* There will be Points - 1 segments in the beam */
    union
    {
        struct /*« Written out in the data file */
        {
            TgUINTPTR                                   m_uiShape_Offset; /*« F3 Offset at fraction value (orthogonal to beam only) */
            TgUINTPTR                                   m_uiLine_Fraction; /*« F1 Percentage (distance) along the shape for each segment */
            TgUINTPTR                                   m_uiShape_Fraction; /*« F1 Percentage of completion when segment appears */
        }                                           m_sData_Offset;
        struct /*« Fixed up after load */
        {
            P_TgVEC_M_F32_04                            m_pvShape_Offset; /*« F3 Offset at fraction value (orthogonal to beam only) */
            P_TgFLOAT32                                 m_pfLine_Fraction; /*« F1 Percentage (distance) along the shape for each segment */
            P_TgFLOAT32                                 m_pfShape_Fraction; /*« F1 Percentage of completion when segment appears */
        }                                           m_sData;
    }                                           m_sShape;
    TgUINT32                                    m_uiPad0;

    /* Animation Data */
    TgUINT32                                    m_nuiData;
    union
    {
        struct /*« Written out in the data file */
        {
            TgUINTPTR                                   m_uiStart_Position_Width; /*« F4 */
            TgUINTPTR                                   m_uiStart_Colour; /*« F4 */
            TgUINTPTR                                   m_uiEnd_Position_Width; /*« F4 */
            TgUINTPTR                                   m_uiEnd_Colour; /*« F4 */
        }                                           m_sData_Offset;
        struct /*« Fixed up after load */
        {
            P_STg2_FX_AnimData                          m_psStart_Position_Width;
            P_STg2_FX_AnimData                          m_psStart_Colour;
            P_STg2_FX_AnimData                          m_psEnd_Position_Width;
            P_STg2_FX_AnimData                          m_psEnd_Colour;
        }                                           m_sParameter;
        P_STg2_FX_AnimData                          m_apsList[4];
    }                                           m_sAnim;
    TgUINT32                                    m_uiPad1[2];
};


/* ---- Effect Data - Billboard ----------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_STRUCT(STg2_FX_Billboard__File_Data,)
{
    /* Spawn Data */
    TgFLOAT32                                   m_fTime_Total_MID, m_fTime_Total_RNG; /*« Time value when effect ends */
    TgFLOAT32                                   m_fTime_Start_MID, m_fTime_Start_RNG; /*« Time value when effect goes to stead-state */
    TgFLOAT32                                   m_fTime_End_MID, m_fTime_End_RNG; /*« Time value when effect starts to finish */
    TgUINTXX                                    m_uiHash_Material; /*« Render material name hash */
    TgVEC_M_F32_04                              m_vPivot_X, m_vPivot_Y; /*« Normalized pivot/root location of the billboard */
    TgVEC_M_F32_04                              m_vPlnX, m_vPlnY, m_vPlnZ; /*« Billboard plane definition */
    TgVEC_M_F32_04                              m_vFade_Start, m_vFade_RNG; /*«  */
    TgFLOAT32                                   m_fSpin_MID, m_fSpin_RNG; /*« Random range for the spin (in plane rotation) */
    TgFLOAT32                                   m_fSpin_Speed;

    /* Fixed Data */
    ETgFX_BILLBOARD_ORIENTATION                 m_enOrientation;
    TgUINT32                                    m_uiFlags;
    TgUINT32                                    m_uiSort_Order; /*« Used to control sort ordering during the depth sort */
    TgUINT32                                    m_uiPad0;

    /* Animation Data */
    TgUINT32                                    m_nuiData;
    union
    {
        struct /*« Written out in the data file */
        {
            TgUINTPTR                                   m_uiColour; /*« F4 */
            TgUINTPTR                                   m_uiSize; /*« F2 */
        }                                           m_sData_Offset;
        struct /*« Fixed up after load */
        {
            P_STg2_FX_AnimData                          m_psColour; /*« F4 */
            P_STg2_FX_AnimData                          m_psSize; /*« F2 */
        }                                           m_sParameter;
        P_STg2_FX_AnimData                          m_apsList[2];
    }                                           m_sAnim;
};


/* ---- Effect Data - Decal --------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_STRUCT(STg2_FX_Decal__File_Data,)
{
    /* Spawn Data */
    TgFLOAT32                                   m_fTime_Total_MID, m_fTime_Total_RNG; /*« Time value when effect ends */
    TgFLOAT32                                   m_fTime_Start_MID, m_fTime_Start_RNG; /*« Time value when effect goes to stead-state */
    TgFLOAT32                                   m_fTime_End_MID, m_fTime_End_RNG; /*« Time value when effect starts to finish */
    TgUINTXX                                    m_uiHash_Material; /*« Render material name hash */
    TgVEC_M_F32_04                              m_vSize_MID[2], m_vSize_RNG[2]; /*« Decal start size, and then final size */
    TgFLOAT32                                   m_fSpin_MID, m_fSpin_RNG; /*« Random range for the spin (in plane rotation) */

    /* Fixed Data */
    TgUINT32                                    m_uiSort_Order; /*« Used to control sort ordering during the depth sort */

    /* Animation Data */
    TgUINT32                                    m_nuiData;
    union
    {
        struct /*« Written out in the data file */
        {
            TgUINTPTR                                   m_uiColour; /*« F4 */
        }                                           m_sData_Offset;
        struct /*« Fixed up after load */
        {
            P_STg2_FX_AnimData                          m_psColour; /*« F4 */
        }                                           m_sParameter;
        P_STg2_FX_AnimData                          m_apsList[1];
    }                                           m_sAnim;
    TgUINT64                                    m_uiPad0;
};


/* ---- Effect Data - Emitter ------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_STRUCT(STg2_FX_Particle__File_Data,)
{
    /* Spawn Data */
    TgVEC_M_F32_04                              m_vPivot_X, m_vPivot_Y; /*« Normalized pivot/root location of the particle */
    TgVEC_M_F32_04                              m_vL_Vel_Acceleration_W; /*« Additive to key frame velocity */

                                                /* Used for creating a per instance difference from the key frame data */
    TgVEC_M_F32_04                              m_vLVel_M_Variance_MID, m_vLVel_M_Variance_RNG;
    TgVEC_M_F32_04                              m_vRot_M_Variance_MID, m_vRot_M_Variance_RNG; /*« (Quat.xyzw,Spin.xxxx) */
    TgVEC_M_F32_04                              m_vSize_Variance_MID, m_vSize_Variance_RNG;
    TgVEC_M_F32_04                              m_vRVel_M_Acceleration_MID, m_vRVel_M_Acceleration_RNG; /*« (Quat.xyzw,Spin.xxxx) */
    TgFLOAT32                                   m_fTime_MID, m_fTime_RNG; /*« Random range for the life time of the particle */

    /* Fixed Data */
    ETgFX_PARTICLE_ORIENTATION                  m_enOrientation;
    TgFLOAT32                                   m_fContact_Restitution_MID, m_fContact_Restitution_RNG;
    TgFLOAT32                                   m_fCollision_Restitution;
    TgUINTXX                                    m_uiCollision_New_Effect_Hash;
    TgUINT32                                    m_uiPad0;

    /* Animation Data */
    TgUINT32                                    m_nuiData;
    union
    {
        struct /*« Written out in the data file */
        {
            TgUINTPTR                                   m_uiLVel_M; /*« F3: (x,y,z) Velocity */
            TgUINTPTR                                   m_uiRot_M; /*« F4: (x,y,z) Euler Angles, (w) Quad Spin */
            TgUINTPTR                                   m_uiTurbulence; /*« F1 */
            TgUINTPTR                                   m_uiSize; /*« F2 */
            TgUINTPTR                                   m_uiColour; /*« F4 */
            TgUINTPTR                                   m_uiNew_Effect_Hash; /*« U1 */
        }                                           m_sData_Offset;
        struct /*« Fixed up after load */
        {
            P_STg2_FX_AnimData                          m_psLVel_M;
            P_STg2_FX_AnimData                          m_psRot_M;
            P_STg2_FX_AnimData                          m_psTurbulence;
            P_STg2_FX_AnimData                          m_psSize;
            P_STg2_FX_AnimData                          m_psColour;
            P_STg2_FX_AnimData                          m_psNew_Effect_Hash;
        }                                           m_sParameter;
        P_STg2_FX_AnimData                          m_apsList[6];
    }                                           m_sAnim;
    TgUINT64                                    m_uiPad1;
};


TgTYPE_STRUCT(STg2_FX_Emitter__File_Data,)
{
    /* Spawn Data */
    TgFLOAT32                                   m_fTime_Total_MID, m_fTime_Total_RNG; /*« Time value when effect ends */
    TgFLOAT32                                   m_fTime_Start_MID, m_fTime_Start_RNG; /*« Time value when effect goes to stead-state */
    TgFLOAT32                                   m_fTime_End_MID, m_fTime_End_RNG; /*« Time value when effect starts to finish */
    TgUINTXX                                    m_uiHash_Material; /*« Render material name hash */
    TgFLOAT32                                   m_fEmission_Pivot_X, m_fEmission_Pivot_Y;
    TgSINT32                                    m_aniEmission_Max_Particle[2]; /*« [Low(0), High(9)] Value Range */
    TgFLOAT32                                   m_afEmission_Interval_MID[2], m_afEmission_Interval_RNG[2]; /*« [Low(0), High(9)] Value Range */
    TgFLOAT32                                   m_afEmission_Quantity_MID[2], m_afEmission_Quantity_RNG[2]; /*« [Low(0), High(9)] Value Range */

    /* Fixed Data */
    TgVEC_M_F32_04                              m_vL_Vel_Acceleration_W; /*« Additive to key frame velocity */
    ETgFX_EMISSION_SHAPE                        m_enEmission_Shape;
    TgFLOAT32                                   m_fEmitter_Attraction;
    TgUINT32                                    m_uiFlags;
    TgUINT32                                    m_uiSort_Order; /*« Used to control sort ordering during the depth sort */
    TgUINT32                                    m_uiPad0;

    /* Animation Data */
    TgUINT32                                    m_nuiData;
    union
    {
        struct /*« Written out in the data file */
        {
            TgUINTPTR                                   m_uiEmitter_LVel_M; /*« F4 */
            TgUINTPTR                                   m_uiEmitter_Rot_M; /*« F4 */
            TgUINTPTR                                   m_uiEmission_Shape; /*« F4 */
        }                                           m_sData_Offset;
        struct /*« Fixed up after load */
        {
            P_STg2_FX_AnimData                          m_psEmitter_LVel_M;
            P_STg2_FX_AnimData                          m_psEmitter_Rot_M;
            P_STg2_FX_AnimData                          m_psEmission_Shape;
        }                                           m_sParameter;
        P_STg2_FX_AnimData                          m_apsList[3];
    }                                           m_sAnim;
};


/* ---- Effect Data - GIB ----------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_STRUCT(STg2_FX_GIB__File_Data,)
{
    /* Spawn Data */
    TgFLOAT32                                   m_fTime_Total_MID, m_fTime_Total_RNG; /*« Time value when effect ends */
    TgFLOAT32                                   m_fTime_Start_MID, m_fTime_Start_RNG; /*« Time value when effect goes to stead-state */
    TgFLOAT32                                   m_fTime_End_MID, m_fTime_End_RNG; /*« Time value when effect starts to finish */
    TgUINTXX                                    m_uiHash_Material; /*« Render material name hash */

    /* Fixed Data */

    /* Animation Data */
    TgUINT32                                    m_nuiData;
    TgUINT08                                    m_auiData[4]; /*« Actual size is m_nuiData */
};


/* ---- Effect Data - Glass --------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_STRUCT(STg2_FX_Glass__File_Data,)
{
    /* Spawn Data */
    TgFLOAT32                                   m_fTime_Total_MID, m_fTime_Total_RNG; /*« Time value when effect ends */
    TgFLOAT32                                   m_fTime_Start_MID, m_fTime_Start_RNG; /*« Time value when effect goes to stead-state */
    TgFLOAT32                                   m_fTime_End_MID, m_fTime_End_RNG; /*« Time value when effect starts to finish */
    TgUINTXX                                    m_uiHash_Material; /*« Render material name hash */

    /* Fixed Data */

    /* Animation Data */
    TgUINT32                                    m_nuiData;
    TgUINT08                                    m_auiData[4]; /*« Actual size is m_nuiData */
};


/* ---- Effect Data - Group --------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_STRUCT(STg2_FX_Group_Effect__File_Data,)
{
    TgVEC_M_F32_04                              m_vPosition;
    TgVEC_M_F32_04                              m_vRotation;

    TgUINTXX                                    m_uiHash_Effect;
    TgFLOAT32                                   m_fStart;
    TgUINT32                                    m_uiPad0;
};

TgTYPE_STRUCT(STg2_FX_Group__File_Data,)
{
    /* Spawn Data */
    TgFLOAT32                                   m_fTime_Total_MID, m_fTime_Total_RNG; /*« Unused - always -1 */
    TgFLOAT32                                   m_fTime_Start_MID, m_fTime_Start_RNG; /*« Unused - always -1 */
    TgFLOAT32                                   m_fTime_End_MID, m_fTime_End_RNG; /*« Unused - always -1 */
    TgSINT32                                    m_niEffect;
    TgUINT32                                    m_uiPad0;

    /* Fixed Data */
    STg2_FX_Group_Effect__File_Data             m_asEffect[1]; /*« Actual size is m_nuiEffect */
};


/* ---- Effect Data - Light --------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_STRUCT(STg2_FX_Light__File_Data,)
{
    /* Spawn Data */
    TgFLOAT32                                   m_fTime_Total_MID, m_fTime_Total_RNG; /*« Time value when effect ends */
    TgFLOAT32                                   m_fTime_Start_MID, m_fTime_Start_RNG; /*« Time value when effect goes to stead-state */
    TgFLOAT32                                   m_fTime_End_MID, m_fTime_End_RNG; /*« Time value when effect starts to finish */
    TgUINTXX                                    m_uiPad;
    TgVEC_M_F32_04                              m_vMin_BA;
    TgVEC_M_F32_04                              m_vMax_BA;

    /* Fixed Data */
    TgUINT32                                    m_uiFlags;

    /* Animation Data */
    TgUINT32                                    m_nuiData;
    union
    {
        struct /*« Written out in the data file */
        {
            TgUINTPTR                                   m_uiPosition;
            TgUINTPTR                                   m_uiDirection;
            TgUINTPTR                                   m_uiRGB_709;
            TgUINTPTR                                   m_uiGeom_Light;
        }                                           m_sData_Offset;
        struct /*« Fixed up after load */
        {
            P_STg2_FX_AnimData                          m_psPos_M;
            P_STg2_FX_AnimData                          m_psRot_M;
            P_STg2_FX_AnimData                          m_psRGB_709;
            P_STg2_FX_AnimData                          m_psGeom_Light;
        }                                           m_sParameter;
        P_STg2_FX_AnimData                          m_apsList[6];
    }                                           m_sAnim;

    TgUINT64                                    m_uiPad0;
};


/* ---- Effect Data - Liquid -------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_STRUCT(STg2_FX_Liquid__File_Data,)
{
    /* Spawn Data */
    TgFLOAT32                                   m_fTime_Total_MID, m_fTime_Total_RNG; /*« Time value when effect ends */
    TgFLOAT32                                   m_fTime_Start_MID, m_fTime_Start_RNG; /*« Time value when effect goes to stead-state */
    TgFLOAT32                                   m_fTime_End_MID, m_fTime_End_RNG; /*« Time value when effect starts to finish */
    TgUINTXX                                    m_uiHash_Material; /*« Render material name hash */

    /* Fixed Data */

    /* Animation Data */
    TgUINT32                                    m_nuiData;
    TgUINT08                                    m_auiData[4]; /*« Actual size is m_nuiData */
};


/* ---- Effect Data - Post ---------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_STRUCT(STg2_FX_Post__File_Data,)
{
    /* Spawn Data */
    TgFLOAT32                                   m_fTime_Total_MID, m_fTime_Total_RNG; /*« Time value when effect ends */
    TgFLOAT32                                   m_fTime_Start_MID, m_fTime_Start_RNG; /*« Time value when effect goes to stead-state */
    TgFLOAT32                                   m_fTime_End_MID, m_fTime_End_RNG; /*« Time value when effect starts to finish */
    TgUINTXX                                    m_uiHash_Material; /*« Render material name hash */

    TgUINT32                                    m_uiPad0;
    TgUINT32                                    m_uiPad1;
    TgUINT32                                    m_uiPad2;
    TgUINT32                                    m_nuiData;

    /* Fixed Data */
    /* Animation Data */
    TgUINT08                                    m_auiData[8]; /*« Actual size is m_nuiData */
};


/* ---- Effect Data - Sound --------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_STRUCT(STg2_FX_Sound__File_Data,)
{
    /* Spawn Data */
    TgFLOAT32                                   m_fTime_Total_MID, m_fTime_Total_RNG; /*« Unused - always -1 */
    TgFLOAT32                                   m_fTime_Start_MID, m_fTime_Start_RNG; /*« Unused - always -1 */
    TgFLOAT32                                   m_fTime_End_MID, m_fTime_End_RNG; /*« Unused - always -1 */
    TgUINTXX                                    m_uiPad;
    TgVEC_M_F32_04                              m_vDirection;
    TgVEC_M_F32_04                              m_vVelocity;

    /* Fixed Data */
    TgUINTXX                                    m_uiHash_Sound_Bank;
    TgUINTXX                                    m_uiHash_Sound;
    TgUINT32                                    m_uiEvent;
    TgUINT32                                    m_uiPad0;

                                                /* Fixed up after load */
    TgSN_BANK_ID                                m_tiSound_Bank;
    TgSN_ID                                     m_tiSound;
    TgUINT64                                    m_uiPad1;
};


/* ---- Effect Data - Trail --------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_STRUCT(STg2_FX_Trail__File_Data,)
{
    /* Spawn Data */
    TgFLOAT32                                   m_fTime_Total_MID, m_fTime_Total_RNG; /*« Time value when effect ends */
    TgFLOAT32                                   m_fTime_Start_MID, m_fTime_Start_RNG; /*« Time value when effect goes to stead-state */
    TgFLOAT32                                   m_fTime_End_MID, m_fTime_End_RNG; /*« Time value when effect starts to finish */
    TgUINTXX                                    m_uiHash_Material; /*« Render material name hash */
    TgVEC_M_F32_04                              m_vScale_U, m_vScale_V; /*« UV Scale (U0, 0, U1, 0), (0, V0, 0, V1) */

    /* Fixed Data */
    TgFLOAT32                                   m_fFollow_Fraction;
    TgUINT32                                    m_nuiMax_Points;
    TgUINT32                                    m_uiSort_Order; /*« Used to control sort ordering during the depth sort */
    TgUINT32                                    m_enTex;
    TgUINT32                                    m_uiPad1;

    /* Animation Data */
    TgUINT32                                    m_nuiData;
    union
    {
        struct /*« Written out in the data file */
        {
            TgUINTPTR                                   m_uiColour; /*« F4 */
            TgUINTPTR                                   m_uiWidth; /*« F2 */
        }                                           m_sData_Offset;
        struct /*« Fixed up after load */
        {
            P_STg2_FX_AnimData                          m_psColour;
            P_STg2_FX_AnimData                          m_psWidth;
        }                                           m_sParameter;
        P_STg2_FX_AnimData                          m_apsList[2];
    }                                           m_sAnim;
    TgUINT64                                    m_uiPad2;
};


/* ---- Effect Data ----------------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_STRUCT(STg2_File_Data__FXFX,)
{
    STg2_File_Data                              m_sHeader;
    ETgFX__EFFECT                               m_enEffect;
    TgUINT32                                    m_uiPad0;
    TgUINTXX                                    m_uiHash;
    union
    {
        STg2_FX_Beam__File_Data                     m_sBeam;
        STg2_FX_Billboard__File_Data                m_sBillboard;
        STg2_FX_Decal__File_Data                    m_sDecal;
        STg2_FX_Particle__File_Data                 m_sParticle;
        STg2_FX_Emitter__File_Data                  m_sEmitter;
        STg2_FX_GIB__File_Data                      m_sGIB;
        STg2_FX_Glass__File_Data                    m_sGlass;
        STg2_FX_Group__File_Data                    m_sGroup;
        STg2_FX_Light__File_Data                    m_sLight;
        STg2_FX_Liquid__File_Data                   m_sLiquid;
        STg2_FX_Post__File_Data                     m_sPost;
        STg2_FX_Sound__File_Data                    m_sSound;
        STg2_FX_Trail__File_Data                    m_sTrail;
    }                                           m_sData;
};


TgTYPE_STRUCT(STg2_File_Data__FXDB,)
{
    STg2_File_Data                              m_sHeader;
    TgUINT32                                    m_uiPad0;
    TgUINT32                                    m_nuiNames;
    struct 
    {
        TgCHAR                                      m_szName[32];
        TgUINTXX                                    m_uiHash;
    }                                           m_asName[1];
};


/* ====================================================================================================================================================================== */
#endif