update macos/ios to Filament v1.51.2

This commit is contained in:
Nick Fisher
2024-04-20 13:46:58 +08:00
parent 15882891e2
commit ea04e94c1f
156 changed files with 5394 additions and 5884 deletions

View File

@@ -24,7 +24,6 @@
#include <utils/SingleInstanceComponentManager.h>
#include <stddef.h>
#include <stdint.h>
namespace utils {
@@ -48,7 +47,7 @@ class EntityManager;
* printf("%s\n", names->getName(names->getInstance(myEntity));
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
class UTILS_PUBLIC NameComponentManager : public SingleInstanceComponentManager<utils::CString> {
class UTILS_PUBLIC NameComponentManager : private SingleInstanceComponentManager<utils::CString> {
public:
using Instance = EntityInstance<NameComponentManager>;
@@ -75,15 +74,6 @@ public:
return { SingleInstanceComponentManager::getInstance(e) };
}
/*! \cond PRIVATE */
// these are implemented in SingleInstanceComponentManager<>, but we need to
// reimplement them in each manager, to ensure they are generated in an implementation file
// for backward binary compatibility reasons.
size_t getComponentCount() const noexcept;
Entity const* getEntities() const noexcept;
void gc(const EntityManager& em, size_t ratio = 4) noexcept;
/*! \endcond */
/**
* Adds a name component to the given entity if it doesn't already exist.
*/
@@ -105,6 +95,12 @@ public:
* @return pointer to the copy that was made during setName()
*/
const char* getName(Instance instance) const noexcept;
void gc(EntityManager& em) noexcept {
SingleInstanceComponentManager<utils::CString>::gc(em, [this](Entity e) {
removeComponent(e);
});
}
};
} // namespace utils