Skip to content

Commit

Permalink
Exclude WAAPI Interface Registration on Unsupported Platforms
Browse files Browse the repository at this point in the history
Update the code to prevent the registration of the WAAPI interface to ClassDB on iOS, Android, and Linux platforms. This modification ensures that the interface is only registered on supported platforms,
  • Loading branch information
alessandrofama committed Jul 15, 2023
1 parent 6b08ad4 commit 90549f5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions addons/Wwise/native/src/register_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ static AkUtils* ak_utils;

void register_wwise_types(ModuleInitializationLevel p_level)
{
#if !defined(AK_IOS) && !defined(AK_ANDROID) && !defined(AK_LINUX)
if (p_level == MODULE_INITIALIZATION_LEVEL_EDITOR)
{
ClassDB::register_class<Waapi>();
waapi_module = memnew(Waapi);
Engine::get_singleton()->register_singleton("Waapi", Waapi::get_singleton());
}
#endif

if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE)
{
Expand Down Expand Up @@ -57,6 +59,14 @@ void unregister_wwise_types(ModuleInitializationLevel p_level)
memdelete(wwise_settings);
memdelete(ak_utils);
}

#if !defined(AK_IOS) && !defined(AK_ANDROID) && !defined(AK_LINUX)
if (p_level == MODULE_INITIALIZATION_LEVEL_EDITOR)
{
Engine::get_singleton()->unregister_singleton("Waapi");
memdelete(waapi_module);
}
#endif
}

extern "C"
Expand Down

0 comments on commit 90549f5

Please sign in to comment.