35 : _parentProject(parentMgr)
45 tempScenes.insert(eastl::cend(tempScenes),
50 for (
const std::shared_ptr<Scene>& scene : tempScenes)
74 _activeScene = &scene;
87 Scene_ptr ret =
nullptr;
92 if (scene->resourceName().compare(sceneEntry.
_name) == 0)
105 ret = creationFunc(context,
parent, sceneEntry );
109 ret = std::make_shared<Scene>(context,
parent, sceneEntry );
129 if (targetGUID != -1)
134 if (targetGUID != defaultGUID)
136 if (targetGUID == activeGUID && defaultGUID != 0)
147 erase_if(
_createdScenes, [&targetGUID](
const auto& s)
noexcept {
return s->getGUID() == targetGUID; });
160 scenes.push_back(it.second);
165 eastl::sort(begin(scenes),
static bool unloadScene(Divide::Project &project, Scene *scene)
FORCE_INLINE I64 getGUID() const noexcept
void setActiveScene(Scene *scene)
bool deleteScene(I64 targetGUID)
bool defaultSceneActive() const noexcept
Scene * defaultScene() const noexcept
vector< Str< 256 > > customCodeScenes(bool sorted) const
Scene * getOrCreateScene(PlatformContext &context, Project &parent, const SceneEntry &sceneEntry, bool &foundInCache)
Scene * activeScene() const noexcept
ScenePool(Project &parentProject)
vector< Scene_ptr > _createdScenes
void registerSceneFactory(const char *name, const ScenePtrFactory &factoryFunc)
static SceneFactoryMap & sceneFactoryMap()
std::unordered_map< U64, ScenePtrFactory > SceneFactoryMap
std::unordered_map< U64, Str< 256 > > SceneNameMap
static SceneNameMap & sceneNameMap()
std::function< std::shared_ptr< Scene >(PlatformContext &context, Project &parent, const SceneEntry &name)> ScenePtrFactory
Handle console commands that start with a forward slash.
std::lock_guard< mutex > LockGuard
eastl::vector< Type > vector
std::shared_lock< mutex > SharedLock
constexpr U64 _ID(const char *const str, const U64 value=val_64_const) noexcept