DocMultiArchive.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #ifndef CRYINCLUDE_EDITOR_DOCMULTIARCHIVE_H
  9. #define CRYINCLUDE_EDITOR_DOCMULTIARCHIVE_H
  10. #pragma once
  11. #include "Util/XmlArchive.h"
  12. // Segmented World need XML Archive of editor level being split into multiple Archives
  13. // Because multiArchive is a super set of single archive, Doc can always use it, with or without SW Level
  14. // so some of the interface functions was written as always using MultiArchive
  15. // However, to decouple other sandbox interfaces with SW stuff(prevent important header files from being polluted),
  16. // it's better put it here as a generic implement and be included in both sides
  17. // the current available slots for MultiArchive
  18. // used by segmented world code through enum mapping (to EWDBType)
  19. enum EDocMultiArchiveSlot
  20. {
  21. DMAS_GENERAL = 0,
  22. DMAS_TERRAIN_LAYERS,
  23. DMAS_VEGETATION,
  24. DMAS_TIME_OF_DAY,
  25. DMAS_ENVIRONMENT,
  26. DMAS_GENERAL_NAMED_DATA,
  27. DMAS_USER, // Per user data,
  28. DMAS_COUNT,
  29. };
  30. typedef CXmlArchive* TDocMultiArchive [DMAS_COUNT];
  31. inline void FillXmlArArray(TDocMultiArchive& arrXmlAr, CXmlArchive* pXmlAr)
  32. {
  33. for (int i = 0; i < DMAS_COUNT; i++)
  34. {
  35. arrXmlAr[i] = pXmlAr;
  36. }
  37. }
  38. inline bool IsLoadingXmlArArray(TDocMultiArchive& arrXmlAr)
  39. {
  40. bool bLoading = false;
  41. for (int i = 0; i < DMAS_COUNT; i++)
  42. {
  43. if (arrXmlAr[i])
  44. {
  45. bLoading = arrXmlAr[i]->bLoading;
  46. break;
  47. }
  48. }
  49. return bLoading;
  50. }
  51. #endif // CRYINCLUDE_EDITOR_DOCMULTIARCHIVE_H