mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
fix bug in GeomVertexData::unclean_set_format()
This commit is contained in:
parent
5f85e58acd
commit
335c80f8ac
@ -361,6 +361,7 @@ unclean_set_format(const GeomVertexFormat *format) {
|
||||
for (int ai = 0; ai < format->get_num_arrays(); ++ai) {
|
||||
nassertv(format->get_array(ai)->get_stride() == cdata->_format->get_array(ai)->get_stride());
|
||||
}
|
||||
nassertv(cdata->_arrays.size() == cdata->_format->get_num_arrays());
|
||||
#endif // NDEBUG
|
||||
|
||||
CDWriter cdataw(_cycler, cdata, true);
|
||||
@ -368,6 +369,11 @@ unclean_set_format(const GeomVertexFormat *format) {
|
||||
// Assign the new format.
|
||||
cdataw->_format = format;
|
||||
|
||||
for (int ai = 0; ai < cdataw->_arrays.size(); ++ai) {
|
||||
PT(GeomVertexArrayData) array_obj = cdataw->_arrays[ai].get_write_pointer();
|
||||
array_obj->_array_format = format->get_array(ai);
|
||||
}
|
||||
|
||||
clear_cache_stage();
|
||||
cdataw->_modified = Geom::get_next_modified();
|
||||
cdataw->_animated_vertices.clear();
|
||||
|
Loading…
x
Reference in New Issue
Block a user