diff --git a/src/inferno/scene/scene.cpp b/src/inferno/scene/scene.cpp index 4ff843c..b227ff9 100644 --- a/src/inferno/scene/scene.cpp +++ b/src/inferno/scene/scene.cpp @@ -54,11 +54,13 @@ void Scene::initialize() auto& cameraJson = sceneJson.at("camera"); uint32_t camera = loadEntity(cameraJson); - auto cameraType = CameraType::Perspective; + auto& cameraComponent = addComponent(camera); if (cameraJson.exists("type") && cameraJson.at("type").get() == "orthographic") { - cameraType = CameraType::Orthographic; + cameraComponent.type = CameraType::Orthographic; + } + if (cameraJson.exists("zoom-level") && cameraJson.at("zoom-level").type() == ruc::Json::Type::Number) { + cameraComponent.zoomLevel = cameraJson.at("zoom-level").asDouble(); } - addComponent(camera, cameraType); if (cameraJson.exists("script")) { auto& cameraScript = cameraJson.at("script"); @@ -67,6 +69,7 @@ void Scene::initialize() addComponent(camera, cameraScript.at("name").get()); } else { + // TODO: Allow usage of custom camera classes addComponent(camera).bind(); } }