[add] Release_Checked
This commit is contained in:
@@ -223,7 +223,10 @@ void CGoblin::Free()
|
||||
Safe_Delete(m_pCallBack_Behavior);
|
||||
Safe_Delete(m_pCallBack_HitReport);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CGoblin::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -53,6 +53,7 @@ unsigned int APIENTRY LoadingMain(void* pArg)
|
||||
|
||||
if (FAILED(pLoader->Loading())) {
|
||||
assert(false);
|
||||
int a = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -271,7 +272,7 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Box"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.fbx", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))) {
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -321,7 +322,7 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SkyboxModel"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.fbx", XMMatrixIdentity()))))
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.bin", XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
Asset_FileLoad("../Bin/Resources/Models/Effect/ParticleMesh", L"Prototype_Instance_Model_", [&](_wstring wstrFileName, const _char* pFilePath) {
|
||||
@@ -483,8 +484,9 @@ HRESULT CLoader::Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreN
|
||||
|
||||
string ext = file.path().extension().string();
|
||||
|
||||
if (!strcmp(ext.c_str(), ".txt"))
|
||||
if (!strcmp(ext.c_str(), ".txt") || !strcmp(ext.c_str(), ".fbx")){
|
||||
continue;
|
||||
}
|
||||
|
||||
_char szFilePath[MAX_PATH] = {};
|
||||
|
||||
|
||||
@@ -73,7 +73,10 @@ void CMonster::Free()
|
||||
|
||||
SAFE_RELEASE(m_pPlayerTransform);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CMonster::Describe_Entity()
|
||||
{
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
@@ -50,6 +50,8 @@ HRESULT CWand::Initialize(void* pArg)
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
}
|
||||
SAFE_ADDREF(m_pTrail);
|
||||
SAFE_ADDREF(m_pEffectParts);
|
||||
|
||||
m_pEffectParts->Load("../Bin/Resources/Data/Effect/Lumos/Lumos", static_cast<LEVEL>(NEXT_LEVEL));
|
||||
|
||||
@@ -70,9 +72,10 @@ void CWand::Priority_Update(_float fTimeDelta)
|
||||
|
||||
m_pTransformCom->Set_WorldMatrix(socketMatrix * XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr()));
|
||||
|
||||
#ifdef _DEBUG
|
||||
Describe_Entity();
|
||||
|
||||
|
||||
#endif // _DEBUG
|
||||
}
|
||||
|
||||
void CWand::Update(_float fTimeDelta)
|
||||
|
||||
@@ -37,8 +37,11 @@ class CGoblin final : public CMonster
|
||||
static CGoblin* 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
|
||||
|
||||
private:
|
||||
virtual void Add_FSM();
|
||||
virtual void Set_Anim();
|
||||
|
||||
@@ -31,7 +31,11 @@ class CMonster abstract : public CUnit
|
||||
public:
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)PURE;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
virtual void Describe_Entity() override;
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -109,6 +109,9 @@ void CGameInstance::Update_Engine(_float fTimeDelta)
|
||||
m_pMouse_Manager->Update();
|
||||
//m_pSound_Manager->Update();
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
|
||||
#ifdef 기무리
|
||||
static _bool bPicking = false;
|
||||
GUI::Checkbox("Picking Enable", &bPicking);
|
||||
@@ -116,6 +119,7 @@ void CGameInstance::Update_Engine(_float fTimeDelta)
|
||||
m_pPicking->Update();
|
||||
}
|
||||
#endif // 기무리
|
||||
#endif // _DEBUG
|
||||
#ifndef 기무리
|
||||
m_pPicking->Update();
|
||||
#endif // !기무리
|
||||
|
||||
@@ -28,6 +28,7 @@ CInstance_Model::CInstance_Model(const CInstance_Model& rhs)
|
||||
SAFE_ADDREF(m_pVBInstance);
|
||||
}
|
||||
|
||||
#ifdef EDITOR_PROJECT
|
||||
|
||||
HRESULT CInstance_Model::Initialize_Prototype(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex)
|
||||
{
|
||||
@@ -51,7 +52,6 @@ HRESULT CInstance_Model::Initialize_Prototype(const _char* pModelFilePath, MODEL
|
||||
{
|
||||
LoadData(pModelFilePath);
|
||||
}
|
||||
#ifdef EDITOR_PROJECT
|
||||
else if (strcmp(".fbx", szEXT) == 0)
|
||||
{
|
||||
_char Temp[256];
|
||||
@@ -66,7 +66,6 @@ HRESULT CInstance_Model::Initialize_Prototype(const _char* pModelFilePath, MODEL
|
||||
SaveAssimpModel(Temp , m_pAIScene);
|
||||
return S_OK;
|
||||
}
|
||||
#endif
|
||||
#pragma region Mesh
|
||||
if (FAILED(Ready_Meshes())) {
|
||||
return E_FAIL;
|
||||
@@ -76,6 +75,47 @@ HRESULT CInstance_Model::Initialize_Prototype(const _char* pModelFilePath, MODEL
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef EDITOR_PROJECT
|
||||
|
||||
HRESULT CInstance_Model::Initialize_Prototype(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex)
|
||||
{
|
||||
if (FAILED(__super::Initialize_Prototype()))
|
||||
return E_FAIL;
|
||||
|
||||
m_iNumBuffer = 2;
|
||||
|
||||
XMStoreFloat4x4(&m_PreTransformMatrix, PreTransformMatrix);
|
||||
|
||||
m_eType = eType;
|
||||
_char szTextureFileName[MAX_PATH] = {};
|
||||
_char szDir[MAX_PATH] = {};
|
||||
_char szName[MAX_PATH] = {};
|
||||
_char szEXT[MAX_PATH] = {};
|
||||
|
||||
_splitpath_s(pModelFilePath, nullptr, 0, szDir, MAX_PATH, szName, MAX_PATH, szEXT, MAX_PATH);
|
||||
|
||||
|
||||
if (strcmp(".bin", szEXT) == 0)
|
||||
{
|
||||
LoadData(pModelFilePath);
|
||||
}
|
||||
else {
|
||||
return E_FAIL;
|
||||
}
|
||||
#pragma region Mesh
|
||||
if (FAILED(Ready_Meshes())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef EDITOR_PROJECT
|
||||
HRESULT CInstance_Model::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex)
|
||||
{
|
||||
@@ -694,9 +734,7 @@ HRESULT CInstance_Model::Bind_CS_Output(_uint Index, _uint iBufferIndex)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
#ifdef EDITOR_PROJECT
|
||||
|
||||
|
||||
CInstance_Model* CInstance_Model::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex)
|
||||
{
|
||||
CInstance_Model* pInstance = new CInstance_Model(pDevice, pContext);
|
||||
@@ -709,7 +747,6 @@ CInstance_Model* CInstance_Model::Create(ID3D11Device* pDevice, ID3D11DeviceCont
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
#endif
|
||||
|
||||
CComponent* CInstance_Model::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ void CMouse_Manager::Update()
|
||||
}
|
||||
m_ptOldMouseCur = m_ptCurrentMouseCur;
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
GUI::Begin("Mouse_Manager");
|
||||
GUI::Text("AccumulateMomentum %f, %f", m_vMove.x, m_vMove.y);
|
||||
GUI::Text("CurPos %d, %d", m_ptCurrentMouseCur.x, m_ptCurrentMouseCur.y);
|
||||
@@ -79,7 +79,7 @@ void CMouse_Manager::Update()
|
||||
GUI::Text("INV_VPPOS: %f, %f", pt.x - (viewPort.Width * 0.5f), pt.y - (viewPort.Height * 0.5f));
|
||||
|
||||
GUI::End();
|
||||
|
||||
#endif
|
||||
Picking();
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -47,11 +47,12 @@ PSX::PxRigidDynamic* CPhysX_Manager::Add_DynamicActor(CRigidBody_Dynamic& RigidB
|
||||
}
|
||||
assert(nullptr != pShape);
|
||||
|
||||
// createExclusiveShape를 하면 쉐이프가 actor에 attach 된 상태로 나오기 때문에
|
||||
// 쉐이프 속성만 건드려서 액터의 쉐이프를 수정함
|
||||
pShape->setFlags(RigidBody.Get_ShapeFlags());
|
||||
pShape->setContactOffset(RigidBody.Get_ContactOffset());
|
||||
pShape->setRestOffset(0.f);
|
||||
|
||||
pActorDynamic->attachShape(*pShape);
|
||||
PSX::PxRigidBodyFlags pxRigidFlags = RigidBody.Get_RigidBodyFlags();
|
||||
pActorDynamic->setRigidBodyFlags(pxRigidFlags);
|
||||
|
||||
@@ -101,7 +102,7 @@ PSX::PxRigidStatic* CPhysX_Manager::Add_StaticActor(CRigidBody_Static& RigidBody
|
||||
// GeoFlag 중 더블사이드는 이제 지원 안함, 할거면 노말 뒤집어서 하라고 함
|
||||
// pPxMeshGeometry->meshFlags |= PSX::PxMeshGeometryFlag::eDOUBLE_SIDED;
|
||||
// 유효성 체크
|
||||
PX_ASSERT(pPxMeshGeometry.isValid());
|
||||
PX_ASSERT(pPxMeshGeometry->isValid());
|
||||
m_TriangleMeshGeometry.emplace(RigidBody.Get_PxMeshKey(), pPxMeshGeometry);
|
||||
}
|
||||
break;
|
||||
@@ -331,10 +332,19 @@ unordered_set<PSX::PxActor*>::iterator CPhysX_Manager::Detach_Actor(PSX::PxActor
|
||||
if (m_pActiveBodys.end() != iter) {
|
||||
m_pActiveBodys.erase(iter); // 액터를 활성화 맵에서 분리 해주고
|
||||
iterOut = m_pRestBodies.insert(&Actor).first; // 액터를 다시 쓸 수 있기 때문에 따로 보관해줌
|
||||
if (m_pScene != nullptr) {
|
||||
m_pScene->removeActor(Actor);
|
||||
}
|
||||
}
|
||||
|
||||
PSX::PxScene* pOwnerScene = Actor.getScene();
|
||||
|
||||
if (pOwnerScene == nullptr) { // 액터가 씬에 없는 경우 nullptr이 나옴
|
||||
return iterOut;
|
||||
}
|
||||
|
||||
if (pOwnerScene != m_pScene) { // 액터가 속한 씬이 아닌경우 빼면 안됨
|
||||
return iterOut;
|
||||
}
|
||||
m_pScene->removeActor(Actor);
|
||||
|
||||
return iterOut;
|
||||
}
|
||||
|
||||
@@ -475,6 +485,19 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
pPvdClient->setScenePvdFlag(PSX::PxPvdSceneFlag::eTRANSMIT_SCENEQUERIES, true);
|
||||
}
|
||||
|
||||
m_pMaterials.reserve(ENUM_CLASS(PXMATERIAL::END));
|
||||
m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f));
|
||||
|
||||
PlaneData.eKind = PHYSX_KIND::BODY_STATIC;
|
||||
PlaneData.iSubKind = UINT_MAX;
|
||||
PlaneData.pOwner = nullptr;
|
||||
PlaneData.pBody = nullptr;
|
||||
|
||||
PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]);
|
||||
pGroundPlane->userData = &PlaneData;
|
||||
pGroundPlane->setName("PHYSX_MANAGER_PLANE");
|
||||
m_pScene->addActor(*pGroundPlane);;
|
||||
|
||||
// m_pScene->overlap();??????
|
||||
#ifdef EDITOR_PROJECT
|
||||
#ifdef 기무리
|
||||
@@ -483,8 +506,6 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
PlaneData.pOwner = nullptr;
|
||||
PlaneData.pBody = nullptr;
|
||||
|
||||
m_pMaterials.reserve(ENUM_CLASS(PXMATERIAL::END));
|
||||
m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f));
|
||||
PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]);
|
||||
pGroundPlane->userData = &PlaneData;
|
||||
pGroundPlane->setName("PHYSX_MANAGER_PLANE");
|
||||
@@ -515,8 +536,6 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
PlaneData.pOwner = nullptr;
|
||||
PlaneData.pBody = nullptr;
|
||||
|
||||
m_pMaterials.reserve(ENUM_CLASS(PXMATERIAL::END));
|
||||
m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f));
|
||||
PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]);
|
||||
pGroundPlane->userData = &PlaneData;
|
||||
pGroundPlane->setName("PHYSX_MANAGER_PLANE");
|
||||
@@ -547,8 +566,6 @@ HRESULT CPhysX_Manager::Initialize()
|
||||
PlaneData.pOwner = nullptr;
|
||||
PlaneData.pBody = nullptr;
|
||||
|
||||
m_pMaterials.reserve(ENUM_CLASS(PXMATERIAL::END));
|
||||
m_pMaterials.push_back(m_pPhysics->createMaterial(0.5f, 0.5f, 0.6f));
|
||||
PSX::PxRigidStatic* pGroundPlane = PxCreatePlane(*m_pPhysics, physx::PxPlane(0, 1, 0, 0), *m_pMaterials[ENUM_CLASS(PXMATERIAL::DEFAULT)]);
|
||||
pGroundPlane->userData = &PlaneData;
|
||||
pGroundPlane->setName("PHYSX_MANAGER_PLANE");
|
||||
|
||||
Reference in New Issue
Block a user