|
| | Scene () |
| | ~Scene () |
| Object * | Instantiate (Scene *targetScene) |
| | Adds a copy of this scene's objects to targetScene.
|
| Object * | Instantiate (Scene *targetScene, float x, float y) |
| | Instantiate(targetScene), with the root object placed at (x, y).
|
| void | AddObject (Object *obj) |
| void | RemoveObject (Object *obj) |
| const std::vector< Object * > & | GetObjects () const |
| const std::vector< Component * > & | GetActiveComponents () |
| void | InvalidateComponentsCache () |
| Object * | CreateDekiObject (const std::string &name="DekiObject") |
| void | DestroyDekiObject (Object *dekiObject) |
| Object * | FindDekiObject (const std::string &name) |
| Object * | FindDekiObject (uint32_t id) |
| bool | LoadData (const uint8_t *data, size_t size) |
| void | InsertObjectAt (Object *obj, size_t index) |
| int | GetObjectIndex (Object *obj) const |
| bool | SaveToFile (const std::string &filePath) |
| bool | LoadFromFile (const std::string &filePath) |
| std::string | SaveToJsonString () |
| bool | LoadFromJsonString (const std::string &jsonStr) |
| Object * | DuplicateObject (const Object *source) |
| bool | ExpandInstance (Object *instanceObj) |
| void | CollapseInstance (Object *instanceObj) |
| void | ApplyOverrides (Object *instanceObj, const nlohmann::json &overrides) |
| void | CollectOverrides (const Object *instanceRoot, const Object *obj, nlohmann::json &overrides) const |
| bool | TryCollectOverrides (const Object *instanceRoot, const Object *obj, nlohmann::json &overrides) const |
| | CollectOverrides, telling whether there was a source to compare with.
|
| void | SetOnObjectsAboutToBeDestroyed (OnObjectsAboutToBeDestroyedFn fn) |
| | Out of line: the callback lives in a side table in Scene.cpp, not in a member, so sizeof(Scene) does not depend on DEKI_EDITOR and embedded targets do not carry a 32-byte std::function they never call.
|
| const std::string & | GetName () const |
| void | SetName (const std::string &sceneName) |
| bool | IsLoaded () const |
|
| static Scene * | Load (const char *path, bool cache=false) |
| | Loads a scene through AssetManager.
|
| static Scene * | LoadInternal (const char *path) |
| | Loads a compiled .scene (binary MessagePack) from a resolved filesystem path, or returns nullptr.
|
| static Scene * | LoadFromMemory (const uint8_t *data, size_t size) |
| | Loads a scene from compiled bytes in memory, or returns nullptr.
|
| static std::vector< std::pair< std::string, std::string > > | CollectUnknownProperties () |
| | Property keys found in a scene file that no component's current metadata knows, as {component type name, key}.
|
| static void | ClearUnknownProperties () |
| | Forgets everything collected so far, so a check can cover only the scenes it is about to load.
|
| static std::vector< std::pair< std::string, std::string > > | CollectLegacyProperties () |
| | Property keys read through a DEKI_RENAMED_FROM alias since the last clear, as {component type name, old key}.
|
| static nlohmann::json | ComponentPropertiesToJson (const Component *comp, const ComponentMeta &meta) |
| | Every reflected property of comp (its base class's first, then its own) as the JSON a scene file holds, keyed by reflected name.
|
| static nlohmann::json | ComponentDefaultsToJson (const ComponentMeta &meta) |
| | ComponentPropertiesToJson for a default-constructed instance of meta.
|
A scene: objects with components, and Deki's basic unit of content.
A scene can be loaded as the running scene, instanced inside another scene (what other engines call a prefab), or shipped and loaded at runtime. There is no separate prefab type.
| bool Deki::Scene::TryCollectOverrides |
( |
const Object * | instanceRoot, |
|
|
const Object * | obj, |
|
|
nlohmann::json & | overrides ) const |
CollectOverrides, telling whether there was a source to compare with.
False when the source scene could not be found or loaded (a merge conflict, saved by a newer editor, missing for a moment); overrides is then empty, and saving it would drop the instance's overrides.
| std::vector< std::pair< std::string, std::string > > Deki::Scene::CollectUnknownProperties |
( |
| ) |
|
|
static |
Property keys found in a scene file that no component's current metadata knows, as {component type name, key}.
Reflected member names are the scene-file keys, so renaming a member changes its key and the old value silently falls back to its default (the value is kept and written back on save, but nothing reads it). Load every scene in a project and check this is empty to catch a rename that lacks DEKI_RENAMED_FROM. Filled on load, so it covers the scenes loaded so far in this session.