remove audiosourcecomponent
This commit is contained in:
parent
65a6014b1c
commit
d0d796781b
|
@ -34,7 +34,8 @@ project "SHADE_Application"
|
|||
"%{IncludeDir.VULKAN}/include",
|
||||
"%{IncludeDir.VMA}/include",
|
||||
"%{IncludeDir.VULKAN}/Source/SPIRV-Reflect",
|
||||
"%{IncludeDir.fmod}/include"
|
||||
"%{IncludeDir.fmod}/include",
|
||||
"%{IncludeDir.RTTR}\\include"
|
||||
}
|
||||
|
||||
externalwarnings "Off"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "Math/Transform/SHTransformSystem.h"
|
||||
#include "Input/SHInputManagerSystem.h"
|
||||
#include "AudioSystem/SHAudioSystem.h"
|
||||
#include "AudioSystem/SHAudioSourceComponent.h"
|
||||
#include "AudioSystem/SHAudioListenerComponent.h"
|
||||
|
||||
#include "Scenes/SBTestScene.h"
|
||||
|
@ -81,7 +80,7 @@ namespace Sandbox
|
|||
SHADE::SHSystemManager::RegisterRoutine<SHADE::SHInputManagerSystem, SHADE::SHInputManagerSystem::InputManagerRoutine>();
|
||||
|
||||
SHADE::SHSystemManager::RegisterRoutine<SHADE::SHAudioSystem, SHADE::SHAudioSystem::AudioRoutine>();
|
||||
SHADE::SHComponentManager::CreateComponentSparseSet<SHADE::SHAudioSourceComponent>();
|
||||
//SHADE::SHComponentManager::CreateComponentSparseSet<SHADE::SHAudioSourceComponent>();
|
||||
SHADE::SHComponentManager::CreateComponentSparseSet<SHADE::SHAudioListenerComponent>();
|
||||
|
||||
// Set up graphics system and windows
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#include "SHpch.h"
|
||||
#include "SHAudioListenerComponent.h"
|
||||
//#include "ECS_Base/System/SHSystemManager.h"
|
||||
#include "ECS_Base/Managers/SHSystemManager.h"
|
||||
|
||||
namespace SHADE
|
||||
{
|
||||
|
@ -34,22 +34,22 @@ namespace SHADE
|
|||
return up;
|
||||
}
|
||||
|
||||
void SHAudioListenerComponent::SetPos(SHVec3 p)
|
||||
void SHAudioListenerComponent::SetPos(const SHVec3 p)
|
||||
{
|
||||
pos = p;
|
||||
}
|
||||
|
||||
void SHAudioListenerComponent::SetVel(SHVec3 v)
|
||||
void SHAudioListenerComponent::SetVel(const SHVec3 v)
|
||||
{
|
||||
vel = v;
|
||||
}
|
||||
|
||||
void SHAudioListenerComponent::SetForward(SHVec3 f)
|
||||
void SHAudioListenerComponent::SetForward(const SHVec3 f)
|
||||
{
|
||||
forward = f;
|
||||
}
|
||||
|
||||
void SHAudioListenerComponent::SetUp(SHVec3 u)
|
||||
void SHAudioListenerComponent::SetUp(const SHVec3 u)
|
||||
{
|
||||
up = u;
|
||||
}
|
||||
|
|
|
@ -24,16 +24,15 @@ namespace SHADE
|
|||
~SHAudioListenerComponent() = default;
|
||||
|
||||
const SHVec3 GetPos() const;
|
||||
void SetPos(const SHVec3 p);
|
||||
|
||||
const SHVec3 GetVel() const;
|
||||
const SHVec3 GetForward() const;
|
||||
const SHVec3 GetUp() const;
|
||||
|
||||
void SetPos(SHVec3 p);
|
||||
void SetVel(SHVec3 v);
|
||||
void SetForward(SHVec3 f);
|
||||
void SetUp(SHVec3 u);
|
||||
|
||||
|
||||
void SetVel(const SHVec3 v);
|
||||
void SetForward(const SHVec3 f);
|
||||
void SetUp(const SHVec3 u);
|
||||
|
||||
private:
|
||||
SHVec3 pos{}, vel{}, forward{}, up{ 0.f,1.f,0.f };
|
||||
|
|
|
@ -25,27 +25,6 @@ namespace SHADE
|
|||
SHSystemManager::GetSystem<SHAudioSystem>()->PlaySFX(id, GetEID(),loop,spatial, min, max);
|
||||
}
|
||||
|
||||
//void SHAudioSourceComponent::PlayOneShot(const char* path, bool isSFX, bool spatial)
|
||||
//{
|
||||
// auto AudioSystem = dynamic_cast<SHAudioSystem*>(SHSystemManager::GetSystem("Audio"));
|
||||
// AudioSystem->PlayEventOnce(path, isSFX, spatial ? GetEID() : MAX_EID, spatial);
|
||||
//}
|
||||
|
||||
//void SHAudioSourceComponent::PlayEvent(const char* path, bool isSFX, bool spatial)
|
||||
//{
|
||||
// auto AudioSystem = dynamic_cast<SHAudioSystem*>(SHSystemManager::GetSystem("Audio"));
|
||||
|
||||
// auto guid = AudioSystem->GetEventGUID(path);
|
||||
// if (guid.has_value())
|
||||
// {
|
||||
// if (FMOD::Studio::EventInstance* instance = AudioSystem->CreateEventInstance(guid.value()))
|
||||
// {
|
||||
// eventInstances.push_back(instance);
|
||||
// AudioSystem->PlayEventInstance(instance, isSFX, GetEID(), spatial);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
void SHAudioSourceComponent::PlaySoundBGM(EntityID id, bool loop, bool spatial, float min, float max)
|
||||
{
|
||||
SHSystemManager::GetSystem<SHAudioSystem>()->PlayBGM(id, GetEID(), loop, spatial, min, max);
|
||||
|
@ -70,20 +49,5 @@ namespace SHADE
|
|||
{
|
||||
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 "ECS_Base/System/SHSystemManager.h"
|
||||
#include "SHAudioSystem.h"
|
||||
#include "Scene/SHSceneManager.h"
|
||||
#include "ECS_Base/Managers/SHComponentManager.h"
|
||||
|
@ -10,8 +9,6 @@
|
|||
|
||||
#include "AudioSystem/SHAudioListenerComponent.h"
|
||||
#include "AudioSystem/SHAudioSourceComponent.h"
|
||||
//#include "ECS_Base/System/SHComponentManager.h"
|
||||
//#include "Resource Manager/SHResourceManager.h"
|
||||
#include "Math/Transform/SHTransformComponent.h"
|
||||
#pragma warning(push)
|
||||
#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)
|
||||
, audioChannels()
|
||||
, result(FMOD_RESULT_FORCEINT)
|
||||
, bgmVolume(0.5F)
|
||||
, bgmVolume(1.F)
|
||||
, sfxVolume(1.F)
|
||||
, masterVolume(1.0F)
|
||||
, version(0)
|
||||
|
|
Loading…
Reference in New Issue