diff options
author | Marc Gilleron <marc.gilleron@gmail.com> | 2017-04-30 16:27:10 +0200 |
---|---|---|
committer | Marc Gilleron <marc.gilleron@gmail.com> | 2017-06-24 01:01:36 +0200 |
commit | 659897cfb8bda0377d798a6f73505d537e521cf9 (patch) | |
tree | db94c76d34d51e9ec97213a08c9654825707fad4 /scene/resources/texture.h | |
parent | 00e5ba314393ce2cc4df883bc1742306007ed117 (diff) |
Added Curve resource
- New resource for curves in y(x) form
- CurveTexture now has a Curve
- Curve and CurveTexture share the same editor
Diffstat (limited to 'scene/resources/texture.h')
-rw-r--r-- | scene/resources/texture.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/scene/resources/texture.h b/scene/resources/texture.h index 2b82dbd21f..2c36cdef87 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -30,6 +30,7 @@ #ifndef TEXTURE_H #define TEXTURE_H +#include "curve.h" #include "io/resource_loader.h" #include "math_2d.h" #include "resource.h" @@ -389,20 +390,22 @@ public: ~CubeMap(); }; -VARIANT_ENUM_CAST(CubeMap::Flags); -VARIANT_ENUM_CAST(CubeMap::Side); -VARIANT_ENUM_CAST(CubeMap::Storage); +VARIANT_ENUM_CAST(CubeMap::Flags) +VARIANT_ENUM_CAST(CubeMap::Side) +VARIANT_ENUM_CAST(CubeMap::Storage) class CurveTexture : public Texture { - GDCLASS(CurveTexture, Texture); - RES_BASE_EXTENSION("curvetex"); + GDCLASS(CurveTexture, Texture) + RES_BASE_EXTENSION("curvetex") private: - RID texture; - PoolVector<Vector2> points; - float min, max; - int width; + RID _texture; + Ref<Curve> _curve; + float _min, _max; + int _width; + + void _update(); protected: static void _bind_methods(); @@ -417,8 +420,10 @@ public: void set_width(int p_width); int get_width() const; - void set_points(const PoolVector<Vector2> &p_points); - PoolVector<Vector2> get_points() const; + void ensure_default_setup(); + + void set_curve(Ref<Curve> p_curve); + Ref<Curve> get_curve() const; virtual RID get_rid() const; |