summaryrefslogtreecommitdiff
path: root/src/helpers/AnimatedVariable.hpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2024-04-27 12:43:12 +0100
committerGitHub <noreply@github.com>2024-04-27 12:43:12 +0100
commitbca7804bb6e1bf5ce5a99b9ae4806be25e36993c (patch)
treeebd3a578de1dfe11b54f9440cfc3a408ffa6a620 /src/helpers/AnimatedVariable.hpp
parent25aec3ac8ce65ed224f025f8f6dfef73780577a4 (diff)
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
Diffstat (limited to 'src/helpers/AnimatedVariable.hpp')
-rw-r--r--src/helpers/AnimatedVariable.hpp12
1 files changed, 6 insertions, 6 deletions
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 <type_traits>
#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<T, Vector2D, float, CColor>;
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<CWorkspace> m_pWorkspace;
void* m_pLayer = nullptr;
@@ -208,7 +208,7 @@ class CAnimatedVariable : public CBaseAnimatedVariable {
public:
CAnimatedVariable() : CBaseAnimatedVariable(typeToANIMATEDVARTYPE<VarType>) {} // 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;