diff --git a/.gitattributes b/.gitattributes index f19f123a2..b5955b0c0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -45,5 +45,9 @@ *.rtf diff=astextplain *.RTF diff=astextplain + +# lfs *.fbx filter=lfs diff=lfs merge=lfs -text *.bin filter=lfs diff=lfs merge=lfs -text + +*.png binary \ No newline at end of file diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 37238d940..e0f824a57 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -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(); + } + } diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index d6f1ee3ee..76223b2ea 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -160,10 +160,16 @@ call Update_Resources.bat + + + + + + @@ -227,9 +233,21 @@ call Update_Resources.bat + + + + + + + + + + + + @@ -251,10 +269,16 @@ call Update_Resources.bat + + + + + + @@ -320,9 +344,21 @@ call Update_Resources.bat + + + + + + + + + + + + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index 64a0849c2..98dedc08b 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -184,9 +184,6 @@ 02.GameObjects\Environment\Terrain - - 02.GameObjects\UI - 02.GameObjects\UI\GamePlay_Canvas\Loding_Panel\LoadingWidget @@ -268,6 +265,69 @@ 02.GameObjects\Item\Troll_Weapon + + 02.GameObjects\UI\GamePlay_Canvas + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_Vidio_Border + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_State + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_Preview + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_List_Image + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_List + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_Hover_Effect + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_Hover + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_Header_Line + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_Header + + + 02.GameObjects\UI\Spell_Canvas + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_Anim + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Eessential_Spell_Slot + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Eessential_Spell + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Current_Spell_Slot + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Current_Slot_Number + + + 02.GameObjects\Environment\03.MapElement + + + 02.GameObjects\Environment\03.MapElement\Light + + + 02.GameObjects\Environment\03.MapElement + + + 02.GameObjects\Environment\03.MapElement\Light + @@ -578,12 +638,75 @@ {2bc5b43e-0e24-49d4-95b0-549ad4428201} + + {f3f219aa-034f-4aa2-9f2e-d75d15bd1f4a} + + + {71f6a568-488d-4ec1-be79-8fcce6677e27} + + + {f3f219aa-034f-4aa2-9f2e-d75d15bd1f4a} + + + {71f6a568-488d-4ec1-be79-8fcce6677e27} + {a1b1f17d-ed4f-4b20-aa8e-c52e693683d4} {1d6c078d-dddd-493d-a6f0-f2cac2e4107e} + + {257a5a09-b15b-4fd2-9615-054a00cf4b25} + + + {978f1d19-2da4-48fe-ad5e-2622b0c668a5} + + + {8c3162f4-bb70-443f-901d-61d194972ccc} + + + {fa8badcc-02d7-4e2f-bd3d-5689cb13629c} + + + {5519da22-ce61-4c5c-91fc-44859d126f26} + + + {1584a13f-7fd5-413c-9b6b-11f07b50bf58} + + + {378ce73b-f242-470c-8737-9a54b967bfd8} + + + {1f768f30-3484-4ce8-9bef-be71c043f229} + + + {6f8a7e8c-2b91-44c7-89c0-8da07283e656} + + + {f0dcd3f2-2f47-4867-8f7a-27283d7f012f} + + + {3db1d2a8-b9f2-4585-b044-49e38edf68b6} + + + {294d9db3-97d6-47a9-9087-adb17525d6ec} + + + {3819fb90-dbd9-4465-a12e-bac7ba19c7d7} + + + {8628d773-0dcf-48e4-8c51-eca66e7f8d1e} + + + {ee8108db-4fe3-4ed7-ac2a-156e2b22591e} + + + {e24f4ced-ec48-46dd-b52f-3eb4b0d9588f} + + + {00b37924-ab02-4287-b67e-80375a8d3268} + @@ -763,9 +886,6 @@ 02.GameObjects\UI\GamePlay_Canvas\Loding_Panel\LoadingWidget - - 02.GameObjects\UI - 02.GameObjects\UI\GamePlay_Canvas\Action_Panel @@ -838,6 +958,18 @@ 04.Mechanic\Skill\Skill_Data + + 02.GameObjects\Environment\03.MapElement + + + 02.GameObjects\Environment\03.MapElement\Light + + + 02.GameObjects\Environment\03.MapElement + + + 02.GameObjects\Environment\03.MapElement\Light + 02.GameObjects\Monster\Troll @@ -847,6 +979,57 @@ 02.GameObjects\Item\Troll_Weapon + + 02.GameObjects\UI\GamePlay_Canvas + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_Vidio_Border + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_State + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_Preview + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_List_Image + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_List + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_Hover_Effect + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_Hover + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_Header_Line + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_Header + + + 02.GameObjects\UI\Spell_Canvas + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Spell_Anim + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Eessential_Spell_Slot + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Eessential_Spell + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Current_Spell_Slot + + + 02.GameObjects\UI\Spell_Canvas\Spell_Panel\Current_Slot_Number + diff --git a/Jusin154_Team3D/Client/Private/Broom.cpp b/Jusin154_Team3D/Client/Private/Broom.cpp index f20587d26..9e2ae2bdd 100644 --- a/Jusin154_Team3D/Client/Private/Broom.cpp +++ b/Jusin154_Team3D/Client/Private/Broom.cpp @@ -62,7 +62,10 @@ void CBroom::Update(_float fTimeDelta) m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); +#ifdef _DEBUG Describe_Entity(); +#endif // _DEBUG + } void CBroom::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Client/Private/BuildingContainer.cpp b/Jusin154_Team3D/Client/Private/BuildingContainer.cpp index a0724e7a9..0d8571861 100644 --- a/Jusin154_Team3D/Client/Private/BuildingContainer.cpp +++ b/Jusin154_Team3D/Client/Private/BuildingContainer.cpp @@ -16,27 +16,31 @@ void CBuildingContainer::Priority_Update(_float fTimeDelta) { __super::Priority_Update(fTimeDelta); - for (auto& pCollisiton : m_ColiisonPartObjects) + for (auto& pCollisiton : m_ColiisonPartObjects){ pCollisiton->Priority_Update(fTimeDelta); + } } void CBuildingContainer::Update(_float fTimeDelta) { __super::Update(fTimeDelta); - m_fCamDepth = XMVectorGetX(XMVector3Length(XMLoadFloat4(m_pGameInstance->Get_CamPosition()) - XMLoadFloat3(&m_vExtentWorldPosition))); + m_fCamDepth = XMVectorGetX(XMVector3LengthSq(XMLoadFloat4(m_pGameInstance->Get_CamPosition()) - XMLoadFloat3(&m_vExtentWorldPosition))); - for (auto& pCollisiton : m_ColiisonPartObjects) + for (auto& pCollisiton : m_ColiisonPartObjects){ pCollisiton->Update(fTimeDelta); + } } void CBuildingContainer::Late_Update(_float fTimeDelta) { - if (m_pOcclusionQueryCom->isDraw()) + if (m_pOcclusionQueryCom->isDraw()){ __super::Late_Update(fTimeDelta); + } - for (auto& pCollisiton : m_ColiisonPartObjects) + for (auto& pCollisiton : m_ColiisonPartObjects){ pCollisiton->Late_Update(fTimeDelta); + } m_pGameInstance->Add_RenderGroup(RENDER::OCCLUSION, this); } @@ -196,8 +200,9 @@ void CBuildingContainer::Free() SAFE_RELEASE(m_pVIBufferCom); SAFE_RELEASE(m_pOcclusionQueryCom); - for (auto& pCollision : m_ColiisonPartObjects) + for (auto& pCollision : m_ColiisonPartObjects){ SAFE_RELEASE(pCollision); + } } #ifdef _DEBUG diff --git a/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp b/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp index 4f81b3220..dd7935bdb 100644 --- a/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp +++ b/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp @@ -69,26 +69,16 @@ void CCamPosition_Shoulder::Priority_Update(_float fTimeDelta) CMyTools::AdjustAccumulateDegreePitchYawDegree(m_vAccDegreeXY); } - _vector vLook = XMVector3Normalize(XMLoadFloat3(&m_vShoulderPosRatio)); - _vector vRotq = XMQuaternionRotationRollPitchYaw(0.f, XMConvertToRadians(m_vAccDegreeXY.y), 0.f); - vLook = XMVector3Normalize(XMVector3Rotate(vLook, vRotq)); - - /*m_vPosLerpTimer.x += fTimeDelta; + m_vPosLerpTimer.x += fTimeDelta; if (m_vPosLerpTimer.x > m_vPosLerpTimer.y) { m_vPosLerpTimer.x = 0.f; Start_LerpShoulderPos(); } _vector vShoulderPos = XMVectorLerp(XMLoadFloat4(&m_StartPos), XMLoadFloat4(&m_DestPos), (m_vPosLerpTimer.x / m_vPosLerpTimer.y)); - m_pTransformCom->Set_State(STATE::POSITION, vShoulderPos);*/ - - m_pTransformCom->Set_State(STATE::POSITION, m_pParentTransformCom->Get_State(STATE::POSITION) + XMVector3Normalize(vLook) * m_fShoulderDistance); - _vector vShoulderPos = Get_WorldPostion(); - _vector vCameraLook = XMVectorSet(0.f, 0.f, 1.f, 0.f); + m_pTransformCom->Set_State(STATE::POSITION, vShoulderPos); _vector vRotCameraq = XMQuaternionRotationRollPitchYaw(XMConvertToRadians(m_vAccDegreeXY.x), XMConvertToRadians(m_vAccDegreeXY.y), 0.f); - vCameraLook = XMVector3Normalize(XMVector3Rotate(vCameraLook, vRotCameraq)); - - //_vector vCameraLook = XMVector3Normalize(XMVector3Rotate(XMVectorSet(0.f, 0.f, 1.f, 0.f), vRotCameraq)); + _vector vCameraLook = XMVector3Normalize(XMVector3Rotate(XMVectorSet(0.f, 0.f, 1.f, 0.f), vRotCameraq)); CTransform* pLookTransform = m_pTarget_LookPart->Get_Component(); CTransform* pFollowTransform = m_pTarget_FollowPart->Get_Component(); diff --git a/Jusin154_Team3D/Client/Private/Camera_Debug.cpp b/Jusin154_Team3D/Client/Private/Camera_Debug.cpp index 23496f7f4..b7ae49307 100644 --- a/Jusin154_Team3D/Client/Private/Camera_Debug.cpp +++ b/Jusin154_Team3D/Client/Private/Camera_Debug.cpp @@ -1,6 +1,9 @@ #include "pch.h" #include "Camera_Debug.h" #include "Shader.h" +#include "Layer.h" +#include "Player.h" + CCamera_Debug::CCamera_Debug(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CCamera(pDevice, pContext) @@ -56,6 +59,15 @@ void CCamera_Debug::Update(_float fTimeDelta) if (m_pGameInstance->Key_Pressing(DIK_TAB)) { Set_InitialPos(); } + if (m_pGameInstance->Key_Pressing(DIK_LCONTROL)) { + if (m_pGameInstance->Key_Up(DIK_SCROLL)) { + CLayer* pLayer = m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_PLAYER); + if (nullptr != pLayer) { + CPlayer* pPlayer = pLayer->Get_Object(); + pPlayer->Get_Component()->Set_Position(Get_WorldPostion()); + } + } + } #pragma endregion #pragma region Angle diff --git a/Jusin154_Team3D/Client/Private/Current_Slot_Number.cpp b/Jusin154_Team3D/Client/Private/Current_Slot_Number.cpp new file mode 100644 index 000000000..62b9c3fee --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Current_Slot_Number.cpp @@ -0,0 +1,280 @@ +#include "pch.h" +#include "Current_Slot_Number.h" +#include "GameInstance.h" + +CCurrent_Slot_Number::CCurrent_Slot_Number(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CCurrent_Slot_Number::CCurrent_Slot_Number(const CCurrent_Slot_Number& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CCurrent_Slot_Number::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CCurrent_Slot_Number::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 35.f; + Desc.fSizeY = 35.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 = 105.f; + m_fOffSetY = 101.f; + m_iCols = 4; + UV(); + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-805.f, 380.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + m_pVIBufferCom->Set_ImageUV(pUVDesc); + return S_OK; +} + +void CCurrent_Slot_Number::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CCurrent_Slot_Number::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 CCurrent_Slot_Number::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CCurrent_Slot_Number::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CCurrent_Slot_Number::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CCurrent_Slot_Number::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CCurrent_Slot_Number::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CCurrent_Slot_Number::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +HRESULT CCurrent_Slot_Number::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_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 CCurrent_Slot_Number::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Slot_Number_UI_Instance"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_Atlas_Number"), 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; +} + +void CCurrent_Slot_Number::UV() +{ + pUVDesc[0].fUV = Meter_Index(1); + pUVDesc[1].fUV = Meter_Index(2); + pUVDesc[2].fUV = Meter_Index(3); + pUVDesc[3].fUV = Meter_Index(4); +} + +_float4 CCurrent_Slot_Number::Meter_Index(_uint Number) +{ + m_fIamge_Size = { 320.f, 128.f }; + + _uint iXCount = 5; + _uint iYCount = 2; + + _float frameWidth = 64.f; + _float frameHeight = 64.f; + + _uint frameX = Number % iXCount; + _uint frameY = Number / iXCount; + + _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 UV; +} + +CCurrent_Slot_Number* CCurrent_Slot_Number::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCurrent_Slot_Number* pInstance = new CCurrent_Slot_Number(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCurrent_Slot_Number"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CCurrent_Slot_Number::Clone(void* pArg, CGameObject* pOwner) +{ + CCurrent_Slot_Number* pInstance = new CCurrent_Slot_Number(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSlot_Number"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CCurrent_Slot_Number::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CCurrent_Slot_Number::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Current_Spell_Slot.cpp b/Jusin154_Team3D/Client/Private/Current_Spell_Slot.cpp new file mode 100644 index 000000000..7828ca304 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Current_Spell_Slot.cpp @@ -0,0 +1,254 @@ +#include "pch.h" +#include "Current_Spell_Slot.h" +#include "GameInstance.h" + +CCurrent_Spell_Slot::CCurrent_Spell_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CCurrent_Spell_Slot::CCurrent_Spell_Slot(const CCurrent_Spell_Slot& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CCurrent_Spell_Slot::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CCurrent_Spell_Slot::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.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_fAlpha = 1.f; + m_fTimeMult = 3.f; + 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, 340.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + return S_OK; +} + +void CCurrent_Spell_Slot::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CCurrent_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 CCurrent_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 CCurrent_Spell_Slot::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 CCurrent_Spell_Slot::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CCurrent_Spell_Slot::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CCurrent_Spell_Slot::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CCurrent_Spell_Slot::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +HRESULT CCurrent_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_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 CCurrent_Spell_Slot::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Current_Spell_Slot"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_ActionItemGoldleaf_4K"), 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; +} + +CCurrent_Spell_Slot* CCurrent_Spell_Slot::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCurrent_Spell_Slot* pInstance = new CCurrent_Spell_Slot(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCurrent_Spell_Slot"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CCurrent_Spell_Slot::Clone(void* pArg, CGameObject* pOwner) +{ + CCurrent_Spell_Slot* pInstance = new CCurrent_Spell_Slot(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Slot"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CCurrent_Spell_Slot::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CCurrent_Spell_Slot::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Eessential_Spell.cpp b/Jusin154_Team3D/Client/Private/Eessential_Spell.cpp new file mode 100644 index 000000000..97b5f2e73 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Eessential_Spell.cpp @@ -0,0 +1,286 @@ + +#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(g_iStaticLevel, 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); +} + +#ifdef _DEBUG +void CEessential_Spell::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Eessential_Spell_Slot.cpp b/Jusin154_Team3D/Client/Private/Eessential_Spell_Slot.cpp new file mode 100644 index 000000000..57ffb8784 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Eessential_Spell_Slot.cpp @@ -0,0 +1,300 @@ +#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_fDelayTime = 0.5f; + m_iPerSpell_Slot = -1; + 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; + } + } + + Hover(fTimeDelta); + + 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); +} + +void CEessential_Spell_Slot::Hover(_float fTimeDelta) +{ + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); + + // 엘리먼트의 월드 위치를 더해주면 엘리먼트 좌표계 기준이 됨 + fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; + fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; + + + m_iSpellType = m_pVIBufferCom->Set_Mouse_Hover(fMouse); + CUIObject::HOVER_INFO Info; + Info.iSlotID = 1; + if (m_iSpellType == -1) + { + Info.iHover_Index = -1; + static_cast(m_pOwner)->Function_Callback(TEXT("Hover"), &Info); + + } + + else + { + Info.iHover_Index = m_iSpellType + ENUM_CLASS(SKILL_TYPE::JAP); + static_cast(m_pOwner)->Function_Callback(TEXT("Hover"), &Info); + + } + +} + +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(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_ActionItemBG"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, 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); +} + +#ifdef _DEBUG +void CEessential_Spell_Slot::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/EffectPool.cpp b/Jusin154_Team3D/Client/Private/EffectPool.cpp index 777012efe..71e8cdfc3 100644 --- a/Jusin154_Team3D/Client/Private/EffectPool.cpp +++ b/Jusin154_Team3D/Client/Private/EffectPool.cpp @@ -27,16 +27,18 @@ HRESULT CEffectPool::Initialize_Prototype() HRESULT CEffectPool::Initialize(void* pArg) { - if (FAILED(__super::Initialize(pArg))) + if (FAILED(__super::Initialize(pArg))){ return E_FAIL; + } - if (FAILED(Ready_Components())) + if (FAILED(Ready_Components())) { return E_FAIL; + } - if (FAILED(Ready_Effect())) + if (FAILED(Ready_Effect())) { return E_FAIL; - + } return S_OK; } @@ -46,8 +48,6 @@ void CEffectPool::Priority_Update(_float fTimeDelta) { if (false == (*iter)->Get_Visible()) { - //SAFE_RELEASE(*iter); - //iter = m_ActiveEffectList.erase(iter); ++iter; } else @@ -64,8 +64,6 @@ void CEffectPool::Update(_float fTimeDelta) { if (false == (*iter)->Get_Visible()) { - //SAFE_RELEASE(*iter); - //iter = m_ActiveEffectList.erase(iter); ++iter; } else @@ -78,7 +76,6 @@ void CEffectPool::Update(_float fTimeDelta) void CEffectPool::Late_Update(_float fTimeDelta) { - for (auto iter = m_ActiveEffectList.begin(); iter != m_ActiveEffectList.end(); ) { if (false == (*iter)->Get_Visible()) @@ -102,7 +99,9 @@ HRESULT CEffectPool::Render() HRESULT CEffectPool::Ready_Components() { - __super::Ready_Components(nullptr); + if (FAILED(__super::Ready_Components(nullptr))) { + return E_FAIL; + } return S_OK; } @@ -113,9 +112,7 @@ HRESULT CEffectPool::Bind_ShaderResources() HRESULT CEffectPool::Ready_Effect() { - if(FAILED(Create_Effect(SKILL_TYPE::JAP, 10, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { - CNomalJap* pEffect = nullptr; pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); @@ -170,8 +167,9 @@ HRESULT CEffectPool::Create_Effect(SKILL_TYPE eType, _uint iNumEffect, _uint iPr { CEffect_Container* pEffect_Container = AddPrototypeEvent(iPrototypeLevel, iCloneLevel); - if (pEffect_Container == nullptr) + if (pEffect_Container == nullptr) { return E_FAIL; + } m_EffectList[ENUM_CLASS(eType)].push_back(pEffect_Container); diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index ee975e4d8..ddc9b5b0e 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -90,7 +90,10 @@ void CGoblin::Update(_float fTimeDelta) m_pRigidBody->ConvertToCCT(*m_pCharacter_Controller); } } +#ifdef _DEBUG Describe_Entity(); +#endif // _DEBUG + } void CGoblin::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp index ae68827d5..b56166cc9 100644 --- a/Jusin154_Team3D/Client/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -81,6 +81,10 @@ HRESULT CInfoInstance::Load_MapObjects(const _char* pFilePath) { return m_pMapInfo->Load_MapObjects(pFilePath); } +HRESULT CInfoInstance::Load_LightElements(const _char* pFilePath) +{ + return m_pMapInfo->Load_LightElements(pFilePath); +} #pragma endregion LEVEL CInfoInstance::Get_RestartLevel() { diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index e204479a4..bd9ce3478 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -6,6 +6,7 @@ #include "Camera_Debug.h" #include "InfoInstance.h" #include "GamePlay_Canvas.h" +#include "Spell_Canvas.h" #include "Layer.h" #include "SkyBox.h" #include "Broom.h" @@ -43,10 +44,12 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg) if (FAILED(Ready_Layer_UI(LAYER_UI))) { return E_FAIL; } - if (FAILED(Reday_Layer_EffectPool())) { //플레이어보다 먼저 생성해야함! + //플레이어보다 먼저 생성해야함! + if (FAILED(Reday_Layer_EffectPool())) { return E_FAIL; } - if (FAILED(Ready_Layer_Item(TEXT("Layer_Item")))) { // 이것도 플레이어보다 먼저 생성해야함! + // 이것도 플레이어보다 먼저 생성해야함! + if (FAILED(Ready_Layer_Item(LAYER_ITEM))) { return E_FAIL; } if (FAILED(Ready_Layer_Player(LAYER_PLAYER))) { @@ -118,9 +121,12 @@ HRESULT CLevel_GamePlay::Ready_Background() /* Map Containters */ /* 테스트용 맵 */ - CInfoInstance::GetInstance()->Load_MapObjects("ClientTest"); + //CInfoInstance::GetInstance()->Load_MapObjects("ClientTest"); /* 전체 맵 */ - // CInfoInstance::GetInstance()->Load_MapObjects("Map1124"); + CInfoInstance::GetInstance()->Load_MapObjects("Map1129"); + + /* 조명 오브젝트 */ + CInfoInstance::GetInstance()->Load_LightElements("LightElement"); CInstancedProp::INSTANCE_PROP_DESC Desc = {}; @@ -128,14 +134,16 @@ HRESULT CLevel_GamePlay::Ready_Background() /* InstanceProp Oak_Tree*/ Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OakTree_MedA.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))){ return E_FAIL; + } /* BearBerry */ Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_BearBerry_A"; Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/BearBerry_A.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))){ return E_FAIL; + } return S_OK; } @@ -145,6 +153,9 @@ HRESULT CLevel_GamePlay::Ready_Layer_UI(const _wstring& strLayerTag) if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, g_iStaticLevel, LAYER_UI))) { return E_FAIL; } + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, g_iStaticLevel, LAYER_UI))) { + return E_FAIL; + } return S_OK; } @@ -192,21 +203,19 @@ HRESULT CLevel_GamePlay::Ready_Markers() HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag) { - - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, m_pBroom))){ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag))){ return E_FAIL; } - - - return S_OK; } HRESULT CLevel_GamePlay::Ready_Layer_Item(const _wstring& strLayerTag) { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, strLayerTag, nullptr, nullptr, &m_pBroom))) + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_ITEM, nullptr, nullptr))) { return E_FAIL; + } return S_OK; } @@ -231,15 +240,15 @@ HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag) HRESULT CLevel_GamePlay::Ready_Layer_Monster() { - for (_uint i = 0; i < 2; ++i) - { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER,&i))) { - return E_FAIL; - } - } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { - return E_FAIL; - } + //for (_uint i = 0; i < 2; ++i) + //{ + // if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER,&i))) { + // return E_FAIL; + // } + //} + //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { + // return E_FAIL; + //} return S_OK; } @@ -247,10 +256,10 @@ HRESULT CLevel_GamePlay::Ready_Layer_Monster() HRESULT CLevel_GamePlay::Reday_Layer_EffectPool() { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_EffectPool")))) //플레이어보다 먼저 생성해야함! + //플레이어보다 먼저 생성해야함! + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_EFFECTPOOL))) { return E_FAIL; - - + } return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Light_Main.cpp b/Jusin154_Team3D/Client/Private/Light_Main.cpp index 10787ff99..6e702e463 100644 --- a/Jusin154_Team3D/Client/Private/Light_Main.cpp +++ b/Jusin154_Team3D/Client/Private/Light_Main.cpp @@ -57,8 +57,11 @@ HRESULT CLight_Main::Ready_Components() LIGHT_DESC LightDesc{}; LightDesc.eType = LIGHT::DIRECTIONAL; - LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); + /*LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); LightDesc.vAmbient = _float4(0.6f, 0.6f, 0.6f, 0.f); + LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f);*/ + LightDesc.vDiffuse = _float4(0.3f, 0.3f, 0.1f, 0.f); + LightDesc.vAmbient = _float4(0.3f, 0.3f, 0.5f, 0.f); LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); LightDesc.pDirection = m_pTransformCom->Get_StatePtr(STATE::LOOK); LightDesc.iLevel = NEXT_LEVEL; @@ -70,6 +73,10 @@ HRESULT CLight_Main::Ready_Components() } m_pGameInstance->Add_Light(NEXT_LEVEL, m_pLightCom); + + _float4 vColor = _float4(0.1f, 0.1f, 0.15f, 0.5f); + m_pGameInstance->Set_FogColor(vColor); + return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 4e2608bc1..87d9fbe2f 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -50,6 +50,23 @@ #include "Mission_Panel.h" +#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 "Spell_State.h" +#include "Spell_Hover.h" +#include "Spell_Hover_Effect.h" +#include "Spell_Preview.h" +#include "Spell_Header.h" +#include "Spell_Header_Line.h" +#include "Spell_Vidio_Border.h" +#include "Spell_Anim.h" +#include "Current_Slot_Number.h" + #pragma endregion #pragma region PHYSX @@ -88,6 +105,7 @@ #include "MapObject_Render.h" #include "MapObject_Collision.h" #include "InstancedProp.h" +#include "MapElement_Light.h" #pragma endregion @@ -196,6 +214,256 @@ HRESULT CLoader::Loading_For_GamePlay() { m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다."); +#pragma region MAP_MODELS + vector*>> jobMapModels; + + { + { /* Terrain */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/Terrain", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Terrain", + ".bin", false + )); + } + + { /* Ollivanders*/ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Collision", + ".bin", false + )); + } + + { /* Gatehouse*/ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Gatehouse/Meshes", + ".bin", false + )); + } + + { /* TScrolls */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TScrolls/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TScrolls/Collisions", + ".bin", false + )); + } + { /* 3BroomStick*/ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Collision", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Meshes/3Broom_Kit", + ".bin", false + )); + } + + + { /* BLDG_QuidditchShop */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_QuidditchShop/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_QuidditchShop/Collision", + ".bin", false + )); + } + { /* BLDG_HogsheadInn */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_HogsheadInn/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_HogsheadInn/Collision", + ".bin", false + )); + } + { /* BLDG_Honeydukes */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Honeydukes/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Honeydukes/Collision", + ".bin", false + )); + } + { /* BLDG_OwlPost */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_OwlPost/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_OwlPost/Collision", + ".bin", false + )); + } + { /* BLDG_TeaShop */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TeaShop/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TeaShop/Collision", + ".bin", false + )); + } + { /* BLDG_Zonkos */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Zonkos/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Zonkos/Collision", + ".bin", false + )); + } + { /* BLDG_DB_GR */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_DB_GR/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_DB_GR/Collision", + ".bin", false + )); + } + { /* BLDG_Potions */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Potions/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Potions/Collisions", + ".bin", false + )); + } + { /* BLDG_Salon */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Salon/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Salon/Collision", + ".bin", false + )); + } + { /* Hengist_Tree */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Vegetation/Hengist_Tree", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/Vegetation", + ".bin", false + )); + } + { /* GEN A*/ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_A/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_A/Collision", + ".bin", false + )); + } + { /* GEN B*/ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_B/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_B/Collision", + ".bin", false + )); + } + { /* GEN C*/ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_C/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_C/Collision", + ".bin", false + )); + } + { /* GEN E*/ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_E/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_E/Collision", + ".bin", false + )); + } + { /* GEN F*/ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_F/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_F/Collision", + ".bin", false + )); + } + { /* GEN G*/ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_G/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_G/Collision", + ".bin", false + )); + } + { /* GEN H*/ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_H/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_H/Collision", + ".bin", false + )); + } + { /* GEN J*/ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_J/Meshes", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_J/Collision", + ".bin", false + )); + } + {/* Light Objects */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts", + ".bin", false + )); + } + } + +#pragma endregion + + #pragma region UI Asset_FileLoad("../Bin/Resources/Textures/Keyboard", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) @@ -242,6 +510,22 @@ HRESULT CLoader::Loading_For_GamePlay() _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, 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/SpellWidget", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) + { + + _string strFilePath = pFilePath; + _wstring wstrFilePath = CMyTools::ToWstring(strFilePath); + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, wstrFileName, CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { return E_FAIL; @@ -364,11 +648,230 @@ HRESULT CLoader::Loading_For_GamePlay() }); + 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(g_iStaticLevel, wstrFileName, + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) { + return E_FAIL; + } + + return S_OK; + + }); if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Item"), CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/GadgetWheel/Item%d.png"), 8)))) { return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Accio"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Accio\\Accio%d.png"), 151)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Altering_Spell"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Altering_Spell\\Altering_Spell%d.png"), 349)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Alohomora"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Alohomora\\Alohomora%d.png"), 394)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Ancient_Magic"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Ancient_Magic\\Ancient_Magic%d.png"), 152)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Ancient_Magic_Throw"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Ancient_Magic_Throw\\Ancient_Magic_Throw%d.png"), 89)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Arresto_Momentum"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Arresto_Momentum\\Arresto_Momentum%d.png"), 120)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Avada_Kedavra"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Avada_Kedavra\\Avada_Kedavra%d.png"), 208)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Basic_Cast"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Basic_Cast\\Basic_Cast%d.png"), 308)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Beast_Feed"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Beast_Feed\\Beast_Feed%d.png"), 378)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Beast_Petting_Brush"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Beast_Petting_Brush\\Beast_Petting_Brush%d.png"), 327)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Bombarda"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Bombarda\\Bombarda%d.png"), 262)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Confringo"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Confringo\\Confringo%d.png"), 157)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Conjuring_Spell"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Conjuring_Spell\\Conjuring_Spell%d.png"), 115)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Descendo"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Descendo\\Descendo%d.png"), 155)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Depulso"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Depulso\\Depulso%d.png"), 152)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Diffindo"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Diffindo\\Diffindo%d.png"), 150)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Disillusionment"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Disillusionment\\Disillusionment%d.png"), 260)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Evanesco"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Evanesco\\Evanesco%d.png"), 136)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Expelliarmus"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Expelliarmus\\Expelliarmus%d.png"), 146)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Flipendo"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Flipendo\\Flipendo%d.png"), 188)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Glacius"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Glacius\\Glacius%d.png"), 156)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Imperio"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Imperio\\Imperio%d.png"), 462)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Incendio"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Incendio\\Incendio%d.png"), 213)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Levioso"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Levioso\\Levioso%d.png"), 180)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Lumos"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Lumos\\Lumos%d.png"), 365)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Nab_Sack"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Nab_Sack\\Nab_Sack%d.png"), 235)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Petrificus_Totalus"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Petrificus_Totalus\\Petrificus_Totalus%d.png"), 275)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Protego"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Protego\\Protego%d.png"), 285)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Reparo"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Reparo\\Reparo%d.png"), 385)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Revelio"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Revelio\\Revelio%d.png"), 227)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Stupefy"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Stupefy\\Stupefy%d.png"), 222)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Transformation"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Transformation\\Transformation%d.png"), 146)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Wingardium_Leviosa"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Wingardium_Leviosa\\Wingardium_Leviosa%d.png"), 273)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Crucio"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Crucio\\Crucio%d.png"), 216)))) + { + return E_FAIL; + } + #pragma endregion #pragma region TERRAIN_TEXTURE @@ -392,6 +895,27 @@ HRESULT CLoader::Loading_For_GamePlay() CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Terrain/Hogsmeade_AlphaMap.dds"), 0)))) { return E_FAIL; } + + /* For.Prototype_Component_LightPost_Emissive */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("LightPost_Emissive"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, + TEXT("C:/MeshTable/Game/Environment/Hogsmeade/Common/Textures/LightPosts/T_HM_LampPost_Glass_E.png"), 0)))) { + return E_FAIL; + } + + /* For.Prototype_Component_LightPost_Mask */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("LightPost_Mask"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, + TEXT("C:/MeshTable/Game/Environment/Hogsmeade/Common/Textures/LightPosts/T_HM_LampPost_Glass_D.png"), 0)))) { + return E_FAIL; + } + + /* For.Prototype_Component_LightPost_Base */ + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("LightPost_Base"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, + TEXT("C:/MeshTable/Game/Environment/Hogsmeade/Common/Textures/LightPosts/T_HM_LampPost_Glass_Dark_D.png"), 0)))) { + return E_FAIL; + } #pragma endregion @@ -456,6 +980,29 @@ HRESULT CLoader::Loading_For_GamePlay() m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다."); + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_UIEDITOR, + CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl"), + VTXPOSTEX::Elements, VTXPOSTEX::iNumElements)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_UIINSTANCE, + CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl"), + VTX_POSTEX_INSTANCE_UI::Elements, VTX_POSTEX_INSTANCE_UI::iNumElements)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_INSTANCE_MODEL, + CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl"), + VTX_MODEL_INSTANCE_PARTICLE::Elements, VTX_MODEL_INSTANCE_PARTICLE::iNumElements)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_INSTANCE_PROP_MODEL, + CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl"), + VTX_MODEL_INSTANCE_MODEL::Elements, VTX_MODEL_INSTANCE_MODEL::iNumElements)))) { + return E_FAIL; + } if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_VTXPOS, CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxPos.hlsl"), VTXPOS::Elements, VTXPOS::iNumElements)))) { @@ -492,11 +1039,56 @@ HRESULT CLoader::Loading_For_GamePlay() SpellSlotUIDesc.iNum = 4; - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Instance"), + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_Slot"), CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &SpellSlotUIDesc)))) { return E_FAIL; } + CVIBuffer_UI_Instance::UI_INSTANCE_DESC CurrentSpellSlotUIDesc{}; + + CurrentSpellSlotUIDesc.iNum = 16; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Current_Spell_Slot"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &CurrentSpellSlotUIDesc)))) { + 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; @@ -506,31 +1098,24 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } - m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다."); - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_UIEDITOR, - CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl"), - VTXPOSTEX::Elements, VTXPOSTEX::iNumElements)))) { + CVIBuffer_UI_Instance::UI_INSTANCE_DESC Magic_MeterDesc{}; + + Magic_MeterDesc.iNum = 5; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Magic_Meter_UI_Instance"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &Magic_MeterDesc)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_UIINSTANCE, - CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl"), - VTX_POSTEX_INSTANCE_UI::Elements, VTX_POSTEX_INSTANCE_UI::iNumElements)))) { + CVIBuffer_UI_Instance::UI_INSTANCE_DESC Spell_Slot_PreviewDesc{}; + + Spell_Slot_PreviewDesc.iNum = 4; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Spell_Slot_Previe_UI_Instance"), + CVIBuffer_UI_Instance::Create(m_pDevice, m_pContext, &Spell_Slot_PreviewDesc)))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_INSTANCE_MODEL, - CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxModelInstance.hlsl"), - VTX_MODEL_INSTANCE_PARTICLE::Elements, VTX_MODEL_INSTANCE_PARTICLE::iNumElements)))) { - return E_FAIL; - } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_INSTANCE_PROP_MODEL, - CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl"), - VTX_MODEL_INSTANCE_MODEL::Elements, VTX_MODEL_INSTANCE_MODEL::iNumElements)))) { - return E_FAIL; - } // Heavy Wall CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{}; @@ -548,8 +1133,6 @@ HRESULT CLoader::Loading_For_GamePlay() Desc.vAutoDamping = { 100.f, 100.f }; } - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_HEAVY_WALL"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) { return E_FAIL; } @@ -582,9 +1165,6 @@ HRESULT CLoader::Loading_For_GamePlay() #pragma endregion - - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Wand_Model"), CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationX(XMConvertToRadians(-90.f)) * XMMatrixIdentity())))) return E_FAIL; @@ -644,11 +1224,6 @@ HRESULT CLoader::Loading_For_GamePlay() m_strMessage = TEXT("Model Loading.."); - - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SkyboxModel"), - CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.bin", XMMatrixIdentity())))) - return E_FAIL; - Asset_FileLoad("../Bin/Resources/Models/Effect/ParticleMesh", L"Prototype_Instance_Model_", [&](_wstring wstrFileName, const _char* pFilePath) { if (FAILED(m_pGameInstance->Add_Asset_Prototype(NEXT_LEVEL, wstrFileName, @@ -679,325 +1254,325 @@ HRESULT CLoader::Loading_For_GamePlay() }); -#pragma region MAP_MODELS - vector> jobFutures; - - _uint iLoadCount = 46; - vector*> Contents(iLoadCount); -{ - { /* Terrain */ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/Terrain", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Terrain", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - - { /* Ollivanders*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - - { /* Gatehouse*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Gatehouse/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - - { /* TScrolls */ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TScrolls/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TScrolls/Collisions", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* 3BroomStick*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Meshes/3Broom_Kit", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - - - { /* BLDG_QuidditchShop */ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_QuidditchShop/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_QuidditchShop/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_HogsheadInn */ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_HogsheadInn/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_HogsheadInn/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_Honeydukes */ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Honeydukes/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Honeydukes/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_OwlPost */ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_OwlPost/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_OwlPost/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_TeaShop */ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TeaShop/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TeaShop/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_Zonkos */ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Zonkos/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Zonkos/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_DB_GR */ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_DB_GR/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_DB_GR/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_Potions */ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Potions/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Potions/Collisions", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* BLDG_Salon */ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Salon/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Salon/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* Hengist_Tree */ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Vegetation/Hengist_Tree", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/Vegetation", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN A*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_A/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_A/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN B*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_B/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_B/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN C*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_C/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_C/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN E*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_E/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_E/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN F*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_F/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_F/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN G*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_G/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_G/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN H*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_H/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_H/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } - { /* GEN J*/ - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_J/Meshes", - ".bin", false, - &Contents[jobFutures.size()] - )); - jobFutures.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_J/Collision", - ".bin", false, - &Contents[jobFutures.size()] - )); - } -} - - - for (auto& jobFuture : jobFutures) - { - jobFuture.get(); - } - - for (_uint i = 0; i < Contents.size(); ++i) { - for (_uint j = 0; j < (Contents[i])->size(); ++j) { - FOLDER_LOAD* pContents = (*Contents[i])[j]; - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) { - return E_FAIL; - } - - for (_uint k = 0; k < pContents->pRigidBodyTags.size(); ++k) { - if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[k], pContents->LoadedRigidBody[k]))) { - return E_FAIL; - } - } - - } - } - - for (_uint i = 0; i < Contents.size(); ++i) { - for (_uint j = 0; j < (Contents[i])->size(); ++j) { - Safe_Delete((*Contents[i])[j]); - } - Safe_Delete(Contents[i]); - } -#pragma endregion - +//#pragma region MAP_MODELS +// vector> jobFutures; +// +// _uint iLoadCount = 46; +// vector*> Contents(iLoadCount); +//{ +// { /* Terrain */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/Terrain", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Terrain", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// +// { /* Ollivanders*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// +// { /* Gatehouse*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Gatehouse/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// +// { /* TScrolls */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TScrolls/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TScrolls/Collisions", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* 3BroomStick*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Meshes/3Broom_Kit", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// +// +// { /* BLDG_QuidditchShop */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_QuidditchShop/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_QuidditchShop/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_HogsheadInn */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_HogsheadInn/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_HogsheadInn/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_Honeydukes */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Honeydukes/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Honeydukes/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_OwlPost */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_OwlPost/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_OwlPost/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_TeaShop */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TeaShop/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TeaShop/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_Zonkos */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Zonkos/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Zonkos/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_DB_GR */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_DB_GR/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_DB_GR/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_Potions */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Potions/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Potions/Collisions", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* BLDG_Salon */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Salon/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Salon/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* Hengist_Tree */ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Vegetation/Hengist_Tree", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/Vegetation", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN A*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_A/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_A/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN B*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_B/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_B/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN C*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_C/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_C/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN E*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_E/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_E/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN F*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_F/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_F/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN G*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_G/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_G/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN H*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_H/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_H/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +// { /* GEN J*/ +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_J/Meshes", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// jobFutures.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_J/Collision", +// ".bin", false, +// &Contents[jobFutures.size()] +// )); +// } +//} +// +// +// for (auto& jobFuture : jobFutures) +// { +// jobFuture.get(); +// } +// +// for (_uint i = 0; i < Contents.size(); ++i) { +// for (_uint j = 0; j < (Contents[i])->size(); ++j) { +// FOLDER_LOAD* pContents = (*Contents[i])[j]; +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) { +// return E_FAIL; +// } +// +// for (_uint k = 0; k < pContents->pRigidBodyTags.size(); ++k) { +// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[k], pContents->LoadedRigidBody[k]))) { +// return E_FAIL; +// } +// } +// +// } +// } +// +// for (_uint i = 0; i < Contents.size(); ++i) { +// for (_uint j = 0; j < (Contents[i])->size(); ++j) { +// Safe_Delete((*Contents[i])[j]); +// } +// Safe_Delete(Contents[i]); +// } +//#pragma endregion +// m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다."); @@ -1088,6 +1663,71 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Canvas::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Panel::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCurrent_Spell_Slot::Create(m_pDevice, m_pContext)))) + { + 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, CSpell_State::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Hover::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Hover_Effect::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Preview::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Header::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Header_Line::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Vidio_Border::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Anim::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCurrent_Slot_Number::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + /* For.Prototype_GameObject_SkyBox */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSkyBox::Create(m_pDevice, m_pContext)))) return E_FAIL; @@ -1116,6 +1756,8 @@ HRESULT CLoader::Loading_For_GamePlay() } } + + /* For.Prototype_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA */ if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA"), CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext, @@ -1163,6 +1805,11 @@ HRESULT CLoader::Loading_For_GamePlay() /* For.Prototype_GameObject_CInstancedProp */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CInstancedProp::Create(m_pDevice, m_pContext)))) return E_FAIL; + + /* For.Prototype_GameObject_MapElement_Light */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CMapElement_Light::Create(m_pDevice, m_pContext)))) + return E_FAIL; + #pragma endregion // MAP PROTOTYPE #pragma region ACTOR PROTOTYPE @@ -1186,8 +1833,6 @@ HRESULT CLoader::Loading_For_GamePlay() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CFSM::Create(m_pDevice, m_pContext)))) return E_FAIL; - - /* For.Prototype_GameObject_Camera_Gaze */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCamera_Gaze::Create(m_pDevice, m_pContext)))) return E_FAIL; @@ -1233,6 +1878,31 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } + +#pragma region RECEIVE_THREAD + { // MapModels + _uint iIndex = 0; + for (auto& JobMapModels : jobMapModels) + { + vector* pOut = JobMapModels.get(); + for (_uint i = 0; i < pOut->size(); ++i) { + FOLDER_LOAD* pContents = (*pOut)[i]; + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) { + return E_FAIL; + } + + for (_uint j = 0; j < pContents->pRigidBodyTags.size(); ++j) { + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[j], pContents->LoadedRigidBody[j]))) { + return E_FAIL; + } + } + Safe_Delete(pContents); + } + iIndex++; + Safe_Delete(pOut); + } + } +#pragma endregion m_strMessage = TEXT("정보를 불러오는 중입니다."); m_strMessage = TEXT("로딩이 완료되었습니다.."); @@ -1310,18 +1980,18 @@ HRESULT CLoader::Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreN return S_OK; } -void APIENTRY Deferred_FolderLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector** OutContents) +vector* APIENTRY Deferred_FolderLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag) { if (FAILED(CoInitializeEx(nullptr, 0))) { - return; + return nullptr; } if (!filesystem::exists(pDirectoryPath)) { MSG_BOX(" 경로 이상해 "); - return; + return nullptr; } - *OutContents = new vector; + vector* pOut = new vector; for (const auto& file : filesystem::directory_iterator(pDirectoryPath)) { if (file.is_directory()) { continue; } @@ -1336,7 +2006,7 @@ void APIENTRY Deferred_FolderLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContex _wstring wstrFileName = L"Prototype_GameObject_" + file.path().stem().wstring(); CModel* pModel = CModel::Create(pDevice, pContext, MODEL::ENVIROMENT, szFilePath); - + _uint iNumMesh = pModel->Get_NumMeshes(); { @@ -1359,21 +2029,22 @@ void APIENTRY Deferred_FolderLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContex Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f); Desc.fContactOffset = 0.f; } + pContents->pRigidBodyTags.emplace_back(CMyTools::ToWstring(pModel->Get_MeshName(i) + to_string(i)).c_str()); pContents->LoadedRigidBody.emplace_back(CRigidBody_Static::Create(pDevice, pContext, Desc)); } } - (*OutContents)->emplace_back(pContents); + (*pOut).emplace_back(pContents); } - (*OutContents)->shrink_to_fit(); + (*pOut).shrink_to_fit(); CoUninitialize(); - return; + return pOut; } -future CLoader::Deferred_FolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector** OutContents) +future*> CLoader::Deferred_FolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag) { - return m_pGameInstance->EnqueueJob(&Deferred_FolderLoad_Main, m_pDevice, m_pContext, pDirectoryPath, pFileExt, bUseTag, OutContents); + return m_pGameInstance->EnqueueJob(&Deferred_FolderLoad_Main, m_pDevice, m_pContext, pDirectoryPath, pFileExt, bUseTag); } pair<_wstring, CModel*>* APIENTRY Deferred_ModelLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const _char* pDirectoryPath, const _tchar* pPrototypeTag, _fmatrix PreTransform) diff --git a/Jusin154_Team3D/Client/Private/Magic_Item.cpp b/Jusin154_Team3D/Client/Private/Magic_Item.cpp index 9ea657f63..8102488dd 100644 --- a/Jusin154_Team3D/Client/Private/Magic_Item.cpp +++ b/Jusin154_Team3D/Client/Private/Magic_Item.cpp @@ -220,6 +220,10 @@ HRESULT CMagic_Item::Bind_ShaderResources() { return E_FAIL; } + if (FAILED(m_pDiffuse_TextureCom6->Bind_ShaderResource(m_pShaderCom, "g_MaskingTexture", 0))) + { + return E_FAIL; + } if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { return E_FAIL; @@ -317,6 +321,10 @@ HRESULT CMagic_Item::Ready_Components(void* pArg) { return E_FAIL; } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_tillingSmokes"), reinterpret_cast(&m_pDiffuse_TextureCom6), nullptr))) + { + return E_FAIL; + } if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) { return E_FAIL; @@ -361,6 +369,7 @@ void CMagic_Item::Free() SAFE_RELEASE(m_pDiffuse_TextureCom3); SAFE_RELEASE(m_pDiffuse_TextureCom4); SAFE_RELEASE(m_pDiffuse_TextureCom5); + SAFE_RELEASE(m_pDiffuse_TextureCom6); SAFE_RELEASE(m_pShaderCom); SAFE_RELEASE(m_pVIBufferCom); } diff --git a/Jusin154_Team3D/Client/Private/MapElement.cpp b/Jusin154_Team3D/Client/Private/MapElement.cpp new file mode 100644 index 000000000..73659bf3c --- /dev/null +++ b/Jusin154_Team3D/Client/Private/MapElement.cpp @@ -0,0 +1,69 @@ +#include "pch.h" +#include "MapElement.h" + +#include "GameInstance.h" + +CMapElement::CMapElement(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CGameObject{ pDevice, pContext } +{ +} + +CMapElement::CMapElement(const CMapElement& rhs) + : CGameObject(rhs) +{ +} + +void CMapElement::Priority_Update(_float fTimeDelta) +{ +} + +void CMapElement::Update(_float fTimeDelta) +{ +} + +void CMapElement::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CMapElement::Render() +{ + return S_OK; +} + +HRESULT CMapElement::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CMapElement::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + return S_OK; +} + +HRESULT CMapElement::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CMapElement::Bind_ShaderResources() +{ + return S_OK; +} + +void CMapElement::Free() +{ + __super::Free(); +} + +#ifdef _DEBUG +void CMapElement::Describe_Entity() +{ +} +#endif diff --git a/Jusin154_Team3D/Client/Private/MapElement_Light.cpp b/Jusin154_Team3D/Client/Private/MapElement_Light.cpp new file mode 100644 index 000000000..b6b55df33 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/MapElement_Light.cpp @@ -0,0 +1,310 @@ +#include "pch.h" +#include "MapElement_Light.h" + +#include "GameInstance.h" + +#include "Terrain.h" +#include "Layer.h" +#include "VIBuffer_Terrain.h" + +CMapElement_Light::CMapElement_Light(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CMapElement{ pDevice, pContext } +{ +} + +CMapElement_Light::CMapElement_Light(const CMapElement_Light& rhs) + : CMapElement(rhs) +{ +} + +HRESULT CMapElement_Light::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CMapElement_Light::Initialize(void* pArg) +{ + MAPELEMENT_LIGHT_DESC* pDesc = static_cast(pArg); + + m_iMaxLodLevel = pDesc->iMaxLodLevel; + m_fBloomStrength = pDesc->fBloomStregth; + m_iGlassMeshIndex = pDesc->iGlassMeshIndex; + + for (_uint i = 0; i < m_iMaxLodLevel + 1; i++) + { + m_ModelPrototypeTags.push_back(pDesc->ModelPrototypeTags[i]); + //m_ModelPathIndices.push_back((*pDesc->pModelPathIndices)[i]); + } + + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPosition), 1.f)); + m_pTransformCom->Set_Scale(pDesc->vScale); + m_pTransformCom->Rotation(XMConvertToRadians(pDesc->vRotation.x), XMConvertToRadians(pDesc->vRotation.y), XMConvertToRadians(pDesc->vRotation.z)); + + return S_OK; +} + +void CMapElement_Light::Priority_Update(_float fTimeDelta) +{ +} + +void CMapElement_Light::Update(_float fTimeDelta) +{ +} + +void CMapElement_Light::Late_Update(_float fTimeDelta) +{ + if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pModelComs[0]->Get_Radius())) + { + if (m_isLightOn) + { + _float fDistance = XMVectorGetX(XMVector3LengthSq(XMLoadFloat4(m_pGameInstance->Get_CamPosition()) - m_pTransformCom->Get_State(STATE::POSITION))); + if (m_LightAdded_Distance > fDistance) // 카메라 범위 안 + { + if (!m_isLightAdded) + { + m_isLightAdded = true; + m_pGameInstance->Add_Light(CURRENT_LEVEL, m_pLightCom); + } + } + else + { + if (m_isLightAdded) + { + m_isLightAdded = false; + m_pGameInstance->Delete_Light(CURRENT_LEVEL, m_pLightCom); + } + } + + m_pGameInstance->Add_RenderGroup(RENDER::BLOOM, this); + } + + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); + } +} + +HRESULT CMapElement_Light::Render() +{ + if (FAILED(Bind_ShaderResources())) + return E_FAIL; + + _uint iNumMeshes = m_pModelComs[m_iLodIndex]->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (true == m_isLightOn && m_iGlassMeshIndex == i) + continue; + + if (m_iGlassMeshIndex == i) + { + if (FAILED(m_pModelComs[0]->Bind_Material(m_iGlassMeshIndex, m_pShaderCom))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_SRV("g_DiffuseTexture", m_pGlassTextureCom->Get_SRV(0)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_SRV("g_GlassTexture", m_pMaskTextureCom->Get_SRV(0)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fGlassRatio", &m_fGlassRatio, sizeof(_float)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::GLASS)))) { + return E_FAIL; + } + } + else + { + if (FAILED(m_pModelComs[0]->Bind_Material(i, m_pShaderCom))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) { + return E_FAIL; + } + } + + if (FAILED(m_pModelComs[m_iLodIndex]->Render(i))) { + return E_FAIL; + } + } + + return S_OK; +} + +HRESULT CMapElement_Light::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + for (_uint i = 0; i < m_iMaxLodLevel + 1; ++i) + { + CModel* pModel = { nullptr }; + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_ModelPrototypeTags[i], + reinterpret_cast(&pModel)))) + return E_FAIL; + + m_pModelComs.push_back(pModel); + } + + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH, + reinterpret_cast(&m_pShaderCom)))) + return E_FAIL; + + /* Com_Texture */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("LightPost_Emissive"), + reinterpret_cast(&m_pEmissiveTextureCom)))) + return E_FAIL; + + /* Com_Texture */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("LightPost_Mask"), + reinterpret_cast(&m_pMaskTextureCom)))) + return E_FAIL; + + /* Com_Texture */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("LightPost_Base"), + reinterpret_cast(&m_pGlassTextureCom)))) + return E_FAIL; + + + MAPELEMENT_LIGHT_DESC* pDesc = static_cast(pArg); + + LIGHT_DESC LightDesc{}; + + LightDesc.eType = LIGHT::POINT; + + memcpy(&LightDesc.vDiffuse, &pDesc->vDiffuse, sizeof(_float4)); + memcpy(&LightDesc.vAmbient, &pDesc->vAmbient, sizeof(_float4)); + memcpy(&LightDesc.vSpecular, &pDesc->vSpecular, sizeof(_float4)); + memcpy(&LightDesc.vPosOffset, &pDesc->vPosOffset, sizeof(_float4)); + + LightDesc.fRange = pDesc->fRange; + LightDesc.iLevel = NEXT_LEVEL; + LightDesc.pPosition = m_pTransformCom->Get_StatePtr(STATE::POSITION); + + /* Com_Light*/ + if (FAILED(Add_Component(g_iStaticLevel, &m_pLightCom, &LightDesc))) + { + return E_FAIL; + } + + if (false == pDesc->isPow) + m_pLightCom->Switch_LightAttenationMethod(); + + return S_OK; +} + +HRESULT CMapElement_Light::Bind_ShaderResources() +{ + if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CMapElement_Light::Render_Bloom() +{ + if (FAILED(Bind_ShaderResources())) + return E_FAIL; + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fBloomStrength", &m_fBloomStrength, sizeof(_float)))) + return E_FAIL; + + if (FAILED(m_pShaderCom->Bind_SRV("g_EmissiveTexture", m_pEmissiveTextureCom->Get_SRV(0)))) + return E_FAIL; + if (FAILED(m_pShaderCom->Bind_SRV("g_DiffuseTexture", m_pGlassTextureCom->Get_SRV(0)))) + return E_FAIL; + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::BLOOM)))) { + return E_FAIL; + } + + if (FAILED(m_pModelComs[m_iLodIndex]->Render(m_iGlassMeshIndex))) { + return E_FAIL; + } + + return S_OK; +} + +void CMapElement_Light::Toggle_Light() +{ + if (m_isLightOn) + m_pGameInstance->Delete_Light(CURRENT_LEVEL, m_pLightCom); + else + m_pGameInstance->Add_Light(CURRENT_LEVEL, m_pLightCom); + + m_isLightAdded = m_isLightOn = !m_isLightOn; +} + +CMapElement_Light* CMapElement_Light::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CMapElement_Light* pInstance = new CMapElement_Light(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CMapElement_Light"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CMapElement_Light::Clone(void* pArg, CGameObject* pOwner) +{ + CMapElement_Light* pInstance = new CMapElement_Light(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CMapElement_Light"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CMapElement_Light::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pLightCom); + SAFE_RELEASE(m_pEmissiveTextureCom); + SAFE_RELEASE(m_pMaskTextureCom); + SAFE_RELEASE(m_pGlassTextureCom); + + SAFE_RELEASE(m_pShaderCom); + for (auto& pModel : m_pModelComs) + SAFE_RELEASE(pModel); +} + +#ifdef _DEBUG +void CMapElement_Light::Describe_Entity() +{ + +} +#endif // DEBUG + + diff --git a/Jusin154_Team3D/Client/Private/MapInfo.cpp b/Jusin154_Team3D/Client/Private/MapInfo.cpp index 29dfa63a4..3335b597b 100644 --- a/Jusin154_Team3D/Client/Private/MapInfo.cpp +++ b/Jusin154_Team3D/Client/Private/MapInfo.cpp @@ -7,6 +7,7 @@ #include "MAPPartObject.h" #include "MapObject_Render.h" #include "MapObject_Collision.h" +#include "MapElement_Light.h" CMapInfo::CMapInfo() { @@ -55,14 +56,17 @@ HRESULT CMapInfo::Load_MapObjects(const _char* pFileName) { Load_StreetContainer(Container, &pContainerObject); } - else + else { return E_FAIL; + } - if (FAILED(Load_MapRenderObjects(Container, pContainerObject))) + if (FAILED(Load_MapRenderObjects(Container, pContainerObject))){ return E_FAIL; + } - if (FAILED(Load_MapCollisionObjects(Container, pContainerObject))) + if (FAILED(Load_MapCollisionObjects(Container, pContainerObject))){ return E_FAIL; + } } for (auto* Object = root->FirstChildElement("Object"); Object; Object = Object->NextSiblingElement("Object")) @@ -266,6 +270,96 @@ HRESULT CMapInfo::Load_MapCollisionObjects(tinyxml2::XMLElement* Container, CMap return S_OK; } +HRESULT CMapInfo::Load_LightElements(const _char* pFileName) +{ + tinyxml2::XMLDocument xmlDoc; + + string strPath = "../Bin/Resources/Data/Map/" + string(pFileName) + ".xml"; + + if ((tinyxml2::XML_SUCCESS != xmlDoc.LoadFile(strPath.c_str()))) + return E_FAIL; + + tinyxml2::XMLElement* root = xmlDoc.FirstChildElement("MapLightObjects"); + + if (nullptr == root) + { + MSG_BOX("Failed to Find root"); + return S_OK; + } + + for (auto* Object = root->FirstChildElement("Object"); Object; Object = Object->NextSiblingElement("Object")) + { + CMapElement_Light::MAPELEMENT_LIGHT_DESC Desc = {}; + + /* Model Prototypes */ + Object->QueryUnsignedAttribute("Lod_Level", &Desc.iMaxLodLevel); + + string strTag = {}; + for (auto* PrototypeTag = Object->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag")) + { + strTag = PrototypeTag->GetText(); + + Desc.ModelPrototypeTags.push_back(CMyTools::ToWstring(strTag)); + } + + /* Transform */ + auto* Position = Object->FirstChildElement("Position"); + Position->QueryFloatAttribute("x", &Desc.vPosition.x); + Position->QueryFloatAttribute("y", &Desc.vPosition.y); + Position->QueryFloatAttribute("z", &Desc.vPosition.z); + + auto* Scale = Object->FirstChildElement("Scale"); + Scale->QueryFloatAttribute("x", &Desc.vScale.x); + Scale->QueryFloatAttribute("y", &Desc.vScale.y); + Scale->QueryFloatAttribute("z", &Desc.vScale.z); + + auto* Rotation = Object->FirstChildElement("Rotation"); + Rotation->QueryFloatAttribute("x", &Desc.vRotation.x); + Rotation->QueryFloatAttribute("y", &Desc.vRotation.y); + Rotation->QueryFloatAttribute("z", &Desc.vRotation.z); + + /* Light Desc */ + auto* Diffuse = Object->FirstChildElement("Diffuse"); + Diffuse->QueryFloatAttribute("x", &Desc.vDiffuse.x); + Diffuse->QueryFloatAttribute("y", &Desc.vDiffuse.y); + Diffuse->QueryFloatAttribute("z", &Desc.vDiffuse.z); + + auto* Ambient = Object->FirstChildElement("Ambient"); + Ambient->QueryFloatAttribute("x", &Desc.vAmbient.x); + Ambient->QueryFloatAttribute("y", &Desc.vAmbient.y); + Ambient->QueryFloatAttribute("z", &Desc.vAmbient.z); + + auto* Specular = Object->FirstChildElement("Specular"); + Specular->QueryFloatAttribute("x", &Desc.vSpecular.x); + Specular->QueryFloatAttribute("y", &Desc.vSpecular.y); + Specular->QueryFloatAttribute("z", &Desc.vSpecular.z); + + auto* PosOffset = Object->FirstChildElement("PosOffset"); + PosOffset->QueryFloatAttribute("x", &Desc.vPosOffset.x); + PosOffset->QueryFloatAttribute("y", &Desc.vPosOffset.y); + PosOffset->QueryFloatAttribute("z", &Desc.vPosOffset.z); + + auto* Info = Object->FirstChildElement("Info"); + Info->QueryUnsignedAttribute("GlassIndex", &Desc.iGlassMeshIndex); + Info->QueryFloatAttribute("BloomStrength", &Desc.fBloomStregth); + Info->QueryFloatAttribute("Range", &Desc.fRange); + _uint iPow = {}; + Info->QueryUnsignedAttribute("Pow", &iPow); + + Desc.isPow = 0 == iPow ? false : true; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Light"), &Desc))) + return E_FAIL; + } + + MSG_BOX("Successed to Load File"); + + + return S_OK; + + return S_OK; +} + HRESULT CMapInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) { m_pGameInstance = CGameInstance::GetInstance(); diff --git a/Jusin154_Team3D/Client/Private/MapObject_Collision.cpp b/Jusin154_Team3D/Client/Private/MapObject_Collision.cpp index 0a9264cc0..a68619e07 100644 --- a/Jusin154_Team3D/Client/Private/MapObject_Collision.cpp +++ b/Jusin154_Team3D/Client/Private/MapObject_Collision.cpp @@ -51,13 +51,15 @@ HRESULT CMapObject_Collision::Initialize(void* pArg) for (_uint i = 0; i < m_iMaxLodLevel + 1; i++) { m_ModelPrototypeTags.push_back(pDesc->ModelPrototypeTags[i]); - //m_ModelPathIndices.push_back((*pDesc->pModelPathIndices)[i]); + //m_ModelPathIndices.push_back((*pDesc->pModelPathIndices)[iIndex]); } - if (FAILED(__super::Initialize(pArg))) + if (FAILED(__super::Initialize(pArg))){ return E_FAIL; + } - if (FAILED(Ready_Components())) + if (FAILED(Ready_Components())){ return E_FAIL; + } m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPosition), 1.f)); m_pTransformCom->Set_Scale(pDesc->vScale); @@ -80,23 +82,37 @@ HRESULT CMapObject_Collision::Ready_Components() { __super::Ready_Components(); - for (_uint i = 0; i < m_iMaxLodLevel + 1; ++i) + for (_uint iIndexLOD = 0; iIndexLOD < m_iMaxLodLevel + 1; ++iIndexLOD) { CModel* pModel = { nullptr }; /* Com_Model */ - if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_ModelPrototypeTags[i], - reinterpret_cast(&pModel)))) + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_ModelPrototypeTags[iIndexLOD], + reinterpret_cast(&pModel)))){ return E_FAIL; + } m_pModelComs.push_back(pModel); + + // _uint iMeshes = pModel->Get_NumMeshes(); + // for (_uint iIndex = 0; iIndex < iMeshes; ++iIndex) { + // _wstring wstrName = CMyTools::ToWstring(pModel->Get_MeshName(iIndex)) + to_wstring(iIndex); + // CRigidBody_Static* pRigidBody = { nullptr }; + // CRigidBody_Static::RIGIDBODY_STATIC_DESC Desc = {}; + // Desc.iSubKind = ENUM_CLASS(PXOBJECT::TERRAIN); + // Desc.pMeshName = wstrName.c_str(); + // if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, wstrName, (CComponent**)&pRigidBody, &Desc))) { + // return E_FAIL; + // } + // m_RigidBodies[iIndexLOD].push_back(pRigidBody); + // } } /* Com_Shader */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH, - reinterpret_cast(&m_pShaderCom)))) + reinterpret_cast(&m_pShaderCom)))){ return E_FAIL; - + } return S_OK; } @@ -151,9 +167,15 @@ void CMapObject_Collision::Free() SAFE_RELEASE(m_pShaderCom); - for (auto& pModel : m_pModelComs) - Safe_Release(pModel); - m_pModelComs.clear(); + for (auto& pModel : m_pModelComs){ + SAFE_RELEASE(pModel); + } m_pModelComs.clear(); + + for (_uint i = 0; i < m_RigidBodies.size(); ++i) { + for (_uint j = 0; j < m_RigidBodies[i].size(); ++j) { + SAFE_RELEASE(m_RigidBodies[i][j]); + } + } m_RigidBodies.clear(); m_ModelPrototypeTags.clear(); m_ModelPathIndices.clear(); diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index c7e5b2f7a..68f69638e 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -60,11 +60,11 @@ HRESULT CPlayer::Initialize(void* pArg) Load_KeyFrame(); #endif // _DEBUG - m_pBroom = static_cast(pArg); - SAFE_ADDREF(m_pBroom); + m_pBroom = m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_ITEM)->Get_Object(); m_pBroomModel = m_pBroom->Get_Component(); - SAFE_ADDREF(m_pBroomModel); m_pBroomTransform = m_pBroom->Get_Component(); + SAFE_ADDREF(m_pBroom); + SAFE_ADDREF(m_pBroomModel); SAFE_ADDREF(m_pBroomTransform); Add_FSM(); @@ -289,7 +289,7 @@ HRESULT CPlayer::Ready_Components() Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Playable_HitReport::Create(); Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_Playable_Behavior::Create(); Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY; - Desc.fWalkableSlope = 22.5f; + Desc.fWalkableSlope = 45.f; if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/Potion.cpp b/Jusin154_Team3D/Client/Private/Potion.cpp index d6885dcba..2d52f3062 100644 --- a/Jusin154_Team3D/Client/Private/Potion.cpp +++ b/Jusin154_Team3D/Client/Private/Potion.cpp @@ -40,9 +40,8 @@ HRESULT CPotion::Initialize(void* pArg) m_fTimeMult = 3.f; m_fAlpha = 1.f; m_fAlphaTime = 1.f; - m_vImageSlotPos = _float2(45.f,45.f); - m_vImageSize = _float2(32.f,32.f); - m_bActive = true; + m_vImageSlotPos = _float2(45.f, 45.f); + m_vImageSize = _float2(32.f, 32.f); return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Skill_Data.cpp b/Jusin154_Team3D/Client/Private/Skill_Data.cpp index bcb5590be..16dd73e6b 100644 --- a/Jusin154_Team3D/Client/Private/Skill_Data.cpp +++ b/Jusin154_Team3D/Client/Private/Skill_Data.cpp @@ -1 +1,143 @@ #include "pch.h" +#include "Skill_Data.h" +#include "GameObject.h" +#include "UIObject.h" +#include "tinyxml2.h" + +; + +CSkill_Data::CSkill_Data(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CGameObject(pDevice, pContext) +{ +} + +CSkill_Data::CSkill_Data(const CSkill_Data& rhs) + :CGameObject(rhs) +{ +} + +HRESULT CSkill_Data::Initialize_Prototype() +{ + + return S_OK; +} + +HRESULT CSkill_Data::Initialize(void* pArg) +{ + auto* pInfo = static_cast(pArg); + + tinyxml2::XMLDocument doc; + tinyxml2::XMLError Error = doc.LoadFile("../Bin/Resources/Data/UI/Spell/SpellInfo.xml"); + if (Error != tinyxml2::XML_SUCCESS) + return E_FAIL; + + tinyxml2::XMLElement* pSpellInfo = doc.FirstChildElement("SpellInfo"); + if (!pSpellInfo) + return E_FAIL; + + tinyxml2::XMLElement* pSpell = pSpellInfo->FirstChildElement("Spell"); + while (pSpell) + { + int id = 0; + pSpell->QueryIntAttribute("Spell_ID", &id); + + if (id < 0 || id > 34) + { + pSpell = pSpell->NextSiblingElement("Spell"); + continue; + } + + pInfo[id].iSpell_ID = id; + pInfo[id].pSpell_Name = CMyTools::ToWstring(pSpell->Attribute("Spell_Name")); + pInfo[id].pImage_Name = CMyTools::ToWstring(pSpell->Attribute("Image_Name")); + pSpell->QueryIntAttribute("Spell_Type", &pInfo[id].iSpell_Type); + pSpell->QueryIntAttribute("Skill_Type", &pInfo[id].iSkill_Type); + pSpell->QueryFloatAttribute("Spell_Cooltime", &pInfo[id].fSpell_CoolTime); + pSpell->QueryFloatAttribute("Duration", &pInfo[id].fDuration); + pSpell->QueryIntAttribute("AnimNum", &pInfo[id].iAnimNum); + pInfo[id].pSpellInfo = CMyTools::ToWstring(pSpell->Attribute("SpellInfo")); + int lock = 0, equip = 0; + pSpell->QueryIntAttribute("Spell_Lock", &lock); + pSpell->QueryIntAttribute("Equip_Spell", &equip); + pInfo[id].bSpell_Lock = lock != 0; + pInfo[id].bEquip_Spell = equip != 0; + + pSpell = pSpell->NextSiblingElement("Spell"); + } + + //pInfo = SpellInfo; + return S_OK; +} + +//const CUIObject::SPELLINFO& CSkill_Data::Get_Info(_uint SpellID) const +//{ +// return SpellInfo[SpellID]; +//} + +void CSkill_Data::Priority_Update(_float fTimeDelta) +{ +} + +void CSkill_Data::Update(_float fTimeDelta) +{ +} + +void CSkill_Data::Late_Update(_float fTimeDelta) +{ +} + +HRESULT CSkill_Data::Render() +{ + return S_OK; +} + +_vector CSkill_Data::Get_WorldPostion() +{ + return _vector(); +} + +HRESULT CSkill_Data::Bind_ShaderResources() +{ + return S_OK; +} + +HRESULT CSkill_Data::Ready_Components(void* pArg) +{ + return S_OK; +} + +CSkill_Data* CSkill_Data::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSkill_Data* pInstance = new CSkill_Data(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSkill_Data"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSkill_Data::Clone(void* pArg, CGameObject* pOwner) +{ + CSkill_Data* pInstance = new CSkill_Data(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSkill_Data"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSkill_Data::Free() +{ + __super::Free(); + +} + +void CSkill_Data::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/Spell_Anim.cpp b/Jusin154_Team3D/Client/Private/Spell_Anim.cpp new file mode 100644 index 000000000..cf6daec60 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Spell_Anim.cpp @@ -0,0 +1,278 @@ +#include "pch.h" +#include "Spell_Anim.h" +#include "GameInstance.h" + +CSpell_Anim::CSpell_Anim(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Anim::CSpell_Anim(const CSpell_Anim& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Anim::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Anim::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 590.f; + Desc.fY = -100.f; + Desc.fSizeX = 470.f; + Desc.fSizeY = 250.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 = 0.f; + m_fAlphaTime = 9.f; + m_fSortZ = 0.01f; + m_iTotalFrames = 120; + m_fFrameTime = 0.1f; + m_iCurrentFrame = 0; + m_bAnim_Start = false; + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); + return S_OK; +} + +void CSpell_Anim::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Anim::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) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + m_bAnim_Start = false; + } + + + if (m_bAnim_Start == true) + { + m_fTime += fTimeDelta * m_fTimeMult; + } + else + { + m_iCurrentFrame = 0; + } + + if (m_fTime >= m_fFrameTime) + { + m_iCurrentFrame++; + m_fTime -= m_fFrameTime; + + if (m_iCurrentFrame >= m_iTotalFrames) + m_iCurrentFrame = 0; + } + + __super::Update(fTimeDelta); +} + +void CSpell_Anim::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) { + if (m_pDiffuse_TextureCom != nullptr) + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSpell_Anim::Render() +{ + + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) + { + 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_Anim::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Anim::Set_FadeIn() +{ + if (!m_bFadeIn && m_fAlpha < 1.f) + { + m_bFadeIn = true; + m_bFadeOut = false; + } + m_bAnim_Start = true; +} + +void CSpell_Anim::Change_Image(_int SpellID) +{ + _wstring pImageName = static_cast(m_pOwner)->Get_Info(SpellID).pImage_Name; + m_iTotalFrames = static_cast(m_pOwner)->Get_Info(SpellID).iAnimNum; + if (m_pDiffuse_TextureCom) + { + Remove_Component(); + SAFE_RELEASE(m_pDiffuse_TextureCom); + } + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, pImageName, reinterpret_cast(&m_pDiffuse_TextureCom)))) + return; +} + +void CSpell_Anim::Set_SkillType(_int eType) +{ + if (eType != -1 && eType != m_iPerSpell) + { + m_iPerSpell = eType; + m_iCurrentFrame = 0; + Change_Image(eType); + } +} + +HRESULT CSpell_Anim::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", m_iCurrentFrame))) + { + 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_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_Anim::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Arresto_Momentum"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + return S_OK; +} + + +CSpell_Anim* CSpell_Anim::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Anim* pInstance = new CSpell_Anim(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Anim"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Anim::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Anim* pInstance = new CSpell_Anim(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Anim"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Anim::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpell_Anim::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Spell_Canvas.cpp b/Jusin154_Team3D/Client/Private/Spell_Canvas.cpp new file mode 100644 index 000000000..c44c70c76 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Spell_Canvas.cpp @@ -0,0 +1,138 @@ +#include "pch.h" +#include "Spell_Canvas.h" +#include "GameInstance.h" +#include "Spell_Panel.h" + +CSpell_Canvas::CSpell_Canvas(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CCanvasObject(pDevice, pContext) +{ +} + +CSpell_Canvas::CSpell_Canvas(const CSpell_Canvas& rhs) + :CCanvasObject(rhs) +{ +} + +HRESULT CSpell_Canvas::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Canvas::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 1920.f; + Desc.fSizeY = 1080.f; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + if (FAILED(Ready_Panel(pArg))) + { + return E_FAIL; + } + return S_OK; +} + +void CSpell_Canvas::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Canvas::Update(_float fTimeDelta) +{ + __super::Update(fTimeDelta); +} + +void CSpell_Canvas::Late_Update(_float fTimeDelta) +{ + if (m_bVisible) { + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CSpell_Canvas::Render() +{ + return S_OK; +} + +_vector CSpell_Canvas::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpell_Canvas::Bind_ShaderResources() +{ + return S_OK; +} + +HRESULT CSpell_Canvas::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpell_Canvas::Ready_Panel(void* pArg) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast (&m_pSpell_Panel)))) + { + return E_FAIL; + } + Add_Panel(TEXT("Spell_Panel"), m_pSpell_Panel); + return S_OK; +} + +void CSpell_Canvas::Clear_Penel() +{ + +} + +CSpell_Canvas* CSpell_Canvas::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Canvas* pInstance = new CSpell_Canvas(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Canvas"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Canvas::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Canvas* pInstance = new CSpell_Canvas(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Canvas"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Canvas::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpell_Canvas::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Spell_Header.cpp b/Jusin154_Team3D/Client/Private/Spell_Header.cpp new file mode 100644 index 000000000..f0a2db064 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Spell_Header.cpp @@ -0,0 +1,239 @@ +#include "pch.h" +#include "Spell_Header.h" +#include "GameInstance.h" + +CSpell_Header::CSpell_Header(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Header::CSpell_Header(const CSpell_Header& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Header::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Header::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 600.f; + Desc.fY = -385.f; + Desc.fSizeX = 512.f; + Desc.fSizeY = 64.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 = 0.f; + m_fAlphaTime = 5.f; + m_fMoveSpeed = 5.f; + m_fLerpX = m_fX; + m_fLerpY = 45; + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); + return S_OK; +} + +void CSpell_Header::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Header::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 * m_fAlphaTime;; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + if (m_iSpellType != -1) + { + m_iSkillType = static_cast(m_pOwner)->Get_Info(m_iSpellType).iSpell_Type; + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Header::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_Header::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELL_HEADER)))) { + 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_Header::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpell_Header::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_fTime", &m_fTime, 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_iSpellType", &m_iSkillType, sizeof(_int)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Header::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_LighthouseHeaderBack"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Header* CSpell_Header::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Header* pInstance = new CSpell_Header(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Header"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Header::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Header* pInstance = new CSpell_Header(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Header"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Header::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpell_Header::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Spell_Header_Line.cpp b/Jusin154_Team3D/Client/Private/Spell_Header_Line.cpp new file mode 100644 index 000000000..1bd1c8aa5 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Spell_Header_Line.cpp @@ -0,0 +1,225 @@ +#include "pch.h" +#include "Spell_Header_Line.h" +#include "GameInstance.h" + +CSpell_Header_Line::CSpell_Header_Line(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Header_Line::CSpell_Header_Line(const CSpell_Header_Line& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Header_Line::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Header_Line::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 600.f; + Desc.fY = -345.f; + Desc.fSizeX = 487.f; + Desc.fSizeY = 18.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 = 0.f; + m_fAlphaTime = 5.f; + static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); + return S_OK; +} + +void CSpell_Header_Line::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Header_Line::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 * m_fAlphaTime;; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Header_Line::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_Header_Line::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) { + 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_Header_Line::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpell_Header_Line::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_fTime", &m_fTime, 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_Header_Line::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_Header_Line"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Header_Line* CSpell_Header_Line::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Header_Line* pInstance = new CSpell_Header_Line(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Header_Line"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Header_Line::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Header_Line* pInstance = new CSpell_Header_Line(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Header"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Header_Line::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpell_Header_Line::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Spell_Hover.cpp b/Jusin154_Team3D/Client/Private/Spell_Hover.cpp new file mode 100644 index 000000000..999d66fdc --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Spell_Hover.cpp @@ -0,0 +1,302 @@ +#include "pch.h" +#include "Spell_Hover.h" +#include "GameInstance.h" + +CSpell_Hover::CSpell_Hover(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Hover::CSpell_Hover(const CSpell_Hover& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Hover::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Hover::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.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_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); + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); + return S_OK; +} + +void CSpell_Hover::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Hover::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_pVIBufferCom->Set_Hover_Index(m_iSpellType); + + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Hover::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_Hover::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::SPELL_HOVER)))) + { + 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_Hover::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Hover::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_Hover::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_Hover::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +HRESULT CSpell_Hover::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_pDiffuse_TextureCom4->Bind_ShaderResource(m_pShaderCom, "g_Texture4", 0))) + { + return E_FAIL; + } + if (FAILED(m_pDiffuse_TextureCom5->Bind_ShaderResource(m_pShaderCom, "g_Texture5", 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_Hover::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(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_IconButtonOutline"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_IconButtonHighlight"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_GoldLeaf"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_Goldleaf_Large"), reinterpret_cast(&m_pDiffuse_TextureCom3), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_IconButton"), reinterpret_cast(&m_pDiffuse_TextureCom4), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_SelectedPresetBorder"), reinterpret_cast(&m_pDiffuse_TextureCom5), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIINSTANCE, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +CSpell_Hover* CSpell_Hover::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Hover* pInstance = new CSpell_Hover(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Hover"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Hover::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Hover* pInstance = new CSpell_Hover(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Hover"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Hover::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_pDiffuse_TextureCom4); + SAFE_RELEASE(m_pDiffuse_TextureCom5); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpell_Hover::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Spell_Hover_Effect.cpp b/Jusin154_Team3D/Client/Private/Spell_Hover_Effect.cpp new file mode 100644 index 000000000..5ed2de67a --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Spell_Hover_Effect.cpp @@ -0,0 +1,266 @@ +#include "pch.h" +#include "Spell_Hover_Effect.h" +#include "GameInstance.h" + +CSpell_Hover_Effect::CSpell_Hover_Effect(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Hover_Effect::CSpell_Hover_Effect(const CSpell_Hover_Effect& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Hover_Effect::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Hover_Effect::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 115.f; + Desc.fSizeY = 115.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 = 1.f; + m_fAlphaTime = 1.f; + m_fOffSetX = 120.f; + m_fOffSetY = 122.f; + m_iCols = 4; + m_fSortZ = 0.02f; + 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); + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); + return S_OK; +} + +void CSpell_Hover_Effect::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Hover_Effect::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_pVIBufferCom->Set_Hover_Index(m_iSpellType); + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Hover_Effect::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_Hover_Effect::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::SPELL_SLOT_EFFECT)))) + { + 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_Hover_Effect::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Hover_Effect::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_Hover_Effect::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_Hover_Effect::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +HRESULT CSpell_Hover_Effect::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_MaskTexture", 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_Hover_Effect::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(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_SelectedBorderMask"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_VFX_T_WhispLine_D"), 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; +} + +CSpell_Hover_Effect* CSpell_Hover_Effect::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Hover_Effect* pInstance = new CSpell_Hover_Effect(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Hover_Effect"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Hover_Effect::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Hover_Effect* pInstance = new CSpell_Hover_Effect(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Hover_Effect"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Hover_Effect::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pDiffuse_TextureCom1); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpell_Hover_Effect::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Spell_List.cpp b/Jusin154_Team3D/Client/Private/Spell_List.cpp new file mode 100644 index 000000000..c88354197 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Spell_List.cpp @@ -0,0 +1,304 @@ +#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 = 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_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_fDelayTime = 0.5f; + m_iPerSpell_Slot = -1; + Color(); + 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; + Hover(fTimeDelta); + __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::COLOR)))) + { + 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); +} + +void CSpell_List::Color() +{ + m_pVIBufferCom->Set_Index_Renge_Color(0, 3, _float4(255.f / 255.f, 255.f / 255.f, 0.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(4, 7, _float4(150.f / 255.f, 120.f / 255.f, 240.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(8, 12, _float4(190.f / 255.f, 46.f / 255.f, 34.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(13, 16, _float4(24.f / 255.f, 190.f / 255.f, 255.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(17, 19, _float4(200.f / 255.f, 220.f / 255.f, 150.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(20, 22, _float4(50.f / 255.f, 150.f / 255.f, 110.f / 255.f, 1.f)); + m_pVIBufferCom->Set_Index_Renge_Color(23, 25, _float4(24.f / 255.f, 190.f / 255.f, 255.f / 255.f, 1.f)); +} + +void CSpell_List::Hover(_float fTimeDelta) +{ + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); + + // 엘리먼트의 월드 위치를 더해주면 엘리먼트 좌표계 기준이 됨 + fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; + fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; + + m_iSpellType = m_pVIBufferCom->Set_Mouse_Hover(fMouse); + + CUIObject::HOVER_INFO Info; + Info.iSlotID = 0; + if (m_iSpellType == -1) + { + Info.iHover_Index = -1; + static_cast(m_pOwner)->Function_Callback(TEXT("Hover"), &Info); + } + + else + { + Info.iHover_Index = m_iSpellType; + static_cast(m_pOwner)->Function_Callback(TEXT("Hover"), &Info); + } + +} + +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; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fTime", &m_fTime, 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(g_iStaticLevel, 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); +} + +#ifdef _DEBUG +void CSpell_List::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Spell_List_Image.cpp b/Jusin154_Team3D/Client/Private/Spell_List_Image.cpp new file mode 100644 index 000000000..2d03173e0 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Spell_List_Image.cpp @@ -0,0 +1,288 @@ +#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(g_iStaticLevel, 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); +} + +#ifdef _DEBUG +void CSpell_List_Image::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Spell_Panel.cpp b/Jusin154_Team3D/Client/Private/Spell_Panel.cpp new file mode 100644 index 000000000..955948fb1 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Spell_Panel.cpp @@ -0,0 +1,349 @@ +#include "pch.h" +#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" +#include "Spell_State.h" +#include "Spell_Hover.h" +#include "Spell_Hover_Effect.h" +#include "Spell_Preview.h" +#include "Spell_Vidio_Border.h" +#include "Current_Slot_Number.h" +#include "Spell_Header.h" +#include "Spell_Header_Line.h" +//#include "Spell_Data.h" +#include "Spell_Anim.h" + +CSpell_Panel::CSpell_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CPanelObject(pDevice, pContext) +{ +} + +CSpell_Panel::CSpell_Panel(const CSpell_Panel& rhs) + :CPanelObject(rhs) +{ +} + +HRESULT CSpell_Panel::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Panel::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 960.f; + Desc.fY = 540.f; + Desc.fSizeX = g_iWinSizeX; + Desc.fSizeY = g_iWinSizeY; + + if (FAILED(__super::Initialize(&Desc))) + { + return E_FAIL; + } + if (FAILED(Ready_Components(pArg))) + { + return E_FAIL; + } + if (FAILED(Ready_Element(pArg))) + { + return E_FAIL; + } + m_fCanvasAlpha = 1.f; + m_fSortZ = 0.04f; + m_iSpellType = -1; + m_iPendingSpell = -1; + m_fDelayTime = 1.f; + Add_Function(TEXT("Hover"), [this](void* p) {this->Slot_Chack(p); }); + return S_OK; +} + +void CSpell_Panel::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Panel::Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + + if (m_iSpellType != -1) + { + m_fHoverTimer += fTimeDelta; + } + else + { + m_fHoverTimer = 0.f; + Function_Callback(TEXT("FadeOut")); + } + + if (m_fHoverTimer >= m_fDelayTime && m_iPendingSpell != m_iSpellType) + { + m_iPendingSpell = m_iSpellType; + Function_Callback(TEXT("FadeIn")); + } + + __super::Update(fTimeDelta); +} + +void CSpell_Panel::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_Panel::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) { + 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_Panel::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +const CUIObject::SPELLINFO CSpell_Panel::Get_Info(_int Index) +{ + return m_Info[Index]; +} + +void CSpell_Panel::Slot_Chack(void* pArg) +{ + CUIObject::HOVER_INFO* Info = static_cast(pArg); + + _int iSlot = Info->iSlotID; + m_iHoverSlot[iSlot] = Info->iHover_Index; + + int finalHover = -1; + for (int i = 0; i < 2; ++i) + { + if (m_iHoverSlot[i] != -1) + { + finalHover = m_iHoverSlot[i]; + break; + } + } + + m_iSpellType = finalHover; + Function_Callback(TEXT("Slot_Hover"), &m_iSpellType); +} + +HRESULT CSpell_Panel::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_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_Panel::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_Spell_Widget"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CSpell_Panel::Ready_Element(void* pArg) +{ + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pCurrent_Spell_Slot)))) + { + return E_FAIL; + } + 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); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_State)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_State"), m_pSpell_State); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Hover)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Hover"), m_pSpell_Hover); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Hover_Effect)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Hover_Effect"), m_pSpell_Hover_Effect); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Preview)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Preview"), m_pSpell_Preview); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Vidio_Border)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Vidio_Border"), m_pSpell_Vidio_Border); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pCurrent_Slot_Number)))) + { + return E_FAIL; + } + Add_Element(TEXT("Current_Slot_Number"), m_pCurrent_Slot_Number); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Header)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Header"), m_pSpell_Header); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Header_Line)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Header_Line"), m_pSpell_Header_Line); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Anim)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Anim"), m_pSpell_Anim); + + //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, m_Info, nullptr, reinterpret_cast(&m_pSpell_Data)))) + //{ + // return E_FAIL; + //} + return S_OK; +} + +CSpell_Panel* CSpell_Panel::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Panel* pInstance = new CSpell_Panel(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Panel"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Panel::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Panel* pInstance = new CSpell_Panel(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Panel"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Panel::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpell_Panel::Describe_Entity() +{ +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Spell_Preview.cpp b/Jusin154_Team3D/Client/Private/Spell_Preview.cpp new file mode 100644 index 000000000..662d64f78 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Spell_Preview.cpp @@ -0,0 +1,288 @@ +#include "pch.h" +#include "Spell_Preview.h" +#include "GameInstance.h" + + +CSpell_Preview::CSpell_Preview(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Preview::CSpell_Preview(const CSpell_Preview& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Preview::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Preview::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 400.f; + Desc.fY = -365.f; + Desc.fSizeX = 128.f; + Desc.fSizeY = 128.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; + } + // y값 최소 270 최대 410 + m_fTimeMult = 3.f; + m_fAlpha = 0.f; + m_fAlphaTime = 5.f; + m_vNine_Slice = _float4(50.f, 75.f, 30.f, 96.f); + m_fTopY = m_fY - m_vScale.y * 0.5f; + SizeUpX(512.f); + SizeUpY(270.f); + m_iSpellType = ENUM_CLASS(SPELLTYPE::CONTROL); + m_fSortZ = 0.02f; + static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); + return S_OK; +} + +void CSpell_Preview::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Preview::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 * m_fAlphaTime;; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_fAlpha = 0.f; + } + } + m_fTime += fTimeDelta * m_fTimeMult; + __super::Update(fTimeDelta); +} + +void CSpell_Preview::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_Preview::Render() +{ + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::SPELL_PREVIEW)))) { + 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_Preview::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_Preview::SizeUpX(_float fSizeX) +{ + _float fX = (fSizeX - m_vScale.x) * 0.5f; + m_fSizeX = fSizeX; + m_fX += fX; + m_fLerpX += fX; + +} + +void CSpell_Preview::SizeUpY(_float fSizeY) +{ + _float prevY = m_fY; + m_fSizeY = fSizeY; + m_fY = m_fTopY + fSizeY * 0.5f; + + _float deltaY = m_fY - prevY; + +} + +HRESULT CSpell_Preview::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_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_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_fNine_Slice", &m_vNine_Slice, sizeof(_float4)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOrigin_Size", &m_fOrigin_Size, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fCurrent_Size", &m_vScale, sizeof(_float2)))) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fImageSipos1", &m_vHeaderBack, sizeof(_float4)))) + { + return E_FAIL; + } + return S_OK; +} + +HRESULT CSpell_Preview::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_SpellWidgetPanelBack"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_Goldleaf_Large"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_TooltipBorder_4K"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_LighthouseHeaderBack"), 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; + } + + return S_OK; +} + +CSpell_Preview* CSpell_Preview::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Preview* pInstance = new CSpell_Preview(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Preview"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Preview::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Preview* pInstance = new CSpell_Preview(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Preview"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Preview::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); +} + +#ifdef _DEBUG +void CSpell_Preview::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Spell_Slot.cpp b/Jusin154_Team3D/Client/Private/Spell_Slot.cpp index 6fed41de8..154832ff0 100644 --- a/Jusin154_Team3D/Client/Private/Spell_Slot.cpp +++ b/Jusin154_Team3D/Client/Private/Spell_Slot.cpp @@ -197,7 +197,7 @@ HRESULT CSpell_Slot::Bind_ShaderResources() HRESULT CSpell_Slot::Ready_Components(void* pArg) { - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Instance"), (CComponent**)&m_pVIBufferCom, nullptr))) + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_UI_Spell_Slot"), (CComponent**)&m_pVIBufferCom, nullptr))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/Spell_State.cpp b/Jusin154_Team3D/Client/Private/Spell_State.cpp new file mode 100644 index 000000000..a183e12cf --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Spell_State.cpp @@ -0,0 +1,271 @@ +#include "pch.h" +#include "Spell_State.h" +#include "GameInstance.h" + +CSpell_State::CSpell_State(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_State::CSpell_State(const CSpell_State& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_State::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_State::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.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_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); + return S_OK; +} + +void CSpell_State::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_State::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; + Hover(); + __super::Update(fTimeDelta); +} + +void CSpell_State::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_State::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIINTANCE::ALPHABLEND)))) + { + 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_State::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CSpell_State::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CSpell_State::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CSpell_State::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +void CSpell_State::Hover() +{ + POINT ptMouse{}; + GetCursorPos(&ptMouse); + ScreenToClient(g_hWnd, &ptMouse); + _float2 fMouse; + fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); + fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); + + // 엘리먼트의 월드 위치를 더해주면 엘리먼트 좌표계 기준이 됨 + fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; + fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; + + m_pVIBufferCom->Set_Mouse_Hover(fMouse); + +} + +HRESULT CSpell_State::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_State::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(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_NewLock"), 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_State* CSpell_State::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_State* pInstance = new CSpell_State(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_State"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_State::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_State* pInstance = new CSpell_State(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_State"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_State::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpell_State::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Spell_Vidio_Border.cpp b/Jusin154_Team3D/Client/Private/Spell_Vidio_Border.cpp new file mode 100644 index 000000000..32ce2c9e2 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Spell_Vidio_Border.cpp @@ -0,0 +1,244 @@ +#include "pch.h" +#include "Spell_Vidio_Border.h" +#include "GameInstance.h" +#include "Spell_Anim.h" + +CSpell_Vidio_Border::CSpell_Vidio_Border(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CSpell_Vidio_Border::CSpell_Vidio_Border(const CSpell_Vidio_Border& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CSpell_Vidio_Border::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CSpell_Vidio_Border::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 590.f; + Desc.fY = -100.f; + Desc.fSizeX = 520.f; + Desc.fSizeY = 275.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 = 0.f; + m_fAlphaTime = 9.f; + m_fMoveSpeed = 5.f; + m_fLerpX = m_fX; + m_fLerpY = 45; + m_bStart = false; + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); + return S_OK; +} + +void CSpell_Vidio_Border::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CSpell_Vidio_Border::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 * m_fAlphaTime; + + if (m_fAlpha <= 0.f) + { + m_bFadeOut = false; + m_bStart = false; + m_fAlpha = 0.f; + } + } + + m_fTime += fTimeDelta * m_fTimeMult; + + if (m_fAlpha >= 0.3f) + m_bStart = true; + + __super::Update(fTimeDelta); + +} + +void CSpell_Vidio_Border::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_Vidio_Border::Render() +{ + if (m_bStart == true) + { + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) + { + 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_Vidio_Border::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +HRESULT CSpell_Vidio_Border::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_fTime", &m_fTime, 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_Vidio_Border::Ready_Components(void* pArg) +{ + if (FAILED(Add_Component(g_iStaticLevel, &m_pVIBufferCom))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_UI_T_TalentVideoBorder"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(g_iStaticLevel, FX_UIEDITOR, (CComponent**)&m_pShaderCom, nullptr))) + { + return E_FAIL; + } + return S_OK; +} + +CSpell_Vidio_Border* CSpell_Vidio_Border::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSpell_Vidio_Border* pInstance = new CSpell_Vidio_Border(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CSpell_Vidio_Border"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CSpell_Vidio_Border::Clone(void* pArg, CGameObject* pOwner) +{ + CSpell_Vidio_Border* pInstance = new CSpell_Vidio_Border(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSpell_Vidio_Border"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSpell_Vidio_Border::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +#ifdef _DEBUG +void CSpell_Vidio_Border::Describe_Entity() +{ +} +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/StreetContainer.cpp b/Jusin154_Team3D/Client/Private/StreetContainer.cpp index 5a2adf4cc..aeeb6d183 100644 --- a/Jusin154_Team3D/Client/Private/StreetContainer.cpp +++ b/Jusin154_Team3D/Client/Private/StreetContainer.cpp @@ -16,24 +16,27 @@ void CStreetContainer::Priority_Update(_float fTimeDelta) { __super::Priority_Update(fTimeDelta); - for (auto& pCollisiton : m_ColiisonPartObjects) + for (auto& pCollisiton : m_ColiisonPartObjects){ pCollisiton->Priority_Update(fTimeDelta); + } } void CStreetContainer::Update(_float fTimeDelta) { __super::Update(fTimeDelta); - for (auto& pCollisiton : m_ColiisonPartObjects) + for (auto& pCollisiton : m_ColiisonPartObjects){ pCollisiton->Update(fTimeDelta); + } } void CStreetContainer::Late_Update(_float fTimeDelta) { __super::Late_Update(fTimeDelta); - for (auto& pCollisiton : m_ColiisonPartObjects) + for (auto& pCollisiton : m_ColiisonPartObjects){ pCollisiton->Late_Update(fTimeDelta); + } } HRESULT CStreetContainer::Render() @@ -109,8 +112,9 @@ void CStreetContainer::Free() { __super::Free(); - for (auto& pCollision : m_ColiisonPartObjects) + for (auto& pCollision : m_ColiisonPartObjects){ SAFE_RELEASE(pCollision); + } } #ifdef _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Troll.cpp b/Jusin154_Team3D/Client/Private/Troll.cpp index 640576de9..0357ca052 100644 --- a/Jusin154_Team3D/Client/Private/Troll.cpp +++ b/Jusin154_Team3D/Client/Private/Troll.cpp @@ -93,7 +93,10 @@ void CTroll::Update(_float fTimeDelta) } } +#ifdef _DEBUG Describe_Entity(); +#endif // _DEBUG + } void CTroll::Late_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index 2032a399d..a3b021b9a 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -8,13 +8,13 @@ namespace Client enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, HAIR, EYELASH, OUTLINE_WRITE, OUTLINE_READ, END }; enum class SHADER_PASS_CUBE { DEFAULT, SHADOW, BLUR, END }; - enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, OUTLINE_WRITE, OUTLINE_READ, END }; + enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, OUTLINE_WRITE, OUTLINE_READ, BLOOM, END }; enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, ENV_TERRAIN_ANISO, END }; enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; 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, UVMULT, 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_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, END }; + enum class SHADER_PASS_UIINTANCE { DEFAULT, ALPHABLEND, MAGIC_METER, SPELL_LIST, EESSENTIAL_SPELL_SOLT, EESSENTIAL_SPELL, COLOR, SPELL_HOVER, SPELL_SLOT_EFFECT, END }; enum class EFFECT_TYPE { EFFECT, TRAIL, END }; diff --git a/Jusin154_Team3D/Client/Public/Client_Macro.h b/Jusin154_Team3D/Client/Public/Client_Macro.h index df875b2d5..ba1ad6980 100644 --- a/Jusin154_Team3D/Client/Public/Client_Macro.h +++ b/Jusin154_Team3D/Client/Public/Client_Macro.h @@ -55,6 +55,8 @@ namespace Client { #define LAYER_DOT TEXT("Layer_Dot") #define LAYER_CELL TEXT("Layer_Cell") #define LAYER_TRIGGER TEXT("Layer_Trigger") +#define LAYER_ITEM TEXT("Layer_Item") +#define LAYER_EFFECTPOOL TEXT("Layer_EffectPool") #define LAYER_LIGHT TEXT("Layer_Light") #define LAYER_MAPOBJECTMANAGER TEXT("Layer_MapObjectManager") diff --git a/Jusin154_Team3D/Client/Public/Client_Struct.h b/Jusin154_Team3D/Client/Public/Client_Struct.h index c3c76619d..498525f3d 100644 --- a/Jusin154_Team3D/Client/Public/Client_Struct.h +++ b/Jusin154_Team3D/Client/Public/Client_Struct.h @@ -21,7 +21,9 @@ namespace Client _uint iSpell_ID{}; _wstring pSpell_Name; _uint iSpell_Type{}; - _uint iSpell_CoolTime{}; + _uint iSkill_Type{}; + _float fSpell_CoolTime{}; + _float fDuration{}; _uint iAnimNum{}; _wstring pSpellInfo; _bool bSpell_Lock = false; diff --git a/Jusin154_Team3D/Client/Public/Current_Slot_Number.h b/Jusin154_Team3D/Client/Public/Current_Slot_Number.h new file mode 100644 index 000000000..5e942a481 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Current_Slot_Number.h @@ -0,0 +1,60 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CCurrent_Slot_Number final : public CElementObject +{ +private: + CCurrent_Slot_Number(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCurrent_Slot_Number(const CCurrent_Slot_Number& rhs); + virtual ~CCurrent_Slot_Number() = 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; + void UV(); + _float4 Meter_Index(_uint Number); + 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[4]; + + _float2 m_fIamge_Size{}; + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CCurrent_Slot_Number* 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 diff --git a/Jusin154_Team3D/Client/Public/Current_Spell_Slot.h b/Jusin154_Team3D/Client/Public/Current_Spell_Slot.h new file mode 100644 index 000000000..91305afe5 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Current_Spell_Slot.h @@ -0,0 +1,57 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CCurrent_Spell_Slot final : public CElementObject +{ +private: + CCurrent_Spell_Slot(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCurrent_Spell_Slot(const CCurrent_Spell_Slot& rhs); + virtual ~CCurrent_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 }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CCurrent_Spell_Slot* 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 diff --git a/Jusin154_Team3D/Client/Public/Eessential_Spell.h b/Jusin154_Team3D/Client/Public/Eessential_Spell.h new file mode 100644 index 000000000..096de667d --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Eessential_Spell.h @@ -0,0 +1,61 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +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; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUGe; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Eessential_Spell_Slot.h b/Jusin154_Team3D/Client/Public/Eessential_Spell_Slot.h new file mode 100644 index 000000000..1cc98a0fc --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Eessential_Spell_Slot.h @@ -0,0 +1,65 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +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: + void Hover(_float fTimeDelta); + +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{}; + + _float m_fHoverTime{}; + _int m_iPerSpell_Slot{}; + + +public: + static CEessential_Spell_Slot* 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 diff --git a/Jusin154_Team3D/Client/Public/InfoInstance.h b/Jusin154_Team3D/Client/Public/InfoInstance.h index 8832eb433..41b803282 100644 --- a/Jusin154_Team3D/Client/Public/InfoInstance.h +++ b/Jusin154_Team3D/Client/Public/InfoInstance.h @@ -40,6 +40,10 @@ class CInfoInstance final : public CBase #pragma endregion #pragma region MAP_INFO HRESULT Load_MapObjects(const _char* pFilePath); + HRESULT Load_LightElements(const _char* pFilePath); +#pragma endregion +#pragma region Spell_INFO + HRESULT Load_SpellInfo(const _char* pFilePath); #pragma endregion diff --git a/Jusin154_Team3D/Client/Public/Loader.h b/Jusin154_Team3D/Client/Public/Loader.h index 0e7b9fbba..86df14ee7 100644 --- a/Jusin154_Team3D/Client/Public/Loader.h +++ b/Jusin154_Team3D/Client/Public/Loader.h @@ -40,7 +40,7 @@ class CLoader final : public CBase private: HRESULT Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreName, function AddPrototypeEvent); - future Deferred_FolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector** OutContents); + future*> Deferred_FolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag); future*> Deferred_ModelLoad(MODEL eType, const _char* pDirectoryPath, _fmatrix PreTransform, const _tchar* pPrototypeTag); public: static CLoader* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID); diff --git a/Jusin154_Team3D/Client/Public/Magic_Item.h b/Jusin154_Team3D/Client/Public/Magic_Item.h index 88421e214..fb685bca1 100644 --- a/Jusin154_Team3D/Client/Public/Magic_Item.h +++ b/Jusin154_Team3D/Client/Public/Magic_Item.h @@ -41,6 +41,7 @@ class CMagic_Item final : public CElementObject CTexture* m_pDiffuse_TextureCom3 = { nullptr }; CTexture* m_pDiffuse_TextureCom4 = { nullptr }; CTexture* m_pDiffuse_TextureCom5 = { nullptr }; + CTexture* m_pDiffuse_TextureCom6 = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/MapElement.h b/Jusin154_Team3D/Client/Public/MapElement.h new file mode 100644 index 000000000..362cbd038 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/MapElement.h @@ -0,0 +1,61 @@ +#pragma once + +#include "Client_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CModel; +class CShader; +NS_END + +NS_BEGIN(Client) + +class CMapElement abstract : public CGameObject +{ +public: + typedef struct tagMapElement_Desc { + _uint iRenderType{}; + CTransform* pParentTransform = { nullptr }; + _float3 vScale; + _float3 vRotation; + _float3 vPosition; + _uint iMaxLodLevel{}; + vector<_wstring> ModelPrototypeTags; + vector<_uint>* pModelPathIndices = { nullptr }; + }MAPELEMENT_DESC; + +protected: + CMapElement(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CMapElement(const CMapElement& rhs); + virtual ~CMapElement() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + +protected: + _uint m_iMaxLodLevel = {}; + _uint m_iLodIndex = {}; + + CShader* m_pShaderCom = { nullptr }; + vector m_pModelComs; + vector<_wstring> m_ModelPrototypeTags; + +protected: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Bind_ShaderResources() override; + +public: + virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) PURE; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG + +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/MapElement_Light.h b/Jusin154_Team3D/Client/Public/MapElement_Light.h new file mode 100644 index 000000000..9f835b36e --- /dev/null +++ b/Jusin154_Team3D/Client/Public/MapElement_Light.h @@ -0,0 +1,73 @@ +#pragma once + +#include "Client_Define.h" +#include "MapElement.h" + +NS_BEGIN(Engine) +class CLight; +class CTexture; +NS_END + +NS_BEGIN(Client) + +class CMapElement_Light : public CMapElement +{ +public: + typedef struct MapElement_Light_Desc : MAPELEMENT_DESC + { + _bool isPow; + _uint iGlassMeshIndex; + _float fBloomStregth; + _float fRange; + _float4 vPosOffset; + _float4 vDiffuse; + _float4 vAmbient; + _float4 vSpecular; + }MAPELEMENT_LIGHT_DESC; + +private: + CMapElement_Light(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CMapElement_Light(const CMapElement_Light& rhs); + virtual ~CMapElement_Light() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + + HRESULT Render_Bloom()override; + void Toggle_Light(); + +private: + CLight* m_pLightCom = { nullptr }; + CTexture* m_pEmissiveTextureCom = { nullptr }; + CTexture* m_pMaskTextureCom = { nullptr }; + CTexture* m_pGlassTextureCom = { nullptr }; + + _bool m_isLightOn = { true }; + _bool m_isLightAdded = { false }; + _uint m_iGlassMeshIndex = {}; + _float m_fBloomStrength = { 1.f }; + _float m_fGlassRatio = { 0.5f }; + + _float m_LightAdded_Distance = { 5000.f }; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Bind_ShaderResources() override; + + +public: + static CMapElement_Light* 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 diff --git a/Jusin154_Team3D/Client/Public/MapInfo.h b/Jusin154_Team3D/Client/Public/MapInfo.h index e81fc6bb4..4ea323760 100644 --- a/Jusin154_Team3D/Client/Public/MapInfo.h +++ b/Jusin154_Team3D/Client/Public/MapInfo.h @@ -22,6 +22,7 @@ class CMapInfo final : public CBase HRESULT Load_StreetContainer(tinyxml2::XMLElement* Container, class CMapContainer** ppContainerObject); HRESULT Load_MapRenderObjects(tinyxml2::XMLElement* Container, class CMapContainer* pContainerObject); HRESULT Load_MapCollisionObjects(tinyxml2::XMLElement* Container, class CMapContainer* pContainerObject); + HRESULT Load_LightElements(const _char* pFileName); private: CGameInstance* m_pGameInstance = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/MapObject_Collision.h b/Jusin154_Team3D/Client/Public/MapObject_Collision.h index 36386ffa8..d6a21d4ff 100644 --- a/Jusin154_Team3D/Client/Public/MapObject_Collision.h +++ b/Jusin154_Team3D/Client/Public/MapObject_Collision.h @@ -23,6 +23,7 @@ class CMapObject_Collision final : public CMapPartObject // 충돌용 Mesh private: CShader* m_pShaderCom = { nullptr }; + vector> m_RigidBodies; vector m_pModelComs; _uint m_iLodIndex = {}; diff --git a/Jusin154_Team3D/Client/Public/MapObject_Render.h b/Jusin154_Team3D/Client/Public/MapObject_Render.h index b991d3b95..d57082d19 100644 --- a/Jusin154_Team3D/Client/Public/MapObject_Render.h +++ b/Jusin154_Team3D/Client/Public/MapObject_Render.h @@ -30,7 +30,7 @@ class CMapObject_Render final : public CMapPartObject // Render PartObject private: MAPOBJECT_RENDER_TYPE m_Type = {}; - CShader* m_pShaderCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; vector m_pModelComs; _uint m_iLodIndex = {}; diff --git a/Jusin154_Team3D/Client/Public/Skill_Data.h b/Jusin154_Team3D/Client/Public/Skill_Data.h index 1f8db1ae1..d5f45f0cd 100644 --- a/Jusin154_Team3D/Client/Public/Skill_Data.h +++ b/Jusin154_Team3D/Client/Public/Skill_Data.h @@ -1,5 +1,62 @@ #pragma once -class CSkill_Data + +#include "Client_Define.h" +#include "GameObject.h" + +NS_BEGIN(Engine) +class CGameInstance; +NS_END + +NS_BEGIN(Client) + +class CSkill_Data final : public CGameObject { +public: + typedef struct tagSpellInfo + { + _int iSpell_ID{}; + _string pSpell_Name; + _string pImage_Name; + _int iSpell_Type{}; + _int iSkill_Type{}; + _float fSpell_CoolTime{}; + _float fDuration{}; + _int iAnimNum{}; + _string pSpellInfo; + _bool bSpell_Lock = false; + _bool bEquip_Spell = false; + }SPELLINFO; +private: + CSkill_Data(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSkill_Data(const CSkill_Data& rhs); + virtual ~CSkill_Data() = 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; + +public: + //const SPELLINFO& Get_Info(_uint SpellID) const; + +private: + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + CGameObject* m_pSpell_Panel = { nullptr }; + + SPELLINFO SpellInfo = {}; +public: + static CSkill_Data* 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/Client/Public/Spell_Anim.h b/Jusin154_Team3D/Client/Public/Spell_Anim.h new file mode 100644 index 000000000..a40ce3957 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Spell_Anim.h @@ -0,0 +1,62 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSpell_Anim final : public CElementObject +{ +private: + CSpell_Anim(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Anim(const CSpell_Anim& rhs); + virtual ~CSpell_Anim() = 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 Set_FadeIn() override; + +private: + void Change_Image(_int SpellID); + virtual void Set_SkillType(_int eType) 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_pDesendo_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + _int m_iTotalFrames{}; // 전체 프레임 수 + _float m_fFrameTime{}; // 한 프레임당 시간(초) + _int m_iCurrentFrame{}; // 현재 보여줄 프레임 + + _int m_iPerSpell{}; + _bool m_bAnim_Start = { false }; +public: + static CSpell_Anim* 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 diff --git a/Jusin154_Team3D/Client/Public/Spell_Canvas.h b/Jusin154_Team3D/Client/Public/Spell_Canvas.h new file mode 100644 index 000000000..f6ca5bf81 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Spell_Canvas.h @@ -0,0 +1,50 @@ +#pragma once + +#include "Client_Define.h" +#include "CanvasObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSpell_Canvas final : public CCanvasObject +{ +private: + CSpell_Canvas(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Canvas(const CSpell_Canvas& rhs); + virtual ~CSpell_Canvas() = 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 Ready_Panel(void* pArg) override; + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + +public: + void Clear_Penel(); + +private: + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + CGameObject* m_pSpell_Panel = { nullptr }; +public: + static CSpell_Canvas* 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 diff --git a/Jusin154_Team3D/Client/Public/Spell_Header.h b/Jusin154_Team3D/Client/Public/Spell_Header.h new file mode 100644 index 000000000..cb7f1956d --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Spell_Header.h @@ -0,0 +1,49 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSpell_Header final : public CElementObject +{ +private: + CSpell_Header(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Header(const CSpell_Header& rhs); + virtual ~CSpell_Header() = 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: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + _int m_iSkillType{}; +public: + static CSpell_Header* 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 diff --git a/Jusin154_Team3D/Client/Public/Spell_Header_Line.h b/Jusin154_Team3D/Client/Public/Spell_Header_Line.h new file mode 100644 index 000000000..e51a66e5d --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Spell_Header_Line.h @@ -0,0 +1,48 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSpell_Header_Line final : public CElementObject +{ +private: + CSpell_Header_Line(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Header_Line(const CSpell_Header_Line& rhs); + virtual ~CSpell_Header_Line() = 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: + CTexture* m_pDiffuse_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + +public: + static CSpell_Header_Line* 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 diff --git a/Jusin154_Team3D/Client/Public/Spell_Hover.h b/Jusin154_Team3D/Client/Public/Spell_Hover.h new file mode 100644 index 000000000..bd223cb21 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Spell_Hover.h @@ -0,0 +1,63 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSpell_Hover final : public CElementObject +{ +private: + CSpell_Hover(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Hover(const CSpell_Hover& rhs); + virtual ~CSpell_Hover() = 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: + void Hover(); + +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 }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; + CTexture* m_pDiffuse_TextureCom3 = { nullptr }; + CTexture* m_pDiffuse_TextureCom4 = { nullptr }; + CTexture* m_pDiffuse_TextureCom5 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_UI_Instance* m_pVIBufferCom = { nullptr }; + + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; +public: + static CSpell_Hover* 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 diff --git a/Jusin154_Team3D/Client/Public/Spell_Hover_Effect.h b/Jusin154_Team3D/Client/Public/Spell_Hover_Effect.h new file mode 100644 index 000000000..c416c180a --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Spell_Hover_Effect.h @@ -0,0 +1,57 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSpell_Hover_Effect final : public CElementObject +{ +private: + CSpell_Hover_Effect(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Hover_Effect(const CSpell_Hover_Effect& rhs); + virtual ~CSpell_Hover_Effect() = 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 CSpell_Hover_Effect* 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 diff --git a/Jusin154_Team3D/Client/Public/Spell_List.h b/Jusin154_Team3D/Client/Public/Spell_List.h new file mode 100644 index 000000000..2be2758cf --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Spell_List.h @@ -0,0 +1,63 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +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: + void Color(); + void Hover(_float fTimeDelta); + +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{}; + + _int m_iPerSpell_Slot{}; + _float m_fHoverTime{}; +public: + static CSpell_List* 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 diff --git a/Jusin154_Team3D/Client/Public/Spell_List_Image.h b/Jusin154_Team3D/Client/Public/Spell_List_Image.h new file mode 100644 index 000000000..5fd3c3c10 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Spell_List_Image.h @@ -0,0 +1,61 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +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; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Spell_Panel.h b/Jusin154_Team3D/Client/Public/Spell_Panel.h new file mode 100644 index 000000000..9b98c857a --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Spell_Panel.h @@ -0,0 +1,80 @@ +#pragma once + +#include "Client_Define.h" +#include "PanelObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSpell_Panel final : public CPanelObject +{ + +private: + CSpell_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Panel(const CSpell_Panel& rhs); + virtual ~CSpell_Panel() = 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 const SPELLINFO Get_Info(_int Index) override; + +private: + void Slot_Chack(void* pArg); + + +private: + virtual HRESULT Bind_ShaderResources() override; + virtual HRESULT Ready_Components(void* pArg) override; + virtual HRESULT Ready_Element(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_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 }; + CGameObject* m_pSpell_State = { nullptr }; + CGameObject* m_pSpell_Hover = { nullptr }; + CGameObject* m_pSpell_Hover_Effect = { nullptr }; + CGameObject* m_pSpell_Preview = { nullptr }; + CGameObject* m_pSpell_Vidio_Border = { nullptr }; + CGameObject* m_pCurrent_Slot_Number = { nullptr }; + CGameObject* m_pSpell_Data= { nullptr }; + CGameObject* m_pSpell_Header = { nullptr }; + CGameObject* m_pSpell_Header_Line = { nullptr }; + CGameObject* m_pSpell_Anim = { nullptr }; + + _int m_iHoverSlot[2] = { -1,-1 }; + + SPELLINFO m_Info[34] = {}; + CUIObject::HOVER_INFO m_Hover; + + _int m_iPendingSpell = -1; + _float m_fHoverTimer = 0.f; +public: + static CSpell_Panel* 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 diff --git a/Jusin154_Team3D/Client/Public/Spell_Preview.h b/Jusin154_Team3D/Client/Public/Spell_Preview.h new file mode 100644 index 000000000..5952a2c80 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Spell_Preview.h @@ -0,0 +1,58 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSpell_Preview final : public CElementObject +{ +private: + CSpell_Preview(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Preview(const CSpell_Preview& rhs); + virtual ~CSpell_Preview() = 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; + +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 }; + CTexture* m_pDiffuse_TextureCom2 = { nullptr }; + CTexture* m_pDiffuse_TextureCom3 = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + + + _float4 m_vHeaderBack{}; + +public: + static CSpell_Preview* 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 diff --git a/Jusin154_Team3D/Client/Public/Spell_State.h b/Jusin154_Team3D/Client/Public/Spell_State.h new file mode 100644 index 000000000..9e958722e --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Spell_State.h @@ -0,0 +1,59 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSpell_State final : public CElementObject +{ +private: + CSpell_State(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_State(const CSpell_State& rhs); + virtual ~CSpell_State() = 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: + void Hover(); + +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_State* 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 diff --git a/Jusin154_Team3D/Client/Public/Spell_Vidio_Border.h b/Jusin154_Team3D/Client/Public/Spell_Vidio_Border.h new file mode 100644 index 000000000..eb4c32fd6 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Spell_Vidio_Border.h @@ -0,0 +1,59 @@ +#pragma once + +#include "Client_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Engine) +class CTexture; +class CShader; +class CVIBuffer_Rect; +NS_END + +NS_BEGIN(Client) + +class CSpell_Vidio_Border final : public CElementObject +{ +private: + CSpell_Vidio_Border(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CSpell_Vidio_Border(const CSpell_Vidio_Border& rhs); + virtual ~CSpell_Vidio_Border() = 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 const SPELLINFO Get_Info(_int Index) override; +// +//public: +// virtual void Set_SkillType(_int eType); + +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_pDesendo_TextureCom = { nullptr }; + CShader* m_pShaderCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + + _float m_fStertTimer{}; + _int m_iPerIndex{}; + _bool m_bStart = { false }; + +public: + static CSpell_Vidio_Border* 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 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml new file mode 100644 index 000000000..e95b0bb5d --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Spell/SpellInfo.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_LightPost.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_LightPost.bin new file mode 100644 index 000000000..d7b8bdaa6 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_LightPost.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5b8e94075725aaec1874eee3c0240c9df914e47713cda7d02d1c84de4abc1e34 +size 406128 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_LightPost_LOD_Lod1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_LightPost_LOD_Lod1.bin new file mode 100644 index 000000000..5a24c7215 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_LightPost_LOD_Lod1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aaf97eaae8f025be73022d47498eb6bfa2a71c372d3e51363ac098dbf6a64b79 +size 47621 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_LightPost_LOD_Lod2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_LightPost_LOD_Lod2.bin new file mode 100644 index 000000000..21cbf2c49 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_LightPost_LOD_Lod2.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f5b5fdfefee9934681704631db107d63f77ed9e85460a2bbf3294af1f9ae993 +size 13029 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_Light_Post_Floating.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_Light_Post_Floating.bin new file mode 100644 index 000000000..901ecc477 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_Light_Post_Floating.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0c9a3bdec85532655541b459d75dd98f6e979602cf9469d289e95148d8a3b97 +size 160300 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_Light_Post_Floating_Lod1.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_Light_Post_Floating_Lod1.bin new file mode 100644 index 000000000..b77fe61de --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_Light_Post_Floating_Lod1.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75046ea7cd3df1c7929505a289011040d230d44f5ab9c138119e834913b75de8 +size 60677 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_Light_Post_Floating_Lod2.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_Light_Post_Floating_Lod2.bin new file mode 100644 index 000000000..f8b15a4b6 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/LightPosts/SM_HM_Light_Post_Floating_Lod2.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:424ac40d753940d65ba9ba77bd9a5fc234954388fabaeca0ed42286d90ac7a68 +size 17125 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Body_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Body_D.png index b63e5e4a5..a6bedaa46 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Body_D.png and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Body_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Leather_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Leather_D.png index 9d495b121..4514a7fd2 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Leather_D.png and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Leather_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Leather_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Leather_N.png index 3533f9808..18f4af2b1 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Leather_N.png and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Leather_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Metal_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Metal_D.png index bbbb5572a..24d592444 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Metal_D.png and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Metal_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Metal_E.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Metal_E.png index b23efd89f..276b69373 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Metal_E.png and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Metal_E.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Metal_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Metal_N.png index 3c8bca8ba..0c732e895 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Metal_N.png and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_ArmoredTroll_Metal_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Eye_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Eye_D.png index df0e9262f..aa18900c0 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Eye_D.png and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Eye_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Head_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Head_D.png index 0276f34ab..9ed84c8fd 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Head_D.png and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Head_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Head_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Head_N.png index f4280c6f9..b7f71ce79 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Head_N.png and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Head_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Skirt_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Skirt_D.png index 04895a31f..ad2dad5cb 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Skirt_D.png and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Skirt_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Skirt_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Skirt_N.png index e3d44cbb1..e4a9470b6 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Skirt_N.png and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Mountain01_Skirt_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Teeth_D.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Teeth_D.png index 5db401caf..a14c27d13 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Teeth_D.png and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Teeth_D.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Teeth_N.png b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Teeth_N.png index 7c0338fd8..20cb63373 100644 Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Teeth_N.png and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Troll/T_Troll_Teeth_N.png differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index 37238d940..e0f824a57 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -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(); + } + } 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 5b35a6cf9..593c4b16a 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UI_Instance.hlsl @@ -43,7 +43,7 @@ VS_OUT VS_MAIN(VS_IN In) matrix matVP = mul(g_ViewMatrix, g_ProjMatrix); float3 vLocalPos = In.vPosition; - if (In.bHover != 0) + if (In.bHover == 1) vLocalPos.xy *= In.vSize * 1.1f; else vLocalPos.xy *= In.vSize; @@ -274,7 +274,7 @@ PS_OUT PS_Spell_Effect(PS_IN In) //float angle = -g_fTime; //float s = sin(angle); //float c = cos(angle); - //float2 rotUV = float2( + //float2 maskUV = float2( //uv.x * c - uv.y * s, //uv.x * s + uv.y * c //) + center; diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index 90acba622..2f838d71f 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -166,6 +166,7 @@ + @@ -260,6 +261,7 @@ + @@ -322,6 +324,7 @@ + @@ -418,6 +421,7 @@ + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 0fa1be799..e9e3ed1fb 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -436,12 +436,18 @@ {99652c97-4011-4d1f-84fb-7e6aa9f6ec1a} - - {4aa98871-8d80-4757-b616-e96f4e840857} - {3949bd3b-1686-43e3-822c-d3eabe41653e} + + {2f8a3c68-c3d3-43cc-9649-16e0cfd168fa} + + + {dcc220a9-4649-4f95-9205-9eee9af128ec} + + + {4aa98871-8d80-4757-b616-e96f4e840857} + @@ -864,6 +870,12 @@ 50.UI\Spell_Data + + 50.UI\Spell_Canvas\Spell_Panel\Current_Slot_Number + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Drag + @@ -1285,6 +1297,12 @@ 50.UI\Spell_Data + + 50.UI\Spell_Canvas\Spell_Panel\Current_Slot_Number + + + 50.UI\Spell_Canvas\Spell_Panel\Spell_Drag + diff --git a/Jusin154_Team3D/Editor/Private/Current_Slot_Number.cpp b/Jusin154_Team3D/Editor/Private/Current_Slot_Number.cpp new file mode 100644 index 000000000..f7bb015e0 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Current_Slot_Number.cpp @@ -0,0 +1,278 @@ +#include "pch.h" +#include "Current_Slot_Number.h" +#include "GameInstance.h" + +CCurrent_Slot_Number::CCurrent_Slot_Number(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + :CElementObject(pDevice, pContext) +{ +} + +CCurrent_Slot_Number::CCurrent_Slot_Number(const CCurrent_Slot_Number& rhs) + :CElementObject(rhs) +{ +} + +HRESULT CCurrent_Slot_Number::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CCurrent_Slot_Number::Initialize(void* pArg) +{ + CUIObject::UIOBJECT_DESC Desc{}; + + Desc.fX = 0.f; + Desc.fY = 0.f; + Desc.fSizeX = 35.f; + Desc.fSizeY = 35.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 = 105.f; + m_fOffSetY = 101.f; + m_iCols = 4; + UV(); + m_pVIBufferCom->Set_Cloned(true); + m_pVIBufferCom->Set_Pos(-805.f, 380.f, m_fOffSetX, m_fOffSetY, m_iCols); + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); + m_pVIBufferCom->Set_ImageUV(pUVDesc); + return S_OK; +} + +void CCurrent_Slot_Number::Priority_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + __super::Priority_Update(fTimeDelta); +} + +void CCurrent_Slot_Number::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 CCurrent_Slot_Number::Late_Update(_float fTimeDelta) +{ + if (!__super::Chack_Visible()) + { + return; + } + if (m_bVisible) + { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + } + __super::Late_Update(fTimeDelta); +} + +HRESULT CCurrent_Slot_Number::Render() +{ + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + + return S_OK; +} + +_vector CCurrent_Slot_Number::Get_WorldPostion() +{ + return m_pTransformCom->Get_State(STATE::POSITION); +} + +void CCurrent_Slot_Number::SizeUpX(_float fSizeX) +{ + m_fSizeX = fSizeX; + m_pVIBufferCom->Set_SizeX(m_fSizeX); +} + +void CCurrent_Slot_Number::SizeUpY(_float fSizeY) +{ + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_SizeY(m_fSizeY); +} + +void CCurrent_Slot_Number::SizeUpdate(_float fSizeX, _float fSizeY) +{ + m_fSizeX = fSizeX; + m_fSizeY = fSizeY; + m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); +} + +HRESULT CCurrent_Slot_Number::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_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 CCurrent_Slot_Number::Ready_Components(void* pArg) +{ + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Slot_Number_UI_Instance"), (CComponent**)&m_pVIBufferCom, nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Atlas_Number"), 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; +} + +void CCurrent_Slot_Number::UV() +{ + pUVDesc[0].fUV = Meter_Index(1); + pUVDesc[1].fUV = Meter_Index(2); + pUVDesc[2].fUV = Meter_Index(3); + pUVDesc[3].fUV = Meter_Index(4); +} + +_float4 CCurrent_Slot_Number::Meter_Index(_uint Number) +{ + m_fIamge_Size = { 320.f, 128.f }; + + _uint iXCount = 5; + _uint iYCount = 2; + + _float frameWidth = 64.f; + _float frameHeight = 64.f; + + _uint frameX = Number % iXCount; + _uint frameY = Number / iXCount; + + _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 UV; +} + +CCurrent_Slot_Number* CCurrent_Slot_Number::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CCurrent_Slot_Number* pInstance = new CCurrent_Slot_Number(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CCurrent_Slot_Number"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CCurrent_Slot_Number::Clone(void* pArg, CGameObject* pOwner) +{ + CCurrent_Slot_Number* pInstance = new CCurrent_Slot_Number(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CSlot_Number"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CCurrent_Slot_Number::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pDiffuse_TextureCom); + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pVIBufferCom); +} + +void CCurrent_Slot_Number::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp b/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp index 7f376933b..b8fc818c2 100644 --- a/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp +++ b/Jusin154_Team3D/Editor/Private/Eessential_Spell_Slot.cpp @@ -46,6 +46,8 @@ HRESULT CEessential_Spell_Slot::Initialize(void* pArg) 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_fDelayTime = 0.5f; + m_iPerSpell_Slot = -1; return S_OK; } @@ -89,7 +91,7 @@ void CEessential_Spell_Slot::Update(_float fTimeDelta) } } - Hover(); + Hover(fTimeDelta); m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); @@ -154,7 +156,7 @@ void CEessential_Spell_Slot::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } -void CEessential_Spell_Slot::Hover() +void CEessential_Spell_Slot::Hover(_float fTimeDelta) { POINT ptMouse{}; GetCursorPos(&ptMouse); @@ -167,25 +169,23 @@ void CEessential_Spell_Slot::Hover() fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; - m_bPrevHover = m_bHover; - m_bHover = (m_iSpellType = m_pVIBufferCom->Set_Mouse_Hover(fMouse)); - if (m_iSpellType != -1) + + m_iSpellType = m_pVIBufferCom->Set_Mouse_Hover(fMouse); + CUIObject::HOVER_INFO Info; + Info.iSlotID = 1; + if (m_iSpellType == -1) { - m_bHover = true; - if (m_bHover == true && m_bPrevHover == false) - { - m_iSpellType += ENUM_CLASS(SKILL_TYPE::JAP); - static_cast(m_pOwner)->Set_SkillType(m_iSpellType); - } + Info.iHover_Index = -1; + static_cast(m_pOwner)->Function_Callback(TEXT("Hover"), &Info); + } + else { - m_bHover = false; - if (m_bHover == false && m_bPrevHover == true) - { - static_cast(m_pOwner)->Set_SkillType(m_iSpellType); - } - } + Info.iHover_Index = m_iSpellType + ENUM_CLASS(SKILL_TYPE::JAP); + static_cast(m_pOwner)->Function_Callback(TEXT("Hover"), &Info); + + } } diff --git a/Jusin154_Team3D/Editor/Private/Level_UI.cpp b/Jusin154_Team3D/Editor/Private/Level_UI.cpp index 89438401e..6eda2432e 100644 --- a/Jusin154_Team3D/Editor/Private/Level_UI.cpp +++ b/Jusin154_Team3D/Editor/Private/Level_UI.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Level_UI.h" #include "GameInstance.h" #include "Level_Loading.h" @@ -6,6 +6,7 @@ #include "IMGUIUI.h" #include "GamePlay_Canvas.h" #include "Mouse_Cursor.h" +#include "Spell_Data.h" CLevel_UI::CLevel_UI(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } @@ -33,7 +34,7 @@ void CLevel_UI::Update(_float fTimeDelta) HRESULT CLevel_UI::Render() { - SetWindowText(g_hWnd, TEXT("UI·¹º§ÀԴϴÙ.")); + SetWindowText(g_hWnd, TEXT("UI레벨입니다.")); GUI::ShowDemoWindow(); return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 703ccb9ef..be35b8fa2 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -36,6 +36,8 @@ #pragma region UI +#include "Spell_Data.h" + #include "GamePlay_Canvas.h" #include "Mission_Panel.h" @@ -78,6 +80,7 @@ #include "Spell_Header_Line.h" #include "Spell_Vidio_Border.h" #include "Spell_Anim.h" +#include "Current_Slot_Number.h" #include "IMGUIUI.h" @@ -813,6 +816,11 @@ HRESULT CLoader::Loading_For_UI() m_strMessage = TEXT("Prototype Loading.."); + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CSpell_Data::Create(m_pDevice, m_pContext)))) + { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGamePlay_Canvas::Create(m_pDevice, m_pContext)))) { return E_FAIL; @@ -968,6 +976,10 @@ HRESULT CLoader::Loading_For_UI() { return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CCurrent_Slot_Number::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/Spell_Anim.cpp b/Jusin154_Team3D/Editor/Private/Spell_Anim.cpp index 8ffec41f8..333921bdf 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Anim.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Anim.cpp @@ -21,8 +21,8 @@ HRESULT CSpell_Anim::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = 0.f; - Desc.fY = 0.f; + Desc.fX = 590.f; + Desc.fY = -100.f; Desc.fSizeX = 470.f; Desc.fSizeY = 250.f; @@ -38,23 +38,34 @@ HRESULT CSpell_Anim::Initialize(void* pArg) } m_fTimeMult = 3.f; - m_fAlpha = 1.f; - m_fAlphaTime = 3.f; + m_fAlpha = 0.f; + m_fAlphaTime = 9.f; m_fSortZ = 0.01f; - m_iTotalFrames = 216; + m_iTotalFrames = 120; m_fFrameTime = 0.1f; m_iCurrentFrame = 0; m_bAnim_Start = false; + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); return S_OK; } void CSpell_Anim::Priority_Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } __super::Priority_Update(fTimeDelta); } void CSpell_Anim::Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } if (m_bFadeIn == true) { if (m_fAlpha <= 1.f) @@ -69,26 +80,20 @@ void CSpell_Anim::Update(_float fTimeDelta) 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_bFadeOut = false; + m_fAlpha = 0.f; + m_bAnim_Start = false; } - if (m_pGameInstance->Key_Down(DIK_9)) - { - m_bAnim_Start = !m_bAnim_Start; - } - if (m_bAnim_Start) + + if (m_bAnim_Start == true) { m_fTime += fTimeDelta * m_fTimeMult; } else + { m_iCurrentFrame = 0; + } if (m_fTime >= m_fFrameTime) { @@ -104,14 +109,20 @@ void CSpell_Anim::Update(_float fTimeDelta) void CSpell_Anim::Late_Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } if (m_bVisible) { - m_pGameInstance->Add_RenderGroup(RENDER::UI, this); + if (m_pDiffuse_TextureCom != nullptr) + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); } __super::Late_Update(fTimeDelta); } HRESULT CSpell_Anim::Render() { + if (FAILED(Bind_ShaderResources())) { return E_FAIL; @@ -137,12 +148,37 @@ _vector CSpell_Anim::Get_WorldPostion() return m_pTransformCom->Get_State(STATE::POSITION); } -void CSpell_Anim::Anim_Start(_uint iSpell_Id) +void CSpell_Anim::Set_FadeIn() { + if (!m_bFadeIn && m_fAlpha < 1.f) + { + m_bFadeIn = true; + m_bFadeOut = false; + } + m_bAnim_Start = true; } -void CSpell_Anim::Anim_End() +void CSpell_Anim::Change_Image(_int SpellID) { + _wstring pImageName = static_cast(m_pOwner)->Get_Info(SpellID).pImage_Name; + m_iTotalFrames = static_cast(m_pOwner)->Get_Info(SpellID).iAnimNum; + if (m_pDiffuse_TextureCom) + { + Remove_Component(); + SAFE_RELEASE(m_pDiffuse_TextureCom); + } + if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(LEVEL::UI), pImageName, reinterpret_cast(&m_pDiffuse_TextureCom)))) + return; +} + +void CSpell_Anim::Set_SkillType(_int eType) +{ + if (eType != -1 && eType != m_iPerSpell) + { + m_iPerSpell = eType; + m_iCurrentFrame = 0; + Change_Image(eType); + } } HRESULT CSpell_Anim::Bind_ShaderResources() @@ -188,7 +224,7 @@ HRESULT CSpell_Anim::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Crucio"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Arresto_Momentum"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) { return E_FAIL; } @@ -196,7 +232,6 @@ HRESULT CSpell_Anim::Ready_Components(void* pArg) { return E_FAIL; } - return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Data.cpp b/Jusin154_Team3D/Editor/Private/Spell_Data.cpp index decc62317..2d61fc8c4 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Data.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Data.cpp @@ -1,6 +1,10 @@ #include "pch.h" #include "Spell_Data.h" #include "GameObject.h" +#include "UIObject.h" +#include "tinyxml2.h" + +; CSpell_Data::CSpell_Data(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CGameObject(pDevice, pContext) @@ -14,14 +18,62 @@ CSpell_Data::CSpell_Data(const CSpell_Data& rhs) HRESULT CSpell_Data::Initialize_Prototype() { + return S_OK; } HRESULT CSpell_Data::Initialize(void* pArg) { + auto* pInfo = static_cast(pArg); + + tinyxml2::XMLDocument doc; + tinyxml2::XMLError Error = doc.LoadFile("../Bin/Resources/Data/UI/Spell/SpellInfo.xml"); + if (Error != tinyxml2::XML_SUCCESS) + return E_FAIL; + + tinyxml2::XMLElement* pSpellInfo = doc.FirstChildElement("SpellInfo"); + if (!pSpellInfo) + return E_FAIL; + + tinyxml2::XMLElement* pSpell = pSpellInfo->FirstChildElement("Spell"); + while (pSpell) + { + int id = 0; + pSpell->QueryIntAttribute("Spell_ID", &id); + + if (id < 0 || id > 34) + { + pSpell = pSpell->NextSiblingElement("Spell"); + continue; + } + + pInfo[id].iSpell_ID = id; + pInfo[id].pSpell_Name = CMyTools::ToWstring(pSpell->Attribute("Spell_Name")); + pInfo[id].pImage_Name = CMyTools::ToWstring(pSpell->Attribute("Image_Name")); + pSpell->QueryIntAttribute("Spell_Type", &pInfo[id].iSpell_Type); + pSpell->QueryIntAttribute("Skill_Type", &pInfo[id].iSkill_Type); + pSpell->QueryFloatAttribute("Spell_Cooltime", &pInfo[id].fSpell_CoolTime); + pSpell->QueryFloatAttribute("Duration", &pInfo[id].fDuration); + pSpell->QueryIntAttribute("AnimNum", &pInfo[id].iAnimNum); + pInfo[id].pSpellInfo = CMyTools::ToWstring(pSpell->Attribute("SpellInfo")); + int lock = 0, equip = 0; + pSpell->QueryIntAttribute("Spell_Lock", &lock); + pSpell->QueryIntAttribute("Equip_Spell", &equip); + pInfo[id].bSpell_Lock = lock != 0; + pInfo[id].bEquip_Spell = equip != 0; + + pSpell = pSpell->NextSiblingElement("Spell"); + } + + //pInfo = SpellInfo; return S_OK; } +//const CUIObject::SPELLINFO& CSpell_Data::Get_Info(_uint SpellID) const +//{ +// return SpellInfo[SpellID]; +//} + void CSpell_Data::Priority_Update(_float fTimeDelta) { } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Drag.cpp b/Jusin154_Team3D/Editor/Private/Spell_Drag.cpp new file mode 100644 index 000000000..a1e01be9e --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Spell_Drag.cpp @@ -0,0 +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(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(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(&m_pDiffuse_TextureCom), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_SelectedPresetBorder"), reinterpret_cast(&m_pDiffuse_TextureCom1), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_GoldLeaf"), reinterpret_cast(&m_pDiffuse_TextureCom2), nullptr))) + { + return E_FAIL; + } + if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_Atlas_Spell"), 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; + } + + 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(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() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/Spell_Header.cpp b/Jusin154_Team3D/Editor/Private/Spell_Header.cpp index 284be9ad9..190672a47 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Header.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Header.cpp @@ -21,8 +21,8 @@ HRESULT CSpell_Header::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = 0.f; - Desc.fY = -20.f; + Desc.fX = 600.f; + Desc.fY = -385.f; Desc.fSizeX = 512.f; Desc.fSizeY = 64.f; @@ -38,21 +38,32 @@ HRESULT CSpell_Header::Initialize(void* pArg) } m_fTimeMult = 3.f; - m_fAlpha = 1.f; - m_fAlphaTime = 3.f; + m_fAlpha = 0.f; + m_fAlphaTime = 5.f; m_fMoveSpeed = 5.f; m_fLerpX = m_fX; m_fLerpY = 45; + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); return S_OK; } void CSpell_Header::Priority_Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } __super::Priority_Update(fTimeDelta); } void CSpell_Header::Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } if (m_bFadeIn == true) { if (m_fAlpha <= 1.f) @@ -70,7 +81,7 @@ void CSpell_Header::Update(_float fTimeDelta) if (m_bFadeOut == true) { if (m_fAlpha >= 0.f) - m_fAlpha -= fTimeDelta; + m_fAlpha -= fTimeDelta * m_fAlphaTime;; if (m_fAlpha <= 0.f) { @@ -79,13 +90,23 @@ void CSpell_Header::Update(_float fTimeDelta) } } + if (m_iSpellType != -1) + { + m_iSkillType = static_cast(m_pOwner)->Get_Info(m_iSpellType).iSpell_Type; + } + m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); } void CSpell_Header::Late_Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); __super::Late_Update(fTimeDelta); } } @@ -113,11 +134,6 @@ _vector CSpell_Header::Get_WorldPostion() return m_pTransformCom->Get_State(STATE::POSITION); } -void CSpell_Header::MoveY(_float fY) -{ - m_fY += fY; -} - HRESULT CSpell_Header::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) @@ -156,7 +172,7 @@ HRESULT CSpell_Header::Bind_ShaderResources() { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSpellType, sizeof(_int)))) + if (FAILED(m_pShaderCom->Bind_RawValue("g_iSpellType", &m_iSkillType, sizeof(_int)))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp b/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp index dbd3bdaf5..6810ed202 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Header_Line.cpp @@ -21,8 +21,8 @@ HRESULT CSpell_Header_Line::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = 0.f; - Desc.fY = 20.f; + Desc.fX = 600.f; + Desc.fY = -345.f; Desc.fSizeX = 487.f; Desc.fSizeY = 18.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) }; @@ -37,19 +37,28 @@ HRESULT CSpell_Header_Line::Initialize(void* pArg) } m_fTimeMult = 3.f; - m_fAlpha = 1.f; - m_fAlphaTime = 3.f; - m_fMoveSpeed = 5.f; + m_fAlpha = 0.f; + m_fAlphaTime = 5.f; + static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); return S_OK; } void CSpell_Header_Line::Priority_Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } __super::Priority_Update(fTimeDelta); } void CSpell_Header_Line::Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } if (m_bFadeIn == true) { if (m_fAlpha <= 1.f) @@ -67,7 +76,7 @@ void CSpell_Header_Line::Update(_float fTimeDelta) if (m_bFadeOut == true) { if (m_fAlpha >= 0.f) - m_fAlpha -= fTimeDelta; + m_fAlpha -= fTimeDelta * m_fAlphaTime;; if (m_fAlpha <= 0.f) { @@ -75,14 +84,19 @@ void CSpell_Header_Line::Update(_float fTimeDelta) m_fAlpha = 0.f; } } - + m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); } void CSpell_Header_Line::Late_Update(_float fTimeDelta) { + if (!__super::Chack_Visible()) + { + return; + } if (m_bVisible) { + m_pGameInstance->Add_RenderGroup(RENDER::UI, this); __super::Late_Update(fTimeDelta); } } @@ -110,11 +124,6 @@ _vector CSpell_Header_Line::Get_WorldPostion() return m_pTransformCom->Get_State(STATE::POSITION); } -void CSpell_Header_Line::MoveY(_float fY) -{ - m_fY += fY; -} - HRESULT CSpell_Header_Line::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) diff --git a/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp b/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp index 86a4e1685..9604d77e7 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Hover.cpp @@ -46,6 +46,7 @@ HRESULT CSpell_Hover::Initialize(void* pArg) 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); + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); return S_OK; } @@ -88,7 +89,9 @@ void CSpell_Hover::Update(_float fTimeDelta) m_fAlpha = 0.f; } } - Hover(); + + m_pVIBufferCom->Set_Hover_Index(m_iSpellType); + m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); } @@ -152,22 +155,6 @@ void CSpell_Hover::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } -void CSpell_Hover::Hover() -{ - POINT ptMouse{}; - GetCursorPos(&ptMouse); - ScreenToClient(g_hWnd, &ptMouse); - _float2 fMouse; - fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); - fMouse.y = -(ptMouse.y - (g_iWinSizeY* 0.5f)); - - fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; - fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; - - m_pVIBufferCom->Set_Mouse_Hover(fMouse); - -} - HRESULT CSpell_Hover::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) diff --git a/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp b/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp index f336f09d1..d323d9f12 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Hover_Effect.cpp @@ -23,8 +23,8 @@ HRESULT CSpell_Hover_Effect::Initialize(void* pArg) Desc.fX = 0.f; Desc.fY = 0.f; - Desc.fSizeX = 105.f; - Desc.fSizeY = 105.f; + Desc.fSizeX = 115.f; + Desc.fSizeY = 115.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) }; @@ -47,6 +47,7 @@ HRESULT CSpell_Hover_Effect::Initialize(void* pArg) 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); + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); return S_OK; } @@ -89,7 +90,7 @@ void CSpell_Hover_Effect::Update(_float fTimeDelta) m_fAlpha = 0.f; } } - Hover(); + m_pVIBufferCom->Set_Hover_Index(m_iSpellType); m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); } @@ -153,22 +154,6 @@ void CSpell_Hover_Effect::SizeUpdate(_float fSizeX, _float fSizeY) m_pVIBufferCom->Set_Size(m_fSizeX, m_fSizeY); } -void CSpell_Hover_Effect::Hover() -{ - POINT ptMouse{}; - GetCursorPos(&ptMouse); - ScreenToClient(g_hWnd, &ptMouse); - _float2 fMouse; - fMouse.x = ptMouse.x - (g_iWinSizeX * 0.5f); - fMouse.y = -(ptMouse.y - (g_iWinSizeY * 0.5f)); - - fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; - fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; - - m_pVIBufferCom->Set_Mouse_Hover(fMouse); - -} - HRESULT CSpell_Hover_Effect::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) diff --git a/Jusin154_Team3D/Editor/Private/Spell_List.cpp b/Jusin154_Team3D/Editor/Private/Spell_List.cpp index 57eaeca74..2285e0425 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_List.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_List.cpp @@ -46,6 +46,8 @@ HRESULT CSpell_List::Initialize(void* pArg) 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_fDelayTime = 0.5f; + m_iPerSpell_Slot = -1; Color(); return S_OK; } @@ -90,7 +92,7 @@ void CSpell_List::Update(_float fTimeDelta) } } m_fTime += fTimeDelta * m_fTimeMult; - Hover(); + Hover(fTimeDelta); __super::Update(fTimeDelta); } @@ -165,7 +167,7 @@ void CSpell_List::Color() m_pVIBufferCom->Set_Index_Renge_Color(23, 25, _float4(24.f / 255.f, 190.f / 255.f, 255.f / 255.f, 1.f)); } -void CSpell_List::Hover() +void CSpell_List::Hover(_float fTimeDelta) { POINT ptMouse{}; GetCursorPos(&ptMouse); @@ -178,23 +180,20 @@ void CSpell_List::Hover() fMouse.x -= m_pOwner->Get_WorldPostion().m128_f32[0]; fMouse.y -= m_pOwner->Get_WorldPostion().m128_f32[1]; - m_bPrevHover = m_bHover; - m_bHover = (m_iSpellType = m_pVIBufferCom->Set_Mouse_Hover(fMouse)); - if (m_iSpellType != -1) + m_iSpellType = m_pVIBufferCom->Set_Mouse_Hover(fMouse); + + CUIObject::HOVER_INFO Info; + Info.iSlotID = 0; + if (m_iSpellType == -1) { - m_bHover = true; - if (m_bHover == true && m_bPrevHover == false) - { - static_cast(m_pOwner)->Set_SkillType(m_iSpellType); - } + Info.iHover_Index = -1; + static_cast(m_pOwner)->Function_Callback(TEXT("Hover"), &Info); } + else { - m_bHover = false; - if (m_bHover == false && m_bPrevHover == true) - { - static_cast(m_pOwner)->Set_SkillType(m_iSpellType); - } + Info.iHover_Index = m_iSpellType; + static_cast(m_pOwner)->Function_Callback(TEXT("Hover"), &Info); } } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp index 566519b20..54cece9c3 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Overlay.cpp @@ -47,7 +47,7 @@ HRESULT CSpell_Overlay::Initialize(void* pArg) m_vUVScale.x = 1.f; m_vUVScale.y = 1.f; m_fCoolTime = 5.f; - m_fSortZ = 1.f; + m_fSortZ = 0.01f; m_iSpellType = ENUM_CLASS(SPELLTYPE::CONTROL); Compute_UI(5); return S_OK; diff --git a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp index 5825737f7..7f60a1c46 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Panel.cpp @@ -11,6 +11,11 @@ #include "Spell_Hover_Effect.h" #include "Spell_Preview.h" #include "Spell_Vidio_Border.h" +#include "Current_Slot_Number.h" +#include "Spell_Header.h" +#include "Spell_Header_Line.h" +#include "Spell_Data.h" +#include "Spell_Anim.h" CSpell_Panel::CSpell_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CPanelObject(pDevice, pContext) @@ -50,7 +55,10 @@ HRESULT CSpell_Panel::Initialize(void* pArg) } m_fCanvasAlpha = 1.f; m_fSortZ = 0.04f; - + m_iSpellType = -1; + m_iPendingSpell = -1; + m_fDelayTime = 1.f; + Add_Function(TEXT("Hover"), [this](void* p) {this->Slot_Chack(p); }); return S_OK; } @@ -70,6 +78,22 @@ void CSpell_Panel::Update(_float fTimeDelta) return; } + if (m_iSpellType != -1) + { + m_fHoverTimer += fTimeDelta; + } + else + { + m_fHoverTimer = 0.f; + Function_Callback(TEXT("FadeOut")); + } + + if (m_fHoverTimer >= m_fDelayTime && m_iPendingSpell != m_iSpellType) + { + m_iPendingSpell = m_iSpellType; + Function_Callback(TEXT("FadeIn")); + } + __super::Update(fTimeDelta); } @@ -108,6 +132,32 @@ _vector CSpell_Panel::Get_WorldPostion() return m_pTransformCom->Get_State(STATE::POSITION); } +const CUIObject::SPELLINFO CSpell_Panel::Get_Info(_int Index) +{ + return m_Info[Index]; +} + +void CSpell_Panel::Slot_Chack(void* pArg) +{ + CUIObject::HOVER_INFO* Info = static_cast(pArg); + + _int iSlot = Info->iSlotID; + m_iHoverSlot[iSlot] = Info->iHover_Index; + + int finalHover = -1; + for (int i = 0; i < 2; ++i) + { + if (m_iHoverSlot[i] != -1) + { + finalHover = m_iHoverSlot[i]; + break; + } + } + + m_iSpellType = finalHover; + Function_Callback(TEXT("Slot_Hover"), &m_iSpellType); +} + HRESULT CSpell_Panel::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) @@ -225,6 +275,34 @@ HRESULT CSpell_Panel::Ready_Element(void* pArg) } Add_Element(TEXT("Spell_Vidio_Border"), m_pSpell_Vidio_Border); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pCurrent_Slot_Number)))) + { + return E_FAIL; + } + Add_Element(TEXT("Current_Slot_Number"), m_pCurrent_Slot_Number); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Header)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Header"), m_pSpell_Header); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Header_Line)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Header_Line"), m_pSpell_Header_Line); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Anim)))) + { + return E_FAIL; + } + Add_Element(TEXT("Spell_Anim"), m_pSpell_Anim); + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, m_Info, nullptr, reinterpret_cast(&m_pSpell_Data)))) + { + return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp b/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp index 782652f26..f42d4fc15 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Preview.cpp @@ -1,8 +1,7 @@ #include "pch.h" #include "Spell_Preview.h" #include "GameInstance.h" -#include "Spell_Header.h" -#include "Spell_Header_Line.h" + CSpell_Preview::CSpell_Preview(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CElementObject(pDevice, pContext) @@ -40,14 +39,16 @@ HRESULT CSpell_Preview::Initialize(void* pArg) } // y값 최소 270 최대 410 m_fTimeMult = 3.f; - m_fAlpha = 1.f; - m_fAlphaTime = 3.f; + m_fAlpha = 0.f; + m_fAlphaTime = 5.f; m_vNine_Slice = _float4(50.f, 75.f, 30.f, 96.f); m_fTopY = m_fY - m_vScale.y * 0.5f; SizeUpX(512.f); SizeUpY(270.f); m_iSpellType = ENUM_CLASS(SPELLTYPE::CONTROL); m_fSortZ = 0.02f; + static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); return S_OK; } @@ -82,7 +83,7 @@ void CSpell_Preview::Update(_float fTimeDelta) if (m_bFadeOut == true) { if (m_fAlpha >= 0.f) - m_fAlpha -= fTimeDelta; + m_fAlpha -= fTimeDelta * m_fAlphaTime;; if (m_fAlpha <= 0.f) { @@ -90,7 +91,6 @@ void CSpell_Preview::Update(_float fTimeDelta) m_fAlpha = 0.f; } } - static_cast(m_pSpell_Header)->Set_SkillType(ENUM_CLASS(m_iSpellType)); m_fTime += fTimeDelta * m_fTimeMult; __super::Update(fTimeDelta); } @@ -121,8 +121,6 @@ HRESULT CSpell_Preview::Render() if (FAILED(m_pVIBufferCom->Render())) { return E_FAIL; } - m_pSpell_Header->Render(); - m_pSpell_Header_Line->Render(); return S_OK; } @@ -148,8 +146,6 @@ void CSpell_Preview::SizeUpY(_float fSizeY) _float deltaY = m_fY - prevY; - static_cast(m_pSpell_Header_Line)->MoveY(-deltaY); - static_cast(m_pSpell_Header)->MoveY(-deltaY); } HRESULT CSpell_Preview::Bind_ShaderResources() @@ -243,14 +239,7 @@ HRESULT CSpell_Preview::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Header)))) - { - return E_FAIL; - } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Header_Line)))) - { - return E_FAIL; - } + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp b/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp index b5f0d702b..1324ee4b8 100644 --- a/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp +++ b/Jusin154_Team3D/Editor/Private/Spell_Vidio_Border.cpp @@ -39,11 +39,15 @@ HRESULT CSpell_Vidio_Border::Initialize(void* pArg) } m_fTimeMult = 3.f; - m_fAlpha = 1.f; - m_fAlphaTime = 3.f; + m_fAlpha = 0.f; + m_fAlphaTime = 9.f; m_fMoveSpeed = 5.f; m_fLerpX = m_fX; m_fLerpY = 45; + m_bStart = false; + static_cast(m_pOwner)->Add_Function(TEXT("Slot_Hover"), [this](void* p) {this->Set_SkillType(*reinterpret_cast<_int*>(p)); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeIn"), [this](void* p) {this->Set_FadeIn(); }); + static_cast(m_pOwner)->Add_Function(TEXT("FadeOut"), [this](void* p) {this->Set_FadeOut(); }); return S_OK; } @@ -78,17 +82,21 @@ void CSpell_Vidio_Border::Update(_float fTimeDelta) if (m_bFadeOut == true) { if (m_fAlpha >= 0.f) - m_fAlpha -= fTimeDelta; + m_fAlpha -= fTimeDelta * m_fAlphaTime; if (m_fAlpha <= 0.f) { m_bFadeOut = false; + m_bStart = false; m_fAlpha = 0.f; } } m_fTime += fTimeDelta * m_fTimeMult; + if (m_fAlpha >= 0.3f) + m_bStart = true; + __super::Update(fTimeDelta); } @@ -107,21 +115,25 @@ void CSpell_Vidio_Border::Late_Update(_float fTimeDelta) HRESULT CSpell_Vidio_Border::Render() { - if (FAILED(Bind_ShaderResources())) + if (m_bStart == true) { - return E_FAIL; - } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) - { - return E_FAIL; - } - if (FAILED(m_pVIBufferCom->Bind_Resources())) - { - return E_FAIL; - } - if (FAILED(m_pVIBufferCom->Render())) - { - return E_FAIL; + if (FAILED(Bind_ShaderResources())) + { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Bind_Resources())) + { + return E_FAIL; + } + if (FAILED(m_pVIBufferCom->Render())) + { + return E_FAIL; + } + } return S_OK; @@ -187,10 +199,6 @@ HRESULT CSpell_Vidio_Border::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pSpell_Anim)))) - { - return E_FAIL; - } return S_OK; } diff --git a/Jusin154_Team3D/Editor/Public/Current_Slot_Number.h b/Jusin154_Team3D/Editor/Public/Current_Slot_Number.h new file mode 100644 index 000000000..ebfed02b7 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Current_Slot_Number.h @@ -0,0 +1,52 @@ +#pragma once + +#include "Editor_Define.h" +#include "ElementObject.h" + +NS_BEGIN(Editor) + +class CCurrent_Slot_Number final : public CElementObject +{ +private: + CCurrent_Slot_Number(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CCurrent_Slot_Number(const CCurrent_Slot_Number& rhs); + virtual ~CCurrent_Slot_Number() = 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; + void UV(); + _float4 Meter_Index(_uint Number); + 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[4]; + + _float2 m_fIamge_Size{}; + _float m_fOffSetX{}; + _float m_fOffSetY{}; + _uint m_iCols{}; + +public: + static CCurrent_Slot_Number* 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/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index 43cb7b2e4..129d4badf 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -28,14 +28,14 @@ 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 }; enum class EFFECT_TYPE { EFFECT, TRAIL, END }; - enum class SKILL_TYPE{ ARESTO_MOMENTUM, GLACIUS, LEVIOSO, TRANSFORM, // 노란색 - ASSIO, DEPULSO, DESCENDO, FLIPENDO, // 보라색 + enum class SKILL_TYPE{ ARRESTO_MOMENTUM, GLACIUS, LEVIOSO, TRANSFORM, // 노란색 + ACCIO, DEPULSO, DESCENDO, FLIPENDO, // 보라색 CONFRINGO, DIFFINDO, EXPELLIARMUS, BOMBARDA, INCENDIO, // 빨간색 DISILLUSIONMENT, LUMOS, REPARO, WINGARDIUM_LEVIOSA, // 하늘색 CONJURING_SPELL, ALTERING_SPELL, EVANESCO, // 연녹색 diff --git a/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h b/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h index 6c0619e09..5ce4f508f 100644 --- a/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h +++ b/Jusin154_Team3D/Editor/Public/Eessential_Spell_Slot.h @@ -25,7 +25,7 @@ class CEessential_Spell_Slot final : public CElementObject private: - void Hover(); + void Hover(_float fTimeDelta); private: virtual HRESULT Bind_ShaderResources() override; @@ -43,8 +43,10 @@ class CEessential_Spell_Slot final : public CElementObject _float m_fOffSetY{}; _uint m_iCols{}; - _bool m_bHover = { false }; - _bool m_bPrevHover = { false }; + _float m_fHoverTime{}; + _int m_iPerSpell_Slot{}; + + public: static CEessential_Spell_Slot* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Magic_Item.h b/Jusin154_Team3D/Editor/Public/Magic_Item.h index 18df03ef7..7679c208e 100644 --- a/Jusin154_Team3D/Editor/Public/Magic_Item.h +++ b/Jusin154_Team3D/Editor/Public/Magic_Item.h @@ -28,6 +28,7 @@ class CMagic_Item final : public CElementObject private: void Compute_UV(_uint iItemID); void Compute_Image(); + private: CTexture* m_pDiffuse_TextureCom = { nullptr }; CTexture* m_pDiffuse_TextureCom1 = { nullptr }; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Anim.h b/Jusin154_Team3D/Editor/Public/Spell_Anim.h index 678f2b36a..4845e6212 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Anim.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Anim.h @@ -20,8 +20,11 @@ class CSpell_Anim final : public CElementObject virtual _vector Get_WorldPostion() override; public: - void Anim_Start(_uint iSpell_Id); - void Anim_End(); + virtual void Set_FadeIn() override; + +private: + void Change_Image(_int SpellID); + virtual void Set_SkillType(_int eType) override; private: virtual HRESULT Bind_ShaderResources() override; @@ -39,7 +42,7 @@ class CSpell_Anim final : public CElementObject _float m_fFrameTime{}; // 한 프레임당 시간(초) _int m_iCurrentFrame{}; // 현재 보여줄 프레임 - _uint m_iSpell_Index{}; + _int m_iPerSpell{}; _bool m_bAnim_Start = { false }; public: static CSpell_Anim* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Editor/Public/Spell_Data.h b/Jusin154_Team3D/Editor/Public/Spell_Data.h index 86c6f33f6..e1101bbae 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Data.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Data.h @@ -11,6 +11,22 @@ NS_BEGIN(Editor) class CSpell_Data final : public CGameObject { +public: + typedef struct tagSpellInfo + { + _int iSpell_ID{}; + _string pSpell_Name; + _string pImage_Name; + _int iSpell_Type{}; + _int iSkill_Type{}; + _float fSpell_CoolTime{}; + _float fDuration{}; + _int iAnimNum{}; + _string pSpellInfo; + _bool bSpell_Lock = false; + _bool bEquip_Spell = false; + }SPELLINFO; +private: CSpell_Data(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CSpell_Data(const CSpell_Data& rhs); virtual ~CSpell_Data() = default; @@ -28,9 +44,14 @@ class CSpell_Data final : public CGameObject virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; +public: + //const SPELLINFO& Get_Info(_uint SpellID) const; + private: CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; CGameObject* m_pSpell_Panel = { nullptr }; + + SPELLINFO SpellInfo = {}; public: static CSpell_Data* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Drag.h b/Jusin154_Team3D/Editor/Public/Spell_Drag.h new file mode 100644 index 000000000..b65a92d24 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Spell_Drag.h @@ -0,0 +1,50 @@ +#pragma once + +#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 diff --git a/Jusin154_Team3D/Editor/Public/Spell_Header.h b/Jusin154_Team3D/Editor/Public/Spell_Header.h index 41fb41913..c9690aaab 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Header.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Header.h @@ -19,9 +19,6 @@ class CSpell_Header final : public CElementObject virtual HRESULT Render() override; virtual _vector Get_WorldPostion() override; -private: - virtual void MoveY(_float fY) override; - private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; @@ -33,6 +30,7 @@ class CSpell_Header final : public CElementObject CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + _int m_iSkillType{}; public: static CSpell_Header* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Header_Line.h b/Jusin154_Team3D/Editor/Public/Spell_Header_Line.h index d8062f7ec..822caa59e 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Header_Line.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Header_Line.h @@ -19,9 +19,6 @@ class CSpell_Header_Line final : public CElementObject virtual HRESULT Render() override; virtual _vector Get_WorldPostion() override; -private: - virtual void MoveY(_float fY) override; - private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Hover.h b/Jusin154_Team3D/Editor/Public/Spell_Hover.h index 496588411..7aeeca08a 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Hover.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Hover.h @@ -49,7 +49,6 @@ class CSpell_Hover final : public CElementObject _float m_fOffSetX{}; _float m_fOffSetY{}; _uint m_iCols{}; - public: static CSpell_Hover* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h b/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h index 433d74719..2216e07f9 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Hover_Effect.h @@ -27,9 +27,6 @@ class CSpell_Hover_Effect final : public CElementObject virtual void SizeUpY(_float fSizeY) override; virtual void SizeUpdate(_float fSizeX, _float fSizeY) override; -private: - void Hover(); - private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_List.h b/Jusin154_Team3D/Editor/Public/Spell_List.h index 7e81f303a..a74245592 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_List.h +++ b/Jusin154_Team3D/Editor/Public/Spell_List.h @@ -29,7 +29,7 @@ class CSpell_List final : public CElementObject private: void Color(); - void Hover(); + void Hover(_float fTimeDelta); private: virtual HRESULT Bind_ShaderResources() override; @@ -47,9 +47,8 @@ class CSpell_List final : public CElementObject _float m_fOffSetY{}; _uint m_iCols{}; - _bool m_bHover = { false }; - _bool m_bPrevHover = { false }; - + _int m_iPerSpell_Slot{}; + _float m_fHoverTime{}; public: static CSpell_List* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Panel.h b/Jusin154_Team3D/Editor/Public/Spell_Panel.h index 8fa70c623..af602b37e 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Panel.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Panel.h @@ -11,6 +11,7 @@ NS_BEGIN(Editor) class CSpell_Panel final : public CPanelObject { + private: CSpell_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CSpell_Panel(const CSpell_Panel& rhs); @@ -24,9 +25,11 @@ class CSpell_Panel final : public CPanelObject virtual _vector Get_WorldPostion() override; public: - void SlotHoverOn(); - void SlotHoverOff(); - void SlotHover(); + virtual const SPELLINFO Get_Info(_int Index) override; + +private: + void Slot_Chack(void* pArg); + private: virtual HRESULT Bind_ShaderResources() override; @@ -38,7 +41,7 @@ class CSpell_Panel final : public CPanelObject private: CTexture* m_pDiffuse_TextureCom = { nullptr }; CShader* m_pShaderCom = { nullptr }; - CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; CGameObject* m_pCurrent_Spell_Slot = { nullptr }; CGameObject* m_pSpell_List = { nullptr }; @@ -50,9 +53,19 @@ class CSpell_Panel final : public CPanelObject CGameObject* m_pSpell_Hover_Effect = { nullptr }; CGameObject* m_pSpell_Preview = { nullptr }; CGameObject* m_pSpell_Vidio_Border = { nullptr }; + CGameObject* m_pCurrent_Slot_Number = { nullptr }; + CGameObject* m_pSpell_Data= { nullptr }; + CGameObject* m_pSpell_Header = { nullptr }; + CGameObject* m_pSpell_Header_Line = { nullptr }; + CGameObject* m_pSpell_Anim = { nullptr }; - _uint m_iSlotHover_Index{}; + _int m_iHoverSlot[2] = { -1,-1 }; + SPELLINFO m_Info[34] = {}; + CUIObject::HOVER_INFO m_Hover; + + _int m_iPendingSpell = -1; + _float m_fHoverTimer = 0.f; public: static CSpell_Panel* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Preview.h b/Jusin154_Team3D/Editor/Public/Spell_Preview.h index 6f3dcd134..e8d47274c 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Preview.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Preview.h @@ -36,8 +36,7 @@ class CSpell_Preview final : public CElementObject CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; - CGameObject* m_pSpell_Header = { nullptr }; - CGameObject* m_pSpell_Header_Line = { nullptr }; + _float4 m_vHeaderBack{}; diff --git a/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h b/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h index 3263a8c70..bb306b7bb 100644 --- a/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h +++ b/Jusin154_Team3D/Editor/Public/Spell_Vidio_Border.h @@ -19,6 +19,12 @@ class CSpell_Vidio_Border final : public CElementObject virtual HRESULT Render() override; virtual _vector Get_WorldPostion() override; +//public: +// virtual const SPELLINFO Get_Info(_int Index) override; +// +//public: +// virtual void Set_SkillType(_int eType); + private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; @@ -31,7 +37,9 @@ class CSpell_Vidio_Border final : public CElementObject CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; - CGameObject* m_pSpell_Anim = { nullptr }; + _float m_fStertTimer{}; + _int m_iPerIndex{}; + _bool m_bStart = { false }; public: static CSpell_Vidio_Border* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj b/Jusin154_Team3D/Engine/Default/Engine.vcxproj index a884dc4a7..06b502ff1 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj @@ -269,7 +269,6 @@ call Update_Lib.bat - @@ -522,7 +521,6 @@ call Update_Lib.bat - diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index 1240a0667..5928bf252 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -178,9 +178,6 @@ {3625aad6-89b2-490e-bd9c-3cff284605e4} - - {92ec7ae6-14ee-455c-a3ad-378e46f3b1f0} - {be0d499e-e4cf-4dde-92a0-a0904e713045} @@ -462,9 +459,6 @@ 02.Element\02.Component\06.Model\Animation\Channel - - 02.Element\02.Component\06.Model\LerpAnim - 02.Element\02.Component\02.VIBuffer\Cube @@ -1094,9 +1088,6 @@ 02.Element\02.Component\06.Model\Animation\Channel - - 02.Element\02.Component\06.Model\LerpAnim - 02.Element\02.Component\02.VIBuffer\Cube diff --git a/Jusin154_Team3D/Engine/Private/Animation.cpp b/Jusin154_Team3D/Engine/Private/Animation.cpp index 3d5d0b145..448f27838 100644 --- a/Jusin154_Team3D/Engine/Private/Animation.cpp +++ b/Jusin154_Team3D/Engine/Private/Animation.cpp @@ -29,9 +29,7 @@ CAnimation::CAnimation(const CAnimation& rhs) , m_fTempTrack{rhs.m_fTempTrack } { memcpy_s(m_TickPerSeconds, sizeof(_float) * 2, rhs.m_TickPerSeconds, sizeof(_float) * 2); - - strcpy_s(m_szName, sizeof(m_szName), rhs.m_szName); - + for (auto& pChannel : m_Channels) { SAFE_ADDREF(pChannel); } @@ -359,7 +357,6 @@ void CAnimation::CreateGPUData(ID3D11Device* pDevice) HRESULT CAnimation::Initialize(const vector& Bones, const aiAnimation* pAIAnimation) { m_strName = pAIAnimation->mName.data; - strcpy_s(m_szName, pAIAnimation->mName.data); size_t pos = m_strName.find_last_of('|'); if (0 > pos) { pos = 0; @@ -368,6 +365,7 @@ HRESULT CAnimation::Initialize(const vector& Bones, const aiAnimation* p pos++; } m_strName = m_strName.substr(pos); + m_strName.shrink_to_fit(); m_fDuration = (_float)pAIAnimation->mDuration; m_TickPerSeconds[0] = (_float)pAIAnimation->mTicksPerSecond; @@ -406,8 +404,8 @@ CAnimation* CAnimation::Create(const vector& Bones, const aiAnimation* p HRESULT CAnimation::Initialize(const vector& Bones, const CModel* pModel, SaveAnimation* pSaveAnimation) { m_pSaveAnim = pSaveAnimation; - - strcpy_s(m_szName, pSaveAnimation->AnimName.c_str()); + m_strName = pSaveAnimation->AnimName; + m_strName.shrink_to_fit(); m_fDuration = pSaveAnimation->mDuration; m_fTickPerSecond = pSaveAnimation->mTicksPerSecond; diff --git a/Jusin154_Team3D/Engine/Private/Bone.cpp b/Jusin154_Team3D/Engine/Private/Bone.cpp index adf046879..82c8dc769 100644 --- a/Jusin154_Team3D/Engine/Private/Bone.cpp +++ b/Jusin154_Team3D/Engine/Private/Bone.cpp @@ -8,7 +8,7 @@ CBone::CBone() CBone::CBone(const CBone& other): CBase() { - memcpy_s(m_szName, sizeof(_char) * MAX_PATH, other.m_szName, sizeof(_char) * MAX_PATH); + m_strName = other.m_strName; m_TransformationMatrix = other.m_TransformationMatrix; m_CombinedTransformationMatrix = other.m_CombinedTransformationMatrix; m_iParentBoneIndex = other.m_iParentBoneIndex; @@ -55,11 +55,10 @@ _float3 CBone::Get_LocalPosition() #ifdef EDITOR_PROJECT HRESULT CBone::SaveAsBinary(HANDLE hFile, DWORD& dwByte) { - string strName = m_szName; - strName.shrink_to_fit(); - DWORD iLength = (DWORD)strName.length(); + m_strName.shrink_to_fit(); + DWORD iLength = (DWORD)m_strName.length(); WriteFile(hFile, &iLength, sizeof(_uint), &dwByte, nullptr); - WriteFile(hFile, strName.data(), iLength, &dwByte, nullptr); + WriteFile(hFile, m_strName.data(), iLength, &dwByte, nullptr); WriteFile(hFile, &m_iParentBoneIndex, sizeof(_int), &dwByte, nullptr); WriteFile(hFile, &m_TransformationMatrix, sizeof(_float4x4), &dwByte, nullptr); WriteFile(hFile, &m_matInitial, sizeof(_float4x4), &dwByte, nullptr); @@ -82,8 +81,8 @@ CBone* CBone::Create(const aiNode* pAINode, _int iParentIndex) HRESULT CBone::Initialize(const aiNode* pAINode, _int iParentIndex) { - strcpy_s(m_szName, pAINode->mName.data); - + m_strName = pAINode->mName.data; + m_strName.shrink_to_fit(); m_iParentBoneIndex = iParentIndex; memcpy(&m_TransformationMatrix, &pAINode->mTransformation, sizeof(_float4x4)); @@ -114,7 +113,8 @@ HRESULT CBone::Initialize(HANDLE hFile, DWORD& dwByte) if (!ReadFile(hFile, &iLength, sizeof(_uint), &dwByte, nullptr)) { return E_FAIL; } - if (!ReadFile(hFile, m_szName, iLength, &dwByte, nullptr)) { + m_strName.resize(iLength); + if (!ReadFile(hFile, m_strName.data(), iLength, &dwByte, nullptr)) { return E_FAIL; } if (!ReadFile(hFile, &m_iParentBoneIndex, sizeof(_int), &dwByte, nullptr)) { @@ -134,8 +134,7 @@ HRESULT CBone::Initialize(HANDLE hFile, DWORD& dwByte) HRESULT CBone::Initialize(const SaveNode& _SaveNode, _int iParentIndex) { - strcpy_s(m_szName, _SaveNode.NodeName.c_str()); - + m_strName = _SaveNode.NodeName; m_iParentBoneIndex = iParentIndex; memcpy(&m_TransformationMatrix, &_SaveNode.Transformation, sizeof(_float4x4)); diff --git a/Jusin154_Team3D/Engine/Private/Channel.cpp b/Jusin154_Team3D/Engine/Private/Channel.cpp index ae51e39d4..bd03bf7e4 100644 --- a/Jusin154_Team3D/Engine/Private/Channel.cpp +++ b/Jusin154_Team3D/Engine/Private/Channel.cpp @@ -11,9 +11,9 @@ CChannel::CChannel() #ifdef EDITOR_PROJECT HRESULT CChannel::Initialize(const vector& Bones, const aiNodeAnim* pAIChannel) { - strcpy_s(m_szName, pAIChannel->mNodeName.data); - - m_iBoneIndex = CModel::Get_BoneIndex(m_szName, Bones); + m_strName = pAIChannel->mNodeName.data; + m_strName.shrink_to_fit(); + m_iBoneIndex = CModel::Get_BoneIndex(m_strName.c_str(), Bones); if (-1 == m_iBoneIndex) { return E_FAIL; } @@ -102,8 +102,8 @@ CHANNEL_DESC CChannel::Fill_GPU_ChannelDesc() HRESULT CChannel::Initialize(const vector& Bones, _uint iIndex) { m_iBoneIndex = iIndex; - memcpy_s(m_szName, sizeof(_char) * MAX_PATH, Bones[iIndex]->Get_Name(), sizeof(_char) * MAX_PATH); - + m_strName = Bones[iIndex]->Get_Name(); + m_strName.shrink_to_fit(); m_iNumKeyFrames = 2; m_KeyFrames.resize(m_iNumKeyFrames); @@ -191,9 +191,9 @@ void CChannel::Set_Frame(_uint iIndex, KEYFRAME& kf) HRESULT CChannel::Initialize(const CModel* pModel, SaveChannel* pSaveChannel) { - strcpy_s(m_szName, pSaveChannel->ChannelName.c_str()); - - m_iBoneIndex = pModel->Get_BoneIndex(m_szName); + m_strName = pSaveChannel->ChannelName; + m_strName.shrink_to_fit(); + m_iBoneIndex = pModel->Get_BoneIndex(m_strName.c_str()); m_PreTransformMatrix = pModel->Get_PreTransformMatrix(); m_iNumKeyFrames = max(pSaveChannel->ScalingKeyCount, pSaveChannel->RotationKeyCount); diff --git a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp index 9578595d8..ca42b0b3f 100644 --- a/Jusin154_Team3D/Engine/Private/Character_Controller.cpp +++ b/Jusin154_Team3D/Engine/Private/Character_Controller.cpp @@ -212,18 +212,21 @@ _bool CCharacter_Controller::UpdateGroundByCast(_float fTimeDelta) case PXOBJECT::FLOOR: case PXOBJECT::ROAD: { // 임계값 이상이면 지면에 서서히 붙임 - _float fYHitPos = hit.position.y; - _float fYFoot = (_float)m_pController->getFootPosition().y; - _float fDiff = (fYHitPos - fYFoot); - if (fDiff > m_vAccHeight.w) { - _vector vMomentum = m_pTransform->Get_CurrentMomentum(); - _float fYCurrentMomentum = XMVectorGetY(vMomentum); - fYCurrentMomentum = fDiff * 0.3f; - m_pTransform->Set_CurrentMomentum(XMVectorSetY(vMomentum, fYCurrentMomentum)); - } - else { - m_iIsOnGround = iCoyote_Counter; - } + m_iIsOnGround = iCoyote_Counter; + + + //_float fYHitPos = hit.position.y; + //_float fYFoot = (_float)m_pController->getFootPosition().y; + //_float fDiff = (fYHitPos - fYFoot); + //if (fDiff > m_vAccHeight.w) { + // _vector vMomentum = m_pTransform->Get_CurrentMomentum(); + // _float fYCurrentMomentum = XMVectorGetY(vMomentum); + // fYCurrentMomentum = fDiff * 0.3f; + // m_pTransform->Set_CurrentMomentum(XMVectorSetY(vMomentum, fYCurrentMomentum)); + //} + //else { + // m_iIsOnGround = iCoyote_Counter; + //} } break; default: @@ -324,7 +327,7 @@ HRESULT CCharacter_Controller::Initialize(void* pArg) Desc.reportCallback = pDesc->pCallback_HitReport; Desc.behaviorCallback = pDesc->pCallback_Behavior; Desc.slopeLimit = cosf(XMConvertToRadians(m_fWalkableSlopeDegree)); - Desc.nonWalkableMode = PSX::PxControllerNonWalkableMode::ePREVENT_CLIMBING; + Desc.nonWalkableMode = PSX::PxControllerNonWalkableMode::ePREVENT_CLIMBING_AND_FORCE_SLIDING; Desc.material = m_pGameInstance->Create_Material(&pDesc->fMaterial); m_pController = m_pGameInstance->Add_BoxController(Desc); m_pController->setUserData(&m_tagData); @@ -340,7 +343,7 @@ HRESULT CCharacter_Controller::Initialize(void* pArg) Desc.reportCallback = pDesc->pCallback_HitReport; Desc.behaviorCallback = pDesc->pCallback_Behavior; Desc.slopeLimit = cosf(XMConvertToRadians(m_fWalkableSlopeDegree)); - Desc.nonWalkableMode = PSX::PxControllerNonWalkableMode::ePREVENT_CLIMBING; + Desc.nonWalkableMode = PSX::PxControllerNonWalkableMode::ePREVENT_CLIMBING_AND_FORCE_SLIDING; Desc.material = m_pGameInstance->Create_Material(&pDesc->fMaterial); m_pController = m_pGameInstance->Add_CapsuleController(Desc); m_pController->setUserData(&m_tagData); diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index bd2847d80..1f8595953 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -49,7 +49,7 @@ HRESULT CGameInstance::Initialize_Engine(const ENGINE_DESC& EngineDesc, ID3D11De } } } - m_pThreadHolder = CThreadHolder::Create(4); + m_pThreadHolder = CThreadHolder::Create( 6 ); if (nullptr == m_pThreadHolder) { return E_FAIL; } @@ -647,15 +647,19 @@ void CGameInstance::Add_ModelToMap(const _char* filePath, CModel* pModel) void CGameInstance::Add_SaveModel(const _char* filePath, SaveModel sModel) { + lock_guard lock(m_mtxLoadModelLock); m_sModelMap[filePath] = sModel; } SaveModel* CGameInstance::Load_SaveModel(const _char* filePath) { - m_mtxLoadModelLock.lock(); - auto iter = m_sModelMap.find(filePath); - m_mtxLoadModelLock.unlock(); - return &iter->second; + lock_guard lock(m_mtxLoadModelLock); + map::iterator iter = m_sModelMap.find(filePath); + if (iter == m_sModelMap.end()) { + return nullptr; + } + SaveModel* pOut = &iter->second; + return pOut; } #pragma region PhysX_Manager @@ -727,16 +731,16 @@ HRESULT CGameInstance::SaveTriMeshes(const _char* pPath, vectorSaveTriMeshes(pPath, TriMeshes); } +void CGameInstance::Add_Editor_Plane(PhsXUserData& PlaneData) +{ + m_pPhysX_Manager->Add_Editor_Plane(PlaneData); +} #endif // EDITOR_PROJECT HRESULT CGameInstance::LoadTriMeshes(const _char* pPath, vector& TriMeshes) { return m_pPhysX_Manager->LoadTriMeshes(pPath, TriMeshes); } -void CGameInstance::Add_Editor_Plane(PhsXUserData& PlaneData) -{ - m_pPhysX_Manager->Add_Editor_Plane(PlaneData); -} #pragma endregion #pragma region FOG diff --git a/Jusin154_Team3D/Engine/Private/GameObject_Manager.cpp b/Jusin154_Team3D/Engine/Private/GameObject_Manager.cpp index d60fc12ce..3483b03e8 100644 --- a/Jusin154_Team3D/Engine/Private/GameObject_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/GameObject_Manager.cpp @@ -40,7 +40,9 @@ HRESULT CGameObject_Manager::Add_GameObject_ToLayer(_uint iLayerLevelIndex, cons void CGameObject_Manager::Priority_Update(_float fTimeDelta) { #ifdef _DEBUG +#ifndef gimch Describe_Entity(); +#endif // !gimch m_pGameInstance->Compute_TimeDelta(TEXT("Timer_PriorityUpdate")); #endif // _DEBUG for (size_t i = 0; i < m_iNumLevels; i++) diff --git a/Jusin154_Team3D/Engine/Private/LerpAnim.cpp b/Jusin154_Team3D/Engine/Private/LerpAnim.cpp deleted file mode 100644 index 1bbfe912f..000000000 --- a/Jusin154_Team3D/Engine/Private/LerpAnim.cpp +++ /dev/null @@ -1,94 +0,0 @@ -#include "pch.h" -#include "LerpAnim.h" -#include "Channel.h" -#include "Bone.h" - -CLerpAnim::CLerpAnim() -{ -} - -_bool CLerpAnim::Update_TransformationMatrices(const vector& Bones, _float fTimeDelta) -{ - m_fCurrentTrackPosition += m_fTickPerSecond * fTimeDelta; - - if (m_fCurrentTrackPosition >= m_fDuration) { - m_fCurrentTrackPosition = m_fDuration; - m_bLerping = false; - return false; - } - - /*_uint iIndex = {}; - for (auto& pChannel : m_Channels) { - if (true == m_Movable[iIndex]) { - pChannel->Update_TransformationMatirx(Bones, m_fCurrentTrackPosition, &m_CurrentKeyFrameIndices[iIndex]); - } - iIndex++; - }*/ - return true; -} - -HRESULT CLerpAnim::Initialize(_uint iNumBone, _float fTickPerSecond, const vector& Bones) -{ - m_iNumChannels = iNumBone; - m_fTickPerSecond = fTickPerSecond; - m_CurrentKeyFrameIndices.resize(m_iNumChannels); - m_Movable.resize(m_iNumChannels); - m_InitialFrames.resize(m_iNumChannels); - m_Channels.reserve(m_iNumChannels); - - return S_OK; -} -void CLerpAnim::Begin(const vector& Bones, vector& StartFrames, vector& EndFrames, _float fDuration, _uint iRootBoneIndex) -{ - { // 초기화 - - //KEYFRAME kf = { // 항등행렬의 키프레임 - // { 1.f, 1.f, 1.f }, - // { 0.f, 0.f, 0.f, 1.f }, - // { 0.f, 0.f, 0.f}, - // m_fDuration }; - m_bLerping = true; - m_fDuration = fDuration; - m_fCurrentTrackPosition = 0.f; - for (_uint i = 0; i < m_iNumChannels; ++i) { - m_Channels[i]->Set_Frame(1, m_InitialFrames[i]); // 끝프레임을 초기 값으로 채우기 - } - fill(m_CurrentKeyFrameIndices.begin(), m_CurrentKeyFrameIndices.end(), 0); - fill(m_Movable.begin(), m_Movable.end(), false); - } - { // 실제 값 채우기 - for (LERPDESC& Desc : EndFrames) // 끝프레임을 실제 값으로 채우기 - { - _int iIndex = Desc.iSlot; - Desc.tagKeyFrame.fTrackPosition = m_fDuration; - m_Channels[iIndex]->Set_Frame(1, Desc.tagKeyFrame); - } - for (_uint i = 0; i < StartFrames.size(); ++i) { // 시작 프레임을 현재 본 상태 키프레임으로 채우기 - _int iIndex = StartFrames[i].iSlot; - m_Movable[iIndex] = true; - m_Channels[iIndex]->Set_Frame(0, StartFrames[i].tagKeyFrame); - } - //m_Movable[iRootBoneIndex] = false; - } -} -CLerpAnim* CLerpAnim::Create(_uint iNumBone, _float fTickPerSecond, const vector& Bones) -{ - CLerpAnim* pInstance = new CLerpAnim; - if (FAILED(pInstance->Initialize(iNumBone, fTickPerSecond, Bones))) { - SAFE_RELEASE(pInstance); - } - return pInstance; -} - -void CLerpAnim::Free() -{ - __super::Free(); - - for (auto& pChannel : m_Channels) { - SAFE_RELEASE(pChannel); - } - m_Channels.clear(); - - m_CurrentKeyFrameIndices.clear(); -} -; diff --git a/Jusin154_Team3D/Engine/Private/Mesh.cpp b/Jusin154_Team3D/Engine/Private/Mesh.cpp index 06af3d192..588856d07 100644 --- a/Jusin154_Team3D/Engine/Private/Mesh.cpp +++ b/Jusin154_Team3D/Engine/Private/Mesh.cpp @@ -57,7 +57,8 @@ HRESULT CMesh::Render_Indexed(_uint IndexCount, _uint StartIndexLocation, _uint #ifdef EDITOR_PROJECT HRESULT CMesh::Initialize_Prototype(MODEL eType, vector& Bones, const aiMesh* pAIMesh, _fmatrix& PreTransformMatrix) { - strcpy_s(m_szName, pAIMesh->mName.data); + m_strName = pAIMesh->mName.data; + m_strName.shrink_to_fit(); m_iMaterialIndex = pAIMesh->mMaterialIndex; m_iNumVertexBuffers = 1; @@ -151,7 +152,8 @@ HRESULT CMesh::Render_Instance(_uint iNumInstance) HRESULT CMesh::Initialize_Prototype(MODEL eType, const CModel* pModel, SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix) { - strcpy_s(m_szName, _SaveMesh->MeshName.c_str()); + m_strName = _SaveMesh->MeshName; + m_strName.shrink_to_fit(); m_iMaterialIndex = _SaveMesh->MaterialIndex; m_iNumVertexBuffers = 1; @@ -317,7 +319,7 @@ HRESULT CMesh::Ready_VertexBuffer_For_Anim(const CModel* pModel, SaveMesh* _Save for (_uint i = 0; i < m_iNumBones; i++) { SaveBone _SaveBone = _SaveMesh->Bones[i]; - strcpy_s(m_szName, _SaveBone.BoneName.c_str()); + m_strName = _SaveBone.BoneName; memcpy(&OffsetMatrix, &_SaveBone.OffsetMatrix, sizeof(_float4x4)); @@ -361,7 +363,7 @@ HRESULT CMesh::Ready_VertexBuffer_For_Anim(const CModel* pModel, SaveMesh* _Save { m_iNumBones = 1; - m_BoneIndices.push_back(pModel->Get_BoneIndex(m_szName)); + m_BoneIndices.push_back(pModel->Get_BoneIndex(m_strName.c_str())); m_offsetMatrices.push_back(OffsetMatrix); } @@ -554,7 +556,7 @@ HRESULT CMesh::Ready_VertexBuffer_For_Anim(vector& Bones, const ai } if (0 == m_iNumBones) { m_iNumBones = 1; - m_BoneIndices.push_back(CModel::Get_BoneIndex(m_szName, Bones)); + m_BoneIndices.push_back(CModel::Get_BoneIndex(m_strName.c_str(), Bones)); m_offsetMatrices.push_back(OffSetMatrix); } diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index b4e850371..25525d45a 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -4,7 +4,6 @@ #include "Mesh.h" #include "Material.h" #include "Animation.h" -#include "LerpAnim.h" #include "GameObject.h" #include "Transform.h" #include "ComputeShader.h" @@ -24,7 +23,6 @@ CModel::CModel(const CModel& rhs) m_Materials(rhs.m_Materials), m_iNumMaterials(rhs.m_iNumMaterials), m_iNumAnimations(rhs.m_iNumAnimations), - m_pLerpAnim(rhs.m_pLerpAnim), m_fRadius(rhs.m_fRadius), m_vRadiusOffset(rhs.m_vRadiusOffset) { @@ -525,7 +523,7 @@ void CModel::Set_CurrentTrackPosition(_float TrackPosition) const _char* CModel::Get_AnimList(_uint iIndex) { - return m_Animations[iIndex]->Get_SZName(); + return m_Animations[iIndex]->Get_Name().c_str(); } _float CModel::Get_CurrentTrackPosition() @@ -882,7 +880,7 @@ _bool CModel::SaveAssimpModel(const _char* filename) for (size_t i = 0; i < m_Materials.size(); i++) { - modelData.Materials.push_back(m_Materials[i]->Get_SaveMaterial()); + modelData.Materials.emplace_back(m_Materials[i]->Get_SaveMaterial()); } std::vector allNodes; @@ -1372,6 +1370,9 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _ } m_pSaveModel = m_pGameInstance->Load_SaveModel(pModelFilePath); + if (nullptr == m_pSaveModel) { + return S_OK; + } LoadAdditionalAnimations(pModelFilePath); @@ -1390,6 +1391,11 @@ HRESULT CModel::Initialize_Prototype(MODEL eType, const _char* pModelFilePath, _ if (FAILED(Ready_Animations(m_Bones))) { return E_FAIL; } +//#ifdef 기무리 +// if (MODEL::ENVIROMENT == eType) { +// Save_PhysXTriMeshes(pModelFilePath); +// } +//#endif // _DEBUG return S_OK; } @@ -1562,13 +1568,13 @@ _bool CModel::LoadData(const _char* filename) NewModel.Materials.clear(); for (_uint i = 0; i < NewModel.MaterialCount; i++) { - SaveMaterial mat; + SaveMaterial pMAt; for (_uint k = 0; k < AI_TEXTURE_TYPE_MAX; k++) { _uint MaterialCount = 0; fread(&MaterialCount, sizeof(_uint), 1, fp); - mat.Path[k].resize(MaterialCount); + pMAt.Path[k].resize(MaterialCount); for (_uint j = 0; j < MaterialCount; j++) { _uint len = 0; @@ -1576,11 +1582,11 @@ _bool CModel::LoadData(const _char* filename) std::string temp; temp.resize(len); fread(&temp[0], sizeof(_char), len, fp); - mat.Path[k][j] = temp; + pMAt.Path[k][j] = temp; } } - NewModel.Materials.push_back(mat); + NewModel.Materials.push_back(pMAt); } if (MODEL::ENVIROMENT == m_eType) @@ -1838,6 +1844,7 @@ void CModel::Free() SAFE_RELEASE(m_pConstantBuffer); SAFE_RELEASE(m_pParentBuffer); SAFE_RELEASE(m_pLocalPosBuffer); + for (auto& pAnimation : m_Animations) { SAFE_RELEASE(pAnimation); } @@ -1857,7 +1864,6 @@ void CModel::Free() m_Bones.clear(); SAFE_RELEASE(m_pTransform); - SAFE_RELEASE(m_pLerpAnim); m_SaveModel.clear(); @@ -1888,7 +1894,7 @@ void CModel::Describe_Entity() for (_uint i = 0; i < m_iNumAnimations; ++i) { name.clear(); - name.append(m_Animations[i]->Get_SZName()); + name.append(m_Animations[i]->Get_Name().c_str()); size_t pos = name.find_last_of('|'); if (0 > pos) { pos = 0; } diff --git a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp index c0a2df655..15d68b1f5 100644 --- a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp @@ -477,18 +477,26 @@ HRESULT CPhysX_Manager::Initialize() assert(false); return E_FAIL; } +#ifdef _DEBUG if (FAILED(Connect_DebugServer())) { //ASSERT_NURI(false); //ASSERT_JINWOO(false); } +#endif // _DEBUG + { // 씬 세팅 m_ToleranceScale.length = 1.f; // 1 meter m_ToleranceScale.speed = GRAVITY; // - +#ifdef _DEBUG m_pPhysics = PxCreatePhysics(PX_PHYSICS_VERSION, *m_pFoundation, m_ToleranceScale, true, m_pPvd); +#endif // _DEBUG +#ifndef _DEBUG +m_pPhysics = PxCreatePhysics(PX_PHYSICS_VERSION, *m_pFoundation, m_ToleranceScale, true); +#endif // _DEBUG + m_pCookingParam = new PSX::PxCookingParams(m_pPhysics->getTolerancesScale()); m_pCookingParam->meshPreprocessParams |= PSX::PxMeshPreprocessingFlag::eWELD_VERTICES; @@ -565,6 +573,7 @@ HRESULT CPhysX_Manager::Initialize() return S_OK; } +#ifdef _DEBUG HRESULT CPhysX_Manager::Connect_DebugServer() { @@ -587,6 +596,8 @@ HRESULT CPhysX_Manager::Connect_DebugServer() return S_OK; } +#endif // _DEBUG + CPhysX_Manager* CPhysX_Manager::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CPhysX_Manager* pInstance = new CPhysX_Manager(pDevice, pContext); @@ -640,12 +651,15 @@ void CPhysX_Manager::Free() if (nullptr != m_pPhysics) { m_pPhysics->release(); m_pPhysics = nullptr; } +#ifdef _DEBUG if (nullptr != m_pPvd) { m_pPvd->disconnect(); m_pPvd->release(); m_pPvd = nullptr; } +#endif // _DEBUG + if (nullptr != m_pTransport) { m_pTransport->release(); m_pTransport = nullptr; } diff --git a/Jusin154_Team3D/Engine/Private/RigidBody_Static.cpp b/Jusin154_Team3D/Engine/Private/RigidBody_Static.cpp index 9f450afb4..0e88a2aed 100644 --- a/Jusin154_Team3D/Engine/Private/RigidBody_Static.cpp +++ b/Jusin154_Team3D/Engine/Private/RigidBody_Static.cpp @@ -9,7 +9,7 @@ CRigidBody_Static::CRigidBody_Static(ID3D11Device* pDevice, ID3D11DeviceContext* CRigidBody_Static::CRigidBody_Static(const CRigidBody_Static& rhs) : CRigidBody(rhs), - m_pMeshName(rhs.m_pMeshName) + m_wstrMeshName(rhs.m_wstrMeshName) { } @@ -31,7 +31,7 @@ HRESULT CRigidBody_Static::Initialize(void* pArg) return E_FAIL; } RIGIDBODY_STATIC_DESC* pDesc = static_cast(pArg); - m_pMeshName = pDesc->pMeshName; + m_wstrMeshName = pDesc->pMeshName; m_tagData.pOwner = m_pOwner; XMStoreFloat4x4(&m_tagData.BeforeMatrix, m_pTransform->Get_XMWorldMatrix()); m_tagData.pBody = this; diff --git a/Jusin154_Team3D/Engine/Private/Trail.cpp b/Jusin154_Team3D/Engine/Private/Trail.cpp index fb8f83706..3a837fd0b 100644 --- a/Jusin154_Team3D/Engine/Private/Trail.cpp +++ b/Jusin154_Team3D/Engine/Private/Trail.cpp @@ -181,8 +181,10 @@ void CTrail::Trail_Update(_float fDeltaTime, _fmatrix WorldMatrix) } - +#ifdef _DEBUG Describe_Entity(); +#endif // _DEBUG + //XMStoreFloat3(&m_pVertices[0].vPosition, vLow); //XMStoreFloat3(&m_pVertices[1].vPosition, vHigh); diff --git a/Jusin154_Team3D/Engine/Private/UIObject.cpp b/Jusin154_Team3D/Engine/Private/UIObject.cpp index c3824772e..a7f122609 100644 --- a/Jusin154_Team3D/Engine/Private/UIObject.cpp +++ b/Jusin154_Team3D/Engine/Private/UIObject.cpp @@ -207,14 +207,20 @@ _bool CUIObject::Chack_Visible() void CUIObject::Set_FadeIn() { - m_bFadeIn = true; - m_bFadeOut = false; + if (!m_bFadeIn && m_fAlpha < 1.f) + { + m_bFadeIn = true; + m_bFadeOut = false; + } } void CUIObject::Set_FadeOut() { - m_bFadeIn = false; - m_bFadeOut = true; + if (!m_bFadeOut && m_fAlpha > 0.f) + { + m_bFadeOut = true; + m_bFadeIn = false; + } } _bool CUIObject::Get_FadeIn() @@ -449,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; @@ -467,6 +483,16 @@ void CUIObject::Function_Callback(wstring Name, void* pArg) { } +_bool CUIObject::Get_Hover() +{ + return m_bHover; +} + +const CUIObject::SPELLINFO CUIObject::Get_Info(_int Index) +{ + return SPELLINFO(); +} + void CUIObject::Free() { __super::Free(); diff --git a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp index 46981233b..57426e437 100644 --- a/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp +++ b/Jusin154_Team3D/Engine/Private/VIBuffer_UI_Instance.cpp @@ -274,6 +274,9 @@ _int CVIBuffer_UI_Instance::Set_Mouse_Hover(_float2 fMousePos) VTX_INSTANCE_UI* pVertices = static_cast(SubResource.pData); _int hoveredIndex = -1; + for (_uint i = 0; i < m_iNumInstance; i++) + pVertices[i].bHover = 0.f; + for (_uint i = 0; i < m_iNumInstance; i++) { _float2 pos = pVertices[i].fPos; @@ -289,21 +292,42 @@ _int CVIBuffer_UI_Instance::Set_Mouse_Hover(_float2 fMousePos) pt.x = LONG(fMousePos.x); pt.y = LONG(fMousePos.y); - if (PtInRect(&rcInstance, pt)) - { - pVertices[i].bHover = 1.f; - hoveredIndex = i; + if (PtInRect(&rcInstance, pt)) + { + pVertices[i].bHover = 1.f; + hoveredIndex = i; break; - } - else - { - pVertices[i].bHover = 0.f; + } + else + { + pVertices[i].bHover = 0.f; hoveredIndex = -1; - } - } + } + } - m_pContext->Unmap(m_pVBInstance, 0); - return hoveredIndex; + m_pContext->Unmap(m_pVBInstance, 0); + return hoveredIndex; +} + +void CVIBuffer_UI_Instance::Set_Hover_Index(_uint iIndex) +{ + D3D11_MAPPED_SUBRESOURCE SubResource{}; + + m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_NO_OVERWRITE, 0, &SubResource); + + VTX_INSTANCE_UI* pVertices = static_cast(SubResource.pData); + + for (_uint i = 0; i < m_iNumInstance; ++i) + { + if (i == iIndex) + { + pVertices[i].bHover = 1.f; + } + else + pVertices[i].bHover = 0.f; + } + + m_pContext->Unmap(m_pVBInstance, 0); } CVIBuffer_UI_Instance* CVIBuffer_UI_Instance::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const INSTANCE_DESC* pInstanceDesc) diff --git a/Jusin154_Team3D/Engine/Public/Animation.h b/Jusin154_Team3D/Engine/Public/Animation.h index 578312b07..11b20fbfc 100644 --- a/Jusin154_Team3D/Engine/Public/Animation.h +++ b/Jusin154_Team3D/Engine/Public/Animation.h @@ -31,7 +31,6 @@ class ENGINE_DLL CAnimation : public CBase vector Get_StartFrameInformations() { return m_StartKeyFrames; } const _string& Get_Name() const { return m_strName; } - const _char* Get_SZName() const { return m_szName; } void Set_CurrentTrackPosition(_float TrackPosition) { m_fCurrentTrackPosition = TrackPosition; } _float Get_CurrentTrackPosition() { return m_fCurrentTrackPosition; } _float Get_CurrentTrackProgressRatio() { return m_fTempTrack / m_fDurationSeconds;} @@ -68,14 +67,13 @@ class ENGINE_DLL CAnimation : public CBase private: SaveAnimation* m_pSaveAnim = { nullptr }; - _char m_szName[MAX_PATH] = {}; _float m_fTickPerSecond = {}; _float m_fAnimSpeed = {1.f}; - _bool m_bPause = { FALSE }; // 애님퍼즈 인덱스 _string m_strName = {}; // 애님 이름 _float m_fCurrentTrackPosition = {}; // 현재 트랙 위치 _float m_fDuration = {}; // 트랙의 전체 길이 + _bool m_bPause = { FALSE }; // 애님퍼즈 인덱스 _float m_TickPerSeconds[2] = { 0.f, 0.f }; // 초당 트랙 이동 거리 _uint m_iNumChannels = {}; // 영향을 받는 본의 수 _float m_fTempTrack = {}; diff --git a/Jusin154_Team3D/Engine/Public/Bone.h b/Jusin154_Team3D/Engine/Public/Bone.h index 19ebd46c1..300bc6680 100644 --- a/Jusin154_Team3D/Engine/Public/Bone.h +++ b/Jusin154_Team3D/Engine/Public/Bone.h @@ -21,21 +21,21 @@ class ENGINE_DLL CBone final : public CBase return XMStoreFloat4x4(&m_CombinedTransformationMatrix, newMatrix); } _bool Compare_Name(const _char* pBoneName) const { - return !strcmp(pBoneName, m_szName); + return !strcmp(pBoneName, m_strName.c_str()); } void Get_KeyFrame(KEYFRAME& kf, _bool bIsCurrentFrame); // 현재 본의 로컬매트릭스를 캡쳐해서 키프레임으로 성분 분해하여 올려보낸다. - const _char* Get_Name() const { return m_szName; } + const _char* Get_Name() const { return m_strName.c_str(); } _float3 Get_LocalPosition(); void Update_CombinedTransformationMatrix(const vector& Bones, _fmatrix PreTransformMatrix); void Set_TransformationMatrix(_fmatrix TransformationMatrix); // 애니메이션에서 현재 로컬 매트릭스를 변경할 때 사용된다 _float4x4 Get_TransformationMatrix() { return m_TransformationMatrix; } _int Get_ParentBoneIndex() { return m_iParentBoneIndex; } private: - _char m_szName[MAX_PATH] = {}; // 본의 이름 + _string m_strName = {}; _float4x4 m_TransformationMatrix = {}; // 본의 현재 로컬 매트릭스 _float4x4 m_CombinedTransformationMatrix = {}; // 본의 루트노드로부터 상대적인 복합매트릭스 ( 부모노드는 PreTranformMatrix와 월드좌표로부터 상대적임 ) - _int m_iParentBoneIndex = { -1 }; // 부모본의 인덱스 ( 모델에 있는 본벡터의 인덱스 ) ( 부모는 인덱스 -1 고정 ) _float4x4 m_matInitial = {}; + _int m_iParentBoneIndex = { -1 }; // 부모본의 인덱스 ( 모델에 있는 본벡터의 인덱스 ) ( 부모는 인덱스 -1 고정 ) private: HRESULT Initialize(HANDLE hFile, DWORD& dwByte); // 바이너리 diff --git a/Jusin154_Team3D/Engine/Public/Channel.h b/Jusin154_Team3D/Engine/Public/Channel.h index bcd6ca857..2a670bbe2 100644 --- a/Jusin154_Team3D/Engine/Public/Channel.h +++ b/Jusin154_Team3D/Engine/Public/Channel.h @@ -32,9 +32,9 @@ class ENGINE_DLL CChannel : public CBase KEYFRAME* Get_Frame(_uint iIndex); void Set_Frame(_uint iIndex, KEYFRAME& kf); _bool Compare_Name(const _char* pChannelname) const { - return !strcmp(pChannelname, m_szName); + return !strcmp(pChannelname, m_strName.c_str()); } - _char* Get_Name() { return m_szName; } + const _char* Get_Name() { return m_strName.c_str(); } private: // 바이너리 HRESULT Initialize(const class CModel* pModel, SaveChannel* pSaveChannel); @@ -51,23 +51,21 @@ class ENGINE_DLL CChannel : public CBase private: - _char m_szName[MAX_PATH] = {}; // 영향을 받을 본의 이름 + _string m_strName = {}; _int m_iBoneIndex = { -1 }; // 본 벡터에서 본의 인덱스 _uint m_iNumKeyFrames = {}; // Animation의 m_fDuration동안 이 본이 취해야할 키프레임의 갯수 _float4x4 m_PreTransformMatrix = {}; vector m_KeyFrames; // 키프레임 벡터 _float3 m_vPrevRootPos = { 0.f, 0.f, 0.f }; - _float4 m_vPrevRootRot = { 0.f, 0.f, 0.f,0.f }; - _matrix m_BoneTransformationMatrix = {}; - _bool m_bInitialRootPos = { false }; - _bool m_bInitialRootRotSaved = {false}; - _float4 m_vInitialRootRot = {}; - - _bool m_IsUpper = false; _int m_ilayerIndex = 0; + _float4 m_vPrevRootRot = { 0.f, 0.f, 0.f,0.f }; + _float4 m_vInitialRootRot = {}; + _matrix m_BoneTransformationMatrix = {}; LOCALPOS_DESC LocalPos = {}; - vector m_KeyFrameDesc; + _bool m_bInitialRootPos = { false }; + _bool m_bInitialRootRotSaved = { false }; + _bool m_IsUpper = false; public: // 바이너리 static CChannel* Create(const class CModel* pModel, SaveChannel* pSaveChannel); diff --git a/Jusin154_Team3D/Engine/Public/LerpAnim.h b/Jusin154_Team3D/Engine/Public/LerpAnim.h deleted file mode 100644 index d7a0459f9..000000000 --- a/Jusin154_Team3D/Engine/Public/LerpAnim.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once - -#include "Base.h" - -NS_BEGIN(Engine) - -class ENGINE_DLL CLerpAnim : public CBase -{ -private: - CLerpAnim(); - virtual ~CLerpAnim() = default; -public: - _bool IsLerping() { return m_bLerping; } - _bool Update_TransformationMatrices(const vector& Bones, _float fTimeDelta); - HRESULT Initialize(_uint iNumBone, _float fTickPerSecond, const vector& Bones); - void Begin(const vector& Bones, vector& StartFrames, vector& EndFrames, _float fDuration, _uint iRootBoneIndex); - -private: - _float m_fCurrentTrackPosition = {}; // ÇöÀç Ʈ·¢ À§ġ - _float m_fTickPerSecond = {}; // Ãʴç Ʈ·¢ À̵¿ °Ÿ® - _uint m_iNumChannels = {}; // ¿µÇâÀ» ¹޴ º»ÀÇ ¼ö - - vector m_Channels; // ÀÌ ¾ִϸÞÀ̼ÇÀÌ ¿µÇâÀ» ÁØ »çÀü °è»êµÈ º»ÀÇ ¹迭 - vector m_InitialFrames; // Ãʱâ ÇÁ·¹ÀÓ - vector<_uint> m_CurrentKeyFrameIndices; // °¢ º»ÀÌ ÇöÀç ¾ִϸÞÀ̼ǿ¡¼­ ÃëÇؾßÇÒ ŰÇÁ·¹ÀÓ ¿ÞÂÊ À妽º - vector<_bool> m_Movable; // °¢ º»ÀÌ ·²ÇÁ µµÁß ¾÷µ¥ÀÌƮ¸¦ ¹޾ƾßÇÒÁö ¸»¾ƾßÇÒÁö ½ºÀ§ġ - _bool m_bLerping = { false }; // ·²ÇÁ ȮÀÎ ºοï - _float m_fDuration = { 0.25f }; // ·²ÇÁ Áֱâ - -public: - static CLerpAnim* Create(_uint iNumBone, _float fTickPerSecond, const vector& Bones); - virtual void Free() override; - -}; - -NS_END \ No newline at end of file diff --git a/Jusin154_Team3D/Engine/Public/Mesh.h b/Jusin154_Team3D/Engine/Public/Mesh.h index f0ed2e36b..29084f904 100644 --- a/Jusin154_Team3D/Engine/Public/Mesh.h +++ b/Jusin154_Team3D/Engine/Public/Mesh.h @@ -16,7 +16,7 @@ class ENGINE_DLL CMesh final : public CVIBuffer return m_iMaterialIndex; } - const _char* Get_Name() const { return m_szName; } + const _char* Get_Name() const { return m_strName.c_str(); } HRESULT Bind_BoneMatrices(const vector& Bones, class CShader* pShader, const _char* pConstantName); HRESULT Bind_BoneMatrices(_float4x4* pCombinedMatrices, class CShader* pShader, const _char* pConstantName); HRESULT Render_Indexed(_uint IndexCount, _uint StartIndexLocation, _uint BaseVertexLocation); @@ -44,11 +44,8 @@ class ENGINE_DLL CMesh final : public CVIBuffer HRESULT Ready_VertexBuffer_For_NonAnim(SaveMesh* _SaveMesh, _fmatrix PreTransformMatrix); HRESULT Ready_VertexBuffer_For_Anim(const class CModel* pModel, SaveMesh* _SaveMesh); - - - // private: - _char m_szName[MAX_PATH] = {}; + _string m_strName = { }; _uint m_iMaterialIndex = {}; _uint m_iNumBones = { }; _uint m_iStartIndex = {}; diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index dee87a4af..b583cd25d 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -102,22 +102,16 @@ class ENGINE_DLL CModel final : public CComponent #endif // EDITOR_PROJECT -private: -#ifdef EDITOR_PROJECT - const aiScene* m_pAIScene = { nullptr }; - Assimp::Importer m_Importer; -#endif - private: MODEL m_eType = {}; // 모델의 타입 + _float4x4 m_PreTransformMatrix = {}; // 사전에 루트본에 곱해줄 매트릭스 - - _uint m_iNumMeshes = {}; // 메쉬의 갯수 vector m_Meshes; // 메쉬의 벡터 - _uint m_iNumPhysXMeshes = {}; // 피직스 메쉬의 갯수 vector m_TriMeshes = {}; // 피직스 메쉬의 갯수 - + _uint m_iNumPhysXMeshes = {}; // 피직스 메쉬의 갯수 + _uint m_iNumMeshes = {}; // 메쉬의 갯수 _uint m_iNumMaterials = {}; // 머테리얼의 갯수 + _float m_fAmount = { 1.f }; vector m_Materials; // 머테리얼의 벡터 vector m_Bones; // 본의 벡터, 정렬순서는 루트본부터 트리의 마지막 노드까지 @@ -128,33 +122,27 @@ class ENGINE_DLL CModel final : public CComponent _bool m_bIsFinishedAnim = { false }; // 대상 애니메이션이 끝났는지 _bool m_bIsFinishedLerp = { false }; // 럴프 애니메이션이 끝났는지 _bool m_bPlayAnim = { true }; - _float m_fAmount = { 1.f }; _int m_iPreAnimIndex = { -1 }; _float m_fBlendTime = { 0.f }; _float m_fBlendDuration = { 0.3f }; - _float m_fRadius = { 0.f }; // 컬링용 Radius _float3 m_vRadiusOffset = {}; // 컬링용 Radius Offset + _float m_fSecondBlendTime = {}; + _float m_fSecondBlendDuration = { 0.3f }; + _float m_fSecondRatio = {}; vector m_Animations; // 애니메이션의 벡터, - class CLerpAnim* m_pLerpAnim = { nullptr }; // 럴프전용 애니메이션 - - _int m_iRootBoneIndex = { -1 }; // 루트본의 인덱스 _matrix m_PrevAnimationMatrix = XMMatrixIdentity(); // 루트본의 이전 위치 _matrix m_DeltaAnimationMatrix = {}; // 루트본의 델타애니메이션 class CTransform* m_pTransform = { nullptr }; // 모델 대상의 트랜스폼 _float m_fRatio = {}; - _int m_iBoneIndex[ENUM_CLASS(BLEND_BONE::END)] = { -1,-1,-1,-1,-1,-1 }; _int m_iCurrSecondAnimIndex = { -1 }; - _bool m_bIsSecondFinishedAnim = { false }; - _bool m_bIsSecondLoop = { false }; + _int m_iBoneIndex[ENUM_CLASS(BLEND_BONE::END)] = { -1,-1,-1,-1,-1,-1 }; vector> m_BoneMask; - _float m_fSecondBlendTime = {}; - _float m_fSecondBlendDuration = {0.3f}; - _float m_fSecondRatio = {}; + // 바이너리 @@ -163,19 +151,29 @@ class ENGINE_DLL CModel final : public CComponent // vector<_float4x4> m_BoneMatrix; - _bool m_bRatio = { false }; _float3 m_vPrevRootPos = { 0.f, 0.f, 0.f }; _float4 m_vPrevRootRot = { 0.f, 0.f, 0.f,0.f }; _matrix m_BoneTransformationMatrix = {}; - _bool m_bInitialRootPos = { false }; - _bool m_bInitialRootRotSaved = { false }; _float4 m_vInitialRootRot = {}; + _float m_fRadius = { 0.f }; // 컬링용 Radius + _int m_iRootBoneIndex = { -1 }; // 루트본의 인덱스 _vector m_vector[3]; - _bool m_bLoopRestarted = false; vector<_uint> m_iBoneMask; + _bool m_bInitialRootPos = { false }; + _bool m_bInitialRootRotSaved = { false }; + _bool m_bLoopRestarted = false; + _bool m_bIsSecondFinishedAnim = { false }; + _bool m_bIsSecondLoop = { false }; + _bool m_bRatio = { false }; + +private: +#ifdef EDITOR_PROJECT + const aiScene* m_pAIScene = { nullptr }; + Assimp::Importer m_Importer; +#endif #pragma region Compute @@ -226,7 +224,8 @@ class ENGINE_DLL CModel final : public CComponent // virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr); -virtual void Free(); public: + virtual void Free(); +public: #ifdef _DEBUG void Describe_Entity() override; #endif // _DEBUG diff --git a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h index 43c4f40dd..6bb0c6de8 100644 --- a/Jusin154_Team3D/Engine/Public/PhysX_Manager.h +++ b/Jusin154_Team3D/Engine/Public/PhysX_Manager.h @@ -14,7 +14,6 @@ class CPhysX_Manager final : public CBase private: CPhysX_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual ~CPhysX_Manager() = default; - #pragma region RIGID_BODY public: @@ -102,7 +101,10 @@ class CPhysX_Manager final : public CBase _uint m_iNumLevel = {}; private: HRESULT Initialize(); +#ifdef _DEBUG HRESULT Connect_DebugServer(); +#endif // _DEBUG + void Update_Kinematic(); void Update_Dynamic_ActiveActors(); //void Update_Dynamic_AllActors(); diff --git a/Jusin154_Team3D/Engine/Public/RigidBody_Static.h b/Jusin154_Team3D/Engine/Public/RigidBody_Static.h index 1d7794439..7fa36eb73 100644 --- a/Jusin154_Team3D/Engine/Public/RigidBody_Static.h +++ b/Jusin154_Team3D/Engine/Public/RigidBody_Static.h @@ -26,11 +26,11 @@ class ENGINE_DLL CRigidBody_Static : public CRigidBody public: PSX::PxRigidStatic* Get_Actor() override { return m_pRigidBody; } - const _tchar* Get_PxMeshKey() const { return m_pMeshName; } + const _tchar* Get_PxMeshKey() const { return m_wstrMeshName.c_str(); } private: PSX::PxRigidStatic* m_pRigidBody = { nullptr }; // 실제 시뮬레이션을 도는 본체 - const _tchar* m_pMeshName = { nullptr }; // 짝꿍 스태틱 메시의 triangleMesh 키 + _wstring m_wstrMeshName = { }; // 짝꿍 스태틱 메시의 triangleMesh 키 private: HRESULT Initialize_Prototype(RIGIDBODY_STATIC_PROTOTYPEDESC& Desc); diff --git a/Jusin154_Team3D/Engine/Public/UIObject.h b/Jusin154_Team3D/Engine/Public/UIObject.h index 1564d510c..4c73bf661 100644 --- a/Jusin154_Team3D/Engine/Public/UIObject.h +++ b/Jusin154_Team3D/Engine/Public/UIObject.h @@ -17,6 +17,25 @@ typedef struct tagUIObjectDesc _float fSizeX, fSizeY = {}; }UIOBJECT_DESC; +typedef struct tagSpellInfo +{ + _int iSpell_ID{}; + _wstring pSpell_Name; + _wstring pImage_Name; + _int iSpell_Type{}; + _int iSkill_Type{}; + _float fSpell_CoolTime{}; + _float fDuration{}; + _int iAnimNum{}; + _wstring pSpellInfo; + _bool bSpell_Lock = false; + _bool bEquip_Spell = false; +}SPELLINFO; +typedef struct SlotHover +{ + _int iSlotID{}; + _int iHover_Index{}; +}HOVER_INFO; protected: CUIObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CUIObject(const CUIObject& rhs); @@ -102,12 +121,18 @@ typedef struct tagUIObjectDesc 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(); virtual void Add_Function(wstring Name, function Evnet); virtual void Function_Callback(wstring Name, void* pArg = nullptr); + + virtual _bool Get_Hover(); + + virtual const SPELLINFO Get_Info(_int Index); protected: _vector m_fOrigin_Position_vector{}; _float2 m_fOrigin_Position{}; @@ -152,6 +177,7 @@ typedef struct tagUIObjectDesc RECT m_pRect{}; _int m_iSpellType{}; + _int m_iSkillType{}; _float m_fSortZ{}; _float m_fMoveSpeed{}; diff --git a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h index 75278c14b..c20a19ae6 100644 --- a/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h +++ b/Jusin154_Team3D/Engine/Public/VIBuffer_UI_Instance.h @@ -34,6 +34,7 @@ class ENGINE_DLL CVIBuffer_UI_Instance final : public CVIBuffer_Instance void Set_ImageUV(UI_ATLAS_DESC* AtlasUV); void Set_Index_Renge_Color(_uint StartIndex, _uint EndIndex, _float4 vColor); _int Set_Mouse_Hover(_float2 fMousePos); + void Set_Hover_Index(_uint iIndex); private: VTX_INSTANCE_UI* m_pInstanceVertices = { nullptr };