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 x; float w;
float y; float h;
float z;
}; };
struct { // PtkColor struct {
float width;
float height;
};
} PtkSize;
typedef struct {
float x;
float y;
float z;
} PtkVec3;
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 {
float x;
float y;
float z;
float w;
} PtkVec4;
typedef union { typedef union {
struct { // PtkVec4 struct {
float x;
float y;
float z;
float w;
};
struct { // PtkColorA
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_