Skip to content

Commit

Permalink
Fixes for 4.3 compat.
Browse files Browse the repository at this point in the history
  • Loading branch information
stechyo committed Aug 18, 2024
1 parent 4660cad commit 81a7879
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[submodule "src/lib/godot-cpp"]
path = src/lib/godot-cpp
url = https://github.com/stechyo/godot-cpp
branch = gdext/steam-audio
branch = 4.3-steam-audio
[submodule "src/lib/steamaudio"]
path = src/lib/steamaudio
url = https://github.com/ValveSoftware/steam-audio
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ compatibility_minimum = 4.2

[libraries]

linux.x86_64.debug ="res://addons/godot-steam-audio/bin/libgodot-steam-audio.linux.template_debug.x86_64.so"
linux.x86_64.debug ="res://addons/godot-steam-audio/bin/libgodot-steam-audio.linux.template_debug.dev.x86_64.so"
linux.x86_64.release = "res://addons/godot-steam-audio/bin/libgodot-steam-audio.linux.template_release.x86_64.so"
linux.debug.arm64 = "res://addons/godot-steam-audio/bin/libgodot-steam-audio.linux.template_debug.arm64.so"
linux.release.arm64 = "res://addons/godot-steam-audio/bin/libgodot-steam-audio.linux.template_release.arm64.so"
Expand Down
22 changes: 11 additions & 11 deletions project/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,50 @@ config_version=5

config/name="Godot-SteamAudio Demo"
run/main_scene="res://scenes/demo.tscn"
config/features=PackedStringArray("4.2")
config/features=PackedStringArray("4.3")
config/icon="res://icon.svg"

[input]

ui_left={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194319,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194319,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
]
}
ui_right={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194321,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194321,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
]
}
ui_up={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194320,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194320,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
]
}
ui_down={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194322,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194322,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
]
}
toggle_door={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":49,"key_label":0,"unicode":49,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":49,"key_label":0,"unicode":49,"location":0,"echo":false,"script":null)
]
}
move_door={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":50,"key_label":0,"unicode":50,"echo":false,"script":null)
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":50,"key_label":0,"unicode":50,"location":0,"echo":false,"script":null)
]
}
3 changes: 1 addition & 2 deletions project/scenes/demo.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ material = SubResource("StandardMaterial3D_dg8l6")
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_w72gs"]
streams_count = 2
stream_0/stream = ExtResource("5_00edw")
stream_0/weight = 1.0
stream_1/stream = ExtResource("6_dw5dv")
stream_1/weight = 1.0

