diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 1aee12e67..6d883bd57 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -1,3 +1,4 @@ + #include "Engine_Shader_Defines.hlsli" matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; diff --git a/Jusin154_Team3D/Client/Private/Slot_Number.cpp b/Jusin154_Team3D/Client/Private/Slot_Number.cpp index 675349f6b..0e7a0d043 100644 --- a/Jusin154_Team3D/Client/Private/Slot_Number.cpp +++ b/Jusin154_Team3D/Client/Private/Slot_Number.cpp @@ -211,17 +211,13 @@ HRESULT CSlot_Number::Ready_Components(void* pArg) void CSlot_Number::UV() { - pUVDesc[0].fUVStart = Meter_Index(1); - pUVDesc[0].fUVEnd = Compute_UVY(1); - pUVDesc[1].fUVStart = Meter_Index(2); - pUVDesc[1].fUVEnd = Compute_UVY(2); - pUVDesc[2].fUVStart = Meter_Index(3); - pUVDesc[2].fUVEnd = Compute_UVY(3); - pUVDesc[3].fUVStart = Meter_Index(4); - pUVDesc[3].fUVEnd = Compute_UVY(4); + pUVDesc[0].fUV = Meter_Index(1); + pUVDesc[1].fUV = Meter_Index(2); + pUVDesc[2].fUV = Meter_Index(3); + pUVDesc[3].fUV = Meter_Index(4); } -_float2 CSlot_Number::Meter_Index(_uint Number) +_float4 CSlot_Number::Meter_Index(_uint Number) { m_fIamge_Size = { 320.f, 128.f }; @@ -234,29 +230,15 @@ _float2 CSlot_Number::Meter_Index(_uint Number) _uint frameX = Number % iXCount; _uint frameY = Number / iXCount; - _float2 UVStart; - UVStart.x = frameX * frameWidth / m_fIamge_Size.x; - UVStart.y = frameY * frameHeight / m_fIamge_Size.y; + _float4 UV; + UV.x = frameX * frameWidth / m_fIamge_Size.x; + UV.y = frameY * frameHeight / m_fIamge_Size.y; + UV.z = UV.x + (frameWidth / m_fIamge_Size.x); + UV.w = UV.y + (frameHeight / m_fIamge_Size.y); - return UVStart; + return UV; } -_float2 CSlot_Number::Compute_UVY(_uint Number) -{ - m_fIamge_Size = { 320.f, 128.f }; - - _float frameWidth = 64.f; - _float frameHeight = 64.f; - - // Start 구함 - _float2 UVStart = Meter_Index(Number); - - _float2 UVEnd; - UVEnd.x = UVStart.x + (frameWidth / m_fIamge_Size.x); - UVEnd.y = UVStart.y + (frameHeight / m_fIamge_Size.y); - - return UVEnd; -} CSlot_Number* CSlot_Number::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { diff --git a/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp index d7335caec..88571df96 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Overlay.cpp @@ -55,10 +55,10 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) void CSpell_Overlay::Compute_UI(_uint SpellID) { - _float2 fImage_Size = { 1024.f, 1536.f }; + _float2 fImage_Size = { 1024.f, 1792.f }; _uint iCountX = 4; - _uint iCountY = 6; + _uint iCountY = 7; _float iImageX = 256.f; _float iImageY = 256.f; @@ -201,6 +201,10 @@ HRESULT CSpell_Overlay::Bind_ShaderResources() { 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; @@ -274,6 +278,10 @@ HRESULT CSpell_Overlay::Ready_Components(void* pArg) { return E_FAIL; } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_tillingSmokes"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) + { + return E_FAIL; + } if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) { return E_FAIL; @@ -315,6 +323,7 @@ void CSpell_Overlay::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); } diff --git a/Jusin154_Team3D/Client/Private/Spell_Slot.cpp b/Jusin154_Team3D/Client/Private/Spell_Slot.cpp index cb57aa16d..64dde823a 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Slot.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Slot.cpp @@ -39,7 +39,7 @@ HRESULT CSpell_Slot::Initialize(void* pArg) m_fAlpha = 1.f; m_fTimeMult = 3.f; - m_fAngle = XMConvertToRadians(45); + m_fAngle = XMConvertToRadians(-135); m_fAlphaTime = 1.f; m_fOffSetX = 101.f; m_fOffSetY = 101.f; diff --git a/Jusin154_Team3D/Client/Public/Slot_Number.h b/Jusin154_Team3D/Client/Public/Slot_Number.h index 0d30e7301..7b4ad290b 100644 --- a/Jusin154_Team3D/Client/Public/Slot_Number.h +++ b/Jusin154_Team3D/Client/Public/Slot_Number.h @@ -33,8 +33,7 @@ class CSlot_Number final : public CElementObject virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; void UV(); - _float2 Meter_Index(_uint Numver); - _float2 Compute_UVY(_uint Numver); + _float4 Meter_Index(_uint Numver); virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; diff --git a/Jusin154_Team3D/Client/Public/Spell_Overlay.h b/Jusin154_Team3D/Client/Public/Spell_Overlay.h index ae3ce440e..2b889685c 100644 --- a/Jusin154_Team3D/Client/Public/Spell_Overlay.h +++ b/Jusin154_Team3D/Client/Public/Spell_Overlay.h @@ -39,6 +39,7 @@ class CSpell_Overlay final : public CElementObject 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 }; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 1aee12e67..6d883bd57 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -1,3 +1,4 @@ + #include "Engine_Shader_Defines.hlsli" matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl index d6b238656..48fe88d12 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl @@ -18,8 +18,7 @@ struct VS_IN float2 vSize : TEXCOORD1; float2 vPos : TEXCOORD2; - float2 vUVStart : TEXCOORD3; - float2 vUVEnd: TEXCOORD4; + float4 vUV: TEXCOORD3; }; struct VS_OUT @@ -36,14 +35,13 @@ VS_OUT VS_MAIN(VS_IN In) float3 vLocalPos = In.vPosition; vLocalPos.xy *= In.vSize; vLocalPos.xy += In.vPos; - float2 StartUV = In.vUVStart; - float2 EndUV = In.vUVEnd; + float4 UV = In.vUV; float3 vParentPos = float3(g_WorldMatrix._41, g_WorldMatrix._42, g_WorldMatrix._43); float3 vFinalWorldPos = vLocalPos + vParentPos; Out.vPosition = mul(float4(vFinalWorldPos, 1.f), matVP); - Out.vTexcoord = StartUV + In.vTexcoord * (EndUV - StartUV); + Out.vTexcoord = UV.xy + In.vTexcoord * (UV.zw - UV.xy); return Out; } @@ -124,6 +122,71 @@ PS_OUT PS_Megic_Meter(PS_IN In) return Out; } +PS_OUT PS_Spell_List(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float3 Blue = float3(41.f, 165.f, 255.f) / 255.f; + + float4 color = float4(1.f, 1.f, 1.f, 1.f); + float4 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord); + float4 tex2 = g_Texture1.Sample(ClampSampler, In.vTexcoord); + + color = tex1; + tex2.rgb *= Blue * 1.5f; + + if (all(color.rgb >= float3(65.f / 255.f, 65.f / 255.f, 65.f / 255.f))) + color = tex2; + + //if(color.a <= 0.4f) + // discard; + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + +PS_OUT PS_Eessential_Spell_Slot(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float3 Blue = float3(41.f, 165.f, 255.f) / 255.f; + + float4 color = float4(1.f, 1.f, 1.f, 1.f); + float4 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord); + float4 tex2 = g_Texture1.Sample(ClampSampler, In.vTexcoord); + + color = tex1; + + color = lerp(tex1, tex2, tex2.a); + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + +PS_OUT PS_Eessential_Spell(PS_IN In) +{ + PS_OUT Out; + float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha; + float3 Blue = float3(41.f, 165.f, 255.f) / 255.f; + + float4 color = float4(1.f, 1.f, 1.f, 1.f); + float4 tex1 = g_Texture.Sample(ClampSampler, In.vTexcoord); + + color = tex1; + + color.a *= Alpha; + + Out.vColor = color; + + return Out; +} + technique11 PosTexTechnique11 { pass Default @@ -158,4 +221,37 @@ technique11 PosTexTechnique11 GeometryShader = NULL; PixelShader = compile ps_5_0 PS_Megic_Meter(); } + + pass Spell_List + { + 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_List(); + } + + pass Eessential_Spell_Slot + { + 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_Eessential_Spell_Slot(); + } + + pass Eessential_Spell + { + 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_Eessential_Spell(); + } } diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/HUD/UI_T_NoFlyIcon.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/MiniMap/UI_T_NoFlyIcon.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/HUD/UI_T_NoFlyIcon.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/MiniMap/UI_T_NoFlyIcon.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/HUD/UI_T_NoMountIcon.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/MiniMap/UI_T_NoMountIcon.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/HUD/UI_T_NoMountIcon.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/MiniMap/UI_T_NoMountIcon.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Spell_Widget.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Spell_Widget.png index bd3c9cea3..f8ec4801b 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Spell_Widget.png and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/Spell_Widget.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonHighlight.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonHighlight.png new file mode 100644 index 000000000..867ef1d40 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_IconButtonHighlight.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_NewLock.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_NewLock.png new file mode 100644 index 000000000..5e3716df2 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_NewLock.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedBorderExtended_4K.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedBorderExtended_4K.png new file mode 100644 index 000000000..b5128f7bf Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SelectedBorderExtended_4K.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_SpellType_Generic.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SpellType_Generic.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_SpellType_Generic.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SpellType_Generic.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_SpellType_InnerShadow.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SpellType_InnerShadow.png similarity index 100% rename from Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_SpellType_InnerShadow.png rename to Jusin154_Team3D/Editor/Bin/Resources/Textures/SpellWidget/UI_T_SpellType_InnerShadow.png diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Altas_Eessential.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Altas_Eessential.dds new file mode 100644 index 000000000..0a0543a48 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Altas_Eessential.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Atlas_Widget_Spell.dds b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Atlas_Widget_Spell.dds new file mode 100644 index 000000000..66d912ed0 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Atlas_Widget_Spell.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Conjuration.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Conjuration.png deleted file mode 100644 index e865c8647..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Conjuration.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Descendo.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Descendo.png deleted file mode 100644 index 23163f45e..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/Descendo.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_reparo.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_reparo.png deleted file mode 100644 index 7b0f22d55..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_reparo.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_Crucio.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_Crucio.png deleted file mode 100644 index 61cdd37f4..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_Crucio.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformation_4K.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformation_4K.png deleted file mode 100644 index a0bba2153..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformation_4K.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformationoverland.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformationoverland.png deleted file mode 100644 index 6c0797351..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_spell_transformationoverland.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_wingardium.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_wingardium.png deleted file mode 100644 index 4196a09cf..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/UI_T_wingardium.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/accio.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/accio.png deleted file mode 100644 index 2bce2fb55..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/accio.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/arrestomomentum.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/arrestomomentum.png deleted file mode 100644 index 62cb4c8a5..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/arrestomomentum.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/avadakedavra.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/avadakedavra.png deleted file mode 100644 index 1d0cb34a1..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/avadakedavra.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/confringo.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/confringo.png deleted file mode 100644 index fe2968523..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/confringo.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/depulso.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/depulso.png deleted file mode 100644 index ed98ea5d7..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/depulso.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/diffindo.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/diffindo.png deleted file mode 100644 index 919119ab1..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/diffindo.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expelliarmus.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expelliarmus.png deleted file mode 100644 index b272c4fa8..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expelliarmus.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expulso.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expulso.png deleted file mode 100644 index 91a3a6b73..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/expulso.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/glacius.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/glacius.png deleted file mode 100644 index 06f10cee2..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/glacius.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/imperius.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/imperius.png deleted file mode 100644 index b4315b7a6..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/imperius.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/incendio.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/incendio.png deleted file mode 100644 index d9ce34549..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/incendio.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/levioso.png b/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/levioso.png deleted file mode 100644 index e5b078558..000000000 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Textures/Spells/levioso.png and /dev/null differ diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 97c92149b..9a8f3bfa1 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -208,6 +208,8 @@ + + @@ -251,6 +253,8 @@ + + @@ -346,6 +350,8 @@ + + @@ -391,6 +397,8 @@ + + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 741323ffe..c5a8a4631 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -388,6 +388,18 @@ {c7b1ffc6-548f-464c-8f19-8b6ff5913b06} + + {8d15e456-f0d7-45b6-b725-7f1a8c0f6b0f} + + + {bae34bc2-3b69-40c0-8c9a-278dba07c8aa} + + + {1700ba11-4e28-4934-b757-bfed96b74503} + + + {da710064-ef45-41e1-8fc5-1fc544cb4cb8} + @@ -756,6 +768,18 @@ 50.UI\Spell_Canvas\Spell_Panel\Current_Spell_Slot + + 50.UI\Spell_Canvas\Spell_Panel\Spell_List + + + 50.UI\Spell_Canvas\Spell_Panel\Eessential_Spell_Slot + + + 50.UI\Spell_Canvas\Spell_Panel\Eessential_Spell + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_List_Image + @@ -1123,6 +1147,18 @@ 50.UI\Spell_Canvas\Spell_Panel\Current_Spell_Slot + + 50.UI\Spell_Canvas\Spell_Panel\Spell_List + + + 50.UI\Spell_Canvas\Spell_Panel\Eessential_Spell_Slot + + + 50.UI\Spell_Canvas\Spell_Panel\Eessential_Spell + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_List_Image + diff --git a/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp index 5e22856f8..959fee00c 100644 --- a/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/Current_Spell_Slot.cpp @@ -39,13 +39,13 @@ HRESULT CCurrent_Spell_Slot::Initialize(void* pArg) m_fAlpha = 1.f; m_fTimeMult = 3.f; - m_fAngle = XMConvertToRadians(45); + m_fAngle = XMConvertToRadians(-135); m_fAlphaTime = 1.f; m_fOffSetX = 105.f; m_fOffSetY = 150.f; m_iCols = 4; m_pVIBufferCom->Set_Cloned(true); - m_pVIBufferCom->Set_Pos(-780.f, -110.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Pos(-780.f, 340.f, m_fOffSetX, m_fOffSetY, m_iCols); m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); m_pVIBufferCom->Set_ImageUV(); return S_OK; @@ -113,7 +113,7 @@ HRESULT CCurrent_Spell_Slot::Render() { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::DEFAULT)))) + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::DEFAULT)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Eessential_Spell.cpp b/Jusin154_Team3D/Editor/Private/Eessential_Spell.cpp new file mode 100644 index 000000000..ab66cc828 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Eessential_Spell.cpp @@ -0,0 +1,283 @@ +#include "pch.h" +#include "Eessential_Spell.h" +#include "GameInstance.h" + +CEessential_Spell::CEessential_Spell(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CEessential_Spell::CEessential_Spell(const CEessential_Spell& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CEessential_Spell::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CEessential_Spell::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 40.f; + Desc.fSizeY = 40.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_fAlpha = 1.f; + m_fTimeMult = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 80.f; + m_fOffSetY = 80.f; + m_iCols = 4; + UV(); + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-731.f, -300.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + m_pVIBufferCom->Set_ImageUV(pUVDesc); + return S_OK; +} + +void CEessential_Spell::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CEessential_Spell::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 CEessential_Spell::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CEessential_Spell::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::EESSENTIAL_SPELL)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CEessential_Spell::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CEessential_Spell::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CEessential_Spell::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CEessential_Spell::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CEessential_Spell::UV() +{ + for (_uint i = 0; i < 8; ++i) + { + pUVDesc[i].fUV = Meter_Index(i); + } +} + +_float4 CEessential_Spell::Meter_Index(_uint Number) +{ + _float2 fImage_Size = _float2{ 512.f, 256.f}; + + _uint iXCount = 4; + _uint iYCount = 2; + + _float frameWidth = 128.f; + _float frameHeight = 128.f; + + _uint frameX = Number % iXCount; + _uint frameY = Number / iXCount; + + _float4 UV{}; + UV.x = frameX * frameWidth / fImage_Size.x; + UV.y = frameY * frameHeight / fImage_Size.y; + UV.z = UV.x + (frameWidth / fImage_Size.x); + UV.w = UV.y + (frameHeight / fImage_Size.y); + + return UV; +} + +HRESULT CEessential_Spell::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_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), 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; + } + + return S_OK; +} + +HRESULT CEessential_Spell::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Eessential_Spell"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Altas_Eessential"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CEessential_Spell* CEessential_Spell::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CEessential_Spell* pInstance = new CEessential_Spell(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CEessential_Spell"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CEessential_Spell::Clone(void* pArg, CGameObject* pOwner) +{ + CEessential_Spell* pInstance = new CEessential_Spell(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CEessential_Spell"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CEessential_Spell::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CEessential_Spell::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp new file mode 100644 index 000000000..3d46acf32 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp @@ -0,0 +1,261 @@ +#include "pch.h" +#include "Eessential_Spell_Slot.h" +#include "GameInstance.h" + +CEessential_Spell_Slot::CEessential_Spell_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CEessential_Spell_Slot::CEessential_Spell_Slot(const CEessential_Spell_Slot& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CEessential_Spell_Slot::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CEessential_Spell_Slot::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 65.f; + Desc.fSizeY = 65.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_fAlpha = 1.f; + m_fTimeMult = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 80.f; + m_fOffSetY = 80.f; + m_iCols = 4; + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos( -731.f, -300.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + m_pVIBufferCom->Set_ImageUV(); + return S_OK; +} + +void CEessential_Spell_Slot::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CEessential_Spell_Slot::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 CEessential_Spell_Slot::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CEessential_Spell_Slot::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::EESSENTIAL_SPELL_SOLT)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CEessential_Spell_Slot::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CEessential_Spell_Slot::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CEessential_Spell_Slot::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CEessential_Spell_Slot::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +HRESULT CEessential_Spell_Slot::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_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), 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; + } + + return S_OK; +} + +HRESULT CEessential_Spell_Slot::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Eessential_Spell_Slot"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_ActionItemBG"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_ActionDiamondTriggerBack_4K"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CEessential_Spell_Slot* CEessential_Spell_Slot::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CEessential_Spell_Slot* pInstance = new CEessential_Spell_Slot(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CEessential_Spell_Slot"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CEessential_Spell_Slot::Clone(void* pArg, CGameObject* pOwner) +{ + CEessential_Spell_Slot* pInstance = new CEessential_Spell_Slot(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CEessential_Spell_Slot"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CEessential_Spell_Slot::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CEessential_Spell_Slot::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 160b367c4..b47e34c56 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -66,6 +66,10 @@ #include "Spell_Canvas.h" #include "Spell_Panel.h" #include "Current_Spell_Slot.h" +#include "Spell_List.h" +#include "Eessential_Spell_Slot.h" +#include "Eessential_Spell.h" +#include "Spell_List_Image.h" #include "IMGUIUI.h" @@ -383,22 +387,6 @@ HRESULT CLoader::Loading_For_UI() _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, - CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { - return E_FAIL; - } - - return S_OK; - - }); - - Asset_FileLoad("../Bin/Resources/Textures/HUD", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) - { - - _string strFilePath = pFilePath; - _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { return E_FAIL; @@ -479,6 +467,22 @@ HRESULT CLoader::Loading_For_UI() _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); + + Asset_FileLoad("../Bin/Resources/Textures/GadgetWheel", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) + { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName, CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { return E_FAIL; @@ -513,6 +517,42 @@ HRESULT CLoader::Loading_For_UI() return E_FAIL; } + CVIBuffer_UI_Instance::UI_INSTANCE_DESC Spell_List{}; + + Spell_List.iNum = 26; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &Spell_List)))) { + return E_FAIL; + } + + CVIBuffer_UI_Instance::UI_INSTANCE_DESC Eessential_Spell_Slot{}; + + Eessential_Spell_Slot.iNum = 8; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Eessential_Spell_Slot"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &Eessential_Spell_Slot)))) { + return E_FAIL; + } + + CVIBuffer_UI_Instance::UI_INSTANCE_DESC Eessential_Spell{}; + + Eessential_Spell.iNum = 8; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Eessential_Spell"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &Eessential_Spell)))) { + return E_FAIL; + } + + CVIBuffer_UI_Instance::UI_INSTANCE_DESC Spell_List_Image{}; + + Spell_List_Image.iNum = 26; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List_Image"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &Spell_List_Image)))) { + return E_FAIL; + } + CVIBuffer_UI_Instance::UI_INSTANCE_DESC SlotNumberUIDesc{}; SlotNumberUIDesc.iNum = 4; @@ -664,6 +704,22 @@ HRESULT CLoader::Loading_For_UI() { return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_List::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CEessential_Spell_Slot::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CEessential_Spell::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_List_Image::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CIMGUIUI::Create(m_pDevice, m_pContext)))) { diff --git a/Jusin154_Team3D/Editor/Private/Slot_Number.cpp b/Jusin154_Team3D/Editor/Private/Slot_Number.cpp index 3099589bb..11ddde33b 100644 --- a/Jusin154_Team3D/Editor/Private/Slot_Number.cpp +++ b/Jusin154_Team3D/Editor/Private/Slot_Number.cpp @@ -210,17 +210,13 @@ HRESULT CSlot_Number::Ready_Components(void* pArg) void CSlot_Number::UV() { - pUVDesc[0].fUVStart = Meter_Index(1); - pUVDesc[0].fUVEnd = Compute_UVY(1); - pUVDesc[1].fUVStart = Meter_Index(2); - pUVDesc[1].fUVEnd = Compute_UVY(2); - pUVDesc[2].fUVStart = Meter_Index(3); - pUVDesc[2].fUVEnd = Compute_UVY(3); - pUVDesc[3].fUVStart = Meter_Index(4); - pUVDesc[3].fUVEnd = Compute_UVY(4); + pUVDesc[0].fUV = Meter_Index(1); + pUVDesc[1].fUV = Meter_Index(2); + pUVDesc[2].fUV = Meter_Index(3); + pUVDesc[3].fUV = Meter_Index(4); } -_float2 CSlot_Number::Meter_Index(_uint Number) +_float4 CSlot_Number::Meter_Index(_uint Number) { m_fIamge_Size = { 320.f, 128.f }; @@ -233,28 +229,13 @@ _float2 CSlot_Number::Meter_Index(_uint Number) _uint frameX = Number % iXCount; _uint frameY = Number / iXCount; - _float2 UVStart; - UVStart.x = frameX * frameWidth / m_fIamge_Size.x; - UVStart.y = frameY * frameHeight / m_fIamge_Size.y; + _float4 UV; + UV.x = frameX * frameWidth / m_fIamge_Size.x; + UV.y = frameY * frameHeight / m_fIamge_Size.y; + UV.z = UV.x + (frameWidth / m_fIamge_Size.x); + UV.w = UV.y + (frameHeight / m_fIamge_Size.y); - return UVStart; -} - -_float2 CSlot_Number::Compute_UVY(_uint Number) -{ - m_fIamge_Size = { 320.f, 128.f }; - - _float frameWidth = 64.f; - _float frameHeight = 64.f; - - // Start 구함 - _float2 UVStart = Meter_Index(Number); - - _float2 UVEnd; - UVEnd.x = UVStart.x + (frameWidth / m_fIamge_Size.x); - UVEnd.y = UVStart.y + (frameHeight / m_fIamge_Size.y); - - return UVEnd; + return UV; } CSlot_Number* CSlot_Number::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) diff --git a/Jusin154_Team3D/Editor/Private/Spell_List.cpp b/Jusin154_Team3D/Editor/Private/Spell_List.cpp new file mode 100644 index 000000000..263b9ffdd --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_List.cpp @@ -0,0 +1,253 @@ +#include "pch.h" +#include "Spell_List.h" +#include "GameInstance.h" + +CSpell_List::CSpell_List(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_List::CSpell_List(const CSpell_List& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_List::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_List::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 150.f; + Desc.fSizeY = 150.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_fAlpha = 1.f; + m_fTimeMult = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 120.f; + m_fOffSetY = 122.f; + m_iCols = 4; + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + m_pVIBufferCom->Set_ImageUV(); + return S_OK; +} + +void CSpell_List::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_List::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_List::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_List::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::DEFAULT)))) + { + 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_List::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_List::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_List::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_List::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +HRESULT CSpell_List::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_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), 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; + } + + return S_OK; +} + +HRESULT CSpell_List::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SpellType_Generic"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_List* CSpell_List::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_List* pInstance = new CSpell_List(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_List"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_List::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_List* pInstance = new CSpell_List(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_List"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_List::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_List::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_List_Image.cpp b/Jusin154_Team3D/Editor/Private/Spell_List_Image.cpp new file mode 100644 index 000000000..b263f0576 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_List_Image.cpp @@ -0,0 +1,286 @@ +#include "pch.h" +#include "Spell_List_Image.h" +#include "GameInstance.h" + +CSpell_List_Image::CSpell_List_Image(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_List_Image::CSpell_List_Image(const CSpell_List_Image& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_List_Image::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_List_Image::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeY = 90.f; + Desc.fSizeX = 90.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_fAlpha = 1.f; + m_fTimeMult = 3.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 120.f; + m_fOffSetY = 122.f; + m_iCols = 4; + UV(); + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-185.f, 375.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + m_pVIBufferCom->Set_ImageUV(pUVDesc); + return S_OK; +} + +void CSpell_List_Image::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_List_Image::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_List_Image::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_List_Image::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::EESSENTIAL_SPELL)))) + { + 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_List_Image::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_List_Image::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_List_Image::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_List_Image::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CSpell_List_Image::UV() +{ + for (_uint i = 0; i < 26; ++i) + { + pUVDesc[i].fUV = Meter_Index(i); + } +} + +_float4 CSpell_List_Image::Meter_Index(_uint Number) +{ + _float2 fImage_Size = { 1024.f, 1792.f }; + + _uint iCountX = 4; + _uint iCountY = 7; + + _float iImageX = 256.f; + _float iImageY = 256.f; + + _uint iframeX = Number % iCountX; + _uint iframeY = Number / 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 }; + return UV; +} + +HRESULT CSpell_List_Image::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_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), 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; + } + + return S_OK; +} + +HRESULT CSpell_List_Image::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_List_Image"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Atlas_Widget_Spell"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_List_Image* CSpell_List_Image::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_List_Image* pInstance = new CSpell_List_Image(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_List_Image"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_List_Image::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_List_Image* pInstance = new CSpell_List_Image(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_List_Image"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_List_Image::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CSpell_List_Image::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp index 0b657c26f..cf51b84a4 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp @@ -55,10 +55,10 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) void CSpell_Overlay::Compute_UI(_uint SpellID) { - _float2 fImage_Size = { 1024.f, 1536.f }; + _float2 fImage_Size = { 1024.f, 1792.f }; _uint iCountX = 4; - _uint iCountY = 6; + _uint iCountY = 7; _float iImageX = 256.f; _float iImageY = 256.f; diff --git a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp index 40ad30251..feface3ee 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp @@ -2,6 +2,10 @@ #include "Spell_Panel.h" #include "GameInstance.h" #include "Current_Spell_Slot.h" +#include "Spell_List.h" +#include "Eessential_Spell_Slot.h" +#include "Eessential_Spell.h" +#include "Spell_List_Image.h" CSpell_Panel::CSpell_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CPanelObject(pDevice, pContext) @@ -161,6 +165,30 @@ HRESULT CSpell_Panel::Ready_Element(void* pArg) } Add_Element(TEXT("Current_Spell_Slot"), m_pCurrent_Spell_Slot); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_List)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_List"), m_pSpell_List); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pEessential_Spell_Slot)))) + { + return E_FAIL; + } + Add_Element(TEXT("Eessential_Spell_Slot"), m_pEessential_Spell_Slot); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pEessential_Spell)))) + { + return E_FAIL; + } + Add_Element(TEXT("Eessential_Spell"), m_pEessential_Spell); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_List_Image)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_List_Image"), m_pSpell_List_Image); + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp index ebe541b3d..bebb79111 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Slot.cpp @@ -39,7 +39,7 @@ HRESULT CSpell_Slot::Initialize(void* pArg) m_fAlpha = 1.f; m_fTimeMult = 3.f; - m_fAngle = XMConvertToRadians(45); + m_fAngle = XMConvertToRadians(-135); m_fAlphaTime = 1.f; m_fOffSetX = 101.f; m_fOffSetY = 101.f; diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index af57f3848..98dc5525c 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -27,7 +27,7 @@ namespace Editor enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR ,END }; enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, ALPHA_BLEND, END }; enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, SPELLTYPE, HPBAR, MAGIC_METER, MAGIC_ICON, REMOVEUV, REVELIO, POTION, MAGIC_ITEM, END }; - enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, END }; + enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, END }; enum class EFFECT_TYPE { EFFECT, TRAIL, END }; enum class SKILL_TYPE{ JAP , BOMBARD , DECENDO , PROTEGO , END }; diff --git a/Jusin154_Team3D/Editor/Public/Eessential_Spell.h b/Jusin154_Team3D/Editor/Public/Eessential_Spell.h new file mode 100644 index 000000000..3a793d636 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Eessential_Spell.h @@ -0,0 +1,53 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CEessential_Spell final : public CElementObject +{ +private: + CEessential_Spell(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CEessential_Spell(const CEessential_Spell& rhs); + virtual ~CEessential_Spell() = 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; + +public: + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + + void UV(); + _float4 Meter_Index(_uint Number); + +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: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + CVIBuffer_UI_Instance::UI_ATLAS_DESC pUVDesc[8]; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CEessential_Spell* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h b/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h new file mode 100644 index 000000000..1e20db80e --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h @@ -0,0 +1,50 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CEessential_Spell_Slot final : public CElementObject +{ +private: + CEessential_Spell_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CEessential_Spell_Slot(const CEessential_Spell_Slot& rhs); + virtual ~CEessential_Spell_Slot() = 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; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) 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: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CTexture* m_pDiffuse_TextureCom1 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CEessential_Spell_Slot* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Slot_Number.h b/Jusin154_Team3D/Editor/Public/Slot_Number.h index 340b9b872..a419eee42 100644 --- a/Jusin154_Team3D/Editor/Public/Slot_Number.h +++ b/Jusin154_Team3D/Editor/Public/Slot_Number.h @@ -27,8 +27,7 @@ class CSlot_Number final : public CElementObject virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; void UV(); - _float2 Meter_Index(_uint Numver); - _float2 Compute_UVY(_uint Numver); + _float4 Meter_Index(_uint Numver); virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_List.h b/Jusin154_Team3D/Editor/Public/Spell_List.h new file mode 100644 index 000000000..fca734abf --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_List.h @@ -0,0 +1,53 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpell_List final : public CElementObject +{ +private: + CSpell_List(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_List(const CSpell_List& rhs); + virtual ~CSpell_List() = 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; + + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) 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: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CSpell_List* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_List_Image.h b/Jusin154_Team3D/Editor/Public/Spell_List_Image.h new file mode 100644 index 000000000..2a8a3ba0b --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_List_Image.h @@ -0,0 +1,57 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CGameObject; +NS_END + +NS_BEGIN(Editor) + +class CSpell_List_Image final : public CElementObject +{ +private: + CSpell_List_Image(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_List_Image(const CSpell_List_Image& rhs); + virtual ~CSpell_List_Image() = 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; + +public: + virtual void SizeUpX(_float fSizeX) override; + virtual void SizeUpY(_float fSizeY) override; + virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; + + void UV(); + _float4 Meter_Index(_uint Number); + +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: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + CVIBuffer_UI_Instance::UI_ATLAS_DESC pUVDesc[26]; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CSpell_List_Image* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; + virtual void Free() override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Spell_Panel.h b/Jusin154_Team3D/Editor/Public/Spell_Panel.h index 4d7ebe882..cdc792457 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Panel.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Panel.h @@ -36,6 +36,10 @@ class CSpell_Panel final : public CPanelObject CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; CGameObject* m_pCurrent_Spell_Slot = { nullptr }; + CGameObject* m_pSpell_List = { nullptr }; + CGameObject* m_pEessential_Spell_Slot = { nullptr }; + CGameObject* m_pEessential_Spell = { nullptr }; + CGameObject* m_pSpell_List_Image = { nullptr }; public: static CSpell_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp index 110a22c4f..3b9875a2d 100644 --- a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp +++ b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp @@ -171,7 +171,7 @@ void CVIBuffer_UI_Instance::Set_Pos(_float fX, _float fY, _float OffSetX, _float _uint row = i / iCols; // 세로 인덱스 pVertices[i].fPos.x = fX + col * OffSetX; - pVertices[i].fPos.y = fY + row * OffSetY; + pVertices[i].fPos.y = fY - row * OffSetY; } m_pContext->Unmap(m_pVBInstance, 0); @@ -238,13 +238,11 @@ void CVIBuffer_UI_Instance::Set_ImageUV(UI_ATLAS_DESC* AtlasUV) { if (AtlasUV == nullptr) { - pVertices[i].fUVStart = _float2(0.f, 0.f); - pVertices[i].fUVStart = _float2(1.f, 1.f); + pVertices[i].fUV = _float4(0.f, 0.f,1.f,1.f); } else { - pVertices[i].fUVStart = AtlasUV[i].fUVStart; - pVertices[i].fUVEnd = AtlasUV[i].fUVEnd; + pVertices[i].fUV = AtlasUV[i].fUV; } } diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index d763ad9b1..cd68b4dfa 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -200,8 +200,7 @@ typedef struct tagVertexInstance_UI { _float2 fSize = {}; _float2 fPos = {}; - _float2 fUVStart = {}; - _float2 fUVEnd = {}; + _float4 fUV = {}; }VTX_INSTANCE_UI; typedef struct tagVertexBlock @@ -349,15 +348,14 @@ typedef struct tagVertexModelInstanceModelDesc typedef struct tagVertexInstance_UIDesc { - static constexpr unsigned int iNumElements = {6}; + static constexpr unsigned int iNumElements = {5}; static constexpr D3D11_INPUT_ELEMENT_DESC Elements[] = { { "POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0}, { "TEXCOORD", 1, DXGI_FORMAT_R32G32_FLOAT, 1, 0, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, { "TEXCOORD", 2, DXGI_FORMAT_R32G32_FLOAT, 1, 8, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, - { "TEXCOORD", 3, DXGI_FORMAT_R32G32_FLOAT, 1, 16, D3D11_INPUT_PER_INSTANCE_DATA, 1 }, - { "TEXCOORD", 4, DXGI_FORMAT_R32G32_FLOAT, 1, 24, D3D11_INPUT_PER_INSTANCE_DATA, 1 } + { "TEXCOORD", 3, DXGI_FORMAT_R32G32B32A32_FLOAT, 1, 16, D3D11_INPUT_PER_INSTANCE_DATA, 1 } }; }VTX_POSTEX_INSTANCE_UI; diff --git a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h index 6c65232a6..4dcbf1511 100644 --- a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h +++ b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h @@ -12,8 +12,7 @@ class ENGINE_DLL CVIBuffer_UI_Instance final : public CVIBuffer_Instance }UI_INSTANCE_DESC; typedef struct tagUIAtlasDesc { - _float2 fUVStart{}; - _float2 fUVEnd{}; + _float4 fUV{}; }UI_ATLAS_DESC; private: CVIBuffer_UI_Instance(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);