Fix missing audio on OpenAL when changing active device

#3621
This commit is contained in:
Wojtek Figat
2026-02-04 23:43:06 +01:00
parent f733611213
commit 7e9ee0610a
5 changed files with 86 additions and 11 deletions

View File

@@ -473,6 +473,19 @@ public:
/// <returns>Found actors list.</returns>
API_FUNCTION() static Array<Actor*> GetActors(API_PARAM(Attributes="TypeReference(typeof(Actor))") const MClass* type, bool activeOnly = false);
/// <summary>
/// Finds all the actors of the given type in all the loaded scenes.
/// </summary>
/// <typeparam name="T">Type of the object.</typeparam>
/// <param name="activeOnly">Finds only active actors.</param>
/// <returns>Found actors list.</returns>
template<typename T>
static Array<T*> GetActors(bool activeOnly = false)
{
Array<Actor*> actors = GetActors(T::GetStaticClass(), activeOnly);
return *(Array<T*>*)&actors;
}
/// <summary>
/// Finds all the scripts of the given type in an actor or all the loaded scenes.
/// </summary>