mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-18 15:11:51 +00:00
Allow reading vec3_whatever_t as vec2 directly
It's a union in a struct in a union in a struct. Oh god, what have I done. git-svn-id: https://svn.eduke32.com/eduke32@7830 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
52db0e37f7
commit
490b7249a2
1 changed files with 16 additions and 5 deletions
|
@ -837,17 +837,28 @@ typedef struct {
|
|||
} vec2d_t;
|
||||
|
||||
typedef struct MAY_ALIAS {
|
||||
int32_t x, y, z;
|
||||
union {
|
||||
struct { int32_t x, y, z; };
|
||||
vec2_t vec2;
|
||||
};
|
||||
} vec3_t;
|
||||
|
||||
typedef struct MAY_ALIAS {
|
||||
int16_t x, y, z;
|
||||
union {
|
||||
struct { int16_t x, y, z; };
|
||||
vec2_16_t vec2;
|
||||
};
|
||||
} vec3_16_t;
|
||||
|
||||
typedef struct {
|
||||
union { float x; float d; };
|
||||
union { float y; float u; };
|
||||
union { float z; float v; };
|
||||
union {
|
||||
struct {
|
||||
union { float x, d; };
|
||||
union { float y, u; };
|
||||
union { float z, v; };
|
||||
};
|
||||
vec2f_t vec2;
|
||||
};
|
||||
} vec3f_t;
|
||||
|
||||
EDUKE32_STATIC_ASSERT(sizeof(vec3f_t) == sizeof(float) * 3);
|
||||
|
|
Loading…
Reference in a new issue