Home

Resume

Blog

Teikitu


/* =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= */
/*  »Project«   Teikitu Gaming System (TgS) (∂)
    »File«      TgS Effect - Internal - 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_INTERNAL_TYPE_H)
#define TGS_EFFECT_INTERNAL_TYPE_H
#pragma once

#include "TgS Effect - Internal - Constants.h"


/* == Effects =========================================================================================================================================================== */

/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */
/*  Private Types                                                                                                                                                         */
/* -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-. */

TgTYPE_STRUCT( STg2_FX_Calc_Quad, )
{
    TgVEC_M_F32_04                      m_vPivot_X;
    TgVEC_M_F32_04                      m_vPivot_Y;
    TgVEC_M_F32_04                      m_vSize_X;
    TgVEC_M_F32_04                      m_vSize_Y;
    TgVEC_M_F32_04                      m_vPos_W;
    TgVEC_M_F32_04                      m_vDir_Up;
    TgVEC_M_F32_04                      m_vDir_Right;
};


/* ---- Effect Commands ------------------------------------------------------------------------------------------------------------------------------------------------- */

TgTYPE_STRUCT_ALIGN(STg2_FX_Command__Update__NoParam,16,)
{
    ETgFX_COMMAND                               m_enCommand;
    TgUINT32                                    m_uiPad0;
    union
    {
        TgFX_CLIENT_INST_ID                         m_tiClient;
        TgFX_DATA_INST_ID                           m_tiData;
    }                                           m_sDest;
};

TgTYPE_STRUCT_ALIGN(STg2_FX_Command__Update__1_S32,16,)
{
    ETgFX_COMMAND                               m_enCommand;
    TgSINT32                                    m_iVal;
    union
    {
        TgFX_CLIENT_INST_ID                         m_tiClient;
        TgFX_DATA_INST_ID                           m_tiData;
    }                                           m_sDest;
};

TgTYPE_STRUCT_ALIGN(STg2_FX_Command__Update__1_F32,16,)
{
    ETgFX_COMMAND                               m_enCommand;
    TgFLOAT32                                   m_fVal;
    union
    {
        TgFX_CLIENT_INST_ID                         m_tiClient;
        TgFX_DATA_INST_ID                           m_tiData;
    }                                           m_sDest;
};

TgTYPE_STRUCT_ALIGN(STg2_FX_Command__Update__1_F32_04,16,)
{
    ETgFX_COMMAND                               m_enCommand;
    TgUINT32                                    m_uiPad0;
    union
    {
        TgFX_CLIENT_INST_ID                         m_tiClient;
        TgFX_DATA_INST_ID                           m_tiData;
    }                                           m_sDest;
    TgVEC_F32_04                                m_vF32_04;
};

TgTYPE_STRUCT_ALIGN(STg2_FX_Command__Update__2_F32_04,16,)
{
    ETgFX_COMMAND                               m_enCommand;
    TgUINT32                                    m_uiPad0;
    union
    {
        TgFX_CLIENT_INST_ID                         m_tiClient;
        TgFX_DATA_INST_ID                           m_tiData;
    }                                           m_sDest;
    TgVEC_F32_04                                m_vF32_04[2];
};

TgTYPE_STRUCT_ALIGN(STg2_FX_Command__Update__1_UXX,16,)
{
    ETgFX_COMMAND                               m_enCommand;
    TgUINT32                                    m_uiPad0;
    union
    {
        TgFX_CLIENT_INST_ID                         m_tiClient;
        TgFX_DATA_INST_ID                           m_tiData;
    }                                           m_sDest;
    TgUINTXX                                    m_uiVal;
    TgUINTXX                                    m_uiPad1;
};

TgTYPE_STRUCT_ALIGN(STg2_FX_Command__Update__2_UXX,16,)
{
    ETgFX_COMMAND                               m_enCommand;
    TgUINT32                                    m_uiPad0;
    union
    {
        TgFX_CLIENT_INST_ID                         m_tiClient;
        TgFX_DATA_INST_ID                           m_tiData;
    }                                           m_sDest;
    TgUINTXX                                    m_uiVal[2];
};

