Skip to content

Commit

Permalink
fix soh otr asset building not detecting textures (HarbourMasters#2702)
Browse files Browse the repository at this point in the history
  • Loading branch information
Archez authored Apr 13, 2023
1 parent 92fa54c commit 660c3ec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ find_package(Python3 COMPONENTS Interpreter)
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 $<IF:$<VERSION_LESS:${CMAKE_VERSION},3.17>,remove,rm> -f oot.otr oot-mq.otr
COMMAND ${CMAKE_COMMAND} -E $<IF:$<VERSION_LESS:${CMAKE_VERSION},3.17>,remove,rm> -f oot.otr oot-mq.otr soh.otr
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --non-interactive
COMMAND ${CMAKE_COMMAND} -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
Expand Down
4 changes: 2 additions & 2 deletions OTRExporter/OTRExporter/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ static void ExporterProgramEnd()

if (splitPath.size() >= 3)
{
const std::string& extension = splitPath.at(splitPath.size() - 1);
const std::string& format = splitPath.at(splitPath.size() - 2);
const std::string extension = splitPath.at(splitPath.size() - 1);
const std::string format = splitPath.at(splitPath.size() - 2);
splitPath.pop_back();
splitPath.pop_back();
std::string afterPath = std::accumulate(splitPath.begin(), splitPath.end(), std::string(""));
Expand Down
3 changes: 3 additions & 0 deletions copy-existing-otrs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ if(EXISTS ${SOURCE_DIR}/OTRExporter/soh.otr)
endif()
if(NOT EXISTS ${SOURCE_DIR}/oot.otr AND NOT EXISTS ${SOURCE_DIR}/oot-mq.otr)
message(FATAL_ERROR, "No OTR files found.")
endif()
if(NOT EXISTS ${SOURCE_DIR}/soh.otr)
message(FATAL_ERROR, "No soh OTR found.")
endif()

0 comments on commit 660c3ec

Please sign in to comment.