Prepping to allow textures to have different render modes/types. Prepping for freetype support
This commit is contained in:
@ -38,15 +38,42 @@ target_link_libraries(texturetool
|
||||
)
|
||||
|
||||
# Tool Function
|
||||
function(tool_texture target in)
|
||||
function(tool_texture target)
|
||||
# Defaults
|
||||
set(FILE "" )
|
||||
set(FILTER_MIN "")
|
||||
set(FILTER_MAG "")
|
||||
set(WRAP_X "")
|
||||
set(WRAP_Y "")
|
||||
|
||||
# Parse Args
|
||||
foreach(_PAIR IN LISTS ARGN)
|
||||
if (_PAIR MATCHES "^([^:]+)=(.*)$")
|
||||
set(${CMAKE_MATCH_1} ${CMAKE_MATCH_2})
|
||||
else()
|
||||
message(FATAL_ERROR "Invalid pair: ${_PAIR}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Check for missing args
|
||||
if(NOT DEFINED FILE)
|
||||
message(FATAL_ERROR "Missing FILE input")
|
||||
endif()
|
||||
|
||||
set(DEPS "")
|
||||
if(DAWN_BUILD_TOOLS)
|
||||
set(DEPS texturetool)
|
||||
endif()
|
||||
|
||||
add_custom_target(${target}
|
||||
COMMAND texturetool --input="${DAWN_ASSETS_SOURCE_DIR}/${in}" --output="${DAWN_ASSETS_BUILD_DIR}/${target}"
|
||||
COMMENT "Generating texture ${target} from ${in}"
|
||||
COMMAND texturetool
|
||||
--input="${DAWN_ASSETS_SOURCE_DIR}/${FILE}"
|
||||
--output="${DAWN_ASSETS_BUILD_DIR}/${target}"
|
||||
--wrapX="${WRAP_X}"
|
||||
--wrapY="${WRAP_Y}"
|
||||
--filterMin="${FILTER_MIN}"
|
||||
--filterMag="${FILTER_MIN}"
|
||||
COMMENT "Generating texture ${target} from ${FILE}"
|
||||
DEPENDS ${DEPS}
|
||||
)
|
||||
add_dependencies(${DAWN_TARGET_NAME} ${target})
|
||||
|
Reference in New Issue
Block a user