Merge branch 'Develope' into Effect
This commit is contained in:
@@ -25,10 +25,18 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||
//_CrtSetBreakAlloc(1181);
|
||||
//_CrtSetBreakAlloc(1182);
|
||||
//_CrtSetBreakAlloc(1183);
|
||||
//_CrtSetBreakAlloc(1184);
|
||||
//_CrtSetBreakAlloc(1185);
|
||||
//_CrtSetBreakAlloc(1186);
|
||||
//_CrtSetBreakAlloc(1187);
|
||||
#endif
|
||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||
|
||||
|
||||
CMainApp* pMainApp = { nullptr };
|
||||
|
||||
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
|
||||
@@ -41,8 +49,8 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
}
|
||||
|
||||
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_CLIENT));
|
||||
|
||||
MSG msg = {};
|
||||
|
||||
MSG msg;
|
||||
|
||||
pMainApp = CMainApp::Create();
|
||||
if (nullptr == pMainApp)
|
||||
@@ -106,13 +114,13 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
||||
#endif // _DEBUG
|
||||
|
||||
pGameInstance->Compute_TimeDelta(TEXT("Timer_60"));
|
||||
|
||||
#ifdef _DEBUG
|
||||
pMainApp->Update(0.0166f);
|
||||
#endif // _DEBUG
|
||||
pMainApp->Update(1.f / 60.f);
|
||||
#endif // _DEBUG
|
||||
#ifndef _DEBUG
|
||||
pMainApp->Update(pGameInstance->Get_TimeDelta(TEXT("Timer_60")));
|
||||
#endif // !_DEBUG
|
||||
|
||||
#endif
|
||||
pMainApp->Render();
|
||||
|
||||
fTimeAcc = 0.f;
|
||||
@@ -163,7 +171,7 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
|
||||
RECT rcWindow = { 0, 0, g_iWinSizeX, g_iWinSizeY };
|
||||
|
||||
AdjustWindowRect(&rcWindow, WS_OVERLAPPEDWINDOW, TRUE);
|
||||
AdjustWindowRect(&rcWindow, WS_OVERLAPPEDWINDOW, FALSE);
|
||||
|
||||
HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW,
|
||||
CW_USEDEFAULT, 0, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, nullptr, nullptr, hInstance, nullptr);
|
||||
@@ -178,18 +186,20 @@ BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
|
||||
g_hWnd = hWnd;
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (ImGui_ImplWin32_WndProcHandler(hWnd, message, wParam, lParam))
|
||||
if (ImGui_ImplWin32_WndProcHandler(hWnd, message, wParam, lParam)) {
|
||||
return true;
|
||||
}
|
||||
switch (message)
|
||||
{
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
@@ -180,6 +180,7 @@
|
||||
<ClInclude Include="..\Public\Decendo.h" />
|
||||
<ClInclude Include="..\Public\EffectPool.h" />
|
||||
<ClInclude Include="..\Public\Goblin.h" />
|
||||
<ClInclude Include="..\public\InstancedProp.h" />
|
||||
<ClInclude Include="..\public\MapContainer.h" />
|
||||
<ClInclude Include="..\public\MapObject_Collision.h" />
|
||||
<ClInclude Include="..\public\MapObject_Render.h" />
|
||||
@@ -239,6 +240,7 @@
|
||||
<ClCompile Include="..\Private\EffectPool.cpp" />
|
||||
<ClCompile Include="..\Private\Goblin.cpp" />
|
||||
<ClCompile Include="..\Private\Goblin_States.cpp" />
|
||||
<ClCompile Include="..\private\InstancedProp.cpp" />
|
||||
<ClCompile Include="..\private\MapContainer.cpp" />
|
||||
<ClCompile Include="..\private\MapObject_Collision.cpp" />
|
||||
<ClCompile Include="..\private\MapObject_Render.cpp" />
|
||||
|
||||
@@ -190,6 +190,9 @@
|
||||
<ClInclude Include="..\Public\Decendo.h">
|
||||
<Filter>02.GameObjects\Effect\Effects\Decendo</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\InstancedProp.h">
|
||||
<Filter>02.GameObjects\Environment\02.InstancedProp</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Client.ico">
|
||||
@@ -448,6 +451,9 @@
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Effect\EffectPool">
|
||||
<UniqueIdentifier>{bdd4863e-8ab9-4ce8-a88d-9a0c558a67fb}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\02.InstancedProp">
|
||||
<UniqueIdentifier>{4ef15d06-4520-4d55-ab49-1ae7179f145b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -628,6 +634,9 @@
|
||||
<ClCompile Include="..\Private\Decendo.cpp">
|
||||
<Filter>02.GameObjects\Effect\Effects\Decendo</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\InstancedProp.cpp">
|
||||
<Filter>02.GameObjects\Environment\02.InstancedProp</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Client.rc">
|
||||
|
||||
@@ -58,11 +58,13 @@ HRESULT CGoblin::Initialize(void* pArg)
|
||||
|
||||
void CGoblin::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CGoblin::Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Update(fTimeDelta);
|
||||
|
||||
m_pFSM->Update_State(fTimeDelta);
|
||||
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
@@ -76,7 +78,7 @@ void CGoblin::Late_Update(_float fTimeDelta)
|
||||
__super::Late_Update(fTimeDelta);
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
|
||||
|
||||
m_pTransformCom->LookAt(m_pPlayerTransform->Get_State(STATE::POSITION));
|
||||
m_pTransformCom->LookAt(XMLoadFloat4(&m_vTargetPos));
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
}
|
||||
|
||||
@@ -136,15 +136,62 @@ void CGoblin::Add_FSM()
|
||||
|
||||
void CGoblin::Set_Anim()
|
||||
{
|
||||
|
||||
m_Animation[STATEANIM::IDLE] = { 22,true };
|
||||
m_Animation[STATEANIM::IDLE_TURN_BWD] = { 24, false };
|
||||
m_Animation[STATEANIM::IDLE_TURN_L] = { 26, false };
|
||||
m_Animation[STATEANIM::IDLE_TURN_R] = { 30, false };
|
||||
|
||||
m_Animation[STATEANIM::WALK_FWD] = { 50,true };
|
||||
m_Animation[STATEANIM::WALK_STOP] = { 58,false };
|
||||
m_Animation[STATEANIM::WALK_BWD] = { 49, true };
|
||||
|
||||
m_Animation[STATEANIM::JOG_FWD] = { 46,true };
|
||||
m_Animation[STATEANIM::JOG_BWD] = { 154,false };
|
||||
|
||||
m_Animation[STATEANIM::DODGE_LEFT] = { 125, false };
|
||||
m_Animation[STATEANIM::DODGE_RIGHT] = { 126, false };
|
||||
m_Animation[STATEANIM::SPRINT] = { 90, true };
|
||||
|
||||
m_Animation[STATEANIM::SKILL] = { 70,false }; // 도끼 스윙
|
||||
m_Animation[STATEANIM::SKILL2] = { 85,false }; // 나이프 던지기
|
||||
|
||||
m_Animation[STATEANIM::HIT_FWD] = { 353, false };
|
||||
m_Animation[STATEANIM::HIT_BWD] = { 352, false };
|
||||
m_Animation[STATEANIM::HIT_BWD2] = { 349, false };
|
||||
m_Animation[STATEANIM::HIT_BWD3] = { 350, false };
|
||||
m_Animation[STATEANIM::HIT_BWD4] = { 351, false };
|
||||
m_Animation[STATEANIM::HIT_L] = { 354, false };
|
||||
m_Animation[STATEANIM::HIT_R] = { 355, false };
|
||||
|
||||
m_Animation[STATEANIM::KNOCKDOWN_BWD] = { 374, false };
|
||||
m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT] = { 375, false };
|
||||
m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT_HOLD] = { 370, false };
|
||||
m_Animation[STATEANIM::KNOCKDOWN_FWD] = { 371, false };
|
||||
m_Animation[STATEANIM::KNOCKDOWN_FWD_SPLT] = { 372, false };
|
||||
m_Animation[STATEANIM::KNOCKDOWN_FWD_SPLT_HOLD] = { 373, false };
|
||||
|
||||
m_Animation[STATEANIM::GETUP_BWD] = { 330, false };
|
||||
m_Animation[STATEANIM::GETUP_FWD] = { 332, false };
|
||||
m_Animation[STATEANIM::GETUP_L] = { 334, false };
|
||||
m_Animation[STATEANIM::GETUP_L_FD] = { 336, false };
|
||||
m_Animation[STATEANIM::GETUP_L_FU] = { 338, false };
|
||||
m_Animation[STATEANIM::GETUP_R] = { 340, false };
|
||||
m_Animation[STATEANIM::GETUP_R_FD] = { 342, false };
|
||||
m_Animation[STATEANIM::GETUP_R_FU] = { 344, false };
|
||||
m_Animation[STATEANIM::GETUP_SLOUCH] = { 346, false };
|
||||
|
||||
m_Animation[STATEANIM::KNOCKBACK] = { 377, true };
|
||||
m_Animation[STATEANIM::KNOCKBACK2] = { 378, true };
|
||||
m_Animation[STATEANIM::TUMBLE] = { 379, true };
|
||||
m_Animation[STATEANIM::TUMBLE2] = { 380, true };
|
||||
m_Animation[STATEANIM::PETRIFICUSED_START] = { 383, false };
|
||||
|
||||
m_Animation[STATEANIM::DEAD_BWD] = { 317, false };
|
||||
m_Animation[STATEANIM::DEAD_BWD2] = { 318, false };
|
||||
m_Animation[STATEANIM::DEAD_FWD] = { 319, false };
|
||||
m_Animation[STATEANIM::DEAD_FWD2] = { 320, false };
|
||||
m_Animation[STATEANIM::DEAD_L] = { 321, false };
|
||||
m_Animation[STATEANIM::DEAD_L2] = { 322, false };
|
||||
m_Animation[STATEANIM::DEAD_R] = { 323, false };
|
||||
m_Animation[STATEANIM::DEAD_R2] = { 324, false };
|
||||
}
|
||||
|
||||
@@ -14,14 +14,55 @@ CInfoInstance::CInfoInstance()
|
||||
|
||||
void CInfoInstance::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
m_pPlayerInfo->Update(fTimeDelta);
|
||||
m_pMonsterInfo->Update(fTimeDelta);
|
||||
m_pMapInfo->Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CInfoInstance::Change_Level()
|
||||
{
|
||||
m_pPlayerInfo->Change_Level();
|
||||
m_pMonsterInfo->Change_Level();
|
||||
m_pMapInfo->Change_Level();
|
||||
}
|
||||
|
||||
#pragma region MONSTER_INFO
|
||||
HRESULT CInfoInstance::Regist_PlayerAlly(CUnit* pUnit)
|
||||
{
|
||||
return m_pMonsterInfo->Regist_PlayerAlly(pUnit);
|
||||
}
|
||||
|
||||
HRESULT CInfoInstance::Deregist_PlayerAlly(CUnit* pUnit)
|
||||
{
|
||||
return m_pMonsterInfo->Deregist_PlayerAlly(pUnit);
|
||||
}
|
||||
|
||||
HRESULT CInfoInstance::Regist_ActiveMonster(CMonster* pUnit)
|
||||
{
|
||||
return m_pMonsterInfo->Regist_ActiveMonster(pUnit);
|
||||
}
|
||||
|
||||
HRESULT CInfoInstance::Deregist_ActiveMonster(CMonster* pUnit)
|
||||
{
|
||||
return m_pMonsterInfo->Deregist_ActiveMonster(pUnit);
|
||||
}
|
||||
|
||||
CMonster* CInfoInstance::Get_LockOnMonster()
|
||||
{
|
||||
return m_pMonsterInfo->Get_LockOnMonster();
|
||||
}
|
||||
|
||||
pair<CUnit*, CTransform*> CInfoInstance::Get_NearestPlayerAlly(_fvector vPos)
|
||||
{
|
||||
return m_pMonsterInfo->Get_NearestPlayerAlly(vPos);
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region MAP_INFO
|
||||
HRESULT CInfoInstance::Load_MapObjects(const _char* pFilePath)
|
||||
{
|
||||
return m_pMapInfo->Load_MapObjects(pFilePath);
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
LEVEL CInfoInstance::Get_RestartLevel()
|
||||
{
|
||||
return LEVEL::GAMEPLAY;
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
#include "pch.h"
|
||||
#include "InstancedProp.h"
|
||||
#include "VIBuffer_Model_Instance.h"
|
||||
|
||||
CInstancedProp::CInstancedProp(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CGameObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CInstancedProp::CInstancedProp(const CInstancedProp& rhs)
|
||||
:CGameObject(rhs)
|
||||
{
|
||||
}
|
||||
|
||||
void CInstancedProp::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CInstancedProp::Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CInstancedProp::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
}
|
||||
|
||||
HRESULT CInstancedProp::Render()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources()))
|
||||
return E_FAIL;
|
||||
|
||||
for (_uint i = 0; i < m_iNumMesh; i++)
|
||||
{
|
||||
if (FAILED(m_pVIBufferInstanceCom->Bind_Matrial(m_pShaderCom, i)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(0)))
|
||||
return E_FAIL;
|
||||
|
||||
m_pVIBufferInstanceCom->Render(i);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CInstancedProp::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CInstancedProp::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
m_iNumMesh = m_pVIBufferInstanceCom->Get_NumMesh();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CInstancedProp::Ready_Components(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Ready_Components(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
INSTANCE_PROP_DESC* pDesc = static_cast<INSTANCE_PROP_DESC*>(pArg);
|
||||
|
||||
/* Com_VIBuffer_Instance_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, pDesc->strPrototypeTag,
|
||||
reinterpret_cast<CComponent**>(&m_pVIBufferInstanceCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Laod Instance Data */
|
||||
if(FAILED(Load_InstancedProp(pDesc->strInstanceDataPath.c_str())))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_INSTANCE_PROP_MODEL,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CInstancedProp::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CInstancedProp::Load_InstancedProp(const _char* pFilePath)
|
||||
{
|
||||
ifstream FileIn(pFilePath, ios::binary);
|
||||
|
||||
if (!FileIn.is_open())
|
||||
{
|
||||
MSG_BOX("Failed to Load InstancedProp File");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
vector<_float4x4> WorldMatrices = {};
|
||||
|
||||
_uint iNumWorldMatrix = 0;
|
||||
|
||||
FileIn.read(reinterpret_cast<char*>(&iNumWorldMatrix), sizeof(_uint));
|
||||
WorldMatrices.reserve(iNumWorldMatrix);
|
||||
|
||||
_float4x4 WorldMatrix = {};
|
||||
FileIn.read(reinterpret_cast<char*>(&WorldMatrix), sizeof(_float4x4));
|
||||
|
||||
for (_uint i = 1; i < iNumWorldMatrix; ++i)
|
||||
{
|
||||
FileIn.read(reinterpret_cast<char*>(&WorldMatrix), sizeof(_float4x4));
|
||||
|
||||
WorldMatrices.push_back(WorldMatrix);
|
||||
}
|
||||
FileIn.close();
|
||||
|
||||
if (FAILED(m_pVIBufferInstanceCom->Load_WorldData(WorldMatrices)))
|
||||
{
|
||||
MSG_BOX("Failed to Load World Matrices to VIBuffer Instance");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CInstancedProp* CInstancedProp::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CInstancedProp* pInstance = new CInstancedProp(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CInstancedProp");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CInstancedProp::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CInstancedProp* pInstance = new CInstancedProp(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CInstancedProp");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CInstancedProp::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pShaderCom);
|
||||
SAFE_RELEASE(m_pVIBufferInstanceCom);
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CInstancedProp::Describe_Entity()
|
||||
{
|
||||
}
|
||||
#endif // _DEBUG
|
||||
@@ -48,6 +48,7 @@ void CLevel_Field::Update(_float fTimeDelta)
|
||||
m_pInfoInstance->Update(fTimeDelta);
|
||||
|
||||
if (true == m_pGameInstance->Check_LevelShouldChange()) {
|
||||
m_pInfoInstance->Change_Level();
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::RESTART)))) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "Goblin.h"
|
||||
#include "Terrain.h"
|
||||
#include "EffectPool.h"
|
||||
#include "InstancedProp.h"
|
||||
|
||||
CLevel_GamePlay::CLevel_GamePlay(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
||||
@@ -70,6 +71,7 @@ void CLevel_GamePlay::Update(_float fTimeDelta)
|
||||
m_pInfoInstance->Update(fTimeDelta);
|
||||
|
||||
if (true == m_pGameInstance->Check_LevelShouldChange()) {
|
||||
m_pInfoInstance->Change_Level();
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::FIELD)))) {
|
||||
return;
|
||||
}
|
||||
@@ -104,7 +106,26 @@ HRESULT CLevel_GamePlay::Ready_Background()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* Map Containters */
|
||||
/* 테스트용 맵 */
|
||||
CInfoInstance::GetInstance()->Load_MapObjects("ClientTest");
|
||||
/* 전체 맵 */
|
||||
// CInfoInstance::GetInstance()->Load_MapObjects("Map1124");
|
||||
|
||||
|
||||
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<CInstancedProp>(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<CInstancedProp>(g_iStaticLevel, NEXT_LEVEL, LAYER_BACKGROUND, &Desc)))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ void CLevel_Logo::Update(_float fTimeDelta)
|
||||
m_pGameInstance->Set_LevelToChange();
|
||||
}
|
||||
|
||||
m_pInfoInstance->Update(fTimeDelta);
|
||||
//m_pInfoInstance->Update(fTimeDelta);
|
||||
|
||||
if (true == m_pGameInstance->Check_LevelShouldChange()) {
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::GAMEPLAY)))) {
|
||||
|
||||
@@ -27,7 +27,7 @@ void CLevel_Restart::Update(_float fTimeDelta)
|
||||
m_pGameInstance->Set_LevelToChange();
|
||||
}
|
||||
|
||||
m_pInfoInstance->Update(fTimeDelta);
|
||||
//m_pInfoInstance->Update(fTimeDelta);
|
||||
|
||||
if (true == m_pGameInstance->Check_LevelShouldChange()) {
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, m_eNextLevel)))) {
|
||||
|
||||
@@ -47,9 +47,11 @@
|
||||
|
||||
#include "Terrain.h"
|
||||
#include "VIBuffer_Terrain.h"
|
||||
#include "VIBuffer_Model_Instance.h"
|
||||
#include "BuildingContainer.h"
|
||||
#include "MapObject_Render.h"
|
||||
#include "MapObject_Collision.h"
|
||||
#include "InstancedProp.h"
|
||||
|
||||
#pragma endregion
|
||||
|
||||
@@ -288,6 +290,12 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_INSTANCE_PROP_MODEL,
|
||||
CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_VtxWorldModelInstance.hlsl"),
|
||||
VTX_MODEL_INSTANCE_MODEL::Elements, VTX_MODEL_INSTANCE_MODEL::iNumElements)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// Heavy Wall
|
||||
CRigidBody_Dynamic::RIGIDBODY_PROTOTYPE_DYNAMIC_DESC Desc{};
|
||||
{
|
||||
@@ -417,7 +425,7 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
|
||||
_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",
|
||||
@@ -451,6 +459,255 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
&Contents[jobFutures.size()]
|
||||
));
|
||||
}
|
||||
//{ /* TScrolls */
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TScrolls/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TScrolls/Collisions",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* 3BroomStick*/
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_ThreeBroomsticks/Meshes/3Broom_Kit",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
|
||||
|
||||
//{ /* BLDG_QuidditchShop */
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_QuidditchShop/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_QuidditchShop/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* BLDG_HogsheadInn */
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_HogsheadInn/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_HogsheadInn/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* BLDG_Honeydukes */
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Honeydukes/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Honeydukes/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* BLDG_OwlPost */
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_OwlPost/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_OwlPost/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* BLDG_TeaShop */
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TeaShop/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_TeaShop/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* BLDG_Zonkos */
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Zonkos/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Zonkos/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* BLDG_DB_GR */
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_DB_GR/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_DB_GR/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* BLDG_Potions */
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Potions/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Potions/Collisions",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* BLDG_Salon */
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Salon/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_Salon/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* Hengist_Tree */
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Meshes/Vegetation/Hengist_Tree",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/Common/Collision/Vegetation",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* GEN A*/
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_A/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_A/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* GEN B*/
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_B/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_B/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* GEN C*/
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_C/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_C/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* GEN E*/
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_E/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_E/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* GEN F*/
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_F/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_F/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* GEN G*/
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_G/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_G/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* GEN H*/
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_H/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_H/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
//{ /* GEN J*/
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_J/Meshes",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
// jobFutures.emplace_back(Deferred_FolderLoad(
|
||||
// "../Bin/Resources/Models/MapMesh/Game/Environment/Hogsmeade/BLDG_GEN_J/Collision",
|
||||
// ".bin", false,
|
||||
// &Contents[jobFutures.size()]
|
||||
// ));
|
||||
//}
|
||||
}
|
||||
|
||||
|
||||
for (auto& jobFuture : jobFutures)
|
||||
{
|
||||
@@ -499,11 +756,26 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CSkyBox>(g_iStaticLevel, CSkyBox::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
#pragma region MAP PROTOTYPE
|
||||
/* 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_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_SM_OakTree_MedA"),
|
||||
CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
"../Bin/Resources/Models/InstanceProp/SM_OakTree_MedA.bin",
|
||||
"../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_VIBuffer_Model_Instancel_SM_BearBerry_A */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Model_Instancel_SM_BearBerry_A"),
|
||||
CVIBuffer_Model_Instance::Create(m_pDevice, m_pContext,
|
||||
"../Bin/Resources/Models/InstanceProp/SM_BearBerry_A.bin",
|
||||
"../Bin/Resources/Data/Map/Instance/InstanceMaterial.xml"))))
|
||||
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;
|
||||
@@ -520,6 +792,11 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_Collision>(g_iStaticLevel, CMapObject_Collision::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_CInstancedProp */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CInstancedProp>(g_iStaticLevel, CInstancedProp::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
#pragma endregion // MAP PROTOTYPE
|
||||
|
||||
/* For.Prototype_Component_FSM */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CFSM>(g_iStaticLevel, CFSM::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
@@ -656,6 +933,11 @@ void APIENTRY Deferred_FolderLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContex
|
||||
return;
|
||||
}
|
||||
|
||||
if (!filesystem::exists(pDirectoryPath)) {
|
||||
MSG_BOX(" 경로 이상해 ");
|
||||
return;
|
||||
}
|
||||
|
||||
*OutContents = new vector<FOLDER_LOAD*>;
|
||||
for (const auto& file : filesystem::directory_iterator(pDirectoryPath))
|
||||
{
|
||||
@@ -663,7 +945,7 @@ void APIENTRY Deferred_FolderLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContex
|
||||
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());
|
||||
|
||||
@@ -15,6 +15,10 @@ void CMapInfo::Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CMapInfo::Change_Level()
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CMapInfo::Load_MapObjects(const _char* pFileName)
|
||||
{
|
||||
tinyxml2::XMLDocument xmlDoc;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "Monster.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "InfoInstance.h"
|
||||
#include "Player.h"
|
||||
|
||||
CMonster::CMonster(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
@@ -10,8 +11,10 @@ CMonster::CMonster(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
}
|
||||
|
||||
CMonster::CMonster(const CMonster& Prototype)
|
||||
: CUnit(Prototype)
|
||||
: CUnit(Prototype),
|
||||
m_pInfoInstance(CInfoInstance::GetInstance())
|
||||
{
|
||||
SAFE_ADDREF(m_pInfoInstance);
|
||||
}
|
||||
|
||||
HRESULT CMonster::Initialize_Prototype()
|
||||
@@ -21,28 +24,37 @@ HRESULT CMonster::Initialize_Prototype()
|
||||
|
||||
HRESULT CMonster::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
if (FAILED(__super::Initialize(pArg))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pPlayerTransform = static_cast<CPlayer*>(pArg)->Get_Component<CTransform>();
|
||||
SAFE_ADDREF(m_pPlayerTransform);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMonster::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
m_pTransformCom->RewindMomentum();
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CMonster::Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
_vector vCurrentPos = Get_WorldPostion();
|
||||
pair<CUnit*, CTransform*> pairTarget = m_pInfoInstance->Get_NearestPlayerAlly(vCurrentPos);
|
||||
if (nullptr != pairTarget.first) {
|
||||
Set_Target(*pairTarget.first, *pairTarget.second);
|
||||
}
|
||||
if (nullptr != m_pTarget && m_pTarget->isDead()) {
|
||||
SAFE_RELEASE(m_pTarget);
|
||||
m_fTargetDistance = { FLT_MAX };
|
||||
}
|
||||
__super::Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CMonster::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
m_fTargetDistance = m_pTransformCom->TargetDis(m_pPlayerTransform->Get_State(STATE::POSITION));
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
HRESULT CMonster::Render()
|
||||
@@ -56,8 +68,9 @@ HRESULT CMonster::Ready_Components(void*pArg)
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom)))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -67,11 +80,25 @@ HRESULT CMonster::Bind_ShaderResources()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMonster::Set_Target(CUnit& pTarget, CTransform& pTransform)
|
||||
{
|
||||
SAFE_RELEASE(m_pTarget);
|
||||
m_pTarget = &pTarget;
|
||||
SAFE_ADDREF(m_pTarget);
|
||||
|
||||
_vector vTargetPos = pTransform.Get_State(STATE::POSITION);
|
||||
_vector vToTargetDir = vTargetPos - Get_WorldPostion();
|
||||
XMStoreFloat4(&m_vTargetPos, vTargetPos);
|
||||
XMStoreFloat3(&m_vToTargetDir, XMVector3Normalize(vToTargetDir));
|
||||
m_fTargetDistance = XMVectorGetX(XMVector3Length(vToTargetDir));
|
||||
}
|
||||
|
||||
void CMonster::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pPlayerTransform);
|
||||
SAFE_RELEASE(m_pTarget);
|
||||
SAFE_RELEASE(m_pInfoInstance);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "MonsterInfo.h"
|
||||
#include "GameInstance.h"
|
||||
#include "InfoInstance.h"
|
||||
#include "Monster.h"
|
||||
|
||||
CMonsterInfo::CMonsterInfo()
|
||||
{
|
||||
@@ -9,6 +10,150 @@ CMonsterInfo::CMonsterInfo()
|
||||
|
||||
void CMonsterInfo::Update(_float fTimeDelta)
|
||||
{
|
||||
Refresh_PlayerAllies();
|
||||
Refresh_LockOnMonsters();
|
||||
}
|
||||
|
||||
void CMonsterInfo::Change_Level()
|
||||
{
|
||||
SAFE_RELEASE(m_pLockOnMonster);
|
||||
for (CMonster* pMonster : m_ActiveMonsters) {
|
||||
SAFE_RELEASE(pMonster);
|
||||
} m_ActiveMonsters.clear();
|
||||
for (CUnit* pPlayerAlly : m_PlayerAllies) {
|
||||
SAFE_RELEASE(pPlayerAlly);
|
||||
} m_PlayerAllies.clear();
|
||||
}
|
||||
|
||||
HRESULT CMonsterInfo::Regist_PlayerAlly(CUnit* pUnit)
|
||||
{
|
||||
for (CUnit* pAlly : m_PlayerAllies) {
|
||||
if (pAlly == pUnit) {
|
||||
return E_ACCESSDENIED;
|
||||
}
|
||||
} m_PlayerAllies.push_back(pUnit);
|
||||
SAFE_ADDREF(pUnit);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMonsterInfo::Deregist_PlayerAlly(CUnit* pUnit)
|
||||
{
|
||||
for (list<CUnit*>::iterator iter = m_PlayerAllies.begin(); iter != m_PlayerAllies.end();) {
|
||||
if (*iter == pUnit) {
|
||||
SAFE_RELEASE(*iter);
|
||||
m_PlayerAllies.erase(iter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CMonsterInfo::Regist_ActiveMonster(CMonster* pUnit)
|
||||
{
|
||||
for (CMonster* pMonster : m_ActiveMonsters) {
|
||||
if (pMonster == pUnit) {
|
||||
return E_ACCESSDENIED;
|
||||
}
|
||||
} m_ActiveMonsters.push_back(pUnit);
|
||||
SAFE_ADDREF(pUnit);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMonsterInfo::Deregist_ActiveMonster(CMonster* pUnit)
|
||||
{
|
||||
for (list<CMonster*>::iterator iter = m_ActiveMonsters.begin(); iter != m_ActiveMonsters.end();) {
|
||||
if (*iter == pUnit) {
|
||||
SAFE_RELEASE(*iter);
|
||||
m_ActiveMonsters.erase(iter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
CMonster* CMonsterInfo::Get_LockOnMonster()
|
||||
{
|
||||
return m_pLockOnMonster;
|
||||
}
|
||||
|
||||
pair<CUnit*, CTransform*> CMonsterInfo::Get_NearestPlayerAlly(_fvector vPos)
|
||||
{
|
||||
_float fLengthMAX = FLT_MAX;
|
||||
CTransform* pNearestPlayerAllyTransform = { nullptr };
|
||||
CUnit* pNearestPlayerAlly = { nullptr };
|
||||
|
||||
for (list<CUnit*>::iterator iter = m_PlayerAllies.begin(); iter != m_PlayerAllies.end(); ++iter) {
|
||||
|
||||
CTransform* pTransform = (*iter)->Get_Component<CTransform>();
|
||||
_float fNewLength = XMVectorGetX(XMVector3LengthSq(pTransform->Get_State(STATE::POSITION) - vPos));
|
||||
|
||||
if (nullptr == pNearestPlayerAlly) {
|
||||
pNearestPlayerAlly = (*iter);
|
||||
fLengthMAX = fNewLength;
|
||||
pNearestPlayerAllyTransform = pTransform;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (fNewLength < fLengthMAX) {
|
||||
pNearestPlayerAlly = (*iter);
|
||||
pNearestPlayerAllyTransform = pTransform;
|
||||
fLengthMAX = fNewLength;
|
||||
}
|
||||
}
|
||||
return { pNearestPlayerAlly, pNearestPlayerAllyTransform };
|
||||
}
|
||||
|
||||
HRESULT CMonsterInfo::Refresh_LockOnMonsters()
|
||||
{
|
||||
SAFE_RELEASE(m_pLockOnMonster);
|
||||
_vector vCameraLook = m_pGameInstance->Get_CameraLook();
|
||||
_vector vCameraPos = m_pGameInstance->Get_CamXMPosition();
|
||||
_float fMaxDot = { 0.f };
|
||||
|
||||
_vector vMonsterPos;
|
||||
_vector vToMonsterDir;
|
||||
|
||||
{ // 뷰프러스텀 순회해서 가장 중앙에 근접한 몬스터 찾기
|
||||
for (list<CMonster*>::iterator iter = m_ActiveMonsters.begin(); iter != m_ActiveMonsters.end(); ++iter) {
|
||||
|
||||
// (카메라의 룩)과 (카메라 -> 몬스터 방향 벡터)를 내적해서 가장 큰 크기가 나온 몬스타가 락온 대상
|
||||
vMonsterPos = (*iter)->Get_WorldPostion();
|
||||
vToMonsterDir = vMonsterPos - vCameraPos;
|
||||
_float fDotResult = CMyTools::DirectionCompare(vCameraLook, vToMonsterDir);
|
||||
if (fDotResult <= 0.f) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (nullptr == m_pLockOnMonster) {
|
||||
m_pLockOnMonster = (*iter);
|
||||
fMaxDot = fDotResult;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (fMaxDot < fDotResult) {
|
||||
m_pLockOnMonster = (*iter);
|
||||
fMaxDot = fDotResult;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nullptr != m_pLockOnMonster) {
|
||||
SAFE_ADDREF(m_pLockOnMonster);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMonsterInfo::Refresh_PlayerAllies()
|
||||
{
|
||||
for (list<CUnit*>::iterator iter = m_PlayerAllies.begin(); iter != m_PlayerAllies.end();) {
|
||||
if (true == (*iter)->isDead()) {
|
||||
SAFE_RELEASE(*iter);
|
||||
iter = m_PlayerAllies.erase(iter);
|
||||
}
|
||||
else {
|
||||
iter++;
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMonsterInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex)
|
||||
@@ -23,7 +168,6 @@ HRESULT CMonsterInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pCo
|
||||
SAFE_ADDREF(m_pDevice);
|
||||
SAFE_ADDREF(m_pContext);
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -42,9 +186,16 @@ void CMonsterInfo::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pLockOnMonster);
|
||||
for (CMonster* pMonster : m_ActiveMonsters) {
|
||||
SAFE_RELEASE(pMonster);
|
||||
} m_ActiveMonsters.clear();
|
||||
for (CUnit* pAlly : m_PlayerAllies) {
|
||||
SAFE_RELEASE(pAlly);
|
||||
} m_PlayerAllies.clear();
|
||||
|
||||
SAFE_RELEASE(m_pGameInstance);
|
||||
SAFE_RELEASE(m_pInfoInstance);
|
||||
SAFE_RELEASE(m_pDevice);
|
||||
SAFE_RELEASE(m_pContext);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "Player.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "InfoInstance.h"
|
||||
#include "CamPosition_Socket.h"
|
||||
#include "Camera_Gaze.h"
|
||||
#include "CamPosition_Arm.h"
|
||||
@@ -29,8 +30,10 @@ CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
}
|
||||
|
||||
CPlayer::CPlayer(const CPlayer& Prototype)
|
||||
: CUnit(Prototype)
|
||||
: CUnit(Prototype),
|
||||
m_pInfoInstance(CInfoInstance::GetInstance())
|
||||
{
|
||||
SAFE_ADDREF(m_pInfoInstance);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Initialize_Prototype()
|
||||
@@ -77,6 +80,9 @@ HRESULT CPlayer::Initialize(void* pArg)
|
||||
m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object<CEffectPool>();
|
||||
SAFE_ADDREF(m_pEffectPool);
|
||||
|
||||
m_pInfoInstance->Regist_PlayerAlly(this);
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
m_BasicEffect = make_unique<BasicEffect>(m_pDevice);
|
||||
m_BasicEffect->SetVertexColorEnabled(true);
|
||||
@@ -366,8 +372,8 @@ void CPlayer::Free()
|
||||
SAFE_RELEASE(m_pCamPosition_TopDown_FollowPart);
|
||||
SAFE_RELEASE(m_pCamPosition_TopDown_LookPart);
|
||||
SAFE_RELEASE(m_pCamPosition_ShoulderPart);
|
||||
|
||||
SAFE_RELEASE(m_pEffectPool);
|
||||
SAFE_RELEASE(m_pInfoInstance);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
|
||||
@@ -11,6 +11,10 @@ void CPlayerInfo::Update(_float fTimeDelta)
|
||||
{
|
||||
}
|
||||
|
||||
void CPlayerInfo::Change_Level()
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CPlayerInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex)
|
||||
{
|
||||
m_pGameInstance = CGameInstance::GetInstance();
|
||||
|
||||
@@ -22,6 +22,20 @@
|
||||
|
||||
#include "EffectPool.h"
|
||||
|
||||
template<typename T>
|
||||
void CPlayer::Spawn_Effect()
|
||||
{
|
||||
CPartObject::PARTOBJECT_DESC PartsDesc{};
|
||||
|
||||
PartsDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<T>(NEXT_LEVEL, NEXT_LEVEL, TEXT("Layer_Effect"), &PartsDesc, this, nullptr))) {
|
||||
assert(false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma region States
|
||||
void CPlayer::TestKeyInput(_float fTimeDelta)
|
||||
{
|
||||
@@ -64,6 +78,7 @@ HRESULT CPlayer::InputAction()
|
||||
|| m_pGameInstance->Key_Down(DIK_LSHIFT)
|
||||
|| m_pGameInstance->Key_Down(DIK_C)
|
||||
|| m_pGameInstance->Key_Down(DIK_V)
|
||||
|| m_pGameInstance->Key_Down(DIK_Z)
|
||||
)
|
||||
{
|
||||
return S_OK;
|
||||
@@ -83,6 +98,18 @@ HRESULT CPlayer::InputMove()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputKeyUpMove()
|
||||
{
|
||||
if (m_pGameInstance->Key_Up(DIK_W)
|
||||
|| m_pGameInstance->Key_Up(DIK_A)
|
||||
|| m_pGameInstance->Key_Up(DIK_S)
|
||||
|| m_pGameInstance->Key_Up(DIK_D))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
HRESULT CPlayer::InputSpell()
|
||||
{
|
||||
if (
|
||||
@@ -108,11 +135,12 @@ void CPlayer::Behavior_IdleEnter() {
|
||||
|
||||
// S_OK -> 현 상태 유지
|
||||
// E_FAIL -> 현 상태 탈출
|
||||
HRESULT CPlayer::Behavior_IdleExitCheck()
|
||||
HRESULT CPlayer::Behavior_IdleExitCheck(_float fTimeDelta)
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo;
|
||||
_vector xmvLook = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f));
|
||||
_vector xmvRight = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::RIGHT), 0.f));
|
||||
_uint iCurrentAnimIndex = m_pModelCom->Get_AnimIndex();
|
||||
if (SUCCEEDED(InputAction()) || SUCCEEDED(InputSpell())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
@@ -138,37 +166,77 @@ HRESULT CPlayer::Behavior_IdleExitCheck()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W))
|
||||
if (SUCCEEDED(InputMove()))
|
||||
{
|
||||
m_fInputTime += fTimeDelta;
|
||||
if (m_fInputTime > 0.2f)
|
||||
{
|
||||
m_fInputTime = 0.f;
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pGameInstance->Key_Down(DIK_D))
|
||||
if (SUCCEEDED(InputKeyUpMove()))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_R];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
_vector xmvInputDir = XMVectorZero();
|
||||
|
||||
_vector xmvCamLook = XMVector4Normalize(XMVectorSet(m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z, 0.f));
|
||||
_vector xmvCamRight = XMVector4Normalize(XMVectorSet(m_vCameraRightDir.x, 0.f, m_vCameraRightDir.z, 0.f));
|
||||
|
||||
if (m_pGameInstance->Key_Up(DIK_W))
|
||||
xmvInputDir += xmvCamLook;
|
||||
if (m_pGameInstance->Key_Up(DIK_S))
|
||||
xmvInputDir -= xmvCamLook;
|
||||
if (m_pGameInstance->Key_Up(DIK_A))
|
||||
xmvInputDir -= xmvCamRight;
|
||||
if (m_pGameInstance->Key_Up(DIK_D))
|
||||
xmvInputDir += xmvCamRight;
|
||||
|
||||
if (XMVector3Equal(xmvInputDir, XMVectorZero()))
|
||||
return E_FAIL;
|
||||
|
||||
xmvInputDir = XMVector3Normalize(xmvInputDir);
|
||||
|
||||
_float2 vInputDir = { XMVectorGetX(xmvInputDir),XMVectorGetZ(xmvInputDir) };
|
||||
|
||||
_vector xmvCurLook = XMVector4Normalize(
|
||||
XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f));
|
||||
_float2 vCurLook = { XMVectorGetX(xmvCurLook),XMVectorGetZ(xmvCurLook) };
|
||||
|
||||
_float vDir = CMyTools::Get_Direction2D(vCurLook, vInputDir);
|
||||
_float absDir = fabsf(vDir);
|
||||
|
||||
_float cross = vCurLook.x * vInputDir.y - vCurLook.y * vInputDir.x;
|
||||
|
||||
if (m_pFSM->IsEnable(FSMSTATE::IDLE))
|
||||
{
|
||||
if (absDir < XMConvertToRadians(45.f))
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
else if (absDir < XMConvertToRadians(135.f))
|
||||
{
|
||||
if (cross > 0.f) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_L];
|
||||
}
|
||||
else {
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_R];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_BWD];
|
||||
}
|
||||
|
||||
m_pFSM->Enable_State(FSMSTATE::IDLE_TURN);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,m_fAmount);
|
||||
}
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_pGameInstance->Key_Down(DIK_A))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_L];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_pGameInstance->Key_Down(DIK_S))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE_TURN_BWD];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
if (m_pModelCom->IsFinishedAnim())
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
@@ -179,7 +247,7 @@ HRESULT CPlayer::Behavior_IdleExitCheck()
|
||||
|
||||
void CPlayer::Behavior_IdleExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::IDLE);
|
||||
m_pFSM->Disable_State(FSMSTATE::IDLE | FSMSTATE::IDLE_TURN);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveEnter()
|
||||
@@ -213,15 +281,10 @@ void CPlayer::Behavior_MoveEnter()
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
if (bFoward)
|
||||
if (SUCCEEDED(InputMove()))
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
else if (bBackward)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_BWD];
|
||||
m_fAmount = 0.2f;
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // While Moving
|
||||
@@ -245,14 +308,12 @@ void CPlayer::Behavior_MoveEnter()
|
||||
m_pFSM->Enable_State(FSMSTATE::JOG);
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
if (bFoward)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
m_bRatio = true;
|
||||
}
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, m_fAmount);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, m_fAmount, m_bRatio);
|
||||
m_fAmount = 1.f;
|
||||
}
|
||||
|
||||
@@ -285,6 +346,9 @@ HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Z)) {
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LSHIFT)) {
|
||||
m_bSprintToggle = !m_bSprintToggle;
|
||||
m_bWalkToggle = false;
|
||||
@@ -323,29 +387,36 @@ HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
}
|
||||
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
_vector xmvPlayerDir = { };
|
||||
_vector xmvInputDir = XMVectorZero();
|
||||
|
||||
{ // 이동방향 누적
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W)) {
|
||||
xmvPlayerDir += xmvLook;
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)) {
|
||||
xmvPlayerDir -= xmvRight;
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_S)) {
|
||||
xmvPlayerDir -= xmvLook;
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)) {
|
||||
xmvPlayerDir += xmvRight;
|
||||
}
|
||||
}
|
||||
_vector xmvCamLook = XMVector4Normalize(XMVectorSet(m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z, 0.f));
|
||||
_vector xmvCamRight = XMVector4Normalize(XMVectorSet(m_vCameraRightDir.x, 0.f, m_vCameraRightDir.z, 0.f));
|
||||
|
||||
xmvPlayerDir = XMVectorSetW(XMVector3Normalize(xmvPlayerDir), 0.f);
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W))
|
||||
xmvInputDir += xmvCamLook;
|
||||
if (m_pGameInstance->Key_Pressing(DIK_S))
|
||||
xmvInputDir -= xmvCamLook;
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A))
|
||||
xmvInputDir -= xmvCamRight;
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D))
|
||||
xmvInputDir += xmvCamRight;
|
||||
|
||||
_float2 vPlayerDir = { XMVectorGetX(xmvPlayerDir), XMVectorGetZ(xmvPlayerDir) };
|
||||
_float2 vCameraLookDir = { m_vCameraLookDir.x, m_vCameraLookDir.z };
|
||||
if (XMVector3Equal(xmvInputDir, XMVectorZero()))
|
||||
return E_FAIL;
|
||||
|
||||
xmvInputDir = XMVector3Normalize(xmvInputDir);
|
||||
|
||||
_float2 vInputDir = { XMVectorGetX(xmvInputDir),XMVectorGetZ(xmvInputDir) };
|
||||
|
||||
_vector xmvCurLook = XMVector4Normalize(
|
||||
XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f));
|
||||
_float2 vCurLook = { XMVectorGetX(xmvCurLook),XMVectorGetZ(xmvCurLook) };
|
||||
|
||||
_float vDir = CMyTools::Get_Direction2D(vCurLook, vInputDir);
|
||||
_float absDir = fabsf(vDir);
|
||||
|
||||
_float cross = vCurLook.x * vInputDir.y - vCurLook.y * vInputDir.x;
|
||||
|
||||
_float vDir = CMyTools::Get_Direction2D(vCameraLookDir, vPlayerDir);
|
||||
_bool bSkipAngleCheck = { false };
|
||||
if (m_pFSM->IsEnable(FSMSTATE::JOG)) {
|
||||
if (iCurrentAnimIndex != m_Animation[STATEANIM::JOG_FWD].first) {
|
||||
@@ -357,38 +428,31 @@ HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
}
|
||||
}
|
||||
if (!bSkipAngleCheck) {
|
||||
_bool bLeft = { true };
|
||||
if (vDir < 0.f)
|
||||
{
|
||||
// + left
|
||||
}
|
||||
else
|
||||
{
|
||||
// - Right
|
||||
}
|
||||
|
||||
_float absDir = fabsf(vDir);
|
||||
if (absDir < XMConvertToRadians(160.f)) {
|
||||
if (absDir <= XMConvertToRadians(80.f)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
}
|
||||
else if (absDir < XMConvertToRadians(90.f)) {
|
||||
// pairAnimInfo = m_Animation[STATEANIM::]
|
||||
else if (absDir < XMConvertToRadians(160.f)) {
|
||||
if (cross > 0)
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_LEFT];
|
||||
m_fAmount = 0.2f;
|
||||
m_bRatio = true;
|
||||
}
|
||||
else {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_RIGHT];
|
||||
m_fAmount = 0.2f;
|
||||
m_bRatio = true;
|
||||
}
|
||||
}
|
||||
else if (absDir < XMConvertToRadians(112.f)) {
|
||||
// pairAnimInfo = m_Animation[STATEANIM::]
|
||||
}
|
||||
else if (absDir < XMConvertToRadians(135.f)) {
|
||||
// pairAnimInfo = m_Animation[STATEANIM::]
|
||||
}
|
||||
else if (absDir < XMConvertToRadians(180.f)) {
|
||||
else {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_BWD];
|
||||
|
||||
m_fAmount = 0.2f;
|
||||
m_bRatio = true;
|
||||
}
|
||||
|
||||
{ // left Right
|
||||
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,m_fAmount, m_bRatio);
|
||||
m_fAmount = 1.f;
|
||||
}
|
||||
}
|
||||
return S_OK;
|
||||
@@ -413,7 +477,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
}
|
||||
else if (IsCurrentKeyFrame("Dodge"))
|
||||
else if (IsCurrentKeyFrame("TurnStop"))
|
||||
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
@@ -574,7 +638,10 @@ void CPlayer::Behavior_CombatEnter()
|
||||
else if (m_pGameInstance->Key_Down(DIK_V)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::MAPHELP);
|
||||
pairAnimInfo = m_Animation[STATEANIM::MAPHELP];
|
||||
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Z)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::ANCIENT_THROW);
|
||||
pairAnimInfo = m_Animation[STATEANIM::ANCIENT_THROW];
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
@@ -629,6 +696,11 @@ HRESULT CPlayer::Behavior_CombatExitCheck()
|
||||
pairAnimInfo = m_Animation[STATEANIM::MAPHELP];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Z)) {
|
||||
m_pFSM->Enable_State(FSMSTATE::ANCIENT_THROW);
|
||||
pairAnimInfo = m_Animation[STATEANIM::ANCIENT_THROW];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pFSM->IsEnable(FSMSTATE::SPELL) && IsCurrentKeyFrame("Combat"))
|
||||
@@ -639,32 +711,43 @@ HRESULT CPlayer::Behavior_CombatExitCheck()
|
||||
{
|
||||
case STATEANIM::ACCIO:
|
||||
{
|
||||
/* TODO 임시 방편 */
|
||||
pairAnimInfo = m_Animation[STATEANIM::ACCIO];
|
||||
|
||||
|
||||
m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARD, this);
|
||||
|
||||
}
|
||||
break;
|
||||
case STATEANIM::DESCENDO:
|
||||
pairAnimInfo = m_Animation[STATEANIM::DESCENDO];
|
||||
|
||||
m_pEffectPool->Use_Skill(SKILL_TYPE::DECENDO, this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
m_eSpell = STATEANIM::END;
|
||||
m_pModelCom->Anim_Event(0.1f, m_Animation[STATEANIM::ACCIO].first, [this]() {
|
||||
Spawn_Effect<CBombard>();
|
||||
m_eSpell = STATEANIM::END;
|
||||
return E_FAIL;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (m_pFSM->IsEnable(FSMSTATE::ANCIENT_THROW))
|
||||
{
|
||||
if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Throw")) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Combat")) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Combat")) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
@@ -676,7 +759,7 @@ HRESULT CPlayer::Behavior_CombatExitCheck()
|
||||
|
||||
void CPlayer::Behavior_CombatExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::LIGHT_ATTACK | FSMSTATE::SPELL | FSMSTATE::SKILL | FSMSTATE::SKILL2 | FSMSTATE::MAPHELP);
|
||||
m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::LIGHT_ATTACK | FSMSTATE::SPELL | FSMSTATE::SKILL | FSMSTATE::SKILL2 | FSMSTATE::MAPHELP | FSMSTATE::ANCIENT_THROW);
|
||||
}
|
||||
|
||||
void CPlayer::Add_FSM()
|
||||
@@ -686,7 +769,7 @@ void CPlayer::Add_FSM()
|
||||
CState_Idle::STATE_IDLE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(fTimedelta); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_IdleExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
@@ -703,9 +786,13 @@ void CPlayer::Add_FSM()
|
||||
_vector xmvPlayerDir = { };
|
||||
|
||||
{
|
||||
_float3 fMove = m_pGameInstance->Get_MouseMove();
|
||||
m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.x* 0.1f);
|
||||
m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.y * 0.1f);
|
||||
if (!m_pFSM->IsEnable(FSMSTATE::STOP))
|
||||
{
|
||||
_float3 fMove = m_pGameInstance->Get_MouseMove();
|
||||
m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.x * 0.05f);
|
||||
m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta * fMove.y * 0.05f);
|
||||
}
|
||||
|
||||
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)) {
|
||||
xmvPlayerDir -= xmvRight;
|
||||
@@ -721,10 +808,10 @@ void CPlayer::Add_FSM()
|
||||
|
||||
_float vDir = CMyTools::Get_Direction2D(vCameraLookDir, vPlayerDir);
|
||||
_float absDir = fabsf(vDir);
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)&& vDir < XMConvertToRadians(140.f) ) {
|
||||
/*if (m_pGameInstance->Key_Pressing(DIK_A)&& vDir < XMConvertToRadians(140.f) ) {
|
||||
m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)&& vDir > XMConvertToRadians(-140.f) ) {
|
||||
m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); };
|
||||
m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); };*/
|
||||
|
||||
};
|
||||
|
||||
@@ -783,7 +870,7 @@ void CPlayer::Add_FSM()
|
||||
|
||||
void CPlayer::Set_Anim()
|
||||
{
|
||||
m_Animation[STATEANIM::IDLE] = { 817,true };
|
||||
m_Animation[STATEANIM::IDLE] = { 266,true };
|
||||
m_Animation[STATEANIM::IDLE_TURN_L] = { 270,false };
|
||||
m_Animation[STATEANIM::IDLE_TURN_R] = { 430,false };
|
||||
m_Animation[STATEANIM::IDLE_TURN_BWD] = { 268,false };
|
||||
@@ -793,7 +880,9 @@ void CPlayer::Set_Anim()
|
||||
m_Animation[STATEANIM::WALK_STOP] = { 344,false };
|
||||
|
||||
m_Animation[STATEANIM::JOG_FWD] = { 167,true };
|
||||
m_Animation[STATEANIM::JOG_BWD] = { 154,false };
|
||||
m_Animation[STATEANIM::JOG_LEFT] = { 164,false };
|
||||
m_Animation[STATEANIM::JOG_RIGHT] = { 185,false };
|
||||
m_Animation[STATEANIM::JOG_BWD] = { 154,false };//176
|
||||
m_Animation[STATEANIM::JOG_STOP] = { 289,false };
|
||||
|
||||
m_Animation[STATEANIM::JUMP] = { 205,false };
|
||||
@@ -819,6 +908,7 @@ void CPlayer::Set_Anim()
|
||||
m_Animation[STATEANIM::LUMOS] = { 782,false };
|
||||
m_Animation[STATEANIM::DISILLUSION_ENTER] = { 585,false };
|
||||
m_Animation[STATEANIM::DISILLUSION_EXIT] = { 586,false };
|
||||
m_Animation[STATEANIM::ANCIENT_THROW] = { 843,false };
|
||||
}
|
||||
#pragma endregion State
|
||||
|
||||
|
||||
@@ -166,8 +166,9 @@ HRESULT CTerrain::Bind_ShaderResources()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fUsingSurfaceParams", &m_fUsingSurfaceParams, sizeof(_float))))
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fUsingSurfaceParams", &m_fUsingSurfaceParams, sizeof(_float)))){
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Client
|
||||
{
|
||||
const unsigned int g_iWinSizeX = 1920;
|
||||
const unsigned int g_iWinSizeY = 1080;
|
||||
|
||||
class CInfoInstance;
|
||||
}
|
||||
|
||||
using namespace Client;
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Client
|
||||
enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, END };
|
||||
enum class SHADER_PASS_PARTICLE { EXPLOSION, END };
|
||||
enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, TRAIL_BLUR, END };
|
||||
enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, END };
|
||||
enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR, WEIGHTBLEND, NON_WORLD, NON_WORLD_BLUR, ALPHA_BLEND, END };
|
||||
enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, MISSION, QUESTYPE, UVMULT, NINECLICE, ROTATION, SLOT, END };
|
||||
|
||||
enum class EFFECT_TYPE { EFFECT, TRAIL, END };
|
||||
|
||||
@@ -10,15 +10,16 @@ namespace Client {
|
||||
|
||||
|
||||
#pragma region FX_NAME
|
||||
#define FX_ANIMMESH TEXT("FX_ANIMMESH")
|
||||
#define FX_MESH TEXT("FX_MESH")
|
||||
#define FX_POSTEX TEXT("FX_POSTEX")
|
||||
#define FX_NORTEX TEXT("FX_NORTEX")
|
||||
#define FX_CELL TEXT("FX_CELL")
|
||||
#define FX_PARTICLE TEXT("FX_PARTICLE")
|
||||
#define FX_INSTANCE_MODEL TEXT("FX_INSTANCE_MODEL")
|
||||
#define FX_UIEDITOR TEXT("FX_UIEDITOR")
|
||||
#define FX_UIINSTANCE TEXT("FX_UIINSTANCE")
|
||||
#define FX_ANIMMESH TEXT("FX_ANIMMESH")
|
||||
#define FX_MESH TEXT("FX_MESH")
|
||||
#define FX_POSTEX TEXT("FX_POSTEX")
|
||||
#define FX_NORTEX TEXT("FX_NORTEX")
|
||||
#define FX_CELL TEXT("FX_CELL")
|
||||
#define FX_PARTICLE TEXT("FX_PARTICLE")
|
||||
#define FX_INSTANCE_MODEL TEXT("FX_INSTANCE_MODEL")
|
||||
#define FX_INSTANCE_PROP_MODEL TEXT("FX_INSTANCE_PROP_MODEL")
|
||||
#define FX_UIEDITOR TEXT("FX_UIEDITOR")
|
||||
#define FX_UIINSTANCE TEXT("FX_UIINSTANCE")
|
||||
|
||||
#pragma endregion
|
||||
#pragma region MACRO_PROTOTYPE
|
||||
|
||||
@@ -15,8 +15,6 @@ class CGoblin final : public CMonster
|
||||
virtual ~CGoblin() = 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;
|
||||
@@ -30,6 +28,8 @@ class CGoblin final : public CMonster
|
||||
CRigidBody_Dynamic* m_pRigidBody = { nullptr };
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Bind_ShaderResources();
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
class CTransform;
|
||||
class CUnit;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
@@ -21,8 +23,17 @@ class CInfoInstance final : public CBase
|
||||
LEVEL Get_RestartLevel();
|
||||
public:
|
||||
void Update(_float fTimeDelta);
|
||||
void Change_Level();
|
||||
|
||||
#pragma region MONSTER_INFO
|
||||
HRESULT Regist_PlayerAlly(CUnit* pUnit);
|
||||
HRESULT Deregist_PlayerAlly(CUnit* pUnit);
|
||||
HRESULT Regist_ActiveMonster(class CMonster* pUnit);
|
||||
HRESULT Deregist_ActiveMonster(class CMonster* pUnit);
|
||||
|
||||
class CMonster* Get_LockOnMonster();
|
||||
pair<CUnit*, CTransform*> Get_NearestPlayerAlly(_fvector vPos);
|
||||
#pragma endregion
|
||||
#pragma region MAP_INFO
|
||||
HRESULT Load_MapObjects(const _char* pFilePath);
|
||||
#pragma endregion
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CVIBuffer_Model_Instance;
|
||||
class CShader;
|
||||
class CTexture;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CInstancedProp final : public CGameObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagInstancedPropDesc
|
||||
{
|
||||
_wstring strPrototypeTag;
|
||||
_string strInstanceDataPath;
|
||||
}INSTANCE_PROP_DESC;
|
||||
private:
|
||||
CInstancedProp(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CInstancedProp(const CInstancedProp& rhs);
|
||||
virtual ~CInstancedProp() = 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;
|
||||
|
||||
private:
|
||||
_uint m_iNumMesh = {};
|
||||
CVIBuffer_Model_Instance* m_pVIBufferInstanceCom = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
virtual HRESULT Bind_ShaderResources() override;
|
||||
|
||||
HRESULT Load_InstancedProp(const _char* pFilePath);
|
||||
|
||||
public:
|
||||
static CInstancedProp* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -16,6 +16,7 @@ class CMapInfo final : public CBase
|
||||
~CMapInfo() = default;
|
||||
public:
|
||||
void Update(_float fTimeDelta);
|
||||
void Change_Level();
|
||||
HRESULT Load_MapObjects(const _char* pFilePath);
|
||||
|
||||
|
||||
|
||||
@@ -13,20 +13,24 @@ class CMonster abstract : public CUnit
|
||||
virtual ~CMonster() = 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;
|
||||
|
||||
protected:
|
||||
CTransform* m_pPlayerTransform = { nullptr };
|
||||
_float m_fTargetDistance = {};
|
||||
CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
CUnit* m_pTarget = { nullptr };
|
||||
_float4 m_vTargetPos = { };
|
||||
_float3 m_vToTargetDir = { };
|
||||
_float m_fTargetDistance = { FLT_MAX };
|
||||
|
||||
protected:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
HRESULT Ready_Components(void* pArg);
|
||||
HRESULT Bind_ShaderResources();
|
||||
void Set_Target(CUnit& pTarget, CTransform& pTransform);
|
||||
|
||||
public:
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)PURE;
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
class CUnit;
|
||||
class CTransform;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
@@ -16,6 +18,15 @@ class CMonsterInfo final : public CBase
|
||||
~CMonsterInfo() = default;
|
||||
public:
|
||||
void Update(_float fTimeDelta);
|
||||
void Change_Level();
|
||||
|
||||
HRESULT Regist_PlayerAlly(CUnit* pUnit);
|
||||
HRESULT Deregist_PlayerAlly(CUnit* pUnit);
|
||||
HRESULT Regist_ActiveMonster(class CMonster* pUnit);
|
||||
HRESULT Deregist_ActiveMonster(class CMonster* pUnit);
|
||||
|
||||
class CMonster* Get_LockOnMonster();
|
||||
pair<CUnit*, CTransform*> Get_NearestPlayerAlly(_fvector vPos);
|
||||
|
||||
private:
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
@@ -23,8 +34,15 @@ class CMonsterInfo final : public CBase
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
ID3D11DeviceContext* m_pContext = { nullptr };
|
||||
|
||||
class CMonster* m_pLockOnMonster = { nullptr };
|
||||
list<class CMonster*> m_ActiveMonsters = {};
|
||||
list<CUnit*> m_PlayerAllies = {};
|
||||
|
||||
private:
|
||||
HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex);
|
||||
HRESULT Refresh_LockOnMonsters();
|
||||
HRESULT Refresh_PlayerAllies();
|
||||
|
||||
|
||||
public:
|
||||
static CMonsterInfo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex);
|
||||
|
||||
@@ -23,6 +23,7 @@ class CPlayer final : public CUnit
|
||||
_bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; }
|
||||
|
||||
private:
|
||||
CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
_float m_fDirectionRadian = 0.f;
|
||||
|
||||
_bool m_bSprintToggle = { false };
|
||||
@@ -68,20 +69,27 @@ class CPlayer final : public CUnit
|
||||
public:
|
||||
virtual void Reset_Sprint() { m_bSprintToggle = false; }
|
||||
virtual void Reset_Walk() { m_bWalkToggle = false; }
|
||||
template<typename T>
|
||||
void Spawn_Effect();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
void TestKeyInput(_float fTimeDelta);
|
||||
virtual void Add_FSM();
|
||||
virtual void Set_Anim();
|
||||
|
||||
_float m_fAmount = { 1.f };
|
||||
_float m_fInputTime = {};
|
||||
_bool m_bRatio = { false };
|
||||
|
||||
HRESULT InputAction();
|
||||
HRESULT InputMove();
|
||||
HRESULT InputKeyUpMove();
|
||||
HRESULT InputSpell();
|
||||
|
||||
void Behavior_IdleEnter();
|
||||
HRESULT Behavior_IdleExitCheck();
|
||||
HRESULT Behavior_IdleExitCheck(_float fTimeDelta);
|
||||
void Behavior_IdleExit();
|
||||
|
||||
void Behavior_MoveEnter();
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
class CTransform;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
@@ -16,6 +17,7 @@ class CPlayerInfo final : public CBase
|
||||
~CPlayerInfo() = default;
|
||||
public:
|
||||
void Update(_float fTimeDelta);
|
||||
void Change_Level();
|
||||
|
||||
private:
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
@@ -23,6 +25,10 @@ class CPlayerInfo final : public CBase
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
ID3D11DeviceContext* m_pContext = { nullptr };
|
||||
|
||||
private:
|
||||
CTransform* m_pTransform = { nullptr };
|
||||
|
||||
|
||||
private:
|
||||
HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex);
|
||||
|
||||
|
||||
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user