Moving some assets around
This commit is contained in:
@@ -48,7 +48,7 @@ function(tool_prefab in)
|
||||
|
||||
STRING(REGEX REPLACE "[\.|\\|\/]" "-" prefab_name ${in})
|
||||
add_custom_target(prefab_${prefab_name}
|
||||
COMMAND prefabtool --input="${DAWN_ASSETS_SOURCE_DIR}/${in}" --output="${DAWN_GENERATED_DIR}/generatedprefabs" --sources="${DAWN_SOURCES_DIR}"
|
||||
COMMAND prefabtool --input="${in}" --output="${DAWN_GENERATED_DIR}/generatedprefabs" --sources="${DAWN_SOURCES_DIR}"
|
||||
COMMENT "Generating prefab from ${in}"
|
||||
DEPENDS ${DEPS}
|
||||
)
|
||||
|
@@ -49,7 +49,7 @@ function(tool_scene in)
|
||||
|
||||
STRING(REGEX REPLACE "[\.|\\|\/]" "-" scene_name ${in})
|
||||
add_custom_target(scene_${scene_name}
|
||||
COMMAND scenetool --input="${DAWN_ASSETS_SOURCE_DIR}/${in}" --output="${DAWN_GENERATED_DIR}/generatedscenes" --sources="${DAWN_SOURCES_DIR}"
|
||||
COMMAND scenetool --input="${in}" --output="${DAWN_GENERATED_DIR}/generatedscenes" --sources="${DAWN_SOURCES_DIR}"
|
||||
COMMENT "Generating scene from ${in}"
|
||||
DEPENDS ${DEPS}
|
||||
)
|
||||
|
@@ -68,7 +68,7 @@ function(tool_texture target)
|
||||
|
||||
add_custom_target(${target}
|
||||
COMMAND texturetool
|
||||
--input="${DAWN_ASSETS_SOURCE_DIR}/${FILE}"
|
||||
--input="${FILE}"
|
||||
--output="${DAWN_ASSETS_BUILD_DIR}/${target}"
|
||||
--wrapX="${WRAP_X}"
|
||||
--wrapY="${WRAP_Y}"
|
||||
|
@@ -53,19 +53,6 @@ function(tool_truetype target)
|
||||
set(DEPS truetypetool)
|
||||
endif()
|
||||
|
||||
if(DEFINED REGULAR)
|
||||
set(REGULAR "${DAWN_ASSETS_SOURCE_DIR}/${REGULAR}")
|
||||
endif()
|
||||
if(DEFINED BOLD)
|
||||
set(BOLD "${DAWN_ASSETS_SOURCE_DIR}/${BOLD}")
|
||||
endif()
|
||||
if(DEFINED ITALICS)
|
||||
set(ITALICS "${DAWN_ASSETS_SOURCE_DIR}/${ITALICS}")
|
||||
endif()
|
||||
if(DEFINED BOLD_ITALICS)
|
||||
set(BOLD_ITALICS "${DAWN_ASSETS_SOURCE_DIR}/${BOLD_ITALICS}")
|
||||
endif()
|
||||
|
||||
add_custom_target(${target}
|
||||
COMMAND truetypetool
|
||||
--output="${DAWN_ASSETS_BUILD_DIR}/${target}.truetype"
|
||||
|
@@ -10,6 +10,7 @@ using namespace Dawn;
|
||||
void SceneAssetGenerator::generate(
|
||||
std::map<std::string, std::string> &assetMap,
|
||||
int32_t &assetNumber,
|
||||
std::vector<std::string> *publicProperties,
|
||||
std::vector<std::string> *initBody,
|
||||
std::vector<std::string> *assetsBody,
|
||||
struct SceneAsset *asset,
|
||||
@@ -17,6 +18,7 @@ void SceneAssetGenerator::generate(
|
||||
) {
|
||||
std::string assetType = "";
|
||||
|
||||
bool_t componentInit = true;
|
||||
if(asset->ref.empty()) {
|
||||
asset->usageName = "asset" + std::to_string(assetNumber++);
|
||||
} else {
|
||||
@@ -40,6 +42,12 @@ void SceneAssetGenerator::generate(
|
||||
assertUnreachable();
|
||||
}
|
||||
|
||||
line(initBody, "auto " + asset->usageName + " = man->get<" + assetType + ">(\"" + asset->fileName + "\");", "");
|
||||
if(!asset->ref.empty()) {
|
||||
line(publicProperties, assetType + " *" + asset->usageName + " = nullptr;", "");
|
||||
line(initBody, asset->usageName + " = man->get<" + assetType + ">(\"" + asset->fileName + "\");", "");
|
||||
} else {
|
||||
line(initBody, "auto " + asset->usageName + " = man->get<" + assetType + ">(\"" + asset->fileName + "\");", "");
|
||||
}
|
||||
|
||||
line(assetsBody, "assets.push_back(man->get<" + assetType + ">(\"" + asset->fileName + "\"));", "");
|
||||
}
|
@@ -13,6 +13,7 @@ namespace Dawn {
|
||||
static void generate(
|
||||
std::map<std::string, std::string> &assetMap,
|
||||
int32_t &assetNumber,
|
||||
std::vector<std::string> *publicProperties,
|
||||
std::vector<std::string> *initBody,
|
||||
std::vector<std::string> *assetsBody,
|
||||
struct SceneAsset *asset,
|
||||
|
@@ -149,6 +149,7 @@ void SceneItemGenerator::generate(
|
||||
SceneAssetGenerator::generate(
|
||||
assetMap,
|
||||
assetNumber,
|
||||
publicProperties,
|
||||
initBody,
|
||||
assetBody,
|
||||
&(*itAssets),
|
||||
|
@@ -52,7 +52,7 @@ function(tool_vnscene in)
|
||||
|
||||
STRING(REGEX REPLACE "[\.|\\|\/]" "-" scene_name ${in})
|
||||
add_custom_target(scene_${scene_name}
|
||||
COMMAND vnscenetool --input="${DAWN_ASSETS_SOURCE_DIR}/${in}" --output="${DAWN_GENERATED_DIR}/generatedscenes"
|
||||
COMMAND vnscenetool --input="${in}" --output="${DAWN_GENERATED_DIR}/generatedscenes"
|
||||
COMMENT "Generating vnscene from ${in}"
|
||||
DEPENDS ${DEPS}
|
||||
)
|
||||
|
Reference in New Issue
Block a user