From 5f19a69e725a6eaab204eae233b28c3fdb25814d Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Tue, 29 Apr 2025 00:06:45 -0400 Subject: [PATCH] Update to latest libphysis --- external/CMakeLists.txt | 5 +++-- external/libphysis | 2 +- launcher/src/profile.cpp | 11 +++++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index 0baa35f..d662c20 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -20,11 +20,12 @@ FetchContent_MakeAvailable(Corrosion) corrosion_import_crate(MANIFEST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/libphysis/Cargo.toml NO_DEFAULT_FEATURES - FEATURES game_install visual_data logging - CRATE_TYPES staticlib) # FIXME: split visual_data? we only need texture decompression + FEATURES game_install logging + CRATE_TYPES staticlib) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libphysis/logger EXCLUDE_FROM_ALL) target_include_directories(physis INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/libphysis/target/public) +target_compile_definitions(physis INTERFACE ENABLE_GAME_INSTALL) # We should use the CMake module everywhere once distros update their packages if (WIN32) diff --git a/external/libphysis b/external/libphysis index 8d68aee..c4a101c 160000 --- a/external/libphysis +++ b/external/libphysis @@ -1 +1 @@ -Subproject commit 8d68aeed9a8fc2d04ad258ee94e44001001f3b6e +Subproject commit c4a101c339d485d53e4f609c78db5a034306e2de diff --git a/launcher/src/profile.cpp b/launcher/src/profile.cpp index 57b0474..7a84490 100644 --- a/launcher/src/profile.cpp +++ b/launcher/src/profile.cpp @@ -98,8 +98,15 @@ void Profile::readGameData() if (exh != nullptr) { const physis_EXD exd = physis_gamedata_read_excel_sheet(m_gameData, "ExVersion", exh, Language::English, 0); - for (unsigned int i = 0; i < exd.row_count; i++) { - m_expansionNames.push_back(QString::fromLatin1(exd.row_data[i].column_data[0].string._0)); + // TODO: bad API, we should instead get a list of row ids from libphysis but that API doesn't exist yet. + for (unsigned int i = 1; i < exd.row_count + 1; i++) { + auto rows = physis_exd_read_row(&exd, i); + for (int j = 0; j < rows.row_count; j++) { + auto row = rows.row_data[j]; + if (row.column_data != nullptr) { + m_expansionNames.push_back(QString::fromLatin1(row.column_data[0].string._0)); + } + } } physis_gamedata_free_sheet(exd);