ScreenFaderTrack.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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_CRYMOVIE_SCREENFADERTRACK_H
  9. #define CRYINCLUDE_CRYMOVIE_SCREENFADERTRACK_H
  10. #pragma once
  11. #include "IMovieSystem.h"
  12. #include "AnimTrack.h"
  13. class CScreenFaderTrack
  14. : public TAnimTrack<IScreenFaderKey>
  15. {
  16. public:
  17. AZ_CLASS_ALLOCATOR(CScreenFaderTrack, AZ::SystemAllocator);
  18. AZ_RTTI(CScreenFaderTrack, "{3279BB19-D32D-482E-BD6E-C2DCD8858328}", IAnimTrack);
  19. //-----------------------------------------------------------------------------
  20. //!
  21. CScreenFaderTrack();
  22. ~CScreenFaderTrack();
  23. //-----------------------------------------------------------------------------
  24. //! IAnimTrack Method Overriding.
  25. //-----------------------------------------------------------------------------
  26. void GetKeyInfo(int key, const char*& description, float& duration) override;
  27. void SerializeKey(IScreenFaderKey& key, XmlNodeRef& keyNode, bool bLoading) override;
  28. void SetFlags(int flags) override;
  29. void PreloadTextures();
  30. ITexture* GetActiveTexture() const;
  31. void SetScreenFaderTrackDefaults();
  32. bool IsTextureVisible() const {return m_bTextureVisible; };
  33. void SetTextureVisible(bool bVisible){m_bTextureVisible = bVisible; };
  34. Vec4 GetDrawColor() const {return m_drawColor; };
  35. void SetDrawColor(Vec4 vDrawColor){m_drawColor = vDrawColor; };
  36. int GetLastTextureID() const { return m_lastTextureID; };
  37. void SetLastTextureID(int nTextureID){ m_lastTextureID = nTextureID; };
  38. bool SetActiveTexture(int index);
  39. static void Reflect(AZ::ReflectContext* context);
  40. private:
  41. void ReleasePreloadedTextures();
  42. std::vector<ITexture*> m_preloadedTextures;
  43. bool m_bTextureVisible;
  44. Vec4 m_drawColor;
  45. int m_lastTextureID;
  46. };
  47. #endif // CRYINCLUDE_CRYMOVIE_SCREENFADERTRACK_H