mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-15 16:25:18 -04:00
fix crash on simple animations
This commit is contained in:
parent
d08a4bcd2b
commit
1ec142d675
@ -64,11 +64,19 @@ munge_format_impl(const qpGeomVertexFormat *orig,
|
|||||||
C_color, color_type->get_start());
|
C_color, color_type->get_start());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (animation.get_animation_type() == AT_hardware &&
|
if (animation.get_animation_type() == AT_hardware) {
|
||||||
animation.get_num_transforms() > 0) {
|
|
||||||
// If we want hardware animation, we need to reserve space for the
|
// If we want hardware animation, we need to reserve space for the
|
||||||
// blend weights.
|
// blend weights.
|
||||||
|
|
||||||
|
// Make sure the old weights and indices are removed, just in
|
||||||
|
// case.
|
||||||
|
new_format->remove_column(InternalName::get_transform_weight());
|
||||||
|
new_format->remove_column(InternalName::get_transform_index());
|
||||||
|
|
||||||
|
// And we don't need the transform_blend table any more.
|
||||||
|
new_format->remove_column(InternalName::get_transform_blend());
|
||||||
|
|
||||||
|
if (animation.get_num_transforms() > 1) {
|
||||||
PT(qpGeomVertexArrayFormat) new_array_format = new qpGeomVertexArrayFormat;
|
PT(qpGeomVertexArrayFormat) new_array_format = new qpGeomVertexArrayFormat;
|
||||||
new_array_format->add_column
|
new_array_format->add_column
|
||||||
(InternalName::get_transform_weight(), animation.get_num_transforms() - 1,
|
(InternalName::get_transform_weight(), animation.get_num_transforms() - 1,
|
||||||
@ -88,16 +96,9 @@ munge_format_impl(const qpGeomVertexFormat *orig,
|
|||||||
NT_uint8, C_index);
|
NT_uint8, C_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the old weights and indices are removed, just in
|
|
||||||
// case.
|
|
||||||
new_format->remove_column(InternalName::get_transform_weight());
|
|
||||||
new_format->remove_column(InternalName::get_transform_index());
|
|
||||||
|
|
||||||
// And we don't need the transform_blend table any more.
|
|
||||||
new_format->remove_column(InternalName::get_transform_blend());
|
|
||||||
|
|
||||||
new_format->add_array(new_array_format);
|
new_format->add_array(new_array_format);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (true) {
|
if (true) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user