TgTYPE_STRUCT_ALIGN(STg2_FX_Command__Notify,16,)
{
    ETgFX_COMMAND                               m_enCommand;
    TgUINT32                                    m_uiMessage;
    P_TgVOID                                    m_pNotify;
};

TgTYPE_STRUCT_ALIGN(STg2_FX_Command__Update__Create,16,)
{
    ETgFX_COMMAND                               m_enCommand;
    TgUINT32                                    m_uiPad0;
    TgFX_DATA_INST_ID                           m_tiData;
    TgFX_CLIENT_INST_ID                         m_tiClient;
    CP_TgVOID                                   m_psFile_Data_0;
    CP_TgVOID                                   m_psFile_Data_1;
    TgUINT32                                    m_uiPad1[2];
    STg2_FX_Instance                            m_sInstance;
};

TgTYPE_STRUCT_ALIGN(STg2_FX_Command__Client__Create,16,)
{
    ETgFX_COMMAND                               m_enCommand;
    TgUINT32                                    m_uiPad0;
    TgUINTXX                                    m_uiHash;
    STg2_FX_Instance                            m_sInstance;
};

TgTYPE_STRUCT_ALIGN(STg2_FX_Command__Client__Free,16,)
{
    ETgFX_COMMAND                               m_enCommand;
    TgUINT32                                    m_uiPad0;
    TgFX_DATA_INST_ID                           m_tiData;
    TgFX_CLIENT_INST_ID                         m_tiClient;
    TgUINTXX                                    m_uiPad1;
};

TgTYPE_STRUCT_ALIGN(STg2_FX_Command__Render__Patch,16,)
{
    ETgFX_COMMAND                               m_enCommand;
    TgUINT32                                    m_uiPad0;
    TgFX_DATA_INST_ID                           m_tiData;
    TgSINT32                                    m_iIndex_In_SE_Context;
    TgUINT32                                    m_uiPad1[3];
};


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

TgTYPE_STRUCT(STg2_FX_Data__Effect,)
{
    TgFX_EFFECT_ID                              m_tiEffect;
    TgKN_FILE_ID                                m_tiFile;
    TgFX_CACHE_ID                               m_tiCache;
    CP_STg2_File_Data__FXFX                     m_psFile_Data;
    ETgFX__EFFECT                               m_enEffect;
    TgUINT32                                    m_nuiReference;
};

TgTYPE_STRUCT(STg2_FX_Data__Data,)
{
    TgFX_EFFECT_ID                              m_tiEffect;
    TgFX_CACHE_ID                               m_tiCache;
    union
    {
        struct
        {
            TgSN_BANK_ID                                m_tiSound_Bank;
            TgSN_ID                                     m_tiSound;
        }                                           m_sSound;
        struct
        {
            TgRN_MATERIAL_ID                            m_tiMaterial;
            TgRN_MESH_SET_ID                            m_tiMesh_Set;
            ETgRN_VERTEX                                m_enVertex;
            TgUINT32                                    m_uiPad;
        }                                           m_sRender;
    }                                           m_sData;
};


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

TgTYPE_STRUCT(STg2_FX_Descriptor,)
{
    ETgFX__EFFECT                               m_enEffect;
    ETgRN_PRIMITIVE                             m_enPrimitive;
    TgUINT32                                    m_uiMax;
};

TgTYPE_STRUCT(STg2_FX__Client,)
{
    TgFX_CLIENT_INST_ID                         m_tiUpdate_Next;

    TgFX_DATA_INST_ID                           m_tiData;
    TgFX_CLIENT_INST_ID                         m_tiClient;
    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;

    ETgFX__EFFECT                               m_enEffect;
    TgSINT32                                    m_iPriority; /*« Zero is median priority */
    TgFX_EFFECT_ID                              m_tiEffect;
    TgUINT32                                    m_uiUpdate : 2; /*« Must be large enough to hold ETgFX_UPDATE__MAX - 1 */
    TgUINT32                                    m_uiRender_Visible : 1; /*« Boolean value */
    TgUINT32                                    m_uiPad2: 29;
    TgUINT32                                    m_uiPad3;
};


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

