diff options
author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-07-17 00:48:45 +0200 |
---|---|---|
committer | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-07-22 02:11:32 +0200 |
commit | 458da8a94877677f086f06cdeecf959ec4283a33 (patch) | |
tree | 583166d77602ad90a0d552f37de8729ad80fd6c1 /src/audio_core/renderer/nodes/edge_matrix.cpp | |
parent | Merge pull request #8598 from Link4565/recv-dontwait (diff) | |
download | yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.gz yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.bz2 yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.lz yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.xz yuzu-458da8a94877677f086f06cdeecf959ec4283a33.tar.zst yuzu-458da8a94877677f086f06cdeecf959ec4283a33.zip |
Diffstat (limited to '')
-rw-r--r-- | src/audio_core/renderer/nodes/edge_matrix.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/audio_core/renderer/nodes/edge_matrix.cpp b/src/audio_core/renderer/nodes/edge_matrix.cpp new file mode 100644 index 000000000..5573f33b9 --- /dev/null +++ b/src/audio_core/renderer/nodes/edge_matrix.cpp @@ -0,0 +1,38 @@ +// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "audio_core/renderer/nodes/edge_matrix.h" + +namespace AudioCore::AudioRenderer { + +void EdgeMatrix::Initialize([[maybe_unused]] std::span<u8> buffer, + [[maybe_unused]] const u64 node_buffer_size, const u32 count_) { + count = count_; + edges.buffer.resize(count_ * count_); + edges.size = count_ * count_; + edges.reset(); +} + +bool EdgeMatrix::Connected(const u32 id, const u32 destination_id) const { + return edges.buffer[count * id + destination_id]; +} + +void EdgeMatrix::Connect(const u32 id, const u32 destination_id) { + edges.buffer[count * id + destination_id] = true; +} + +void EdgeMatrix::Disconnect(const u32 id, const u32 destination_id) { + edges.buffer[count * id + destination_id] = false; +} + +void EdgeMatrix::RemoveEdges(const u32 id) { + for (u32 dest = 0; dest < count; dest++) { + Disconnect(id, dest); + } +} + +u32 EdgeMatrix::GetNodeCount() const { + return count; +} + +} // namespace AudioCore::AudioRenderer |