Skip to content

Commit

Permalink
清除图集散图引用前进行检查
Browse files Browse the repository at this point in the history
  • Loading branch information
Daylily-Zeleen committed Jul 8, 2024
1 parent 02b3c77 commit 3994a40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build_version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python
import sys

version = "v0.2.4"
version = "v0.2.5-dev"

print("BUILD_VERSION=" + version)
6 changes: 3 additions & 3 deletions src/dragonbones_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ void DragonBonesFactory::_buildBones(const BuildArmaturePackage &dataPackage, Ar
}
}

/// 对外接口c成员 ///////////////////////////////////////////////////////////////
/// 对外接口成员 ///////////////////////////////////////////////////////////////
void make_dragon_bones_data_unref_texture_atlas_data(dragonBones::DragonBonesData *p_data, const dragonBones::TextureAtlasData *p_atlas) {
if (!p_data || !p_atlas) {
return;
Expand All @@ -193,13 +193,13 @@ void make_dragon_bones_data_unref_texture_atlas_data(dragonBones::DragonBonesDat

if (display->type == dragonBones::DisplayType::Image) {
if (auto image_display = static_cast<dragonBones::ImageDisplayData *>(display)) {
if (image_display->texture->parent == p_atlas) {
if (image_display->texture && image_display->texture->parent == p_atlas) {
image_display->texture = nullptr; // 清除对该图集的散图引用
}
}
} else if (display->type == dragonBones::DisplayType::Mesh) {
if (auto mesh_display = static_cast<dragonBones::MeshDisplayData *>(display)) {
if (mesh_display->texture->parent == p_atlas) {
if (mesh_display->texture && mesh_display->texture->parent == p_atlas) {
mesh_display->texture = nullptr; // 清除对该图集的散图引用
}
}
Expand Down

0 comments on commit 3994a40

Please sign in to comment.