mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
Removed field update to multi fields...
Not needed .. just send updates to exact same targets
This commit is contained in:
parent
fb6e53b57d
commit
24c0731696
@ -57,10 +57,6 @@ ConfigVariableBool dc_sort_inheritance_by_file
|
|||||||
"within the class."));
|
"within the class."));
|
||||||
|
|
||||||
|
|
||||||
ConfigVariableBool dc_update_multifield
|
|
||||||
("dc-update-multifield", false,
|
|
||||||
PRC_DESC("Set this true to support Multiple updates in a field update"));
|
|
||||||
|
|
||||||
#endif // WITHIN_PANDA
|
#endif // WITHIN_PANDA
|
||||||
|
|
||||||
class SortFieldsByIndex {
|
class SortFieldsByIndex {
|
||||||
@ -474,58 +470,27 @@ receive_update(PyObject *distobj, DatagramIterator &di) const {
|
|||||||
#ifdef WITHIN_PANDA
|
#ifdef WITHIN_PANDA
|
||||||
PStatTimer timer(((DCClass *)this)->_class_update_pcollector);
|
PStatTimer timer(((DCClass *)this)->_class_update_pcollector);
|
||||||
#endif
|
#endif
|
||||||
if(dc_update_multifield)
|
DCPacker packer;
|
||||||
{
|
packer.set_unpack_data(di.get_remaining_bytes());
|
||||||
while(di.get_remaining_size() > 0)
|
|
||||||
{
|
|
||||||
|
|
||||||
DCPacker packer;
|
|
||||||
packer.set_unpack_data(di.get_remaining_bytes());
|
|
||||||
|
|
||||||
|
|
||||||
int field_id = packer.raw_unpack_uint16();
|
int field_id = packer.raw_unpack_uint16();
|
||||||
DCField *field = get_field_by_index(field_id);
|
DCField *field = get_field_by_index(field_id);
|
||||||
if (field == (DCField *)NULL) {
|
if (field == (DCField *)NULL) {
|
||||||
ostringstream strm;
|
|
||||||
strm
|
|
||||||
<< "Received update for field " << field_id << ", not in class "
|
|
||||||
<< get_name();
|
|
||||||
nassert_raise(strm.str());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
packer.begin_unpack(field);
|
|
||||||
field->receive_update(packer, distobj);
|
|
||||||
packer.end_unpack();
|
|
||||||
|
|
||||||
di.skip_bytes(packer.get_num_unpacked_bytes());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
DCPacker packer;
|
|
||||||
packer.set_unpack_data(di.get_remaining_bytes());
|
|
||||||
|
|
||||||
|
|
||||||
int field_id = packer.raw_unpack_uint16();
|
|
||||||
DCField *field = get_field_by_index(field_id);
|
|
||||||
if (field == (DCField *)NULL) {
|
|
||||||
ostringstream strm;
|
ostringstream strm;
|
||||||
strm
|
strm
|
||||||
<< "Received update for field " << field_id << ", not in class "
|
<< "Received update for field " << field_id << ", not in class "
|
||||||
<< get_name();
|
<< get_name();
|
||||||
nassert_raise(strm.str());
|
nassert_raise(strm.str());
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
packer.begin_unpack(field);
|
|
||||||
field->receive_update(packer, distobj);
|
|
||||||
packer.end_unpack();
|
|
||||||
|
|
||||||
di.skip_bytes(packer.get_num_unpacked_bytes());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
packer.begin_unpack(field);
|
||||||
|
field->receive_update(packer, distobj);
|
||||||
|
packer.end_unpack();
|
||||||
|
|
||||||
|
di.skip_bytes(packer.get_num_unpacked_bytes());
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif // HAVE_PYTHON
|
#endif // HAVE_PYTHON
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user