Merge pull request #126 from SpicyGangjeong/Develope

follow
This commit is contained in:
JinhoBa
2025-11-14 22:42:53 +09:00
committed by GitHub
229 changed files with 3438 additions and 1329 deletions
+2 -2
View File
@@ -15,12 +15,12 @@ end_of_line = crlf
# hlsl 저장형식 지정
[*.hlsl]
charset = utf-8-bom
charset = utf-8
insert_final_newline = true
end_of_line = crlf
# hlsli 저장형식 지정
[*.hlsli]
charset = utf-8-bom
charset = utf-8
insert_final_newline = true
end_of_line = crlf
@@ -19,8 +19,11 @@ float g_fSpotOuterAngle;
vector g_vLightDir;
vector g_vLightPos;
vector g_vLightPosOffset;
vector g_vCamPosition;
Texture2D g_NormalTexture;
Texture2D g_DiffuseTexture;
Texture2D g_ShadeTexture;
@@ -156,7 +159,7 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In)
vPosition = mul(vPosition, g_invmatProj);
vPosition = mul(vPosition, g_invMatView);
vector vLightDir = vPosition - g_vLightPos;
vector vLightDir = vPosition - (g_vLightPos + g_vLightPosOffset);
float fDistance = length(vLightDir);
float fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange);
if (fAttenuation <= 0.f)
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Level_GamePlay.h"
#include "GameInstance.h"
#include "Level_Loading.h"
@@ -46,7 +46,7 @@ void CLevel_GamePlay::Update(_float fTimeDelta)
HRESULT CLevel_GamePlay::Render()
{
SetWindowText(g_hWnd, TEXT("게임플레이레벨입니다"));
SetWindowText(g_hWnd, TEXT("게임플레이레벨입니다"));
return S_OK;
}
@@ -58,11 +58,12 @@ HRESULT CLevel_GamePlay::Ready_Lights()
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);
//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->On_Light(NEXT_LEVEL, TEXT("Main_Light"), LightDesc, nullptr))) {
// return E_FAIL;
//}
assert(false);
return S_OK;
+1 -1
View File
@@ -1,4 +1,4 @@
#pragma once
#pragma once
namespace Client {
#ifndef __TEXT
Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

@@ -19,8 +19,11 @@ float g_fSpotOuterAngle;
vector g_vLightDir;
vector g_vLightPos;
vector g_vLightPosOffset;
vector g_vCamPosition;
Texture2D g_NormalTexture;
Texture2D g_DiffuseTexture;
Texture2D g_ShadeTexture;
@@ -156,7 +159,7 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In)
vPosition = mul(vPosition, g_invmatProj);
vPosition = mul(vPosition, g_invMatView);
vector vLightDir = vPosition - g_vLightPos;
vector vLightDir = vPosition - (g_vLightPos + g_vLightPosOffset);
float fDistance = length(vLightDir);
float fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange);
if (fAttenuation <= 0.f)
@@ -8,6 +8,7 @@ int g_iImageCountY;
float g_fFar;
float g_fTime;
float g_fTimeMult;
float g_fFrame;
float g_fAlpha;
float g_fOwnerAlpha;
@@ -16,8 +17,11 @@ float g_fDeltaU;
float g_fDeltaV;
uint g_iIndexU;
uint g_iIndexV;
float4 g_fNine_Slice;
float2 g_fOrigin_Size;
float2 g_fCurrent_Size;
uint g_iQuestType;
float g_fPI;
Texture2D g_Texture;
Texture2D g_Texture1;
@@ -64,7 +68,7 @@ struct PS_OUT
float4 vColor : SV_Target0;
};
PS_OUT PS_MAIN(PS_IN In) // ?쇰컲 UI
PS_OUT PS_MAIN(PS_IN In)
{
PS_OUT Out;
@@ -142,19 +146,31 @@ PS_OUT PS_Cursor(PS_IN In)
Color = White;
Out.vColor = Color;
return Out;
}
PS_OUT PS_Key_Hold_Rotation(PS_IN In)
{
PS_OUT Out;
float4 Color = g_Texture.Sample(DefaultSampler, In.vTexcoord);
if (Color.a <= 0.1f)
discard;
Out.vColor = Color;
float2 uv = In.vTexcoord;
float4 tex = g_Texture.Sample(DefaultSampler, uv);
float2 center = float2(0.5f, 0.5f);
float2 dir = uv - center;
float angle = atan2(dir.x, -dir.y);
if (angle < 0)
angle += g_fPI;
float rotation = saturate(g_fTime * g_fTimeMult) * g_fPI;
tex.rgb = (angle <= rotation) ? 1.0 : tex.rgb;
Out.vColor = tex;
return Out;
}
@@ -224,6 +240,52 @@ PS_OUT PS_UVMult(PS_IN In)
return Out;
}
PS_OUT PS_NineSlice(PS_IN In)
{
PS_OUT Out;
float Left = g_fNine_Slice.x / g_fOrigin_Size.x;
float Right = (g_fOrigin_Size.x - g_fNine_Slice.y) / g_fOrigin_Size.x;
float Top = g_fNine_Slice.z / g_fOrigin_Size.y;
float Bottom = (g_fOrigin_Size.y - g_fNine_Slice.w) / g_fOrigin_Size.y;
float2 ratio = g_fCurrent_Size / g_fOrigin_Size;
float2 UV = In.vTexcoord * 0.5f + 0.5f;
float2 ScaledUV = UV;
if(UV.x < Left)
{
ScaledUV.x = UV.x;
}
else if(UV.x > Right)
{
ScaledUV.x = 1.0f - ((1.0f - UV.x) / ratio.x);
}
else
{
ScaledUV.x = Left + (UV.x - Left) / ratio.x;
}
if(UV.y < Top)
{
ScaledUV.y = UV.y;
}
else if(UV.y > Bottom)
{
ScaledUV.y = 1.0f - ((1.0f - UV.y) / ratio.y);
}
else
{
ScaledUV.y = Top + (UV.y - Top) / ratio.y;
}
float4 color = g_Texture.Sample(ClampSampler, ScaledUV);
Out.vColor = color;
return Out;
}
technique11 PosTexTechnique11
{
pass Default
@@ -305,4 +367,15 @@ technique11 PosTexTechnique11
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_UVMult();
}
pass NineSlice
{
SetRasterizerState(RS_Default);
SetDepthStencilState(DSS_Default, 0);
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
VertexShader = compile vs_5_0 VS_MAIN();
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_NineSlice();
}
}
@@ -304,6 +304,37 @@ PS_OUT PS_MAIN_TEST(PS_IN In)
return Out;
}
PS_OUT PS_EYELASH(PS_IN In)
{
PS_OUT Out;
vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
if (vMtrlDiffuse.a < 0.4f)
{
discard;
}
vector vNormalDesc = g_NormalTexture.Sample(MirrorSampler, In.vTexcoord);
float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal);
float3 vNormal = mul(vNormalDesc.xyz * 2.f - 1.f, WorldMatrix);
if (true == g_bRimLight)
{
float fRimLight = GetRimLight(g_vCamPosition.xyz, In.vWorldPos.xyz, vNormal, g_fRimPower, g_fRimStrength);
vMtrlDiffuse.xyz = (vMtrlDiffuse.xyz * (1 - fRimLight)) + g_vRimColor * fRimLight;
}
Out.vDiffuse = float4(vMtrlDiffuse.rgb, vMtrlDiffuse.g);
Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f);
Out.vDepth = float4(In.vProjPos.z / In.vProjPos.w, In.vProjPos.w / g_fFar, 0.0f, 1.f);
return Out;
}
technique11 DefaultTechnique
{
pass Default
@@ -354,4 +385,14 @@ technique11 DefaultTechnique
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_MAIN_TEST();
}
pass EyeLashPass
{
SetRasterizerState(RS_Default);
SetDepthStencilState(DSS_Default, 0);
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
VertexShader = compile vs_5_0 VS_MAIN();
GeometryShader = NULL;
PixelShader = compile ps_5_0 PS_EYELASH();
}
}
@@ -29,6 +29,7 @@ Texture2D g_NormalTexture : register(t1);
Texture2D g_MaskingTexture : register(t2);
Texture2D g_DissolveTexture : register(t3);
Texture2D g_NoiseTexture : register(t4);
Texture2D g_EmissiveTexture : register(t6);
StructuredBuffer<ParticleValue> g_ParticleValue : register(t5);
@@ -65,6 +66,7 @@ bool g_isDiffuse;
bool g_isMasking;
bool g_isDissolve;
bool g_isNoise;
bool g_isEmissive;
bool g_isDiffuseUVMove;
bool g_isMaskUVMove;
@@ -323,8 +325,16 @@ PS_OUT PS_NON_NORMALMAP(PS_IN In)
Out.vDiffuse = vMtrlDiffuse;
// 색깔 추가할 처리 (이미시브)
float4 vEmissiveMtrl;
if (g_isEmissive == true)
{
vEmissiveMtrl = g_EmissiveTexture.Sample(DefaultSampler, In.vTexcoord);
}
if (vMtrlDiffuse.a >= g_fEmissiveCutAlpha)
Out.vColorTarget = vector(g_vEmissive.rgb, g_fColorOption / 10.f);
Out.vColorTarget = vector(g_vEmissive.rgb + vEmissiveMtrl.rgb, g_fColorOption / 10.f);
else
Out.vColorTarget = vector(0.f, 0.f, 0.f, 0.f);
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.
@@ -129,6 +129,12 @@
<Command>
</Command>
</PreBuildEvent>
<FxCompile>
<ShaderType>Effect</ShaderType>
</FxCompile>
<FxCompile>
<ShaderModel>5.0</ShaderModel>
</FxCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@@ -161,6 +167,7 @@
<ClInclude Include="..\public\Active_Icon.h" />
<ClInclude Include="..\Public\DummyObject.h" />
<ClInclude Include="..\public\DummySkyBox.h" />
<ClInclude Include="..\Public\Dummy_Plane.h" />
<ClInclude Include="..\Public\Dummy_PhysXPlayable.h" />
<ClInclude Include="..\public\GamePlay_Canvas.h" />
<ClInclude Include="..\public\BuildingContainer.h" />
@@ -183,6 +190,7 @@
<ClInclude Include="..\public\MapObject_LOD.h" />
<ClInclude Include="..\public\MapObject_Manager.h" />
<ClInclude Include="..\public\MapObject_Static.h" />
<ClInclude Include="..\Public\MainLight.h" />
<ClInclude Include="..\public\Terrain.h" />
<ClInclude Include="..\Public\Level_PhysXLab.h" />
<ClInclude Include="..\Public\TestEffect.h" />
@@ -226,6 +234,7 @@
<ClCompile Include="..\private\Active_Icon.cpp" />
<ClCompile Include="..\Private\DummyObject.cpp" />
<ClCompile Include="..\private\DummySkyBox.cpp" />
<ClCompile Include="..\Private\Dummy_Plane.cpp" />
<ClCompile Include="..\Private\Dummy_PhysXPlayable.cpp" />
<ClCompile Include="..\private\GamePlay_Canvas.cpp" />
<ClCompile Include="..\private\BuildingContainer.cpp" />
@@ -248,6 +257,7 @@
<ClCompile Include="..\private\MapObject_LOD.cpp" />
<ClCompile Include="..\private\MapObject_Manager.cpp" />
<ClCompile Include="..\private\MapObject_Static.cpp" />
<ClCompile Include="..\Private\MainLight.cpp" />
<ClCompile Include="..\private\Terrain.cpp" />
<ClCompile Include="..\Private\Level_PhysXLab.cpp" />
<ClCompile Include="..\Private\TestEffect.cpp" />
@@ -196,6 +196,12 @@
<Filter Include="02.GameObjects\Dummys\DummySkyBox">
<UniqueIdentifier>{12d17342-7cb4-46be-8243-9e1864496338}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\MainLight">
<UniqueIdentifier>{a9360a97-5ef2-476a-9f12-f4e06c28290c}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Layer_Effect\Dummy_Plane">
<UniqueIdentifier>{6872c5bc-5eac-46a1-b6d8-3ec0f4fb2cd5}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Editor.h">
@@ -396,6 +402,12 @@
<ClInclude Include="..\Public\Information.h">
<Filter>03.Information</Filter>
</ClInclude>
<ClInclude Include="..\Public\MainLight.h">
<Filter>02.GameObjects\MainLight</Filter>
</ClInclude>
<ClInclude Include="..\Public\Dummy_Plane.h">
<Filter>02.GameObjects\Layer_Effect\Dummy_Plane</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="Editor.ico">
@@ -592,6 +604,12 @@
<ClCompile Include="..\Private\Information.cpp">
<Filter>03.Information</Filter>
</ClCompile>
<ClCompile Include="..\Private\MainLight.cpp">
<Filter>02.GameObjects\MainLight</Filter>
</ClCompile>
<ClCompile Include="..\Private\Dummy_Plane.cpp">
<Filter>02.GameObjects\Layer_Effect\Dummy_Plane</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Editor.rc">
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Active_Icon.h"
#include "GameInstance.h"
+3 -3
View File
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Body.h"
#include "GameInstance.h"
@@ -75,7 +75,7 @@ CBody* CBody::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CBody");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
@@ -88,7 +88,7 @@ CGameObject* CBody::Clone(void* pArg, CGameObject* pOwner)
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CBody");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "BuildingContainer.h"
#include "PartObject.h"
#include "Terrain.h"
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "DebugCamera.h"
#include "Shader.h"
@@ -95,6 +95,9 @@ HRESULT CDebugCamera::Initialize(void* pArg)
m_pTransformCom->LookAt(XMVectorSetW(XMLoadFloat3(&pDesc->vAt), 1.f));
m_matInitial = *m_pTransformCom->Get_WorldMatrixPtr();
m_bActive = true;
m_pGameInstance->Add_Camera(NEXT_LEVEL, this, m_pCameraKey);
m_pGameInstance->Bind_Camera(NEXT_LEVEL, m_pCameraKey, false);
return S_OK;
}
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "DummyObject.h"
#include "GameInstance.h"
@@ -44,7 +44,7 @@ void CDummyObject::Priority_Update(_float fTimeDelta)
void CDummyObject::Update(_float fTimeDelta)
{
m_pModelCom->Play_Animation(fTimeDelta);
m_pModelCom->Play_Animation(fTimeDelta,m_pTransformCom);
}
void CDummyObject::Late_Update(_float fTimeDelta)
@@ -129,7 +129,7 @@ CDummyObject* CDummyObject::Create(ID3D11Device* pDevice, ID3D11DeviceContext* p
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CDummyObject");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
@@ -142,7 +142,7 @@ CGameObject* CDummyObject::Clone(void* pArg, CGameObject* pOwner)
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CDummyObject");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
@@ -154,8 +154,8 @@ void CDummyObject::Free()
{
__super::Free();
Safe_Release(m_pShaderCom);
Safe_Release(m_pModelCom);
SAFE_RELEASE(m_pShaderCom);
SAFE_RELEASE(m_pModelCom);
}
void CDummyObject::Describe_Entity()
+1 -1
View File
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "DummyRect.h"
#include "GameInstance.h"
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "DummySkyBox.h"
#include "GameInstance.h"
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Dummy_Cube.h"
#include "GameInstance.h"
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Dummy_PhysXBox.h"
#include "GameInstance.h"
@@ -155,8 +155,8 @@ void CDummy_PhysXBox::Free()
__super::Free();
SAFE_RELEASE(m_pRigidBody);
Safe_Release(m_pShaderCom);
Safe_Release(m_pModelCom);
SAFE_RELEASE(m_pShaderCom);
SAFE_RELEASE(m_pModelCom);
}
void CDummy_PhysXBox::Describe_Entity()
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Dummy_PhysXMesh.h"
#include "GameInstance.h"
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Dummy_PhysXPlayable.h"
#include "GameInstance.h"
@@ -117,9 +117,9 @@ HRESULT CDummy_PhysXPlayable::Ready_Components(void* pArg)
Desc.fMaterial = { 0.5f, 0.5f, 0.6f };
Desc.bAutoStepping = { false };
Desc.fStepOffset = { 0.05f };
Desc.tCapsuleInfo.fRadius = 0.5f;
Desc.tCapsuleInfo.fHeight = 1.0f;
Desc.tCapsuleInfo.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY;
Desc.fRadius = 0.5f;
Desc.fHeight = 1.0f;
Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY;
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) {
return E_FAIL;
}
@@ -188,8 +188,8 @@ void CDummy_PhysXPlayable::Free()
__super::Free();
SAFE_RELEASE(m_pCharacter_Controller);
Safe_Release(m_pShaderCom);
Safe_Release(m_pModelCom);
SAFE_RELEASE(m_pShaderCom);
SAFE_RELEASE(m_pModelCom);
}
void CDummy_PhysXPlayable::Describe_Entity()
@@ -0,0 +1,160 @@
#include "pch.h"
#include "Dummy_Plane.h"
#include "GameInstance.h"
CDummy_Plane::CDummy_Plane(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CGameObject{ pDevice, pContext }
{
}
CDummy_Plane::CDummy_Plane(const CDummy_Plane& rhs)
: CGameObject(rhs)
{
}
HRESULT CDummy_Plane::Initialize_Prototype()
{
return S_OK;
}
HRESULT CDummy_Plane::Initialize(void* pArg)
{
if (FAILED(__super::Initialize(pArg)))
return E_FAIL;
if (FAILED(Ready_Components(pArg)))
return E_FAIL;
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(0.f, -10.f, 0.f, 1.f));
return S_OK;
}
void CDummy_Plane::Priority_Update(_float fTimeDelta)
{
}
void CDummy_Plane::Update(_float fTimeDelta)
{
}
void CDummy_Plane::Late_Update(_float fTimeDelta)
{
_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]);
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this, *vPos, m_pTransformCom->Get_Radius());
}
HRESULT CDummy_Plane::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 CDummy_Plane::Ready_Components(void* pArg)
{
if (FAILED(__super::Ready_Components(pArg))) {
return E_FAIL;
}
///* Com_Model */
//if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_GoblinBody_Model"),
// reinterpret_cast<CComponent**>(&m_pModelCom))))
// return E_FAIL;
/* Com_Model */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Model_DummyPlane"),
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 CDummy_Plane::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;
}
return S_OK;
}
CDummy_Plane* CDummy_Plane::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
{
CDummy_Plane* pInstance = new CDummy_Plane(pDevice, pContext);
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CDummy_Plane");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
CGameObject* CDummy_Plane::Clone(void* pArg, CGameObject* pOwner)
{
CDummy_Plane* pInstance = new CDummy_Plane(*this);
pInstance->m_pOwner = pOwner;
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CDummy_Plane");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CDummy_Plane::Free()
{
__super::Free();
SAFE_RELEASE(m_pModelCom);
SAFE_RELEASE(m_pShaderCom);
}
void CDummy_Plane::Describe_Entity()
{
}
+289 -50
View File
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "EditEffect.h"
#include "GameInstance.h"
@@ -41,7 +41,7 @@ void CEditEffect::Update(_float fTimeDelta)
if (m_isBillboard)
if (m_EffectInfo.isBillboard)
m_pGameInstance->BillBoard(m_pTransformCom);
if (m_pInstance_ModelCom == nullptr)
@@ -61,15 +61,16 @@ void CEditEffect::Late_Update(_float fTimeDelta)
_float4* vPos = (_float4*)(m_pTransformCom->Get_WorldMatrixPtr()->m[3]);
if (m_isBlur == true)
if (m_EffectInfo.isBlur == true)
m_pGameInstance->Add_RenderGroup(RENDER::BLUR, this, *vPos, m_pTransformCom->Get_Radius());
m_pGameInstance->Add_RenderGroup(m_eRenderOrder, this, *vPos, m_pTransformCom->Get_Radius());
m_pGameInstance->Add_RenderGroup(m_EffectInfo.eRenderOrder, this, *vPos, m_pTransformCom->Get_Radius());
}
void CEditEffect::Reference_Mat_For_EditEffect()
{
string strName = {};
const char* pCompute[] = { "DIFFUSE" , "MASK", "NOISE", "DISSOLVE" };
@@ -79,16 +80,37 @@ void CEditEffect::Reference_Mat_For_EditEffect()
switch (m_iSelectTextureNum)
{
case 0:
dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pDiffuse_TextureCom, this);
strName = dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pDiffuse_TextureCom, this);
if (strName != "")
{
m_strDiffuseName = strName;
}
break;
case 1:
dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pMasking_TextureCom, this);
strName =dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pMasking_TextureCom, this);
if (strName != "")
{
m_strMaskingName = strName;
}
break;
case 2:
dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pNoise_TextureCom, this);
strName = dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pNoise_TextureCom, this);
if (strName != "")
{
m_strNoiseName = strName;
}
break;
case 3:
dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pDissolve_TextureCom, this);
strName = dynamic_cast<CEffect_Editor*>(m_pOwner)->Reference_Mat_For_EditEffect((CComponent**)&m_pDissolve_TextureCom, this);
if (strName != "")
{
m_strDissolveName = strName;
}
break;
default:
break;
@@ -97,6 +119,145 @@ void CEditEffect::Reference_Mat_For_EditEffect()
}
HRESULT CEditEffect::Save_Effect(const _char* pPath)
{
_string strPerfectFilePath = pPath;
strPerfectFilePath += ".bin";
HANDLE hFile = CreateFile(CMyTools::ToWstring(strPerfectFilePath).c_str(),
GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, NULL
);
if (hFile == INVALID_HANDLE_VALUE) {
MessageBox(NULL, L"오브젝트 저장 실패", L"System Message", MB_OK);
return E_FAIL;
}
DWORD dwByte(0);
if (m_pLightCom != nullptr)
{
m_EffectInfo.LightDesc = *m_pLightCom->Get_LightDesc();
}
if (!WriteFile(hFile, &m_EffectInfo, sizeof(EFFECT_INFO), &dwByte, nullptr)) {
return E_FAIL;
}
if (m_EffectInfo.isDiffuse)
{
size_t iComponentLength = m_strDiffuseName.length();
const _char* pFileComponentPath = m_strDiffuseName.c_str();
if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
return E_FAIL;
}
if (iComponentLength != 0)
{
if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
return E_FAIL;
}
}
}
if (m_EffectInfo.isNoise)
{
size_t iComponentLength = m_strNoiseName.length();
const _char* pFileComponentPath = m_strNoiseName.c_str();
if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
return E_FAIL;
}
if (iComponentLength != 0)
{
if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
return E_FAIL;
}
}
}
if (m_EffectInfo.isMasking)
{
size_t iComponentLength = m_strMaskingName.length();
const _char* pFileComponentPath = m_strMaskingName.c_str();
if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
return E_FAIL;
}
if (iComponentLength != 0)
{
if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
return E_FAIL;
}
}
}
if (m_EffectInfo.isDissolve)
{
size_t iComponentLength = m_strDissolveName.length();
const _char* pFileComponentPath = m_strDissolveName.c_str();
if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
return E_FAIL;
}
if (iComponentLength != 0)
{
if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
return E_FAIL;
}
}
}
if (m_EffectInfo.isEmissive)
{
size_t iComponentLength = m_strEmissiveName.length();
const _char* pFileComponentPath = m_strEmissiveName.c_str();
if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
return E_FAIL;
}
if (iComponentLength != 0)
{
if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
return E_FAIL;
}
}
}
size_t iComponentLength = m_strModelName.length();
const _char* pFileComponentPath = m_strModelName.c_str();
if (!WriteFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
return E_FAIL;
}
if (iComponentLength != 0)
{
if (!WriteFile(hFile, pFileComponentPath, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
return E_FAIL;
}
}
m_pInstance_ModelCom->Save_InstanceModel(hFile);
CloseHandle(hFile);
return S_OK;
}
HRESULT CEditEffect::Ready_Components(void* pArg)
{
if (FAILED(__super::Ready_Components(pArg)))
@@ -146,44 +307,46 @@ void CEditEffect::Free()
void CEditEffect::Describe_Entity()
{
//여기서 모델, 텍스쳐, 선택할 수 있도록 함
//여기서 모델, 텍스쳐, 선택할 수 있도록 함
const char* pLerp[] = { "Linear" , "EaseInQuad", "EaseOutQuad", "EaseInCubic" , "EaseOutCubic" , "EaseInOutSin" , "EaseInBack" , "Expo" , "Circle" };
const char* pRenderNames[] = { "PRIORITY" , "SHADOW", "NONBLEND", "BLUR" , "NONLIGHT" ,"EFFECT", "BLEND" , "UI" };
_int iCurrentItem = static_cast<_int>(m_eRenderOrder);
_int iCurrentItem = static_cast<_int>(m_EffectInfo.eRenderOrder);
if (ImGui::Combo("Render Order", &iCurrentItem, pRenderNames, ENUM_CLASS(RENDER::END)))
{
m_eRenderOrder = static_cast<RENDER>(iCurrentItem);
m_EffectInfo.eRenderOrder = static_cast<RENDER>(iCurrentItem);
}
m_pTransformCom->Describe_Entity();
GUI::Checkbox("Diffuse", &m_isDiffuse);
GUI::Checkbox("Masking", &m_isMasking);
GUI::Checkbox("Dissolve", &m_isDissolve);
GUI::Checkbox("Noise", &m_isNoise);
GUI::Checkbox("Diffuse", &m_EffectInfo.isDiffuse);
GUI::Checkbox("Masking", &m_EffectInfo.isMasking);
GUI::Checkbox("Dissolve", &m_EffectInfo.isDissolve);
GUI::Checkbox("Noise", &m_EffectInfo.isNoise);
if (GUI::Checkbox("Billboard", &m_isBillboard))
if (GUI::Checkbox("Billboard", &m_EffectInfo.isBillboard))
{
m_pTransformCom->Rotation(0.f, 0.f, 0.f);
}
GUI::ColorEdit4("MixColor", (_float*)&m_vColor);
GUI::ColorEdit4("MixColor", (_float*)&m_EffectInfo.vColor);
ImGui::PushItemWidth(80);
m_pShaderCom->Describe_Entity();
ImGui::PopItemWidth();
if (GUI::TreeNode("BLUR"))
{
GUI::Checkbox("Blur", &m_isBlur);
GUI::Checkbox("Blur", &m_EffectInfo.isBlur);
ImGui::PushItemWidth(80);
GUI::DragFloat("BlurIntensity", &m_fBlurIntensity, 0.005f, 0.f, 1.f);
GUI::DragInt("BlurWeight", &m_iBlurWeight, 1.f, 0, 32);
GUI::DragFloat("BlurIntensity", &m_EffectInfo.fBlurIntensity, 0.005f, 0.f, 1.f);
GUI::DragInt("BlurWeight", &m_EffectInfo.iBlurWeight, 1.f, 0, 32);
ImGui::PopItemWidth();
@@ -196,24 +359,73 @@ void CEditEffect::Describe_Entity()
{
const char* pCompute[] = {"NONE", "DIV" , "PLUS", "SUBSTRACT", "MULTY" , "EQUL" };
_int iColorOption = (_int)m_fColorOption;
_int iColorOption = (_int)m_EffectInfo.fColorOption;
if (ImGui::Combo("OPTION", &iColorOption, pCompute , 6))
{
m_fColorOption = (_float)iColorOption;
m_EffectInfo.fColorOption = (_float)iColorOption;
}
ImGui::PushItemWidth(80);
GUI::DragFloat("EmissiveCutAlpha", &m_fEmissiveCutAlpha, 0.005f, 0.f, 1.f);
GUI::DragFloat("EmissiveCutAlpha", &m_EffectInfo.fEmissiveCutAlpha, 0.005f, 0.f, 1.f);
ImGui::PopItemWidth();
GUI::ColorEdit4("Emissive", (_float*)&m_vEmissive);
GUI::ColorEdit4("Emissive", (_float*)&m_EffectInfo.vEmissive);
GUI::Checkbox("EmissiveTex", &m_EffectInfo.isEmissive);
if (m_EffectInfo.isEmissive)
{
if (GUI::TreeNode("EMISSIVE_TEX"))
{
_string strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "EMISSIVE_TEXTURE", (CComponent**)&m_pEmissive_TextureCom, nullptr, this);
if (strName != "") {
m_strEmissiveName = strName;
}
GUI::TreePop();
}
}
GUI::TreePop();
}
if (GUI::TreeNode("LIGHT"))
{
if (GUI::Button("ADD LIGHT"))
{
if (m_pLightCom != nullptr)
{
GUI::TreePop();
return;
}
LIGHT_DESC LightDesc{};
LightDesc.eType = LIGHT::POINT;
LightDesc.vDiffuse = _float4(0.0f, 0.0f, 0.0f, 0.f);
LightDesc.vAmbient = _float4(0.0f, 0.0f, 0.0f, 0.f);
LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f);
LightDesc.pPosition = m_pTransformCom->Get_StatePtr(STATE::POSITION);
LightDesc.iLevel = NEXT_LEVEL;
/* Com_Light*/
if (FAILED(Add_Component<CLight>(g_iStaticLevel, &m_pLightCom, &LightDesc)))
{
GUI::TreePop();
return;
}
}
if (m_pLightCom != nullptr)
{
m_pLightCom->Describe_Entity();
}
GUI::TreePop();
}
if (GUI::TreeNode("MODEL"))
{
@@ -222,7 +434,11 @@ void CEditEffect::Describe_Entity()
if (m_pInstance_ModelCom != nullptr)
InstanceDesc = m_pInstance_ModelCom->Get_EffectValue();
m_pGameInstance->Asset_Description<CInstance_Model>(ENUM_CLASS(LEVEL::EFFECT), "INSTANCE_MODEL", (CComponent**)&m_pInstance_ModelCom, &InstanceDesc, this);
_string strName = m_pGameInstance->Asset_Description<CInstance_Model>(ENUM_CLASS(LEVEL::EFFECT), "INSTANCE_MODEL", (CComponent**)&m_pInstance_ModelCom, &InstanceDesc, this);
if (strName != "") {
m_strModelName = strName;
}
if (m_pInstance_ModelCom != nullptr)
{
@@ -233,27 +449,30 @@ void CEditEffect::Describe_Entity()
}
if (m_isDiffuse == true)
if (m_EffectInfo.isDiffuse == true)
{
if (GUI::TreeNode("DIFFUSE"))
{
ImGui::PushItemWidth(80);
GUI::Checkbox("DiffuseUVMove", &m_isDiffuseUVMove);
GUI::InputFloat2("DiffuseUVCutting", (_float*)&m_vUVCutting);
GUI::Checkbox("DiffuseUVMove", &m_EffectInfo.isDiffuseUVMove);
GUI::InputFloat2("DiffuseUVCutting", (_float*)&m_EffectInfo.vUVCutting);
GUI::Spacing();
GUI::DragFloat2("DiffuseUVGainAmount", (_float*)&m_vDiffuseUVGainAmount, 0.01f);
GUI::DragFloat2("DiffuseUVGainAmount", (_float*)&m_EffectInfo.vDiffuseUVGainAmount, 0.01f);
_int iDiffuseMoveLerpOption = (_int)m_iDiffuseMoveLerpOption;
_int iDiffuseMoveLerpOption = (_int)m_EffectInfo.iDiffuseMoveLerpOption;
if (ImGui::Combo("Lerp DiffuseMove Option", &iDiffuseMoveLerpOption, pLerp, 9))
{
m_iDiffuseMoveLerpOption = iDiffuseMoveLerpOption;
m_EffectInfo.iDiffuseMoveLerpOption = iDiffuseMoveLerpOption;
}
GUI::Spacing();
@@ -262,7 +481,13 @@ void CEditEffect::Describe_Entity()
if (GUI::TreeNode("DIFFUSE_TEX"))
{
m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DIFFUSE_TEXTURE", (CComponent**)&m_pDiffuse_TextureCom, nullptr, this);
_string strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DIFFUSE_TEXTURE", (CComponent**)&m_pDiffuse_TextureCom, nullptr, this);
if (strName != "") {
m_strDiffuseName = strName;
}
GUI::TreePop();
}
@@ -273,27 +498,27 @@ void CEditEffect::Describe_Entity()
}
if (m_isMasking == true)
if (m_EffectInfo.isMasking == true)
{
if (GUI::TreeNode("MASKING"))
{
GUI::InputFloat2("MaskUVCutting", (_float*)&m_vUVMaskCutting);
GUI::Checkbox("MaskUVMove", &m_isMaskUVMove);
GUI::InputFloat2("MaskUVCutting", (_float*)&m_EffectInfo.vUVMaskCutting);
GUI::Checkbox("MaskUVMove", &m_EffectInfo.isMaskUVMove);
ImGui::PushItemWidth(80);
GUI::DragFloat2("MaskingUVGainAmount", (_float*)&m_vMaskingUVGainAmount, 0.01f);
GUI::DragFloat2("MaskingUVGainAmount", (_float*)&m_EffectInfo.vMaskingUVGainAmount, 0.01f);
ImGui::PopItemWidth();
GUI::Spacing();
_int iMaskMoveLerpOption = (_int)m_iMaskMoveLerpOption;
_int iMaskMoveLerpOption = (_int)m_EffectInfo.iMaskMoveLerpOption;
if (ImGui::Combo("Lerp MaskMove Option", &iMaskMoveLerpOption, pLerp, 9))
{
m_iMaskMoveLerpOption = iMaskMoveLerpOption;
m_EffectInfo.iMaskMoveLerpOption = iMaskMoveLerpOption;
}
@@ -301,7 +526,12 @@ void CEditEffect::Describe_Entity()
if (GUI::TreeNode("MASKING_TEX"))
{
m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "MASKING_TEXTURE", (CComponent**)&m_pMasking_TextureCom, nullptr, this);
string strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "MASKING_TEXTURE", (CComponent**)&m_pMasking_TextureCom, nullptr, this);
if (strName != "") {
m_strMaskingName = strName;
}
GUI::TreePop();
}
GUI::Separator(); GUI::Spacing();
@@ -310,13 +540,18 @@ void CEditEffect::Describe_Entity()
}
}
if (m_isDissolve == true)
if (m_EffectInfo.isDissolve == true)
{
if (GUI::TreeNode("DISSOLVE"))
{
if (GUI::TreeNode("DISSOLV_TEX"))
{
m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DISSOLVE_TEXTURE", (CComponent**)&m_pDissolve_TextureCom, nullptr, this);
_string strName = m_strDissolveName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "DISSOLVE_TEXTURE", (CComponent**)&m_pDissolve_TextureCom, nullptr, this);
if (strName != "") {
m_strDissolveName = strName;
}
GUI::TreePop();
}
GUI::Separator(); GUI::Spacing();
@@ -325,34 +560,34 @@ void CEditEffect::Describe_Entity()
}
}
if (m_isNoise == true)
if (m_EffectInfo.isNoise == true)
{
if (GUI::TreeNode("NOISE"))
{
ImGui::PushItemWidth(80);
GUI::DragFloat("NoiseDistortionIntensity", &m_fNoiseDistortionIntensity, 0.005f, 0.f, 1.f);
GUI::DragFloat("NoiseDistortionIntensity", &m_EffectInfo.fNoiseDistortionIntensity, 0.005f, 0.f, 1.f);
GUI::Spacing();
GUI::DragFloat2("DiffuseNoiseUVGainAmount", (_float*)&m_vDiffuseNoiseUVGainAmount, 0.01f);
GUI::DragFloat2("DiffuseNoiseUVGainAmount", (_float*)&m_EffectInfo.vDiffuseNoiseUVGainAmount, 0.01f);
_int iDiffuseNoiseMoveLerpOption = (_int)m_iDiffuseNoiseMoveLerpOption;
_int iDiffuseNoiseMoveLerpOption = (_int)m_EffectInfo.iDiffuseNoiseMoveLerpOption;
if (ImGui::Combo("Lerp DiffuseNoiseMove Option", &iDiffuseNoiseMoveLerpOption, pLerp, 9))
{
m_iDiffuseNoiseMoveLerpOption = iDiffuseNoiseMoveLerpOption;
m_EffectInfo.iDiffuseNoiseMoveLerpOption = iDiffuseNoiseMoveLerpOption;
}
GUI::Spacing();
GUI::DragFloat2("MaskNoiseUVGainAmount", (_float*)&m_vMaskNoiseUVGainAmount, 0.01f);
GUI::DragFloat2("MaskNoiseUVGainAmount", (_float*)&m_EffectInfo.vMaskNoiseUVGainAmount, 0.01f);
_int iMaskNoiseMoveLerpOption = (_int)m_iMaskNoiseMoveLerpOption;
_int iMaskNoiseMoveLerpOption = (_int)m_EffectInfo.iMaskNoiseMoveLerpOption;
if (ImGui::Combo("Lerp MaskNoiseMove Option", &iMaskNoiseMoveLerpOption, pLerp, 9))
{
m_iMaskNoiseMoveLerpOption = iMaskNoiseMoveLerpOption;
m_EffectInfo.iMaskNoiseMoveLerpOption = iMaskNoiseMoveLerpOption;
}
GUI::Spacing();
@@ -361,7 +596,11 @@ void CEditEffect::Describe_Entity()
if (GUI::TreeNode("NOISE_TEX"))
{
m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "NOISE_TEXTURE", (CComponent**)&m_pNoise_TextureCom, nullptr, this);
_string strName = m_pGameInstance->Asset_Description<CTexture>(ENUM_CLASS(LEVEL::EFFECT), "NOISE_TEXTURE", (CComponent**)&m_pNoise_TextureCom, nullptr, this);
if (strName != "") {
m_strNoiseName = strName;
}
GUI::TreePop();
}
+237 -24
View File
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "EffectObject.h"
#include "GameInstance.h"
@@ -62,11 +62,11 @@ HRESULT CEffectObject::Render_Blur()
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fBlurIntensity", &m_fBlurIntensity, sizeof(_float)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_fBlurIntensity", &m_EffectInfo.fBlurIntensity, sizeof(_float)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_iBlurWeight", &m_iBlurWeight, sizeof(_int)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_iBlurWeight", &m_EffectInfo.iBlurWeight, sizeof(_int)))) {
return E_FAIL;
}
@@ -95,6 +95,200 @@ HRESULT CEffectObject::Render_Blur()
return S_OK;
}
HRESULT CEffectObject::Load(const _char* pFilePath , LEVEL eLevel)
{
_string strPerfectFilePath = pFilePath;
strPerfectFilePath += ".bin";
HANDLE hFile = CreateFileW(
CMyTools::ToWstring(strPerfectFilePath).c_str(), // 파일 이름
GENERIC_READ, // 읽기 모드
FILE_SHARE_READ, // 다른 프로세스도 읽기 가능
NULL,
OPEN_EXISTING, // 기존 파일 열기
FILE_ATTRIBUTE_NORMAL,
NULL
);
if (hFile == INVALID_HANDLE_VALUE) {
MessageBox(NULL, L"오브젝트 읽기 실패", L"System Message", MB_OK);
return E_FAIL;
}
DWORD dwByte(0);
if (!ReadFile(hFile, &m_EffectInfo, sizeof(EFFECT_INFO), &dwByte, nullptr)) {
return E_FAIL;
}
m_EffectInfo.LightDesc.pPosition = m_pTransformCom->Get_StatePtr(STATE::POSITION);
m_EffectInfo.LightDesc.iLevel = ENUM_CLASS(eLevel);
if (m_EffectInfo.LightDesc.eType != LIGHT::DIRECTIONAL) // 0이 아닐때만 생성
{
if (FAILED(Add_Component<CLight>(g_iStaticLevel, &m_pLightCom, &m_EffectInfo.LightDesc)))
{
return E_FAIL;
}
}
if (m_EffectInfo.isDiffuse)
{
size_t iComponentLength = {};
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
return E_FAIL;
}
if (iComponentLength != 0)
{
_char szName[MAX_PATH] = {};
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
return E_FAIL;
}
m_strDiffuseName = szName;
}
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDiffuseName),
reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom))))
return E_FAIL;
}
if (m_EffectInfo.isNoise)
{
size_t iComponentLength = {};
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
return E_FAIL;
}
if (iComponentLength != 0)
{
_char szName[MAX_PATH] = {};
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
return E_FAIL;
}
m_strNoiseName = szName;
}
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strNoiseName),
reinterpret_cast<CComponent**>(&m_pNoise_TextureCom))))
return E_FAIL;
}
if (m_EffectInfo.isMasking)
{
size_t iComponentLength = {};
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
return E_FAIL;
}
if (iComponentLength != 0)
{
_char szName[MAX_PATH] = {};
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
return E_FAIL;
}
m_strMaskingName = szName;
}
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strMaskingName),
reinterpret_cast<CComponent**>(&m_pMasking_TextureCom))))
return E_FAIL;
}
if (m_EffectInfo.isDissolve)
{
size_t iComponentLength = {};
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
return E_FAIL;
}
if (iComponentLength != 0)
{
_char szName[MAX_PATH] = {};
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
return E_FAIL;
}
m_strDissolveName = szName;
}
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strDissolveName),
reinterpret_cast<CComponent**>(&m_pDissolve_TextureCom))))
return E_FAIL;
}
if (m_EffectInfo.isEmissive)
{
size_t iComponentLength = {};
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
return E_FAIL;
}
if (iComponentLength != 0)
{
_char szName[MAX_PATH] = {};
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)iComponentLength + 1), &dwByte, nullptr)) {
return E_FAIL;
}
m_strEmissiveName = szName;
}
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strEmissiveName),
reinterpret_cast<CComponent**>(&m_pEmissive_TextureCom))))
return E_FAIL;
}
size_t iComponentLength = {};
if (!ReadFile(hFile, &iComponentLength, sizeof(size_t), &dwByte, nullptr)) {
return E_FAIL;
}
if (iComponentLength != 0)
{
_char szName[MAX_PATH] = {};
if (!ReadFile(hFile, &szName, sizeof(_char) * ((DWORD)(DWORD)iComponentLength + 1), &dwByte, nullptr)) {
return E_FAIL;
}
m_strModelName = szName;
}
if (FAILED(__super::Add_Asset_Component(ENUM_CLASS(eLevel), CMyTools::ToWstring(m_strModelName),
reinterpret_cast<CComponent**>(&m_pInstance_ModelCom))))
return E_FAIL;;
m_pInstance_ModelCom->Load_InstanceModel(hFile);
CloseHandle(hFile);
return S_OK;
}
HRESULT CEffectObject::Bind_ShaderResources()
{
@@ -110,91 +304,95 @@ HRESULT CEffectObject::Bind_ShaderResources()
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_isDiffuse, sizeof(_bool)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuse", &m_EffectInfo.isDiffuse, sizeof(_bool)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMasking", &m_isMasking, sizeof(_bool)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMasking", &m_EffectInfo.isMasking, sizeof(_bool)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDissolve", &m_isDissolve, sizeof(_bool)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDissolve", &m_EffectInfo.isDissolve, sizeof(_bool)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_isNoise, sizeof(_bool)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_isNoise", &m_EffectInfo.isNoise, sizeof(_bool)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuseUVMove", &m_isDiffuseUVMove, sizeof(_bool)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_isEmissive", &m_EffectInfo.isEmissive, sizeof(_bool)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMaskUVMove", &m_isMaskUVMove, sizeof(_bool)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_isDiffuseUVMove", &m_EffectInfo.isDiffuseUVMove, sizeof(_bool)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_vColor, sizeof(_float4)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_isMaskUVMove", &m_EffectInfo.isMaskUVMove, sizeof(_bool)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_vEmissive", &m_vEmissive, sizeof(_float4)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_vColor", &m_EffectInfo.vColor, sizeof(_float4)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fColorOption", &m_fColorOption, sizeof(_float)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_vEmissive", &m_EffectInfo.vEmissive, sizeof(_float4)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fEmissiveCutAlpha", &m_fEmissiveCutAlpha, sizeof(_float)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_fColorOption", &m_EffectInfo.fColorOption, sizeof(_float)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fNoiseDistortionIntensity", &m_fNoiseDistortionIntensity, sizeof(_float)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_fEmissiveCutAlpha", &m_EffectInfo.fEmissiveCutAlpha, sizeof(_float)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseUVGainAmount", &m_vDiffuseUVGainAmount, sizeof(_float2)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_fNoiseDistortionIntensity", &m_EffectInfo.fNoiseDistortionIntensity, sizeof(_float)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskingUVGainAmount", &m_vMaskingUVGainAmount, sizeof(_float2)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseUVGainAmount", &m_EffectInfo.vDiffuseUVGainAmount, sizeof(_float2)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskingUVGainAmount", &m_EffectInfo.vMaskingUVGainAmount, sizeof(_float2)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseNoiseUVGainAmount", &m_vDiffuseNoiseUVGainAmount, sizeof(_float2)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_vDiffuseNoiseUVGainAmount", &m_EffectInfo.vDiffuseNoiseUVGainAmount, sizeof(_float2)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskNoiseUVGainAmount", &m_vMaskNoiseUVGainAmount, sizeof(_float2)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_vMaskNoiseUVGainAmount", &m_EffectInfo.vMaskNoiseUVGainAmount, sizeof(_float2)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVCutting", &m_vUVCutting, sizeof(_float2)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVCutting", &m_EffectInfo.vUVCutting, sizeof(_float2)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVMaskCutting", &m_vUVMaskCutting, sizeof(_float2)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_vUVMaskCutting", &m_EffectInfo.vUVMaskCutting, sizeof(_float2)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskMoveLerpOption", &m_iMaskMoveLerpOption, sizeof(_int)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskMoveLerpOption", &m_EffectInfo.iMaskMoveLerpOption, sizeof(_int)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseMoveLerpOption", &m_iDiffuseMoveLerpOption, sizeof(_int)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseMoveLerpOption", &m_EffectInfo.iDiffuseMoveLerpOption, sizeof(_int)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskNoiseMoveLerpOption", &m_iMaskNoiseMoveLerpOption, sizeof(_int)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_iMaskNoiseMoveLerpOption", &m_EffectInfo.iMaskNoiseMoveLerpOption, sizeof(_int)))) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseNoiseMoveLerpOption", &m_iDiffuseNoiseMoveLerpOption, sizeof(_int)))) {
if (FAILED(m_pShaderCom->Bind_RawValue("g_iDiffuseNoiseMoveLerpOption", &m_EffectInfo.iDiffuseNoiseMoveLerpOption, sizeof(_int)))) {
return E_FAIL;
}
@@ -229,7 +427,16 @@ HRESULT CEffectObject::Bind_ShaderResources()
}
}
if (m_pEmissive_TextureCom != nullptr)
{
if (FAILED(m_pEmissive_TextureCom->Bind_ShaderResource(m_pShaderCom, "g_EmissiveTexture", 0))) {
return E_FAIL;
}
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
return E_FAIL;
}
@@ -245,7 +452,9 @@ HRESULT CEffectObject::Ready_Components(void* pArg)
if (FAILED(__super::Ready_Components(pArg))) {
return E_FAIL;
}
//나중에 로드할 때 라이트를 값을 입력받아서 생성 하자
return S_OK;
}
@@ -275,9 +484,13 @@ void CEffectObject::Free()
SAFE_RELEASE(m_pNoise_TextureCom);
SAFE_RELEASE(m_pMasking_TextureCom);
SAFE_RELEASE(m_pDissolve_TextureCom);
SAFE_RELEASE(m_pEmissive_TextureCom);
SAFE_RELEASE(m_pShaderCom);
SAFE_RELEASE(m_pInstance_ModelCom);
if(m_pLightCom != nullptr)
SAFE_RELEASE(m_pLightCom);
}
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Effect_Editor.h"
#include "GameInstance.h"
@@ -113,14 +113,14 @@ void CEffect_Editor::ReadMaterials(const char* pDirectoryName)
_string ext = file.path().extension().string();
if (strcmp(ext.c_str(), ".txt")) // 텍스트 파일 일때만 빌드함
if (strcmp(ext.c_str(), ".txt")) // 텍스트 파일 일때만 빌드함
continue;
_char szFilePath[MAX_PATH] = {};
strcpy_s(szFilePath, MAX_PATH, file.path().string().c_str());
_wstring wstrFileName = file.path().stem().wstring(); // 파일명
_wstring wstrFileName = file.path().stem().wstring(); // 파일명
ReadMaterial(wstrFileName, szFilePath);
@@ -138,35 +138,35 @@ void CEffect_Editor::ReadMaterial(_wstring wstrFileName, const char* pFilePath)
_wstring wstrFirstLine = {};
getline(wifs, wstrFirstLine); // 가장 위의 텍스트
getline(wifs, wstrFirstLine); // 가장 위의 텍스트
//.기준으로 뒤에 이름을 지워야함
//.기준으로 뒤에 이름을 지워야함
size_t iPos = wstrFirstLine.find(L" ");
_wstring wstrParent = {};
wstrParent = wstrFirstLine.substr(0, iPos); // " " 이전만 남김
wstrParent = wstrFirstLine.substr(0, iPos); // " " 이전만 남김
if (wstrParent == L"Parent") // 부모 머테리얼이 있는 객체였다면
if (wstrParent == L"Parent") // 부모 머테리얼이 있는 객체였다면
{
_wstring wstrMatPath = wstrFirstLine;
_wstring wstrKeyword = L"VFX";
size_t iPos = wstrMatPath.find(wstrKeyword); // VFX를 찾고 없을 시에 로드하지 않는다
size_t iPos = wstrMatPath.find(wstrKeyword); // VFX를 찾고 없을 시에 로드하지 않는다
if (iPos != _wstring::npos) {
_wstring wstrResult = wstrMatPath.substr(iPos + wstrKeyword.length()); // "VTX이후만 남김"
_wstring wstrResult = wstrMatPath.substr(iPos + wstrKeyword.length()); // "VTX이후만 남김"
_wstring wstrMatName = {};
//.기준으로 뒤에 이름을 지워야함
//.기준으로 뒤에 이름을 지워야함
size_t iPos = wstrResult.find(L".");
wstrResult = wstrResult.substr(0, iPos); // ".이전만 남김"
wstrResult = wstrResult.substr(0, iPos); // ".이전만 남김"
//파일이름 받아오기
//파일이름 받아오기
size_t iNamePos = wstrResult.rfind(L"/");
wstrMatName = wstrResult.substr(iNamePos + 1);
@@ -175,18 +175,18 @@ void CEffect_Editor::ReadMaterial(_wstring wstrFileName, const char* pFilePath)
ReadMaterial(wstrMatName, CMyTools::ToString(wstrResult).c_str());
// 상위 머테리얼 파일에서 넣었던 파일을 다시 내 파일로 담는다
// 상위 머테리얼 파일에서 넣었던 파일을 다시 내 파일로 담는다
auto Superior_iter = m_MatFiles.find(wstrMatName);
auto Recent_iter = m_MatFiles.find(wstrFileName);
if (m_MatFiles.end() != Superior_iter) // 경로가 존재한다면
if (m_MatFiles.end() != Superior_iter) // 경로가 존재한다면
{
for (auto& wstrPath : Superior_iter->second) // 상위 머테리얼 벡터를 순회하여 내 벡터에 넣자
for (auto& wstrPath : Superior_iter->second) // 상위 머테리얼 벡터를 순회하여 내 벡터에 넣자
{
_bool isExist = { false };
for (auto TextureInfo : Recent_iter->second) //이미 존재한 경로였다면 추가하지 않는다
for (auto TextureInfo : Recent_iter->second) //이미 존재한 경로였다면 추가하지 않는다
{
if (TextureInfo.first == wstrPath.first)
@@ -205,13 +205,13 @@ void CEffect_Editor::ReadMaterial(_wstring wstrFileName, const char* pFilePath)
m_MatFiles.erase(Superior_iter);
}
//벡터에 모두 넣었다면 상위 머테리얼을 지운다
//벡터에 모두 넣었다면 상위 머테리얼을 지운다
}
}
// 텍스쳐를 불러오자
// 텍스쳐를 불러오자
_wstring wstrTextureLine = {};
while (getline(wifs, wstrTextureLine))
@@ -219,34 +219,34 @@ void CEffect_Editor::ReadMaterial(_wstring wstrFileName, const char* pFilePath)
_wstring wstrKeyword = L"/VFX";
size_t iPos = wstrTextureLine.find(wstrKeyword); // VFX를 찾고 없을 시에 로드하지 않는다
size_t iPos = wstrTextureLine.find(wstrKeyword); // VFX를 찾고 없을 시에 로드하지 않는다
if (iPos != _wstring::npos) {
_wstring wstrResult = wstrTextureLine.substr(iPos); // "VTX이후만 남김"
_wstring wstrResult = wstrTextureLine.substr(iPos); // "VTX이후만 남김"
_wstring wstrTextureName = {};
//.기준으로 뒤에 이름을 지워야함
//.기준으로 뒤에 이름을 지워야함
size_t iPos = wstrResult.find(L".");
wstrResult = wstrResult.substr(0, iPos); // ".이전만 남김"
wstrResult = wstrResult.substr(0, iPos); // ".이전만 남김"
// 이름 만들기
// 이름 만들기
size_t iNamePos = wstrResult.rfind(L"/");
wstrTextureName = wstrResult.substr(iNamePos + 1);
wstrResult = L"../Bin/Resources" + wstrResult + L".png";
//경로를 담는다
//경로를 담는다
auto iter = m_MatFiles.find(wstrFileName);
if (m_MatFiles.end() != iter) // 경로가 존재한다면
if (m_MatFiles.end() != iter) // 경로가 존재한다면
{
_bool isExist = { false };
for (auto TextureInfo : iter->second)
{
if (TextureInfo.first == wstrTextureName) // 이미 존재했었다면
if (TextureInfo.first == wstrTextureName) // 이미 존재했었다면
{
isExist = true;
break;
@@ -263,9 +263,10 @@ void CEffect_Editor::ReadMaterial(_wstring wstrFileName, const char* pFilePath)
wifs.close();
}
void CEffect_Editor::Reference_Mat_For_EditEffect(CComponent** pTexture, CGameObject* pObject)
_string CEffect_Editor::Reference_Mat_For_EditEffect(CComponent** pTexture, CGameObject* pObject)
{
_string strName = {};
for (auto iter : m_MatFiles)
{
if (GUI::TreeNode(CMyTools::ToString(iter.first).c_str()))
@@ -273,14 +274,17 @@ void CEffect_Editor::Reference_Mat_For_EditEffect(CComponent** pTexture, CGameOb
for (auto wstrTextureInfo : iter.second)
{
m_pGameInstance->Asset_Description<CTexture>(
strName = m_pGameInstance->Asset_Description<CTexture>(
ENUM_CLASS(LEVEL::EFFECT),
CMyTools::ToString(iter.first).c_str()
, pTexture
, nullptr
, pObject
, wstrTextureInfo.first // 이름
, wstrTextureInfo.first // 이름
);
if(strName != "")
return strName;
};
@@ -291,7 +295,24 @@ void CEffect_Editor::Reference_Mat_For_EditEffect(CComponent** pTexture, CGameOb
}
return "";
}
HRESULT CEffect_Editor::Load_Edit(const _char* pPath)
{
if (m_pEditEffect == nullptr)
return E_FAIL;
if (FAILED(m_pEditEffect->Load(pPath, LEVEL::EFFECT)))
{
Safe_Release(m_pEditEffect);
return E_FAIL;
}
Safe_Release(m_pEditEffect);
return S_OK;
}
@@ -337,6 +358,22 @@ void CEffect_Editor::Describe_Entity()
if (m_pEditEffect != nullptr)
m_pEditEffect->Describe_Entity();
GUI::InputTextMultiline("FILE PATH", m_szBuffer, sizeof(m_szBuffer), ImVec2(250, 25));
m_strSavePath = m_szBuffer;
if (GUI::Button("SAVE"))
{
m_pEditEffect->Save_Effect(m_strSavePath.c_str());
}
GUI::SameLine();
if (GUI::Button("LOAD"))
{
Load_Edit(m_strSavePath.c_str());
}
ImGui::End();
ImGui::Begin("Reference Material");
@@ -395,7 +432,7 @@ void CEffect_Editor::Describe_Entity()
if (ImGui::MenuItem("Delete Effect"))
{
auto iter = m_PartObjects.begin();
advance(iter, iIndex); // 이터레이터를 증가시킨다
advance(iter, iIndex); // 이터레이터를 증가시킨다
SAFE_RELEASE(pPartObject.second);
m_PartObjects.erase(iter);
@@ -411,7 +448,7 @@ void CEffect_Editor::Describe_Entity()
#pragma endregion
if (GUI::IsItemClicked()) // 선택창에 띄우기
if (GUI::IsItemClicked()) // 선택창에 띄우기
{
CEditEffect* pSelectedEffectObject = dynamic_cast<CEditEffect*>(pPartObject.second);
@@ -432,11 +469,11 @@ void CEffect_Editor::Describe_Entity()
Safe_Release(m_pEditEffect);
SAFE_RELEASE(m_pEditEffect);
m_pEditEffect = pSelectedEffectObject;
Safe_AddRef(pSelectedEffectObject);
SAFE_ADDREF(pSelectedEffectObject);
m_strCurrentEffectName = strName;
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "GamePlay_Canvas.h"
#include "GameInstance.h"
#include "Mission_Panel.h"
+3 -3
View File
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Hair.h"
#include "GameInstance.h"
@@ -136,7 +136,7 @@ CHair* CHair::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CHair");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
@@ -149,7 +149,7 @@ CGameObject* CHair::Clone(void* pArg, CGameObject* pOwner)
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CHair");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
+75 -4
View File
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Head.h"
#include "GameInstance.h"
@@ -50,7 +50,78 @@ void CHead::Late_Update(_float fTimeDelta)
HRESULT CHead::Render()
{
__super::Render();
if(!m_pModelCom)
return S_OK;
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_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
return E_FAIL;
}
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 (i == m_HeadIndex)
{
if (FAILED(m_pShaderCom->Begin(5))) {
return E_FAIL;
}
if (FAILED(m_pModelCom->Render(i))) {
return E_FAIL;
}
}
else
{
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) {
return E_FAIL;
}
if (FAILED(m_pModelCom->Render(i))) {
return E_FAIL;
}
}
}
return S_OK;
}
HRESULT CHead::Bind_ShaderResources()
{
if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", &m_CombinedWorldMatrix))) {
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;
}
GUI::DragFloat4("COLOR", (_float*)&m_vColor, 0.1f);
if (FAILED(m_pShaderCom->Bind_RawValue("g_TestColor", &m_vColor, sizeof(_float4)))) {
return E_FAIL;
}
return S_OK;
}
@@ -75,7 +146,7 @@ CHead* CHead::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CHead");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
@@ -88,7 +159,7 @@ CGameObject* CHead::Clone(void* pArg, CGameObject* pOwner)
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CHead");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
+36 -7
View File
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "IMGUIUI.h"
#include "UIObject.h"
#include "GamePlay_Canvas.h"
@@ -38,7 +38,7 @@ void CIMGUIUI::PanelwstringTostring(vector<std::wstring>& panelNames)
for (auto& wname : panelNames)
{
// wstring -> UTF-8 string 변환
// wstring -> UTF-8 string 변환
int size = WideCharToMultiByte(CP_UTF8, 0,
wname.c_str(), (int)wname.size(),
nullptr, 0, nullptr, nullptr);
@@ -49,11 +49,11 @@ void CIMGUIUI::PanelwstringTostring(vector<std::wstring>& panelNames)
wname.c_str(), (int)wname.size(),
&result[0], size, nullptr, nullptr);
// 변환된 string 저장
// 변환된 string 저장
m_iPanelNamestring.push_back(std::move(result));
}
// vector<const char*> 업데이트
// vector<const char*> 업데이트
for (auto& str : m_iPanelNamestring)
m_iPanelName.push_back(str.c_str());
@@ -70,7 +70,7 @@ void CIMGUIUI::ElementwstringTostring(vector<wstring>& panelNames)
for (auto& wname : panelNames)
{
// wstring -> UTF-8 string 변환
// wstring -> UTF-8 string 변환
int size = WideCharToMultiByte(CP_UTF8, 0,
wname.c_str(), (int)wname.size(),
nullptr, 0, nullptr, nullptr);
@@ -81,11 +81,11 @@ void CIMGUIUI::ElementwstringTostring(vector<wstring>& panelNames)
wname.c_str(), (int)wname.size(),
&result[0], size, nullptr, nullptr);
// 변환된 string 저장
// 변환된 string 저장
m_pElementNamestring.push_back(std::move(result));
}
// vector<const char*> 업데이트
// vector<const char*> 업데이트
for (auto& str : m_pElementNamestring)
m_pElementName.push_back(str.c_str());
@@ -134,6 +134,11 @@ void CIMGUIUI::Update(_float fTimeDelta)
m_bElementFadeOut = static_cast<CElementObject*>(m_pElementObject)->Get_FadeOut();
m_fAlphaTime = static_cast<CElementObject*>(m_pElementObject)->Get_AlphaTime();
m_UV = static_cast<CElementObject*>(m_pElementObject)->Get_UV();
m_fLeft = static_cast<CElementObject*>(m_pElementObject)->Get_Nine_Slice_Left();
m_fRight = static_cast<CElementObject*>(m_pElementObject)->Get_Nine_Slice_Right();
m_fTop = static_cast<CElementObject*>(m_pElementObject)->Get_Nine_Slice_Top();
m_fBottom = static_cast<CElementObject*>(m_pElementObject)->Get_Nine_Slice_Bottom();
}
GUI::Begin("Current_PanelObject_Info");
if (m_pGamePlay_Canvas != nullptr)
@@ -306,6 +311,7 @@ void CIMGUIUI::Update(_float fTimeDelta)
static_cast<CElementObject*>(m_pElementObject)->SizeUpdate_float(m_fSizeXY);
}
GUI::Text("Time");
if (GUI::DragFloat("EndTime", &m_fEndTime, 0.01f, 0.f, 10.f))
{
static_cast<CElementObject*>(m_pElementObject)->Set_TimeMult(m_fEndTime);
@@ -326,6 +332,7 @@ void CIMGUIUI::Update(_float fTimeDelta)
static_cast<CElementObject*>(m_pElementObject)->Set_AlphaTime(m_fAlphaTime);
}
GUI::Text("UV");
if (GUI::DragFloat("U", &m_UV.x, 0.01f, 0.f, 10.f))
{
static_cast<CElementObject*>(m_pElementObject)->Set_U(m_UV.x);
@@ -335,6 +342,28 @@ void CIMGUIUI::Update(_float fTimeDelta)
{
static_cast<CElementObject*>(m_pElementObject)->Set_V(m_UV.y);
}
GUI::Text("Nine_Slice");
if (GUI::DragFloat("Left", &m_fLeft, 0.1f, 0, m_fSize.x))
{
static_cast<CElementObject*>(m_pElementObject)->Nine_Slice_Left(m_fLeft);
}
if (GUI::DragFloat("Right", &m_fRight, 0.1f,0.5f, m_fSize.x))
{
static_cast<CElementObject*>(m_pElementObject)->Nine_Slice_Right(m_fRight);
}
if (GUI::DragFloat("Top", &m_fTop, 0.1f, 0, m_fSize.y))
{
static_cast<CElementObject*>(m_pElementObject)->Nine_Slice_Top(m_fTop);
}
if (GUI::DragFloat("Bottom", &m_fBottom, 0.1f,0, m_fSize.y))
{
static_cast<CElementObject*>(m_pElementObject)->Nine_Slice_Bottom(m_fBottom);
}
}
GUI::End();
}
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Information.h"
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Level_EffectViewer.h"
#include "GameInstance.h"
#include "Level_Loading.h"
@@ -6,6 +6,8 @@
#include "TestEffect.h"
#include "Effect_Editor.h"
#include "Dummy_Cube.h"
#include "MainLight.h"
#include "Dummy_Plane.h"
CLevel_EffectViewer::CLevel_EffectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
@@ -35,6 +37,9 @@ HRESULT CLevel_EffectViewer::Initialize()
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_Cube>(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, LAYER_CUBE)))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummy_Plane>(ENUM_CLASS(LEVEL::EFFECT), NEXT_LEVEL, LAYER_CUBE)))
return E_FAIL;
return S_OK;
}
@@ -46,7 +51,7 @@ void CLevel_EffectViewer::Update(_float fTimeDelta)
HRESULT CLevel_EffectViewer::Render()
{
SetWindowText(g_hWnd, TEXT("이펙트 레벨입니다"));
SetWindowText(g_hWnd, TEXT("이펙트 레벨입니다"));
GUI::ShowDemoWindow();
return S_OK;
}
@@ -62,6 +67,7 @@ HRESULT CLevel_EffectViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
CameraDesc.vEye = _float3(0.f, 10.f, -10.f);
CameraDesc.vAt = _float3(0.f, 0.f, 0.f);
CameraDesc.fSpeedPerSec = 5.f;
CameraDesc.pCameraKey = TEXT("Debug_Camera");
CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f);
CameraDesc.fMouseSensor = 0.1f;
@@ -74,17 +80,10 @@ HRESULT CLevel_EffectViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
HRESULT CLevel_EffectViewer::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.6f, 0.6f, 0.6f, 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))) {
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMainLight>(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT)))
return E_FAIL;
}
return S_OK;
}
@@ -8,6 +8,7 @@
#include "MapObject_Manager.h"
#include "BuildingContainer.h"
#include "DummySkyBox.h"
#include "MainLight.h"
CLevel_MapViewer::CLevel_MapViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
@@ -56,17 +57,10 @@ HRESULT CLevel_MapViewer::Initialize()
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))) {
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMainLight>(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT)))
return E_FAIL;
}
return S_OK;
}
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Level_ObjectViewer.h"
#include "GameInstance.h"
#include "Level_Loading.h"
@@ -11,7 +11,11 @@
#include "Layer.h"
#include "GameObject.h"
#include "DummyObject.h"
#include "DummySkyBox.h"
#include "MainLight.h"
#include "Terrain.h"
CLevel_ObjectViewer::CLevel_ObjectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
@@ -54,7 +58,7 @@ void CLevel_ObjectViewer::Update(_float fTimeDelta)
HRESULT CLevel_ObjectViewer::Render()
{
SetWindowText(g_hWnd, TEXT("오브젝트 레벨입니다"));
SetWindowText(g_hWnd, TEXT("오브젝트 레벨입니다"));
//GUI::ShowDemoWindow();
return S_OK;
}
@@ -262,6 +266,7 @@ void CLevel_ObjectViewer::Show_AnimList()
{
pModel->Set_AnimationIndex(i);
pModel->Set_CurrentTrackPosition(0.f);
pModel->Play_Animation(0.f);
}
}
}
@@ -298,9 +303,16 @@ void CLevel_ObjectViewer::Dummy_Object_Setting()
GUI::Begin("Object_Info");
if (!m_Objects.empty())
{
_float3 Pos;
XMStoreFloat3(&Pos, m_Objects[m_iObjectIndex]->Get_Component<CTransform>()->Get_State(STATE::POSITION));
GUI::DragFloat3("Pos", (_float*)&Pos);
Show_ObjectList();
CModel* pModel = m_Objects[m_iObjectIndex]->Get_Component<CModel>();
GUI::Button(pModel->Get_AnimList(pModel->Get_AnimIndex()));
_float AnimTrack = pModel->Get_CurrentTrackPosition();
GUI::DragFloat("AnimTrack", &AnimTrack);
@@ -330,6 +342,18 @@ void CLevel_ObjectViewer::Parts_Object_Setting()
CModel* pModel = m_HumanRoot->Get_MainModel();
if (pModel)
{
_float3 Pos;
XMStoreFloat3(&Pos, m_HumanRoot->Get_WorldPostion());
float Pos3[3] = { Pos.x, Pos.y, Pos.z };
GUI::DragFloat3("Pos", Pos3);
Pos.x = Pos3[0];
Pos.y = Pos3[1];
Pos.z = Pos3[2];
m_HumanRoot->Get_Component<CTransform>()->Set_State(STATE::POSITION, XMVectorSet(Pos.x, Pos.y, Pos.z, 1.f));
GUI::Button(pModel->Get_AnimList(pModel->Get_AnimIndex()));
_float KeyFrame = pModel->Get_CurrentTrackPosition();
@@ -464,6 +488,7 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
CameraDesc.vEye = _float3(0.f, 30.f, -10.f);
CameraDesc.vAt = _float3(0.f, 0.f, 0.f);
CameraDesc.fSpeedPerSec = 5.f;
CameraDesc.pCameraKey = TEXT("Debug_Camera");
CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f);
CameraDesc.fMouseSensor = 0.1f;
@@ -476,17 +501,9 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
HRESULT CLevel_ObjectViewer::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.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))) {
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMainLight>(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT)))
return E_FAIL;
}
return S_OK;
}
@@ -500,6 +517,9 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag)
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CDummySkyBox>(g_iStaticLevel, NEXT_LEVEL, LAYER_CUBE)))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTerrain>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
return E_FAIL;
return S_OK;
}
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Level_PhysXLab.h"
#include "GameInstance.h"
@@ -10,6 +10,7 @@
#include "Dummy_PhysXMesh.h"
#include "MapObject_Manager.h"
#include "BuildingContainer.h"
#include "MainLight.h"
CLevel_PhysXLab::CLevel_PhysXLab(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
@@ -24,7 +25,7 @@ void CLevel_PhysXLab::Update(_float fTimeDelta)
HRESULT CLevel_PhysXLab::Render()
{
SetWindowText(g_hWnd, TEXT("PhysXEditor·¹º§ÀÔ´Ï´Ù"));
SetWindowText(g_hWnd, TEXT("PhysXEditor레벨입니다"));
GUI::ShowDemoWindow();
return S_OK;
}
@@ -51,17 +52,9 @@ HRESULT CLevel_PhysXLab::Initialize()
HRESULT CLevel_PhysXLab::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))) {
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CMainLight>(ENUM_CLASS(LEVEL::STATIC), NEXT_LEVEL, LAYER_LIGHT)))
return E_FAIL;
}
return S_OK;
}
@@ -70,10 +63,11 @@ HRESULT CLevel_PhysXLab::Ready_Layer_Camera(const _wstring& strLayerTag)
CDebugCamera::CAMERA_DEBUG_DESC CameraDesc{};
CameraDesc.fFovy = XMConvertToRadians(60.0f);
CameraDesc.fNear = 0.1f;
CameraDesc.fFar = 5000.f;
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.pCameraKey = TEXT("Debug_Camera");
CameraDesc.fRotationPerSec = XMConvertToRadians(90.0f);
CameraDesc.fMouseSensor = 0.1f;
+106 -40
View File
@@ -1,10 +1,16 @@
#include "pch.h"
#include "Loader.h"
#include "DebugCamera.h"
#include "GameInstance.h"
#pragma region DEFAULT_HEADER
#include "DebugCamera.h"
#include "DummyRect.h"
#include "MainApp.h"
#include "Dummy_Cube.h"
#include "MainLight.h"
#pragma endregion
#pragma region OBJECT_HEADER
@@ -59,6 +65,7 @@
#include "TestEffect.h"
#include "EditEffect.h"
#include "Effect_Editor.h"
#include "Dummy_Plane.h"
#pragma endregion
@@ -222,6 +229,10 @@ HRESULT CLoader::Loading_For_Logo()
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Prototype<CMainLight>(g_iStaticLevel, CMainLight::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
m_strMessage = TEXT("Loading Success!");
m_isFinished = true;
@@ -236,41 +247,42 @@ HRESULT CLoader::Loading_For_UI()
m_strMessage = TEXT("Texture Loading..");
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Keyboard"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Keyboard/Keyboard_%d.png"), 10)))) {
return E_FAIL;
}
Asset_FileLoad("../Bin/Resources/Textures/Keyboard", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath)
{
_string strFilePath = pFilePath;
_wstring wstrFilePath = CMyTools::ToWstring(strFilePath);
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName,
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) {
return E_FAIL;
}
return S_OK;
});
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Cursor"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Cursor/UI_T_CursorRings.dds"), 0)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("LodingWidget1"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Loading/LoadingWidget.png"), 0)))) {
return E_FAIL;
}
Asset_FileLoad("../Bin/Resources/Textures/Mission", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath)
{
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("MissionBanner_Border"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Mission/MissionBanner_Border.png"), 0)))) {
return E_FAIL;
}
_string strFilePath = pFilePath;
_wstring wstrFilePath = CMyTools::ToWstring(strFilePath);
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("MissionBanner_Key"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Mission/MissionBanner_Key.png"), 0)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Finishi_Rect"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Mission/Finishi_Rect.png"), 0)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName,
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Mission_Main"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Mission/Mission_Main.png"), 0)))) {
return E_FAIL;
}
return S_OK;
});
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), TEXT("Mission_Icon"),
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("../Bin/Resources/Textures/Mission/Mission_Icon_%d.png"), 2)))) {
@@ -292,6 +304,22 @@ HRESULT CLoader::Loading_For_UI()
_wstring wstrFilePath = CMyTools::ToWstring(strFilePath);
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName,
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) {
return E_FAIL;
}
return S_OK;
});
Asset_FileLoad("../Bin/Resources/Textures/Loading", L"Prototype_Texture_", [&](_wstring wstrFileName, const _char* pFilePath)
{
_string strFilePath = pFilePath;
_wstring wstrFilePath = CMyTools::ToWstring(strFilePath);
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::UI), wstrFileName,
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, wstrFilePath.c_str(), 0)))) {
return E_FAIL;
@@ -448,6 +476,10 @@ HRESULT CLoader::Loading_For_Effect()
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.bin", XMMatrixIdentity()))))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Model_DummyPlane"),
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Effect/DummyPlane/DummyPlane.fbx", XMMatrixIdentity()))))
return E_FAIL;
m_strMessage = TEXT("Shader Loading..");
@@ -482,6 +514,10 @@ HRESULT CLoader::Loading_For_Effect()
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_Cube>(ENUM_CLASS(LEVEL::EFFECT), CDummy_Cube::Create(m_pDevice, m_pContext))))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_Prototype<CDummy_Plane>(ENUM_CLASS(LEVEL::EFFECT), CDummy_Plane::Create(m_pDevice, m_pContext))))
return E_FAIL;
m_strMessage = TEXT("Loading Success!");
m_isFinished = true;
@@ -563,25 +599,29 @@ HRESULT CLoader::Loading_For_PhysXLevel()
}
ModelPrototypeTags.push_back(strFileName);
ModelPrototypePath.push_back(file.path());
_uint iNumMesh = pModel->Get_NumMeshes();
{ /* cache rigidbody */ // More Info In 리지드바디, CCT, 엔진이넘
ModelPrototypePath.push_back(file.path());
CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{};
for (_uint i = 0; i < iNumMesh; ++i) {
_string strDestName = pModel->Get_MeshName(i) + to_string(i);
{
Desc.eType = ACTOR::TRIANGLEMESH;
Desc.ePxRigidBodyFlags = {};
Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT;
Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f);
Desc.fContactOffset = 0.f;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
return E_FAIL;
_uint iNumMesh = pModel->Get_NumMeshes();
CRigidBody::RIGIDBODY_PROTOTYPEDESC Desc{};
for (_uint i = 0; i < iNumMesh; ++i) {
_string strDestName = pModel->Get_MeshName(i) + to_string(i);
{ // basic static RIGIDBODY
Desc.eType = ACTOR::TRIANGLEMESH;
Desc.ePxRigidBodyFlags = {};
Desc.ePxShapeFlags = { PSX::PxShapeFlag::eVISUALIZATION | PSX::PxShapeFlag::eSCENE_QUERY_SHAPE | PSX::PxShapeFlag::eSIMULATION_SHAPE };
Desc.ePxMaterialTypes = PXMATERIAL::DEFAULT;
Desc.vMatInfo = _float3(0.5f, 0.5f, 0.6f);
Desc.fContactOffset = 0.f;
}
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(strDestName).c_str(), CRigidBody::Create(m_pDevice, m_pContext, Desc)))) {
return E_FAIL;
}
}
}
}
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_Manager>(g_iStaticLevel, CMapObject_Manager::Create(m_pDevice, m_pContext, ModelPrototypeTags, ModelPrototypePath)))){
return E_FAIL;
@@ -695,6 +735,14 @@ HRESULT CLoader::Loading_For_ObjectViewer()
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/FeMale/T_NPC_F_Head_Eye_Honey.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity()))))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_F_Head_Model"),
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/FeMale/F_Head.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity()))))
return E_FAIL;
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_Head_Model"),
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/Male/M_Head.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity()))))
return E_FAIL;
#pragma endregion
#pragma region HAIR
@@ -716,6 +764,10 @@ HRESULT CLoader::Loading_For_ObjectViewer()
return E_FAIL;
#pragma endregion
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_TestHuman_Model"),
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/TestHuman.bin", XMMatrixScaling(0.001f, 0.001f, 0.001f) * XMMatrixIdentity()))))
return E_FAIL;
#pragma region MONSTER
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_TombProtector_Model"),
@@ -752,10 +804,20 @@ HRESULT CLoader::Loading_For_ObjectViewer()
return E_FAIL;
}
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("Shader Loading..");
m_strMessage = TEXT("Prototype Loading..");
/* 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_RootModelPart */
if (FAILED(m_pGameInstance->Add_Prototype<CRootModelPart>(g_iStaticLevel, CRootModelPart::Create(m_pDevice, m_pContext))))
return E_FAIL;
@@ -780,6 +842,10 @@ HRESULT CLoader::Loading_For_ObjectViewer()
if (FAILED(m_pGameInstance->Add_Prototype<CDummySkyBox>(g_iStaticLevel, CDummySkyBox::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;
m_strMessage = TEXT("Loading Success!");
m_isFinished = true;
@@ -0,0 +1,124 @@
#include "pch.h"
#include "MainLight.h"
#include "GameInstance.h"
#include "DebugCamera.h"
CMainLight::CMainLight(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CGameObject(pDevice, pContext)
{
}
CMainLight::CMainLight(const CMainLight& Prototype)
: CGameObject(Prototype)
{
}
HRESULT CMainLight::Initialize_Prototype()
{
return S_OK;
}
HRESULT CMainLight::Initialize(void* pArg)
{
if (FAILED(__super::Initialize(pArg)))
return E_FAIL;
if (FAILED(Ready_Components()))
return E_FAIL;
m_pTransformCom->Set_State(STATE::LOOK, XMVectorSet(1.f, -1.f, 1.f, 0.f));
return S_OK;
}
void CMainLight::Priority_Update(_float fTimeDelta)
{
}
void CMainLight::Update(_float fTimeDelta)
{
}
void CMainLight::Late_Update(_float fTimeDelta)
{
}
HRESULT CMainLight::Render()
{
return S_OK;
}
HRESULT CMainLight::Ready_Components()
{
__super::Ready_Components(nullptr);
LIGHT_DESC LightDesc{};
LightDesc.eType = LIGHT::DIRECTIONAL;
LightDesc.vDiffuse = _float4(0.8f, 0.8f, 0.8f, 0.f);
LightDesc.vAmbient = _float4(0.6f, 0.6f, 0.6f, 0.f);
LightDesc.vSpecular = _float4(0.f, 0.f, 0.f, 0.f);
LightDesc.pDirection = m_pTransformCom->Get_StatePtr(STATE::LOOK);
LightDesc.iLevel = NEXT_LEVEL;
/* Com_Light*/
if (FAILED(Add_Component<CLight>(g_iStaticLevel, &m_pLightCom, &LightDesc)))
{
return E_FAIL;
}
return S_OK;
}
HRESULT CMainLight::Bind_ShaderResources()
{
return S_OK;
}
CMainLight* CMainLight::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
{
CMainLight* pInstance = new CMainLight(pDevice, pContext);
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CMainLight");
Safe_Release(pInstance);
}
return pInstance;
}
CGameObject* CMainLight::Clone(void* pArg, CGameObject* pOwner)
{
CMainLight* pInstance = new CMainLight(*this);
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CMainLight");
Safe_Release(pInstance);
}
return pInstance;
}
void CMainLight::Free()
{
__super::Free();
Safe_Release(m_pLightCom);
}
void CMainLight::Describe_Entity()
{
}
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "MapObject_LOD.h"
#include "GameInstance.h"
@@ -222,10 +222,10 @@ void CMapObject_LOD::Free()
{
__super::Free();
Safe_Release(m_pShaderCom);
SAFE_RELEASE(m_pShaderCom);
for(auto& pModel : m_pModelComs)
Safe_Release(pModel);
SAFE_RELEASE(pModel);
m_pModelComs.clear();
}
@@ -374,7 +374,7 @@ HRESULT CMapObject_Manager::Save_MapData(const _char* pFileName)
#pragma endregion
// ÀúÀå
// ?ú?å
if (doc.SaveFile(strPath.c_str()) != tinyxml2::XML_SUCCESS) {
MSG_BOX("Failed to Save File");
}
@@ -498,7 +498,7 @@ HRESULT CMapObject_Manager::Save_ContainerData(const _char* pFileName, const _ch
m_pSelectObject = nullptr;
#pragma endregion
// ÀúÀå
// ?ú?å
if (doc.SaveFile(strPath.c_str()) != tinyxml2::XML_SUCCESS) {
MSG_BOX("Failed to Save File");
}
@@ -1084,7 +1084,7 @@ CMapObject_Manager* CMapObject_Manager::Create(ID3D11Device* pDevice, ID3D11Devi
if (FAILED(pInstance->Initialize_Prototype(ModelPrototypeTags, ModelPrototypePaths)))
{
MSG_BOX("Failed to Created : CMapObject_Manager");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
@@ -1097,7 +1097,7 @@ CGameObject* CMapObject_Manager::Clone(void* pArg, CGameObject* pOwner)
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CMapObject_Manager");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "MapObject_Static.h"
#include "GameInstance.h"
@@ -192,8 +192,8 @@ void CMapObject_Static::Free()
{
__super::Free();
Safe_Release(m_pShaderCom);
Safe_Release(m_pModelCom);
SAFE_RELEASE(m_pShaderCom);
SAFE_RELEASE(m_pModelCom);
}
void CMapObject_Static::Describe_Entity()
@@ -23,8 +23,8 @@ HRESULT CMissionBanner_Border::Initialize(void* pArg)
Desc.fX = -248.f;
Desc.fY = 100.f;
Desc.fSizeX = 480.f;
Desc.fSizeY = 240.f;
Desc.fSizeX = 256.f;
Desc.fSizeY = 128.f;
m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) };
@@ -110,7 +110,7 @@ HRESULT CMissionBanner_Border::Render()
if (FAILED(Bind_ShaderResources())) {
return E_FAIL;
}
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::UVMULT)))) {
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_UIEDITOR::ALPHABLEND)))) {
return E_FAIL;
}
if (FAILED(m_pVIBufferCom->Bind_Resources())) {
@@ -170,6 +170,18 @@ HRESULT CMissionBanner_Border::Bind_ShaderResources()
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fNine_Slice", &m_vNine_Slice, sizeof(_float4))))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fOrigin_Size", &m_fOrigin_Size, sizeof(_float2))))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fCurrent_Size", &m_fCurrent_Posigion, sizeof(_float2))))
{
return E_FAIL;
}
return S_OK;
}
@@ -40,6 +40,7 @@ HRESULT CMission_KeyHold::Initialize(void* pArg)
m_fTimeMult = 1.f;
m_fAlpha = 1.f;
m_fAlphaTime = 3.f;
m_fPI = AI_MATH_TWO_PI_F;
return S_OK;
}
@@ -159,7 +160,11 @@ HRESULT CMission_KeyHold::Bind_ShaderResources()
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fAlpha", &m_fAlpha, sizeof(_float))))
if (FAILED(m_pShaderCom->Bind_RawValue("g_fTimeMult", &m_fTimeMult, sizeof(_float))))
{
return E_FAIL;
}
if (FAILED(m_pShaderCom->Bind_RawValue("g_fPI", &m_fPI, sizeof(_float))))
{
return E_FAIL;
}
+10 -4
View File
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Body.h"
#include "GameInstance.h"
@@ -96,7 +96,13 @@ void CModelParts::Change_Model(const _wchar* Prototype)
Remove_Component<CModel>();
SAFE_RELEASE(m_pModelCom);
}
;
if (strstr(CMyTools::ToString(Prototype).c_str(), "_F_"))
{
m_HeadIndex = 2;
}
else
m_HeadIndex = 1;
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, Prototype,
reinterpret_cast<CComponent**>(&m_pModelCom))))
return;
@@ -138,8 +144,8 @@ void CModelParts::Free()
{
__super::Free();
Safe_Release(m_pShaderCom);
Safe_Release(m_pModelCom);
SAFE_RELEASE(m_pShaderCom);
SAFE_RELEASE(m_pModelCom);
}
void CModelParts::Describe_Entity()
+5 -5
View File
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Monster.h"
#include "GameInstance.h"
@@ -129,7 +129,7 @@ CMonster* CMonster::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CMonster");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
@@ -142,7 +142,7 @@ CGameObject* CMonster::Clone(void* pArg, CGameObject* pOwner)
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CMonster");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
@@ -154,8 +154,8 @@ void CMonster::Free()
{
__super::Free();
Safe_Release(m_pShaderCom);
Safe_Release(m_pModelCom);
SAFE_RELEASE(m_pShaderCom);
SAFE_RELEASE(m_pModelCom);
}
void CMonster::Describe_Entity()
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "RootModelPart.h"
#include "GameInstance.h"
@@ -71,7 +71,7 @@ void CRootModelPart::Update_Anim(_float fTimeDelta)
{
pModel->Set_PlayAnim(m_pMainModel->Get_PlayAnim());
pModel->Set_AnimSpeed(m_pMainModel->Get_AnimSpeed());
pModel->Play_Animation(fTimeDelta);
pModel->Play_Animation(fTimeDelta,m_pTransformCom);
}
}
}
@@ -171,7 +171,7 @@ CRootModelPart* CRootModelPart::Create(ID3D11Device* pDevice, ID3D11DeviceContex
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CRootModelPart");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
@@ -184,7 +184,7 @@ CGameObject* CRootModelPart::Clone(void* pArg, CGameObject* pOwner)
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CRootModelPart");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
+6 -6
View File
@@ -1,4 +1,4 @@
#include "pch.h"
#include "pch.h"
#include "Terrain.h"
#include "GameInstance.h"
@@ -126,7 +126,7 @@ CTerrain* CTerrain::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CTerrain");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
@@ -139,7 +139,7 @@ CGameObject* CTerrain::Clone(void* pArg, CGameObject* pOwner)
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CTerrain");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
@@ -149,9 +149,9 @@ void CTerrain::Free()
{
__super::Free();
Safe_Release(m_pShaderCom);
Safe_Release(m_pVIBufferCom);
Safe_Release(m_pTextureCom);
SAFE_RELEASE(m_pShaderCom);
SAFE_RELEASE(m_pVIBufferCom);
SAFE_RELEASE(m_pTextureCom);
}
void CTerrain::Describe_Entity()
+1 -1
View File
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "ElementObject.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "Camera.h"
+4 -4
View File
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "GameObject.h"
@@ -34,8 +34,8 @@ class CDummyObject final : public CGameObject
_wstring& Get_PrototypeTag() { return m_strModelPrototypeTag; }
private:
CShader* m_pShaderCom = { nullptr };
CModel* m_pModelCom = { nullptr };
CShader* m_pShaderCom = { nullptr };
CModel* m_pModelCom = { nullptr };
_wstring m_strModelPrototypeTag;
_bool m_bRimLight = { true };
_float m_fRimLightPower = { 3.2f };
@@ -53,4 +53,4 @@ class CDummyObject final : public CGameObject
virtual void Describe_Entity() override;
};
NS_END
NS_END
+1 -1
View File
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "GameObject.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "GameObject.h"
+1 -1
View File
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "GameObject.h"
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "GameObject.h"
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "GameObject.h"
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "GameObject.h"
@@ -0,0 +1,44 @@
#pragma once
#include "Editor_Define.h"
#include "GameObject.h"
NS_BEGIN(Engine)
class CModel;
class CShader;
NS_END
NS_BEGIN(Editor)
class CDummy_Plane final : public CGameObject
{
private:
CDummy_Plane(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CDummy_Plane(const CDummy_Plane& rhs);
virtual ~CDummy_Plane() = 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:
CModel* m_pModelCom = { 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;
public:
static CDummy_Plane* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
virtual void Free() override;
void Describe_Entity() override;
};
NS_END
+4 -4
View File
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "EffectObject.h"
@@ -23,8 +23,8 @@ class CEditEffect final : public CEffectObject
virtual void Late_Update(_float fTimeDelta) override;
public:
void Reference_Mat_For_EditEffect();
void Reference_Mat_For_EditEffect();
HRESULT Save_Effect(const _char* pPath);
private:
virtual HRESULT Initialize_Prototype() override;
virtual HRESULT Initialize(void* pArg) override;
@@ -39,4 +39,4 @@ class CEditEffect final : public CEffectObject
void Describe_Entity() override;
};
NS_END
NS_END
@@ -24,7 +24,7 @@ namespace Editor
enum class SHADER_PASS_PARTICLE { EXPLOSION, END };
enum class SHADER_PASS_POSTEX { DEFAULT, SCISSOR, UI, UVMOVE, TRAIL, END };
enum class SHADER_PASS_INSTANCE_MODEL { DEFAULT, NON_NOMALMAP, BLUR ,END };
enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, QUESTYPE, UVMULT, END };
enum class SHADER_PASS_UIEDITOR { DEFAULT, ALPHABLEND, CLAMP, CURSOR, LODING, HOLD_ROTATION, QUESTYPE, UVMULT, NINECLICE , END };
}
using namespace Editor;
@@ -20,6 +20,7 @@ namespace Editor {
#define FX_INSTANCE_MODEL TEXT("FX_INSTANCE_MODEL")
#define FX_UIEDITOR TEXT("FX_UIEDITOR")
#pragma endregion
#pragma region MACRO_PROTOTYPE
#define CURRENT_LEVEL m_pGameInstance->Get_CurrentLevelID()
@@ -50,6 +51,7 @@ namespace Editor {
#define LAYER_DOT TEXT("Layer_Dot")
#define LAYER_CELL TEXT("Layer_Cell")
#define LAYER_TRIGGER TEXT("Layer_Trigger")
#define LAYER_LIGHT TEXT("Layer_Light")
#define LAYER_MAPOBJECTMANAGER TEXT("Layer_MapObjectManager")
+58 -38
View File
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "PartObject.h"
@@ -7,12 +7,56 @@ NS_BEGIN(Engine)
class CInstance_Model;
class CShader;
class CTexture;
class CLight;
NS_END
NS_BEGIN(Editor)
class CEffectObject abstract : public CPartObject
{
public:
typedef struct tagEffectInfo
{
_float4 vColor = { 0.f ,0.f ,0.f ,1.f };
_float2 vDiffuseUVGainAmount = {};
_float2 vMaskingUVGainAmount = {};
_float2 vDiffuseNoiseUVGainAmount = {};
_float2 vMaskNoiseUVGainAmount = {};
_float2 vUVCutting = { 1.f ,1.f };
_float2 vUVMaskCutting = { 1.f ,1.f };
_int iMaskMoveLerpOption = { 0 };
_int iDiffuseMoveLerpOption = { 0 };
_int iMaskNoiseMoveLerpOption = { 0 };
_int iDiffuseNoiseMoveLerpOption = { 0 };
_int iBlurWeight = { 0 };
_bool isDiffuse = {};
_bool isMasking = {};
_bool isDissolve = {};
_bool isNoise = {};
_bool isEmissive = {};
_bool isDiffuseUVMove = {};
_bool isMaskUVMove = {};
_bool isBlur = {};
_bool isBillboard = {};
_float4 vEmissive = { 0.f ,0.f ,0.f ,0.f };
_float fColorOption = {};
_float fBlurIntensity = {};
_float fNoiseDistortionIntensity = {};
_float fEmissiveCutAlpha = {};
LIGHT_DESC LightDesc = {};
RENDER eRenderOrder = { RENDER::EFFECT };
}EFFECT_INFO;
protected:
CEffectObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CEffectObject(const CEffectObject& rhs);
@@ -24,6 +68,8 @@ class CEffectObject abstract : public CPartObject
virtual void Late_Update(_float fTimeDelta);
virtual HRESULT Render() override;
virtual HRESULT Render_Blur() override;
public:
HRESULT Load(const _char* pFilePath, LEVEL eLevel);
protected:
virtual HRESULT Bind_ShaderResources() override;
virtual HRESULT Ready_Components(void* pArg) override;
@@ -35,50 +81,24 @@ class CEffectObject abstract : public CPartObject
CTexture* m_pNoise_TextureCom = { nullptr };
CTexture* m_pMasking_TextureCom = { nullptr };
CTexture* m_pDissolve_TextureCom = { nullptr };
CTexture* m_pEmissive_TextureCom = { nullptr };
CShader* m_pShaderCom = { nullptr };
CLight* m_pLightCom = { nullptr };
CInstance_Model* m_pInstance_ModelCom = { nullptr };
protected:
_float4 m_vColor = { 0.f ,0.f ,0.f ,1.f };
_float2 m_vDiffuseUVGainAmount = {};
_float2 m_vMaskingUVGainAmount = {};
_float2 m_vDiffuseNoiseUVGainAmount = {};
_float2 m_vMaskNoiseUVGainAmount = {};
_float2 m_vUVCutting = { 1.f ,1.f };
_float2 m_vUVMaskCutting = { 1.f ,1.f };
_int m_iMaskMoveLerpOption = { 0 };
_int m_iDiffuseMoveLerpOption = { 0 };
_int m_iMaskNoiseMoveLerpOption = { 0 };
_int m_iDiffuseNoiseMoveLerpOption = { 0 };
_int m_iBlurWeight = { 0 };
_bool m_isDiffuse = {};
_bool m_isMasking = {};
_bool m_isDissolve = {};
_bool m_isNoise = {};
_bool m_isDiffuseUVMove = {};
_bool m_isMaskUVMove = {};
_bool m_isBlur = {};
_bool m_isBillboard = {};
_float4 m_vEmissive = { 0.f ,0.f ,0.f ,0.f };
_float m_fColorOption = {};
_float m_fBlurIntensity = {};
_float m_fNoiseDistortionIntensity = {};
_float m_fEmissiveCutAlpha = {};
RENDER m_eRenderOrder = { RENDER::EFFECT };
EFFECT_INFO m_EffectInfo = {};
_string m_strDiffuseName = {};
_string m_strNoiseName = {};
_string m_strMaskingName = {};
_string m_strDissolveName = {};
_string m_strModelName = {};
_string m_strEmissiveName = {};
public:
virtual void Free() override;
};
NS_END
NS_END
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "ContainerObject.h"
@@ -23,7 +23,8 @@ class CEffect_Editor final : public CContainerObject
virtual void Late_Update(_float fTimeDelta) override;
public:
void Reference_Mat_For_EditEffect(class CComponent** pTexture, CGameObject* pObject);
_string Reference_Mat_For_EditEffect(class CComponent** pTexture, CGameObject* pObject);
HRESULT Load_Edit(const _char* pPath);
private:
virtual HRESULT Initialize_Prototype() override;
@@ -37,9 +38,13 @@ class CEffect_Editor final : public CContainerObject
private:
_string m_strCurrentEffectName = {};
_uint m_iNumPart = { 0 };
class CEditEffect* m_pEditEffect = { nullptr };
map<_wstring, vector<pair<_wstring, _wstring>>> m_MatFiles = {}; // map<머테리얼 이름, vector<텍스쳐이름 , 텍스쳐 경로>>
map<_wstring, vector<pair<_wstring, _wstring>>> m_MatFiles = {}; // map<머테리얼 이름, vector<텍스쳐이름 , 텍스쳐 경로>>
_char m_szBuffer[MAX_PATH] = { "../Bin/Resources/Data/Effect/"};
_string m_strSavePath = {};
public:
static CEffect_Editor* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
@@ -50,4 +55,4 @@ class CEffect_Editor final : public CContainerObject
};
NS_END
NS_END
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "CanvasObject.h"
+2 -3
View File
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "ModelParts.h"
@@ -28,7 +28,6 @@ class CHair final : public CModelParts
private:
CTexture* m_pTextureCom = { nullptr };
_uint iTextureIndex = { 0 };
_float4 m_vColor = _float4{1.f,1.f,1.f,1.f};
public:
static CHair* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
@@ -37,4 +36,4 @@ class CHair final : public CModelParts
virtual void Describe_Entity() override;
};
NS_END
NS_END
+3 -2
View File
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "ModelParts.h"
@@ -19,6 +19,7 @@ class CHead final : public CModelParts
virtual void Update(_float fTimeDelta) override;
virtual void Late_Update(_float fTimeDelta) override;
virtual HRESULT Render() override;
HRESULT Bind_ShaderResources();
private:
HRESULT Ready_Components();
@@ -29,4 +30,4 @@ class CHead final : public CModelParts
virtual void Describe_Entity() override;
};
NS_END
NS_END
+7 -1
View File
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "GameObject.h"
@@ -46,6 +46,12 @@ class CIMGUIUI final : public CGameObject
_float m_fAlpha{};
_float2 m_UV{};
_float m_fLeft{};
_float m_fRight{};
_float m_fTop{};
_float m_fBottom{};
_float4 m_fNineSlice{};
_float2 m_fPanelPos{};
_float2 m_fPanelSize{};
_float3 m_fPanelSizeXY{};
+2 -2
View File
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Base.h"
#include "Editor_Define.h"
@@ -15,7 +15,7 @@ typedef class CInformation final : public CBase
_bool strListBox(const _char* Label, _int& iCurrentIndex, vector<_string>& contents);
_bool wstrListBox(const _char* Label, _int& iCurrentIndex, vector<_wstring>& contents);
#pragma endregion // 전역
#pragma endregion // 전역
#pragma region OBJECTVIEWER
+42
View File
@@ -0,0 +1,42 @@
#pragma once
#include "Editor_Define.h"
#include "GameObject.h"
NS_BEGIN(Engine)
class CLight;
NS_END
NS_BEGIN(Editor)
class CMainLight final : public CGameObject
{
private:
CMainLight(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CMainLight(const CMainLight& Prototype);
virtual ~CMainLight() = 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:
CLight* m_pLightCom = { nullptr };
private:
HRESULT Ready_Components();
HRESULT Bind_ShaderResources();
public:
static CMainLight* 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
@@ -31,6 +31,7 @@ class CMission_KeyHold final : public CElementObject
CShader* m_pShaderCom = { nullptr };
CVIBuffer_Rect* m_pVIBufferCom = { nullptr };
_float m_fPI{};
public:
static CMission_KeyHold* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
+6 -5
View File
@@ -1,4 +1,4 @@
#pragma once
#pragma once
#include "Editor_Define.h"
#include "PartObject.h"
@@ -34,14 +34,15 @@ class CModelParts abstract : public CPartObject
_wstring& Get_PrototypeTag() { return m_strModelPrototypeTag; }
protected:
CShader* m_pShaderCom = { nullptr };
CModel* m_pModelCom = { nullptr };
CShader* m_pShaderCom = { nullptr };
CModel* m_pModelCom = { nullptr };
_bool m_bRimLight = { true };
_float m_fRimLightPower = { 3.2f };
_float m_fRimLightStrength = { 3.04f };
_float3 m_vRimLightColor = { 69.f / 255.f, 5.f / 255.f, 10.f / 255.f };
_uint m_HeadIndex = {};
_wstring m_strModelPrototypeTag;
_float4 m_vColor = _float4{ 1.f,1.f,1.f,1.f };
protected:
HRESULT Ready_Components();
HRESULT Bind_ShaderResources();
@@ -52,4 +53,4 @@ class CModelParts abstract : public CPartObject
virtual void Describe_Entity() override;
};
NS_END
NS_END
@@ -19,8 +19,11 @@ float g_fSpotOuterAngle;
vector g_vLightDir;
vector g_vLightPos;
vector g_vLightPosOffset;
vector g_vCamPosition;
Texture2D g_NormalTexture;
Texture2D g_DiffuseTexture;
Texture2D g_ShadeTexture;
@@ -156,7 +159,7 @@ PS_OUT_LIGHT PS_MAIN_POINT(PS_IN In)
vPosition = mul(vPosition, g_invmatProj);
vPosition = mul(vPosition, g_invMatView);
vector vLightDir = vPosition - g_vLightPos;
vector vLightDir = vPosition - (g_vLightPos + g_vLightPosOffset);
float fDistance = length(vLightDir);
float fAttenuation = saturate((g_fLightRange - fDistance) / g_fLightRange);
if (fAttenuation <= 0.f)
@@ -135,6 +135,12 @@
call Update_Lib.bat
</Command>
</PostBuildEvent>
<FxCompile>
<ShaderType>Effect</ShaderType>
</FxCompile>
<FxCompile>
<ShaderModel>5.0</ShaderModel>
</FxCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
@@ -197,6 +203,7 @@ call Update_Lib.bat
</ClCompile>
<ClCompile Include="..\Private\Collider.cpp" />
<ClCompile Include="..\Private\Collider_Manager.cpp" />
<ClCompile Include="..\Private\Collision_Callback.cpp" />
<ClCompile Include="..\Private\Component.cpp" />
<ClCompile Include="..\Private\ComputeShader.cpp" />
<ClCompile Include="..\Private\ContainerObject.cpp" />
@@ -412,6 +419,7 @@ call Update_Lib.bat
</ClInclude>
<ClInclude Include="..\Public\Collider.h" />
<ClInclude Include="..\Public\Collider_Manager.h" />
<ClInclude Include="..\Public\Collision_Callback.h" />
<ClInclude Include="..\Public\Component.h" />
<ClInclude Include="..\Public\ComputeShader.h" />
<ClInclude Include="..\Public\ContainerObject.h" />
@@ -34,9 +34,6 @@
<Filter Include="01.Utility\03.RenderTargets">
<UniqueIdentifier>{d7596dbd-fa1c-414b-9f4e-f05a1a982434}</UniqueIdentifier>
</Filter>
<Filter Include="01.Utility\04.Light">
<UniqueIdentifier>{0c8440f6-63b2-4dcb-9cb8-4c2356106fd0}</UniqueIdentifier>
</Filter>
<Filter Include="01.Utility\05.Shadow">
<UniqueIdentifier>{6f4f880c-b0f2-4fab-ba8b-0939f6bc9321}</UniqueIdentifier>
</Filter>
@@ -106,9 +103,6 @@
<Filter Include="02.Element\02.Component\02.VIBuffer\Rect">
<UniqueIdentifier>{5fec6152-84b6-4811-a2ee-f5f1044cc1eb}</UniqueIdentifier>
</Filter>
<Filter Include="01.Utility\04.Light\Manager">
<UniqueIdentifier>{2bb63dcf-1503-446f-820e-03bfc3e1e38e}</UniqueIdentifier>
</Filter>
<Filter Include="03.Management\20.Camera_Manager">
<UniqueIdentifier>{b89f3382-3069-4263-8e56-6116866a2518}</UniqueIdentifier>
</Filter>
@@ -226,9 +220,6 @@
<Filter Include="01.Utility\06.ComputeShader">
<UniqueIdentifier>{96600587-16b1-4627-914d-7fc413c501ba}</UniqueIdentifier>
</Filter>
<Filter Include="01.Utility\06. Picking">
<UniqueIdentifier>{a60a7ba5-a937-41d7-baac-db67f86f3ba1}</UniqueIdentifier>
</Filter>
<Filter Include="99.Define\99.THIRDPARTY\PHYSX">
<UniqueIdentifier>{5948985e-f67e-4627-aca4-09b8e9edc359}</UniqueIdentifier>
</Filter>
@@ -250,6 +241,27 @@
<Filter Include="02.Element\01.GameObject\50.UI\ElementObject">
<UniqueIdentifier>{1eafb189-2d0c-4ad7-8690-10a517668206}</UniqueIdentifier>
</Filter>
<Filter Include="01.Utility\06.Picking">
<UniqueIdentifier>{a60a7ba5-a937-41d7-baac-db67f86f3ba1}</UniqueIdentifier>
</Filter>
<Filter Include="02.Element\02.Component\08.Character_Controller\Collision_Callback">
<UniqueIdentifier>{05865481-fa20-4432-a5a7-945d4f8c7f3c}</UniqueIdentifier>
</Filter>
<Filter Include="02.Element\02.Component\07.RigidBody\10.Dynamic">
<UniqueIdentifier>{bed0de44-4e62-4b5f-9767-65cfc8a933a3}</UniqueIdentifier>
</Filter>
<Filter Include="02.Element\02.Component\07.RigidBody\11.Kinematic">
<UniqueIdentifier>{33ac85a2-be8e-4ad9-a179-1239d818dc9c}</UniqueIdentifier>
</Filter>
<Filter Include="02.Element\02.Component\07.RigidBody\00.Static">
<UniqueIdentifier>{fda41884-634b-4dd4-8bd2-f6f7ad68ab1f}</UniqueIdentifier>
</Filter>
<Filter Include="02.Element\02.Component\09.Light">
<UniqueIdentifier>{7c82051e-19af-4284-8156-16f504db30b6}</UniqueIdentifier>
</Filter>
<Filter Include="03.Management\03.Light_Manager">
<UniqueIdentifier>{8727e975-e9e2-4b59-9a52-27ad3ad79f2f}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\Private\Base.cpp">
@@ -330,12 +342,6 @@
<ClCompile Include="..\Private\Shadow.cpp">
<Filter>01.Utility\05.Shadow</Filter>
</ClCompile>
<ClCompile Include="..\Private\Light.cpp">
<Filter>01.Utility\04.Light</Filter>
</ClCompile>
<ClCompile Include="..\Private\Light_Manager.cpp">
<Filter>01.Utility\04.Light\Manager</Filter>
</ClCompile>
<ClCompile Include="..\Private\imgui_demo.cpp">
<Filter>99.Define\99.THIRDPARTY\IMGUI</Filter>
</ClCompile>
@@ -445,7 +451,7 @@
<Filter>02.Element\02.Component\06.Model\Instance_Model</Filter>
</ClCompile>
<ClCompile Include="..\private\Picking.cpp">
<Filter>01.Utility\06. Picking</Filter>
<Filter>01.Utility\06.Picking</Filter>
</ClCompile>
<ClCompile Include="..\Private\ComputeShader.cpp">
<Filter>01.Utility\06.ComputeShader</Filter>
@@ -465,6 +471,15 @@
<ClCompile Include="..\private\PanelObject.cpp">
<Filter>02.Element\01.GameObject\50.UI\PanelObject</Filter>
</ClCompile>
<ClCompile Include="..\Private\Light.cpp">
<Filter>02.Element\02.Component\09.Light</Filter>
</ClCompile>
<ClCompile Include="..\Private\Light_Manager.cpp">
<Filter>03.Management\03.Light_Manager</Filter>
</ClCompile>
<ClCompile Include="..\Private\Collision_Callback.cpp">
<Filter>02.Element\02.Component\08.Character_Controller\Collision_Callback</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\Public\Base.h">
@@ -932,12 +947,6 @@
<ClInclude Include="..\Public\Shadow.h">
<Filter>01.Utility\05.Shadow</Filter>
</ClInclude>
<ClInclude Include="..\Public\Light.h">
<Filter>01.Utility\04.Light</Filter>
</ClInclude>
<ClInclude Include="..\Public\Light_Manager.h">
<Filter>01.Utility\04.Light\Manager</Filter>
</ClInclude>
<ClInclude Include="..\Public\Key_Manager.h">
<Filter>00.System\00.Device\Input\00.Key_Manager</Filter>
</ClInclude>
@@ -1023,7 +1032,7 @@
<Filter>01.Utility\06.ComputeShader</Filter>
</ClInclude>
<ClInclude Include="..\public\Picking.h">
<Filter>01.Utility\06. Picking</Filter>
<Filter>01.Utility\06.Picking</Filter>
</ClInclude>
<ClInclude Include="..\Public\VIBuffer_Terrain.h">
<Filter>02.Element\02.Component\02.VIBuffer\Terrain</Filter>
@@ -1046,6 +1055,15 @@
<ClInclude Include="..\public\PanelObject.h">
<Filter>02.Element\01.GameObject\50.UI\PanelObject</Filter>
</ClInclude>
<ClInclude Include="..\Public\Light.h">
<Filter>02.Element\02.Component\09.Light</Filter>
</ClInclude>
<ClInclude Include="..\Public\Light_Manager.h">
<Filter>03.Management\03.Light_Manager</Filter>
</ClInclude>
<ClInclude Include="..\Public\Collision_Callback.h">
<Filter>02.Element\02.Component\08.Character_Controller\Collision_Callback</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\Public\Assimp\color4.inl">
+31 -6
View File
@@ -1,7 +1,9 @@
#include "pch.h"
#include "pch.h"
#include "Animation.h"
#include "Channel.h"
#include "Model.h"
#include "Transform.h"
CAnimation::CAnimation()
{
@@ -29,12 +31,12 @@ CAnimation::CAnimation(const CAnimation& rhs)
SAFE_ADDREF(pChannel);
}
}
_bool CAnimation::Update_TransformationMatrices(const vector<class CBone*>& Bones, _bool bIsLoop, _float fTimeDelta)
_bool CAnimation::Update_TransformationMatrices(const vector<class CBone*>& Bones, _bool bIsLoop, _float fTimeDelta,CTransform*pTransform)
{
//m_fCurrentTrackPosition += m_TickPerSeconds[m_bPause] * fTimeDelta;
m_fCurrentTrackPosition += m_fTickPerSecond * fTimeDelta * m_fAnimSpeed;
if (m_fCurrentTrackPosition >= m_fDuration) {
m_fCurrentTrackPosition = 0.f; // ·çÇÁ
m_fCurrentTrackPosition = 0.f; // 루프
if (false == bIsLoop) {
m_fCurrentTrackPosition = m_fDuration;
return true;
@@ -47,12 +49,17 @@ _bool CAnimation::Update_TransformationMatrices(const vector<class CBone*>& Bone
_uint iIndex = {};
for (auto& pChannel : m_Channels) {
pChannel->Update_TransformationMatirx(Bones, m_fCurrentTrackPosition, &m_CurrentKeyFrameIndices[iIndex++]);
pChannel->Update_TransformationMatirx(Bones, m_fCurrentTrackPosition, &m_CurrentKeyFrameIndices[iIndex++],pTransform);
}
return false;
}
void CAnimation::ResetRootMotion()
{
for (auto& pChannel : m_Channels)
pChannel->ResetRootMotion();
}
void CAnimation::Depart_Animation()
{
@@ -97,7 +104,25 @@ vector<_int>* CAnimation::Capture_Bones()
}
return &m_DestBones;
}
void CAnimation::Remap_Channels_By_Name(CModel* TargetModel)
{
for (auto& channel : m_Channels)
{
const string& name = channel->Get_Name();
int idx = TargetModel->Get_BoneIndex(name.c_str());
if (idx != -1)
channel->Set_BoneIndex(idx);
else
channel->Set_BoneIndex(-1);
}
}
#ifdef EDITOR_PROJECT
HRESULT CAnimation::Initialize(const vector<CBone*>& Bones, const aiAnimation* pAIAnimation)
{
m_strName = pAIAnimation->mName.data;
@@ -244,7 +269,7 @@ CAnimation* CAnimation::Create(const CModel* pModel, SaveAnimation* pSaveAnimati
if (FAILED(pInstance->Initialize(pModel, pSaveAnimation)))
{
MSG_BOX("Failed to Created : CAnimation");
Safe_Release(pInstance);
SAFE_RELEASE(pInstance);
}
return pInstance;
@@ -272,4 +297,4 @@ void CAnimation::Describe_Entity()
//if (GUI::CollapsingHeader(m_strName.c_str())) {
//
//}
}
}

Some files were not shown because too many files have changed in this diff Show More