Add context sharing on prefabs.

This commit is contained in:
2024-12-03 17:15:39 -06:00
parent 68fab7c94d
commit 5998037994
30 changed files with 166 additions and 177 deletions

View File

@@ -21,7 +21,7 @@ void Camera::onDispose() {
renderTarget = nullptr;
}
void Camera::load(const SceneComponentLoadContext &ctx) {
void Camera::load(SceneComponentLoadContext &ctx) {
SceneComponent::load(ctx);
if(ctx.data.contains("fov")) {

View File

@@ -33,7 +33,7 @@ namespace Dawn {
void onInit() override;
void onDispose() override;
void load(const SceneComponentLoadContext &ctx) override;
void load(SceneComponentLoadContext &ctx) override;
/**
* Returns the aspect ratio that the camera is using. In future I may

View File

@@ -9,7 +9,7 @@
using namespace Dawn;
void SimpleTexturedMaterial::load(const SceneComponentLoadContext &ctx) {
void SimpleTexturedMaterial::load(SceneComponentLoadContext &ctx) {
if(ctx.data.contains("color")) {
this->setColor(JSON::color(ctx.data["color"]));
}

View File

@@ -15,7 +15,7 @@ namespace Dawn {
std::shared_ptr<Texture> texture;
public:
void load(const SceneComponentLoadContext &ctx) override;
void load(SceneComponentLoadContext &ctx) override;
/**
* Returns the color of this material.

View File

@@ -27,7 +27,7 @@ void CubeMeshComponent::onDispose() {
mesh = nullptr;
}
void CubeMeshComponent::load(const SceneComponentLoadContext &ctx) {
void CubeMeshComponent::load(SceneComponentLoadContext &ctx) {
if(!mesh) mesh = std::make_shared<Mesh>();
}

View File

@@ -14,6 +14,6 @@ namespace Dawn {
void onInit() override;
void onDispose() override;
void load(const SceneComponentLoadContext &ctx) override;
void load(SceneComponentLoadContext &ctx) override;
};
}