Meta: Assets in separate CMakeLists.txt
This commit is contained in:
+1
-1
@@ -16,6 +16,6 @@
|
|||||||
[submodule "inferno/vendor/stb/stb"]
|
[submodule "inferno/vendor/stb/stb"]
|
||||||
path = vendor/stb/stb
|
path = vendor/stb/stb
|
||||||
url = https://github.com/nothings/stb
|
url = https://github.com/nothings/stb
|
||||||
[submodule "vendor/ruc"]
|
[submodule "inferno/vendor/ruc"]
|
||||||
path = vendor/ruc
|
path = vendor/ruc
|
||||||
url = https://github.com/Riyyi/ruc
|
url = https://github.com/Riyyi/ruc
|
||||||
|
|||||||
+1
-4
@@ -69,10 +69,7 @@ add_subdirectory("src")
|
|||||||
# ------------------------------------------
|
# ------------------------------------------
|
||||||
# Assets target
|
# Assets target
|
||||||
|
|
||||||
add_custom_target(${ENGINE}-assets
|
add_subdirectory("assets")
|
||||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/copy-assets.cmake
|
|
||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
||||||
add_dependencies(${ENGINE} ${ENGINE}-assets)
|
|
||||||
|
|
||||||
# ------------------------------------------
|
# ------------------------------------------
|
||||||
# Examples target
|
# Examples target
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
add_custom_target(${ENGINE}-assets
|
||||||
|
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/copy-assets.cmake
|
||||||
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
||||||
|
add_dependencies(${ENGINE} ${ENGINE}-assets)
|
||||||
@@ -64,8 +64,9 @@ void Scene::initialize()
|
|||||||
if (cameraJson.exists("script")) {
|
if (cameraJson.exists("script")) {
|
||||||
auto& cameraScript = cameraJson.at("script");
|
auto& cameraScript = cameraJson.at("script");
|
||||||
if (cameraScript.exists("type") && cameraScript.exists("name")) {
|
if (cameraScript.exists("type") && cameraScript.exists("name")) {
|
||||||
|
auto name = cameraScript.at("name").get<std::string>();
|
||||||
if (cameraScript.at("type").get<std::string>() == "lua") {
|
if (cameraScript.at("type").get<std::string>() == "lua") {
|
||||||
addComponent<LuaScriptComponent>(camera, cameraScript.at("name").get<std::string>());
|
addComponent<LuaScriptComponent>(camera, name);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
addComponent<NativeScriptComponent>(camera, name);
|
addComponent<NativeScriptComponent>(camera, name);
|
||||||
|
|||||||
Reference in New Issue
Block a user