summaryrefslogtreecommitdiff
path: root/core/variant.h
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-03-09 00:14:08 +0100
committerRémi Verschelde <remi@verschelde.fr>2016-03-09 00:14:08 +0100
commite46e43d2aaa6339a1675eb989f41885e745bf5c3 (patch)
treecf91f2869ff8f058c6682569fb31e22e5ee736ad /core/variant.h
parent1dad6eca812e5c2e313b54265114de8a1d73d999 (diff)
parent4a4f2479146aa33e235ed57cde311efda68d3c8f (diff)
Merge pull request #3928 from Marqin/whitespace
remove trailing whitespace - sorry for the broken PRs, please rebase :)
Diffstat (limited to 'core/variant.h')
-rw-r--r--core/variant.h52
1 files changed, 26 insertions, 26 deletions
diff --git a/core/variant.h b/core/variant.h
index d8813c4937..ed33de6660 100644
--- a/core/variant.h
+++ b/core/variant.h
@@ -75,17 +75,17 @@ class Variant {
public:
enum Type {
-
- NIL,
-
- // atomic types
+
+ NIL,
+
+ // atomic types
BOOL,
INT,
REAL,
STRING,
-
+
// math types
-
+
VECTOR2, // 5
RECT2,
VECTOR3,
@@ -95,17 +95,17 @@ public:
_AABB, //sorry naming convention fail :( not like it's used often
MATRIX3,
TRANSFORM,
-
- // misc types
+
+ // misc types
COLOR,
IMAGE, // 15
NODE_PATH,
_RID,
- OBJECT,
+ OBJECT,
INPUT_EVENT,
DICTIONARY, // 20
ARRAY,
-
+
// arrays
RAW_ARRAY,
INT_ARRAY,
@@ -114,10 +114,10 @@ public:
VECTOR2_ARRAY,
VECTOR3_ARRAY,
COLOR_ARRAY,
-
+
VARIANT_MAX
-
- };
+
+ };
private:
@@ -125,7 +125,7 @@ private:
friend class _VariantCall;
// Variant takes 20 bytes when real_t is float, and 36 if double
// it only allocates extra memory for aabb/matrix.
-
+
Type type;
struct ObjData {
@@ -133,25 +133,25 @@ private:
Object *obj;
RefPtr ref;
};
-
+
_FORCE_INLINE_ ObjData& _get_obj();
_FORCE_INLINE_ const ObjData& _get_obj() const;
union {
-
+
bool _bool;
int _int;
double _real;
Matrix32 *_matrix32;
AABB* _aabb;
Matrix3 *_matrix3;
- Transform *_transform;
+ Transform *_transform;
RefPtr *_resource;
InputEvent *_input_event;
Image *_image;
void *_ptr; //generic pointer
-#ifdef USE_QUAD_VECTORS
+#ifdef USE_QUAD_VECTORS
uint8_t _mem[sizeof(ObjData) > (sizeof(real_t)*5) ? sizeof(ObjData) : (sizeof(real_t)*5)]; // plane uses an extra real
#else
uint8_t _mem[sizeof(ObjData) > (sizeof(real_t)*4) ? sizeof(ObjData) : (sizeof(real_t)*4)];
@@ -172,7 +172,7 @@ public:
template<class T>
static Type get_type_for() {
-
+
GetSimpleType<T> t;
Variant v(t.type);
Type r = v.get_type();
@@ -231,7 +231,7 @@ public:
operator Dictionary() const;
operator Array() const;
-
+
operator DVector<uint8_t>() const;
operator DVector<int>() const;
operator DVector<real_t>() const;
@@ -260,7 +260,7 @@ public:
operator IP_Address() const;
-
+
Variant(bool p_bool);
Variant(signed int p_int); // real one
Variant(unsigned int p_int);
@@ -286,8 +286,8 @@ public:
Variant(const Vector3& p_vector3);
Variant(const Plane& p_plane);
Variant(const AABB& p_aabb);
- Variant(const Quat& p_quat);
- Variant(const Matrix3& p_transform);
+ Variant(const Quat& p_quat);
+ Variant(const Matrix3& p_transform);
Variant(const Matrix32& p_transform);
Variant(const Transform& p_transform);
Variant(const Color& p_color);
@@ -295,10 +295,10 @@ public:
Variant(const NodePath& p_path);
Variant(const RefPtr& p_resource);
Variant(const RID& p_rid);
- Variant(const Object* p_object);
+ Variant(const Object* p_object);
Variant(const InputEvent& p_input_event);
Variant(const Dictionary& p_dictionary);
-
+
Variant(const Array& p_array);
Variant(const DVector<Plane>& p_array); // helper
Variant(const DVector<uint8_t>& p_raw_array);
@@ -309,7 +309,7 @@ public:
Variant(const DVector<Color>& p_color_array);
Variant(const DVector<Face3>& p_face_array);
-
+
Variant(const Vector<Variant>& p_array);
Variant(const Vector<uint8_t>& p_raw_array);
Variant(const Vector<int>& p_int_array);