summaryrefslogtreecommitdiffstats
path: root/scene/3d/audio_stream_player_3d.cpp
diff options
context:
space:
mode:
authorA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-01-09 15:01:12 +0100
committerA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-02-13 15:37:09 +0100
commitd8b29efe666202443a019532eb68f560041abeb5 (patch)
treeabe805edd7548423fc40ee9e0b621c82e947a742 /scene/3d/audio_stream_player_3d.cpp
parentdfe226b93346c208787728eceecc2c64d81a9553 (diff)
downloadredot-engine-d8b29efe666202443a019532eb68f560041abeb5.tar.gz
Fix member names of `AudioFrame` to match extension
Diffstat (limited to 'scene/3d/audio_stream_player_3d.cpp')
-rw-r--r--scene/3d/audio_stream_player_3d.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/scene/3d/audio_stream_player_3d.cpp b/scene/3d/audio_stream_player_3d.cpp
index 1fe6cb718c..2bb376c9ab 100644
--- a/scene/3d/audio_stream_player_3d.cpp
+++ b/scene/3d/audio_stream_player_3d.cpp
@@ -123,20 +123,20 @@ void AudioStreamPlayer3D::_calc_output_vol(const Vector3 &source_dir, real_t tig
switch (AudioServer::get_singleton()->get_speaker_mode()) {
case AudioServer::SPEAKER_SURROUND_71:
- output.write[3].l = volumes[5]; // side-left
- output.write[3].r = volumes[6]; // side-right
+ output.write[3].left = volumes[5]; // side-left
+ output.write[3].right = volumes[6]; // side-right
[[fallthrough]];
case AudioServer::SPEAKER_SURROUND_51:
- output.write[2].l = volumes[3]; // rear-left
- output.write[2].r = volumes[4]; // rear-right
+ output.write[2].left = volumes[3]; // rear-left
+ output.write[2].right = volumes[4]; // rear-right
[[fallthrough]];
case AudioServer::SPEAKER_SURROUND_31:
- output.write[1].r = 1.0; // LFE - always full power
- output.write[1].l = volumes[2]; // center
+ output.write[1].right = 1.0; // LFE - always full power
+ output.write[1].left = volumes[2]; // center
[[fallthrough]];
case AudioServer::SPEAKER_MODE_STEREO:
- output.write[0].r = volumes[1]; // front-right
- output.write[0].l = volumes[0]; // front-left
+ output.write[0].right = volumes[1]; // front-right
+ output.write[0].left = volumes[0]; // front-left
break;
}
}
@@ -168,25 +168,25 @@ void AudioStreamPlayer3D::_calc_reverb_vol(Area3D *area, Vector3 listener_area_p
// Stereo pair.
float c = rev_pos.x * 0.5 + 0.5;
- reverb_vol.write[0].l = 1.0 - c;
- reverb_vol.write[0].r = c;
+ reverb_vol.write[0].left = 1.0 - c;
+ reverb_vol.write[0].right = c;
if (channel_count >= 3) {
// Center pair + Side pair
float xl = Vector3(-1, 0, -1).normalized().dot(rev_pos) * 0.5 + 0.5;
float xr = Vector3(1, 0, -1).normalized().dot(rev_pos) * 0.5 + 0.5;
- reverb_vol.write[1].l = xl;
- reverb_vol.write[1].r = xr;
- reverb_vol.write[2].l = 1.0 - xr;
- reverb_vol.write[2].r = 1.0 - xl;
+ reverb_vol.write[1].left = xl;
+ reverb_vol.write[1].right = xr;
+ reverb_vol.write[2].left = 1.0 - xr;
+ reverb_vol.write[2].right = 1.0 - xl;
}
if (channel_count >= 4) {
// Rear pair
// FIXME: Not sure what math should be done here
- reverb_vol.write[3].l = 1.0 - c;
- reverb_vol.write[3].r = c;
+ reverb_vol.write[3].left = 1.0 - c;
+ reverb_vol.write[3].right = c;
}
for (int i = 0; i < channel_count; i++) {