171 lines
2.9 KiB
C++
171 lines
2.9 KiB
C++
#include "pch.h"
|
|
#include "EffectParts.h"
|
|
|
|
#include "GameInstance.h"
|
|
#include "Instance_Model.h"
|
|
|
|
CEffectParts::CEffectParts(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
|
: CEffectObject{ pDevice, pContext }
|
|
{
|
|
}
|
|
|
|
CEffectParts::CEffectParts(const CEffectParts& rhs)
|
|
: CEffectObject(rhs)
|
|
{
|
|
}
|
|
|
|
HRESULT CEffectParts::Initialize_Prototype()
|
|
{
|
|
return S_OK;
|
|
}
|
|
|
|
HRESULT CEffectParts::Initialize(void* pArg)
|
|
{
|
|
if (FAILED(__super::Initialize(pArg)))
|
|
return E_FAIL;
|
|
|
|
if (FAILED(Ready_Components(pArg)))
|
|
return E_FAIL;
|
|
|
|
|
|
Set_Visible(false);
|
|
|
|
return S_OK;
|
|
}
|
|
|
|
void CEffectParts::Priority_Update(_float fTimeDelta)
|
|
{
|
|
if (m_EffectInfo.isMotionBlur == true)
|
|
m_pTransformCom->RewindMomentum();
|
|
}
|
|
|
|
void CEffectParts::Update(_float fTimeDelta)
|
|
{
|
|
|
|
if (m_bVisible == false)
|
|
return;
|
|
|
|
if (m_pInstance_ModelCom == nullptr)
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
void CEffectParts::Late_Update(_float fTimeDelta)
|
|
{
|
|
|
|
if (m_bVisible == false)
|
|
return;
|
|
|
|
if (m_pInstance_ModelCom == nullptr)
|
|
return;
|
|
|
|
|
|
m_pInstance_ModelCom->Compute_CS(fTimeDelta);
|
|
|
|
|
|
if (m_EffectInfo.isBillboard)
|
|
m_pGameInstance->BillBoard(m_pTransformCom);
|
|
|
|
|
|
if (m_EffectInfo.isLightDissolve == true)
|
|
{
|
|
if (m_pLightCom != nullptr)
|
|
{
|
|
m_pLightCom->Update_IntensityRatio(fTimeDelta, m_EffectInfo.isLightTime, m_EffectInfo.fLightDeley);
|
|
}
|
|
}
|
|
|
|
|
|
if (m_EffectInfo.isBloom == true)
|
|
{
|
|
m_pGameInstance->Add_RenderGroup(RENDER::BLOOM, this);
|
|
}
|
|
|
|
|
|
if (m_EffectInfo.isBlur == true)
|
|
{
|
|
m_pGameInstance->Add_RenderGroup(RENDER::BLUR, this);
|
|
}
|
|
|
|
if (m_EffectInfo.isOnlyBlur == true)
|
|
return;
|
|
|
|
|
|
if (m_pLightCom != nullptr)
|
|
m_pGameInstance->Add_Light_Group(CURRENT_LEVEL, m_pLightCom);
|
|
|
|
m_pGameInstance->Add_RenderGroup(m_EffectInfo.eRenderOrder, this);
|
|
|
|
|
|
}
|
|
|
|
_vector CEffectParts::Get_WorldPostion()
|
|
{
|
|
return m_pTransformCom->Get_State(STATE::POSITION);
|
|
}
|
|
|
|
|
|
|
|
HRESULT CEffectParts::Ready_Components(void* pArg)
|
|
{
|
|
if (FAILED(__super::Ready_Components(pArg)))
|
|
{
|
|
return E_FAIL;
|
|
}
|
|
|
|
if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_INSTANCE_MODEL, (CComponent**)&m_pShaderCom, nullptr)))
|
|
{
|
|
return E_FAIL;
|
|
}
|
|
|
|
|
|
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Base_MRO"),
|
|
reinterpret_cast<CComponent**>(&m_pSurface_TextureCom))))
|
|
return E_FAIL;
|
|
|
|
return S_OK;
|
|
}
|
|
|
|
|
|
CEffectParts* CEffectParts::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
|
{
|
|
CEffectParts* pInstance = new CEffectParts(pDevice, pContext);
|
|
|
|
if (FAILED(pInstance->Initialize_Prototype()))
|
|
{
|
|
MSG_BOX("Failed to Created : CEffectParts");
|
|
SAFE_RELEASE(pInstance);
|
|
}
|
|
|
|
return pInstance;
|
|
}
|
|
|
|
CGameObject* CEffectParts::Clone(void* pArg, CGameObject* pOwner)
|
|
{
|
|
CEffectParts* pInstance = new CEffectParts(*this);
|
|
pInstance->m_pOwner = pOwner;
|
|
if (FAILED(pInstance->Initialize(pArg)))
|
|
{
|
|
MSG_BOX("Failed to Cloned : CEffectParts");
|
|
SAFE_RELEASE(pInstance);
|
|
}
|
|
|
|
return pInstance;
|
|
}
|
|
|
|
void CEffectParts::Free()
|
|
{
|
|
__super::Free();
|
|
|
|
}
|
|
#ifdef _DEBUG
|
|
|
|
void CEffectParts::Describe_Entity()
|
|
{
|
|
|
|
}
|
|
|
|
#endif // _DEBUG
|