Skip to content
This repository was archived by the owner on Jan 18, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions src/Subsystems/AudioSubsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,6 @@
void engine::AudioSubsystem::Update()
{
auto objects = spic::GameObject::All();
auto currentScene = spic::Engine::Instance().PeekScene();
if (_previousScene && _previousScene != currentScene)
{
for (const auto& gameObject: _previousScene->Contents())
{
auto found = std::find(objects.begin(), objects.end(), gameObject);
if (found == objects.end())
{
for (const auto& audioSource: gameObject->GetComponents<spic::AudioSource>())
{
if (audioSource->PlayingInScene)
audioSource->Stop();
}
}
}
}
_previousScene = currentScene;

for (const auto& object: objects)
{
Expand Down
3 changes: 0 additions & 3 deletions src/Subsystems/AudioSubsystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ namespace engine
*/
class AudioSubsystem : public ISubsystem
{
private:
std::shared_ptr<spic::Scene> _previousScene;

public:
/**
* @brief Constructs a new instance of a AudioSubsystem.
Expand Down