[fix] Load MapContainer

This commit is contained in:
JinhoBa
2025-11-11 23:08:24 +09:00
parent a83842ed92
commit 5ce681240b
6 changed files with 72 additions and 90 deletions
@@ -308,4 +308,33 @@
<Rotation x="0" y="0" z="0"/>
</PartObject>
</Container>
<Container Name="3Broom_Ext">
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_barrel_stands</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_barrel_stands</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_barrels</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Door_R</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
</Container>
</Land>
+16 -16
View File
@@ -684,29 +684,29 @@ HRESULT CLoader::Loading_For_MapViewer()
ModelPrototypeTags.push_back(strFileName);
}
for (const auto& file : filesystem::directory_iterator("C:\\Users\\82103\\Desktop\\MapRe\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes\\3Broom_Kit"))
{
if (file.is_directory())
continue;
//for (const auto& file : filesystem::directory_iterator("C:\\Users\\82103\\Desktop\\MapRe\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes\\3Broom_Kit"))
//{
// if (file.is_directory())
// continue;
string ext = file.path().extension().string();
// string ext = file.path().extension().string();
if (strcmp(ext.c_str(), ".fbx"))
continue;
// if (strcmp(ext.c_str(), ".fbx"))
// continue;
_char szFilePath[MAX_PATH] = {};
// _char szFilePath[MAX_PATH] = {};
strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str());
// strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str());
_wstring strFileName = L"Prototype_GameObject_" + file.path().stem().wstring();
// _wstring strFileName = L"Prototype_GameObject_" + file.path().stem().wstring();
/*For Prototype_Component_Model_*/
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, strFileName,
CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, szFilePath))))
return E_FAIL;
// /*For Prototype_Component_Model_*/
// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, strFileName,
// CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, szFilePath))))
// return E_FAIL;
ModelPrototypeTags.push_back(strFileName);
}
// ModelPrototypeTags.push_back(strFileName);
//}
m_strMessage = TEXT("쉐이더를(을) 로딩 중 입니다.");
+17 -17
View File
@@ -6,56 +6,56 @@
#include "MapObject_Static.h"
CMapContainer::CMapContainer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
:CContainerObject(pDevice, pContext)
:CContainerObject(pDevice, pContext)
{
}
CMapContainer::CMapContainer(const CMapContainer& rhs)
:CContainerObject(rhs)
:CContainerObject(rhs)
{
}
HRESULT CMapContainer::Initialize_Prototype()
{
return S_OK;
return S_OK;
}
HRESULT CMapContainer::Initialize(void* pArg)
{
if (FAILED(__super::Initialize(pArg))) {
return E_FAIL;
}
if (FAILED(__super::Initialize(pArg))) {
return E_FAIL;
}
return S_OK;
return S_OK;
}
HRESULT CMapContainer::Ready_Components(void* pArg)
{
if (FAILED(__super::Ready_Components(pArg))) {
return E_FAIL;
}
if (FAILED(__super::Ready_Components(pArg))) {
return E_FAIL;
}
return S_OK;
return S_OK;
}
void CMapContainer::Priority_Update(_float fTimeDelta)
{
__super::Priority_Update(fTimeDelta);
__super::Priority_Update(fTimeDelta);
}
void CMapContainer::Update(_float fTimeDelta)
{
__super::Update(fTimeDelta);
__super::Update(fTimeDelta);
}
void CMapContainer::Late_Update(_float fTimeDelta)
{
__super::Late_Update(fTimeDelta);
__super::Late_Update(fTimeDelta);
}
HRESULT CMapContainer::Render()
{
return S_OK;
return S_OK;
}
HRESULT CMapContainer::Save_PartObjects(tinyxml2::XMLDocument& Doc, tinyxml2::XMLElement* Container)
@@ -113,10 +113,10 @@ HRESULT CMapContainer::Save_PartObjects(tinyxml2::XMLDocument& Doc, tinyxml2::XM
}
return S_OK;
return S_OK;
}
void CMapContainer::Free()
{
__super::Free();
__super::Free();
}
@@ -77,32 +77,6 @@ HRESULT CMapObject::Initialize(void* pArg)
return S_OK;
}
_wstring CMapObject::Get_PrototypeTag(_uint iLodIndex)
{
return _wstring();
}
return S_OK;
}
HRESULT CMapObject::Initialize(void* pArg)
{
if (FAILED(__super::Initialize(pArg)))
return E_FAIL;
if (FAILED(Ready_Components()))
return E_FAIL;
#ifdef _DEBUG
m_bSelected = false;
m_vPosition = _float3(0.f, 0.f, 0.f);
m_vRotation = _float3(0.f, 0.f, 0.f);
m_vScale = _float3(1.f, 1.f, 1.f);
#endif // _DEBUG
//if (FAILED(m_pShaderCom->Bind_RawValue("g_vCamPosition", m_pGameInstance->Get_CamPosition(), sizeof(_float4)))) {
// return E_FAIL;
//}
HRESULT CMapObject::Ready_Components()
{
__super::Ready_Components(nullptr);
@@ -115,22 +89,6 @@ HRESULT CMapObject::Bind_ShaderResources()
return S_OK;
}
return pInstance;
}
CGameObject* CMapObject::Clone(void* pArg, CGameObject* pOwner)
{
CMapObject* pInstance = new CMapObject(*this);
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CMapObject");
Safe_Release(pInstance);
}
return pInstance;
}
void CMapObject::Free()
{
__super::Free();
@@ -304,7 +304,8 @@ HRESULT CMapObject_Manager::Save_ContainerData(const _char* pFileName, const _ch
PartObject->InsertEndChild(proto);
}
//m_pMapObjects = pLayer->Get_Objects();
// <Position x="0.0" y="0.0" z="0.0"/>
tinyxml2::XMLElement* PositionElem = doc.NewElement("Position");
_float3 vPosition = {};
XMStoreFloat3(&vPosition, pMapObject->Get_Component<CTransform>()->Get_State(STATE::POSITION));
@@ -314,11 +315,8 @@ HRESULT CMapObject_Manager::Save_ContainerData(const _char* pFileName, const _ch
PositionElem->SetAttribute("z", vPosition.z);
PartObject->InsertEndChild(PositionElem);
if (false == m_MapObjects.empty())
{
for (auto pMapObject : m_MapObjects)
{
CMapObject* pCurrentMapObject = static_cast<CMapObject*>(pMapObject);
// <Scale x="0.0" y="0.0" z="0.0"/>
tinyxml2::XMLElement* ScaleElem = doc.NewElement("Scale");
_float3 pScale = pMapObject->Get_Component<CTransform>()->Get_Scale();
ScaleElem->SetAttribute("x", pScale.x);
@@ -326,7 +324,8 @@ HRESULT CMapObject_Manager::Save_ContainerData(const _char* pFileName, const _ch
ScaleElem->SetAttribute("z", pScale.z);
PartObject->InsertEndChild(ScaleElem);
wstring strPrototypeTag = pCurrentMapObject->Get_PrototypeTag();
// <Rotation x="0.0" y="0.0" z="0.0"/>
tinyxml2::XMLElement* RotationElem = doc.NewElement("Rotation");
_float3 vRotation = {};
XMStoreFloat3(&vRotation, pMapObject->Get_Component<CTransform>()->Get_RollPitchYawVector());
@@ -404,7 +403,7 @@ HRESULT CMapObject_Manager::Load_MapData(const _char* pFileName)
ContainerDesc.strName = string(pName);
m_pGameInstance->Add_GameObject_ToLayer<CBuildingContainer>(
g_iStaticLevel, ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Building"), &ContainerDesc, nullptr, reinterpret_cast<CGameObject**>(&pContainerObject));
g_iStaticLevel, ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Building"), &ContainerDesc, nullptr, &pContainerObject);
#pragma endregion
#pragma region ADD_PARTOBJECT
@@ -489,7 +488,6 @@ HRESULT CMapObject_Manager::Load_MapData(const _char* pFileName)
}
#pragma endregion
}
return S_OK;
@@ -556,8 +554,7 @@ HRESULT CMapObject_Manager::Load_ContainerData(const _char* pFileName, const _ch
ContainerDesc.strName = string(pContainerName);
m_pGameInstance->Add_GameObject_ToLayer<CBuildingContainer>(
g_iStaticLevel, ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Building"), &ContainerDesc, nullptr, reinterpret_cast<CGameObject**>(&pContainerObject));
m_pGameInstance->Add_GameObject_ToLayer<CBuildingContainer>(g_iStaticLevel, ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Building"), &ContainerDesc, nullptr, (CBuildingContainer**)(&pContainerObject));
#pragma endregion
#pragma region ADD_PARTOBJECT
@@ -642,7 +639,7 @@ HRESULT CMapObject_Manager::Load_ContainerData(const _char* pFileName, const _ch
}
#pragma endregion
SAFE_RELEASE(pContainerObject);
return S_OK;
}
@@ -36,13 +36,11 @@ class CMapObject_LOD final : public CMapObject
private:
CShader* m_pShaderCom = { nullptr };
vector<CModel*> m_pModelComs = { nullptr };
vector<CModel*> m_pModelComs;
_uint m_iMaxLodLevel = {};
_uint m_iLodIndex = {};
CShader* m_pShaderCom = { nullptr };
vector<CModel*> m_pModelComs;
vector<_wstring> m_ModelPrototypeTags;