From bca7804bb6e1bf5ce5a99b9ae4806be25e36993c Mon Sep 17 00:00:00 2001 From: Vaxry <43317083+vaxerski@users.noreply.github.com> Date: Sat, 27 Apr 2024 12:43:12 +0100 Subject: internal: Window storage rework - part 1 (#5762) * Window storage rework - part 1 * format * remove useless include * fix pch * format * fix crash in dwindle * fix vram leak * prefer .expired() for bool checks --- src/helpers/AnimatedVariable.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/helpers/AnimatedVariable.hpp') diff --git a/src/helpers/AnimatedVariable.hpp b/src/helpers/AnimatedVariable.hpp index 4c24f642..02849306 100644 --- a/src/helpers/AnimatedVariable.hpp +++ b/src/helpers/AnimatedVariable.hpp @@ -6,7 +6,7 @@ #include #include "Vector2D.hpp" #include "Color.hpp" -#include "../macros.hpp" +#include "../defines.hpp" #include "../debug/Log.hpp" #include "../desktop/DesktopTypes.hpp" @@ -68,7 +68,7 @@ concept Animable = OneOf; class CBaseAnimatedVariable { public: CBaseAnimatedVariable(ANIMATEDVARTYPE type); - void create(SAnimationPropertyConfig* pAnimConfig, CWindow* pWindow, AVARDAMAGEPOLICY policy); + void create(SAnimationPropertyConfig* pAnimConfig, PHLWINDOW pWindow, AVARDAMAGEPOLICY policy); void create(SAnimationPropertyConfig* pAnimConfig, SLayerSurface* pLayer, AVARDAMAGEPOLICY policy); void create(SAnimationPropertyConfig* pAnimConfig, PHLWORKSPACE pWorkspace, AVARDAMAGEPOLICY policy); void create(SAnimationPropertyConfig* pAnimConfig, AVARDAMAGEPOLICY policy); @@ -140,12 +140,12 @@ class CBaseAnimatedVariable { m_bRemoveEndAfterRan = false; } - CWindow* getWindow() { - return (CWindow*)m_pWindow; + PHLWINDOW getWindow() { + return m_pWindow.lock(); } protected: - void* m_pWindow = nullptr; + PHLWINDOWREF m_pWindow; std::weak_ptr m_pWorkspace; void* m_pLayer = nullptr; @@ -208,7 +208,7 @@ class CAnimatedVariable : public CBaseAnimatedVariable { public: CAnimatedVariable() : CBaseAnimatedVariable(typeToANIMATEDVARTYPE) {} // dummy var - void create(const VarType& value, SAnimationPropertyConfig* pAnimConfig, CWindow* pWindow, AVARDAMAGEPOLICY policy) { + void create(const VarType& value, SAnimationPropertyConfig* pAnimConfig, PHLWINDOW pWindow, AVARDAMAGEPOLICY policy) { create(pAnimConfig, pWindow, policy); m_Value = value; m_Goal = value; -- cgit v1.2.3