framedata.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include "pch.h"
  2. //////////////////////////////////////////////////////////////////////////////
  3. //
  4. // FrameData
  5. //
  6. //////////////////////////////////////////////////////////////////////////////
  7. ZString GetString(int indent, const FrameData& data)
  8. {
  9. return
  10. "("
  11. + ::GetString(indent + 1, data.m_strName)
  12. + ", " + ::GetString(indent + 1, data.m_vecPosition)
  13. + ", " + ::GetString(indent + 1, data.m_vecForward)
  14. + ", " + ::GetString(indent + 1, data.m_vecUp)
  15. + ")";
  16. }
  17. ZString FrameDataListValue::GetString(int indent)
  18. {
  19. ZString str = "FrameData([\n";
  20. FrameList::Iterator iter(m_list);
  21. while (!iter.End()) {
  22. str += Value::Indent(indent + 1) + ::GetString(indent, iter.Value());
  23. iter.Next();
  24. if (!iter.End()) {
  25. str += ",\n";
  26. } else {
  27. str += "\n";
  28. }
  29. }
  30. return str + Value::Indent(indent) + "])";
  31. }
  32. void FrameDataListValue::Write(IMDLBinaryFile* pmdlFile)
  33. {
  34. pmdlFile->WriteReference("FrameData");
  35. TRef<ZFile> pfile = pmdlFile->WriteBinary();
  36. pfile->Write(m_list.GetCount());
  37. FrameList::Iterator iter(m_list);
  38. while (!iter.End()) {
  39. FrameData& data = iter.Value();
  40. pfile->WriteAlignedString(data.m_strName);
  41. pfile->Write((void*)&data.m_vecPosition, 3 * sizeof(Vector));
  42. iter.Next();
  43. }
  44. }