remove audiosourcecomponent
This commit is contained in:
parent
65a6014b1c
commit
d0d796781b
|
@ -34,7 +34,8 @@ project "SHADE_Application"
|
||||||
"%{IncludeDir.VULKAN}/include",
|
"%{IncludeDir.VULKAN}/include",
|
||||||
"%{IncludeDir.VMA}/include",
|
"%{IncludeDir.VMA}/include",
|
||||||
"%{IncludeDir.VULKAN}/Source/SPIRV-Reflect",
|
"%{IncludeDir.VULKAN}/Source/SPIRV-Reflect",
|
||||||
"%{IncludeDir.fmod}/include"
|
"%{IncludeDir.fmod}/include",
|
||||||
|
"%{IncludeDir.RTTR}\\include"
|
||||||
}
|
}
|
||||||
|
|
||||||
externalwarnings "Off"
|
externalwarnings "Off"
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include "Math/Transform/SHTransformSystem.h"
|
#include "Math/Transform/SHTransformSystem.h"
|
||||||
#include "Input/SHInputManagerSystem.h"
|
#include "Input/SHInputManagerSystem.h"
|
||||||
#include "AudioSystem/SHAudioSystem.h"
|
#include "AudioSystem/SHAudioSystem.h"
|
||||||
#include "AudioSystem/SHAudioSourceComponent.h"
|
|
||||||
#include "AudioSystem/SHAudioListenerComponent.h"
|
#include "AudioSystem/SHAudioListenerComponent.h"
|
||||||
|
|
||||||
#include "Scenes/SBTestScene.h"
|
#include "Scenes/SBTestScene.h"
|
||||||
|
@ -81,7 +80,7 @@ namespace Sandbox
|
||||||
SHADE::SHSystemManager::RegisterRoutine<SHADE::SHInputManagerSystem, SHADE::SHInputManagerSystem::InputManagerRoutine>();
|
SHADE::SHSystemManager::RegisterRoutine<SHADE::SHInputManagerSystem, SHADE::SHInputManagerSystem::InputManagerRoutine>();
|
||||||
|
|
||||||
SHADE::SHSystemManager::RegisterRoutine<SHADE::SHAudioSystem, SHADE::SHAudioSystem::AudioRoutine>();
|
SHADE::SHSystemManager::RegisterRoutine<SHADE::SHAudioSystem, SHADE::SHAudioSystem::AudioRoutine>();
|
||||||
SHADE::SHComponentManager::CreateComponentSparseSet<SHADE::SHAudioSourceComponent>();
|
//SHADE::SHComponentManager::CreateComponentSparseSet<SHADE::SHAudioSourceComponent>();
|
||||||
SHADE::SHComponentManager::CreateComponentSparseSet<SHADE::SHAudioListenerComponent>();
|
SHADE::SHComponentManager::CreateComponentSparseSet<SHADE::SHAudioListenerComponent>();
|
||||||
|
|
||||||
// Set up graphics system and windows
|
// Set up graphics system and windows
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
#include "SHpch.h"
|
#include "SHpch.h"
|
||||||
#include "SHAudioListenerComponent.h"
|
#include "SHAudioListenerComponent.h"
|
||||||
//#include "ECS_Base/System/SHSystemManager.h"
|
#include "ECS_Base/Managers/SHSystemManager.h"
|
||||||
|
|
||||||
namespace SHADE
|
namespace SHADE
|
||||||
{
|
{
|
||||||
|
@ -34,22 +34,22 @@ namespace SHADE
|
||||||
return up;
|
return up;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SHAudioListenerComponent::SetPos(SHVec3 p)
|
void SHAudioListenerComponent::SetPos(const SHVec3 p)
|
||||||
{
|
{
|
||||||
pos = p;
|
pos = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SHAudioListenerComponent::SetVel(SHVec3 v)
|
void SHAudioListenerComponent::SetVel(const SHVec3 v)
|
||||||
{
|
{
|
||||||
vel = v;
|
vel = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SHAudioListenerComponent::SetForward(SHVec3 f)
|
void SHAudioListenerComponent::SetForward(const SHVec3 f)
|
||||||
{
|
{
|
||||||
forward = f;
|
forward = f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SHAudioListenerComponent::SetUp(SHVec3 u)
|
void SHAudioListenerComponent::SetUp(const SHVec3 u)
|
||||||
{
|
{
|
||||||
up = u;
|
up = u;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,16 +24,15 @@ namespace SHADE
|
||||||
~SHAudioListenerComponent() = default;
|
~SHAudioListenerComponent() = default;
|
||||||
|
|
||||||
const SHVec3 GetPos() const;
|
const SHVec3 GetPos() const;
|
||||||
|
void SetPos(const SHVec3 p);
|
||||||
|
|
||||||
const SHVec3 GetVel() const;
|
const SHVec3 GetVel() const;
|
||||||
const SHVec3 GetForward() const;
|
const SHVec3 GetForward() const;
|
||||||
const SHVec3 GetUp() const;
|
const SHVec3 GetUp() const;
|
||||||
|
|
||||||
void SetPos(SHVec3 p);
|
void SetVel(const SHVec3 v);
|
||||||
void SetVel(SHVec3 v);
|
void SetForward(const SHVec3 f);
|
||||||
void SetForward(SHVec3 f);
|
void SetUp(const SHVec3 u);
|
||||||
void SetUp(SHVec3 u);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
SHVec3 pos{}, vel{}, forward{}, up{ 0.f,1.f,0.f };
|
SHVec3 pos{}, vel{}, forward{}, up{ 0.f,1.f,0.f };
|
||||||
|
|
|
@ -15,75 +15,39 @@
|
||||||
|
|
||||||
namespace SHADE
|
namespace SHADE
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @brief play the sound
|
* @brief play the sound
|
||||||
*
|
*
|
||||||
* @param index where the sound is in the index
|
* @param index where the sound is in the index
|
||||||
*/
|
*/
|
||||||
void SHAudioSourceComponent::PlaySoundSFX(EntityID id, bool loop, bool spatial, float min , float max )
|
void SHAudioSourceComponent::PlaySoundSFX(EntityID id, bool loop, bool spatial, float min , float max )
|
||||||
{
|
{
|
||||||
SHSystemManager::GetSystem<SHAudioSystem>()->PlaySFX(id, GetEID(),loop,spatial, min, max);
|
SHSystemManager::GetSystem<SHAudioSystem>()->PlaySFX(id, GetEID(),loop,spatial, min, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
//void SHAudioSourceComponent::PlayOneShot(const char* path, bool isSFX, bool spatial)
|
void SHAudioSourceComponent::PlaySoundBGM(EntityID id, bool loop, bool spatial, float min, float max)
|
||||||
//{
|
{
|
||||||
// auto AudioSystem = dynamic_cast<SHAudioSystem*>(SHSystemManager::GetSystem("Audio"));
|
SHSystemManager::GetSystem<SHAudioSystem>()->PlayBGM(id, GetEID(), loop, spatial, min, max);
|
||||||
// AudioSystem->PlayEventOnce(path, isSFX, spatial ? GetEID() : MAX_EID, spatial);
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
//void SHAudioSourceComponent::PlayEvent(const char* path, bool isSFX, bool spatial)
|
/**
|
||||||
//{
|
* @brief Stop the sound
|
||||||
// auto AudioSystem = dynamic_cast<SHAudioSystem*>(SHSystemManager::GetSystem("Audio"));
|
*
|
||||||
|
* @param index where the sound is in the index
|
||||||
|
*/
|
||||||
|
void SHAudioSourceComponent::StopSound(EntityID id)
|
||||||
|
{
|
||||||
|
SHSystemManager::GetSystem<SHAudioSystem>()->StopSound(id);
|
||||||
|
}
|
||||||
|
|
||||||
// auto guid = AudioSystem->GetEventGUID(path);
|
/**
|
||||||
// if (guid.has_value())
|
* @brief Mute the sound
|
||||||
// {
|
*
|
||||||
// if (FMOD::Studio::EventInstance* instance = AudioSystem->CreateEventInstance(guid.value()))
|
* @param index where the sound is in the index
|
||||||
// {
|
*/
|
||||||
// eventInstances.push_back(instance);
|
void SHAudioSourceComponent::SetMute(EntityID id, bool mute)
|
||||||
// AudioSystem->PlayEventInstance(instance, isSFX, GetEID(), spatial);
|
{
|
||||||
// }
|
SHSystemManager::GetSystem<SHAudioSystem>()->SetMute(id, mute);
|
||||||
// }
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
void SHAudioSourceComponent::PlaySoundBGM(EntityID id, bool loop, bool spatial, float min, float max)
|
|
||||||
{
|
|
||||||
SHSystemManager::GetSystem<SHAudioSystem>()->PlayBGM(id, GetEID(), loop, spatial, min, max);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Stop the sound
|
|
||||||
*
|
|
||||||
* @param index where the sound is in the index
|
|
||||||
*/
|
|
||||||
void SHAudioSourceComponent::StopSound(EntityID id)
|
|
||||||
{
|
|
||||||
SHSystemManager::GetSystem<SHAudioSystem>()->StopSound(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Mute the sound
|
|
||||||
*
|
|
||||||
* @param index where the sound is in the index
|
|
||||||
*/
|
|
||||||
void SHAudioSourceComponent::SetMute(EntityID id, bool mute)
|
|
||||||
{
|
|
||||||
SHSystemManager::GetSystem<SHAudioSystem>()->SetMute(id, mute);
|
|
||||||
}
|
|
||||||
|
|
||||||
//void SHAudioSourceComponent::PlayEventInstance(size_t index, bool isSFX, bool spatial)
|
|
||||||
//{
|
|
||||||
// if (index < eventInstances.size())
|
|
||||||
// {
|
|
||||||
// eventInstances[index]->start();
|
|
||||||
// dynamic_cast<SHAudioSystem*>(SHSystemManager::GetSystem("Audio"))->PlayEventInstance(eventInstances[index], isSFX, GetEID(), spatial);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//void SHAudioSourceComponent::StopEventInstance(size_t index)
|
|
||||||
//{
|
|
||||||
// if(index < eventInstances.size())
|
|
||||||
// eventInstances[index]->stop(FMOD_STUDIO_STOP_ALLOWFADEOUT);
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#include "SHpch.h"
|
#include "SHpch.h"
|
||||||
//#include "ECS_Base/System/SHSystemManager.h"
|
|
||||||
#include "SHAudioSystem.h"
|
#include "SHAudioSystem.h"
|
||||||
#include "Scene/SHSceneManager.h"
|
#include "Scene/SHSceneManager.h"
|
||||||
#include "ECS_Base/Managers/SHComponentManager.h"
|
#include "ECS_Base/Managers/SHComponentManager.h"
|
||||||
|
@ -10,8 +9,6 @@
|
||||||
|
|
||||||
#include "AudioSystem/SHAudioListenerComponent.h"
|
#include "AudioSystem/SHAudioListenerComponent.h"
|
||||||
#include "AudioSystem/SHAudioSourceComponent.h"
|
#include "AudioSystem/SHAudioSourceComponent.h"
|
||||||
//#include "ECS_Base/System/SHComponentManager.h"
|
|
||||||
//#include "Resource Manager/SHResourceManager.h"
|
|
||||||
#include "Math/Transform/SHTransformComponent.h"
|
#include "Math/Transform/SHTransformComponent.h"
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
#pragma warning(disable:26812) //disable warning about preference of enum class over enum as ImGuizmo uses enums
|
#pragma warning(disable:26812) //disable warning about preference of enum class over enum as ImGuizmo uses enums
|
||||||
|
@ -29,7 +26,7 @@ namespace SHADE
|
||||||
, masterGroup(nullptr)
|
, masterGroup(nullptr)
|
||||||
, audioChannels()
|
, audioChannels()
|
||||||
, result(FMOD_RESULT_FORCEINT)
|
, result(FMOD_RESULT_FORCEINT)
|
||||||
, bgmVolume(0.5F)
|
, bgmVolume(1.F)
|
||||||
, sfxVolume(1.F)
|
, sfxVolume(1.F)
|
||||||
, masterVolume(1.0F)
|
, masterVolume(1.0F)
|
||||||
, version(0)
|
, version(0)
|
||||||
|
|
Loading…
Reference in New Issue