Skip to content

Commit

Permalink
Use correct type for material (#179)
Browse files Browse the repository at this point in the history
* Use correct type for material

* Rebuilt libs

Make sure to copy the correct libs only. For some reason osx also returns a libSpineExt_53.a when in fact we only want libspinec.a
  • Loading branch information
britzl authored Jul 19, 2024
1 parent f90150d commit de4c3bd
Show file tree
Hide file tree
Showing 15 changed files with 8 additions and 6 deletions.
Binary file modified defold-spine/lib/arm64-android/libspinec.a
Binary file not shown.
Binary file modified defold-spine/lib/arm64-ios/libspinec.a
Binary file not shown.
Binary file removed defold-spine/lib/arm64-osx/libSpineExt_53.a
Binary file not shown.
Binary file modified defold-spine/lib/arm64-osx/libspinec.a
Binary file not shown.
Binary file modified defold-spine/lib/armv7-android/libspinec.a
Binary file not shown.
Binary file modified defold-spine/lib/js-web/libspinec.a
Binary file not shown.
Binary file modified defold-spine/lib/wasm-web/libspinec.a
Binary file not shown.
Binary file modified defold-spine/lib/x86-win32/spinec.lib
Binary file not shown.
Binary file modified defold-spine/lib/x86_64-ios/libspinec.a
Binary file not shown.
Binary file modified defold-spine/lib/x86_64-linux/libspinec.a
Binary file not shown.
Binary file modified defold-spine/lib/x86_64-osx/libspinec.a
Binary file not shown.
Binary file modified defold-spine/lib/x86_64-win32/spinec.lib
Binary file not shown.
8 changes: 5 additions & 3 deletions defold-spine/src/comp_spine_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,11 @@ namespace dmSpine
return dmGameObject::CREATE_RESULT_OK;
}

static inline dmGameSystem::MaterialResource* GetMaterialResource(const SpineModelComponent* component) {
return component->m_Material ? component->m_Material : component->m_Resource->m_Material;
}
static inline dmRender::HMaterial GetMaterial(const SpineModelComponent* component) {
return component->m_Material ? component->m_Material : component->m_Resource->m_Material->m_Material;
return GetMaterialResource(component)->m_Material;
}

static void ReHash(SpineModelComponent* component)
Expand Down Expand Up @@ -1234,8 +1237,7 @@ namespace dmSpine
}
else if (params.m_PropertyId == PROP_MATERIAL)
{
dmRender::HMaterial material = GetMaterial(component);
return dmGameSystem::GetResourceProperty(context->m_Factory, material, out_value);
return dmGameSystem::GetResourceProperty(context->m_Factory, GetMaterialResource(component), out_value);
}
return dmGameSystem::GetMaterialConstant(GetMaterial(component), params.m_PropertyId, params.m_Options.m_Index, out_value, false, CompSpineModelGetConstantCallback, component);
}
Expand Down
2 changes: 1 addition & 1 deletion defold-spine/src/comp_spine_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace dmSpine
spAnimationState* m_AnimationStateInstance;
dmArray<dmSpine::SpineAnimationTrack> m_AnimationTracks;
dmGameSystem::HComponentRenderConstants m_RenderConstants;
dmRender::HMaterial m_Material;
dmGameSystem::MaterialResource* m_Material;
/// Node instances corresponding to the bones
dmArray<dmGameObject::HInstance> m_BoneInstances;
dmArray<spBone*> m_Bones; // We shouldn't really have to have a duplicate array of these
Expand Down
4 changes: 2 additions & 2 deletions utils/build_libs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ function copy_results() {
local platform_ne=$2
local target_dir=$3

for path in ./build/$platform_ne/*.a; do
for path in ./build/$platform_ne/*${LIBRARY_NAME}.a; do
copyfile $path $target_dir
done
for path in ./build/$platform_ne/*.lib; do
for path in ./build/$platform_ne/*${LIBRARY_NAME}.lib; do
copyfile $path $target_dir
done
}
Expand Down

0 comments on commit de4c3bd

Please sign in to comment.