TgTYPE_STRUCT_ALIGN(STg2_FX__Beam__Extend_Data,16,)
{
    /* ------------ Create Data ------------ */
    TgVEC_M_F32_04                              m_vEnd_Variance;

    /* ------------ Update Data ------------ */
    TgVEC_M_F32_04                              m_vPosition_Width_0;
    TgVEC_M_F32_04                              m_vColour_0;
    TgVEC_M_F32_04                              m_vPosition_Width_1;
    TgVEC_M_F32_04                              m_vColour_1;
    TgVEC_M_F32_04                              m_vUV_01_Constant;
    TgVEC_M_F32_04                              m_vUV_01_Scale;
};


TgTYPE_STRUCT(STg2_FX__Billboard__Extend_Data,)
{
    /* ------------ Create Data ------------ */
    TgVEC_M_F32_04                              m_vPlnX, m_vPlnY;

    /* ------------ Update Data ------------ */
    TgFLOAT32                                   m_fSpin;
    TgUINT32                                    m_uiPad0[3];
    TgVEC_M_F32_04                              m_vColour;
    TgVEC_M_F32_04                              m_vSize; /*« X=Size X, Y= Size Y, W, Z */
    TgVEC_M_F32_04                              m_vUV_01_Constant;
    TgVEC_M_F32_04                              m_vUV_01_Scale;
};


TgTYPE_STRUCT(STg2_FX__Decal__Vertex,)
{
    TgVEC_M_F32_04                              m_vS0_W;
    TgVEC_M_F32_04                              m_vT0;
    TgVEC_M_F32_04                              m_vB0;
    TgVEC_M_F32_04                              m_vUV_A; /* X=U, Y=V, Z=Alpha Mult, W=? */
};


TgTYPE_STRUCT(STg2_FX__Decal__Extend_Data,)
{
    /* ------------ Create Data ------------ */
    TgVEC_M_F32_04                              m_vSize_Start;
    TgVEC_M_F32_04                              m_vSize_Final;

    /* ------------ Update Data ------------ */
    TgVEC_M_F32_04                              m_vPos_W;
    TgVEC_M_F32_04                              m_vNormal;
    TgVEC_M_F32_04                              m_vScale;
    TgVEC_M_F32_04                              m_vSpin;
    TgVEC_M_F32_04                              m_vSize;
    TgVEC_M_F32_04                              m_vColour;
    TgVEC_M_F32_04                              m_vUV_01_Constant;
    TgVEC_M_F32_04                              m_vUV_01_Scale;

    /* ------------ Render Data ------------ */
    P_STg2_FX__Decal__Vertex                    m_psVert;
    TgSINT32                                    m_niVert;
    TgSINT32                                    m_niVert_Commit;
};


TgTYPE_STRUCT(STg2_FX__Emitter__Particle,)
{
    /* ------------ Create Data ------------ */
    P_STg2_FX__Emitter__Particle                m_psNext;
    TgUINT32                                    m_uiPad0[2];
    TgVEC_M_F32_04                              m_vRVel_M_Acceleration;
    TgVEC_M_F32_04                              m_vSize_Variance;
    TgVEC_M_F32_04                              m_vRot_M_Variance;
    TgVEC_M_F32_04                              m_vLVel_M_Variance;
    TgVEC_M_F32_04                              m_vPos_Start;
    TgVEC_M_F32_04                              m_vRot_Start;

    /* ------------ Update Data ------------ */
    TgVEC_M_F32_04                              m_qRot_M;
    TgVEC_M_F32_04                              m_vPos_M;
    TgVEC_M_F32_04                              m_vPos_W;
    TgVEC_M_F32_04                              m_vLVel_M;
    TgVEC_M_F32_04                              m_vLVel_W;
    TgVEC_M_F32_04                              m_vLive_Time;
    TgVEC_M_F32_04                              m_vTurbulence;
    TgVEC_M_F32_04                              m_vSize; /*« X=Size X, Y= Size Y, W, Z */
    TgVEC_M_F32_04                              m_vColour;
    TgVEC_M_F32_04                              m_vUV_01_Constant;
    TgVEC_M_F32_04                              m_vUV_01_Scale;
    TgFLOAT32                                   m_fLife_Time;
    TgUINT32                                    m_uiPad1[3];
};

