diff options
-rw-r--r-- | CMakeLists.txt | 6 | ||||
-rw-r--r-- | cmake/bin2h.script.cmake | 5 | ||||
-rw-r--r-- | core/hrtf.cpp | 4 |
3 files changed, 8 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d5b1e79d..f9a2c859 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1226,11 +1226,11 @@ option(ALSOFT_EMBED_HRTF_DATA "Embed the HRTF data files (increases library foot if(ALSOFT_EMBED_HRTF_DATA) macro(make_hrtf_header FILENAME VARNAME) set(infile "${OpenAL_SOURCE_DIR}/hrtf/${FILENAME}") - set(outfile "${OpenAL_BINARY_DIR}/${VARNAME}.h") + set(outfile "${OpenAL_BINARY_DIR}/${VARNAME}.txt") add_custom_command(OUTPUT "${outfile}" COMMAND ${CMAKE_COMMAND} -D "INPUT_FILE=${infile}" -D "OUTPUT_FILE=${outfile}" - -D "VARIABLE_NAME=${VARNAME}" -P "${CMAKE_MODULE_PATH}/bin2h.script.cmake" + -P "${CMAKE_MODULE_PATH}/bin2h.script.cmake" WORKING_DIRECTORY "${OpenAL_SOURCE_DIR}" DEPENDS "${infile}" "${CMAKE_MODULE_PATH}/bin2h.script.cmake" VERBATIM @@ -1238,7 +1238,7 @@ if(ALSOFT_EMBED_HRTF_DATA) set(ALC_OBJS ${ALC_OBJS} "${outfile}") endmacro() - make_hrtf_header("Default HRTF.mhr" "hrtf_default") + make_hrtf_header("Default HRTF.mhr" "default_hrtf") endif() diff --git a/cmake/bin2h.script.cmake b/cmake/bin2h.script.cmake index 1438fde2..7e74a7a1 100644 --- a/cmake/bin2h.script.cmake +++ b/cmake/bin2h.script.cmake @@ -8,6 +8,5 @@ file(READ "${INPUT_FILE}" indata HEX) # per line. string(REGEX REPLACE "(..)" " 0x\\1,\n" output "${indata}") -# Write the list of hex chars to the output file in a const byte array -file(WRITE "${OUTPUT_FILE}" - "const unsigned char ${VARIABLE_NAME}[] = {\n${output}};\n") +# Write the list of hex chars to the output file +file(WRITE "${OUTPUT_FILE}" "${output}") diff --git a/core/hrtf.cpp b/core/hrtf.cpp index 48b9a3d7..28179189 100644 --- a/core/hrtf.cpp +++ b/core/hrtf.cpp @@ -1206,7 +1206,9 @@ al::span<const char> GetResource(int /*name*/) #else -#include "hrtf_default.h" +constexpr unsigned char hrtf_default[]{ +#include "default_hrtf.txt" +}; al::span<const char> GetResource(int name) { |