[fetch] prototype
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
#include "pch.h"
|
||||
#include "Level_MapViewer.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Level_Loading.h"
|
||||
#include "DebugCamera.h"
|
||||
|
||||
|
||||
CLevel_MapViewer::CLevel_MapViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HRESULT CLevel_MapViewer::Initialize()
|
||||
{
|
||||
if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera"))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CLevel_MapViewer::Update(_float fTimeDelta)
|
||||
{
|
||||
GUI::Begin("SelectEditor");
|
||||
if (GUI::Button("Map Editor", { 100, 100 })) {
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::MAP))))
|
||||
return;
|
||||
}
|
||||
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
HRESULT CLevel_MapViewer::Render()
|
||||
{
|
||||
SetWindowText(g_hWnd, TEXT("MapEditor·¹º§ÀÔ´Ï´Ù"));
|
||||
GUI::ShowDemoWindow();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
HRESULT CLevel_MapViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
{
|
||||
CDebugCamera::CAMERA_DEBUG_DESC Desc = {};
|
||||
|
||||
Desc.fFar = 300.f;
|
||||
Desc.fFovy = XMConvertToRadians(60.f);
|
||||
Desc.fNear = 0.1f;
|
||||
Desc.fMouseSensor = 1.f;
|
||||
Desc.fSpeedPerSec = 1.f;
|
||||
Desc.fRotationPerSec = 1.f;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDebugCamera>(g_iStaticLevel, g_iStaticLevel, strLayerTag, &Desc)))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_MapViewer::Ready_Layer_UI(const _wstring& strLayerTag)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CLevel_MapViewer* CLevel_MapViewer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
{
|
||||
CLevel_MapViewer* pInstance = new CLevel_MapViewer(pDevice, pContext, eLevelID);
|
||||
|
||||
if (FAILED(pInstance->Initialize()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CLevel_Logo");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void CLevel_MapViewer::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "Level.h"
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CLevel_MapViewer final : public CLevel
|
||||
{
|
||||
private:
|
||||
CLevel_MapViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID);
|
||||
virtual ~CLevel_MapViewer() = default;
|
||||
|
||||
public:
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual HRESULT Render() override;
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize() override;
|
||||
HRESULT Ready_Layer_Camera(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_UI(const _wstring& strLayerTag);
|
||||
|
||||
|
||||
public:
|
||||
static CLevel_MapViewer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID);
|
||||
virtual void Free() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -61,12 +61,12 @@ class CPrototype_Manager final : public CBase
|
||||
return dynamic_cast<T*>(pObject->Clone(_pArg, pOwner));
|
||||
}
|
||||
private:
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
ID3D11DeviceContext* m_pContext = { nullptr };
|
||||
vector<class CBase*>* m_pPrototypes = { nullptr };
|
||||
map<_wstring, CComponent*>* m_pAssets = { nullptr };
|
||||
|
||||
CGameInstance* m_pGameInstance = { nullptr };
|
||||
ID3D11Device* m_pDevice = { nullptr };
|
||||
ID3D11DeviceContext* m_pContext = { nullptr };
|
||||
vector<class CBase*>* m_pPrototypes = { nullptr };
|
||||
map<_wstring, CComponent*>* m_pAssets = { nullptr };
|
||||
|
||||
_uint m_iLevelNumber = { };
|
||||
|
||||
private:
|
||||
@@ -79,9 +79,11 @@ class CPrototype_Manager final : public CBase
|
||||
{
|
||||
T* pObject = { nullptr };
|
||||
|
||||
for (auto& iter : m_pPrototypes[_iLevelNumber]) {
|
||||
if (typeid(iter) == typeid(T)) {
|
||||
return dynamic_cast<T*>(iter);
|
||||
for (auto& pBase : m_pPrototypes[_iLevelNumber]) {
|
||||
_int iIterId = (_int)typeid(*pBase).hash_code();
|
||||
_int iTemplateID = (_int)typeid(T).hash_code();
|
||||
if (typeid(*pBase).hash_code() == typeid(T).hash_code()) {
|
||||
return dynamic_cast<T*>(pBase);
|
||||
}
|
||||
}
|
||||
return pObject;
|
||||
|
||||
Reference in New Issue
Block a user