[Modify] 병합

This commit is contained in:
qordlsgur
2025-12-02 13:43:48 +09:00
parent b5debf99c6
commit e3e1d6e11b
20 changed files with 450 additions and 2 deletions
@@ -1097,6 +1097,7 @@ PS_OUT PS_Spell_Header(PS_IN In)
return Out;
}
PS_OUT PS_Spell_Header_Line(PS_IN In)
{
PS_OUT Out;
@@ -1159,6 +1160,39 @@ PS_OUT PS_Spell_Header_Line(PS_IN In)
return Out;
}
PS_OUT PS_Spell_Drag(PS_IN In)
{
PS_OUT Out;
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
float4 Color = float4(1.f, 1.f, 1.f, 1.f);
float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord);
float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord);
float4 tex2Color = g_Texture3.Sample(DefaultSampler, In.vTexcoord);
Color = tex1;
tex2.rgb = tex2Color;
Color = lerp(Color, tex2, tex2.a);
float2 Imagetexpos1 = g_fImageUV.xy / g_fCurrent_Size;
float2 Imagetexsize1 = g_fImageUV.zw / g_fCurrent_Size;
float2 Imagelocal = (In.vTexcoord - Imagetexpos1) / Imagetexsize1;
bool inside1 = all(Imagelocal >= 0.0f && Imagelocal <= 1.0f);
float4 tex3 = g_Texture2.Sample(DefaultSampler, In.vTexcoord);
if (inside1)
{
Color = lerp(Color, tex3, tex3.a);
}
Color.a *= Alpha;
Out.vColor = Color;
return Out;
}
technique11 PosTexTechnique11
{
pass Default
@@ -1389,4 +1423,14 @@ technique11 PosTexTechnique11
PixelShader = compile ps_5_0 PS_Spell_Header_Line();
}
pass Spell_Drag
{
SetRasterizerState(RS_Default);
SetDepthStencilState(DSS_Default, 0);
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
VertexShader = compile vs_5_0 VS_MAIN();
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_Spell_Drag();
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 22 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 13 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 7.3 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 16 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 4.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 18 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 7.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 13 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 7.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 4.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

After

Width:  |  Height:  |  Size: 4.1 MiB

@@ -1097,6 +1097,7 @@ PS_OUT PS_Spell_Header(PS_IN In)
return Out;
}
PS_OUT PS_Spell_Header_Line(PS_IN In)
{
PS_OUT Out;
@@ -1159,6 +1160,39 @@ PS_OUT PS_Spell_Header_Line(PS_IN In)
return Out;
}
PS_OUT PS_Spell_Drag(PS_IN In)
{
PS_OUT Out;
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
float4 Color = float4(1.f, 1.f, 1.f, 1.f);
float4 tex1 = g_Texture.Sample(DefaultSampler, In.vTexcoord);
float4 tex2 = g_Texture1.Sample(DefaultSampler, In.vTexcoord);
float4 tex2Color = g_Texture3.Sample(DefaultSampler, In.vTexcoord);
Color = tex1;
tex2.rgb = tex2Color;
Color = lerp(Color, tex2, tex2.a);
float2 Imagetexpos1 = g_fImageUV.xy / g_fCurrent_Size;
float2 Imagetexsize1 = g_fImageUV.zw / g_fCurrent_Size;
float2 Imagelocal = (In.vTexcoord - Imagetexpos1) / Imagetexsize1;
bool inside1 = all(Imagelocal >= 0.0f && Imagelocal <= 1.0f);
float4 tex3 = g_Texture2.Sample(DefaultSampler, In.vTexcoord);
if (inside1)
{
Color = lerp(Color, tex3, tex3.a);
}
Color.a *= Alpha;
Out.vColor = Color;
return Out;
}
technique11 PosTexTechnique11
{
pass Default
@@ -1389,4 +1423,14 @@ technique11 PosTexTechnique11
PixelShader = compile ps_5_0 PS_Spell_Header_Line();
}
pass Spell_Drag
{
SetRasterizerState(RS_Default);
SetDepthStencilState(DSS_Default, 0);
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
VertexShader = compile vs_5_0 VS_MAIN();
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_Spell_Drag();
}
}
@@ -1 +1,303 @@
#include "pch.h"
#include "Spell_Drag.h"
#include "GameInstance.h"
CSpell_Drag::CSpell_Drag(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
:CElementObject(pDevice, pContext)
{
}
CSpell_Drag::CSpell_Drag(const CSpell_Drag& rhs)
:CElementObject(rhs)
{
}
HRESULT CSpell_Drag::Initialize_Prototype()
{
return S_OK;
}
HRESULT CSpell_Drag::Initialize(void* pArg)
{
CUIObject::UIOBJECT_DESC Desc{};
Desc.fX = 380.f;
Desc.fY = 30.f;
Desc.fSizeX = 105.f;
Desc.fSizeY = 105.f;
m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) };
if (FAILED(__super::Initialize(&Desc)))
{
return E_FAIL;
}
if (FAILED(Ready_Components(pArg)))
{
return E_FAIL;
}
m_fTimeMult = 3.f;
m_fAlpha = 1.f;
m_fAlphaTime = 1.f;
m_iSkillType = ENUM_CLASS(SKILL_TYPE::ARRESTO_MOMENTUM);
Compute_UI(m_iSkillType);
static_cast<CUIObject*>(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SpellType(*reinterpret_cast<_int*>(p)); });
return S_OK;
}
void CSpell_Drag::Priority_Update(_float fTimeDelta)
{
if (!__super::Chack_Visible())
{
return;
}
__super::Priority_Update(fTimeDelta);
}
void CSpell_Drag::Update(_float fTimeDelta)
{
if (!__super::Chack_Visible())
{
return;
}
if (m_bFadeIn == true)
{
if (m_fAlpha <= 1.f)
m_fAlpha += fTimeDelta * m_fAlphaTime;
if (m_fAlpha >= 1.f)
{
m_bFadeIn = false;
m_fAlpha = 1.f;
}
}
if (m_bFadeOut == true)
{
if (m_fAlpha >= 0.f)
m_fAlpha -= fTimeDelta;
if (m_fAlpha <= 0.f)
{
m_bFadeOut = false;
m_fAlpha = 0.f;
}
}
m_fTime += fTimeDelta * m_fTimeMult;
__super::Update(fTimeDelta);
}
void CSpell_Drag::Late_Update(_float fTimeDelta)
{
if (!__super::Chack_Visible())
{
return;
}
if (m_bVisible) {
m_pGameInstance->Add_RenderGroup(RENDER::UI, this);
}
__super::Late_Update(fTimeDelta);
}
HRESULT CSpell_Drag::Render()
{
if (FAILED(Bind_ShaderResources()))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELL_DRAG))))
{
return E_FAIL;
}
if (FAILED(m_pVIBufferCom->Bind_Resources()))
{
return E_FAIL;
}
if (FAILED(m_pVIBufferCom->Render()))
{
return E_FAIL;
}
return S_OK;
}
_vector CSpell_Drag::Get_WorldPostion()
{
return m_pTransformCom->Get_State(STATE::POSITION);
}
HRESULT CSpell_Drag::Bind_ShaderResources()
{
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix")))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", &m_ViewMatrix)))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", &m_ProjMatrix)))
{
return E_FAIL;
}
if (FAILED(m_pDiffuse_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_Texture", 0)))
{
return E_FAIL;
}
if (FAILED(m_pDiffuse_TextureCom1->Bind_ShaderResource(m_pShaderCom, "g_Texture1", 0)))
{
return E_FAIL;
}
if (FAILED(m_pDiffuse_TextureCom2->Bind_ShaderResource(m_pShaderCom, "g_Texture2", 0)))
{
return E_FAIL;
}
if (FAILED(m_pDiffuse_TextureCom3->Bind_ShaderResource(m_pShaderCom, "g_Texture3", 0)))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float))))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, sizeof(_float))))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fAngle", &m_fAngle, sizeof(_float))))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float))))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fOwnerAlpha", &m_fOwnerAlpha, sizeof(_float))))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fCanvasAlpha", &m_fCanvasAlpha, sizeof(_float))))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageUV", &m_vUV, sizeof(_float4))))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fCurrent_Size", &m_vScale, sizeof(_float4))))
{
return E_FAIL;
}
return S_OK;
}
HRESULT CSpell_Drag::Ready_Components(void* pArg)
{
if (FAILED(Add_Component<CVIBuffer_Rect>(g_iStaticLevel, &m_pVIBufferCom)))
{
return E_FAIL;
}
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SpellType_Generic"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
{
return E_FAIL;
}
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SelectedPresetBorder"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom1), nullptr)))
{
return E_FAIL;
}
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_GoldLeaf"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom2), nullptr)))
{
return E_FAIL;
}
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Atlas_Spell"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom3), nullptr)))
{
return E_FAIL;
}
if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr)))
{
return E_FAIL;
}
return S_OK;
}
void CSpell_Drag::Compute_UI(_uint SpellID)
{
_float2 fImage_Size = { 1024.f, 1536.f };
_uint iCountX = 4;
_uint iCountY = 6;
_float iImageX = 256.f;
_float iImageY = 256.f;
_uint iframeX = SpellID % iCountX;
_uint iframeY = SpellID / iCountX;
_float2 UVStart;
UVStart.x = iframeX * iImageX / fImage_Size.x;
UVStart.y = iframeY * iImageY / fImage_Size.y;
_float2 UVEnd;
UVEnd.x = UVStart.x + (iImageX / fImage_Size.x);
UVEnd.y = UVStart.y + (iImageY / fImage_Size.y);
_float4 UV = _float4{ UVStart.x, UVStart.y, UVEnd.x, UVEnd.y };
m_vUV = UV;
}
void CSpell_Drag::Set_SpellType(_int SpellID)
{
m_iSkillType = SpellID;
if (m_iSkillType != -1)
{
m_iSkillType = static_cast<CUIObject*>(m_pOwner)->Get_Info(SpellID).iSkill_Type;
Compute_UI(m_iSkillType);
}
}
CSpell_Drag* CSpell_Drag::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
{
CSpell_Drag* pInstance = new CSpell_Drag(pDevice, pContext);
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CSpell_Drag");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
CGameObject* CSpell_Drag::Clone(void* pArg, CGameObject* pOwner)
{
CSpell_Drag* pInstance = new CSpell_Drag(*this);
pInstance->m_pOwner = pOwner;
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CSpell_Drag");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CSpell_Drag::Free()
{
__super::Free();
SAFE_RELEASE(m_pDiffuse_TextureCom);
SAFE_RELEASE(m_pDiffuse_TextureCom1);
SAFE_RELEASE(m_pDiffuse_TextureCom2);
SAFE_RELEASE(m_pDiffuse_TextureCom3);
SAFE_RELEASE(m_pShaderCom);
SAFE_RELEASE(m_pVIBufferCom);
}
void CSpell_Drag::Describe_Entity()
{
}
@@ -28,7 +28,7 @@ namespace Editor
enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR , TRAIL_BLOOM, END };
enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, BLEND, BLEND_NOWORLD, BLOOM, BLOOM_NOWORLD, END };
enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, SPELL_ANIM, NINECLICE, ROTATION, SLOT, TYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, SPELL_PREVIEW, SPELL_HEADER, SPELL_HEADER_LINE, END };
enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, SPELL_ANIM, NINECLICE, ROTATION, SLOT, TYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, SPELL_PREVIEW, SPELL_HEADER, SPELL_HEADER_LINE, SPELL_DRAG, END };
enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, COLOR, SPELL_HOVER, SPELL_SLOT_EFFECT, END };
+46 -1
View File
@@ -1,5 +1,50 @@
#pragma once
class CSpell_Drag
#include "Editor_Define.h"
#include "ElementObject.h"
NS_BEGIN(Editor)
class CSpell_Drag final : public CElementObject
{
private:
CSpell_Drag(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CSpell_Drag(const CSpell_Drag& rhs);
virtual ~CSpell_Drag() = 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 Compute_UI(_uint SpellID);
virtual void Set_SpellType(_int SpellID) override;
private:
CTexture* m_pDiffuse_TextureCom = { nullptr };
CTexture* m_pDiffuse_TextureCom1 = { nullptr };
CTexture* m_pDiffuse_TextureCom2 = { nullptr };
CTexture* m_pDiffuse_TextureCom3 = { nullptr };
CShader* m_pShaderCom = { nullptr };
CVIBuffer_Rect* m_pVIBufferCom = { nullptr };
_float4 m_vUV{};
public:
static CSpell_Drag* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
virtual void Free() override;
void Describe_Entity() override;
};
NS_END
@@ -455,6 +455,16 @@ _int CUIObject::Get_SkillType()
return m_iSpellType;
}
void CUIObject::Set_SpellType(_int eType)
{
m_iSkillType = eType;
}
_int CUIObject::Get_SpellType()
{
return m_iSkillType;
}
void CUIObject::Set_CoolTime(_float CoolTime)
{
m_fCoolTime = CoolTime;
+3
View File
@@ -121,6 +121,8 @@ typedef struct SlotHover
virtual void Set_SkillType(_int eType);
virtual _int Get_SkillType();
virtual void Set_SpellType(_int eType);
virtual _int Get_SpellType();
virtual void Set_CoolTime(_float CoolTime);
virtual _float Get_CoolTime();
@@ -175,6 +177,7 @@ typedef struct SlotHover
RECT m_pRect{};
_int m_iSpellType{};
_int m_iSkillType{};
_float m_fSortZ{};
_float m_fMoveSpeed{};