/////////////////////////////////////////////////////////////////////
| 454 | |
| 455 | ////////////////////////////////////////////////////////////////////////// |
| 456 | void CShapeObject::Serialize( CObjectArchive &ar ) |
| 457 | { |
| 458 | m_bIgnoreGameUpdate = true; |
| 459 | CBaseObject::Serialize( ar ); |
| 460 | m_bIgnoreGameUpdate = false; |
| 461 | |
| 462 | XmlNodeRef xmlNode = ar.node; |
| 463 | if (ar.bLoading) |
| 464 | { |
| 465 | m_bAreaModified = true; |
| 466 | m_bIgnoreGameUpdate = true; |
| 467 | m_entities.Clear(); |
| 468 | |
| 469 | GUID entityId; |
| 470 | if (xmlNode->getAttr( "EntityId",entityId )) |
| 471 | { |
| 472 | // For Backward compatability. |
| 473 | //m_entities.push_back(entityId); |
| 474 | ar.SetResolveCallback( this,entityId,functor(m_entities,&CSafeObjectsArray::Add) ); |
| 475 | } |
| 476 | |
| 477 | // Load Entities. |
| 478 | m_points.clear(); |
| 479 | XmlNodeRef points = xmlNode->findChild( "Points" ); |
| 480 | if (points) |
| 481 | { |
| 482 | for (int i = 0; i < points->getChildCount(); i++) |
| 483 | { |
| 484 | XmlNodeRef pnt = points->getChild(i); |
| 485 | Vec3 pos; |
| 486 | pnt->getAttr( "Pos",pos ); |
| 487 | m_points.push_back(pos); |
| 488 | } |
| 489 | } |
| 490 | XmlNodeRef entities = xmlNode->findChild( "Entities" ); |
| 491 | if (entities) |
| 492 | { |
| 493 | for (int i = 0; i < entities->getChildCount(); i++) |
| 494 | { |
| 495 | XmlNodeRef ent = entities->getChild(i); |
| 496 | GUID entityId; |
| 497 | if (ent->getAttr( "Id",entityId )) |
| 498 | { |
| 499 | //m_entities.push_back(id); |
| 500 | ar.SetResolveCallback( this,entityId,functor(m_entities,&CSafeObjectsArray::Add) ); |
| 501 | } |
| 502 | } |
| 503 | } |
| 504 | |
| 505 | if (ar.bUndo) |
| 506 | { |
| 507 | // Update game area only in undo mode. |
| 508 | m_bIgnoreGameUpdate = false; |
| 509 | } |
| 510 | CalcBBox(); |
| 511 | UpdateGameArea(); |
| 512 | |
| 513 | // Update UI. |
nothing calls this directly
no test coverage detected