TgTYPE_STRUCT(STg2_FX__Emitter__Extend_Data,)
{
    /* ------------ Create Data ------------ */
    TgFLOAT32                                   m_fEmission_Interval;
    TgFLOAT32                                   m_fEmission_Quantity;
    TgSINT32                                    m_niParticle_Max;

    TgSINT32                                    m_niParticle_Commit;
    P_STg2_FX__Emitter__Particle                m_psParticle_Active;
    P_STg2_FX__Emitter__Particle                m_psParticle_Free;
    P_STg2_FX__Emitter__Particle                m_psParticle_Memory;
    CP_STg2_FX_Particle__File_Data              m_psFile_Data__Particle;

    /* ------------ Update Data ------------ */
    TgVEC_M_F32_04                              m_vLVel_M;
    TgVEC_M_F32_04                              m_vEmission_Shape;
    TgSINT32                                    m_niParticle;
    TgSINT32                                    m_niParticle_Render;
    TgSINT32                                    m_iPad0[2];
};

TgTYPE_STRUCT(STg2_FX__GIB__Extend_Data,)
{
    TgVEC_M_F32_04                              m_vUnused;
};

TgTYPE_STRUCT(STg2_FX__Glass__Extend_Data,)
{
    TgVEC_M_F32_04                              m_vUnused;
};

TgTYPE_STRUCT_ALIGN(STg2_FX__Group__Extend_Data,16,)
{
    /* ------------ Client Data ------------ */
    TgFX_CLIENT_INST_ID                         m_atiChildren[KTgFX_MAX_GROUP_SUB_EFFECTS];
    TgSINT32                                    m_niChildren;
    
    /* ------------ Update Data ------------ */
    TgFLOAT32                                   m_fLive_Time;
    TgSINT64                                    m_iPad1;
};

TgTYPE_STRUCT(STg2_FX__Light__Extend_Data,)
{
    /* ------------ Update Data ------------ */
    TgVEC_M_F32_04                              m_vRGB_709;
    TgVEC_M_F32_04                              m_vAmbient_709;
    TgVEC_M_F32_04                              m_vGeom_Light;
};

TgTYPE_STRUCT(STg2_FX__Liquid__Extend_Data,)
{
    /* ------------ Update Data ------------ */
    TgVEC_M_F32_04                              m_qRot_W;
    TgVEC_M_F32_04                              m_vPos_W;
};

TgTYPE_STRUCT(STg2_FX__Post__Extend_Data,)
{
    TgVEC_M_F32_04                              m_vUnused;
};

TgTYPE_STRUCT(STg2_FX__Sound__Extend_Data,)
{
    TgSN_INST_ID                                m_tiSound_Instance;
    TgSINT64                                    m_iPad0;
    TgVEC_M_F32_04                              m_vDir_W;
};

TgTYPE_STRUCT(STg2_FX__Trail__Extend_Data,)
{
    /* ------------ Update Data ------------ */
    TgVEC_M_F32_04                              m_vPos_W[KTgFX_MAX_POINTS_IN_TRAIL];
    TgVEC_M_F32_04                              m_vScaleFactor; /*« Single scale value */
    TgFLOAT32                                   m_fU[KTgFX_MAX_POINTS_IN_TRAIL];
    TgUINT32                                    m_uiPoint_Head;
    TgUINT32                                    m_uiPoint_Tail;
    TgUINT32                                    m_uiHead_Offset;
    TgUINT32                                    m_uiPad2;
    TgVEC_M_F32_04                              m_vEnd_Time;
    TgVEC_M_F32_04                              m_vColour;
    TgVEC_M_F32_04                              m_vWidth;
    TgVEC_M_F32_04                              m_vUV_01_Constant;
    TgVEC_M_F32_04                              m_vUV_01_Scale;
};


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