[Modify] 데미지 폰트 연동
This commit is contained in:
@@ -1,147 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "CDamageFont.h"
|
||||
#include "GameInstance.h"
|
||||
#include "InfoInstance.h"
|
||||
|
||||
CDamageFont::CDamageFont(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CGameObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CDamageFont::CDamageFont(const CDamageFont& rhs)
|
||||
:CGameObject(rhs),
|
||||
m_pInfoInstance(CInfoInstance::GetInstance())
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDamageFont::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDamageFont::Initialize(void* pArg)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CDamageFont::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CDamageFont::Update(_float fTimeDelta)
|
||||
{
|
||||
if (!m_DamageInfos.empty())
|
||||
{
|
||||
for (auto iter = m_DamageInfos.begin(); iter != m_DamageInfos.end();)
|
||||
{
|
||||
if (iter->fTime <= 0.f)
|
||||
iter = m_DamageInfos.erase(iter);
|
||||
else
|
||||
{
|
||||
iter->fTime -= fTimeDelta;
|
||||
iter->fAlpha -= fTimeDelta;
|
||||
|
||||
iter->vColor = XMVectorSet(
|
||||
iter->vColor.m128_f32[0] * iter->fAlpha,
|
||||
iter->vColor.m128_f32[1] * iter->fAlpha,
|
||||
iter->vColor.m128_f32[2] * iter->fAlpha,
|
||||
iter->fAlpha);
|
||||
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CDamageFont::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CDamageFont::Render()
|
||||
{
|
||||
if (!m_DamageInfos.empty())
|
||||
{
|
||||
for (auto iter = m_DamageInfos.begin(); iter != m_DamageInfos.end();)
|
||||
{
|
||||
m_pGameInstance->Perspective_Render_Text(
|
||||
m_pGameInstance->Get_Transform_Matrix(D3DTS::VIEW),
|
||||
m_pGameInstance->Get_Transform_Matrix(D3DTS::PROJ),
|
||||
TEXT("UI_size13"),
|
||||
iter->pDamage.c_str(),
|
||||
iter->vTarget_Pos,
|
||||
iter->vColor
|
||||
);
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
_vector CDamageFont::Get_WorldPostion()
|
||||
{
|
||||
return m_pTransformCom->Get_State(STATE::POSITION);
|
||||
}
|
||||
|
||||
HRESULT CDamageFont::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CDamageFont::Ready_Components(void* pArg)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CDamageFont::Add_Damage(DAMAGE_INFO pInfo)
|
||||
{
|
||||
DAMAGE_FONT_INFO Desc;
|
||||
|
||||
Desc.vTarget_Pos = pInfo.vTarget_Pos;
|
||||
Desc.pDamage = to_wstring(pInfo.fDamage);
|
||||
if (pInfo.eType == DAMAGE_TYPE::NOMAL)
|
||||
{
|
||||
Desc.vColor = XMVectorSet(1.f ,1.f,1.f,1.f);
|
||||
}
|
||||
else
|
||||
{
|
||||
Desc.vColor = XMVectorSet((215.f / 255.f), (185.f / 255.f), (95.f / 255.f), 1.f);
|
||||
}
|
||||
|
||||
m_DamageInfos.push_back(Desc);
|
||||
}
|
||||
|
||||
CDamageFont* CDamageFont::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CDamageFont* pInstance = new CDamageFont(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CDamageFont");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CDamageFont::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CDamageFont* pInstance = new CDamageFont(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CDamageFont");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CDamageFont::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CDamageFont::Describe_Entity()
|
||||
{
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@@ -1,60 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CTexture;
|
||||
class CShader;
|
||||
class CVIBuffer_Rect;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CDamageFont final : public CGameObject
|
||||
{
|
||||
typedef struct tagDamageFontInfo
|
||||
{
|
||||
_vector vTarget_Pos{};
|
||||
_wstring pDamage;
|
||||
_float fTime = 1.f;
|
||||
_float fAlpha = 1.f;
|
||||
_vector vColor{};
|
||||
}DAMAGE_FONT_INFO;
|
||||
private:
|
||||
CDamageFont(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CDamageFont(const CDamageFont& rhs);
|
||||
virtual ~CDamageFont() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta);
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Late_Update(_float fTimeDelta);
|
||||
virtual HRESULT Render() override;
|
||||
virtual _vector Get_WorldPostion() override;
|
||||
|
||||
private:
|
||||
virtual HRESULT Bind_ShaderResources() override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
private:
|
||||
void Add_Damage(DAMAGE_INFO pInfo);
|
||||
|
||||
private:
|
||||
CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
|
||||
vector<DAMAGE_FONT_INFO> m_DamageInfos;
|
||||
|
||||
public:
|
||||
static CDamageFont* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END;
|
||||
@@ -164,6 +164,7 @@ call Update_Resources.bat
|
||||
<ClInclude Include="..\Public\CameraLockOn.h" />
|
||||
<ClInclude Include="..\Public\Current_Slot_Number.h" />
|
||||
<ClInclude Include="..\Public\Current_Spell_Slot.h" />
|
||||
<ClInclude Include="..\Public\Damage_Font.h" />
|
||||
<ClInclude Include="..\Public\Eessential_Spell.h" />
|
||||
<ClInclude Include="..\Public\Eessential_Spell_Slot.h" />
|
||||
<ClInclude Include="..\Public\Enemy_HpBar.h" />
|
||||
@@ -312,7 +313,6 @@ call Update_Resources.bat
|
||||
<ClInclude Include="..\public\UI_Manager.h" />
|
||||
<ClInclude Include="..\public\Unified.h" />
|
||||
<ClInclude Include="..\Public\Wand.h" />
|
||||
<ClInclude Include="CDamageFont.h" />
|
||||
<ClInclude Include="Client.h" />
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
@@ -325,6 +325,7 @@ call Update_Resources.bat
|
||||
<ClCompile Include="..\Private\CameraLockOn.cpp" />
|
||||
<ClCompile Include="..\Private\Current_Slot_Number.cpp" />
|
||||
<ClCompile Include="..\Private\Current_Spell_Slot.cpp" />
|
||||
<ClCompile Include="..\Private\Damage_Font.cpp" />
|
||||
<ClCompile Include="..\Private\Eessential_Spell.cpp" />
|
||||
<ClCompile Include="..\Private\Eessential_Spell_Slot.cpp" />
|
||||
<ClCompile Include="..\Private\Enemy_HpBar.cpp" />
|
||||
@@ -477,7 +478,6 @@ call Update_Resources.bat
|
||||
<ClCompile Include="..\private\UI_Manager.cpp" />
|
||||
<ClCompile Include="..\private\Unified.cpp" />
|
||||
<ClCompile Include="..\Private\Wand.cpp" />
|
||||
<ClCompile Include="CDamageFont.cpp" />
|
||||
<ClCompile Include="Client.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -491,12 +491,13 @@
|
||||
<ClInclude Include="..\Public\Goblin_Attack.h">
|
||||
<Filter>02.GameObjects\Effect\MonsterEffect\Goblin_Attack</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="CDamageFont.h">
|
||||
<Filter>04.Mechanic\Damage</Filter>
|
||||
</ClInclude>
|
||||
|
||||
<ClInclude Include="..\Public\Goblin_BattleAxe.h">
|
||||
<Filter>02.GameObjects\Item\Goblin_Axe</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Damage_Font.h">
|
||||
<Filter>04.Mechanic\Damage</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Client.ico">
|
||||
@@ -1482,7 +1483,8 @@
|
||||
<ClCompile Include="..\Private\Goblin_Attack.cpp">
|
||||
<Filter>02.GameObjects\Effect\MonsterEffect\Goblin_Attack</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="CDamageFont.cpp">
|
||||
|
||||
<ClCompile Include="..\Private\Damage_Font.cpp">
|
||||
<Filter>04.Mechanic\Damage</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
|
||||
Reference in New Issue
Block a user