summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2013-10-14 18:07:31 +0100
committerRobert Bragg <robert@linux.intel.com>2013-10-14 18:07:31 +0100
commit88018b90361215ec33fa317a2c3caf54beffbffa (patch)
tree4f142f4087f3aee7ba1cd9f2b655e07a1286d564
parent60fcd9c87cf5d8ae8c41134217ee0e1fa2fbd46e (diff)
downloadcogl-88018b90361215ec33fa317a2c3caf54beffbffa.tar.gz
Remove padding from eulers and quaternions
One of the notable advantages of a Euler representation of a rotation is that it is compact but we negate that benefit if all CoglEulers have enough padding to potentially cache a quaternion in the future. Having padding for all CoglQuaternions is probably also unnecessary as higher level code can find its own ways of caching data relating to quaternions. Reviewed-by: Neil Roberts <neil@linux.intel.com>
-rw-r--r--cogl/cogl-euler.h10
-rw-r--r--cogl/cogl-quaternion.h8
2 files changed, 2 insertions, 16 deletions
diff --git a/cogl/cogl-euler.h b/cogl/cogl-euler.h
index bf526d7a..c73cc81e 100644
--- a/cogl/cogl-euler.h
+++ b/cogl/cogl-euler.h
@@ -146,16 +146,8 @@ struct _CoglEuler
float heading;
float pitch;
float roll;
-
- /*< private > */
- /* May cached a quaternion here in the future */
- float padding0;
- float padding1;
- float padding2;
- float padding3;
- float padding4;
};
-COGL_STRUCT_SIZE_ASSERT (CoglEuler, 32);
+COGL_STRUCT_SIZE_ASSERT (CoglEuler, 12);
/**
* cogl_euler_init:
diff --git a/cogl/cogl-quaternion.h b/cogl/cogl-quaternion.h
index 02be22e8..5db274c4 100644
--- a/cogl/cogl-quaternion.h
+++ b/cogl/cogl-quaternion.h
@@ -128,14 +128,8 @@ struct _CoglQuaternion
float x;
float y;
float z;
-
- /*< private >*/
- float padding0;
- float padding1;
- float padding2;
- float padding3;
};
-COGL_STRUCT_SIZE_ASSERT (CoglQuaternion, 32);
+COGL_STRUCT_SIZE_ASSERT (CoglQuaternion, 16);
/**
* cogl_quaternion_init: