From 46564264f174af958385e0349700c0ba52ef9e82 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sat, 2 Nov 2024 19:51:32 -0400 Subject: [PATCH] Update libphysis, accommodate for API changes --- extern/CMakeLists.txt | 1 + extern/libphysis | 2 +- parts/mdl/mdlpart.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/extern/CMakeLists.txt b/extern/CMakeLists.txt index 608656d..910114e 100644 --- a/extern/CMakeLists.txt +++ b/extern/CMakeLists.txt @@ -10,6 +10,7 @@ corrosion_import_crate(MANIFEST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/libphysis/Cargo add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/libphysis/logger) target_include_directories(physis INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/libphysis/target/public) +target_link_libraries(physis INTERFACE z) add_library(Physis::Physis ALIAS physis) add_library(Physis::Logger ALIAS physis-logger) diff --git a/extern/libphysis b/extern/libphysis index 2083475..743ab6b 160000 --- a/extern/libphysis +++ b/extern/libphysis @@ -1 +1 @@ -Subproject commit 20834755560176fe0981990f686bcfaebd309e0b +Subproject commit 743ab6bfb1e164c7acc19666321ce1b883ed1da9 diff --git a/parts/mdl/mdlpart.cpp b/parts/mdl/mdlpart.cpp index 04ee53c..d727ff4 100644 --- a/parts/mdl/mdlpart.cpp +++ b/parts/mdl/mdlpart.cpp @@ -256,9 +256,9 @@ RenderMaterial MDLPart::createMaterial(const physis_Material &material) newMaterial.type = MaterialType::Skin; } - if (material.color_table.num_rows > 0) { + if (material.legacy_color_table.num_rows > 0) { int width = 4; - int height = material.color_table.num_rows; + int height = material.legacy_color_table.num_rows; qInfo() << "Creating color table" << width << "X" << height; @@ -266,7 +266,7 @@ RenderMaterial MDLPart::createMaterial(const physis_Material &material) int offset = 0; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { - const auto row = material.color_table.rows[y]; + const auto row = material.legacy_color_table.rows[y]; glm::vec4 color; if (x == 0) { @@ -422,4 +422,4 @@ int MDLPart::numModels() const return models.size(); } -#include "moc_mdlpart.cpp" \ No newline at end of file +#include "moc_mdlpart.cpp"