improve all vector types by deunionifying them

This commit is contained in:
jacekpoz 2024-08-13 14:22:09 +02:00
parent e994825668
commit ef2fdaab86
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -1,65 +1,63 @@
#ifndef PTK_PTK_VEC_H_
#define PTK_PTK_VEC_H_
typedef union {
struct { // PtkVec2, PtkPos
float x;
float y;
};
struct { // PtkSize
float w;
float h;
};
struct { // PtkSize
float width;
float height;
};
typedef struct {
float x;
float y;
} PtkVec2;
typedef PtkVec2 PtkPos;
typedef PtkVec2 PtkSize;
typedef union {
struct { // PtkVec3
float x;
float y;
float z;
struct {
float w;
float h;
};
struct { // PtkColor
struct {
float width;
float height;
};
} PtkSize;
typedef struct {
float x;
float y;
float z;
} PtkVec3;
typedef union {
struct {
float r;
float g;
float b;
};
struct { // PtkColor
struct {
float red;
float green;
float blue;
};
} PtkVec3;
} PtkColor;
typedef PtkVec3 PtkColor;
typedef struct {
float x;
float y;
float z;
float w;
} PtkVec4;
typedef union {
struct { // PtkVec4
float x;
float y;
float z;
float w;
};
struct { // PtkColorA
struct {
float r;
float g;
float b;
float a;
};
struct { // PtkColorA
struct {
float red;
float green;
float blue;
float alpha;
};
} PtkVec4;
typedef PtkVec4 PtkColorA;
} PtkColorA;
#endif // PTK_PTK_VEC_H_