@@ -157,7 +157,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);
|
||||
|
||||
@@ -154,6 +154,10 @@
|
||||
<ClInclude Include="..\Public\DebugCamera.h" />
|
||||
<ClInclude Include="..\Public\Effect_Editor.h" />
|
||||
<ClInclude Include="..\Public\EditEffect.h" />
|
||||
<ClInclude Include="..\public\Level_MapViewer.h" />
|
||||
<ClInclude Include="..\public\MapObject.h" />
|
||||
<ClInclude Include="..\public\MapObject_Manager.h" />
|
||||
<ClInclude Include="..\public\Terrain.h" />
|
||||
<ClInclude Include="..\Public\TestEffect.h" />
|
||||
<ClInclude Include="..\Public\EffectObject.h" />
|
||||
<ClInclude Include="..\Public\DummyRect.h" />
|
||||
@@ -192,6 +196,10 @@
|
||||
<ClCompile Include="..\Private\DebugCamera.cpp" />
|
||||
<ClCompile Include="..\Private\Effect_Editor.cpp" />
|
||||
<ClCompile Include="..\Private\EditEffect.cpp" />
|
||||
<ClCompile Include="..\private\Level_MapViewer.cpp" />
|
||||
<ClCompile Include="..\private\MapObject.cpp" />
|
||||
<ClCompile Include="..\private\MapObject_Manager.cpp" />
|
||||
<ClCompile Include="..\private\Terrain.cpp" />
|
||||
<ClCompile Include="..\Private\TestEffect.cpp" />
|
||||
<ClCompile Include="..\Private\EffectObject.cpp" />
|
||||
<ClCompile Include="..\Private\DummyRect.cpp" />
|
||||
|
||||
@@ -136,6 +136,12 @@
|
||||
<Filter Include="50.UI\Mission\Active_Icon">
|
||||
<UniqueIdentifier>{977fe4d3-c3b5-413c-80fe-777ece19453e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Terrain">
|
||||
<UniqueIdentifier>{44a3ddc2-3993-48d6-840c-3da09daeab70}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Env\Manger">
|
||||
<UniqueIdentifier>{584466e9-fe1a-4a7d-a4ba-54d62ee1a7c1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Editor.h">
|
||||
@@ -246,6 +252,18 @@
|
||||
<ClInclude Include="..\public\Active_Icon.h">
|
||||
<Filter>50.UI\Mission\Active_Icon</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\Level_MapViewer.h">
|
||||
<Filter>01.Level\30.MapViewer</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\MapObject.h">
|
||||
<Filter>02.GameObjects\Env</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\Terrain.h">
|
||||
<Filter>02.GameObjects\Terrain</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\MapObject_Manager.h">
|
||||
<Filter>02.GameObjects\Env\Manger</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Editor.ico">
|
||||
@@ -349,6 +367,18 @@
|
||||
<ClCompile Include="..\private\Active_Icon.cpp">
|
||||
<Filter>50.UI\Mission\Active_Icon</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\Level_MapViewer.cpp">
|
||||
<Filter>01.Level\30.MapViewer</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\MapObject.cpp">
|
||||
<Filter>02.GameObjects\Env</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\Terrain.cpp">
|
||||
<Filter>02.GameObjects\Terrain</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\MapObject_Manager.cpp">
|
||||
<Filter>02.GameObjects\Env\Manger</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Editor.rc">
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "Level_UI.h"
|
||||
#include "Level_ObjectViewer.h"
|
||||
#include "Level_EffectViewer.h"
|
||||
#include "Level_MapViewer.h"
|
||||
|
||||
CLevel_Loading::CLevel_Loading(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
||||
@@ -44,9 +45,9 @@ void CLevel_Loading::Update(_float fTimeDelta)
|
||||
case LEVEL::UI:
|
||||
pNewLevel = CLevel_UI::Create(m_pDevice, m_pContext, m_eNextLevelID);
|
||||
break;
|
||||
//case LEVEL::MAP:
|
||||
// pNewLevel = CLevel_MapViewer::Create(m_pDevice, m_pContext, m_eNextLevelID);
|
||||
// break;
|
||||
case LEVEL::MAP:
|
||||
pNewLevel = CLevel_MapViewer::Create(m_pDevice, m_pContext, m_eNextLevelID);
|
||||
break;
|
||||
case LEVEL::OBJECT:
|
||||
pNewLevel = CLevel_ObjectViewer::Create(m_pDevice, m_pContext, m_eNextLevelID);
|
||||
break;
|
||||
|
||||
@@ -22,11 +22,11 @@ HRESULT CLevel_Logo::Initialize()
|
||||
void CLevel_Logo::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;
|
||||
//}
|
||||
/*else */if (GUI::Button("Object Editor", { 100, 100 })) {
|
||||
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;
|
||||
}
|
||||
else if (GUI::Button("Object Editor", { 100, 100 })) {
|
||||
if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::OBJECT))))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
#include "pch.h"
|
||||
#include "Level_MapViewer.h"
|
||||
#include "GameInstance.h"
|
||||
|
||||
#include "Level_Loading.h"
|
||||
#include "DebugCamera.h"
|
||||
|
||||
#include "Terrain.h"
|
||||
#include "MapObject_Manager.h"
|
||||
|
||||
CLevel_MapViewer::CLevel_MapViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
||||
@@ -11,23 +13,9 @@ CLevel_MapViewer::CLevel_MapViewer(ID3D11Device* pDevice, ID3D11DeviceContext* p
|
||||
|
||||
}
|
||||
|
||||
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()
|
||||
@@ -37,27 +25,89 @@ HRESULT CLevel_MapViewer::Render()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_MapViewer::Initialize()
|
||||
{
|
||||
if (FAILED(Ready_Layer_Light()))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Layer_Camera(LAYER_CAMERA))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Layer_Terrain(TEXT("Layer_Terrain")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Layer_MapObjects(TEXT("Layer_MapObject")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Layer_MapObjectManager(TEXT("Layer_MapObjectManager")))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_MapViewer::Ready_Layer_Light()
|
||||
{
|
||||
LIGHT_DESC LightDesc{};
|
||||
|
||||
LightDesc.eType = LIGHT::DIRECTIONAL;
|
||||
LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f);
|
||||
LightDesc.vAmbient = _float4(0.8f, 0.8f, 0.8f, 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;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_MapViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
|
||||
{
|
||||
CDebugCamera::CAMERA_DEBUG_DESC Desc = {};
|
||||
CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{};
|
||||
CameraDesc.fFovy = XMConvertToRadians(60.0f);
|
||||
CameraDesc.fNear = 0.1f;
|
||||
CameraDesc.fFar = 500.f;
|
||||
CameraDesc.vEye = _float3(0.f, 10.f, -10.f);
|
||||
CameraDesc.vAt = _float3(0.f, 0.f, 0.f);
|
||||
CameraDesc.fSpeedPerSec = 2.f;
|
||||
CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f);
|
||||
CameraDesc.fMouseSensor = 0.1f;
|
||||
|
||||
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)))
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDebugCamera>(g_iStaticLevel, NEXT_LEVEL,
|
||||
strLayerTag, &CameraDesc)))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_MapViewer::Ready_Layer_UI(const _wstring& strLayerTag)
|
||||
HRESULT CLevel_MapViewer::Ready_Layer_Terrain(const _wstring& strLayerTag)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTerrain>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_MapViewer::Ready_Layer_MapObjects(const _wstring& strLayerTag)
|
||||
{
|
||||
//CMapObject::MAPOBJECT_DESC Desc = {};
|
||||
//Desc.pModelPrototypeTag = TEXT("Prototype_GameObject_SM_HW_ClockTower_Courtyard_BaseWall_A");
|
||||
|
||||
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMapObject>(g_iStaticLevel, NEXT_LEVEL,strLayerTag, &Desc)))
|
||||
// return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLevel_MapViewer::Ready_Layer_MapObjectManager(const _wstring& strLayerTag)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMapObject_Manager>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -67,7 +117,7 @@ CLevel_MapViewer* CLevel_MapViewer::Create(ID3D11Device* pDevice, ID3D11DeviceCo
|
||||
|
||||
if (FAILED(pInstance->Initialize()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CLevel_Logo");
|
||||
MSG_BOX("Failed to Created : CLevel_MapViewer");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
@@ -79,6 +129,4 @@ CLevel_MapViewer* CLevel_MapViewer::Create(ID3D11Device* pDevice, ID3D11DeviceCo
|
||||
void CLevel_MapViewer::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -27,6 +27,12 @@
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region MAP_HEADER
|
||||
#include "VIBuffer_Terrain.h"
|
||||
#include "Terrain.h"
|
||||
#include "MapObject.h"
|
||||
#include "MapObject_Manager.h"
|
||||
#pragma endregion
|
||||
|
||||
|
||||
#pragma region EFFECT_HEADER
|
||||
@@ -91,9 +97,9 @@ HRESULT CLoader::Loading()
|
||||
case LEVEL::UI:
|
||||
hr = Loading_For_UI();
|
||||
break;
|
||||
//case LEVEL::MAP:
|
||||
// hr = Loading_For_MapViewer();
|
||||
// break;
|
||||
case LEVEL::MAP:
|
||||
hr = Loading_For_MapViewer();
|
||||
break;
|
||||
case LEVEL::OBJECT:
|
||||
hr = Loading_For_ObjectViewer();
|
||||
break;
|
||||
@@ -436,6 +442,72 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLoader::Loading_For_MapViewer()
|
||||
{
|
||||
m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다.");
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("TerrainTest"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Cursor/UI_T_CursorRings.dds"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strMessage = TEXT("모델를(을) 로딩 중 입니다.");
|
||||
|
||||
vector<_wstring> ModelPrototypeTags;
|
||||
|
||||
for (const auto& file : filesystem::directory_iterator("C:\\Users\\82103\\Desktop\\MapRe\\Game\\Environment\\Hogsmeade\\BLDG_ThreeBroomsticks\\Meshes"))
|
||||
{
|
||||
if (file.is_directory())
|
||||
continue;
|
||||
|
||||
string ext = file.path().extension().string();
|
||||
|
||||
if (strcmp(ext.c_str(), ".fbx"))
|
||||
continue;
|
||||
|
||||
_char szFilePath[MAX_PATH] = {};
|
||||
|
||||
strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str());
|
||||
|
||||
_wstring strFileName = L"Prototype_GameObject_" + file.path().stem().wstring();
|
||||
|
||||
/*For Prototype_Component_Model_Auro*/
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, strFileName,
|
||||
CModel::Create(m_pDevice, m_pContext, szFilePath, MODEL::ENVIROMENT, XMMatrixIdentity(), 0))))
|
||||
return E_FAIL;
|
||||
|
||||
ModelPrototypeTags.push_back(strFileName);
|
||||
}
|
||||
|
||||
|
||||
m_strMessage = TEXT("쉐이더를(을) 로딩 중 입니다.");
|
||||
|
||||
m_strMessage = TEXT("객체원형를(을) 로딩 중 입니다.");
|
||||
|
||||
/* 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, nullptr, 100, 100))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_MapObject */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject>(g_iStaticLevel, CMapObject::Create(m_pDevice, m_pContext))))
|
||||
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;
|
||||
|
||||
/* For.Prototype_GameObject_MapObject_Manager */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_Manager>(g_iStaticLevel, CMapObject_Manager::Create(m_pDevice, m_pContext, ModelPrototypeTags))))
|
||||
return E_FAIL;
|
||||
|
||||
m_strMessage = TEXT("로딩이 완료되었습니다..");
|
||||
|
||||
m_isFinished = true;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CLoader* CLoader::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID)
|
||||
{
|
||||
CLoader* pInstance = new CLoader(pDevice, pContext);
|
||||
|
||||
@@ -0,0 +1,225 @@
|
||||
#include "pch.h"
|
||||
#include "MapObject.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Layer.h"
|
||||
//#include "Terrain.h"
|
||||
|
||||
CMapObject::CMapObject(ID3D11Device * pDevice, ID3D11DeviceContext * pContext)
|
||||
: CGameObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CMapObject::CMapObject(const CMapObject& Prototype)
|
||||
: CGameObject(Prototype)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CMapObject::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapObject::Initialize(void* pArg)
|
||||
{
|
||||
MAPOBJECT_DESC* pDesc = static_cast<MAPOBJECT_DESC*>(pArg);
|
||||
|
||||
m_strModelPrototypeTag = pDesc->pModelPrototypeTag;
|
||||
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components()))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
m_bSelected = false;
|
||||
m_vPosition = _float3(0.f, 0.f, 0.f);
|
||||
m_vRotation = _float3(0.f, 0.f, 0.f);
|
||||
m_vScale = _float3(1.f, 1.f, 1.f);
|
||||
#endif // _DEBUG
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMapObject::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_bSelected = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void CMapObject::Update(_float fTimeDelta)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f));
|
||||
m_pTransformCom->Set_Scale(m_vScale);
|
||||
m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z));
|
||||
#endif
|
||||
}
|
||||
|
||||
void CMapObject::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
_float4 vPos;
|
||||
XMStoreFloat4(&vPos, Get_WorldPostion());
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this, vPos, 20.f);
|
||||
}
|
||||
|
||||
HRESULT CMapObject::Render()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapObject::Ready_Components()
|
||||
{
|
||||
__super::Ready_Components(nullptr);
|
||||
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag,
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapObject::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
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;
|
||||
}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_vCamPosition", m_pGameInstance->Get_CamPosition(), sizeof(_float4)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_bRimLight", &m_bRimLight, sizeof(_bool)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_fRimStrength", &m_fRimLightStrength, sizeof(_float)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_fRimPower", &m_fRimLightPower, sizeof(_float)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
//if (FAILED(m_pShaderCom->Bind_RawValue("g_vRimColor", &m_vRimLightColor, sizeof(_float3)))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CMapObject* CMapObject::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CMapObject* pInstance = new CMapObject(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CMapObject");
|
||||
Safe_Release(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CMapObject::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CMapObject* pInstance = new CMapObject(*this);
|
||||
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CMapObject");
|
||||
Safe_Release(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CMapObject::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
Safe_Release(m_pShaderCom);
|
||||
Safe_Release(m_pModelCom);
|
||||
}
|
||||
|
||||
void CMapObject::Describe_Entity()
|
||||
{
|
||||
if (m_bDead)
|
||||
return;
|
||||
if (nullptr == m_pGameInstance)
|
||||
return;
|
||||
|
||||
ImGui::Text(CMyTools::ToString(m_strModelPrototypeTag).c_str());
|
||||
ImGui::Text("----- Transfrom ----");
|
||||
ImGui::InputFloat("X##Position", &m_vPosition.x, 1.f, 10.f);
|
||||
ImGui::InputFloat("Y##Position", &m_vPosition.y, 0.1f, 1.f);
|
||||
ImGui::InputFloat("Z##Position", &m_vPosition.z, 1.f, 10.f);
|
||||
|
||||
if (m_pGameInstance->Mouse_Down(DIM_4))
|
||||
{
|
||||
/*CTerrain* pTerrain = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Terrain"))->Get_Object<CTerrain>();
|
||||
if (nullptr != pTerrain)
|
||||
{
|
||||
pTerrain->Get_Component<CVIBuffer_Terrain>()->Picking(pTerrain->Get_Component<CTransform>(), m_vPosition);
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
ImGui::Text("----- Rotation ----");
|
||||
ImGui::InputFloat("X##Rotation", &m_vRotation.x, 10.f, 45.f);
|
||||
ImGui::InputFloat("Y##Rotation", &m_vRotation.y, 10.f, 45.f);
|
||||
ImGui::InputFloat("Z##Rotation", &m_vRotation.z, 10.f, 45.f);
|
||||
|
||||
ImGui::Text("----- Scale ----");
|
||||
ImGui::InputFloat("X##Scale", &m_vScale.x, 0.1f, 1.f);
|
||||
ImGui::InputFloat("Y##Scale", &m_vScale.y, 0.1f, 1.f);
|
||||
ImGui::InputFloat("Z##Scale", &m_vScale.z, 0.1f, 1.f);
|
||||
|
||||
m_vScale.x = max(0.01f, m_vScale.x);
|
||||
m_vScale.y = max(0.01f, m_vScale.y);
|
||||
m_vScale.z = max(0.01f, m_vScale.z);
|
||||
|
||||
|
||||
if (ImGui::Button("Delete"))
|
||||
m_bDead = true;
|
||||
|
||||
m_bSelected = true;
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
#include "pch.h"
|
||||
#include "MapObject_Manager.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "Layer.h"
|
||||
#include "MapObject.h"
|
||||
|
||||
|
||||
CMapObject_Manager::CMapObject_Manager(ID3D11Device * pDevice, ID3D11DeviceContext * pContext)
|
||||
: CGameObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CMapObject_Manager::CMapObject_Manager(const CMapObject_Manager& Prototype)
|
||||
: CGameObject(Prototype)
|
||||
, m_ModelPrototypeTags{ Prototype.m_ModelPrototypeTags }
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Manager::Initialize_Prototype(vector<_wstring>& ModelPrototypeTags)
|
||||
{
|
||||
m_ModelPrototypeTags = ModelPrototypeTags;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Manager::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CMapObject_Manager::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CMapObject_Manager::Update(_float fTimeDelta)
|
||||
{
|
||||
GUI::Begin("Model Prototype List");
|
||||
|
||||
for (auto& Tag : m_ModelPrototypeTags)
|
||||
{
|
||||
if (ImGui::Button(CMyTools::ToString(Tag).c_str()))
|
||||
{
|
||||
CMapObject::MAPOBJECT_DESC Desc = {};
|
||||
Desc.pModelPrototypeTag = Tag.c_str();
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMapObject>(g_iStaticLevel, ENUM_CLASS(LEVEL::MAP), TEXT("Layer_MapObject"), &Desc)))
|
||||
{
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
GUI::End();
|
||||
|
||||
CLayer* pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_MapObject"));
|
||||
|
||||
if (nullptr == pLayer)
|
||||
return;
|
||||
|
||||
m_pMapObjects = pLayer->Get_Objects();
|
||||
|
||||
GUI::Begin("MapObject List");
|
||||
|
||||
_uint iObjectIndex = {};
|
||||
string strSrc;
|
||||
|
||||
if (nullptr != m_pMapObjects)
|
||||
{
|
||||
for (auto pMapObject : (*m_pMapObjects))
|
||||
{
|
||||
CMapObject* pCurrentMapObject = static_cast<CMapObject*>(pMapObject);
|
||||
|
||||
if (nullptr == pCurrentMapObject)
|
||||
continue;
|
||||
|
||||
wstring strPrototypeTag = pCurrentMapObject->Get_PrototypeTag();
|
||||
|
||||
strSrc = CMyTools::ToString(strPrototypeTag) + to_string(iObjectIndex) + "##" + to_string(iObjectIndex++);
|
||||
|
||||
if (ImGui::Button(strSrc.c_str()))
|
||||
{
|
||||
m_pSelectObject = pCurrentMapObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GUI::End();
|
||||
|
||||
GUI::Begin("Edit");
|
||||
|
||||
if (nullptr != m_pSelectObject)
|
||||
{
|
||||
m_pSelectObject->Describe_Entity();
|
||||
if (m_pSelectObject->isDead())
|
||||
m_pSelectObject = nullptr;
|
||||
}
|
||||
|
||||
GUI::End();
|
||||
|
||||
}
|
||||
|
||||
void CMapObject_Manager::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Manager::Render()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Manager::Ready_Components()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Manager::Bind_ShaderResources()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CMapObject_Manager::Save_MapData(const _char* pFileName)
|
||||
{
|
||||
const list<CGameObject*>* pObjectList = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_MapObject"))->Get_Objects();
|
||||
|
||||
if (nullptr == pObjectList)
|
||||
return E_FAIL;
|
||||
|
||||
tinyxml2::XMLDocument doc;
|
||||
|
||||
doc.InsertFirstChild(doc.NewDeclaration());
|
||||
|
||||
tinyxml2::XMLElement* land = doc.NewElement("Land");
|
||||
doc.InsertEndChild(land);
|
||||
|
||||
for (auto& pObjcet : *pObjectList)
|
||||
{
|
||||
CMapObject* pMapObject = dynamic_cast<CMapObject*>(pObjcet);
|
||||
|
||||
if (nullptr == pMapObject)
|
||||
continue;
|
||||
|
||||
// <Model>
|
||||
tinyxml2::XMLElement* model = doc.NewElement("Model");
|
||||
land->InsertEndChild(model);
|
||||
|
||||
// <PrototypeTag>ÅØ½ºÆ®</PrototypeTag>
|
||||
tinyxml2::XMLElement* proto = doc.NewElement("PrototypeTag");
|
||||
proto->SetText(CMyTools::ToString(pMapObject->Get_PrototypeTag()).c_str());
|
||||
model->InsertEndChild(proto);
|
||||
|
||||
// <Position x="0.0" y="0.0" z="0.0"/>
|
||||
tinyxml2::XMLElement* PositionElem = doc.NewElement("Position");
|
||||
|
||||
_float3 vPosition = {};
|
||||
XMStoreFloat3(&vPosition, pMapObject->Get_WorldPostion());
|
||||
|
||||
PositionElem->SetAttribute("x", vPosition.x);
|
||||
PositionElem->SetAttribute("y", vPosition.y);
|
||||
PositionElem->SetAttribute("z", vPosition.z);
|
||||
model->InsertEndChild(PositionElem);
|
||||
|
||||
// <Scale x="0.0" y="0.0" z="0.0"/>
|
||||
tinyxml2::XMLElement* ScaleElem = doc.NewElement("Scale");
|
||||
|
||||
_float3 pScale = pMapObject->Get_Component<CTransform>()->Get_Scale();
|
||||
ScaleElem->SetAttribute("x", pScale.x);
|
||||
ScaleElem->SetAttribute("y", pScale.y);
|
||||
ScaleElem->SetAttribute("z", pScale.z);
|
||||
model->InsertEndChild(ScaleElem);
|
||||
|
||||
// <Rotation x="0.0" y="0.0" z="0.0"/>
|
||||
tinyxml2::XMLElement* RotationElem = doc.NewElement("Rotation");
|
||||
|
||||
_float3 vRotation = {};
|
||||
XMStoreFloat3(&vRotation, pMapObject->Get_Component<CTransform>()->Get_RollPitchYawVector());
|
||||
|
||||
RotationElem->SetAttribute("x", vRotation.x);
|
||||
RotationElem->SetAttribute("y", vRotation.y);
|
||||
RotationElem->SetAttribute("z", vRotation.z);
|
||||
model->InsertEndChild(RotationElem);
|
||||
|
||||
}
|
||||
string strPath = "../Bin/Resources/Data/" + string(pFileName) + ".xml";
|
||||
|
||||
// ÀúÀå
|
||||
if (doc.SaveFile(strPath.c_str()) != tinyxml2::XML_SUCCESS) {
|
||||
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
CMapObject_Manager* CMapObject_Manager::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, vector<_wstring>& ModelPrototypeTags)
|
||||
{
|
||||
CMapObject_Manager* pInstance = new CMapObject_Manager(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype(ModelPrototypeTags)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CMapObject_Manager");
|
||||
Safe_Release(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CMapObject_Manager::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CMapObject_Manager* pInstance = new CMapObject_Manager(*this);
|
||||
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CMapObject_Manager");
|
||||
Safe_Release(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CMapObject_Manager::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
}
|
||||
|
||||
void CMapObject_Manager::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
#include "pch.h"
|
||||
#include "Terrain.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "VIBuffer_Terrain.h"
|
||||
|
||||
CTerrain::CTerrain(ID3D11Device * pDevice, ID3D11DeviceContext * pContext)
|
||||
: CGameObject(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CTerrain::CTerrain(const CTerrain& Prototype)
|
||||
: CGameObject(Prototype)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CTerrain::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTerrain::Initialize(void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Initialize(pArg)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(Ready_Components()))
|
||||
return E_FAIL;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CTerrain::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CTerrain::Update(_float fTimeDelta)
|
||||
{
|
||||
GUI::Begin("Picking Position");
|
||||
if (m_pGameInstance->Mouse_Down(0))
|
||||
m_pVIBufferCom->Picking(m_pTransformCom, m_vPickingPosition);
|
||||
|
||||
GUI::DragFloat3("Pos", (_float*)(&m_vPickingPosition));
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
void CTerrain::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
_float4 vPos;
|
||||
XMStoreFloat4(&vPos, Get_WorldPostion());
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this, vPos, 20.f);
|
||||
}
|
||||
|
||||
HRESULT CTerrain::Render()
|
||||
{
|
||||
if (FAILED(Bind_ShaderResources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_NORTEX::TERRAIN)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pVIBufferCom->Bind_Resources())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pVIBufferCom->Render())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTerrain::Ready_Components()
|
||||
{
|
||||
__super::Ready_Components(nullptr);
|
||||
|
||||
/* Com_VIBuffer */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_VIBuffer_Terrain"),
|
||||
reinterpret_cast<CComponent**>(&m_pVIBufferCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_Shader */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_NORTEX,
|
||||
reinterpret_cast<CComponent**>(&m_pShaderCom))))
|
||||
return E_FAIL;
|
||||
|
||||
/* Com_Texture */
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("TerrainTest"), reinterpret_cast<CComponent**>(&m_pTextureCom), nullptr))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CTerrain::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
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;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Bind_SRV("g_DiffuseTexture", m_pTextureCom->Get_SRV(0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CTerrain* CTerrain::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CTerrain* pInstance = new CTerrain(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CTerrain");
|
||||
Safe_Release(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CTerrain::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CTerrain* pInstance = new CTerrain(*this);
|
||||
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CTerrain");
|
||||
Safe_Release(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CTerrain::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
Safe_Release(m_pShaderCom);
|
||||
Safe_Release(m_pVIBufferCom);
|
||||
Safe_Release(m_pTextureCom);
|
||||
}
|
||||
|
||||
void CTerrain::Describe_Entity()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -11,7 +11,7 @@ namespace Editor
|
||||
const unsigned int g_iWinSizeX = 1920;
|
||||
const unsigned int g_iWinSizeY = 1080;
|
||||
|
||||
enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, OBJECT,UI, EFFECT, END };
|
||||
enum class LEVEL { STATIC, LOADING, LOGO, LOBY, GAMEPLAY, RESTART, OBJECT, MAP,UI, EFFECT, END };
|
||||
enum class COLLIDABLEOBJECT { PLAYER, MONSTER, HOSTILE_HITBOX, ALLY_HITBOX, NEUTRAL_HITBOX, ENVIRIONMENT, NPC, ITEM, TRIGGERBOX, REGION, NOCOLLIDE, END };
|
||||
|
||||
enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, END };
|
||||
|
||||
@@ -17,8 +17,12 @@ class CLevel_MapViewer final : public CLevel
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize() override;
|
||||
HRESULT Ready_Layer_Light();
|
||||
HRESULT Ready_Layer_Camera(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_UI(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_Terrain(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_MapObjects(const _wstring& strLayerTag);
|
||||
HRESULT Ready_Layer_MapObjectManager(const _wstring& strLayerTag);
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@@ -44,6 +44,7 @@ class CLoader final : public CBase
|
||||
HRESULT Initialize(LEVEL eNextLevelID);
|
||||
HRESULT Loading_For_Logo();
|
||||
HRESULT Loading_For_ObjectViewer();
|
||||
HRESULT Loading_For_MapViewer();
|
||||
HRESULT Loading_For_UI();
|
||||
HRESULT Loading_For_Effect();
|
||||
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CShader;
|
||||
class CModel;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CMapObject final : public CGameObject
|
||||
{
|
||||
public:
|
||||
typedef struct tagMapObjectDesc
|
||||
{
|
||||
const _tchar* pModelPrototypeTag;
|
||||
}MAPOBJECT_DESC;
|
||||
|
||||
private:
|
||||
CMapObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CMapObject(const CMapObject& Prototype);
|
||||
virtual ~CMapObject() = 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;
|
||||
|
||||
public:
|
||||
_wstring& Get_PrototypeTag() { return m_strModelPrototypeTag; }
|
||||
|
||||
private:
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
|
||||
_wstring m_strModelPrototypeTag;
|
||||
|
||||
#ifdef _DEBUG
|
||||
_bool m_bSelected = {};
|
||||
_float3 m_vPosition = {};
|
||||
_float3 m_vRotation = {};
|
||||
_float3 m_vScale = {};
|
||||
#endif // _DEBUG
|
||||
|
||||
private:
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Bind_ShaderResources();
|
||||
|
||||
public:
|
||||
static CMapObject* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CShader;
|
||||
class CModel;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CMapObject_Manager final : public CGameObject
|
||||
{
|
||||
private:
|
||||
CMapObject_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CMapObject_Manager(const CMapObject_Manager& Prototype);
|
||||
virtual ~CMapObject_Manager() = default;
|
||||
|
||||
public:
|
||||
virtual HRESULT Initialize_Prototype(vector<_wstring>& ModelPrototypeTags);
|
||||
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;
|
||||
|
||||
private:
|
||||
class CMapObject* m_pSelectObject = { nullptr };
|
||||
const list<class CGameObject*>* m_pMapObjects = { nullptr };
|
||||
vector<_wstring> m_ModelPrototypeTags;
|
||||
|
||||
private:
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Bind_ShaderResources();
|
||||
HRESULT Save_MapData(const _char* pFileName);
|
||||
|
||||
public:
|
||||
static CMapObject_Manager* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, vector<_wstring>& ModelPrototypeTags);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,47 @@
|
||||
#pragma once
|
||||
|
||||
#include "Editor_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CShader;
|
||||
class CVIBuffer_Terrain;
|
||||
class CTexture;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CTerrain final : public CGameObject
|
||||
{
|
||||
private:
|
||||
CTerrain(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CTerrain(const CTerrain& Prototype);
|
||||
virtual ~CTerrain() = 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;
|
||||
|
||||
private:
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CVIBuffer_Terrain* m_pVIBufferCom = { nullptr };
|
||||
CTexture* m_pTextureCom = { nullptr };
|
||||
|
||||
_float3 m_vPickingPosition = {};
|
||||
|
||||
private:
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Bind_ShaderResources();
|
||||
|
||||
public:
|
||||
static CTerrain* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity() override;
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -270,6 +270,7 @@
|
||||
<ClCompile Include="..\Private\VIBuffer_Cube.cpp" />
|
||||
<ClCompile Include="..\Private\Instance_Model.cpp" />
|
||||
<ClCompile Include="..\Private\VIBuffer_Rect.cpp" />
|
||||
<ClCompile Include="..\Private\VIBuffer_Terrain.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Public\Animation.h" />
|
||||
@@ -473,6 +474,7 @@
|
||||
<ClInclude Include="..\Public\VIBuffer_Cube.h" />
|
||||
<ClInclude Include="..\Public\Instance_Model.h" />
|
||||
<ClInclude Include="..\Public\VIBuffer_Rect.h" />
|
||||
<ClInclude Include="..\Public\VIBuffer_Terrain.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\Bin\Resources\ShaderFiles\Engine_Shader_Defines.hlsli" />
|
||||
|
||||
@@ -423,6 +423,9 @@
|
||||
<ClCompile Include="..\Private\ComputeShader.cpp">
|
||||
<Filter>01.Utility\06.ComputeShader</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\VIBuffer_Terrain.cpp">
|
||||
<Filter>02.Element\02.Component\02.VIBuffer\Terrain</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Public\Base.h">
|
||||
@@ -983,6 +986,9 @@
|
||||
<ClInclude Include="..\public\Picking.h">
|
||||
<Filter>01.Utility\06. Picking</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\VIBuffer_Terrain.h">
|
||||
<Filter>02.Element\02.Component\02.VIBuffer\Terrain</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\Public\Assimp\color4.inl">
|
||||
|
||||
@@ -90,12 +90,12 @@ HRESULT CMaterial::Initialize(const _char* pModelFilePath, const aiMaterial* pAI
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT CMaterial::Initialize(const _char* pMaterialFilePath)
|
||||
HRESULT CMaterial::Initialize(const _char* pMaterialFilePath, const _char* pTextureFilePath)
|
||||
{
|
||||
_char szTextureFilePath[MAX_PATH] = {};
|
||||
_char szMaterialFilePath[MAX_PATH] = {};
|
||||
|
||||
strcpy_s(szTextureFilePath, "../Bin/Resources/Models/");
|
||||
strcpy_s(szTextureFilePath, pTextureFilePath);
|
||||
|
||||
strcpy_s(szMaterialFilePath, pMaterialFilePath);
|
||||
strcat_s(szMaterialFilePath, ".props.txt");
|
||||
@@ -114,7 +114,8 @@ HRESULT CMaterial::Read_MaterialFile(const _char* pMaterialFilePath, const _char
|
||||
if (!file.is_open())
|
||||
{
|
||||
MSG_BOX("Failed to Open Materail File");
|
||||
return E_FAIL;
|
||||
//return E_FAIL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
_char szTextureFilePath[MAX_PATH] = {};
|
||||
@@ -250,18 +251,28 @@ HRESULT CMaterial::Add_Texture(const _char* pTextureFolderPath, string& FileType
|
||||
eTexture = aiTextureType::aiTextureType_DIFFUSE;
|
||||
else if (!strcmp(FileType.c_str(), "N"))
|
||||
eTexture = aiTextureType::aiTextureType_NORMALS;
|
||||
else if (!strcmp(FileType.c_str(), "normal"))
|
||||
eTexture = aiTextureType::aiTextureType_NORMALS;
|
||||
else if (!strcmp(FileType.c_str(), "MRO"))
|
||||
eTexture = aiTextureType::aiTextureType_METALNESS;
|
||||
else if (!strcmp(FileType.c_str(), "MROH"))
|
||||
eTexture = aiTextureType::aiTextureType_METALNESS;
|
||||
else if (!strcmp(FileType.c_str(), "MROA'"))
|
||||
else if (!strcmp(FileType.c_str(), "MROA"))
|
||||
eTexture = aiTextureType::aiTextureType_DIFFUSE_ROUGHNESS;
|
||||
else if (!strcmp(FileType.c_str(), "SRO"))
|
||||
eTexture = aiTextureType::aiTextureType_AMBIENT_OCCLUSION;
|
||||
eTexture = aiTextureType::aiTextureType_SPECULAR;
|
||||
else if (!strcmp(FileType.c_str(), "SROH"))
|
||||
eTexture = aiTextureType::aiTextureType_AMBIENT_OCCLUSION;
|
||||
else if (!strcmp(FileType.c_str(), "HDR'"))
|
||||
eTexture = aiTextureType::aiTextureType_DISPLACEMENT;
|
||||
eTexture = aiTextureType::aiTextureType_SPECULAR;
|
||||
else if (!strcmp(FileType.c_str(), "SROA"))
|
||||
eTexture = aiTextureType::aiTextureType_SPECULAR;
|
||||
else if (!strcmp(FileType.c_str(), "HDR"))
|
||||
return S_OK;
|
||||
else if (!strcmp(FileType.c_str(), "MSK"))
|
||||
eTexture = aiTextureType::aiTextureType_MAYA_BASE;
|
||||
else if (!strcmp(FileType.c_str(), "basecolor"))
|
||||
eTexture = aiTextureType::aiTextureType_DIFFUSE;
|
||||
else if (!strcmp(FileType.c_str(), "E"))
|
||||
eTexture = aiTextureType::aiTextureType_EMISSIVE;
|
||||
else
|
||||
{
|
||||
MSG_BOX("Failed to Path Material Texture Type");
|
||||
@@ -337,9 +348,18 @@ CMaterial* CMaterial::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
CMaterial* CMaterial::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, const _char* pMaterialName)
|
||||
|
||||
CMaterial* CMaterial::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pMaterialFilePath, const _char* pTextureFilePath)
|
||||
{
|
||||
return nullptr;
|
||||
CMaterial* pInstance = new CMaterial(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize(pMaterialFilePath, pTextureFilePath)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CMaterial");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -338,6 +338,11 @@ HRESULT CModel::Ready_Materials_FromFile(const aiScene* pAIScene, const _char* p
|
||||
_char szFileName[MAX_PATH] = {};
|
||||
_char szMeshFilePath[MAX_PATH] = {};
|
||||
vector<_string> MaterialFilePathes;
|
||||
string strFolderPath = pModelFilePath;
|
||||
|
||||
size_t iFolderPos = strFolderPath.find("Environment");
|
||||
|
||||
strFolderPath = strFolderPath.substr(0, iFolderPos);
|
||||
|
||||
_splitpath_s(pModelFilePath, szDrive, MAX_PATH, szDir, MAX_PATH, szFileName, MAX_PATH, nullptr, 0);
|
||||
|
||||
@@ -380,12 +385,12 @@ HRESULT CModel::Ready_Materials_FromFile(const aiScene* pAIScene, const _char* p
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
string strPath = "../Bin/Resources/Models/" + strText.substr(iBeginIndex, iEndIndex - iBeginIndex);
|
||||
string strPath = strFolderPath + strText.substr(iBeginIndex, iEndIndex - iBeginIndex);
|
||||
MaterialFilePathes.push_back(strPath);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < m_iNumMaterials; ++i) {
|
||||
CMaterial* pMaterial = CMaterial::Create(m_pDevice, m_pContext, MaterialFilePathes[i].c_str(), pAIScene->mMaterials[i]->GetName().C_Str());
|
||||
CMaterial* pMaterial = CMaterial::Create(m_pDevice, m_pContext, MaterialFilePathes[i].c_str(), strFolderPath.c_str());
|
||||
if (nullptr == pMaterial) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -760,7 +765,9 @@ HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fma
|
||||
#pragma region Material
|
||||
if (MODEL::ENVIROMENT == eType)
|
||||
{
|
||||
|
||||
if (FAILED(Ready_Materials_FromFile(m_pAIScene, pModelFilePath))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -24,12 +24,12 @@ class ENGINE_DLL CMaterial final : public CBase
|
||||
#ifdef EDITOR_PROJECT
|
||||
public:
|
||||
static CMaterial* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, const aiMaterial* pAIMaterial);
|
||||
static CMaterial* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, const _char* pMaterialName);
|
||||
static CMaterial* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pMaterialFilePath, const _char* pTextureFilePath);
|
||||
HRESULT SaveAsBinary(HANDLE hFile, DWORD& dwByte);
|
||||
private:
|
||||
vector<string> m_strPath[AI_TEXTURE_TYPE_MAX];
|
||||
HRESULT Initialize(const _char* pModelFilePath, const aiMaterial* pAIMaterial);
|
||||
HRESULT Initialize(const _char* pMaterialFilePath);
|
||||
HRESULT Initialize(const _char* pMaterialFilePath, const _char* pTextureFilePath);
|
||||
HRESULT Read_MaterialFile(const _char* pMaterialFilePath, const _char* pTextureFolderPath);
|
||||
HRESULT Add_Texture(const _char* pTextureFolderPath, string& FileType);
|
||||
#endif // EDITOR_PROJECT
|
||||
|
||||
@@ -51,6 +51,7 @@ using namespace DirectX;
|
||||
#include <cassert>
|
||||
#include <random>
|
||||
#include <fstream>
|
||||
#include <filesystem>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user