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_ #ifndef PTK_PTK_VEC_H_
#define PTK_PTK_VEC_H_ #define PTK_PTK_VEC_H_
typedef union { typedef struct {
struct { // PtkVec2, PtkPos
float x; float x;
float y; float y;
};
struct { // PtkSize
float w;
float h;
};
struct { // PtkSize
float width;
float height;
};
} PtkVec2; } PtkVec2;
typedef PtkVec2 PtkPos; typedef PtkVec2 PtkPos;
typedef PtkVec2 PtkSize;
typedef union { typedef union {
struct { // PtkVec3 struct {
float w;
float h;
};
struct {
float width;
float height;
};
} PtkSize;
typedef struct {
float x; float x;
float y; float y;
float z; float z;
}; } PtkVec3;
struct { // PtkColor
typedef union {
struct {
float r; float r;
float g; float g;
float b; float b;
}; };
struct { // PtkColor struct {
float red; float red;
float green; float green;
float blue; float blue;
}; };
} PtkVec3; } PtkColor;
typedef PtkVec3 PtkColor; typedef struct {
typedef union {
struct { // PtkVec4
float x; float x;
float y; float y;
float z; float z;
float w; float w;
}; } PtkVec4;
struct { // PtkColorA
typedef union {
struct {
float r; float r;
float g; float g;
float b; float b;
float a; float a;
}; };
struct { // PtkColorA struct {
float red; float red;
float green; float green;
float blue; float blue;
float alpha; float alpha;
}; };
} PtkVec4; } PtkColorA;
typedef PtkVec4 PtkColorA;
#endif // PTK_PTK_VEC_H_ #endif // PTK_PTK_VEC_H_