EffectLibrary.hpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. //==========================================================================//
  2. // File: EffectLibrary.hpp //
  3. // Contents: Base Effect Component //
  4. //---------------------------------------------------------------------------//
  5. // Copyright (C) Microsoft Corporation. All rights reserved. //
  6. //===========================================================================//
  7. #pragma once
  8. #include "gosFX.hpp"
  9. #include "Effect.hpp"
  10. namespace gosFX
  11. {
  12. class EffectLibrary
  13. #if defined(_ARMOR)
  14. : public Stuff::Signature
  15. #endif
  16. {
  17. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. // Initialization
  19. //
  20. public:
  21. static void
  22. InitializeClass();
  23. static void
  24. TerminateClass();
  25. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  26. // Constructors/Destructors
  27. //
  28. public:
  29. EffectLibrary();
  30. ~EffectLibrary();
  31. void
  32. Load(Stuff::MemoryStream* stream);
  33. void
  34. Save(Stuff::MemoryStream* stream);
  35. enum MergeMode {
  36. OnlyAddNewEffects,
  37. ReplaceMatchingEffects,
  38. ReplaceNamedEffects
  39. };
  40. void
  41. Merge(
  42. EffectLibrary &source,
  43. MergeMode merge_mode=(MergeMode)OnlyAddNewEffects
  44. );
  45. static EffectLibrary*
  46. Instance;
  47. protected:
  48. EffectLibrary(EffectLibrary &source)
  49. {STOP(("Shouldn't be called"));}
  50. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  51. // Effect management
  52. //
  53. public:
  54. Stuff::DynamicArrayOf<Effect::Specification*>
  55. m_effects;
  56. Effect::Specification*
  57. Find(const char* name);
  58. Effect*
  59. MakeEffect(
  60. unsigned index,
  61. unsigned flags
  62. );
  63. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  64. // Testing
  65. //
  66. public:
  67. void
  68. TestInstance() const
  69. {}
  70. };
  71. }