AnimScreenFaderNode.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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_ANIMSCREENFADERNODE_H
  9. #define CRYINCLUDE_CRYMOVIE_ANIMSCREENFADERNODE_H
  10. #pragma once
  11. #include "AnimNode.h"
  12. class CScreenFaderTrack;
  13. class CAnimScreenFaderNode
  14. : public CAnimNode
  15. {
  16. public:
  17. AZ_CLASS_ALLOCATOR(CAnimScreenFaderNode, AZ::SystemAllocator);
  18. AZ_RTTI(CAnimScreenFaderNode, "{C24D5F2D-B17A-4350-8381-539202A99FDD}", CAnimNode);
  19. //-----------------------------------------------------------------------------
  20. //!
  21. CAnimScreenFaderNode(const int id);
  22. CAnimScreenFaderNode();
  23. ~CAnimScreenFaderNode();
  24. static void Initialize();
  25. //-----------------------------------------------------------------------------
  26. //! Overrides from CAnimNode
  27. void Animate(SAnimContext& ac) override;
  28. void CreateDefaultTracks() override;
  29. void OnReset() override;
  30. void Activate(bool bActivate) override;
  31. void Serialize(XmlNodeRef& xmlNode, bool bLoading, bool bLoadEmptyTracks) override;
  32. //-----------------------------------------------------------------------------
  33. //! Overrides from IAnimNode
  34. unsigned int GetParamCount() const override;
  35. CAnimParamType GetParamType(unsigned int nIndex) const override;
  36. void SetFlags(int flags) override;
  37. void Render() override;
  38. bool IsAnyTextureVisible() const;
  39. static void Reflect(AZ::ReflectContext* context);
  40. protected:
  41. bool GetParamInfoFromType(const CAnimParamType& paramId, SParamInfo& info) const override;
  42. bool NeedToRender() const override { return true; }
  43. private:
  44. CAnimScreenFaderNode(const CAnimScreenFaderNode&);
  45. CAnimScreenFaderNode& operator = (const CAnimScreenFaderNode&);
  46. private:
  47. //-----------------------------------------------------------------------------
  48. //!
  49. void PrecacheTexData();
  50. Vec4 m_startColor;
  51. bool m_bActive;
  52. float m_screenWidth, m_screenHeight;
  53. int m_lastActivatedKey;
  54. bool m_texPrecached;
  55. };
  56. #endif // CRYINCLUDE_CRYMOVIE_ANIMSCREENFADERNODE_H