[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_pyn86"]
albedo_color = Color(0.976471, 0.133333, 0.286275, 1)
Expand Down Expand Up @@ -178,6 +176,7 @@ environment = SubResource("Environment_gdnyc")
camera_attributes = SubResource("CameraAttributesPhysical_v0408")

[node name="SteamAudioConfig" type="SteamAudioConfig" parent="."]
global_log_level = 0

[node name="Ground" type="MeshInstance3D" parent="."]
transform = Transform3D(200, 0, 0, 0, 200, 0, 0, 0, 200, 0, 0, 0)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/godot-cpp
Submodule godot-cpp updated 138 files
2 changes: 1 addition & 1 deletion src/lib/steamaudio
Submodule steamaudio updated 43 files
+1 −1 README.md
+2 −5 core/CMakeLists.txt
+1 −1 core/README.md
+5 −2 core/build/dependencies.json
+1 −1 core/doc/build-instructions.rst
+0 −2 core/doc/getting-started.rst
+7 −9 core/src/core/CMakeLists.txt
+1,310 −0 core/src/core/api_internal.cpp
+1 −1 core/src/core/api_validation_layer.cpp
+17 −17 core/src/core/avx_float8.h
+3 −3 core/src/core/delay.h
+8 −72 core/src/core/embree_scene.cpp
+0 −6 core/src/core/float8.h
+2 −2 core/src/core/float8_delay.cpp
+3 −3 core/src/core/float8_iir.cpp
+3 −3 core/src/core/float8_reverb_effect.cpp
+4 −4 core/src/core/iir.h
+0 −10 core/src/core/instanced_mesh.h
+0 −4 core/src/core/overlap_save_convolution_effect.cpp
+7 −13 core/src/core/phonon.h
+3 −3 core/src/core/phonon_version.h.in
+2 −2 core/src/core/reverb_effect.h
+27 −36 core/src/core/scene.cpp
+5 −10 core/src/core/simulation_manager.cpp
+1 −1 core/src/core/simulation_manager.h
+1 −1 fmod/CMakeLists.txt
+7 −13 fmod/include/phonon/phonon.h
+4 −4 fmod/include/phonon/phonon_version.h
+1 −1 fmod/setup.py
+1 −1 unity/CMakeLists.txt
+7 −13 unity/include/phonon/phonon.h
+4 −4 unity/include/phonon/phonon_version.h
+1 −1 unity/setup.py
+3 −12 unity/src/project/SteamAudioUnity/Assets/Plugins/SteamAudio/Scripts/Runtime/SteamAudioManager.cs
+1 −1 unreal/CMakeLists.txt
+1 −1 unreal/setup.py
+0 −1 unreal/src/SteamAudioUnreal/Plugins/SteamAudio/Source/SteamAudio/Private/SteamAudioGeometryComponent.cpp
+2 −2 unreal/src/SteamAudioUnreal/Plugins/SteamAudio/Source/SteamAudio/Private/SteamAudioSourceComponent.cpp
+1 −1 unreal/src/SteamAudioUnreal/Plugins/SteamAudio/Source/SteamAudio/Public/SteamAudioSourceComponent.h
+7 −13 unreal/src/SteamAudioUnreal/Plugins/SteamAudio/Source/SteamAudioSDK/include/phonon.h
+4 −4 unreal/src/SteamAudioUnreal/Plugins/SteamAudio/Source/SteamAudioSDK/include/phonon_version.h
+1 −1 unreal/src/SteamAudioUnreal/Plugins/SteamAudio/SteamAudio.uplugin
+1 −1 unreal/src/SteamAudioUnreal/Plugins/SteamAudioFMODStudio/SteamAudioFMODStudio.uplugin
4 changes: 3 additions & 1 deletion src/register_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "config.hpp"
#include "geometry.hpp"
#include "geometry_dynamic.hpp"
#include "godot_cpp/core/memory.hpp"
#include "listener.hpp"
#include "material.hpp"
#include "player.hpp"
Expand All @@ -16,6 +17,7 @@

using namespace godot;


void init_ext(ModuleInitializationLevel p_level) {
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE && p_level != MODULE_INITIALIZATION_LEVEL_SERVERS) {
return;
Expand All @@ -34,7 +36,7 @@ void init_ext(ModuleInitializationLevel p_level) {

if (p_level == MODULE_INITIALIZATION_LEVEL_SERVERS) {
GDREGISTER_CLASS(SteamAudioServer);
auto sa = memnew(SteamAudioServer);
auto srv = memnew(SteamAudioServer);
}
}

Expand Down
7 changes: 5 additions & 2 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "godot_cpp/classes/engine.hpp"
#include "godot_cpp/classes/project_settings.hpp"
#include "godot_cpp/core/class_db.hpp"
#include "godot_cpp/core/memory.hpp"
#include "godot_cpp/variant/callable_method_pointer.hpp"
#include "phonon.h"
#include "server_init.hpp"
Expand Down Expand Up @@ -208,7 +209,7 @@ GlobalSteamAudioState *SteamAudioServer::get_global_state(bool should_init) {
}

void SteamAudioServer::start_refl_sim() {
refl_thread.start(callable_mp(this, &SteamAudioServer::run_refl_sim));
refl_thread->start(callable_mp(this, &SteamAudioServer::run_refl_sim));
}

void SteamAudioServer::run_refl_sim() {
Expand Down Expand Up @@ -290,11 +291,13 @@ SteamAudioServer::SteamAudioServer() {
is_refl_thread_processing.store(false);
is_running.store(true);
local_states_have_changed.store(false);
refl_thread = memnew(Thread);
}

SteamAudioServer::~SteamAudioServer() {
is_running.store(false);
refl_thread.wait_to_finish();
refl_thread->wait_to_finish();
memdelete(refl_thread);

if (!self->is_global_state_init.load()) {
return;
Expand Down
4 changes: 2 additions & 2 deletions src/server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ class SteamAudioServer : public Object {
std::vector<IPLStaticMesh> dynamic_meshes_to_add;

// TODO: allow for multiple
SteamAudioListener *listener;
SteamAudioListener *listener = nullptr;

void init_scene(IPLSceneSettings *scene_cfg);
void start_refl_sim();
void run_refl_sim();
Thread refl_thread = Thread();
Thread *refl_thread = nullptr;

protected:
static void _bind_methods();
Expand Down
2 changes: 1 addition & 1 deletion src/stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int32_t SteamAudioStreamPlayback::_mix(AudioFrame *buffer, double rate_scale, in
return frames;
}

PackedVector2Array mixed_frames = stream_playback->get_raw_audio(rate_scale, frames);
PackedVector2Array mixed_frames = stream_playback->mix_audio(rate_scale, frames);
frames = int(mixed_frames.size());

for (int i = 0; i < frames; i++) {
Expand Down

0 comments on commit 81a7879

Please sign in to comment.