From a88be9c111a9d5b2bfb73cb6542d89206f31b4b1 Mon Sep 17 00:00:00 2001 From: kimnuri Date: Sun, 7 Dec 2025 11:10:53 +0900 Subject: [PATCH 1/6] [add] Resource manager sharedmtrx --- .../Engine/Private/Resource_Manager.cpp | 117 +++++++++--------- Jusin154_Team3D/Engine/Private/Texture.cpp | 3 +- .../Private/VIBuffer_Model_Instance.cpp | 3 +- .../Engine/Public/Resource_Manager.h | 5 +- Jusin154_Team3D/Engine/Public/pch.h | 1 + 5 files changed, 67 insertions(+), 62 deletions(-) diff --git a/Jusin154_Team3D/Engine/Private/Resource_Manager.cpp b/Jusin154_Team3D/Engine/Private/Resource_Manager.cpp index 29a6760f8..0a8f5f160 100644 --- a/Jusin154_Team3D/Engine/Private/Resource_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Resource_Manager.cpp @@ -4,27 +4,55 @@ CResource_Manager::CResource_Manager(ID3D11Device* pDevice) :m_pDevice{ pDevice } { - SAFE_ADDREF(pDevice); + SAFE_ADDREF(m_pDevice); } ID3D11ShaderResourceView* CResource_Manager::Add_Texture(const _char* pFilePath) { - lock_guard lock(m_mtxTexture); + if (pFilePath == nullptr || pFilePath[0] == '\0'){ + return nullptr; + } + filesystem::path pathFile = pFilePath; + const _wstring wstrKeyOriginal = pathFile.filename().wstring(); + + { // 브레이스 해제 금지 + shared_lock sharedLock(m_smtxTexture); - ID3D11ShaderResourceView* pSRV = Find_SRV(pFilePath); - - if (nullptr == pSRV) - { - pSRV = Load_SRV(pFilePath); - - if (nullptr == pSRV) + auto iter = m_Resources.find(wstrKeyOriginal); + if (iter != m_Resources.end()) { - return nullptr; + SAFE_ADDREF(iter->second); + return iter->second; } + // sharedLock 소멸 + } // 브레이스 해제 금지 + + ID3D11ShaderResourceView* pSRV = Load_SRV(pathFile); + + if (pSRV == nullptr){ + return nullptr; } - SAFE_ADDREF(pSRV); + { // 브레이스 해제 금지 + unique_lock uniqueLock(m_smtxTexture); + auto iter = m_Resources.find(wstrKeyOriginal); + if (iter != m_Resources.end()) + { + SAFE_RELEASE(pSRV); // 여기까지 왔는데 end가 아니다? -> 다른 스레드가 넣음 -> 이 srv는 이미 로드됨. -> 삭제해야 됨 + + SAFE_ADDREF(iter->second); + return iter->second; // sharedLock 소멸 + } + + m_Resources.emplace(wstrKeyOriginal, pSRV); + // sharedLock 소멸 + } // 브레이스 해제 금지 + +#ifdef _DEBUG + ++m_iCount; +#endif // _DEBUG + SAFE_ADDREF(pSRV); return pSRV; } @@ -35,62 +63,37 @@ HRESULT CResource_Manager::Initialize(_uint iResourceCount) return S_OK; } -ID3D11ShaderResourceView* CResource_Manager::Find_SRV(const _char* pFilePath) -{ - _char szFileName[MAX_PATH] = {}; - _splitpath_s(pFilePath, nullptr, 0, nullptr, 0, szFileName, MAX_PATH, nullptr, 0); - - auto iter = m_Resources.find(CMyTools::ToWstring(szFileName)); - - if (iter == m_Resources.end()) - return nullptr; - - return iter->second; -} - -ID3D11ShaderResourceView* CResource_Manager::Load_SRV(const _char* pFilePath) +ID3D11ShaderResourceView* CResource_Manager::Load_SRV(const filesystem::path& pathFile) { ID3D11ShaderResourceView* pSRV = nullptr; - _char szTextureFileName[MAX_PATH] = {}; - _char szTextureFilePath[MAX_PATH] = {}; - _char szDrive[MAX_PATH] = {}; - _char szDir[MAX_PATH] = {}; - _char szFileName[MAX_PATH] = {}; - _char szEXT[MAX_PATH] = {}; - _splitpath_s(pFilePath, szDrive, MAX_PATH, szDir, MAX_PATH, szFileName, MAX_PATH, szEXT, MAX_PATH); - strcpy_s(szTextureFileName, szDrive); - strcat_s(szTextureFileName, szDir); - strcat_s(szTextureFileName, szFileName); + const filesystem::path pathExtensionOriginal = pathFile.extension(); - strcat_s(szTextureFilePath, szTextureFileName); - strcat_s(szTextureFilePath, ".dds"); + filesystem::path pathDDSFile = pathFile; + pathDDSFile.replace_extension(L".dds"); - HRESULT hr = {}; + HRESULT hr = CreateDDSTextureFromFile( + m_pDevice, + pathDDSFile.wstring().c_str(), + nullptr, + &pSRV + ); - hr = CreateDDSTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, &pSRV); // 일단 dds로 시도하고 if (FAILED(hr)) { - memset(szTextureFilePath, 0, sizeof(_char) * MAX_PATH); // 실패하면 원래 확장자로 다시 시도 - strcat_s(szTextureFilePath, szTextureFileName); - strcat_s(szTextureFilePath, szEXT); + filesystem::path pathFileOriginal = pathFile; + pathFileOriginal.replace_extension(pathExtensionOriginal); - if (false == strcmp(".tga", szEXT)) { - assert(false); // trying to Load TGA - hr = S_OK; - } - else { - hr = CreateWICTextureFromFile(m_pDevice, CMyTools::ToWstring(szTextureFilePath).c_str(), nullptr, &pSRV); + hr = CreateWICTextureFromFile( + m_pDevice, + pathFileOriginal.wstring().c_str(), + nullptr, + &pSRV + ); + + if (FAILED(hr)){ + return nullptr; } } - - if (E_FAIL == hr) - return nullptr; - - m_Resources.emplace(CMyTools::ToWstring(szFileName), pSRV); -#ifdef _DEBUG - ++m_iCount; -#endif // _DEBUG - return pSRV; } diff --git a/Jusin154_Team3D/Engine/Private/Texture.cpp b/Jusin154_Team3D/Engine/Private/Texture.cpp index 611e7278c..d30efd096 100644 --- a/Jusin154_Team3D/Engine/Private/Texture.cpp +++ b/Jusin154_Team3D/Engine/Private/Texture.cpp @@ -97,8 +97,9 @@ HRESULT CTexture::Load_SRV(const _char* szPath, ID3D11ShaderResourceView** ppSRV { ID3D11ShaderResourceView* pSRV = m_pGameInstance->Add_Resource(szPath); - if (nullptr == pSRV) + if (nullptr == pSRV){ return E_FAIL; + } *ppSRV = pSRV; diff --git a/Jusin154_Team3D/Engine/Private/VIBuffer_Model_Instance.cpp b/Jusin154_Team3D/Engine/Private/VIBuffer_Model_Instance.cpp index d267d8180..21575c4a5 100644 --- a/Jusin154_Team3D/Engine/Private/VIBuffer_Model_Instance.cpp +++ b/Jusin154_Team3D/Engine/Private/VIBuffer_Model_Instance.cpp @@ -272,8 +272,9 @@ HRESULT CVIBuffer_Model_Instance::Ready_Materials() pSRV = m_pGameInstance->Add_Resource(m_MeshMaterialPathes[i][j].c_str()); - if (nullptr == pSRV) + if (nullptr == pSRV){ return E_FAIL; + } SRVs.push_back(pSRV); } diff --git a/Jusin154_Team3D/Engine/Public/Resource_Manager.h b/Jusin154_Team3D/Engine/Public/Resource_Manager.h index 3b27f4892..837f81915 100644 --- a/Jusin154_Team3D/Engine/Public/Resource_Manager.h +++ b/Jusin154_Team3D/Engine/Public/Resource_Manager.h @@ -9,15 +9,14 @@ class CResource_Manager final : public CBase private: CResource_Manager(ID3D11Device* pDevice); virtual ~CResource_Manager() = default; - mutex m_mtxTexture = {}; + shared_mutex m_smtxTexture = {}; public: ID3D11ShaderResourceView* Add_Texture(const _char* pFilePath); private: HRESULT Initialize(_uint iResourceCount); - ID3D11ShaderResourceView* Find_SRV(const _char* pFilePath); - ID3D11ShaderResourceView* Load_SRV(const _char* pFilePath); + ID3D11ShaderResourceView* Load_SRV(const filesystem::path& pathFile); private: #ifdef _DEBUG diff --git a/Jusin154_Team3D/Engine/Public/pch.h b/Jusin154_Team3D/Engine/Public/pch.h index c27ab5229..c226fdfe9 100644 --- a/Jusin154_Team3D/Engine/Public/pch.h +++ b/Jusin154_Team3D/Engine/Public/pch.h @@ -58,6 +58,7 @@ using namespace DirectX; #include #include #include +#include using namespace std; From cf8ea71f85fbbbf4de61f919717a3d161c717ccb Mon Sep 17 00:00:00 2001 From: kimnuri Date: Sun, 7 Dec 2025 11:47:49 +0900 Subject: [PATCH 2/6] [fix] mesh PhysX --- Jusin154_Team3D/Client/Private/EffectPool.cpp | 6 - .../Client/Private/Level_GamePlay.cpp | 149 ++--- Jusin154_Team3D/Client/Private/Loader.cpp | 606 +++++++++--------- Jusin154_Team3D/Engine/Private/Mesh.cpp | 12 +- Jusin154_Team3D/Engine/Public/VIBuffer.h | 4 +- 5 files changed, 389 insertions(+), 388 deletions(-) diff --git a/Jusin154_Team3D/Client/Private/EffectPool.cpp b/Jusin154_Team3D/Client/Private/EffectPool.cpp index 7dcecb132..b0de40811 100644 --- a/Jusin154_Team3D/Client/Private/EffectPool.cpp +++ b/Jusin154_Team3D/Client/Private/EffectPool.cpp @@ -122,7 +122,6 @@ HRESULT CEffectPool::Bind_ShaderResources() HRESULT CEffectPool::Ready_Effect() { -#ifndef 기무리 if(FAILED(Create_Effect(SKILL_TYPE::JAP, 10, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { CNomalJap* pEffect = nullptr; @@ -168,7 +167,6 @@ HRESULT CEffectPool::Ready_Effect() return pEffect; } ))) return E_FAIL; - if (FAILED(Create_Effect(SKILL_TYPE::JAP_SIDE, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel)-> CEffect_Container* { CNomalJapSide* pEffect = nullptr; @@ -226,10 +224,6 @@ HRESULT CEffectPool::Ready_Effect() return pEffect; } ))) return E_FAIL; -#endif // 기무리 - - - return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 25818fe76..3f53240c7 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -161,96 +161,97 @@ HRESULT CLevel_GamePlay::Ready_Background() /* Map Containters */ /* 테스트용 맵 */ - //CInfoInstance::GetInstance()->Load_MapObjects("ClientTest"); + CInfoInstance::GetInstance()->Load_MapObjects("ClientTest"); /* 전체 맵 */ - //CInfoInstance::GetInstance()->Load_MapObjects("Hogsmeade_MapContainer_Data"); + { + CInfoInstance::GetInstance()->Load_MapObjects("Hogsmeade_MapContainer_Data"); - ///* 조명 오브젝트 */ - //CInfoInstance::GetInstance()->Load_LightElements("LightElement"); + /* 조명 오브젝트 */ + CInfoInstance::GetInstance()->Load_LightElements("LightElement"); - ///* 상호작용 오브젝트 */ - //CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_Barrel"); - //CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_PostPackage_B"); - //CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_PostPackage_F"); - //CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_TeaShopTable"); - //CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_TeaShopChair"); + /* 상호작용 오브젝트 */ + CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_Barrel"); + CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_PostPackage_B"); + CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_PostPackage_F"); + CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_TeaShopTable"); + CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_TeaShopChair"); - //CInstancedProp::INSTANCE_PROP_DESC Desc = {}; + CInstancedProp::INSTANCE_PROP_DESC Desc = {}; - ///* 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))){ - // return E_FAIL; - //} + /* 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))) { + 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))){ - // 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))) { + return E_FAIL; + } - ///* SM_HM_OwlPost_Window_A */ - //Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_OwlPost_Window_A"; - //Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OwlPost_Window.bin"; - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - // return E_FAIL; + /* SM_HM_OwlPost_Window_A */ + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_OwlPost_Window_A"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OwlPost_Window.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; - /////* WA_Rectangle_Double_A */ - //Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Rectangle_Double_A"; - //Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Rectangle_Double_A.bin"; - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - // return E_FAIL; + ///* WA_Rectangle_Double_A */ + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Rectangle_Double_A"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Rectangle_Double_A.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; - /////* WC_Retangle_Double_A */ - //Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Retangle_Double_A"; - //Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Retangle_Double_A.bin"; - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - // return E_FAIL; + ///* WC_Retangle_Double_A */ + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Retangle_Double_A"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Retangle_Double_A.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; - /////* WA_Square_Double_C */ - //Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Square_Double_C"; - //Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WA_Square_Double_C.bin"; - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - // return E_FAIL; + ///* WA_Square_Double_C */ + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Square_Double_C"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WA_Square_Double_C.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; - ///* Quid_Window_A */ - //Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Quid_Window_A"; - //Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Quid_Window_A.bin"; - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - // return E_FAIL; + /* Quid_Window_A */ + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Quid_Window_A"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Quid_Window_A.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; - ///* Ollivanders_Box_Window */ - //Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Ollivanders_Box_Window"; - //Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Ollivanders_Box.bin"; - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - // return E_FAIL; + /* Ollivanders_Box_Window */ + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Ollivanders_Box_Window"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Ollivanders_Box.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; - ///* WC_L_DoubleS_A */ - //Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_L_DoubleS_A"; - //Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_L_DoubleS_A.bin"; - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - // return E_FAIL; + /* WC_L_DoubleS_A */ + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_L_DoubleS_A"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_L_DoubleS_A.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; - ///* WC_Round_Double_A */ - //Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Round_Double_A"; - //Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Round_Double_A.bin"; - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - // return E_FAIL; + /* WC_Round_Double_A */ + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Round_Double_A"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Round_Double_A.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; - ///* SM_HM_Door1a */ - //Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door1a"; - //Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door1a.bin"; - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - // return E_FAIL; - - ///* SM_HM_Door1a */ - //Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door2b"; - //Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door2b.bin"; - //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - // return E_FAIL; + /* SM_HM_Door1a */ + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door1a"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door1a.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; + /* SM_HM_Door1a */ + Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door2b"; + Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door2b.bin"; + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 18659a9e4..d33c56c75 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -235,288 +235,288 @@ HRESULT CLoader::Loading_For_GamePlay() #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 -// )); -// } -// {/* Doors */ -// jobMapModels.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Doors", -// ".bin", false -// )); -// } -// {/* Step and Stair */ -// jobMapModels.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/GroundSurfaces", -// ".bin", false -// )); -// jobMapModels.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/GroundSurfaces", -// ".bin", false -// )); -// } -// {/* Barrel */ -// jobMapModels.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Objects/Meshes", -// ".bin", false -// )); -// /* Box */ -// jobMapModels.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/MiscProps", -// ".bin", false -// )); -// /* TeaShop Table */ -// jobMapModels.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Tables", -// ".bin", false -// )); -// /* TeaShop Chair*/ -// jobMapModels.emplace_back(Deferred_FolderLoad( -// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Chairs", -// ".bin", false -// )); -// } -// } -// -//#pragma endregion + { + { /* 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 + )); + } + {/* Doors */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Doors", + ".bin", false + )); + } + {/* Step and Stair */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/GroundSurfaces", + ".bin", false + )); + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/GroundSurfaces", + ".bin", false + )); + } + {/* Barrel */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Objects/Meshes", + ".bin", false + )); + /* Box */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/MiscProps", + ".bin", false + )); + /* TeaShop Table */ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Tables", + ".bin", false + )); + /* TeaShop Chair*/ + jobMapModels.emplace_back(Deferred_FolderLoad( + "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Chairs", + ".bin", false + )); + } + } + +#pragma endregion #pragma region UI @@ -1766,28 +1766,28 @@ HRESULT CLoader::Loading_For_GamePlay() #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; - // } + { // 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); - // } - //} + 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("정보를 불러오는 중입니다."); diff --git a/Jusin154_Team3D/Engine/Private/Mesh.cpp b/Jusin154_Team3D/Engine/Private/Mesh.cpp index 83233ea77..03fa9df24 100644 --- a/Jusin154_Team3D/Engine/Private/Mesh.cpp +++ b/Jusin154_Team3D/Engine/Private/Mesh.cpp @@ -185,7 +185,7 @@ HRESULT CMesh::Initialize_Prototype(MODEL eType, const CModel* pModel, SaveMesh* m_Vertices.clear(); m_Vertices.reserve(_SaveMesh->Vertices.size()); - XMMATRIX matPre = PreTransformMatrix; + _matrix matPre = PreTransformMatrix; for (size_t i = 0; i < _SaveMesh->Vertices.size(); ++i) { @@ -210,6 +210,11 @@ HRESULT CMesh::Initialize_Prototype(MODEL eType, const CModel* pModel, SaveMesh* hr = Ready_VertexBuffer_For_Anim(pModel, _SaveMesh); break; case Engine::MODEL::ENVIROMENT: + m_pVertexPositions = new _float3[m_iNumVertices]; + for (size_t i = 0; i < m_iNumVertices; ++i) + { + memcpy_s(m_pVertexPositions, sizeof(_float3) * m_iNumVertices, m_Vertices.data(), sizeof(_float3) * m_iNumVertices); + } break; default: break; @@ -266,6 +271,7 @@ HRESULT CMesh::Ready_VertexBuffer_For_NonAnim(SaveMesh* SaveMesh, _fmatrix PreTr for (_uint i = 0; i < m_iNumVertices; ++i) { memcpy(&pVertices[i].vPosition, &SaveMesh->Vertices[i].Pos, sizeof(_float3)); + memcpy(&m_pVertexPositions[i], &SaveMesh->Vertices[i].Pos, sizeof(_float3)); XMStoreFloat3(&pVertices[i].vPosition, XMVector3TransformCoord(XMLoadFloat3(&pVertices[i].vPosition), PreTransformMatrix)); @@ -426,9 +432,9 @@ PSX::PxTriangleMesh* CMesh::ConvertToPxMesh(const PSX::PxCookingParams* pParam, tMeshDesc.points.stride = sizeof(PSX::PxVec3); Vertices.resize(m_iNumVertices); XMVector3TransformCoordStream( - reinterpret_cast(Vertices.data()), // dest + reinterpret_cast<_float3*>(Vertices.data()), // dest sizeof(PSX::PxVec3), - reinterpret_cast(m_pVertexPositions), // src + reinterpret_cast(m_pVertexPositions), // src sizeof(PSX::PxVec3), m_iNumVertices, WorldMatrix diff --git a/Jusin154_Team3D/Engine/Public/VIBuffer.h b/Jusin154_Team3D/Engine/Public/VIBuffer.h index bef2f6308..dd273ce00 100644 --- a/Jusin154_Team3D/Engine/Public/VIBuffer.h +++ b/Jusin154_Team3D/Engine/Public/VIBuffer.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Component.h" NS_BEGIN(Engine) @@ -33,4 +33,4 @@ public CComponent virtual void Free(); }; -NS_END \ No newline at end of file +NS_END From 0581b41b6b51482222c873662943c0a118937d5d Mon Sep 17 00:00:00 2001 From: kimnuri Date: Sun, 7 Dec 2025 17:15:44 +0900 Subject: [PATCH 3/6] [add] StatSystem --- .../Client/Default/Client.vcxproj.filters | 37 +++-- .../Private/CallBack_Monster_HitReport.cpp | 8 +- Jusin154_Team3D/Client/Private/Goblin.cpp | 12 +- .../Client/Private/InfoInstance.cpp | 4 +- Jusin154_Team3D/Client/Private/Loader.cpp | 33 +++++ Jusin154_Team3D/Client/Private/Monster.cpp | 10 ++ Jusin154_Team3D/Client/Private/NomalJap.cpp | 33 +++-- Jusin154_Team3D/Client/Private/Player.cpp | 13 +- Jusin154_Team3D/Client/Private/Troll.cpp | 3 + Jusin154_Team3D/Client/Public/Loader.h | 2 + Jusin154_Team3D/Client/Public/Monster.h | 2 + Jusin154_Team3D/Client/Public/NomalJap.h | 3 +- Jusin154_Team3D/Client/Public/Player.h | 1 + .../Editor/Bin/Resources/Data/Stat/Stat.xml | 5 + .../Resources/ShaderFiles/Shader_VtxMesh.hlsl | 20 +-- Jusin154_Team3D/Engine/Default/Engine.vcxproj | 4 + .../Engine/Default/Engine.vcxproj.filters | 18 +++ .../Engine/Private/Prototype_Manager.cpp | 1 - Jusin154_Team3D/Engine/Private/Stat.cpp | 128 +++++++++++++++++ Jusin154_Team3D/Engine/Private/StatEvent.cpp | 130 ++++++++++++++++++ Jusin154_Team3D/Engine/Public/Engine_Enum.h | 2 + .../Engine/Public/Prototype_Manager.h | 2 + Jusin154_Team3D/Engine/Public/Stat.h | 41 ++++++ Jusin154_Team3D/Engine/Public/StatEvent.h | 45 ++++++ Jusin154_Team3D/Engine/Public/Unit.h | 2 +- 25 files changed, 502 insertions(+), 57 deletions(-) create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/Stat.xml create mode 100644 Jusin154_Team3D/Engine/Private/Stat.cpp create mode 100644 Jusin154_Team3D/Engine/Private/StatEvent.cpp create mode 100644 Jusin154_Team3D/Engine/Public/Stat.h create mode 100644 Jusin154_Team3D/Engine/Public/StatEvent.h diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index b2460592f..4ac556ce1 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -158,10 +158,10 @@ 02.GameObjects\Cameras\Camera_Gaze - 02.GameObjects\Monster\Goblin + 02.GameObjects\NPC\Hostile\Monster\Goblin - 02.GameObjects\Monster + 02.GameObjects\NPC\Hostile\Monster 02.GameObjects\Environment\00.MapContainer @@ -269,7 +269,7 @@ 02.GameObjects\Effect\Effects\Lumos - 02.GameObjects\Monster\Troll + 02.GameObjects\NPC\Hostile\Monster\Troll 02.GameObjects\Item\Troll_Weapon @@ -467,9 +467,6 @@ {603938cc-e4fe-44d8-890b-784174a86161} - - {b72a9bb0-1b21-416b-bd0c-ba943cd7cc9d} - {2814c935-13d9-4b9a-94ba-c9e470219a18} @@ -611,12 +608,6 @@ {b719d948-fce3-4144-9d2c-edcab4cfceaf} - - {d371e373-e343-4e0b-9a0c-34eae167c1cd} - - - {1ff3d6f1-f31d-47b7-84b7-d23efe98d7d2} - {e2d84a8f-46c9-4689-bd91-cc45343d2b10} @@ -704,9 +695,6 @@ {71f6a568-488d-4ec1-be79-8fcce6677e27} - - {a1b1f17d-ed4f-4b20-aa8e-c52e693683d4} - {1d6c078d-dddd-493d-a6f0-f2cac2e4107e} @@ -821,6 +809,15 @@ {7e641382-9dfa-4da7-a8c8-a3ee06360e7a} + + {d371e373-e343-4e0b-9a0c-34eae167c1cd} + + + {1ff3d6f1-f31d-47b7-84b7-d23efe98d7d2} + + + {a1b1f17d-ed4f-4b20-aa8e-c52e693683d4} + @@ -968,13 +965,13 @@ 02.GameObjects\Cameras\Camera_Gaze - 02.GameObjects\Monster\Goblin + 02.GameObjects\NPC\Hostile\Monster\Goblin - 02.GameObjects\Monster\Goblin + 02.GameObjects\NPC\Hostile\Monster\Goblin - 02.GameObjects\Monster + 02.GameObjects\NPC\Hostile\Monster 02.GameObjects\Environment\00.MapContainer\BuildingContainer @@ -1085,10 +1082,10 @@ 02.GameObjects\Environment\03.MapElement\Light - 02.GameObjects\Monster\Troll + 02.GameObjects\NPC\Hostile\Monster\Troll - 02.GameObjects\Monster\Troll + 02.GameObjects\NPC\Hostile\Monster\Troll 02.GameObjects\Item\Troll_Weapon diff --git a/Jusin154_Team3D/Client/Private/CallBack_Monster_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_Monster_HitReport.cpp index 9cc701393..01f1a3bfa 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Monster_HitReport.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Monster_HitReport.cpp @@ -111,10 +111,10 @@ void CCallBack_Monster_HitReport::onControllerHit(const PSX::PxControllersHit& h void CCallBack_Monster_HitReport::onObstacleHit(const PSX::PxControllerObstacleHit& hit) { PSX::PxController* pController = hit.controller; - PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점 - PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말 - PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향 - _float fLength = hit.length; // 시도한 move 길이 + PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점 + PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말 + PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향 + _float fLength = hit.length; // 시도한 move 길이 const void* pOtherController = hit.userData; // 장애물 diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index a940e626d..7dd96b02f 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -185,6 +185,9 @@ _vector CGoblin::Get_LockOnPos() void CGoblin::OnCollision(CGameObject* pOther, void* pDesc) { + if (true == m_bDead) { + return; + } ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); _vector vWorldPos = {}; // 접촉지점 _vector vWorldNomal = {}; // 접촉노말 @@ -207,6 +210,9 @@ void CGoblin::OnCollision(CGameObject* pOther, void* pDesc) break; case ENUM_CLASS(SKILL_TYPE::JAP): m_eHitSpell = STATEANIM::HIT_LEVIOSO; + if (true == Get_Damage(60.f)) { + return; + } break; case ENUM_CLASS(SKILL_TYPE::LEVIOSO): m_eHitSpell = STATEANIM::HIT_LEVIOSO; @@ -215,8 +221,9 @@ void CGoblin::OnCollision(CGameObject* pOther, void* pDesc) m_eHitSpell = STATEANIM::KNOCKDOWN_FWD; break; } - if (!m_pFSM->IsEnable(FSMSTATE::BLINK)) + if (!m_pFSM->IsEnable(FSMSTATE::BLINK)){ m_pFSM->Change_State(FSMSTATE::HIT); + } } @@ -272,6 +279,9 @@ HRESULT CGoblin::Ready_Components() m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor()); } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("STAT_GOBLIN"), (CComponent**)&m_pStat))) { + return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp index a9f9795b2..2a6aef94f 100644 --- a/Jusin154_Team3D/Client/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -47,7 +47,7 @@ HRESULT CInfoInstance::Regist_PlayerAlly(CUnit* pUnit) HRESULT CInfoInstance::Deregist_PlayerAlly(CUnit* pUnit) { - if (nullptr == m_pMonsterInfo) { + if (nullptr == s_pInstance) { return S_OK; // 게임 종료 된 상태 } return m_pMonsterInfo->Deregist_PlayerAlly(pUnit); @@ -60,7 +60,7 @@ HRESULT CInfoInstance::Regist_ActiveMonster(CMonster* pUnit) HRESULT CInfoInstance::Deregist_ActiveMonster(CMonster* pUnit) { - if (nullptr == m_pMonsterInfo) { + if (nullptr == s_pInstance) { return S_OK; // 게임 종료 된 상태 } return m_pMonsterInfo->Deregist_ActiveMonster(pUnit); diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index d33c56c75..f6053f188 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -1704,6 +1704,11 @@ HRESULT CLoader::Loading_For_GamePlay() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CTroll::Create(m_pDevice, m_pContext)))) return E_FAIL; +#pragma endregion +#pragma region STAT PROTOTYPE + if (FAILED(Stat_FileLoad("../Bin/Resources/Data/Stat/Stat.xml"))) { + return E_FAIL; + } #pragma endregion @@ -1866,6 +1871,34 @@ HRESULT CLoader::Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreN return S_OK; } +HRESULT CLoader::Stat_FileLoad(const _char* pDirectoryPath) +{ + filesystem::path pathStatFile = pDirectoryPath; + + tinyxml2::XMLDocument doc; + tinyxml2::XMLError Error = doc.LoadFile(pathStatFile.string().c_str()); + if (Error != tinyxml2::XML_SUCCESS) { + return E_FAIL; + } + + tinyxml2::XMLElement* pStatInfo = doc.FirstChildElement("StatInfo"); + if (!pStatInfo) { + return E_FAIL; + } + + _uint iNumChild = pStatInfo->ChildElementCount(); + tinyxml2::XMLNode* pChild = pStatInfo->FirstChildElement(); + for (_uint i = 0; i < iNumChild; ++i) { + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(pChild->Value()), + CStat::Create(m_pDevice, m_pContext, pChild)))) { + return E_FAIL; + } + pChild = pChild->NextSiblingElement(); + } + + return S_OK; +} + vector* APIENTRY Deferred_FolderLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag) { if (FAILED(CoInitializeEx(nullptr, 0))) { diff --git a/Jusin154_Team3D/Client/Private/Monster.cpp b/Jusin154_Team3D/Client/Private/Monster.cpp index 9df271243..3cf8a239f 100644 --- a/Jusin154_Team3D/Client/Private/Monster.cpp +++ b/Jusin154_Team3D/Client/Private/Monster.cpp @@ -119,6 +119,15 @@ void CMonster::Set_DrawOutLine() m_bDrawOutLine = true; } +_bool CMonster::Get_Damage(_float fDamage) +{ + _bool bDead = m_pStat->Get_Damage(fDamage); + if (true == bDead) { + m_bDead = true; + } + return m_bDead; +} + HRESULT CMonster::Ready_Components(void*pArg) { __super::Ready_Components(pArg); @@ -149,6 +158,7 @@ void CMonster::Free() { __super::Free(); + SAFE_RELEASE(m_pStat); SAFE_RELEASE(m_pTarget); if (nullptr != m_pInfoInstance){ CInfoInstance* pInfo = m_pInfoInstance; diff --git a/Jusin154_Team3D/Client/Private/NomalJap.cpp b/Jusin154_Team3D/Client/Private/NomalJap.cpp index 150f467bf..502405f12 100644 --- a/Jusin154_Team3D/Client/Private/NomalJap.cpp +++ b/Jusin154_Team3D/Client/Private/NomalJap.cpp @@ -119,14 +119,21 @@ void CNomalJap::Update(_float fTimeDelta) void CNomalJap::Late_Update(_float fTimeDelta) { - if (m_bVisible == false) { + if (false == m_bVisible) { return; } + if (false == m_bHit) { + SweepTarget(); + } + Get_PartObject()->Trail_Update(m_pProjectile->Get_Component()->Get_XMWorldMatrix(), fTimeDelta); + __super::Late_Update(fTimeDelta); +} + +void CNomalJap::SweepTarget() +{ _vector vStartPos = m_pProjectile->Get_WorldPostion(); - _vector vEndPos = XMLoadFloat4(&m_vTargetPos); - _vector vDir = { vEndPos - vStartPos }; _float fDistance = XMVectorGetX(XMVector3Length(vEndPos - vStartPos)); @@ -154,11 +161,13 @@ void CNomalJap::Late_Update(_float fTimeDelta) case PXOBJECT::GOBLIN_WARRIOR: { pUserData->pOwner->OnCollision(this); + m_bHit = true; } - break; + break; case PXOBJECT::TROLL: { pUserData->pOwner->OnCollision(this); + m_bHit = true; } break; } @@ -166,11 +175,6 @@ void CNomalJap::Late_Update(_float fTimeDelta) } } } - - Get_PartObject()->Trail_Update(m_pProjectile->Get_Component()->Get_XMWorldMatrix(), fTimeDelta); - - - __super::Late_Update(fTimeDelta); } HRESULT CNomalJap::Pre_Setting(CGameObject* pObject, void* pArg) @@ -186,7 +190,6 @@ HRESULT CNomalJap::Pre_Setting(CGameObject* pObject, void* pArg) XMStoreFloat4(&m_vStartPos, vStartPos); /* 초기 객체 위치 초기화 */ - m_pProjectile->Get_Component()->Set_State(STATE::POSITION, vStartPos); m_pProjectile_Side->Get_Component()->Set_State(STATE::POSITION, vStartPos); @@ -213,7 +216,7 @@ HRESULT CNomalJap::Pre_Setting(CGameObject* pObject, void* pArg) { /* 대상 위치 지정 */ - + m_bHit = false; CUnit* pTargetUnit = m_pInfoInstance->Get_LockOnUnit(); if (nullptr != pTargetUnit) { XMStoreFloat4(&m_vTargetPos, pTargetUnit->Get_LockOnPos()); @@ -222,8 +225,6 @@ HRESULT CNomalJap::Pre_Setting(CGameObject* pObject, void* pArg) XMStoreFloat4(&m_vTargetPos, vStartPos + vDirection * m_fLinearSpeed * 0.5f); } XMStoreFloat3(&m_vCameraLook, XMVector3Normalize(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); - - } else { // 타겟이 없다면 현재위치 -> 카메라 룩벡터 * duration간 예상 이동거리 를 대상으로 지정 @@ -314,11 +315,13 @@ void CNomalJap::OnCollision(CGameObject* pOther, void* pDesc) { int iIndex = CollisionCheck(); - if (iIndex < 0) + if (iIndex < 0){ return; + } - if (m_isCollisionEnter == true) + if (m_isCollisionEnter == true){ return; + } m_isCollisionEnter = true; diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 410c707c1..fe7256cc5 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -150,8 +150,13 @@ void CPlayer::Late_Update(_float fTimeDelta) __super::Late_Update(fTimeDelta); - if (nullptr != m_pLockOnMonster && false == m_pLockOnMonster->isDead()) { - static_cast(m_pLockOnMonster)->Set_DrawOutLine(); + if (nullptr != m_pLockOnMonster) { + if (false == m_pLockOnMonster->isDead()) { + static_cast(m_pLockOnMonster)->Set_DrawOutLine(); + } + else { + m_pLockOnMonster = nullptr; + } } } @@ -321,6 +326,10 @@ HRESULT CPlayer::Ready_Components() return E_FAIL; } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("STAT_PLAYER"), (CComponent**)&m_pStat))) { + return E_FAIL; + } + { // CCT CCharacter_Controller::Character_Controller_DESC Desc{}; diff --git a/Jusin154_Team3D/Client/Private/Troll.cpp b/Jusin154_Team3D/Client/Private/Troll.cpp index 688561087..fd6aa35af 100644 --- a/Jusin154_Team3D/Client/Private/Troll.cpp +++ b/Jusin154_Team3D/Client/Private/Troll.cpp @@ -275,6 +275,9 @@ HRESULT CTroll::Ready_Components() m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor()); } + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("STAT_TROLL"), (CComponent**)&m_pStat))) { + return E_FAIL; + } return S_OK; } diff --git a/Jusin154_Team3D/Client/Public/Loader.h b/Jusin154_Team3D/Client/Public/Loader.h index 86df14ee7..565eed6e8 100644 --- a/Jusin154_Team3D/Client/Public/Loader.h +++ b/Jusin154_Team3D/Client/Public/Loader.h @@ -40,8 +40,10 @@ class CLoader final : public CBase private: HRESULT Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreName, function AddPrototypeEvent); + HRESULT Stat_FileLoad(const _char* pDirectoryPath); 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); virtual void Free() override; diff --git a/Jusin154_Team3D/Client/Public/Monster.h b/Jusin154_Team3D/Client/Public/Monster.h index 0a73f3783..afe73145d 100644 --- a/Jusin154_Team3D/Client/Public/Monster.h +++ b/Jusin154_Team3D/Client/Public/Monster.h @@ -19,10 +19,12 @@ class CMonster abstract : public CUnit virtual HRESULT Render_OutLine() override; virtual void Set_DrawOutLine(); _float4 Get_TargetPos() { return m_vTargetPos; } + virtual _bool Get_Damage(_float fDamage); protected: CInfoInstance* m_pInfoInstance = { nullptr }; CUnit* m_pTarget = { nullptr }; + CStat* m_pStat = { nullptr }; _float4 m_vTargetPos = { }; _float3 m_vToTargetDir = { }; _float m_fTargetDistance = { FLT_MAX }; diff --git a/Jusin154_Team3D/Client/Public/NomalJap.h b/Jusin154_Team3D/Client/Public/NomalJap.h index 10ae59cb8..0dbdfa863 100644 --- a/Jusin154_Team3D/Client/Public/NomalJap.h +++ b/Jusin154_Team3D/Client/Public/NomalJap.h @@ -20,7 +20,6 @@ class CNomalJap final : public CEffect_Container virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; - public: virtual HRESULT Pre_Setting(CGameObject* pObject , void* pArg = nullptr) override; @@ -31,6 +30,7 @@ class CNomalJap final : public CEffect_Container HRESULT Ready_Child(); HRESULT Bind_ShaderResources() override; virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; + void SweepTarget(); private: class CInfoInstance* m_pInfoInstance = { nullptr }; _wstring m_wstrEffectName = {}; @@ -57,6 +57,7 @@ class CNomalJap final : public CEffect_Container _float m_fAngularSpeed = {}; _float m_fLinearSpeed = 35.f; _float m_fTimeRate = {}; + _bool m_bHit = { false }; /*좌우 무빙 관련 변수들*/ _float3 m_vRotateRight = {}; diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index a63fa36e4..8c7e76025 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -52,6 +52,7 @@ class CPlayer final : public CUnit class CModel* m_pBroomModel = { nullptr }; class CTransform* m_pBroomTransform = { nullptr }; class CBroom* m_pBroom = { nullptr }; + CStat* m_pStat = { nullptr }; private: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/Stat.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/Stat.xml new file mode 100644 index 000000000..7b45bee9a --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/Stat.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl index 3750acda3..580f7887a 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl @@ -234,16 +234,16 @@ PS_OUT PS_MAIN(PS_IN In) float4 vMtrlDiffuse = g_DiffuseTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); float4 vSurface = g_SurfaceParamsTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); - if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_TRANSMISSION], true)) - { - float4 vTransmission = g_TransmissionTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); - vMtrlDiffuse *= vTransmission; - } - if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_EMISSIVE], true)) - { - float4 vEmissive = g_EmissiveTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); - vMtrlDiffuse += vEmissive; - } + //if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_TRANSMISSION], true)) + //{ + // float4 vTransmission = g_TransmissionTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); + // vMtrlDiffuse *= vTransmission; + //} + //if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_EMISSIVE], true)) + //{ + // float4 vEmissive = g_EmissiveTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); + // vMtrlDiffuse += vEmissive; + //} if (vMtrlDiffuse.a < 0.2f) { discard; diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj b/Jusin154_Team3D/Engine/Default/Engine.vcxproj index b87aad2df..a17f9ac2f 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj @@ -300,7 +300,9 @@ call Update_Lib.bat + + @@ -550,7 +552,9 @@ call Update_Lib.bat + + diff --git a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters index 43cd1ad68..f48a68822 100644 --- a/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters +++ b/Jusin154_Team3D/Engine/Default/Engine.vcxproj.filters @@ -295,6 +295,12 @@ {7c82051e-19af-4284-8156-16f504db30b6} + + {ea9648d8-6a9a-41d2-8b8f-ea6937017372} + + + {b31a93a4-8bba-4e94-8008-bbb9b458a55e} + @@ -564,6 +570,12 @@ 03.Management\02.Resource_Manager + + 02.Element\02.Component\12.Stat + + + 02.Element\02.Component\12.Stat\Event + @@ -1199,6 +1211,12 @@ 03.Management\02.Resource_Manager + + 02.Element\02.Component\12.Stat + + + 02.Element\02.Component\12.Stat\Event + diff --git a/Jusin154_Team3D/Engine/Private/Prototype_Manager.cpp b/Jusin154_Team3D/Engine/Private/Prototype_Manager.cpp index 9e5192594..107a7be76 100644 --- a/Jusin154_Team3D/Engine/Private/Prototype_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Prototype_Manager.cpp @@ -98,7 +98,6 @@ HRESULT CPrototype_Manager::Ready_StaticComponents() if (FAILED(Add_Prototype(g_iStaticLevel, CLight::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - return S_OK; } diff --git a/Jusin154_Team3D/Engine/Private/Stat.cpp b/Jusin154_Team3D/Engine/Private/Stat.cpp new file mode 100644 index 000000000..e4ec49302 --- /dev/null +++ b/Jusin154_Team3D/Engine/Private/Stat.cpp @@ -0,0 +1,128 @@ +#include "pch.h" +#include "Stat.h" +#include "StatEvent.h" + +CStat::CStat(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CComponent{ pDevice, pContext } +{ + ZeroMemory(m_StatArr, sizeof(m_StatArr)); +} + +CStat::CStat(const CStat& rhs) + : CComponent(rhs) +{ + ZeroMemory(m_StatArr, sizeof(m_StatArr)); + + memcpy_s(m_StatArr, sizeof(m_StatArr), rhs.m_StatArr, sizeof(m_StatArr)); + memcpy_s(m_ConditionArr, sizeof(m_ConditionArr), rhs.m_ConditionArr, sizeof(m_ConditionArr)); +} + +HRESULT CStat::Initialize_Prototype(tinyxml2::XMLNode* pChild) +{ + auto pElement = pChild->ToElement(); + pElement->QueryFloatAttribute("HP", &m_StatArr[ENUM_CLASS(STAT::HP)]); + pElement->QueryFloatAttribute("MAXHP", &m_StatArr[ENUM_CLASS(STAT::MAXHP)]); + pElement->QueryFloatAttribute("MELEE", &m_StatArr[ENUM_CLASS(STAT::MELEE)]); + pElement->QueryFloatAttribute("MAGIC", &m_StatArr[ENUM_CLASS(STAT::MAGIC)]); + pElement->QueryFloatAttribute("DEFENSE", &m_StatArr[ENUM_CLASS(STAT::DEFENSE)]); + pElement->QueryFloatAttribute("SPEED", &m_StatArr[ENUM_CLASS(STAT::SPEED)]); + pElement->QueryFloatAttribute("AGILITY", &m_StatArr[ENUM_CLASS(STAT::AGILITY)]); + pElement->QueryFloatAttribute("LEVEL", &m_StatArr[ENUM_CLASS(STAT::LEVEL)]); + pElement->QueryFloatAttribute("EXPERIENCE", &m_StatArr[ENUM_CLASS(STAT::EXPERIENCE)]); + pElement->QueryFloatAttribute("MAX_EXPERIENCE", &m_StatArr[ENUM_CLASS(STAT::MAX_EXPERIENCE)]); + pElement->QueryFloatAttribute("GOLD", &m_StatArr[ENUM_CLASS(STAT::GOLD)]); + memset(m_ConditionArr, 0, sizeof(m_ConditionArr)); + + return S_OK; +} + +HRESULT CStat::Initialize(void* pArg) +{ + return S_OK; +} + +CStat* CStat::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, tinyxml2::XMLNode* pChild) +{ + CStat* pInstance = new CStat(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype(pChild))) + { + MSG_BOX("Failed to Created : CStat"); + Safe_Release(pInstance); + } + + return pInstance; +} + +CComponent* CStat::Clone(void* pArg, class CGameObject* pOwner) +{ + CStat* pInstance = new CStat(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CStat"); + Safe_Release(pInstance); + } + + return pInstance; +} + +void CStat::Free() +{ + __super::Free(); +} +#ifdef _DEBUG + +void CStat::Describe_Entity() +{ + +} + +#endif // _DEBUG + +_float CStat::Get_Stat(_int _iStatIndex) +{ + return m_StatArr[_iStatIndex]; +} + +void CStat::Set_Stat(_int _iStatIndex, _float _iAmount) +{ + m_StatArr[_iStatIndex] = _iAmount; +} + +void CStat::Add_Stat(_int _iStatIndex, _float _iAmount) +{ + m_StatArr[_iStatIndex] += _iAmount; +} + +_bool CStat::Get_Condition(_uint _iConditionIndex) const +{ + return m_ConditionArr[_iConditionIndex]; +} + +void CStat::Set_Condition(_uint _iConditionIndex, _bool _Condition) +{ + m_ConditionArr[_iConditionIndex] = _Condition; +} + +void CStat::Add_Hp(_float iAmount) +{ + _float fMaxHp = Get_Stat(ENUM_CLASS(STAT::MAXHP)); + _float fCurHp = Get_Stat(ENUM_CLASS(STAT::HP)); + if (fCurHp < fMaxHp) { + _float iNewHP = fCurHp + iAmount; + if (iNewHP > fMaxHp) { + iAmount = fMaxHp - fCurHp; + } + Add_Stat(ENUM_CLASS(STAT::HP), iAmount); + } +} + +_bool CStat::Get_Damage(_float fDamage) +{ + _bool bResultDead = { false }; + _float fCurHp = Get_Stat(ENUM_CLASS(STAT::HP)) - fDamage; + if (fCurHp < 0) { fCurHp = 0; bResultDead = true; } + Set_Stat(ENUM_CLASS(STAT::HP), fCurHp); + return bResultDead; +} diff --git a/Jusin154_Team3D/Engine/Private/StatEvent.cpp b/Jusin154_Team3D/Engine/Private/StatEvent.cpp new file mode 100644 index 000000000..fbf66eca5 --- /dev/null +++ b/Jusin154_Team3D/Engine/Private/StatEvent.cpp @@ -0,0 +1,130 @@ +#include "pch.h" +#include "StatEvent.h" + +CStatEvent::CStatEvent(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CComponent{ pDevice, pContext } +{ +} + +CStatEvent::CStatEvent(const CStatEvent& Prototype) + : CComponent(Prototype) +{ +} + +void CStatEvent::AddEvent(const function _Equipfunc, const function _UnEquipfunc) +{ + if (m_EquipEventVector.size() > 6) + return; + + m_EquipEventVector.push_back(_Equipfunc); + m_UnEquipEventVector.push_back(_UnEquipfunc); + +} + +// 팝된 속성이 어떤 속성인지 리턴함 +_uint CStatEvent::PopEvent(_uint iIndex) +{ + vector> EquipEventVector = {}; + vector> UnEquipEventVector = {}; + vector<_uint> ActiveAbillityIDVec = {}; + + _uint iReturnStat(0); + + EquipEventVector = move(m_EquipEventVector); + UnEquipEventVector = move(m_UnEquipEventVector); + ActiveAbillityIDVec = move(m_ActiveAbillityIDVec); + + for (size_t i = 0; i < EquipEventVector.size(); i++) + { + if (i == iIndex) + { + iReturnStat = ActiveAbillityIDVec[i]; + continue; + } + + + m_EquipEventVector.push_back(EquipEventVector[i]); + m_UnEquipEventVector.push_back(UnEquipEventVector[i]); + m_ActiveAbillityIDVec.push_back(ActiveAbillityIDVec[i]); + } + + return iReturnStat; +} + +HRESULT CStatEvent::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CStatEvent::Initialize(void* pArg) +{ + + return S_OK; +} + +CStatEvent* CStatEvent::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CStatEvent* pInstance = new CStatEvent(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CStatEvent"); + Safe_Release(pInstance); + } + + return pInstance; +} + +void CStatEvent::Equip() +{ + for (auto& func : m_EquipEventVector) + { + func(); + } +} + +void CStatEvent::UnEquip() +{ + for (auto& func : m_UnEquipEventVector) + { + func(); + } +} + +void CStatEvent::Clear() +{ + m_EquipEventVector.clear(); + m_UnEquipEventVector.clear(); + m_ActiveAbillityIDVec.clear(); +} + +void CStatEvent::Push_Order(_uint _iId) +{ + m_ActiveAbillityIDVec.push_back(_iId); +} + +CComponent* CStatEvent::Clone(void* pArg, class CGameObject* pOwner) +{ + CStatEvent* pInstance = new CStatEvent(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CStatEvent"); + Safe_Release(pInstance); + } + + return pInstance; +} + +void CStatEvent::Free() +{ + __super::Free(); +} +#ifdef _DEBUG + +void CStatEvent::Describe_Entity() +{ + +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index dc2d4b463..0a0eb337e 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -9,6 +9,8 @@ enum class RENDER {PRIORITY, SHADOW, NONBLEND, DECAL, BLUR, NONLIGHT, EFFECT ,BL enum class RAY { LOCAL, WORLD, END }; enum class ACTOR { BOX, CAPSULE, SPHERE, PLANE, TRIANGLEMESH, HEIGHTFIELD, END }; enum class BLEND_BONE{SPINE,SHOULDER_L,SHOULDER_R,NECK,SHOULDER_NECK_L, SHOULDER_NECK_R,END}; +enum class STAT { HP, MAXHP, MELEE, MAGIC, DEFENSE, SPEED, AGILITY, LEVEL, EXPERIENCE, MAX_EXPERIENCE, GOLD, END }; +enum class CONDITION { POISON, HPREGENERATION, PANIC, GRAP, END }; enum class TEXTURE_LOAD_TYPE { diff --git a/Jusin154_Team3D/Engine/Public/Prototype_Manager.h b/Jusin154_Team3D/Engine/Public/Prototype_Manager.h index 975c0a842..2b631aef4 100644 --- a/Jusin154_Team3D/Engine/Public/Prototype_Manager.h +++ b/Jusin154_Team3D/Engine/Public/Prototype_Manager.h @@ -11,6 +11,8 @@ #include "Cell.h" #include "Model.h" #include "Instance_Model.h" +#include "Stat.h" +#include "StatEvent.h" #include "Character_Controller.h" #include "Light.h" #include "FSM.h" diff --git a/Jusin154_Team3D/Engine/Public/Stat.h b/Jusin154_Team3D/Engine/Public/Stat.h new file mode 100644 index 000000000..51dd4934e --- /dev/null +++ b/Jusin154_Team3D/Engine/Public/Stat.h @@ -0,0 +1,41 @@ +#pragma once + +#include "Component.h" + +NS_BEGIN(Engine) + +class ENGINE_DLL CStat final : public CComponent +{ +private: + CStat(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CStat(const CStat& rhs); + virtual ~CStat() = default; + +private: + virtual HRESULT Initialize_Prototype(tinyxml2::XMLNode* pChild); + virtual HRESULT Initialize(void* pArg); + +public: + static CStat* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, tinyxml2::XMLNode* pChild); + virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG + +public: + _float Get_Stat(_int _iStatIndex); + void Set_Stat(_int _iStatIndex, _float _iAmount); + void Add_Stat(_int _iStatIndex, _float _iAmount); + _bool Get_Condition(_uint _iConditionIndex) const; + void Set_Condition(_uint _iConditionIndex, _bool _Condition); + + void Add_Hp(_float iAmount); + _bool Get_Damage(_float fDamage); + +private: + _float m_StatArr[ENUM_CLASS(STAT::END)]; + _bool m_ConditionArr[ENUM_CLASS(CONDITION::END)] = { false }; +}; + +NS_END diff --git a/Jusin154_Team3D/Engine/Public/StatEvent.h b/Jusin154_Team3D/Engine/Public/StatEvent.h new file mode 100644 index 000000000..dfd13b576 --- /dev/null +++ b/Jusin154_Team3D/Engine/Public/StatEvent.h @@ -0,0 +1,45 @@ +#pragma once + +#include "Component.h" + +NS_BEGIN(Engine) + +class ENGINE_DLL CStatEvent final : public CComponent +{ +private: + CStatEvent(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CStatEvent(const CStatEvent& Prototype); + virtual ~CStatEvent() = default; +private: + virtual HRESULT Initialize_Prototype(); + virtual HRESULT Initialize(void* pArg); + +public: + void AddEvent(const function _Equipfunc, const function _UnEquipfunc); + _uint PopEvent(_uint iIndex); + + + void Equip(); + void UnEquip(); + void Clear(); + + void Push_Order(_uint _iId); + +public: + static CStatEvent* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr) override; + virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG + + + +private: + vector> m_EquipEventVector = {}; + vector> m_UnEquipEventVector = {}; + vector<_uint> m_ActiveAbillityIDVec = {}; + +}; + +NS_END diff --git a/Jusin154_Team3D/Engine/Public/Unit.h b/Jusin154_Team3D/Engine/Public/Unit.h index 9809ca0fc..919e65f5d 100644 --- a/Jusin154_Team3D/Engine/Public/Unit.h +++ b/Jusin154_Team3D/Engine/Public/Unit.h @@ -50,6 +50,7 @@ class ENGINE_DLL CUnit abstract : public CContainerObject _float Get_KeyFrame(_string FrameName); _bool IsCurrentKeyFrame(_string FrameName); virtual _vector Get_LockOnPos() { return Get_WorldPostion(); } + virtual _bool Get_Damage(_float fDamage) { return false; } virtual void Reset_Sprint() {}; virtual void Reset_Walk() {}; @@ -60,7 +61,6 @@ class ENGINE_DLL CUnit abstract : public CContainerObject CModel* m_pModelCom = { nullptr }; CFSM* m_pFSM = { nullptr }; _wstring m_strModelPrototypeTag; - _float2 m_vHP = { 230.f, 350.f }; _bool m_bRimLight = { true }; _float m_fRimLightPower = { 3.2f }; _float m_fRimLightStrength = { 3.04f }; From 6c4725694393cc44729b8beeecbb1746a5c0e14a Mon Sep 17 00:00:00 2001 From: kimnuri Date: Sun, 7 Dec 2025 19:03:34 +0900 Subject: [PATCH 4/6] [add] Golind delete --- .../Private/CallBack_Monster_Behavior.cpp | 2 +- .../Client/Private/Dummy_PhysXPlayable.cpp | 2 +- Jusin154_Team3D/Client/Private/Goblin.cpp | 2 +- .../Client/Private/InfoInstance.cpp | 4 +- .../Client/Private/Level_GamePlay.cpp | 150 ++--- Jusin154_Team3D/Client/Private/Loader.cpp | 618 +++++++++--------- .../Client/Private/MonsterInfo.cpp | 18 +- Jusin154_Team3D/Client/Private/Player.cpp | 1 + Jusin154_Team3D/Client/Public/MonsterInfo.h | 1 + Jusin154_Team3D/Editor/Private/Loader.cpp | 8 +- .../Engine/Private/GameInstance.cpp | 1 + .../Engine/Private/Resource_Manager.cpp | 87 +++ .../Engine/Public/Resource_Manager.h | 12 + 13 files changed, 512 insertions(+), 394 deletions(-) diff --git a/Jusin154_Team3D/Client/Private/CallBack_Monster_Behavior.cpp b/Jusin154_Team3D/Client/Private/CallBack_Monster_Behavior.cpp index 699647c82..40bf504cb 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Monster_Behavior.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Monster_Behavior.cpp @@ -93,5 +93,5 @@ HRESULT CCallBack_Monster_Behavior::Finalize() CCallBack_Monster_Behavior* CCallBack_Monster_Behavior::Create() { - return new CCallBack_Monster_Behavior();; + return new CCallBack_Monster_Behavior(); } diff --git a/Jusin154_Team3D/Client/Private/Dummy_PhysXPlayable.cpp b/Jusin154_Team3D/Client/Private/Dummy_PhysXPlayable.cpp index e65029f2e..7a34e1158 100644 --- a/Jusin154_Team3D/Client/Private/Dummy_PhysXPlayable.cpp +++ b/Jusin154_Team3D/Client/Private/Dummy_PhysXPlayable.cpp @@ -126,7 +126,7 @@ HRESULT CDummy_PhysXPlayable::Ready_Components(void* pArg) Desc.iSubKind = pDesc->iSubKind; Desc.pTransform = m_pTransformCom; Desc.eBodyType = ACTOR::CAPSULE; - Desc.fContactOffset = 0.1f; + Desc.fContactOffset = 0.001f; Desc.fMaterial = { 0.5f, 0.5f, 0.6f }; Desc.bAutoStepping = { false }; Desc.fStepOffset = { 0.05f }; diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index 7dd96b02f..fe220acca 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -255,7 +255,7 @@ HRESULT CGoblin::Ready_Components() Desc.iSubKind = ENUM_CLASS(PXOBJECT::GOBLIN_WARRIOR); Desc.pTransform = m_pTransformCom; Desc.eBodyType = ACTOR::CAPSULE; - Desc.fContactOffset = 0.3f; + Desc.fContactOffset = 0.001f; Desc.fMaterial = { 1.2f, 1.0f, 0.0f }; Desc.bAutoStepping = { false }; Desc.fStepOffset = { 0.05f }; diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp index 2a6aef94f..dc8c26e6c 100644 --- a/Jusin154_Team3D/Client/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -47,7 +47,7 @@ HRESULT CInfoInstance::Regist_PlayerAlly(CUnit* pUnit) HRESULT CInfoInstance::Deregist_PlayerAlly(CUnit* pUnit) { - if (nullptr == s_pInstance) { + if (nullptr == s_pInstance || nullptr == m_pMonsterInfo) { return S_OK; // 게임 종료 된 상태 } return m_pMonsterInfo->Deregist_PlayerAlly(pUnit); @@ -60,7 +60,7 @@ HRESULT CInfoInstance::Regist_ActiveMonster(CMonster* pUnit) HRESULT CInfoInstance::Deregist_ActiveMonster(CMonster* pUnit) { - if (nullptr == s_pInstance) { + if (nullptr == s_pInstance || nullptr == m_pMonsterInfo) { return S_OK; // 게임 종료 된 상태 } return m_pMonsterInfo->Deregist_ActiveMonster(pUnit); diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 3f53240c7..b3d3e646d 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -162,96 +162,96 @@ HRESULT CLevel_GamePlay::Ready_Background() /* 테스트용 맵 */ CInfoInstance::GetInstance()->Load_MapObjects("ClientTest"); - /* 전체 맵 */ - { - CInfoInstance::GetInstance()->Load_MapObjects("Hogsmeade_MapContainer_Data"); + ///* 전체 맵 */ + //{ + // CInfoInstance::GetInstance()->Load_MapObjects("Hogsmeade_MapContainer_Data"); - /* 조명 오브젝트 */ - CInfoInstance::GetInstance()->Load_LightElements("LightElement"); + // /* 조명 오브젝트 */ + // CInfoInstance::GetInstance()->Load_LightElements("LightElement"); - /* 상호작용 오브젝트 */ - CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_Barrel"); - CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_PostPackage_B"); - CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_PostPackage_F"); - CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_TeaShopTable"); - CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_TeaShopChair"); + // /* 상호작용 오브젝트 */ + // CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_Barrel"); + // CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_PostPackage_B"); + // CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_PostPackage_F"); + // CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_TeaShopTable"); + // CInfoInstance::GetInstance()->Load_InteractableElements("E_INTER_TeaShopChair"); - CInstancedProp::INSTANCE_PROP_DESC Desc = {}; + // CInstancedProp::INSTANCE_PROP_DESC Desc = {}; - /* 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))) { - return E_FAIL; - } + // /* 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))) { + // 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))) { - 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))) { + // return E_FAIL; + // } - /* SM_HM_OwlPost_Window_A */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_OwlPost_Window_A"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OwlPost_Window.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; + // /* SM_HM_OwlPost_Window_A */ + // Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_OwlPost_Window_A"; + // Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/OwlPost_Window.bin"; + // if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + // return E_FAIL; - ///* WA_Rectangle_Double_A */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Rectangle_Double_A"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Rectangle_Double_A.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; + // ///* WA_Rectangle_Double_A */ + // Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Rectangle_Double_A"; + // Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Rectangle_Double_A.bin"; + // if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + // return E_FAIL; - ///* WC_Retangle_Double_A */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Retangle_Double_A"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Retangle_Double_A.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; + // ///* WC_Retangle_Double_A */ + // Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Retangle_Double_A"; + // Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Retangle_Double_A.bin"; + // if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + // return E_FAIL; - ///* WA_Square_Double_C */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Square_Double_C"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WA_Square_Double_C.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; + // ///* WA_Square_Double_C */ + // Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WA_Square_Double_C"; + // Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WA_Square_Double_C.bin"; + // if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + // return E_FAIL; - /* Quid_Window_A */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Quid_Window_A"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Quid_Window_A.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; + // /* Quid_Window_A */ + // Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Quid_Window_A"; + // Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Quid_Window_A.bin"; + // if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + // return E_FAIL; - /* Ollivanders_Box_Window */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Ollivanders_Box_Window"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Ollivanders_Box.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; + // /* Ollivanders_Box_Window */ + // Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_Ollivanders_Box_Window"; + // Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Ollivanders_Box.bin"; + // if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + // return E_FAIL; - /* WC_L_DoubleS_A */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_L_DoubleS_A"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_L_DoubleS_A.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; + // /* WC_L_DoubleS_A */ + // Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_L_DoubleS_A"; + // Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_L_DoubleS_A.bin"; + // if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + // return E_FAIL; - /* WC_Round_Double_A */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Round_Double_A"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Round_Double_A.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; + // /* WC_Round_Double_A */ + // Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_WC_Round_Double_A"; + // Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/WC_Round_Double_A.bin"; + // if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + // return E_FAIL; - /* SM_HM_Door1a */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door1a"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door1a.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; + // /* SM_HM_Door1a */ + // Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door1a"; + // Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door1a.bin"; + // if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + // return E_FAIL; - /* SM_HM_Door1a */ - Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door2b"; - Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door2b.bin"; - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) - return E_FAIL; - } + // /* SM_HM_Door1a */ + // Desc.strPrototypeTag = L"Prototype_Component_VIBuffer_Model_Instancel_SM_HM_Door2b"; + // Desc.strInstanceDataPath = "../Bin/Resources/Data/Map/Instance/Door2b.bin"; + // if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc))) + // return E_FAIL; + //} return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index f6053f188..e20a5886d 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -232,292 +232,292 @@ HRESULT CLoader::Loading_For_Logo() 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 - )); - } - {/* Doors */ - jobMapModels.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Doors", - ".bin", false - )); - } - {/* Step and Stair */ - jobMapModels.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/GroundSurfaces", - ".bin", false - )); - jobMapModels.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/GroundSurfaces", - ".bin", false - )); - } - {/* Barrel */ - jobMapModels.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Objects/Meshes", - ".bin", false - )); - /* Box */ - jobMapModels.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/MiscProps", - ".bin", false - )); - /* TeaShop Table */ - jobMapModels.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Tables", - ".bin", false - )); - /* TeaShop Chair*/ - jobMapModels.emplace_back(Deferred_FolderLoad( - "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Chairs", - ".bin", false - )); - } - } - -#pragma endregion - +// +//#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 +// )); +// } +// {/* Doors */ +// jobMapModels.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Doors", +// ".bin", false +// )); +// } +// {/* Step and Stair */ +// jobMapModels.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/GroundSurfaces", +// ".bin", false +// )); +// jobMapModels.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/GroundSurfaces", +// ".bin", false +// )); +// } +// {/* Barrel */ +// jobMapModels.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Objects/Meshes", +// ".bin", false +// )); +// /* Box */ +// jobMapModels.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/MiscProps", +// ".bin", false +// )); +// /* TeaShop Table */ +// jobMapModels.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Tables", +// ".bin", false +// )); +// /* TeaShop Chair*/ +// jobMapModels.emplace_back(Deferred_FolderLoad( +// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Chairs", +// ".bin", false +// )); +// } +// } +// +//#pragma endregion +// #pragma region UI @@ -1559,7 +1559,7 @@ HRESULT CLoader::Loading_For_GamePlay() Desc.ePxRigidBodyFlags = {}; Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT; - Desc.fContactOffset = 0.f; + Desc.fContactOffset = 0.001f; Desc.vMatInfo = { 1.2f, 1.0f, 0.0f }; } CRigidBody_Static* pRigid = CRigidBody_Static::Create(m_pDevice, m_pContext, Desc); @@ -1771,28 +1771,28 @@ HRESULT CLoader::Loading_For_GamePlay() #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; - } + //{ // 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); - } - } + // 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("정보를 불러오는 중입니다."); @@ -1946,7 +1946,7 @@ vector* APIENTRY Deferred_FolderLoad_Main(ID3D11Device* pDevice, I Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT; Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f); - Desc.fContactOffset = 0.f; + Desc.fContactOffset = 0.001f; } pContents->pRigidBodyTags.emplace_back(CMyTools::ToWstring(pModel->Get_MeshName(i) + to_string(i)).c_str()); diff --git a/Jusin154_Team3D/Client/Private/MonsterInfo.cpp b/Jusin154_Team3D/Client/Private/MonsterInfo.cpp index 88190cd7a..9c617ceaa 100644 --- a/Jusin154_Team3D/Client/Private/MonsterInfo.cpp +++ b/Jusin154_Team3D/Client/Private/MonsterInfo.cpp @@ -12,8 +12,8 @@ void CMonsterInfo::Update(_float fTimeDelta) { Refresh_PlayerAllies(); Refresh_LockOnMonsters(); + Refresh_ActiveMonsters(); } - void CMonsterInfo::Change_Level() { SAFE_RELEASE(m_pLockOnMonster); @@ -149,6 +149,22 @@ HRESULT CMonsterInfo::Refresh_LockOnMonsters() return S_OK; } +HRESULT CMonsterInfo::Refresh_ActiveMonsters() +{ + list::iterator iter = m_ActiveMonsters.begin(); + for (; iter != m_ActiveMonsters.end();) { + if (true == (*iter)->isDead()) { + SAFE_RELEASE(*iter); + iter = m_ActiveMonsters.erase(iter); + } + else { + ++iter; + } + } + return S_OK; +} + + HRESULT CMonsterInfo::Refresh_PlayerAllies() { for (list::iterator iter = m_PlayerAllies.begin(); iter != m_PlayerAllies.end();) { diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index fe7256cc5..d350fe341 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -501,6 +501,7 @@ void CPlayer::Free() SAFE_RELEASE(m_pCharacter_Controller); SAFE_RELEASE(m_pRigidBody); SAFE_RELEASE(m_pLightCom); + SAFE_RELEASE(m_pStat); Safe_Delete(m_pCallBack_Behavior); Safe_Delete(m_pCallBack_HitReport); SAFE_RELEASE(m_pCamPosition_TopDown_FollowPart); diff --git a/Jusin154_Team3D/Client/Public/MonsterInfo.h b/Jusin154_Team3D/Client/Public/MonsterInfo.h index b45493079..f2c0672d0 100644 --- a/Jusin154_Team3D/Client/Public/MonsterInfo.h +++ b/Jusin154_Team3D/Client/Public/MonsterInfo.h @@ -42,6 +42,7 @@ class CMonsterInfo final : public CBase HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); HRESULT Refresh_LockOnMonsters(); HRESULT Refresh_PlayerAllies(); + HRESULT Refresh_ActiveMonsters(); public: diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 09f2d01b5..eff020220 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -1566,7 +1566,7 @@ HRESULT CLoader::Loading_For_PhysXLevel() Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT; Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f); - Desc.fContactOffset = 0.f; + Desc.fContactOffset = 0.001f; } if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), CRigidBody_Static::Create(m_pDevice, m_pContext, Desc)))) { return E_FAIL; @@ -1773,7 +1773,7 @@ HRESULT CLoader::MapFolderLoad(const _char* pDirectoryPath, const _char* pFileEx Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT; Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f); - Desc.fContactOffset = 0.f; + Desc.fContactOffset = 0.001f; } if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), CRigidBody_Static::Create(m_pDevice, m_pContext, Desc)))) { return E_FAIL; @@ -1826,7 +1826,7 @@ void APIENTRY Deferred_FolderLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContex Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT; Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f); - Desc.fContactOffset = 0.f; + Desc.fContactOffset = 0.001f; } 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)); @@ -2833,7 +2833,7 @@ vector*> Contents(iLoadCount); Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE }; Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT; Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f); - Desc.fContactOffset = 0.f; + Desc.fContactOffset = 0.001f; } CRigidBody_Static* pRigid = CRigidBody_Static::Create(m_pDevice, m_pContext, Desc); if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_RigidBody_Static_Terrain_Hogsmeade"), pRigid))) { diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 822065287..7be6cc17a 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -128,6 +128,7 @@ void CGameInstance::Update_Engine(_float fTimeDelta) m_pMouse_Manager->Update(); //m_pSound_Manager->Update(); #ifdef _DEBUG + m_pResource_Manager->Describe_Entity(); m_pFog->Update_Fog(); #endif // _DEBUG m_pPicking->Update(); diff --git a/Jusin154_Team3D/Engine/Private/Resource_Manager.cpp b/Jusin154_Team3D/Engine/Private/Resource_Manager.cpp index 0a8f5f160..96f860c8f 100644 --- a/Jusin154_Team3D/Engine/Private/Resource_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Resource_Manager.cpp @@ -21,9 +21,19 @@ ID3D11ShaderResourceView* CResource_Manager::Add_Texture(const _char* pFilePath) auto iter = m_Resources.find(wstrKeyOriginal); if (iter != m_Resources.end()) { +#ifdef _DEBUG + lock_guard statisticsLock(m_mtxStatistics); + m_mapCacheHit[wstrKeyOriginal]++; +#endif // _DEBUG SAFE_ADDREF(iter->second); return iter->second; } + else { +#ifdef _DEBUG + lock_guard statisticsLock(m_mtxStatistics); + m_mapCacheMiss[wstrKeyOriginal]++; +#endif // _DEBUG + } // sharedLock 소멸 } // 브레이스 해제 금지 @@ -125,3 +135,80 @@ void CResource_Manager::Free() } m_Resources.clear(); } + + +#ifdef _DEBUG + +void CResource_Manager::Describe_Entity() +{ + static vector> vecHit = {}; + static vector> vecMiss = {}; + GUI::Begin("ResourceManager"); + if (GUI::Button("Refresh")) { + vecHit.clear(); + vecMiss.clear(); + for (auto& element : m_mapCacheHit){ + vecHit.emplace_back(element); + } + for (auto& element : m_mapCacheMiss){ + vecMiss.emplace_back(element); + } + sort(vecHit.begin(), vecHit.end(), + [](const pair<_wstring, _uint>& leftPair, + const pair<_wstring, _uint>& rightPair) + { + return leftPair.second > rightPair.second; + }); + + sort(vecMiss.begin(), vecMiss.end(), + [](const pair<_wstring, _uint>& leftPair, + const pair<_wstring, _uint>& rightPair) + { + return leftPair.second > rightPair.second; + }); + } + if (GUI::CollapsingHeader("Statistics")) { + _uint iTotalHitCount = 0; + _uint iTotalMissCount = 0; + + for (const auto& element : m_mapCacheHit) { + iTotalHitCount += element.second; + } + for (const auto& element : m_mapCacheMiss) { + iTotalMissCount += element.second; + } + _uint iTotalRequestCount = iTotalHitCount + iTotalMissCount; + + _float fHitRatePercent = 0.0f; + if (iTotalRequestCount > 0) { + fHitRatePercent = (_float)iTotalHitCount * 100.0f / (_float)iTotalRequestCount; + } + + GUI::Text("Total Requests: %u", iTotalRequestCount); + GUI::Text("Hit: %u Miss: %u HitRate: %.2f%%", iTotalHitCount, iTotalMissCount, fHitRatePercent); + + } + if (GUI::CollapsingHeader("CacheHit")) { + GUI::Text("%d", vecHit.size()); + GUI::BeginChild("CacheHit", { 300, 300 }); + GUI::GetScrollY(); + for (auto& element : vecHit) { + GUI::Text("%d", element.second); GUI::SameLine(); + GUI::Text(CMyTools::ToString(element.first).c_str()); + } + GUI::EndChild(); + } + if (GUI::CollapsingHeader("CacheMiss")) { + GUI::Text("%d", vecMiss.size()); + GUI::BeginChild("CacheMiss", { 300, 300 }); + GUI::GetScrollY(); + for (auto& element : vecMiss) { + GUI::Text("%d", element.second); GUI::SameLine(); + GUI::Text(CMyTools::ToString(element.first).c_str()); + } + GUI::EndChild(); + } + GUI::End(); +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Engine/Public/Resource_Manager.h b/Jusin154_Team3D/Engine/Public/Resource_Manager.h index 837f81915..6dd4ff6b6 100644 --- a/Jusin154_Team3D/Engine/Public/Resource_Manager.h +++ b/Jusin154_Team3D/Engine/Public/Resource_Manager.h @@ -10,6 +10,10 @@ class CResource_Manager final : public CBase CResource_Manager(ID3D11Device* pDevice); virtual ~CResource_Manager() = default; shared_mutex m_smtxTexture = {}; +#ifdef _DEBUG + mutex m_mtxStatistics = {}; +#endif // _DEBUG + public: ID3D11ShaderResourceView* Add_Texture(const _char* pFilePath); @@ -26,10 +30,18 @@ class CResource_Manager final : public CBase ID3D11Device* m_pDevice = { nullptr }; unordered_map<_wstring, ID3D11ShaderResourceView*> m_Resources; +#ifdef _DEBUG + unordered_map<_wstring, atomic_int> m_mapCacheHit; + unordered_map<_wstring, atomic_int> m_mapCacheMiss; +#endif // _DEBUG public: static CResource_Manager* Create(ID3D11Device* pDevice, _uint iResourceCount); virtual void Free() override; +#ifdef _DEBUG + void Describe_Entity(); +#endif // _DEBUG + }; NS_END From 05ff4fe60edcd6b48a810857b519894404a59629 Mon Sep 17 00:00:00 2001 From: kimnuri Date: Sun, 7 Dec 2025 22:02:18 +0900 Subject: [PATCH 5/6] =?UTF-8?q?[add]=20=EB=AA=AC=EC=8A=A4=ED=84=B0=20?= =?UTF-8?q?=EC=82=AC=EB=A7=9D=20=EC=83=81=ED=83=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jusin154_Team3D/Client/Default/Client.vcxproj | 2 + .../Client/Default/Client.vcxproj.filters | 9 +++ .../CallBack_EffectHitBox_Behavior.cpp | 2 +- .../CallBack_EffectHitBox_HitReport.cpp | 8 +-- .../Private/CallBack_Monster_Behavior.cpp | 2 +- .../Private/CallBack_Playable_Behavior.cpp | 2 +- Jusin154_Team3D/Client/Private/Goblin.cpp | 11 +-- .../Client/Private/Goblin_States.cpp | 67 +++++++++++++++++-- Jusin154_Team3D/Client/Private/Monster.cpp | 11 +-- .../Client/Private/MonsterInfo.cpp | 10 ++- Jusin154_Team3D/Client/Private/NomalJap.cpp | 13 +++- Jusin154_Team3D/Client/Private/State_Dead.cpp | 56 ++++++++++++++++ Jusin154_Team3D/Client/Public/Goblin.h | 5 +- Jusin154_Team3D/Client/Public/Monster.h | 1 + Jusin154_Team3D/Client/Public/State_Dead.h | 31 +++++++++ .../CallBack_EffectHitBox_HitReport.cpp | 3 +- Jusin154_Team3D/Engine/Public/Engine_Struct.h | 32 ++++----- Jusin154_Team3D/Engine/Public/FSM.h | 1 + Jusin154_Team3D/Engine/Public/MyTools.h | 12 +++- Jusin154_Team3D/Engine/Public/Unit.h | 1 + 20 files changed, 228 insertions(+), 51 deletions(-) create mode 100644 Jusin154_Team3D/Client/Private/State_Dead.cpp create mode 100644 Jusin154_Team3D/Client/Public/State_Dead.h diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index a2579166f..c9a6c7f64 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -268,6 +268,7 @@ call Update_Resources.bat + @@ -408,6 +409,7 @@ call Update_Resources.bat + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index 2b2fb06d6..ee057fee4 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -409,6 +409,9 @@ 02.GameObjects\UI\Screen\Logo\Logo_Text + + 04.Mechanic\State\State_Combat\Dead + @@ -866,6 +869,9 @@ {c584798b-d7aa-4cb0-b6e8-c2aff73757ce} + + {81add99f-7450-4730-8d3f-bf1de06b2b8d} + @@ -1273,6 +1279,9 @@ 02.GameObjects\UI\Screen\Logo\Logo_Text + + 04.Mechanic\State\State_Combat\Dead + diff --git a/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_Behavior.cpp b/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_Behavior.cpp index 140eb3454..2e11f5720 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_Behavior.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_Behavior.cpp @@ -60,7 +60,7 @@ PSX::PxControllerBehaviorFlags CCallBack_EffectHitBox_Behavior::getBehaviorFlags PSX::PxControllerBehaviorFlags CCallBack_EffectHitBox_Behavior::getBehaviorFlags(const PSX::PxController& controller) { // CCT끼리 부딪힐 때를 굳이 안 쓰면 0 리턴 - return PSX::PxControllerBehaviorFlags(0); + return PSX::PxControllerBehaviorFlag::eCCT_SLIDE; } PSX::PxControllerBehaviorFlags CCallBack_EffectHitBox_Behavior::getBehaviorFlags(const PSX::PxObstacle& obstacle) diff --git a/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_HitReport.cpp index acbbdb0ad..cb60b353a 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_HitReport.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_EffectHitBox_HitReport.cpp @@ -43,7 +43,7 @@ void CCallBack_EffectHitBox_HitReport::onShapeHit(const PSX::PxControllerShapeHi case PXOBJECT::WALL: /* OnCollision 함수에 넘길 값 */ - CollisionDesc.vWorldPos = XMVectorSet( (_float)vWorldPos.x, (_float)vWorldPos.y, (_float)vWorldPos.z, 1.f); + CollisionDesc.vWorldPos = { (_float)vWorldPos.x, (_float)vWorldPos.y, (_float)vWorldPos.z, 1.f }; memcpy(&CollisionDesc.vWorldNomal, &vWorldNormal, sizeof(_float3)); memcpy(&CollisionDesc.vHitDir, &vDir, sizeof(_float3)); CollisionDesc.fLength = fLength; @@ -53,13 +53,13 @@ void CCallBack_EffectHitBox_HitReport::onShapeHit(const PSX::PxControllerShapeHi case PXOBJECT::GOBLIN_WARRIOR: /* OnCollision 함수에 넘길 값 */ - CollisionDesc.vWorldPos = XMVectorSet( (_float)vWorldPos.x, (_float)vWorldPos.y, (_float)vWorldPos.z, 1.f); + CollisionDesc.vWorldPos = { (_float)vWorldPos.x, (_float)vWorldPos.y, (_float)vWorldPos.z, 1.f }; memcpy(&CollisionDesc.vWorldNomal, &vWorldNormal, sizeof(_float3)); memcpy(&CollisionDesc.vHitDir, &vDir, sizeof(_float3)); CollisionDesc.fLength = fLength; pOwnerActorData->pOwner->Get_Owner()->OnCollision(pTargetActorData->pOwner , &CollisionDesc); - static_cast(pTargetActorData->pBody)->Add_Force(CollisionDesc.vHitDir * fLength * 100.f, PSX::PxForceMode::eIMPULSE); + static_cast(pTargetActorData->pBody)->Add_Force(XMLoadFloat4(&CollisionDesc.vHitDir) * fLength * 100.f, PSX::PxForceMode::eIMPULSE); break; default: { @@ -112,7 +112,7 @@ void CCallBack_EffectHitBox_HitReport::onControllerHit(const PSX::PxControllersH case PXOBJECT::GOBLIN_WARRIOR: /* OnCollision 함수에 넘길 값 */ - CollisionDesc.vWorldPos = XMVectorSet((_float)vWorldPos.x, (_float)vWorldPos.y, (_float)vWorldPos.z, 1.f); + CollisionDesc.vWorldPos = { (_float)vWorldPos.x, (_float)vWorldPos.y, (_float)vWorldPos.z, 1.f }; memcpy(&CollisionDesc.vWorldNomal, &vWorldNormal, sizeof(_float3)); memcpy(&CollisionDesc.vHitDir, &vDir, sizeof(_float3)); CollisionDesc.fLength = fLength; diff --git a/Jusin154_Team3D/Client/Private/CallBack_Monster_Behavior.cpp b/Jusin154_Team3D/Client/Private/CallBack_Monster_Behavior.cpp index 40bf504cb..e4b961ca8 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Monster_Behavior.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Monster_Behavior.cpp @@ -60,7 +60,7 @@ PSX::PxControllerBehaviorFlags CCallBack_Monster_Behavior::getBehaviorFlags(cons PSX::PxControllerBehaviorFlags CCallBack_Monster_Behavior::getBehaviorFlags(const PSX::PxController& controller) { // CCT끼리 부딪힐 때를 굳이 안 쓰면 0 리턴 - return PSX::PxControllerBehaviorFlags(0); + return PSX::PxControllerBehaviorFlag::eCCT_SLIDE; } PSX::PxControllerBehaviorFlags CCallBack_Monster_Behavior::getBehaviorFlags(const PSX::PxObstacle& obstacle) diff --git a/Jusin154_Team3D/Client/Private/CallBack_Playable_Behavior.cpp b/Jusin154_Team3D/Client/Private/CallBack_Playable_Behavior.cpp index b74143b2f..28678a758 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Playable_Behavior.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Playable_Behavior.cpp @@ -60,7 +60,7 @@ PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(con PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(const PSX::PxController& controller) { // CCT끼리 부딪힐 때를 굳이 안 쓰면 0 리턴 - return PSX::PxControllerBehaviorFlags(0); + return PSX::PxControllerBehaviorFlag::eCCT_SLIDE; } PSX::PxControllerBehaviorFlags CCallBack_Playable_Behavior::getBehaviorFlags(const PSX::PxObstacle& obstacle) diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index fe220acca..bb92f4009 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -189,17 +189,9 @@ void CGoblin::OnCollision(CGameObject* pOther, void* pDesc) return; } ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); - _vector vWorldPos = {}; // 접촉지점 - _vector vWorldNomal = {}; // 접촉노말 - _vector vHitDir = {}; // 시도한 move 방향 - _float fLength = {}; // 작용된 힘 - //m_pCharacter_Controller->ConvertToDO(*m_pRigidBody); - //m_pRigidBody->Add_Force(vHitDir * fLength * 10000.f, PSX::PxForceMode::eFORCE); - - //m_pCharacter_Controller->ConvertToDO(*m_pRigidBody); - //m_pRigidBody->Add_Force(vHitDir * fLength * 100.f, PSX::PxForceMode::eIMPULSE); _uint iSkillType = dynamic_cast(pOther)->Get_SkillType(); + m_fHitRadius = CMyTools::Get_Direction2D(m_pTransformCom->Get_State(STATE::LOOK), XMLoadFloat4(&CollisionDesc->vHitDir)); switch (iSkillType) { case ENUM_CLASS(SKILL_TYPE::DESCENDO): @@ -211,6 +203,7 @@ void CGoblin::OnCollision(CGameObject* pOther, void* pDesc) case ENUM_CLASS(SKILL_TYPE::JAP): m_eHitSpell = STATEANIM::HIT_LEVIOSO; if (true == Get_Damage(60.f)) { + m_pFSM->Change_State(FSMSTATE::DEAD); return; } break; diff --git a/Jusin154_Team3D/Client/Private/Goblin_States.cpp b/Jusin154_Team3D/Client/Private/Goblin_States.cpp index f3fd39800..e680861ed 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_States.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_States.cpp @@ -16,6 +16,7 @@ #include "State_Throw.h" #include "State_Blink.h" #include "State_Hit.h" +#include "State_Dead.h" #pragma endregion @@ -338,6 +339,60 @@ void CGoblin::Behavior_HitExit() m_pFSM->Disable_State(FSMSTATE::HIT); } +void CGoblin::Behavior_DeadEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::DEAD); + + _bool bStrongerKnockDown = { false }; + + switch (m_eHitSpell) + { + case STATEANIM::KNOCKDOWN_FWD: + bStrongerKnockDown = true; + break; + case STATEANIM::TUMBLE2: + bStrongerKnockDown = true; + break; + default: + break; + } + + _float fabsRadius = fabsf(m_fHitRadius); + _uint iState = { UINT_MAX }; + + if (fabsRadius > 135.f) { + iState = STATEANIM::DEAD_BWD; + } + else if (fabsRadius < 45.f) { + iState = STATEANIM::DEAD_FWD; + } + else { + if (m_fHitRadius < 0.f) { + iState = STATEANIM::DEAD_R; + } + else { + iState = STATEANIM::DEAD_L; + } + } + pairAnimInfo = m_Animation[iState + bStrongerKnockDown]; + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CGoblin::Behavior_DeadExitCheck(_float fTimeDelta) +{ + if (true == m_pModelCom->IsFinishedAnim()) { + return E_FAIL; + } + return S_OK; +} + +void CGoblin::Behavior_DeadExit() +{ + m_bDead = true; +} + void CGoblin::Add_FSM() { @@ -374,7 +429,6 @@ void CGoblin::Add_FSM() Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::COMBAT, CState_Combat::Create(&Desc)); } - { CState_Swing::STATE_SWING_DESC Desc{}; Desc.pOwner = this; @@ -385,7 +439,6 @@ void CGoblin::Add_FSM() Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::SWING, CState_Swing::Create(&Desc)); } - { CState_Throw::STATE_THROW_DESC Desc{}; Desc.pOwner = this; @@ -396,7 +449,6 @@ void CGoblin::Add_FSM() Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::SKILL, CState_Throw::Create(&Desc)); } - { CState_Blink::STATE_BLINK_DESC Desc{}; Desc.pOwner = this; @@ -409,7 +461,14 @@ void CGoblin::Add_FSM() } #pragma endregion #pragma region Behavior_Combat_Focus - + { + CState_Dead::STATE_DEAD_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_DeadEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_DeadExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_DeadExit(); }; + m_States.emplace(FSMSTATE::DEAD, CState_Dead::Create(&Desc)); + } #pragma endregion #pragma region Hit diff --git a/Jusin154_Team3D/Client/Private/Monster.cpp b/Jusin154_Team3D/Client/Private/Monster.cpp index 3cf8a239f..7b4184203 100644 --- a/Jusin154_Team3D/Client/Private/Monster.cpp +++ b/Jusin154_Team3D/Client/Private/Monster.cpp @@ -121,11 +121,12 @@ void CMonster::Set_DrawOutLine() _bool CMonster::Get_Damage(_float fDamage) { - _bool bDead = m_pStat->Get_Damage(fDamage); - if (true == bDead) { - m_bDead = true; - } - return m_bDead; + return m_pStat->Get_Damage(fDamage); +} + +_float2 CMonster::Get_Hp() +{ + return { m_pStat->Get_Stat(ENUM_CLASS(STAT::HP)), m_pStat->Get_Stat(ENUM_CLASS(STAT::MAXHP)) }; } HRESULT CMonster::Ready_Components(void*pArg) diff --git a/Jusin154_Team3D/Client/Private/MonsterInfo.cpp b/Jusin154_Team3D/Client/Private/MonsterInfo.cpp index 9c617ceaa..51100c7b8 100644 --- a/Jusin154_Team3D/Client/Private/MonsterInfo.cpp +++ b/Jusin154_Team3D/Client/Private/MonsterInfo.cpp @@ -124,7 +124,11 @@ HRESULT CMonsterInfo::Refresh_LockOnMonsters() for (list::iterator iter = m_ActiveMonsters.begin(); iter != m_ActiveMonsters.end(); ++iter) { // (카메라의 룩)과 (카메라 -> 몬스터 방향 벡터)를 내적해서 가장 큰 크기가 나온 몬스타가 락온 대상 - vMonsterPos = (*iter)->Get_WorldPostion(); + CMonster* pMonster = (*iter); + if (pMonster->Get_Hp().x <= 0) { + continue; + } + vMonsterPos = pMonster->Get_WorldPostion(); vToMonsterDir = vMonsterPos - vCameraPos; _float fDotResult = CMyTools::DirectionCompare(vCameraLook, vToMonsterDir); if (fDotResult <= cosf(fFovy)) { @@ -132,13 +136,13 @@ HRESULT CMonsterInfo::Refresh_LockOnMonsters() } if (nullptr == m_pLockOnMonster) { - m_pLockOnMonster = (*iter); + m_pLockOnMonster = pMonster; fMaxDot = fDotResult; continue; } if (fMaxDot < fDotResult) { - m_pLockOnMonster = (*iter); + m_pLockOnMonster = pMonster; fMaxDot = fDotResult; } } diff --git a/Jusin154_Team3D/Client/Private/NomalJap.cpp b/Jusin154_Team3D/Client/Private/NomalJap.cpp index 502405f12..502976a40 100644 --- a/Jusin154_Team3D/Client/Private/NomalJap.cpp +++ b/Jusin154_Team3D/Client/Private/NomalJap.cpp @@ -140,12 +140,18 @@ void CNomalJap::SweepTarget() PSX::PxSweepBuffer pxBuffer = {}; - _bool bHit = m_pGameInstance->SphereCast(0.2f, vStartPos, vDir, fDistance, PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eDYNAMIC, pxBuffer); + _bool bHit = m_pGameInstance->SphereCast(0.002f, vStartPos, vDir, fDistance, PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eDYNAMIC, pxBuffer); if (bHit) { const PSX::PxSweepHit& hit = pxBuffer.block; PSX::PxRigidActor* pActor = hit.actor; PSX::PxShape* pShape = hit.shape; + ON_COLLISION_INFO tagCollInfo = {}; + memcpy_s(&tagCollInfo.vWorldPos, sizeof(tagCollInfo.vWorldPos), &hit.position, sizeof(hit.position)); + memcpy_s(&tagCollInfo.vWorldNomal, sizeof(tagCollInfo.vWorldNomal), &hit.normal, sizeof(hit.normal)); + XMStoreFloat4(&tagCollInfo.vHitDir, vDir); + tagCollInfo.fLength = fDistance; + if (nullptr != pActor && nullptr != pActor->userData) { @@ -158,15 +164,16 @@ void CNomalJap::SweepTarget() switch (PXOBJECT(pUserData->iSubKind)) { case PXOBJECT::MONSTER: + break; case PXOBJECT::GOBLIN_WARRIOR: { - pUserData->pOwner->OnCollision(this); + pUserData->pOwner->OnCollision(this, &tagCollInfo); m_bHit = true; } break; case PXOBJECT::TROLL: { - pUserData->pOwner->OnCollision(this); + pUserData->pOwner->OnCollision(this, &tagCollInfo); m_bHit = true; } break; diff --git a/Jusin154_Team3D/Client/Private/State_Dead.cpp b/Jusin154_Team3D/Client/Private/State_Dead.cpp new file mode 100644 index 000000000..14e11a7ec --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Dead.cpp @@ -0,0 +1,56 @@ +#include "pch.h" +#include "State_Dead.h" +#include "Unit.h" + + +CState_Dead::CState_Dead() + :CState_Root() +{ +} + +void CState_Dead::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Dead::Update(_float fTimeDelta) +{ + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + return S_OK; +} + +void CState_Dead::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Dead::Initialize(STATE_DEAD_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Dead* CState_Dead::Create(STATE_DEAD_DESC* pDesc) +{ + CState_Dead* pInstance = new CState_Dead; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Dead::Free() +{ + __super::Free(); +} + +void CState_Dead::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Public/Goblin.h b/Jusin154_Team3D/Client/Public/Goblin.h index e70a6b496..3e467c587 100644 --- a/Jusin154_Team3D/Client/Public/Goblin.h +++ b/Jusin154_Team3D/Client/Public/Goblin.h @@ -67,7 +67,6 @@ class CGoblin final : public CMonster _float m_fTpTime = {}; _float m_fAirTime = {}; - void Behavior_IdleEnter(); HRESULT Behavior_IdleExitCheck(); void Behavior_IdleExit(); @@ -96,6 +95,10 @@ class CGoblin final : public CMonster void Behavior_HitEnter(); HRESULT Behavior_HitExitCheck(_float fTimeDelta); void Behavior_HitExit(); + + void Behavior_DeadEnter(); + HRESULT Behavior_DeadExitCheck(_float fTimeDelta); + void Behavior_DeadExit(); }; NS_END diff --git a/Jusin154_Team3D/Client/Public/Monster.h b/Jusin154_Team3D/Client/Public/Monster.h index afe73145d..84679bd8d 100644 --- a/Jusin154_Team3D/Client/Public/Monster.h +++ b/Jusin154_Team3D/Client/Public/Monster.h @@ -20,6 +20,7 @@ class CMonster abstract : public CUnit virtual void Set_DrawOutLine(); _float4 Get_TargetPos() { return m_vTargetPos; } virtual _bool Get_Damage(_float fDamage); + virtual _float2 Get_Hp(); protected: CInfoInstance* m_pInfoInstance = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/State_Dead.h b/Jusin154_Team3D/Client/Public/State_Dead.h new file mode 100644 index 000000000..5dea32e2b --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Dead.h @@ -0,0 +1,31 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CState_Dead final : public CState_Root +{ +public: + typedef struct tagLand : public CState_Root::STATE_ROOT_DESC { + + }STATE_DEAD_DESC; +private: + CState_Dead(); + virtual ~CState_Dead() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + HRESULT Initialize(STATE_DEAD_DESC* pDesc); + +public: + static CState_Dead* Create(STATE_DEAD_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_HitReport.cpp b/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_HitReport.cpp index f4d5a5677..0a66d2d34 100644 --- a/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_HitReport.cpp +++ b/Jusin154_Team3D/Editor/Private/CallBack_EffectHitBox_HitReport.cpp @@ -45,8 +45,7 @@ void CCallBack_EffectHitBox_HitReport::onShapeHit(const PSX::PxControllerShapeHi /* OnCollision 함수에 넘길 값 */ - - CollisionDesc.vWorldPos = XMVectorSet( (_float)vWorldPos.x, (_float)vWorldPos.y, (_float)vWorldPos.z, 1.f); + CollisionDesc.vWorldPos = { (_float)vWorldPos.x, (_float)vWorldPos.y, (_float)vWorldPos.z, 1.f }; memcpy(&CollisionDesc.vWorldNomal, &vWorldNormal, sizeof(_float3)); memcpy(&CollisionDesc.vHitDir, &vDir, sizeof(_float3)); CollisionDesc.fLength = fLength; diff --git a/Jusin154_Team3D/Engine/Public/Engine_Struct.h b/Jusin154_Team3D/Engine/Public/Engine_Struct.h index fc083eb5b..9d6a54f57 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Struct.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Struct.h @@ -24,9 +24,9 @@ typedef struct tagModelDesc { typedef struct tagKeyFrame { - XMFLOAT3 vScale = {}; - XMFLOAT4 vRotation = {}; - XMFLOAT3 vTranslation = {}; + _float3 vScale = {}; + _float4 vRotation = {}; + _float3 vTranslation = {}; _float fTrackPosition = {}; }KEYFRAME; @@ -43,8 +43,8 @@ typedef struct tagLightDesc _float4 vAmbient = {}; _float4 vSpecular = {}; - const XMFLOAT4* pDirection = nullptr; - const XMFLOAT4* pPosition = nullptr; + const _float4* pDirection = nullptr; + const _float4* pPosition = nullptr; _float4 vPosOffset = {}; @@ -62,18 +62,18 @@ typedef struct tagShadowLight struct SaveVertex { - XMFLOAT3 Pos; - XMFLOAT3 Normal; - XMFLOAT3 Tan; - XMFLOAT3 BiNoraml; - XMFLOAT2 UV; + _float3 Pos; + _float3 Normal; + _float3 Tan; + _float3 BiNoraml; + _float2 UV; bool bHasNormal; bool bHasTan; bool bHasUV; XMUINT4 BlendIndex; - XMFLOAT4 BlendWeight; + _float4 BlendWeight; }; struct SaveBoneWeight @@ -129,13 +129,13 @@ struct SaveMaterial struct SaveKeyFrameVec { float Time; - XMFLOAT3 Value; + _float3 Value; }; struct SaveKeyFrameRotation { float Time; - XMFLOAT4 Value; + _float4 Value; }; struct SaveChannel @@ -396,9 +396,9 @@ typedef struct tagPhsXUserData { typedef struct tagOnCollsionInfo { - _vector vWorldPos = {}; // 접촉지점 - _vector vWorldNomal = {}; // 접촉노말 - _vector vHitDir = {}; // 시도한 move 방향 + _float4 vWorldPos = {}; // 접촉지점 + _float4 vWorldNomal = {}; // 접촉노말 + _float4 vHitDir = {}; // 시도한 move 방향 _float fLength = {}; // 작용된 힘 }ON_COLLISION_INFO; diff --git a/Jusin154_Team3D/Engine/Public/FSM.h b/Jusin154_Team3D/Engine/Public/FSM.h index a889c479b..48cec542c 100644 --- a/Jusin154_Team3D/Engine/Public/FSM.h +++ b/Jusin154_Team3D/Engine/Public/FSM.h @@ -33,6 +33,7 @@ enum ESTATE : _u64Flag SWING = 1ULL << 26, SLAM = 1ULL << 27, BLINK = 1ULL << 28, + DEAD = 1ULL << 29, END }; NS_END diff --git a/Jusin154_Team3D/Engine/Public/MyTools.h b/Jusin154_Team3D/Engine/Public/MyTools.h index a5e8e0cfc..16166d7f0 100644 --- a/Jusin154_Team3D/Engine/Public/MyTools.h +++ b/Jusin154_Team3D/Engine/Public/MyTools.h @@ -202,7 +202,8 @@ class CMyTools { // 2D 평면에 사상된 방향을 교정해서 리턴 // float -> Radian값 - // -, + + // - 시계방향 + // + 반시계방향 inline static _float Get_Direction2D(_float2 vOrigianlDir, _float2 vInputDir) { _vector vOriginal = XMVector2Normalize(XMLoadFloat2(&vOrigianlDir)); _vector vInput = XMVector2Normalize(XMLoadFloat2(&vInputDir)); @@ -212,6 +213,15 @@ class CMyTools { return fDiffAngle * (fCross < 0 ? -1.f : 1.f); } + inline static _float Get_Direction2D(_vector vOriginalDir, _vector vInputDir) { + _vector vOriginal = XMVector2Normalize(XMVectorSet(XMVectorGetX(vOriginalDir), XMVectorGetZ(vOriginalDir), 0.f, 0.f)); + _vector vInput = XMVector2Normalize(XMVectorSet(XMVectorGetX(vInputDir), XMVectorGetZ(vInputDir), 0.f, 0.f)); + + _float fDiffAngle = XMVectorGetX(XMVector2AngleBetweenNormals(vOriginal, vInput)); + _float fCross = XMVectorGetZ(XMVector2Cross(vOriginal, vInput)); + + return fDiffAngle * (fCross < 0 ? -1.f : 1.f); + } // yaw 360도 자동 커트 // pitch 80도 클램프 inline static void AdjustAccumulateDegreePitchYawDegree(_float2& vAccumulateDegreePitchYaw, float fPitchLimitDegree = 80.f) diff --git a/Jusin154_Team3D/Engine/Public/Unit.h b/Jusin154_Team3D/Engine/Public/Unit.h index 919e65f5d..fd9a2fad5 100644 --- a/Jusin154_Team3D/Engine/Public/Unit.h +++ b/Jusin154_Team3D/Engine/Public/Unit.h @@ -76,6 +76,7 @@ class ENGINE_DLL CUnit abstract : public CContainerObject _int m_eSpell = { }; _int m_eHitSpell = {}; + _float m_fHitRadius = {}; vector m_PendingEvents; From ed7c14df7b19dbdc1f4c63fb0458671131a38935 Mon Sep 17 00:00:00 2001 From: kimnuri Date: Sun, 7 Dec 2025 22:20:08 +0900 Subject: [PATCH 6/6] [add] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 뼈추가 --- .../Models/Object/SubTroll_Weapon/SK_WPN_Troll_Club07.fbx | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Models/Object/SubTroll_Weapon/SK_WPN_Troll_Club07.fbx diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/SubTroll_Weapon/SK_WPN_Troll_Club07.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/SubTroll_Weapon/SK_WPN_Troll_Club07.fbx new file mode 100644 index 000000000..b54f244d7 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/SubTroll_Weapon/SK_WPN_Troll_Club07.fbx @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3f2e069a3ea89e68f5658fc88633e5c9032f7c14eeb632357d83e989da32024 +size 113708