Merge branch 'Develope' into Bloom
This commit is contained in:
@@ -159,6 +159,7 @@
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Public\Bombard.h" />
|
||||
<ClInclude Include="..\Public\Broom.h" />
|
||||
<ClInclude Include="..\public\BuildingContainer.h" />
|
||||
<ClInclude Include="..\Public\CallBack_EffectHitBox_Behavior.h" />
|
||||
<ClInclude Include="..\Public\CallBack_EffectHitBox_HitReport.h" />
|
||||
<ClInclude Include="..\Public\CallBack_Monster_Behavior.h" />
|
||||
@@ -175,7 +176,12 @@
|
||||
<ClInclude Include="..\Public\Client_Define.h" />
|
||||
<ClInclude Include="..\Public\Client_Enum.h" />
|
||||
<ClInclude Include="..\Public\Client_Macro.h" />
|
||||
<ClInclude Include="..\Public\Client_Struct.h" />
|
||||
<ClInclude Include="..\Public\Goblin.h" />
|
||||
<ClInclude Include="..\public\MapContainer.h" />
|
||||
<ClInclude Include="..\public\MapObject_Collision.h" />
|
||||
<ClInclude Include="..\public\MapObject_Render.h" />
|
||||
<ClInclude Include="..\public\MapPartObject.h" />
|
||||
<ClInclude Include="..\Public\Monster.h" />
|
||||
<ClInclude Include="..\Public\PhysXEffectHitBox.h" />
|
||||
<ClInclude Include="..\Public\Dummy_PhysXPlayable.h" />
|
||||
@@ -205,6 +211,7 @@
|
||||
<ClInclude Include="..\Public\State_Land.h" />
|
||||
<ClInclude Include="..\Public\State_Move.h" />
|
||||
<ClInclude Include="..\Public\State_Root.h" />
|
||||
<ClInclude Include="..\public\Terrain.h" />
|
||||
<ClInclude Include="..\Public\TrailObject.h" />
|
||||
<ClInclude Include="..\Public\Wand.h" />
|
||||
<ClInclude Include="Client.h" />
|
||||
@@ -215,6 +222,7 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Private\Bombard.cpp" />
|
||||
<ClCompile Include="..\Private\Broom.cpp" />
|
||||
<ClCompile Include="..\private\BuildingContainer.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_EffectHitBox_Behavior.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_EffectHitBox_HitReport.cpp" />
|
||||
<ClCompile Include="..\Private\CallBack_Monster_Behavior.cpp" />
|
||||
@@ -227,6 +235,10 @@
|
||||
<ClCompile Include="..\Private\CamPosition_Arm.cpp" />
|
||||
<ClCompile Include="..\Private\Goblin.cpp" />
|
||||
<ClCompile Include="..\Private\Goblin_States.cpp" />
|
||||
<ClCompile Include="..\private\MapContainer.cpp" />
|
||||
<ClCompile Include="..\private\MapObject_Collision.cpp" />
|
||||
<ClCompile Include="..\private\MapObject_Render.cpp" />
|
||||
<ClCompile Include="..\private\MapPartObject.cpp" />
|
||||
<ClCompile Include="..\Private\Monster.cpp" />
|
||||
<ClCompile Include="..\Private\PhysXEffectHitBox.cpp" />
|
||||
<ClCompile Include="..\Private\CamPosition_Shoulder.cpp" />
|
||||
@@ -264,6 +276,7 @@
|
||||
<ClCompile Include="..\Private\State_Land.cpp" />
|
||||
<ClCompile Include="..\Private\State_Move.cpp" />
|
||||
<ClCompile Include="..\Private\State_Root.cpp" />
|
||||
<ClCompile Include="..\private\Terrain.cpp" />
|
||||
<ClCompile Include="..\Private\TrailObject.cpp" />
|
||||
<ClCompile Include="..\Private\Wand.cpp" />
|
||||
<ClCompile Include="Client.cpp" />
|
||||
|
||||
@@ -163,6 +163,27 @@
|
||||
<ClInclude Include="..\Public\Monster.h">
|
||||
<Filter>02.GameObjects\Monster</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\MapContainer.h">
|
||||
<Filter>02.GameObjects\Environment\00.MapContainer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\BuildingContainer.h">
|
||||
<Filter>02.GameObjects\Environment\00.MapContainer\BuildingContainer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\MapPartObject.h">
|
||||
<Filter>02.GameObjects\Environment\01.MapPartObject</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Client_Struct.h">
|
||||
<Filter>99.Define</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\MapObject_Collision.h">
|
||||
<Filter>02.GameObjects\Environment\01.MapPartObject\Collision</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\MapObject_Render.h">
|
||||
<Filter>02.GameObjects\Environment\01.MapPartObject\MapObject_Render</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\Terrain.h">
|
||||
<Filter>02.GameObjects\Environment\Terrain</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Client.ico">
|
||||
@@ -401,6 +422,24 @@
|
||||
<Filter Include="02.GameObjects\Monster\Goblin">
|
||||
<UniqueIdentifier>{1ff3d6f1-f31d-47b7-84b7-d23efe98d7d2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\00.MapContainer">
|
||||
<UniqueIdentifier>{e2d84a8f-46c9-4689-bd91-cc45343d2b10}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\00.MapContainer\BuildingContainer">
|
||||
<UniqueIdentifier>{cd65118d-1ab2-4636-a57c-eb8e42c7d88b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\01.MapPartObject">
|
||||
<UniqueIdentifier>{6012da88-b0d8-4cd1-8e56-8638f3e899b1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\01.MapPartObject\Collision">
|
||||
<UniqueIdentifier>{6a873b22-5d8b-455f-b632-45fde44a1dd8}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\01.MapPartObject\MapObject_Render">
|
||||
<UniqueIdentifier>{2521a788-0b04-48f3-8efc-5198b2c51650}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\Terrain">
|
||||
<UniqueIdentifier>{7db61780-d774-4a91-a429-2fb7634e43b3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Client.cpp">
|
||||
@@ -556,6 +595,24 @@
|
||||
<ClCompile Include="..\Private\Monster.cpp">
|
||||
<Filter>02.GameObjects\Monster</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\MapContainer.cpp">
|
||||
<Filter>02.GameObjects\Environment\00.MapContainer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\BuildingContainer.cpp">
|
||||
<Filter>02.GameObjects\Environment\00.MapContainer\BuildingContainer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\MapPartObject.cpp">
|
||||
<Filter>02.GameObjects\Environment\01.MapPartObject</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\MapObject_Collision.cpp">
|
||||
<Filter>02.GameObjects\Environment\01.MapPartObject\Collision</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\MapObject_Render.cpp">
|
||||
<Filter>02.GameObjects\Environment\01.MapPartObject\MapObject_Render</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\Terrain.cpp">
|
||||
<Filter>02.GameObjects\Environment\Terrain</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Client.rc">
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
#include "pch.h"
|
||||
#include "BuildingContainer.h"
|
||||
#include "PartObject.h"
|
||||
//#include "Terrain.h"
|
||||
//#include "Layer.h"
|
||||
//#include "VIBuffer_Terrain.h"
|
||||
|
||||
CBuildingContainer::CBuildingContainer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CMapContainer(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CBuildingContainer::CBuildingContainer(const CBuildingContainer& rhs)
|
||||
:CMapContainer(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
void CBuildingContainer::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
|
||||
for (auto& pCollisiton : m_ColiisonPartObjects)
|
||||
pCollisiton->Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CBuildingContainer::Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Update(fTimeDelta);
|
||||
|
||||
for (auto& pCollisiton : m_ColiisonPartObjects)
|
||||
pCollisiton->Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CBuildingContainer::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Late_Update(fTimeDelta);
|
||||
|
||||
for (auto& pCollisiton : m_ColiisonPartObjects)
|
||||
pCollisiton->Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
HRESULT CBuildingContainer::Render()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CBuildingContainer::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CBuildingContainer::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
MAP_CONTAINER_DESC* pDesc = static_cast<MAP_CONTAINER_DESC*>(pArg);
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPosition), 1.f));
|
||||
m_pTransformCom->Set_Scale(pDesc->vScale);
|
||||
m_pTransformCom->Rotation(XMConvertToRadians(pDesc->vRotation.x), XMConvertToRadians(pDesc->vRotation.y), XMConvertToRadians(pDesc->vRotation.z));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CBuildingContainer::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CBuildingContainer::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CBuildingContainer* CBuildingContainer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CBuildingContainer* pInstance = new CBuildingContainer(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CBuildingContainer");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CBuildingContainer::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CBuildingContainer* pInstance = new CBuildingContainer(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CBuildingContainer");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CBuildingContainer::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
for (auto& pCollision : m_ColiisonPartObjects)
|
||||
SAFE_RELEASE(pCollision);
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CBuildingContainer::Describe_Entity()
|
||||
{
|
||||
|
||||
}
|
||||
#endif
|
||||
@@ -17,6 +17,11 @@ void CInfoInstance::Update(_float fTimeDelta)
|
||||
|
||||
}
|
||||
|
||||
HRESULT CInfoInstance::Load_MapObjects(const _char* pFilePath)
|
||||
{
|
||||
return m_pMapInfo->Load_MapObjects(pFilePath);
|
||||
}
|
||||
|
||||
LEVEL CInfoInstance::Get_RestartLevel()
|
||||
{
|
||||
return LEVEL::GAMEPLAY;
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "Dummy_PhysXWall.h"
|
||||
#include "Dummy_PhysXPlayable.h"
|
||||
#include "Goblin.h"
|
||||
#include "Terrain.h"
|
||||
|
||||
CLevel_GamePlay::CLevel_GamePlay(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
||||
@@ -26,6 +27,9 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg)
|
||||
if (FAILED(Ready_Lights())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Ready_Background())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Ready_Markers())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -82,6 +86,24 @@ HRESULT CLevel_GamePlay::Ready_Lights()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Background()
|
||||
{
|
||||
/* Terrain */
|
||||
CTerrain::TERRAIN_DESC Terrain_Desc = {};
|
||||
Terrain_Desc.vPosition = _float3(-194, 18.5f, -153.f);
|
||||
Terrain_Desc.strDiffuseTextureTag = TEXT("Terrain_Diffuse");
|
||||
Terrain_Desc.strNormalTextureTag = TEXT("Terrain_Normal");
|
||||
Terrain_Desc.strMROTextureTag = TEXT("Terrain_MRO");
|
||||
Terrain_Desc.strAlphaMapTextureTag = TEXT("HogsmeadeAlphaMap");
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTerrain>(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_BACKGROUND, &Terrain_Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CInfoInstance::GetInstance()->Load_MapObjects("ClientTest");
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_GamePlay::Ready_Layer_UI(const _wstring& strLayerTag)
|
||||
{
|
||||
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGamePlay_Canvas>(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_UI))) {
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
#include "MainApp.h"
|
||||
#include "Light_Main.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "Client_Struct.h"
|
||||
#include "Model.h"
|
||||
//#include "GamePlay_Canvas.h"
|
||||
//#include "Loading_Panel.h"
|
||||
//#include "LoadingWidget.h"
|
||||
@@ -37,6 +39,17 @@
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region MAP
|
||||
|
||||
#include "Terrain.h"
|
||||
#include "VIBuffer_Terrain.h"
|
||||
#include "BuildingContainer.h"
|
||||
#include "MapObject_Render.h"
|
||||
#include "MapObject_Collision.h"
|
||||
|
||||
#pragma endregion
|
||||
|
||||
|
||||
CLoader::CLoader(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: m_pDevice{ pDevice }
|
||||
, m_pContext{ pContext }
|
||||
@@ -146,6 +159,29 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
#pragma region TERRAIN_TEXTURE
|
||||
/* Terrain_Diffuse */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_Diffuse"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_D_%d.dds"), 4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
/* Terrain_Normal */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_Normal"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_N_%d.dds"), 4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
/* Terrain_MRO */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Terrain_MRO"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Terrain/Terrain_MRO_%d.dds"), 4)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
/* Terrain_AlphaMap */
|
||||
if(FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("HogsmeadeAlphaMap"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Terrain/Hogsmeade_AlphaMap.dds"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
|
||||
Asset_FileLoad("../Bin/Resources/Textures/Effect/Noises", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath) {
|
||||
|
||||
@@ -226,6 +262,12 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_NORTEX,
|
||||
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxNorTex.hlsl"),
|
||||
VTXNORTEX::Elements, VTXNORTEX::iNumElements)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strMessage = TEXT("모델를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다.");
|
||||
@@ -281,7 +323,7 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Wand_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixIdentity()))))
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity()))))
|
||||
|
||||
return E_FAIL;
|
||||
|
||||
@@ -355,6 +397,77 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
|
||||
});
|
||||
|
||||
#pragma region MAP_MODELS
|
||||
vector<future<void>> jobFutures;
|
||||
|
||||
_uint iLoadCount = 5;
|
||||
vector<vector<FOLDER_LOAD*>*> Contents(iLoadCount);
|
||||
|
||||
{ /* Terrain */
|
||||
jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/Terrain",
|
||||
".bin", false,
|
||||
&Contents[jobFutures.size()]
|
||||
));
|
||||
jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Terrain",
|
||||
".bin", false,
|
||||
&Contents[jobFutures.size()]
|
||||
));
|
||||
}
|
||||
|
||||
{ /* Ollivanders*/
|
||||
jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Meshes",
|
||||
".bin", false,
|
||||
&Contents[jobFutures.size()]
|
||||
));
|
||||
jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Ollivanders/Collision",
|
||||
".bin", false,
|
||||
&Contents[jobFutures.size()]
|
||||
));
|
||||
}
|
||||
|
||||
{ /* Gatehouse*/
|
||||
jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
"../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Gatehouse/Meshes",
|
||||
".bin", false,
|
||||
&Contents[jobFutures.size()]
|
||||
));
|
||||
}
|
||||
|
||||
for (auto& jobFuture : jobFutures)
|
||||
{
|
||||
jobFuture.get();
|
||||
}
|
||||
|
||||
for (_uint i = 0; i < Contents.size(); ++i) {
|
||||
for (_uint j = 0; j < (Contents[i])->size(); ++j) {
|
||||
FOLDER_LOAD* pContents = (*Contents[i])[j];
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pModelTag, pContents->pLoadedModel))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
for (_uint k = 0; k < pContents->pRigidBodyTags.size(); ++k) {
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pContents->pRigidBodyTags[k], pContents->LoadedRigidBody[k]))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
for (_uint i = 0; i < Contents.size(); ++i) {
|
||||
for (_uint j = 0; j < (Contents[i])->size(); ++j) {
|
||||
Safe_Delete((*Contents[i])[j]);
|
||||
}
|
||||
Safe_Delete(Contents[i]);
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
|
||||
|
||||
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
|
||||
|
||||
//if (FAILED(m_pGameInstance->Add_Prototype<CGamePlay_Canvas>(g_iStaticLevel, CGamePlay_Canvas::Create(m_pDevice, m_pContext)))) {
|
||||
@@ -371,6 +484,27 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CSkyBox>(g_iStaticLevel, CSkyBox::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Terrain */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Terrain"),
|
||||
CVIBuffer_Terrain::Create(m_pDevice, m_pContext, "Hogsmeade_HeightMap.bin", 512, 512))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_Terrain */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CTerrain>(g_iStaticLevel, CTerrain::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_CBuildingContainer */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CBuildingContainer>(g_iStaticLevel, CBuildingContainer::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_CMapObject_Render */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_Render>(g_iStaticLevel, CMapObject_Render::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_CMapObject_Collision */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_Collision>(g_iStaticLevel, CMapObject_Collision::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_FSM */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CFSM>(g_iStaticLevel, CFSM::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
@@ -501,6 +635,85 @@ HRESULT CLoader::Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreN
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void APIENTRY Deferred_FolderLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector<FOLDER_LOAD*>** OutContents)
|
||||
{
|
||||
if (FAILED(CoInitializeEx(nullptr, 0))) {
|
||||
return;
|
||||
}
|
||||
|
||||
*OutContents = new vector<FOLDER_LOAD*>;
|
||||
for (const auto& file : filesystem::directory_iterator(pDirectoryPath))
|
||||
{
|
||||
if (file.is_directory()) { continue; }
|
||||
if (strcmp(file.path().extension().string().c_str(), pFileExt)) { continue; }
|
||||
|
||||
FOLDER_LOAD* pContents = new FOLDER_LOAD;
|
||||
pContents->bLoadTags = bUseTag;
|
||||
{ // FOLDER_LOAD
|
||||
_char szFilePath[MAX_PATH] = {};
|
||||
strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str());
|
||||
|
||||
_wstring wstrFileName = L"Prototype_GameObject_" + file.path().stem().wstring();
|
||||
|
||||
CModel* pModel = CModel::Create(pDevice, pContext, MODEL::ENVIROMENT, szFilePath);
|
||||
|
||||
_uint iNumMesh = pModel->Get_NumMeshes();
|
||||
|
||||
{
|
||||
pContents->pModelTag = wstrFileName;
|
||||
pContents->pathModel = file.path();
|
||||
|
||||
pContents->pLoadedModel = pModel;
|
||||
|
||||
pContents->pRigidBodyTags.reserve(iNumMesh);
|
||||
pContents->LoadedRigidBody.reserve(iNumMesh);
|
||||
}
|
||||
|
||||
CRigidBody_Static::RIGIDBODY_STATIC_PROTOTYPEDESC Desc{};
|
||||
for (_uint i = 0; i < iNumMesh; ++i) {
|
||||
{
|
||||
Desc.eType = ACTOR::TRIANGLEMESH;
|
||||
Desc.ePxRigidBodyFlags = {};
|
||||
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;
|
||||
}
|
||||
pContents->pRigidBodyTags.emplace_back(CMyTools::ToWstring(pModel->Get_MeshName(i) + to_string(i)).c_str());
|
||||
pContents->LoadedRigidBody.emplace_back(CRigidBody_Static::Create(pDevice, pContext, Desc));
|
||||
}
|
||||
}
|
||||
(*OutContents)->emplace_back(pContents);
|
||||
}
|
||||
(*OutContents)->shrink_to_fit();
|
||||
|
||||
CoUninitialize();
|
||||
return;
|
||||
}
|
||||
|
||||
future<void> CLoader::Deferred_FolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector<FOLDER_LOAD*>** OutContents)
|
||||
{
|
||||
return m_pGameInstance->EnqueueJob(&Deferred_FolderLoad_Main, m_pDevice, m_pContext, pDirectoryPath, pFileExt, bUseTag, OutContents);
|
||||
}
|
||||
|
||||
pair<_wstring, CModel*>* APIENTRY Deferred_ModelLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const _char* pDirectoryPath, const _tchar* pPrototypeTag, _fmatrix PreTransform)
|
||||
{
|
||||
if (FAILED(CoInitializeEx(nullptr, 0))) {
|
||||
assert(false);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CModel* pModel = CModel::Create(pDevice, pContext, eType, pDirectoryPath, PreTransform);
|
||||
|
||||
CoUninitialize();
|
||||
pair<_wstring, CModel*>* Out = new pair<_wstring, CModel*>(pPrototypeTag, pModel);
|
||||
return Out;
|
||||
}
|
||||
|
||||
future<pair<_wstring, CModel*>*> CLoader::Deferred_ModelLoad(MODEL eType, const _char* pDirectoryPath, _fmatrix PreTransform, const _tchar* pPrototypeTag) {
|
||||
return m_pGameInstance->EnqueueJob(&Deferred_ModelLoad_Main, m_pDevice, m_pContext, eType, pDirectoryPath, pPrototypeTag, PreTransform);
|
||||
}
|
||||
|
||||
CLoader* CLoader::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID)
|
||||
{
|
||||
CLoader* pInstance = new CLoader(pDevice, pContext);
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
#include "pch.h"
|
||||
#include "MapContainer.h"
|
||||
#include "PartObject.h"
|
||||
|
||||
//#include "MapObject_LOD.h"
|
||||
|
||||
CMapContainer::CMapContainer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
:CContainerObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CMapContainer::CMapContainer(const CMapContainer& rhs)
|
||||
:CContainerObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CMapContainer::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapContainer::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapContainer::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMapContainer::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CMapContainer::Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CMapContainer::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
HRESULT CMapContainer::Render()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMapContainer::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
@@ -2,6 +2,10 @@
|
||||
#include "MapInfo.h"
|
||||
#include "GameInstance.h"
|
||||
#include "InfoInstance.h"
|
||||
#include "BuildingContainer.h"
|
||||
#include "MAPPartObject.h"
|
||||
#include "MapObject_Render.h"
|
||||
#include "MapObject_Collision.h"
|
||||
|
||||
CMapInfo::CMapInfo()
|
||||
{
|
||||
@@ -11,6 +15,188 @@ void CMapInfo::Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CMapInfo::Load_MapObjects(const _char* pFileName)
|
||||
{
|
||||
tinyxml2::XMLDocument xmlDoc;
|
||||
|
||||
string strPath = "../Bin/Resources/Data/Map/" + string(pFileName) + ".xml";
|
||||
|
||||
if ((tinyxml2::XML_SUCCESS != xmlDoc.LoadFile(strPath.c_str())))
|
||||
return E_FAIL;
|
||||
|
||||
tinyxml2::XMLElement* root = xmlDoc.FirstChildElement("Land");
|
||||
|
||||
if (nullptr == root)
|
||||
{
|
||||
MSG_BOX("Failed to Find root");
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/* Container */
|
||||
for (auto* Container = root->FirstChildElement("Container"); Container; Container = Container->NextSiblingElement("Container"))
|
||||
{
|
||||
const _char* pName = {};
|
||||
|
||||
Container->QueryStringAttribute("Name", &pName);
|
||||
#pragma region ADD_CONTAINER_OBJECT
|
||||
|
||||
CBuildingContainer* pContainerObject = { nullptr };
|
||||
CMapContainer::MAP_CONTAINER_DESC ContainerDesc = {};
|
||||
|
||||
auto* ContainerPosition = Container->FirstChildElement("Position");
|
||||
ContainerPosition->QueryFloatAttribute("x", &ContainerDesc.vPosition.x);
|
||||
ContainerPosition->QueryFloatAttribute("y", &ContainerDesc.vPosition.y);
|
||||
ContainerPosition->QueryFloatAttribute("z", &ContainerDesc.vPosition.z);
|
||||
|
||||
auto* ContainerScale = Container->FirstChildElement("Scale");
|
||||
ContainerScale->QueryFloatAttribute("x", &ContainerDesc.vScale.x);
|
||||
ContainerScale->QueryFloatAttribute("y", &ContainerDesc.vScale.y);
|
||||
ContainerScale->QueryFloatAttribute("z", &ContainerDesc.vScale.z);
|
||||
|
||||
auto* ContainerRotation = Container->FirstChildElement("Rotation");
|
||||
ContainerRotation->QueryFloatAttribute("x", &ContainerDesc.vRotation.x);
|
||||
ContainerRotation->QueryFloatAttribute("y", &ContainerDesc.vRotation.y);
|
||||
ContainerRotation->QueryFloatAttribute("z", &ContainerDesc.vRotation.z);
|
||||
|
||||
m_pGameInstance->Add_GameObject_ToLayer<CBuildingContainer>(
|
||||
g_iStaticLevel, ENUM_CLASS(LEVEL::GAMEPLAY), LAYER_BACKGROUND, &ContainerDesc, nullptr, &pContainerObject);
|
||||
#pragma endregion
|
||||
|
||||
#pragma region ADD_PARTOBJECT
|
||||
for (auto* PartObject = Container->FirstChildElement("PartObject"); PartObject; PartObject = PartObject->NextSiblingElement("PartObject"))
|
||||
{
|
||||
_uint iLodLevel = {};
|
||||
_uint iKeyIndex = {};
|
||||
|
||||
PartObject->QueryUnsignedAttribute("Lod_Level", &iLodLevel);
|
||||
PartObject->QueryUnsignedAttribute("Key_Index", &iKeyIndex);
|
||||
|
||||
#pragma region MAPOBJECT_RENDER
|
||||
CMapPartObject::MAPOBJECT_DESC Desc = {};
|
||||
string strTag = {};
|
||||
for (auto* PrototypeTag = PartObject->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
|
||||
{
|
||||
strTag = PrototypeTag->GetText();
|
||||
|
||||
Desc.ModelPrototypeTags.push_back(CMyTools::ToWstring(strTag));
|
||||
}
|
||||
|
||||
Desc.iMaxLodLevel = iLodLevel;
|
||||
Desc.pParentTransform = pContainerObject->Get_Component<CTransform>();
|
||||
const string strKey = CMyTools::ToString(Desc.ModelPrototypeTags.front()) + to_string(iKeyIndex);
|
||||
|
||||
/* Position */
|
||||
tinyxml2::XMLElement* Position = PartObject->FirstChildElement("Position");
|
||||
Position->QueryFloatAttribute("x", &Desc.vPosition.x);
|
||||
Position->QueryFloatAttribute("y", &Desc.vPosition.y);
|
||||
Position->QueryFloatAttribute("z", &Desc.vPosition.z);
|
||||
|
||||
/* Scale */
|
||||
tinyxml2::XMLElement* Scale = PartObject->FirstChildElement("Scale");
|
||||
Scale->QueryFloatAttribute("x", &Desc.vScale.x);
|
||||
Scale->QueryFloatAttribute("y", &Desc.vScale.y);
|
||||
Scale->QueryFloatAttribute("z", &Desc.vScale.z);
|
||||
|
||||
/* Rotation */
|
||||
tinyxml2::XMLElement* Rotation = PartObject->FirstChildElement("Rotation");
|
||||
Rotation->QueryFloatAttribute("x", &Desc.vRotation.x);
|
||||
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
|
||||
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
|
||||
|
||||
if (FAILED(pContainerObject->Add_Part<CMapObject_Render>(strKey, g_iStaticLevel, nullptr, &Desc)))
|
||||
return E_FAIL;
|
||||
|
||||
#pragma endregion
|
||||
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region ADD_COLLISION
|
||||
for (auto* Collision = Container->FirstChildElement("Collision"); Collision; Collision = Collision->NextSiblingElement("Collision"))
|
||||
{
|
||||
_uint iLodLevel = {};
|
||||
_uint iKeyIndex = {};
|
||||
|
||||
Collision->QueryUnsignedAttribute("Lod_Level", &iLodLevel);
|
||||
Collision->QueryUnsignedAttribute("Key_Index", &iKeyIndex);
|
||||
|
||||
#pragma region MAPOBJECT_LOD
|
||||
CMapPartObject::MAPOBJECT_DESC Desc = {};
|
||||
string strTag = {};
|
||||
for (auto* PrototypeTag = Collision->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
|
||||
{
|
||||
Desc.ModelPrototypeTags.push_back(CMyTools::ToWstring(PrototypeTag->GetText()));
|
||||
}
|
||||
Desc.iMaxLodLevel = iLodLevel;
|
||||
Desc.pParentTransform = pContainerObject->Get_Component<CTransform>();
|
||||
|
||||
/* Position */
|
||||
tinyxml2::XMLElement* Position = Collision->FirstChildElement("Position");
|
||||
Position->QueryFloatAttribute("x", &Desc.vPosition.x);
|
||||
Position->QueryFloatAttribute("y", &Desc.vPosition.y);
|
||||
Position->QueryFloatAttribute("z", &Desc.vPosition.z);
|
||||
|
||||
/* Scale */
|
||||
tinyxml2::XMLElement* Scale = Collision->FirstChildElement("Scale");
|
||||
Scale->QueryFloatAttribute("x", &Desc.vScale.x);
|
||||
Scale->QueryFloatAttribute("y", &Desc.vScale.y);
|
||||
Scale->QueryFloatAttribute("z", &Desc.vScale.z);
|
||||
|
||||
/* Rotation */
|
||||
tinyxml2::XMLElement* Rotation = Collision->FirstChildElement("Rotation");
|
||||
Rotation->QueryFloatAttribute("x", &Desc.vRotation.x);
|
||||
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
|
||||
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
|
||||
|
||||
pContainerObject->Add_Collision<CMapObject_Collision>(g_iStaticLevel, &Desc);
|
||||
#pragma endregion
|
||||
|
||||
}
|
||||
#pragma endregion
|
||||
}
|
||||
|
||||
for (auto* Object = root->FirstChildElement("Object"); Object; Object = Object->NextSiblingElement("Object"))
|
||||
{
|
||||
CMapPartObject::MAPOBJECT_DESC Desc = {};
|
||||
|
||||
MAPOBJECT_TYPE eType = {};
|
||||
|
||||
Object->QueryUnsignedAttribute("Type", (_uint*)(&eType));
|
||||
Object->QueryUnsignedAttribute("Lod_Level", &Desc.iMaxLodLevel);
|
||||
|
||||
auto* Position = Object->FirstChildElement("Position");
|
||||
Position->QueryFloatAttribute("x", &Desc.vPosition.x);
|
||||
Position->QueryFloatAttribute("y", &Desc.vPosition.y);
|
||||
Position->QueryFloatAttribute("z", &Desc.vPosition.z);
|
||||
|
||||
auto* Scale = Object->FirstChildElement("Scale");
|
||||
Scale->QueryFloatAttribute("x", &Desc.vScale.x);
|
||||
Scale->QueryFloatAttribute("y", &Desc.vScale.y);
|
||||
Scale->QueryFloatAttribute("z", &Desc.vScale.z);
|
||||
|
||||
auto* Rotation = Object->FirstChildElement("Rotation");
|
||||
Rotation->QueryFloatAttribute("x", &Desc.vRotation.x);
|
||||
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
|
||||
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
|
||||
|
||||
string strTag = {};
|
||||
|
||||
for (auto* PrototypeTag = Object->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
|
||||
{
|
||||
strTag = PrototypeTag->GetText();
|
||||
|
||||
Desc.ModelPrototypeTags.push_back(CMyTools::ToWstring(strTag));
|
||||
}
|
||||
|
||||
/*if (MAPOBJECT_TYPE::ELEMENT_STATIC == eType)
|
||||
m_pGameInstance->Add_GameObject_ToLayer<CMapElement_Static>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Static"), &Desc);
|
||||
else if (MAPOBJECT_TYPE::ELEMENT_INTERACT == eType)
|
||||
m_pGameInstance->Add_GameObject_ToLayer<CMapElement_Interactable>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Interact"), &Desc);*/
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex)
|
||||
{
|
||||
m_pGameInstance = CGameInstance::GetInstance();
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
#include "pch.h"
|
||||
#include "MapObject_Collision.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "Layer.h"
|
||||
#include "VIBuffer_Terrain.h"
|
||||
|
||||
CMapObject_Collision::CMapObject_Collision(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CMapPartObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CMapObject_Collision::CMapObject_Collision(const CMapObject_Collision& Prototype)
|
||||
: CMapPartObject(Prototype)
|
||||
{
|
||||
}
|
||||
|
||||
void CMapObject_Collision::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CMapObject_Collision::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CMapObject_Collision::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Collision::Render()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Collision::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Collision::Initialize(void* pArg)
|
||||
{
|
||||
m_iMaxLodLevel = 0;
|
||||
|
||||
MAPOBJECT_DESC* pDesc = static_cast<MAPOBJECT_DESC*>(pArg);
|
||||
|
||||
m_iMaxLodLevel = pDesc->iMaxLodLevel;
|
||||
|
||||
for (_uint i = 0; i < m_iMaxLodLevel + 1; i++)
|
||||
{
|
||||
m_ModelPrototypeTags.push_back(pDesc->ModelPrototypeTags[i]);
|
||||
//m_ModelPathIndices.push_back((*pDesc->pModelPathIndices)[i]);
|
||||
}
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components()))
|
||||
return E_FAIL;
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPosition), 1.f));
|
||||
m_pTransformCom->Set_Scale(pDesc->vScale);
|
||||
m_pTransformCom->Rotation(XMConvertToRadians(pDesc->vRotation.x), XMConvertToRadians(pDesc->vRotation.y), XMConvertToRadians(pDesc->vRotation.z));
|
||||
|
||||
XMStoreFloat4x4(&m_CombinedWorldMatrix, m_pTransformCom->Get_XMWorldMatrix() * m_pParentTransformCom->Get_XMWorldMatrix());
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
_wstring CMapObject_Collision::Get_PrototypeTag(_uint iLodIndex)
|
||||
{
|
||||
if (m_iMaxLodLevel < iLodIndex)
|
||||
return m_ModelPrototypeTags[0];
|
||||
|
||||
return m_ModelPrototypeTags[iLodIndex];
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Collision::Ready_Components()
|
||||
{
|
||||
__super::Ready_Components();
|
||||
|
||||
for (_uint i = 0; i < m_iMaxLodLevel + 1; ++i)
|
||||
{
|
||||
CModel* pModel = { nullptr };
|
||||
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_ModelPrototypeTags[i],
|
||||
reinterpret_cast<CComponent**>(&pModel))))
|
||||
return E_FAIL;
|
||||
|
||||
m_pModelComs.push_back(pModel);
|
||||
}
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Collision::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", &m_CombinedWorldMatrix))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CMapObject_Collision* CMapObject_Collision::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CMapObject_Collision* pInstance = new CMapObject_Collision(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CMapObject_Static");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CMapObject_Collision::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CMapObject_Collision* pInstance = new CMapObject_Collision(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CMapObject_Collision");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CMapObject_Collision::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
|
||||
for (auto& pModel : m_pModelComs)
|
||||
Safe_Release(pModel);
|
||||
m_pModelComs.clear();
|
||||
|
||||
m_ModelPrototypeTags.clear();
|
||||
m_ModelPathIndices.clear();
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
void CMapObject_Collision::Describe_Entity()
|
||||
{
|
||||
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@@ -0,0 +1,242 @@
|
||||
#include "pch.h"
|
||||
#include "MapObject_Render.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "Layer.h"
|
||||
#include "VIBuffer_Terrain.h"
|
||||
#include "Character_Controller.h"
|
||||
#include "Bounding_Sphere.h"
|
||||
#include "Collider.h"
|
||||
|
||||
CMapObject_Render::CMapObject_Render(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CMapPartObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CMapObject_Render::CMapObject_Render(const CMapObject_Render& Prototype)
|
||||
: CMapPartObject(Prototype), m_iLodIndex{ 0 }
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Render::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Render::Initialize(void* pArg)
|
||||
{
|
||||
MAPOBJECT_DESC* pDesc = static_cast<MAPOBJECT_DESC*>(pArg);
|
||||
|
||||
//m_Type = static_cast<MAPOBJECT_RENDER_TYPE>(pDesc->iRenderType);
|
||||
m_iMaxLodLevel = pDesc->iMaxLodLevel;
|
||||
|
||||
for (_uint i = 0; i < m_iMaxLodLevel + 1; i++)
|
||||
{
|
||||
m_ModelPrototypeTags.push_back(pDesc->ModelPrototypeTags[i]);
|
||||
//m_ModelPathIndices.push_back((*pDesc->pModelPathIndices)[i]);
|
||||
}
|
||||
|
||||
/*if (_wstring::npos != m_ModelPrototypeTags.front().find(L"Glass"))
|
||||
m_iShaderPass = 12;
|
||||
else*/
|
||||
|
||||
m_iShaderPass = ENUM_CLASS(SHADER_PASS_MESH::DEFAULT);
|
||||
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components()))
|
||||
return E_FAIL;
|
||||
|
||||
m_fRadius = m_pModelComs[0]->Get_Radius();
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPosition), 1.f));
|
||||
m_pTransformCom->Set_Scale(pDesc->vScale);
|
||||
m_pTransformCom->Rotation(XMConvertToRadians(pDesc->vRotation.x), XMConvertToRadians(pDesc->vRotation.y), XMConvertToRadians(pDesc->vRotation.z));
|
||||
|
||||
XMStoreFloat4x4(&m_CombinedWorldMatrix, m_pTransformCom->Get_XMWorldMatrix() * m_pParentTransformCom->Get_XMWorldMatrix());
|
||||
|
||||
_float3 vOffset = m_pModelComs[0]->Get_RadiusOffset();
|
||||
_matrix ColliderMatrix = XMMatrixTranslation(vOffset.x, vOffset.y, vOffset.z) * XMLoadFloat4x4(&m_CombinedWorldMatrix);
|
||||
XMStoreFloat4(&m_vExtentPosition, ColliderMatrix.r[3]);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMapObject_Render::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CMapObject_Render::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CMapObject_Render::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_pGameInstance->isIn_WorldFrustum(XMLoadFloat4(&m_vExtentPosition), m_fRadius)) {
|
||||
|
||||
m_fCamDepth = XMVectorGetX(XMVector3LengthSq(XMLoadFloat4(m_pGameInstance->Get_CamPosition()) - XMLoadFloat4(&m_vExtentPosition)));
|
||||
|
||||
m_iLodIndex = min(m_iMaxLodLevel, (_uint)(m_fCamDepth / (m_fRadius * m_fRadius + 3600.f)));
|
||||
|
||||
m_iNumMeshe = m_pModelComs[m_iLodIndex]->Get_NumMeshes();
|
||||
|
||||
switch (m_Type)
|
||||
{
|
||||
case MAPOBJECT_RENDER_TYPE::NORMAL:
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
break;
|
||||
|
||||
case MAPOBJECT_RENDER_TYPE::GLASS:
|
||||
break;
|
||||
|
||||
case MAPOBJECT_RENDER_TYPE::DECAL:
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::DECAL, this);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Render::Render()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
for (_uint i = 0; i < m_iNumMeshe; i++)
|
||||
{
|
||||
if (FAILED(m_pModelComs[0]->Bind_Material(i, m_pShaderCom))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(m_iShaderPass))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelComs[m_iLodIndex]->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
_wstring CMapObject_Render::Get_PrototypeTag(_uint iLodIndex)
|
||||
{
|
||||
if (m_iMaxLodLevel < iLodIndex)
|
||||
return m_ModelPrototypeTags[0];
|
||||
|
||||
return m_ModelPrototypeTags[iLodIndex];
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Render::Add_LodModel(const _tchar* pModelPrototypeTag)
|
||||
{
|
||||
CModel* pModel = { nullptr };
|
||||
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, pModelPrototypeTag,
|
||||
reinterpret_cast<CComponent**>(&pModel))))
|
||||
return E_FAIL;
|
||||
|
||||
m_ModelPrototypeTags.push_back(pModelPrototypeTag);
|
||||
|
||||
++m_iMaxLodLevel;
|
||||
m_pModelComs.push_back(pModel);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Render::Ready_Components()
|
||||
{
|
||||
__super::Ready_Components();
|
||||
|
||||
for (_uint i = 0; i < m_iMaxLodLevel + 1; ++i)
|
||||
{
|
||||
CModel* pModel = { nullptr };
|
||||
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_ModelPrototypeTags[i],
|
||||
reinterpret_cast<CComponent**>(&pModel))))
|
||||
return E_FAIL;
|
||||
|
||||
m_pModelComs.push_back(pModel);
|
||||
}
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Render::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", &m_CombinedWorldMatrix))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CMapObject_Render* CMapObject_Render::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CMapObject_Render* pInstance = new CMapObject_Render(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CMapObject_Render");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CMapObject_Render::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CMapObject_Render* pInstance = new CMapObject_Render(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CMapObject_Render");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CMapObject_Render::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
|
||||
for (auto& pModel : m_pModelComs)
|
||||
SAFE_RELEASE(pModel);
|
||||
m_pModelComs.clear();
|
||||
|
||||
m_ModelPrototypeTags.clear();
|
||||
m_ModelPathIndices.clear();
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
void CMapObject_Render::Describe_Entity()
|
||||
{
|
||||
}
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
#include "pch.h"
|
||||
#include "MapPartObject.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "Layer.h"
|
||||
#include "VIBuffer_Terrain.h"
|
||||
|
||||
CMapPartObject::CMapPartObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CPartObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CMapPartObject::CMapPartObject(const CMapPartObject& Prototype)
|
||||
: CPartObject(Prototype)
|
||||
{
|
||||
}
|
||||
|
||||
void CMapPartObject::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CMapPartObject::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CMapPartObject::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CMapPartObject::Render()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapPartObject::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapPartObject::Initialize(void* pArg)
|
||||
{
|
||||
MAPOBJECT_DESC* pDesc = static_cast<MAPOBJECT_DESC*>(pArg);
|
||||
|
||||
PARTOBJECT_DESC Desc = {};
|
||||
Desc.pParentTransform = pDesc->pParentTransform;
|
||||
|
||||
if (FAILED(__super::Initialize(&Desc)))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapPartObject::Ready_Components()
|
||||
{
|
||||
__super::Ready_Components(nullptr);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapPartObject::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMapPartObject::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CMapPartObject::Describe_Entity()
|
||||
{
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@@ -0,0 +1,217 @@
|
||||
#include "pch.h"
|
||||
#include "Terrain.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "Camera_Debug.h"
|
||||
#include "VIBuffer_Terrain.h"
|
||||
|
||||
CTerrain::CTerrain(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CTerrain::CTerrain(const CTerrain& Prototype)
|
||||
: CGameObject(Prototype)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CTerrain::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTerrain::Initialize(void* pArg)
|
||||
{
|
||||
TERRAIN_DESC* pDesc = static_cast<TERRAIN_DESC*>(pArg);
|
||||
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
m_fUsingSurfaceParams = 15.f / 27.f;
|
||||
//m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(-194, 18.5f, -153.f, 1.f));
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPosition), 1.f));
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CTerrain::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CTerrain::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (m_pGameInstance->Key_Down(DIK_LSHIFT) )
|
||||
{
|
||||
m_bWasWireFrame = !m_bWasWireFrame;
|
||||
}
|
||||
#endif // _DEBUG
|
||||
}
|
||||
|
||||
void CTerrain::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
//if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
//}
|
||||
}
|
||||
|
||||
HRESULT CTerrain::Render()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
if (m_bWasWireFrame)
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NORTEX::TERRAIN)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NORTEX::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NORTEX::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
|
||||
if (FAILED(m_pVIBufferCom->Bind_Resources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pVIBufferCom->Render())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTerrain::Ready_Components(void* pArg)
|
||||
{
|
||||
__super::Ready_Components(nullptr);
|
||||
|
||||
TERRAIN_DESC* pDesc = static_cast<TERRAIN_DESC*>(pArg);
|
||||
|
||||
/* Com_VIBuffer */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Terrain"),
|
||||
reinterpret_cast<CComponent**>(&m_pVIBufferCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_NORTEX,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_Texture */
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, pDesc->strDiffuseTextureTag, reinterpret_cast<CComponent**>(&m_pDiffuseTextureCom), nullptr))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* Com_Texture */
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, pDesc->strNormalTextureTag, reinterpret_cast<CComponent**>(&m_pNormalTextureCom), nullptr))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* Com_Texture */
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, pDesc->strMROTextureTag, reinterpret_cast<CComponent**>(&m_pMROTextureCom), nullptr))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* Com_Texture */
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, pDesc->strAlphaMapTextureTag, reinterpret_cast<CComponent**>(&m_pAlphaMapTextureCom), nullptr))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTerrain::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pDiffuseTextureCom->Bind_ShaderResources(m_pShaderCom, "g_DiffuseTextures", 0, m_pDiffuseTextureCom->Get_Size()))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pNormalTextureCom->Bind_ShaderResources(m_pShaderCom, "g_NormalTextures", 0, m_pNormalTextureCom->Get_Size()))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pMROTextureCom->Bind_ShaderResources(m_pShaderCom, "g_SurfaceParamsTextures", 0, m_pMROTextureCom->Get_Size()))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_SRV("g_MaskTexture", m_pAlphaMapTextureCom->Get_SRV(0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fUsingSurfaceParams", &m_fUsingSurfaceParams, sizeof(_float))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CTerrain* CTerrain::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CTerrain* pInstance = new CTerrain(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CTerrain");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CTerrain::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CTerrain* pInstance = new CTerrain(*this);
|
||||
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CTerrain");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CTerrain::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pVIBufferCom);
|
||||
SAFE_RELEASE(m_pDiffuseTextureCom);
|
||||
SAFE_RELEASE(m_pNormalTextureCom);
|
||||
SAFE_RELEASE(m_pMROTextureCom);
|
||||
SAFE_RELEASE(m_pAlphaMapTextureCom);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
void CTerrain::Describe_Entity()
|
||||
{
|
||||
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@@ -0,0 +1,56 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "MapContainer.h"
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CBuildingContainer final : public CMapContainer
|
||||
{
|
||||
private:
|
||||
CBuildingContainer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CBuildingContainer(const CBuildingContainer& rhs);
|
||||
~CBuildingContainer() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
public:
|
||||
template<typename T>
|
||||
HRESULT Add_Part(const _string& strPartKey, _uint iPrototypeLevelIndex, T** ppOut, void* pArg = nullptr) {
|
||||
return Add_PartObject<T>(strPartKey, iPrototypeLevelIndex, ppOut, pArg);
|
||||
}
|
||||
template<typename T>
|
||||
HRESULT Add_Collision(_uint iPrototypeLevelIndex, void* pArg = nullptr)
|
||||
{
|
||||
T* pPartObject = m_pGameInstance->Clone_Prototype<T>(iPrototypeLevelIndex, pArg, this);
|
||||
|
||||
if (nullptr == pPartObject) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_ColiisonPartObjects.push_back(pPartObject);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Bind_ShaderResources()override;
|
||||
|
||||
public:
|
||||
static CBuildingContainer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner = nullptr)override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
virtual void Describe_Entity()override;
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -2,8 +2,11 @@
|
||||
|
||||
#include <process.h>
|
||||
#include "../Default/framework.h"
|
||||
#include "Engine_Define.h"
|
||||
#include "Client_Enum.h"
|
||||
#include "Client_Macro.h"
|
||||
#include "Client_Struct.h"
|
||||
|
||||
|
||||
namespace Client
|
||||
{
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace Client
|
||||
enum class LEVEL { STATIC, LOADING, LOGO, INTRO, GAMEPLAY, FIELD, RESTART, END };
|
||||
enum class COLLIDABLEOBJECT { PLAYER, MONSTER, HOSTILE_HITBOX, ALLY_HITBOX, NEUTRAL_HITBOX, ENVIRIONMENT, NPC, ITEM, TRIGGERBOX, REGION, NOCOLLIDE, END };
|
||||
enum class MAPOBJECT_TYPE { CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT };
|
||||
enum class MAPOBJECT_RENDER_TYPE { NORMAL, DECAL, GLASS };
|
||||
|
||||
enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, END };
|
||||
enum class SHADER_PASS_CUBE { DEFAULT, SHADOW, BLUR, END };
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
class CRigidBody_Static;
|
||||
NS_END
|
||||
|
||||
namespace Client
|
||||
{
|
||||
typedef struct tagFolderLoad {
|
||||
_wstring pModelTag;
|
||||
CModel* pLoadedModel;
|
||||
filesystem::path pathModel;
|
||||
|
||||
_bool bLoadTags;
|
||||
vector<_wstring> pRigidBodyTags;
|
||||
vector<CRigidBody_Static*> LoadedRigidBody;
|
||||
}FOLDER_LOAD;
|
||||
};
|
||||
@@ -23,6 +23,11 @@ class CInfoInstance final : public CBase
|
||||
void Update(_float fTimeDelta);
|
||||
|
||||
|
||||
#pragma region MAP_INFO
|
||||
HRESULT Load_MapObjects(const _char* pFilePath);
|
||||
#pragma endregion
|
||||
|
||||
|
||||
private:
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
|
||||
@@ -23,6 +23,7 @@ class CLevel_GamePlay final : public CLevel
|
||||
virtual HRESULT Initialize() override;
|
||||
HRESULT Initialize(void* pArg);
|
||||
HRESULT Ready_Lights();
|
||||
HRESULT Ready_Background();
|
||||
HRESULT Ready_Markers();
|
||||
HRESULT Ready_Layer_UI(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_Camera();
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
class CModel;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
@@ -36,8 +37,11 @@ class CLoader final : public CBase
|
||||
HRESULT Loading_For_GamePlay();
|
||||
HRESULT Loading_For_Field();
|
||||
HRESULT Loading_For_Restart();
|
||||
|
||||
private:
|
||||
HRESULT Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreName, function<HRESULT(_wstring, const _char*)> AddPrototypeEvent);
|
||||
future<void> Deferred_FolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector<FOLDER_LOAD*>** OutContents);
|
||||
future<pair<_wstring, CModel*>*> 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;
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "ContainerObject.h"
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CMapContainer abstract : public CContainerObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagMapContainerDesc
|
||||
{
|
||||
_float3 vPosition;
|
||||
_float3 vScale;
|
||||
_float3 vRotation;
|
||||
}MAP_CONTAINER_DESC;
|
||||
|
||||
protected:
|
||||
CMapContainer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CMapContainer(const CMapContainer& rhs);
|
||||
~CMapContainer() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
protected:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
|
||||
protected:
|
||||
_uint m_iMaxLodLevel = {};
|
||||
|
||||
vector<class CPartObject*> m_ColiisonPartObjects;
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -16,6 +16,8 @@ class CMapInfo final : public CBase
|
||||
~CMapInfo() = default;
|
||||
public:
|
||||
void Update(_float fTimeDelta);
|
||||
HRESULT Load_MapObjects(const _char* pFilePath);
|
||||
|
||||
|
||||
private:
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "MapPartObject.h"
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CMapObject_Collision final : public CMapPartObject // 충돌용 Mesh
|
||||
{
|
||||
private:
|
||||
CMapObject_Collision(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CMapObject_Collision(const CMapObject_Collision& Prototype);
|
||||
virtual ~CMapObject_Collision() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
public:
|
||||
virtual _wstring Get_PrototypeTag(_uint iLodIndex = 0);
|
||||
|
||||
private:
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
vector<CModel*> m_pModelComs;
|
||||
|
||||
_uint m_iLodIndex = {};
|
||||
|
||||
vector<_wstring> m_ModelPrototypeTags;
|
||||
vector<_uint> m_ModelPathIndices = { };
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Bind_ShaderResources();
|
||||
|
||||
public:
|
||||
static CMapObject_Collision* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
virtual void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,59 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "MapPartObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CCollider;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CMapObject_Render final : public CMapPartObject // Render PartObject
|
||||
{
|
||||
private:
|
||||
CMapObject_Render(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CMapObject_Render(const CMapObject_Render& Prototype);
|
||||
virtual ~CMapObject_Render() = default;
|
||||
|
||||
public:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
public:
|
||||
virtual _wstring Get_PrototypeTag(_uint iLodIndex = 0);
|
||||
HRESULT Add_LodModel(const _tchar* pModelPrototypeTag);
|
||||
|
||||
private:
|
||||
MAPOBJECT_RENDER_TYPE m_Type = {};
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
vector<CModel*> m_pModelComs;
|
||||
|
||||
_uint m_iLodIndex = {};
|
||||
_uint m_iShaderPass = {};
|
||||
_uint m_iNumMeshe = {};
|
||||
|
||||
_float m_fRadius = { 0.f };
|
||||
|
||||
|
||||
vector<_wstring> m_ModelPrototypeTags;
|
||||
vector<_uint> m_ModelPathIndices = { };
|
||||
|
||||
private:
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Bind_ShaderResources();
|
||||
|
||||
public:
|
||||
static CMapObject_Render* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
virtual void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,57 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "PartObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CShader;
|
||||
class CModel;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CMapPartObject abstract : public CPartObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagMapObject_Desc {
|
||||
_uint iRenderType{};
|
||||
CTransform* pParentTransform = { nullptr };
|
||||
_float3 vScale;
|
||||
_float3 vRotation;
|
||||
_float3 vPosition;
|
||||
_uint iMaxLodLevel{};
|
||||
vector<_wstring> ModelPrototypeTags;
|
||||
vector<_uint>* pModelPathIndices = { nullptr };
|
||||
}MAPOBJECT_DESC;
|
||||
|
||||
protected:
|
||||
CMapPartObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CMapPartObject(const CMapPartObject& Prototype);
|
||||
virtual ~CMapPartObject() = default;
|
||||
|
||||
public:
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
protected:
|
||||
_float4 m_vExtentPosition = {};
|
||||
_uint m_iMaxLodLevel = {};
|
||||
|
||||
protected:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
HRESULT Ready_Components();
|
||||
|
||||
private:
|
||||
HRESULT Bind_ShaderResources();
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
virtual void Describe_Entity() override;
|
||||
#endif
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,69 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CShader;
|
||||
class CVIBuffer_Terrain;
|
||||
class CTexture;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CTerrain final : public CGameObject
|
||||
{
|
||||
public:
|
||||
typedef struct TerrainDesc
|
||||
{
|
||||
_float3 vPosition;
|
||||
_wstring strDiffuseTextureTag;
|
||||
_wstring strNormalTextureTag;
|
||||
_wstring strMROTextureTag;
|
||||
_wstring strAlphaMapTextureTag;
|
||||
}TERRAIN_DESC;
|
||||
private:
|
||||
CTerrain(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CTerrain(const CTerrain& Prototype);
|
||||
virtual ~CTerrain() = default;
|
||||
|
||||
public:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual void Priority_Update(_float fTimeDelta) override;
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CVIBuffer_Terrain* m_pVIBufferCom = { nullptr };
|
||||
CTexture* m_pDiffuseTextureCom = { nullptr };
|
||||
CTexture* m_pNormalTextureCom = { nullptr };
|
||||
CTexture* m_pMROTextureCom = { nullptr };
|
||||
CTexture* m_pAlphaMapTextureCom = { nullptr };
|
||||
|
||||
_float m_fUsingSurfaceParams = {};
|
||||
_float3 m_vPickingPosition = {};
|
||||
|
||||
_uint m_iTextureIndex = {};
|
||||
|
||||
#ifdef _DEBUG
|
||||
_bool m_bWasWireFrame = { false };
|
||||
_float m_fCullingRadius = { 0.2f };
|
||||
#endif // _DEBUG
|
||||
|
||||
private:
|
||||
virtual HRESULT Ready_Components(void* pArg);
|
||||
HRESULT Bind_ShaderResources();
|
||||
|
||||
public:
|
||||
static CTerrain* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
virtual void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
};
|
||||
|
||||
NS_END
|
||||
Reference in New Issue
Block a user