From e369ad4c868cbc045d4423ce2c456d7730c5b6a4 Mon Sep 17 00:00:00 2001 From: Adam Bird Date: Tue, 24 Oct 2023 20:51:54 -0700 Subject: [PATCH] Pass in custom assets to OTRExporter (#3328) * bump submodules and use custom assets dir * bump submodules --- CMakeLists.txt | 6 +++--- OTRExporter | 2 +- ZAPDTR | 2 +- scripts/linux/appimage/soh.sh | 2 -- soh/macosx/soh-macos.sh | 2 -- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 229a63bbc..de5521a02 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,7 +124,7 @@ add_custom_target( ExtractAssets # CMake versions prior to 3.17 do not have the rm command, use remove instead for older versions COMMAND ${CMAKE_COMMAND} -E $,remove,rm> -f oot.otr oot-mq.otr soh.otr - COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$" --non-interactive + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$" --non-interactive --xml-root ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/xml --custom-otr-file soh.otr "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter COMMENT "Running asset extraction..." @@ -146,7 +146,7 @@ add_custom_target( GenerateSohOtr # CMake versions prior to 3.17 do not have the rm command, use remove instead for older versions COMMAND ${CMAKE_COMMAND} -E $,remove,rm> -f soh.otr - COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$" --norom + COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$" --norom --custom-otr-file soh.otr "--custom-assets-path" ${CMAKE_CURRENT_SOURCE_DIR}/soh/assets/custom COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -DONLYSOHOTR=On -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter COMMENT "Generating soh.otr..." @@ -219,4 +219,4 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin") endif() set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_SOURCE_DIR}/CMake/Packaging-2.cmake) -include(CMake/Packaging.cmake) \ No newline at end of file +include(CMake/Packaging.cmake) diff --git a/OTRExporter b/OTRExporter index 89de14726..f1bc0a726 160000 --- a/OTRExporter +++ b/OTRExporter @@ -1 +1 @@ -Subproject commit 89de1472606b101a25d489d3e01f1769d3bc186c +Subproject commit f1bc0a726813d7e70ad471fdebd080e6fd77996a diff --git a/ZAPDTR b/ZAPDTR index e6b076479..9b8e224da 160000 --- a/ZAPDTR +++ b/ZAPDTR @@ -1 +1 @@ -Subproject commit e6b0764799309b96c46f4c77e3ea2aa670f15e89 +Subproject commit 9b8e224dac83aa8e47a688884ad48725f18fc293 diff --git a/scripts/linux/appimage/soh.sh b/scripts/linux/appimage/soh.sh index 063fcf79c..0e8414ac0 100644 --- a/scripts/linux/appimage/soh.sh +++ b/scripts/linux/appimage/soh.sh @@ -26,7 +26,6 @@ while [[ (! -e "$SHIP_HOME"/oot.otr) || (! -e "$SHIP_HOME"/oot-mq.otr) ]]; do ln -s "$HERE"/usr/bin/{assets,soh.elf,ZAPD} "$ASSETDIR" export OLDPWD="$PWD" mkdir -p "$ASSETDIR"/tmp - mkdir -p "$ASSETDIR"/Extract ln -s "$romfile" "$ASSETDIR"/tmp/rom.z64 cd "$ASSETDIR" ROMHASH=$(sha1sum -b "$ASSETDIR"/tmp/rom.z64 | awk '{ print $1 }') @@ -166,7 +165,6 @@ while [[ (! -e "$SHIP_HOME"/oot.otr) || (! -e "$SHIP_HOME"/oot-mq.otr) ]]; do continue;; esac if [[ ! -e "$SHIP_HOME"/"$OTRNAME" ]]; then - cp -r "$ASSETDIR"/assets/game "$ASSETDIR"/Extract/assets if [ -n "$ZENITY" ]; then (echo "# 25%"; echo "25"; sleep 2; echo "# 50%"; echo "50"; sleep 3; echo "# 75%"; echo "75"; sleep 2; echo "# 100%"; echo "100"; sleep 3) | zenity --progress --title="OTR Generating..." --timeout=10 --percentage=0 --icon-name=soh --window-icon=soh.png --height=80 --width=400 & diff --git a/soh/macosx/soh-macos.sh b/soh/macosx/soh-macos.sh index f32fb6363..4b5871892 100755 --- a/soh/macosx/soh-macos.sh +++ b/soh/macosx/soh-macos.sh @@ -180,9 +180,7 @@ if [ ! -e "$SHIP_HOME"/oot.otr ] || [ ! -e "$SHIP_HOME"/oot-mq.otr ]; then export ASSETDIR cp -r "$RESPATH/assets" "$ASSETDIR" mkdir -p "$ASSETDIR"/tmp - mkdir -p "$ASSETDIR"/Extract cp "$ROMPATH" "$ASSETDIR"/tmp/rom.z64 - cp -r "$ASSETDIR"/assets/game "$ASSETDIR"/Extract/assets/ cd "$ASSETDIR" || return # If an invalid rom was detected, let the user know