diff --git a/Jusin154_Team3D/Client/Default/Client.aps b/Jusin154_Team3D/Client/Default/Client.aps new file mode 100644 index 000000000..c2afa22ef Binary files /dev/null and b/Jusin154_Team3D/Client/Default/Client.aps differ diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index b1ec0747c..212e74446 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -165,7 +165,7 @@ true true - + @@ -174,6 +174,9 @@ + + + @@ -181,7 +184,7 @@ - + @@ -190,10 +193,13 @@ + + Create Create + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index ad2c3c07f..94624b871 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -40,8 +40,8 @@ 99.Define - - 03.Information + + 03.InfoInstance 01.Levels\10.Field @@ -49,12 +49,21 @@ 01.Levels\99.Restart - - 02.GameObjects\Environment\Lights - 02.GameObjects\Cameras\Debug + + 02.GameObjects\Environment\Lights\Main + + + 03.InfoInstance\00.PlayerInfo + + + 03.InfoInstance\01.MonsterInfo + + + 03.InfoInstance\02.MapInfo + @@ -92,9 +101,6 @@ {27434478-691e-42a8-83c7-ecd1a60f46ce} - - {cdfbb346-6cae-4094-93cd-b82685efa68e} - {7efd65d5-eb4d-4331-a746-f0fa2de6275b} @@ -116,15 +122,6 @@ {a7d0a3fa-b3dc-40c6-b258-ffcde49b05c1} - - {1cfdfc05-0b0d-4c58-8c2d-58090efea4fd} - - - {621b87a7-54b8-4d90-84b2-fa8cd26cc396} - - - {caa3de9a-fe01-426c-9cea-195c2f9b18f6} - {b5bef783-5315-4488-ac64-cb98d16a84a9} @@ -158,6 +155,45 @@ {708bbc88-47fb-42c5-b060-14cec7d646f2} + + {b24c78ef-dccc-41f0-a086-053ae6b7fbf4} + + + {603938cc-e4fe-44d8-890b-784174a86161} + + + {11250d84-e19c-4999-a5d6-d9f89123e7ae} + + + {b72a9bb0-1b21-416b-bd0c-ba943cd7cc9d} + + + {2814c935-13d9-4b9a-94ba-c9e470219a18} + + + {19ee2ea4-2d79-46bd-b857-c759e3ec6cf4} + + + {2561df42-3dfa-4045-a30c-85f44cd65e09} + + + {25ad4a41-5b06-4659-bd29-c0c4265a3277} + + + {5a667a7b-6c90-44f6-9c9f-aac3108b6561} + + + {cdfbb346-6cae-4094-93cd-b82685efa68e} + + + {1cfdfc05-0b0d-4c58-8c2d-58090efea4fd} + + + {621b87a7-54b8-4d90-84b2-fa8cd26cc396} + + + {413e6692-6e4a-4b00-8306-edf652bd876a} + @@ -181,8 +217,8 @@ 01.Levels\02.GamePlay - - 03.Information + + 03.InfoInstance 01.Levels\10.Field @@ -190,12 +226,21 @@ 01.Levels\99.Restart - - 02.GameObjects\Environment\Lights - 02.GameObjects\Cameras\Debug + + 02.GameObjects\Environment\Lights\Main + + + 03.InfoInstance\00.PlayerInfo + + + 03.InfoInstance\01.MonsterInfo + + + 03.InfoInstance\02.MapInfo + diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp new file mode 100644 index 000000000..a7ba7db91 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -0,0 +1,68 @@ +#include "pch.h" +#include "InfoInstance.h" +#include "GameInstance.h" +#include "MapInfo.h" +#include "MonsterInfo.h" +#include "PlayerInfo.h" + +IMPLEMENT_SINGLETON(CInfoInstance) + +CInfoInstance::CInfoInstance() +{ +} + + +void CInfoInstance::Update(_float fTimeDelta) +{ + +} + +LEVEL CInfoInstance::Get_RestartLevel() +{ + return LEVEL::GAMEPLAY; +} + +HRESULT CInfoInstance::Initialize_Information(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + m_pGameInstance = CGameInstance::GetInstance(); + m_pDevice = pDevice; + m_pContext = pContext; + SAFE_ADDREF(m_pGameInstance); + SAFE_ADDREF(m_pDevice); + SAFE_ADDREF(m_pContext); + + m_pMapInfo = CMapInfo::Create(pDevice, pContext); + if (nullptr == m_pMapInfo) { + return E_FAIL; + } + m_pPlayerInfo = CPlayerInfo::Create(pDevice, pContext); + if (nullptr == m_pPlayerInfo) { + return E_FAIL; + } + m_pMonsterInfo = CMonsterInfo::Create(pDevice, pContext); + if (nullptr == m_pMonsterInfo) { + return E_FAIL; + } + + + return S_OK; +} + +void CInfoInstance::Release_Information() +{ + DestroyInstance(); + + + SAFE_RELEASE(m_pMapInfo); + SAFE_RELEASE(m_pPlayerInfo); + SAFE_RELEASE(m_pMonsterInfo); + SAFE_RELEASE(m_pDevice); + SAFE_RELEASE(m_pContext); + SAFE_RELEASE(m_pGameInstance); +} + +void CInfoInstance::Free() +{ + __super::Free(); + +} diff --git a/Jusin154_Team3D/Client/Private/Information.cpp b/Jusin154_Team3D/Client/Private/Information.cpp deleted file mode 100644 index 25dc551fd..000000000 --- a/Jusin154_Team3D/Client/Private/Information.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "pch.h" -#include "Information.h" -#include "GameInstance.h" - - -CInformation::CInformation() -{ -} - -HRESULT CInformation::Initialize_Information(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) -{ - m_pGameInstance = CGameInstance::GetInstance(); - m_pDevice = pDevice; - m_pContext = pContext; - SAFE_ADDREF(m_pGameInstance); - SAFE_ADDREF(m_pDevice); - SAFE_ADDREF(m_pContext); - return S_OK; -} - -void CInformation::Release_Information() -{ - -} - -void CInformation::Free() -{ - __super::Free(); - - SAFE_RELEASE(m_pDevice); - SAFE_RELEASE(m_pContext); - SAFE_RELEASE(m_pGameInstance); -} diff --git a/Jusin154_Team3D/Client/Private/Level_Field.cpp b/Jusin154_Team3D/Client/Private/Level_Field.cpp index 43e23c39c..8101093b3 100644 --- a/Jusin154_Team3D/Client/Private/Level_Field.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Field.cpp @@ -2,12 +2,15 @@ #include "Level_Field.h" #include "GameInstance.h" #include "Level_Loading.h" +#include "InfoInstance.h" +#include "Light_Main.h" #include "Layer.h" CLevel_Field::CLevel_Field(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } { - + m_pInfoInstance = CInfoInstance::GetInstance(); + SAFE_ADDREF(m_pInfoInstance); } HRESULT CLevel_Field::Initialize(void* pArg) @@ -37,34 +40,31 @@ HRESULT CLevel_Field::Initialize() void CLevel_Field::Update(_float fTimeDelta) { + if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) + { + m_pGameInstance->Set_LevelToChange(); + } + + 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::WOODS)))) { - // return; - //} + if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::RESTART)))) { + return; + } } } HRESULT CLevel_Field::Render() { - SetWindowText(g_hWnd, TEXT("게임플레이레벨입니다")); + SetWindowText(g_hWnd, TEXT("필드레벨")); return S_OK; } HRESULT CLevel_Field::Ready_Lights() { - LIGHT_DESC LightDesc{}; - - LightDesc.eType = LIGHT::DIRECTIONAL; - LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f); - LightDesc.vAmbient = _float4(0.2f, 0.2f, 0.2f, 0.f); - LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f); - //LightDesc.vDirection = _float4(1.f, -1.f, 1.f, 0.f); - - //if (FAILED(m_pGameInstance->On_Light(NEXT_LEVEL, TEXT("Main_Light"), LightDesc, nullptr))) { - // return E_FAIL; - //} - - + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT))) { + return E_FAIL; + } return S_OK; } @@ -111,4 +111,5 @@ void CLevel_Field::Free() { __super::Free(); + SAFE_RELEASE(m_pInfoInstance); } diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 766d6da10..f3cd197f3 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -4,12 +4,14 @@ #include "Level_Loading.h" #include "Light_Main.h" #include "Camera_Debug.h" +#include "InfoInstance.h" #include "Layer.h" CLevel_GamePlay::CLevel_GamePlay(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } { - + m_pInfoInstance = CInfoInstance::GetInstance(); + SAFE_ADDREF(m_pInfoInstance); } HRESULT CLevel_GamePlay::Initialize(void* pArg) @@ -17,7 +19,6 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg) if (FAILED(Ready_Lights())) { return E_FAIL; } - if (FAILED(Ready_Markers())) { return E_FAIL; } @@ -39,10 +40,17 @@ HRESULT CLevel_GamePlay::Initialize() void CLevel_GamePlay::Update(_float fTimeDelta) { + if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) + { + m_pGameInstance->Set_LevelToChange(); + } + + 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::WOODS)))) { - // return; - //} + if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::FIELD)))) { + return; + } } } @@ -54,8 +62,9 @@ HRESULT CLevel_GamePlay::Render() HRESULT CLevel_GamePlay::Ready_Lights() { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT))){ return E_FAIL; + } return S_OK; } @@ -77,6 +86,9 @@ HRESULT CLevel_GamePlay::Ready_Layer_Camera() Camera_Desc.pCameraKey = CAMERA_DEBUG; Camera_Desc.fRotationPerSec = XMConvertToRadians(90.0f); Camera_Desc.fMouseSensor = 0.1f; + Camera_Desc.iPriority = 99; + Camera_Desc.pFollowTarget = { nullptr }; + Camera_Desc.pLookTarget = { nullptr }; CCamera_Debug* pCamera = { nullptr }; if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_CAMERA, &Camera_Desc, nullptr, &pCamera))){ @@ -122,4 +134,5 @@ void CLevel_GamePlay::Free() { __super::Free(); + SAFE_RELEASE(m_pInfoInstance); } diff --git a/Jusin154_Team3D/Client/Private/Level_Loading.cpp b/Jusin154_Team3D/Client/Private/Level_Loading.cpp index fcc85f885..f68a13049 100644 --- a/Jusin154_Team3D/Client/Private/Level_Loading.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Loading.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Level_Loading.h" #include "Loader.h" @@ -6,6 +6,8 @@ #include "Layer.h" #include "Level_Logo.h" #include "Level_GamePlay.h" +#include "Level_Restart.h" +#include "Level_Field.h" CLevel_Loading::CLevel_Loading(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } @@ -47,7 +49,17 @@ void CLevel_Loading::Update(_float fTimeDelta) { pairLevel = CLevel_GamePlay::Create(m_pDevice, m_pContext, m_eNextLevelID, nullptr); } break; + case LEVEL::FIELD: + { + pairLevel = CLevel_Field::Create(m_pDevice, m_pContext, m_eNextLevelID, nullptr); + } break; + case LEVEL::RESTART: + { + pairLevel = CLevel_Restart::Create(m_pDevice, m_pContext, m_eNextLevelID); + } break; + default: + assert(false); // E_IMPL break; } @@ -59,7 +71,7 @@ void CLevel_Loading::Update(_float fTimeDelta) return; } else /* FAILED */ { - assert(false); // ·¹º§ º¯°æ ½ÇÆÐ + assert(false); // 레벨 변경 실패 } } } diff --git a/Jusin154_Team3D/Client/Private/Level_Logo.cpp b/Jusin154_Team3D/Client/Private/Level_Logo.cpp index 7cd7f7049..6c6b50201 100644 --- a/Jusin154_Team3D/Client/Private/Level_Logo.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Logo.cpp @@ -1,14 +1,16 @@ -#include "pch.h" +#include "pch.h" #include "Level_Logo.h" #include "GameInstance.h" #include "Level_Loading.h" +#include "InfoInstance.h" CLevel_Logo::CLevel_Logo(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } { - + m_pInfoInstance = CInfoInstance::GetInstance(); + SAFE_ADDREF(m_pInfoInstance); } HRESULT CLevel_Logo::Initialize() @@ -23,6 +25,12 @@ void CLevel_Logo::Update(_float fTimeDelta) { if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) { + m_pGameInstance->Set_LevelToChange(); + } + + 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)))) { return; } @@ -31,7 +39,7 @@ void CLevel_Logo::Update(_float fTimeDelta) HRESULT CLevel_Logo::Render() { - SetWindowText(g_hWnd, TEXT("·ΰí·¹º§ÀԴϴÙ")); + SetWindowText(g_hWnd, TEXT("로고레벨입니다")); return S_OK; } @@ -57,5 +65,5 @@ void CLevel_Logo::Free() { __super::Free(); - + SAFE_RELEASE(m_pInfoInstance); } diff --git a/Jusin154_Team3D/Client/Private/Level_Restart.cpp b/Jusin154_Team3D/Client/Private/Level_Restart.cpp index 75fb7534d..91dc3500d 100644 --- a/Jusin154_Team3D/Client/Private/Level_Restart.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Restart.cpp @@ -1,6 +1,6 @@ #include "pch.h" #include "Level_Restart.h" -#include "Information.h" +#include "InfoInstance.h" #include "GameInstance.h" #include "Level_Loading.h" @@ -9,25 +9,36 @@ CLevel_Restart::CLevel_Restart(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID) : CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) } { - + m_pInfoInstance = CInfoInstance::GetInstance(); + SAFE_ADDREF(m_pInfoInstance); } HRESULT CLevel_Restart::Initialize() { - //m_eNextLevel = CInformation::GetInstance()->Get_RestartLevel(); + m_eNextLevel = m_pInfoInstance->Get_RestartLevel(); return S_OK; } void CLevel_Restart::Update(_float fTimeDelta) { - if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, m_eNextLevel)))) { - return; + if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) + { + m_pGameInstance->Set_LevelToChange(); + } + + 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)))) { + return; + } } } HRESULT CLevel_Restart::Render() { + SetWindowText(g_hWnd, TEXT("리스타트레벨")); return S_OK; } @@ -48,4 +59,5 @@ void CLevel_Restart::Free() { __super::Free(); + SAFE_RELEASE(m_pInfoInstance); } diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 4aa07b34f..9ffe64cfa 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -56,6 +56,9 @@ HRESULT CLoader::Loading() case LEVEL::FIELD: hr = Loading_For_Field(); break; + case LEVEL::RESTART: + hr = Loading_For_Restart(); + break; default: break; } @@ -141,6 +144,27 @@ HRESULT CLoader::Loading_For_Field() return S_OK; } +HRESULT CLoader::Loading_For_Restart() +{ + m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다."); + + m_strMessage = TEXT("모델를(을) 로딩 중 입니다."); + + m_strMessage = TEXT("셰이더를(을) 로딩 중 입니다."); + + m_strMessage = TEXT("이펙트를(을) 로딩 중 입니다."); + + m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다."); + + m_strMessage = TEXT("정보를 불러오는 중입니다."); + + m_strMessage = TEXT("로딩이 완료되었습니다.."); + + m_isFinished = true; + + return S_OK; +} + CLoader* CLoader::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID) { CLoader* pInstance = new CLoader(pDevice, pContext); diff --git a/Jusin154_Team3D/Client/Private/MainApp.cpp b/Jusin154_Team3D/Client/Private/MainApp.cpp index b9c13c960..e6c5d9540 100644 --- a/Jusin154_Team3D/Client/Private/MainApp.cpp +++ b/Jusin154_Team3D/Client/Private/MainApp.cpp @@ -1,14 +1,14 @@ -#include "pch.h" +#include "pch.h" #include "MainApp.h" #include "GameInstance.h" #include "Level_Loading.h" +#include "InfoInstance.h" #ifdef _DEBUG _float g_fTimeMult = 1.f; #endif // _DEBUG - CMainApp::CMainApp() : m_pGameInstance{ CGameInstance::GetInstance() } { @@ -74,7 +74,7 @@ HRESULT CMainApp::Render() m_pGameInstance->Draw(); GUI::Render(); - //m_pGameInstance->Render_Font(TEXT("HYHL"), TEXT("ÇǰïÇØ ¸ø ½á"), _float2(0.f, 0.f), XMVectorSet(1.f, 0.f, 0.f, 1.f)); + //m_pGameInstance->Render_Font(TEXT("HYHL"), TEXT("피곤해 못 써"), _float2(0.f, 0.f), XMVectorSet(1.f, 0.f, 0.f, 1.f)); ImGui_ImplDX11_RenderDrawData(GUI::GetDrawData()); m_pGameInstance->Render_End(); @@ -96,7 +96,14 @@ HRESULT CMainApp::Start_Level(LEVEL eLevelID) if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, eLevelID)))) { return E_FAIL; } - + m_pInfoInstance = CInfoInstance::GetInstance(); + if (nullptr == m_pInfoInstance) { + return E_FAIL; + } + SAFE_ADDREF(m_pInfoInstance); + if (FAILED(m_pInfoInstance->Initialize_Information(m_pDevice, m_pContext))) { + return E_FAIL; + } return S_OK; } @@ -157,6 +164,9 @@ void CMainApp::Free() { __super::Free(); + m_pInfoInstance->Release_Information(); + SAFE_RELEASE(m_pInfoInstance); + Release_IMGUI(); SAFE_RELEASE(m_pDevice); diff --git a/Jusin154_Team3D/Client/Private/MapInfo.cpp b/Jusin154_Team3D/Client/Private/MapInfo.cpp new file mode 100644 index 000000000..032d467fd --- /dev/null +++ b/Jusin154_Team3D/Client/Private/MapInfo.cpp @@ -0,0 +1,50 @@ +#include "pch.h" +#include "MapInfo.h" +#include "GameInstance.h" +#include "InfoInstance.h" + +CMapInfo::CMapInfo() +{ +} + +void CMapInfo::Update(_float fTimeDelta) +{ +} + +HRESULT CMapInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) +{ + m_pGameInstance = CGameInstance::GetInstance(); + m_pInfoInstance = CInfoInstance::GetInstance(); + m_pDevice = pDevice; + m_pContext = pContex; + + SAFE_ADDREF(m_pGameInstance); + SAFE_ADDREF(m_pInfoInstance); + SAFE_ADDREF(m_pDevice); + SAFE_ADDREF(m_pContext); + + + return S_OK; +} + +CMapInfo* CMapInfo::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) +{ + CMapInfo* pInstance = new CMapInfo(); + + if (FAILED(pInstance->Initialize(pDevice, pContex))) { + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CMapInfo::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pInfoInstance); + SAFE_RELEASE(m_pDevice); + SAFE_RELEASE(m_pContext); + +} diff --git a/Jusin154_Team3D/Client/Private/MonsterInfo.cpp b/Jusin154_Team3D/Client/Private/MonsterInfo.cpp new file mode 100644 index 000000000..27d673a78 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/MonsterInfo.cpp @@ -0,0 +1,50 @@ +#include "pch.h" +#include "MonsterInfo.h" +#include "GameInstance.h" +#include "InfoInstance.h" + +CMonsterInfo::CMonsterInfo() +{ +} + +void CMonsterInfo::Update(_float fTimeDelta) +{ +} + +HRESULT CMonsterInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) +{ + m_pGameInstance = CGameInstance::GetInstance(); + m_pInfoInstance = CInfoInstance::GetInstance(); + m_pDevice = pDevice; + m_pContext = pContex; + + SAFE_ADDREF(m_pGameInstance); + SAFE_ADDREF(m_pInfoInstance); + SAFE_ADDREF(m_pDevice); + SAFE_ADDREF(m_pContext); + + + return S_OK; +} + +CMonsterInfo* CMonsterInfo::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) +{ + CMonsterInfo* pInstance = new CMonsterInfo(); + + if (FAILED(pInstance->Initialize(pDevice, pContex))) { + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CMonsterInfo::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pInfoInstance); + SAFE_RELEASE(m_pDevice); + SAFE_RELEASE(m_pContext); + +} diff --git a/Jusin154_Team3D/Client/Private/PlayerInfo.cpp b/Jusin154_Team3D/Client/Private/PlayerInfo.cpp new file mode 100644 index 000000000..d355667a6 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/PlayerInfo.cpp @@ -0,0 +1,50 @@ +#include "pch.h" +#include "PlayerInfo.h" +#include "GameInstance.h" +#include "InfoInstance.h" + +CPlayerInfo::CPlayerInfo() +{ +} + +void CPlayerInfo::Update(_float fTimeDelta) +{ +} + +HRESULT CPlayerInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) +{ + m_pGameInstance = CGameInstance::GetInstance(); + m_pInfoInstance = CInfoInstance::GetInstance(); + m_pDevice = pDevice; + m_pContext = pContex; + + SAFE_ADDREF(m_pGameInstance); + SAFE_ADDREF(m_pInfoInstance); + SAFE_ADDREF(m_pDevice); + SAFE_ADDREF(m_pContext); + + + return S_OK; +} + +CPlayerInfo* CPlayerInfo::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) +{ + CPlayerInfo* pInstance = new CPlayerInfo(); + + if (FAILED(pInstance->Initialize(pDevice, pContex))) { + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CPlayerInfo::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pInfoInstance); + SAFE_RELEASE(m_pDevice); + SAFE_RELEASE(m_pContext); + +} diff --git a/Jusin154_Team3D/Client/Public/InfoInstance.h b/Jusin154_Team3D/Client/Public/InfoInstance.h new file mode 100644 index 000000000..6fe77ff71 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/InfoInstance.h @@ -0,0 +1,44 @@ +#pragma once + +#include "Client_Define.h" +#include "Base.h" + +NS_BEGIN(Engine) +class CGameInstance; +class CGameObject; +NS_END + +NS_BEGIN(Client) + +class CInfoInstance final : public CBase +{ + DECLARE_SINGLETON(CInfoInstance) +private: + CInfoInstance(); + virtual ~CInfoInstance() = default; +public: + HRESULT Initialize_Information(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + void Release_Information(); + LEVEL Get_RestartLevel(); +public: + void Update(_float fTimeDelta); + + +private: + CGameInstance* m_pGameInstance = { nullptr }; + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; + + class CPlayerInfo* m_pPlayerInfo = { nullptr }; + class CMonsterInfo* m_pMonsterInfo = { nullptr }; + class CMapInfo* m_pMapInfo = { nullptr }; + +#ifdef _DEBUG + _string m_strLog = {}; +#endif // _DEBUG + +public: + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Information.h b/Jusin154_Team3D/Client/Public/Information.h deleted file mode 100644 index c7c011f70..000000000 --- a/Jusin154_Team3D/Client/Public/Information.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include "Client_Define.h" -#include "Base.h" - -NS_BEGIN(Engine) -class CGameInstance; -class CGameObject; -NS_END - -NS_BEGIN(Client) - -class CInformation final : public CBase -{ - DECLARE_SINGLETON(CInformation) -private: - CInformation(); - virtual ~CInformation() = default; -public: - HRESULT Initialize_Information(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); - void Release_Information(); - - -private: - ID3D11Device* m_pDevice = { nullptr }; - ID3D11DeviceContext* m_pContext = { nullptr }; - class CGameInstance* m_pGameInstance = { nullptr }; - - class CPlayerInfo* m_pPlayerInfo = { nullptr }; - class CMonsterInfo* m_pMonsterInfo = { nullptr }; - class CNeutralInfo* m_pNeutralInfo = { nullptr }; - -private: -#ifdef _DEBUG - _string m_strLog = {}; -#endif // _DEBUG - -public: - virtual void Free() override; -}; - -NS_END diff --git a/Jusin154_Team3D/Client/Public/Level_Field.h b/Jusin154_Team3D/Client/Public/Level_Field.h index d4b52ca78..58603e37f 100644 --- a/Jusin154_Team3D/Client/Public/Level_Field.h +++ b/Jusin154_Team3D/Client/Public/Level_Field.h @@ -16,6 +16,9 @@ class CLevel_Field final : public CLevel virtual void Update(_float fTimeDelta) override; virtual HRESULT Render() override; +private: + class CInfoInstance* m_pInfoInstance = { nullptr }; + private: virtual HRESULT Initialize() override; HRESULT Initialize(void* pArg); diff --git a/Jusin154_Team3D/Client/Public/Level_GamePlay.h b/Jusin154_Team3D/Client/Public/Level_GamePlay.h index 877cdbbc0..4ed6cd481 100644 --- a/Jusin154_Team3D/Client/Public/Level_GamePlay.h +++ b/Jusin154_Team3D/Client/Public/Level_GamePlay.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Client_Define.h" #include "Level.h" @@ -16,6 +16,10 @@ class CLevel_GamePlay final : public CLevel virtual void Update(_float fTimeDelta) override; virtual HRESULT Render() override; + +private: + class CInfoInstance* m_pInfoInstance = { nullptr }; + private: virtual HRESULT Initialize() override; HRESULT Initialize(void* pArg); @@ -25,10 +29,11 @@ class CLevel_GamePlay final : public CLevel HRESULT Ready_Layer_Camera(); HRESULT Ready_Layer_Sound(); HRESULT Ready_Layer_Effect(const _wstring& strLayerTag); + public: static pair> Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID, void* pArg); virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Client/Public/Level_Logo.h b/Jusin154_Team3D/Client/Public/Level_Logo.h index da1546a74..7ace4888a 100644 --- a/Jusin154_Team3D/Client/Public/Level_Logo.h +++ b/Jusin154_Team3D/Client/Public/Level_Logo.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Client_Define.h" #include "Level.h" @@ -15,6 +15,9 @@ class CLevel_Logo final : public CLevel virtual void Update(_float fTimeDelta) override; virtual HRESULT Render() override; +private: + class CInfoInstance* m_pInfoInstance = { nullptr }; + private: virtual HRESULT Initialize() override; HRESULT Ready_Layer_UI(const _wstring& strLayerTag); @@ -25,4 +28,4 @@ class CLevel_Logo final : public CLevel virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END diff --git a/Jusin154_Team3D/Client/Public/Level_Restart.h b/Jusin154_Team3D/Client/Public/Level_Restart.h index 4c6d1dedd..2b996f08c 100644 --- a/Jusin154_Team3D/Client/Public/Level_Restart.h +++ b/Jusin154_Team3D/Client/Public/Level_Restart.h @@ -17,8 +17,12 @@ class CLevel_Restart final : public CLevel virtual void Update(_float fTimeDelta) override; virtual HRESULT Render() override; +private: + class CInfoInstance* m_pInfoInstance = { nullptr }; + private: virtual HRESULT Initialize() override; + private: LEVEL m_eNextLevel = {}; public: diff --git a/Jusin154_Team3D/Client/Public/Loader.h b/Jusin154_Team3D/Client/Public/Loader.h index 9dcd8d2a3..fe9223f44 100644 --- a/Jusin154_Team3D/Client/Public/Loader.h +++ b/Jusin154_Team3D/Client/Public/Loader.h @@ -35,6 +35,7 @@ class CLoader final : public CBase HRESULT Loading_For_Logo(); HRESULT Loading_For_GamePlay(); HRESULT Loading_For_Field(); + HRESULT Loading_For_Restart(); public: static CLoader* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID); diff --git a/Jusin154_Team3D/Client/Public/MainApp.h b/Jusin154_Team3D/Client/Public/MainApp.h index f65267e73..b168ae59f 100644 --- a/Jusin154_Team3D/Client/Public/MainApp.h +++ b/Jusin154_Team3D/Client/Public/MainApp.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Client_Define.h" #include "Base.h" @@ -23,6 +23,7 @@ class CMainApp final : public CBase private: CGameInstance* m_pGameInstance = { nullptr }; + class CInfoInstance* m_pInfoInstance = { nullptr }; ID3D11Device* m_pDevice = { nullptr }; ID3D11DeviceContext* m_pContext = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/MapInfo.h b/Jusin154_Team3D/Client/Public/MapInfo.h new file mode 100644 index 000000000..51b82b9ff --- /dev/null +++ b/Jusin154_Team3D/Client/Public/MapInfo.h @@ -0,0 +1,35 @@ +#pragma once + +#include "Client_Define.h" +#include "Base.h" + +NS_BEGIN(Engine) +class CGameInstance; +class CGameObject; +NS_END + +NS_BEGIN(Client) + +class CMapInfo final : public CBase +{ +private: + CMapInfo(); + ~CMapInfo() = default; +public: + void Update(_float fTimeDelta); + +private: + CGameInstance* m_pGameInstance = { nullptr }; + class CInfoInstance* m_pInfoInstance = { nullptr }; + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; + +private: + HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + +public: + static CMapInfo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/MonsterInfo.h b/Jusin154_Team3D/Client/Public/MonsterInfo.h new file mode 100644 index 000000000..ab05fbb8f --- /dev/null +++ b/Jusin154_Team3D/Client/Public/MonsterInfo.h @@ -0,0 +1,35 @@ +#pragma once + +#include "Client_Define.h" +#include "Base.h" + +NS_BEGIN(Engine) +class CGameInstance; +class CGameObject; +NS_END + +NS_BEGIN(Client) + +class CMonsterInfo final : public CBase +{ +private: + CMonsterInfo(); + ~CMonsterInfo() = default; +public: + void Update(_float fTimeDelta); + +private: + CGameInstance* m_pGameInstance = { nullptr }; + class CInfoInstance* m_pInfoInstance = { nullptr }; + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; + +private: + HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + +public: + static CMonsterInfo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/PlayerInfo.h b/Jusin154_Team3D/Client/Public/PlayerInfo.h new file mode 100644 index 000000000..c76b406f2 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/PlayerInfo.h @@ -0,0 +1,35 @@ +#pragma once + +#include "Client_Define.h" +#include "Base.h" + +NS_BEGIN(Engine) +class CGameInstance; +class CGameObject; +NS_END + +NS_BEGIN(Client) + +class CPlayerInfo final : public CBase +{ +private: + CPlayerInfo(); + ~CPlayerInfo() = default; +public: + void Update(_float fTimeDelta); + +private: + CGameInstance* m_pGameInstance = { nullptr }; + class CInfoInstance* m_pInfoInstance = { nullptr }; + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; + +private: + HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + +public: + static CPlayerInfo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Default/.bin b/Jusin154_Team3D/Editor/Default/.bin index 052ff3eb0..2b6446a32 100644 Binary files a/Jusin154_Team3D/Editor/Default/.bin and b/Jusin154_Team3D/Editor/Default/.bin differ diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index 6fe14a25c..0009caed7 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -145,7 +145,6 @@ void CGameInstance::Clear_Resources(_uint iLevelIndex) m_pCamera_Manager->Clear_Cameras(iLevelIndex); m_pObject_Manager->Clear(iLevelIndex); m_pLight_Manager->Light_Clear(iLevelIndex); - } _float CGameInstance::Random_Normal() diff --git a/Jusin154_Team3D/Engine/Private/Light_Manager.cpp b/Jusin154_Team3D/Engine/Private/Light_Manager.cpp index 601ccdf56..19f6380eb 100644 --- a/Jusin154_Team3D/Engine/Private/Light_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Light_Manager.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Light_Manager.h" #include "Light.h" @@ -74,10 +74,9 @@ const LIGHT_DESC* CLight_Manager::Get_Light_Info(_uint _iCurrentLevel, _uint _iL } -HRESULT CLight_Manager::Render_Lights(_uint _iCurrentLevel, CShader* pShader, CVIBuffer* pVIBuffer) +HRESULT CLight_Manager::Render_Lights(_uint iCurrentLevel, CShader* pShader, CVIBuffer* pVIBuffer) { - - for (auto& pLight : m_Lights[_iCurrentLevel]) + for (auto& pLight : m_Lights[iCurrentLevel]) { pLight->Render(pShader, pVIBuffer); } diff --git a/Jusin154_Team3D/Engine/Public/Light_Manager.h b/Jusin154_Team3D/Engine/Public/Light_Manager.h index c028d0752..fad3c9aa8 100644 --- a/Jusin154_Team3D/Engine/Public/Light_Manager.h +++ b/Jusin154_Team3D/Engine/Public/Light_Manager.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Base.h" @@ -9,8 +9,6 @@ class CLight_Manager final : public CBase private: CLight_Manager(); virtual ~CLight_Manager() = default; - - public: void Add_Light(_uint _iCurrentLevel, class CLight* _pLight); void Delete_Light(_uint _iCurrentLevel, class CLight* _pLight); @@ -18,7 +16,7 @@ class CLight_Manager final : public CBase const LIGHT_DESC* Get_Light_Info(_uint _iCurrentLevel ,_uint _iLightIndex); public: - HRESULT Render_Lights(_uint _iCurrentLevel, class CShader* pShader, class CVIBuffer* pVIBuffer); + HRESULT Render_Lights(_uint iCurrentLevel, class CShader* pShader, class CVIBuffer* pVIBuffer); private: HRESULT Initialize(_uint iNumLevels); @@ -31,4 +29,4 @@ class CLight_Manager final : public CBase virtual void Free() override; }; -NS_END \ No newline at end of file +NS_END