diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters
index 7b741c0f7..5ee1646f4 100644
--- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters
+++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters
@@ -970,7 +970,7 @@
02.GameObjects\Effect\BroomRace\Bubble
-
+
02.GameObjects\Cameras\CameraPosition\CamPosition_WorldLook
@@ -2009,7 +2009,7 @@
{ce57978a-c208-4fe6-bbfd-8f582c20ff07}
-
+
{b3924c52-0c0d-4cd1-94f4-1eb61d2c6c99}
@@ -2892,9 +2892,6 @@
02.GameObjects\Cameras\CameraPosition\CamPosition_WorldLook
-
- 02.GameObjects\Environment\Prop\SkyBox\TriggerBox
-
02.GameObjects\Effect\Effects\Potion\PotionScreen
@@ -2907,6 +2904,9 @@
02.GameObjects\Effect\BroomRace\Bubble
+
+ 02.GameObjects\Environment\Prop\SkyBox\TriggerBox
+
diff --git a/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp b/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp
index a26ca106a..014eb5b35 100644
--- a/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp
+++ b/Jusin154_Team3D/Client/Private/BroomRaceManager.cpp
@@ -10,6 +10,7 @@
#include "Broom.h"
#include "InfoInstance.h"
#include "InstancedProp.h"
+#include "EffectPool.h"
CBroomRaceManager::CBroomRaceManager(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CGameObject(pDevice, pContext)
@@ -39,6 +40,8 @@ HRESULT CBroomRaceManager::Initialize(void* pArg)
m_pInfoInstance->Add_Event(TEXT("BROOMRACENPCINTERACT"), [this](void* p) {this->RaceReady(); });
+
+
return S_OK;
}
@@ -357,6 +360,11 @@ void CBroomRaceManager::RaceReady()
MSG_BOX("Failed Load Balloons");
}
+ if (FAILED(Load_Broomrace_Effect()))
+ {
+ MSG_BOX("Failed Load Broomrace_Effect");
+ }
+
CInstancedProp::INSTANCE_PROP_DESC Instance_Desc = {};
/* InstanceProp RouteMarker*/
@@ -577,6 +585,48 @@ HRESULT CBroomRaceManager::Load_Balloons()
return E_FAIL;
}
+ return S_OK;
+}
+
+HRESULT CBroomRaceManager::Load_Broomrace_Effect()
+{
+ CEffectPool* pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object();
+
+ if (nullptr == pEffectPool)
+ return E_FAIL;
+
+ tinyxml2::XMLDocument xmlDoc;
+
+ string strPath = "../Bin/Resources/Data/Map/EffectPart/Bubble_Data.xml";
+
+ if ((tinyxml2::XML_SUCCESS != xmlDoc.LoadFile(strPath.c_str())))
+ return E_FAIL;
+
+ tinyxml2::XMLElement* root = xmlDoc.FirstChildElement("EffectParts");
+
+ if (nullptr == root)
+ {
+ MSG_BOX("Failed to Find root");
+ return S_OK;
+ }
+
+ for (auto* Object = root->FirstChildElement("Object"); Object; Object = Object->NextSiblingElement("Object"))
+ {
+ _float4 vPosition = {};
+
+ /* Transform */
+ auto* Position = Object->FirstChildElement("Position");
+ Position->QueryFloatAttribute("x", &vPosition.x);
+ Position->QueryFloatAttribute("y", &vPosition.y);
+ Position->QueryFloatAttribute("z", &vPosition.z);
+ vPosition.w = 1.f;
+
+ pEffectPool->Use_Skill(SKILL_TYPE::BROOM_RACE_BUBBLE, this, &vPosition);
+ }
+
+
+
+
return S_OK;
}
diff --git a/Jusin154_Team3D/Client/Private/BroomRace_Bubble.cpp b/Jusin154_Team3D/Client/Private/BroomRace_Bubble.cpp
index b60dbf613..ec665b5c7 100644
--- a/Jusin154_Team3D/Client/Private/BroomRace_Bubble.cpp
+++ b/Jusin154_Team3D/Client/Private/BroomRace_Bubble.cpp
@@ -78,7 +78,7 @@ void CBroomRace_Bubble::Late_Update(_float fTimeDelta)
if (false == m_bHit) {
_vector vStartPos = XMLoadFloat4(&m_vStartPos);
_vector vEndPos = pBubble->Get_WorldPostion();
- ON_COLLISION_INFO CollisionInfo = SweepTarget(vStartPos, vEndPos, 0.002f);
+ ON_COLLISION_INFO CollisionInfo = MonsterSweepTarget(vStartPos, vEndPos, 0.002f);
OnCollision(this, &CollisionInfo);
diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp
index 2cf9347e1..8146c5508 100644
--- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp
+++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp
@@ -175,7 +175,7 @@ void CLevel_GamePlay::Update(_float fTimeDelta)
bStartCinematic = true;
#elif Bin
bStartCinematic = false;
-#elif gimchi
+#elif gimch
bStartCinematic = false;
#endif
#endif // _DEBUG
diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp
index c1184621a..55388e8a5 100644
--- a/Jusin154_Team3D/Client/Private/Player.cpp
+++ b/Jusin154_Team3D/Client/Private/Player.cpp
@@ -126,6 +126,8 @@ HRESULT CPlayer::Initialize(void* pArg)
m_fRayDistance = 5.f;
m_pModelCom->Set_DisableRootMotionScale(true);
+ Ready_Sound_Events("../Bin/Resources/Models/Human/PlayableCharacter/KeyFrame.xml");
+
return S_OK;
}
diff --git a/Jusin154_Team3D/Client/Public/BroomRaceManager.h b/Jusin154_Team3D/Client/Public/BroomRaceManager.h
index fbb2b7251..811c03d95 100644
--- a/Jusin154_Team3D/Client/Public/BroomRaceManager.h
+++ b/Jusin154_Team3D/Client/Public/BroomRaceManager.h
@@ -44,6 +44,7 @@ class CBroomRaceManager final : public CGameObject
HRESULT Load_RaceRing();
HRESULT Load_Balloons();
+ HRESULT Load_Broomrace_Effect();
private:
CInfoInstance* m_pInfoInstance = { nullptr };
diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/EffectPart/Bubble_Data.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/EffectPart/Bubble_Data.xml
new file mode 100644
index 000000000..beea5468d
--- /dev/null
+++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/EffectPart/Bubble_Data.xml
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Terrain/Hogsmeade_AlphaMap.dds b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Terrain/Hogsmeade_AlphaMap.dds
index 4f509bd01..df19cee74 100644
Binary files a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Terrain/Hogsmeade_AlphaMap.dds and b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Terrain/Hogsmeade_AlphaMap.dds differ
diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/KeyFrame.xml b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/KeyFrame.xml
new file mode 100644
index 000000000..051939b9e
--- /dev/null
+++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/PlayableCharacter/KeyFrame.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp
index da8df57ee..39e1db320 100644
--- a/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp
+++ b/Jusin154_Team3D/Editor/Private/Level_MapViewer.cpp
@@ -806,9 +806,9 @@ HRESULT CLevel_MapViewer::Ready_Layer_MapObjectManager(const _wstring& strLayerT
HRESULT CLevel_MapViewer::Ready_Layer_Player_And_Ranrok()
{
- if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_PLAYER))) {
- return E_FAIL;
- }
+ //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_PLAYER))) {
+ // return E_FAIL;
+ //}
/*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Monster"))))
diff --git a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp
index df032518f..15b4e032c 100644
--- a/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp
+++ b/Jusin154_Team3D/Editor/Private/Level_ObjectViewer.cpp
@@ -20,6 +20,8 @@
#include "Goblin.h"
#include "Broom.h"
#include "ReparoObject.h"
+#include "Sound_Manager.h"
+#include "Unit.h"
CLevel_ObjectViewer::CLevel_ObjectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
{
@@ -42,6 +44,7 @@ HRESULT CLevel_ObjectViewer::Initialize()
return E_FAIL;
}
+ m_fVolume = 0.8f;
return S_OK;
}
@@ -59,6 +62,9 @@ void CLevel_ObjectViewer::Update(_float fTimeDelta)
Parts_Object_Setting();
Find_Anim();
+
+ for(auto& pObject : m_Objects)
+ dynamic_cast(pObject)->Play_Event();
}
HRESULT CLevel_ObjectViewer::Render()
@@ -362,6 +368,7 @@ void CLevel_ObjectViewer::Show_AnimList()
GUI::End();
}
+
void CLevel_ObjectViewer::Show_ObjectList()
{
for (size_t i = 0; i < m_Objects.size(); i++)
@@ -428,6 +435,7 @@ void CLevel_ObjectViewer::Dummy_Object_Setting()
_int iIndex = pModel->Get_AnimIndex();
if (GUI::InputInt("Anim Index", &iIndex))
{
+ m_iCurAnimIndex = iIndex;
pModel->Set_AnimationIndex(iIndex);
}
@@ -438,8 +446,15 @@ void CLevel_ObjectViewer::Dummy_Object_Setting()
Load_KeyFrame(szName);
}
-
- static _char EventName[64] = {};
+ if(GUI::Button("Load KeyFrame_"))
+ {
+ for (auto& pObject : m_Objects)
+ {
+ dynamic_cast(pObject)->Reset_SoundEvent();
+ dynamic_cast(m_Objects[m_iObjectIndex])->Ready_Sound_Events("../Bin/Resources/Models/Human/PlayableCharacter/KeyFrame.xml");
+ }
+ }
+ static _char EventName[256] = {};
GUI::InputText("EventName", EventName, sizeof(EventName));
GUI::SameLine();
@@ -456,6 +471,31 @@ void CLevel_ObjectViewer::Dummy_Object_Setting()
EventName[0] = '\0';
}
}
+ GUI::InputFloat("Volume", &m_fVolume);
+ static _char SoundFilter[256] = {};
+
+ if (GUI::Button("Stop Sound"))
+ m_pGameInstance->Sound_StopAll();
+
+ if (GUI::CollapsingHeader("Sound list"))
+ {
+ GUI::InputText("Filter", SoundFilter, sizeof(SoundFilter));
+
+ _wstring soudnfilter = CMyTools::ToWstring(SoundFilter);
+ for (_uint i = 0; i < ENUM_CLASS(SOUND::SD_KIND::END); ++i)
+ {
+ _wstring Name = SOUND::SD_PATH::SD_KIND_PATHS[i];
+ if (string::npos != Name.find(soudnfilter))
+ {
+ if (GUI::Button(("S_" + CMyTools::ToString(Name)).c_str()))
+ {
+ strcpy_s(EventName, CMyTools::ToString(Name).c_str());
+ m_pGameInstance->Sound_Play(static_cast(i), SD_CHANNEL_GROUP::EFFECT, false, m_fVolume);
+ }
+ }
+ }
+ }
+
for (auto& iter : m_KeyFrames)
@@ -702,6 +742,7 @@ void CLevel_ObjectViewer::Find_Anim()
void CLevel_ObjectViewer::Save_KeyFrame()
{
+
_char szDrive[MAX_PATH] = {};
_char szDir[MAX_PATH] = {};
_splitpath_s(m_DummyPath, szDrive, MAX_PATH, szDir, MAX_PATH, nullptr, 0, nullptr, 0);
@@ -736,17 +777,17 @@ void CLevel_ObjectViewer::Save_KeyFrame()
}
}
- if (!pAnimNode)
+ if (nullptr == pAnimNode)
{
pAnimNode = doc.NewElement("Animation");
pAnimNode->SetAttribute("Index", m_iCurAnimIndex);
pRoot->InsertEndChild(pAnimNode);
}
- while (tinyxml2::XMLElement* pKey = pAnimNode->FirstChildElement("KeyFrame"))
- {
- pAnimNode->DeleteChild(pKey);
- }
+ //while (tinyxml2::XMLElement* pKey = pAnimNode->FirstChildElement("KeyFrame"))
+ //{
+ // pAnimNode->DeleteChild(pKey);
+ //}
for (auto& iter : m_KeyFrames)
{
@@ -757,9 +798,20 @@ void CLevel_ObjectViewer::Save_KeyFrame()
pKey->SetAttribute("Ratio", buf);
pKey->SetAttribute("Volume", m_fVolume);
pAnimNode->InsertEndChild(pKey);
+
+ SOUND::SD_KIND eSoundKind = m_pGameInstance->Find_Sound(CMyTools::ToWstring(Path));
+
+ if(nullptr != m_Objects[m_iObjectIndex])
+ {
+ dynamic_cast(m_Objects[m_iObjectIndex])->Add_Sound_Event(m_iCurAnimIndex,
+ [this, eSoundKind, iter]() { m_pGameInstance->Sound_Play(eSoundKind, SD_CHANNEL_GROUP::EFFECT, false, m_fVolume); },
+ iter.second, true);
+ }
}
+ m_KeyFrames.clear();
doc.SaveFile(Path.c_str());
+
}
HRESULT CLevel_ObjectViewer::Ready_Layer_Camera(const _wstring& strLayerTag)
diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp
index 1990d7f4f..b6b0488fa 100644
--- a/Jusin154_Team3D/Editor/Private/Loader.cpp
+++ b/Jusin154_Team3D/Editor/Private/Loader.cpp
@@ -418,6 +418,15 @@ HRESULT CLoader::Loading_For_Logo()
m_strMessage = TEXT("Model Loading..");
+ m_strMessage = TEXT("Sound Loading..");
+
+ const _tchar* pSoundFilePath = TEXT("../Bin/Resources/Sounds/");
+
+ for (int iIndex = 0; iIndex < ENUM_CLASS(SOUND::SD_KIND::END); ++iIndex) {
+ if (FAILED(m_pGameInstance->Load_Sound((SOUND::SD_KIND)iIndex, (_wstring(pSoundFilePath) + SOUND::SD_PATH::SD_KIND_PATHS[iIndex]).c_str(), FMOD_DEFAULT))) {
+ return E_FAIL;
+ }
+ }
m_strMessage = TEXT("Shader Loading..");
@@ -2858,25 +2867,25 @@ HRESULT CLoader::Loading_For_MapViewer()
// return E_FAIL;
//}
- if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Playable_Model"),
- CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/PlayableCharacter/Playable.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) {
- return E_FAIL;
- }
+ //if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Playable_Model"),
+ // CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Human/PlayableCharacter/Playable.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) {
+ // return E_FAIL;
+ //}
- if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CRanrok::Create(m_pDevice, m_pContext)))) {
- return E_FAIL;
- }
+ //if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CRanrok::Create(m_pDevice, m_pContext)))) {
+ // return E_FAIL;
+ //}
- if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CFSM::Create(m_pDevice, m_pContext))))
- return E_FAIL;
+ //if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CFSM::Create(m_pDevice, m_pContext))))
+ // return E_FAIL;
- /* For.Prototype_GameObject_Player */
- if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CPlayer::Create(m_pDevice, m_pContext))))
- return E_FAIL;
+ ///* For.Prototype_GameObject_Player */
+ //if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CPlayer::Create(m_pDevice, m_pContext))))
+ // return E_FAIL;
- if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), CCharacter_Controller::Create(m_pDevice, m_pContext)))) {
- return E_FAIL;
- }
+ //if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), CCharacter_Controller::Create(m_pDevice, m_pContext)))) {
+ // return E_FAIL;
+ //}
/* For.Prototype_GameObject_Wand */
if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CWand::Create(m_pDevice, m_pContext))))
@@ -3490,7 +3499,7 @@ _bool bLoadHogsmeade = true;
}
#pragma region HOGWART
-_bool bHogwartLoad = { false };
+_bool bHogwartLoad = { true };
/* Hogwart LOD */
if (FAILED(MapFolderLoad("../Bin/Resources/Models/MapMesh/Game/Environment/Hogwarts/HogwartsLOD",
@@ -3833,7 +3842,7 @@ vector> jobFutures;
_uint iLoadCount = 44;
vector*> Contents(iLoadCount);
-_bool isLoad_Map = { true };
+_bool isLoad_Map = { false };
if(isLoad_Map)
{
{ /* Terrain */
diff --git a/Jusin154_Team3D/Editor/Private/Loader_ObjectViewer.cpp b/Jusin154_Team3D/Editor/Private/Loader_ObjectViewer.cpp
index 14dc49d0c..5a2bbca19 100644
--- a/Jusin154_Team3D/Editor/Private/Loader_ObjectViewer.cpp
+++ b/Jusin154_Team3D/Editor/Private/Loader_ObjectViewer.cpp
@@ -75,14 +75,6 @@ HRESULT CLoader::Loading_For_ObjectViewer()
#pragma region MONSTER
- if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinSpector_Model"),
- CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "C:\\MeshTable\\Game\\RiggedObjects\\Props\\Weapons\\Goblins\\SK_WPN_GOB_BattleAxe01.fbx", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity()))))
- return E_FAIL;
-
- if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_GoblinSpector_Model"),
- CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "C:\\MeshTable\\Game\\RiggedObjects\\Props\\Weapons\\Goblins\\SK_WPN_GOB_SmallSword.fbx", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity()))))
- return E_FAIL;
-
futures.emplace_back(Deferred_ModelLoad(
MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/SK_GOB_M_T4Melee_INST_A_Master.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity(),
TEXT("Prototype_Component_SK_GOB_M_T4Melee_INST_A_Master_Model")
diff --git a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp
index 686407b32..fb52ae93f 100644
--- a/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp
+++ b/Jusin154_Team3D/Editor/Private/MapObject_Manager.cpp
@@ -76,7 +76,7 @@ HRESULT CMapObject_Manager::Initialize(void* pArg)
/*if (FAILED(Load_LightObject("LightElement")))
return E_FAIL;*/
- if (FAILED(Load_InteractObject("E_INTER_Barrel")))
+ /*if (FAILED(Load_InteractObject("E_INTER_Barrel")))
return E_FAIL;
if (FAILED(Load_InteractObject("E_INTER_PostPackage_B")))
return E_FAIL;
@@ -85,11 +85,11 @@ HRESULT CMapObject_Manager::Initialize(void* pArg)
if (FAILED(Load_InteractObject("E_INTER_TeaShopTable")))
return E_FAIL;
if (FAILED(Load_InteractObject("E_INTER_TeaShopChair")))
- return E_FAIL;
+ return E_FAIL;*/
#pragma region HOGSMEADE
- if (FAILED(Load_MapData("Hogsmeade_MapContainer_Data", LAYER_HOGSMEADE)))
- return E_FAIL;
+ //if (FAILED(Load_MapData("Hogsmeade_MapContainer_Data", LAYER_HOGSMEADE)))
+ // return E_FAIL;
#pragma endregion
#pragma region DUNGEON
@@ -100,10 +100,10 @@ HRESULT CMapObject_Manager::Initialize(void* pArg)
#pragma endregion
#pragma region HOGWART
- //if (FAILED(Load_MapData("Hogwart_MapContainer_Data", LAYER_HOGWART)))
- // return E_FAIL;
- //if (FAILED(Load_MapData("HogwartMap1221", LAYER_HOGWART)))
- // return E_FAIL;
+ if (FAILED(Load_MapData("Hogwart_MapContainer_Data", LAYER_HOGWART)))
+ return E_FAIL;
+ if (FAILED(Load_MapData("HogwartMap1221", LAYER_HOGWART)))
+ return E_FAIL;
#pragma endregion
#pragma region Light
@@ -277,9 +277,9 @@ void CMapObject_Manager::Update(_float fTimeDelta)
//Update_LightSpawer();
//Update_Decal();
//Update_RaceRing();
- //Update_EditEffect();
+ Update_EditEffect();
//Update_Balloon();
- Update_DummyNpc();
+ //Update_DummyNpc();
Update_Unified();
@@ -2766,7 +2766,7 @@ void CMapObject_Manager::Update_EditEffect()
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(ENUM_CLASS(LEVEL::MAP), NEXT_LEVEL, TEXT("Layer_Effect_EDIT"), &PartsDesc, nullptr, &pEffect)))
return;
- pEffect->Load("../Bin/Resources/Data/Effect/MapEffect/Ranrok_Decal_35",LEVEL::MAP);
+ pEffect->Load("../Bin/Resources/Data/Effect/BroomRace/Bubble",LEVEL::MAP);
pEffect->Set_Visible(true);
}
diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp
index d4b1d3ae0..f17105244 100644
--- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp
+++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp
@@ -1032,10 +1032,34 @@ HRESULT CGameInstance::Load_Sound(SOUND::SD_KIND eKind, const _tchar* wstrSoundF
{
return m_pSound_Manager->Load_Sound(eKind, wstrSoundFilePath, eSoundMode);
}
+SOUND::SD_KIND CGameInstance::Find_Sound(const _wstring wstrFilePath)
+{
+ return m_pSound_Manager->Find_Sound(wstrFilePath);
+}
void CGameInstance::Sound_Play(SOUND::SD_KIND eSoundKind, SD_CHANNEL_GROUP eSoundChannel, _bool bRepeat, _float fVolume)
{
m_pSound_Manager->Sound_Play(eSoundKind, eSoundChannel, bRepeat, fVolume);
}
+void CGameInstance::Sound_Play_3DPos(SOUND::SD_KIND eSoundKind, SD_CHANNEL_GROUP eSoundChannel, _float3& refSpeaker, _float fMin, _float fMax, _bool bRepeat)
+{
+ m_pSound_Manager->Sound_Play_3DPos(eSoundKind, eSoundChannel, refSpeaker, fMin, fMax, bRepeat);
+}
+void CGameInstance::Sound_Pause_Channel(SD_CHANNEL_GROUP eSoundChannel, bool bPause)
+{
+ m_pSound_Manager->Sound_Pause_Channel(eSoundChannel, bPause);
+}
+void CGameInstance::Sound_Set3DListenerPos(CTransform* pTransform)
+{
+ m_pSound_Manager->Sound_Set3DListenerPos(pTransform);
+}
+void CGameInstance::Sound_StopChannel(SD_CHANNEL_GROUP eSoundChannel)
+{
+ m_pSound_Manager->Sound_StopChannel(eSoundChannel);
+}
+void CGameInstance::Sound_Stop(SOUND::SD_KIND eSoundKind, SD_CHANNEL_GROUP eSoundChannel)
+{
+ m_pSound_Manager->Sound_Stop(eSoundKind, eSoundChannel);
+}
void CGameInstance::Sound_StopAll()
{
m_pSound_Manager->Sound_StopAll();
diff --git a/Jusin154_Team3D/Engine/Private/Sound_Manager.cpp b/Jusin154_Team3D/Engine/Private/Sound_Manager.cpp
index 6d46c82a7..cf4e8effc 100644
--- a/Jusin154_Team3D/Engine/Private/Sound_Manager.cpp
+++ b/Jusin154_Team3D/Engine/Private/Sound_Manager.cpp
@@ -7,7 +7,7 @@ System* CSound_Manager::s_pSystem = { nullptr };
_string CSound_Manager::s_ArrChannelName[ENUM_CLASS(SD_CHANNEL_GROUP::END)] = { "BGM", "ENVIRONMENT", "EFFECT", "VOICE" };
list CSound_Manager::s_listChannel[ENUM_CLASS(SD_CHANNEL_GROUP::END)] = {};
Sound* CSound_Manager::s_ArrSounds[ENUM_CLASS(SOUND::SD_KIND::END)] = {};
-
+map<_wstring, SOUND::SD_KIND > CSound_Manager::s_SoundMap = {};
CSound_Manager::CSound_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: m_pDevice(pDevice),
@@ -38,7 +38,6 @@ HRESULT CSound_Manager::Update()
}
}
}
- Sound_Test();
return S_OK;
}
@@ -204,45 +203,8 @@ void CSound_Manager::Sound_SetVolume(SD_CHANNEL_GROUP eSoundChannel, float fVolu
}
}
-void CSound_Manager::Sound_Test()
-{
- //GUI::Begin("Music_Player");
- //static int item_selected_CHANNEL = 0;
- //static int item_selected_SD_KIND = 0;
-
- //GUI::BeginChild("##ITEMs", ImVec2(350.f, 175.f), true, ImGuiWindowFlags_HorizontalScrollbar);
- //for (int iIndex = 0; iIndex < SOUND::SD_KIND::END; ++iIndex) {
- // if (GUI::Button(CMyTools::ToString(SOUND::SD_PATH::SD_KIND_STRING[iIndex]).c_str())) {
- // item_selected_SD_KIND = iIndex;
- // }
- //}
- //GUI::EndChild();
- //GUI::BeginChild("##Channels", ImVec2(350.f, 175.f), true, ImGuiWindowFlags_HorizontalScrollbar);
- //for (int iIndex = 0; iIndex < ENUM_CLASS(SD_CHANNEL_GROUP::END); ++iIndex) {
- // if (GUI::Button(s_ArrChannelName[iIndex].c_str())) {
- // item_selected_CHANNEL = iIndex;
- // }
- //}
- //GUI::EndChild();
-
- //if (GUI::Button("Play_Sound", { 50, 50 })) {
- // Sound_Play(static_cast(item_selected_SD_KIND), static_cast(item_selected_CHANNEL), false, false, 1.f);
- //} GUI::SameLine();
- //if (GUI::Button("Sound_STOP", { 50, 50 })) {
- // Sound_StopAll();
- //}
- //GUI::End();
-}
-
HRESULT CSound_Manager::Load_Sound(SOUND::SD_KIND eKind, const _tchar* wstrSoundFilePath, FMOD_MODE eSoundMode)
{
- //const _tchar* pSoundFilePath = TEXT("../Bin/Resources/Sounds/");
- //for (int iIndex = 0; iIndex < ENUM_CLASS(SOUND::SD_KIND::END); ++iIndex) {
- // if (FAILED(m_pGameInstance->Load_Sound((SOUND::SD_KIND)iIndex, (_wstring(pSoundFilePath) + SOUND::SD_PATH::SD_KIND_STRING[iIndex]).c_str()))) {
- // return E_FAIL;
- // }
- //}
-
//// 사운드 생성, 파일 불러오기
FMOD_RESULT fr = CSound_Manager::s_pSystem->createSound(
CMyTools::ToString(wstrSoundFilePath).c_str(), // 대상 경로
@@ -255,6 +217,16 @@ HRESULT CSound_Manager::Load_Sound(SOUND::SD_KIND eKind, const _tchar* wstrSound
return E_FAIL;
}
+SOUND::SD_KIND CSound_Manager::Find_Sound(const _wstring wstrFilePath)
+{
+ auto iter = s_SoundMap.find(wstrFilePath);
+
+ if (iter == s_SoundMap.end())
+ return SOUND::SD_KIND::END;
+
+ return iter->second;
+}
+
HRESULT CSound_Manager::Initialize()
{
FMOD_RESULT r = System_Create(&s_pSystem);
@@ -275,9 +247,22 @@ HRESULT CSound_Manager::Initialize()
s_pSystem->init(512, FMOD_INIT_NORMAL, nullptr);
}
+ Ready_SoundMap();
+
return S_OK;
}
+void CSound_Manager::Ready_SoundMap()
+{
+ _uint iNumSound = ENUM_CLASS(SOUND::SD_KIND::END);
+ for (_uint i = 0; i < iNumSound; ++i)
+ {
+ s_SoundMap.emplace(SOUND::SD_PATH::SD_KIND_PATHS[i], static_cast(i));
+ }
+}
+
+
+
CSound_Manager* CSound_Manager::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
{
CSound_Manager* pInstance = new CSound_Manager(pDevice, pContext);
diff --git a/Jusin154_Team3D/Engine/Private/Unit.cpp b/Jusin154_Team3D/Engine/Private/Unit.cpp
index a5a47ecaa..a5615d92f 100644
--- a/Jusin154_Team3D/Engine/Private/Unit.cpp
+++ b/Jusin154_Team3D/Engine/Private/Unit.cpp
@@ -186,6 +186,37 @@ void CUnit::Play_Event()
++iter;
}
+
+ /* Sound */
+ for (auto iter = m_SoundEvents.begin(); iter != m_SoundEvents.end(); )
+ {
+ _float ratio = m_pModelCom->Get_CurrentTrackProgressRatio();
+ _uint curAnim = m_pModelCom->Get_AnimIndex();
+
+ _float prevRatio = iter->PrevRatio;
+
+ if (curAnim == iter->AnimIndex)
+ {
+ if (prevRatio <= iter->fRatio && ratio >= iter->fRatio)
+ {
+ iter->Callback();
+
+ if (!iter->bKeep)
+ {
+ iter = m_SoundEvents.erase(iter);
+ continue;
+ }
+ }
+
+ iter->PrevRatio = ratio;
+ }
+ else
+ {
+ iter->PrevRatio = 0.f;
+ }
+
+ ++iter;
+ }
}
void CUnit::Add_Event(_uint AnimIndex, function Callback, _float fRatio,_bool bKeep)
@@ -198,6 +229,21 @@ void CUnit::Add_Event(_uint AnimIndex, function Callback, _float fRatio,
m_PendingEvents.push_back(Desc);
}
+void CUnit::Add_Sound_Event(_uint AnimIndex, function Callback, _float fRatio, _bool bKeep)
+{
+ PendingEvent Desc;
+ Desc.AnimIndex = AnimIndex;
+ Desc.fRatio = fRatio;
+ Desc.Callback = Callback;
+ Desc.bKeep = bKeep;
+ m_SoundEvents.push_back(Desc);
+}
+
+void CUnit::Reset_SoundEvent()
+{
+ m_SoundEvents.clear();
+}
+
void CUnit::Reset_Event()
{
m_PendingEvents.clear();
@@ -584,6 +630,48 @@ STATEANIM::ESTATE CUnit::StringToStateAnim(const string& s)
return it->second;
}
+HRESULT CUnit::Ready_Sound_Events(const _char* pFilePath)
+{
+ tinyxml2::XMLDocument xmlDoc;
+
+ if ((tinyxml2::XML_SUCCESS != xmlDoc.LoadFile(pFilePath)))
+ return E_FAIL;
+
+ tinyxml2::XMLElement* root = xmlDoc.FirstChildElement("KeyFrames");
+
+ if (nullptr == root)
+ {
+ MSG_BOX("Failed to Find root");
+ return S_OK;
+ }
+
+ for (auto* Animation = root->FirstChildElement("Animation"); Animation; Animation = Animation->NextSiblingElement("Animation"))
+ {
+ _uint iAnimationIndex = {};
+
+ Animation->QueryUnsignedAttribute("Index", &iAnimationIndex);
+
+
+ for (auto* KeyFrame = Animation->FirstChildElement("KeyFrame"); KeyFrame; KeyFrame = KeyFrame->NextSiblingElement("KeyFrame"))
+ {
+ _float fVolume = {};
+ _float fRatio = {};
+ const _char* pPath = {};
+
+ KeyFrame->QueryStringAttribute("Event", &pPath);
+ KeyFrame->QueryFloatAttribute("Ratio", &fRatio);
+ KeyFrame->QueryFloatAttribute("Volume", &fVolume);
+
+ SOUND::SD_KIND eSoundKind = m_pGameInstance->Find_Sound(CMyTools::ToWstring(pPath));
+
+ Add_Sound_Event(iAnimationIndex,
+ [this, eSoundKind, fVolume]() { m_pGameInstance->Sound_Play(eSoundKind, SD_CHANNEL_GROUP::EFFECT, false, fVolume); },
+ fRatio, true);
+ }
+ }
+
+ return S_OK;
+}
void CUnit::Free()
{
diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h
index b229b5ac3..f23d75036 100644
--- a/Jusin154_Team3D/Engine/Public/GameInstance.h
+++ b/Jusin154_Team3D/Engine/Public/GameInstance.h
@@ -211,8 +211,14 @@ class ENGINE_DLL CGameInstance final : public CBase
#pragma endregion
#pragma region SOUND_MANAGER
HRESULT Load_Sound(SOUND::SD_KIND eKind, const _tchar* wstrSoundFilePath, FMOD_MODE eSoundMode);
+ SOUND::SD_KIND Find_Sound(const _wstring wstrFilePath);
void Sound_Play(SOUND::SD_KIND eSoundKind, SD_CHANNEL_GROUP eSoundChannel, _bool bRepeat, _float fVolume);
- void Sound_StopAll(); // 전체 정지
+ void Sound_Play_3DPos(SOUND::SD_KIND eSoundKind, SD_CHANNEL_GROUP eSoundChannel, _float3& refSpeaker, _float fMin = 3.f, _float fMax = 20.f, _bool bRepeat = false);
+ void Sound_Pause_Channel(SD_CHANNEL_GROUP eSoundChannel, bool bPause);
+ void Sound_Set3DListenerPos(class CTransform* pTransform);
+ void Sound_StopChannel(SD_CHANNEL_GROUP eSoundChannel);
+ void Sound_Stop(SOUND::SD_KIND eSoundKind, SD_CHANNEL_GROUP eSoundChannel);
+ void Sound_StopAll();
#pragma endregion
#pragma region PICKING
diff --git a/Jusin154_Team3D/Engine/Public/Sound_Manager.h b/Jusin154_Team3D/Engine/Public/Sound_Manager.h
index b5931c8e3..e5e213158 100644
--- a/Jusin154_Team3D/Engine/Public/Sound_Manager.h
+++ b/Jusin154_Team3D/Engine/Public/Sound_Manager.h
@@ -11,6 +11,7 @@ class CSound_Manager final :
static _string s_ArrChannelName[ENUM_CLASS(SD_CHANNEL_GROUP::END)];
static list s_listChannel[ENUM_CLASS(SD_CHANNEL_GROUP::END)];
static Sound* s_ArrSounds[ENUM_CLASS(SOUND::SD_KIND::END)];
+ static map<_wstring, SOUND::SD_KIND> s_SoundMap;
private:
CSound_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
@@ -29,9 +30,9 @@ class CSound_Manager final :
void Sound_Stop(SOUND::SD_KIND eSoundKind, SD_CHANNEL_GROUP eSoundChannel); // 특정 사운드 정지
void Sound_StopAll(); // 전체 정지
void Sound_SetVolume(SD_CHANNEL_GROUP eSoundChannel, float fVolume);
- void Sound_Test();
HRESULT Load_Sound(SOUND::SD_KIND eKind, const _tchar* wstrSoundFilePath, FMOD_MODE eSoundMode);
+ SOUND::SD_KIND Find_Sound(const _wstring wstrFilePath);
private:
ID3D11Device* m_pDevice = { nullptr };
@@ -41,6 +42,7 @@ class CSound_Manager final :
private:
HRESULT Initialize();
+ void Ready_SoundMap();
public:
static CSound_Manager* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
diff --git a/Jusin154_Team3D/Engine/Public/Unit.h b/Jusin154_Team3D/Engine/Public/Unit.h
index 1072fb757..04a531250 100644
--- a/Jusin154_Team3D/Engine/Public/Unit.h
+++ b/Jusin154_Team3D/Engine/Public/Unit.h
@@ -36,6 +36,9 @@ class ENGINE_DLL CUnit abstract : public CContainerObject
_wstring& Get_PrototypeTag() { return m_strModelPrototypeTag; }
_bool IsAI() { return m_bAI; }
+ HRESULT Ready_Sound_Events(const _char* pFilePath);
+ void Add_Sound_Event(_uint AnimIndex, function Callback, _float fRatio = 0.f, _bool bKeep = false);
+ void Reset_SoundEvent();
#ifdef _DEBUG
void Load_KeyFrame();
#endif // _DEBUG
@@ -89,6 +92,7 @@ class ENGINE_DLL CUnit abstract : public CContainerObject
_float m_fHitRadius = {};
vector m_PendingEvents;
+ vector m_SoundEvents = {};
_float m_fHitDegree = {};
_float m_fHitCross = {};
@@ -105,12 +109,17 @@ class ENGINE_DLL CUnit abstract : public CContainerObject
protected:
HRESULT Ready_Components(void*pArg);
+#ifdef _DEBUG
+public:
+#endif // _DEBUG
void Play_Event();
+protected:
void Add_Event(_uint AnimIndex, function Callback, _float fRatio = 0.f, _bool bKeep = false);
void Reset_Event();
void Check_HitAngle(_vector ProjectileDir);
virtual void Load_AnimXML(const string& path);
STATEANIM::ESTATE StringToStateAnim(const string& s);
+
public:
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)PURE;
virtual void Free() override;