69 bool discardPendingAsync =
true);
79 bool discardPendingAsync =
true);
93 std::shared_ptr<AsyncOperation>
loadSceneAsync(
const std::string& path,
95 bool discardPendingAsync =
true);
119 void changeScene(std::unique_ptr<Scene> nextScene);
185 std::string
resolvePath(
const std::string& nameOrPath)
const;
186 std::string
pathToName(
const std::string& path)
const;
200 const std::string& jsonContent,
LoadSceneMode
Determines whether loading a scene replaces or adds to the current set.
Definition SceneManagement.hpp:15
Coordinates entities and components, providing creation, removal, lookup, and views.
Definition Registry.hpp:30
Abstract base class representing a game scene, managing entity lifecycle and persistence.
Definition Scene.hpp:14
Manages a set of simultaneously loaded Scenes. Supports Single and Additive loading,...
Definition SceneManager.hpp:54
void flushPendingAsyncMerges()
Definition SceneManager.cpp:327
std::vector< PendingAsyncMerge > pendingAsyncMerges
Definition SceneManager.hpp:177
void changeScene(std::unique_ptr< Scene > nextScene)
Direct scene swap (used by editor and legacy code). Unloads all current scenes and activates nextScen...
Definition SceneManager.cpp:297
void unloadAllScenes()
Definition SceneManager.cpp:127
Registry * registry
Definition SceneManager.hpp:164
std::mutex activeAsyncMutex
Definition SceneManager.hpp:182
void setContext(Registry *reg, VulkanRenderer *rend)
Provide registry and renderer pointers needed for scene construction.
Definition SceneManager.cpp:58
void cancelAllAsyncOps()
Definition SceneManager.cpp:81
std::vector< PendingLoad > pendingLoads
Definition SceneManager.hpp:173
std::vector< std::shared_ptr< AsyncOperation > > activeAsyncOps
Definition SceneManager.hpp:181
Scene * getCurrentScene() const
Returns the first loaded scene (oldest), or nullptr. Backward-compatible.
Definition SceneManager.cpp:376
VulkanRenderer * renderer
Definition SceneManager.hpp:165
std::function< void(const SceneInfo &)> onSceneUnloadedCallback
Definition SceneManager.hpp:141
void fireSceneLoaded(const SceneInfo &info)
Definition SceneManager.cpp:67
std::mutex asyncMergeMutex
Definition SceneManager.hpp:178
bool hasActiveAsyncLoads() const
True if any async loads are currently in flight.
Definition SceneManager.cpp:97
std::string pathToName(const std::string &path) const
Definition SceneManager.cpp:40
std::vector< SceneInfo > getLoadedSceneInfos() const
Returns all currently loaded scene entries.
Definition SceneManager.cpp:381
SceneInfo spawnSceneFromContent(const std::string &path, const std::string &jsonContent, LoadSceneMode mode)
Definition SceneManager.cpp:163
std::shared_ptr< AsyncOperation > loadSceneAsync(const std::string &path, LoadSceneMode mode, bool discardPendingAsync=true)
Start an async scene load. File I/O runs on a JobSystem worker; entity spawning is merged on the main...
Definition SceneManager.cpp:226
void unloadScene(const std::string &path)
Immediately queue an unload for the scene with the given path.
Definition SceneManager.cpp:279
std::function< void(const SceneInfo &)> onSceneLoadedCallback
Definition SceneManager.hpp:140
SceneInfo spawnScene(const std::string &path, LoadSceneMode mode)
Definition SceneManager.cpp:141
std::vector< LoadedSceneEntry > loadedScenes
Definition SceneManager.hpp:170
void unloadSceneByPath(const std::string &path)
Definition SceneManager.cpp:109
SceneInfo getSceneInfo(int id) const
Returns info for a scene by id, or invalid SceneInfo (id=-1) if not found.
Definition SceneManager.cpp:389
void fireSceneUnloaded(const SceneInfo &info)
Definition SceneManager.cpp:72
void flushPendingUnloads()
Definition SceneManager.cpp:313
void flushPendingLoads()
Definition SceneManager.cpp:320
std::vector< std::string > pendingUnloadPaths
Definition SceneManager.hpp:174
std::atomic< int > nextSceneId
Definition SceneManager.hpp:167
std::string resolvePath(const std::string &nameOrPath) const
Resolves a name-or-path string to a canonical scene file path. "level1" -> "assets/scenes/level1....
Definition SceneManager.cpp:30
void update(float dt)
Called each frame. Flushes all pending loads, unloads, and async merges.
Definition SceneManager.cpp:362
int findSceneIdByPath(const std::string &path) const
Definition SceneManager.cpp:44
void loadScene(const std::string &path, LoadSceneMode mode, bool discardPendingAsync=true)
Queue a scene to load next frame by path.
Definition SceneManager.cpp:200
Manages core Vulkan pipeline states, device interaction, frames, buffers, and command submissions.
Definition VulkanRenderer.hpp:127
Internal record linking a Scene instance with its metadata.
Definition SceneManager.hpp:19
std::string path
Definition SceneManager.hpp:22
std::unique_ptr< Scene > scene
Definition SceneManager.hpp:23
std::string name
Definition SceneManager.hpp:21
A completed async I/O load ready to be merged onto the main thread.
Definition SceneManager.hpp:41
std::string path
Definition SceneManager.hpp:42
std::shared_ptr< AsyncOperation > asyncOp
Definition SceneManager.hpp:45
std::string jsonContent
Raw JSON read from disk on background thread.
Definition SceneManager.hpp:43
LoadSceneMode mode
Definition SceneManager.hpp:44
A queued synchronous or async scene load request.
Definition SceneManager.hpp:30
std::string path
Definition SceneManager.hpp:31
std::shared_ptr< AsyncOperation > asyncOp
Non-null for async loads.
Definition SceneManager.hpp:34
bool discardPendingAsync
Definition SceneManager.hpp:33
LoadSceneMode mode
Definition SceneManager.hpp:32
Lightweight descriptor for a known or loaded scene.
Definition SceneManagement.hpp:24