| 659 | } |
| 660 | |
| 661 | void ParticleEffect::Serialize(SerializeStream& stream, const void* otherObj) |
| 662 | { |
| 663 | // Base |
| 664 | Actor::Serialize(stream, otherObj); |
| 665 | |
| 666 | SERIALIZE_GET_OTHER_OBJ(ParticleEffect); |
| 667 | |
| 668 | const auto& params = GetParameters(); |
| 669 | const auto* otherParams = other ? &((ParticleEffect*)other)->GetParameters() : nullptr; |
| 670 | { |
| 671 | stream.JKEY("Overrides"); |
| 672 | stream.StartArray(); |
| 673 | for (int32 i = 0; i < params.Count(); i++) |
| 674 | { |
| 675 | auto& param = params[i]; |
| 676 | if (otherParams) |
| 677 | { |
| 678 | if (otherParams->IsEmpty()) |
| 679 | { |
| 680 | // Serialize only parameters values overriding the default value (from system) |
| 681 | if (param.GetValue() == param.GetDefaultValue()) |
| 682 | continue; |
| 683 | } |
| 684 | else |
| 685 | { |
| 686 | // Serialize only parameters values overriding the other object value (from diff) |
| 687 | const auto& otherParam = (*otherParams)[i]; |
| 688 | if (param.GetValue() == otherParam.GetValue()) |
| 689 | continue; |
| 690 | } |
| 691 | } |
| 692 | |
| 693 | stream.StartObject(); |
| 694 | |
| 695 | stream.JKEY("Track"); |
| 696 | stream.String(param.GetTrackName()); |
| 697 | |
| 698 | stream.JKEY("Id"); |
| 699 | stream.Guid(param.GetParamIdentifier()); |
| 700 | |
| 701 | stream.JKEY("Value"); |
| 702 | Serialization::Serialize(stream, param.GetValue(), nullptr); |
| 703 | |
| 704 | stream.EndObject(); |
| 705 | } |
| 706 | stream.EndArray(); |
| 707 | } |
| 708 | |
| 709 | SERIALIZE(ParticleSystem); |
| 710 | SERIALIZE(UpdateMode); |
| 711 | SERIALIZE(FixedTimestep); |
| 712 | SERIALIZE(SimulationSpeed); |
| 713 | SERIALIZE(UseTimeScale); |
| 714 | SERIALIZE(IsLooping); |
| 715 | SERIALIZE(PlayOnStart); |
| 716 | SERIALIZE(UpdateWhenOffscreen); |
| 717 | SERIALIZE(DrawModes); |
| 718 | SERIALIZE(SortOrder); |
nothing calls this directly
no test coverage detected