Fixed some bugs with buffers during font building
This commit is contained in:
@ -8,55 +8,46 @@
|
||||
|
||||
namespace Dawn {
|
||||
struct Color {
|
||||
uint8_t r, g, b, a;
|
||||
|
||||
glm::vec4 precision() {
|
||||
return {
|
||||
(float_t)r / 255.0f,
|
||||
(float_t)g / 255.0f,
|
||||
(float_t)b / 255.0f,
|
||||
(float_t)a / 100.0f
|
||||
};
|
||||
}
|
||||
float_t r, g, b, a;
|
||||
|
||||
struct Color operator * (const float_t &x) {
|
||||
return {
|
||||
(uint8_t)(r * x),
|
||||
(uint8_t)(g * x),
|
||||
(uint8_t)(b * x),
|
||||
(uint8_t)(a * x)
|
||||
r * x,
|
||||
g * x,
|
||||
b * x,
|
||||
a * x
|
||||
};
|
||||
}
|
||||
|
||||
struct Color operator - (const struct Color &color) {
|
||||
return {
|
||||
(uint8_t)(r - color.r),
|
||||
(uint8_t)(g - color.g),
|
||||
(uint8_t)(b - color.b),
|
||||
(uint8_t)(a - color.a)
|
||||
r - color.r,
|
||||
g - color.g,
|
||||
b - color.b,
|
||||
a - color.a
|
||||
};
|
||||
}
|
||||
|
||||
struct Color operator + (const struct Color &color) {
|
||||
return {
|
||||
(uint8_t)(r + color.r),
|
||||
(uint8_t)(g + color.g),
|
||||
(uint8_t)(b + color.b),
|
||||
(uint8_t)(a + color.a)
|
||||
r + color.r,
|
||||
g + color.g,
|
||||
b + color.b,
|
||||
a + color.a
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
#define COLOR_WHITE { 255, 255, 255, 255 }
|
||||
#define COLOR_RED { 255, 0, 0, 255 }
|
||||
#define COLOR_GREEN { 0, 255, 0, 255 }
|
||||
#define COLOR_BLUE { 0, 0, 255, 255 }
|
||||
#define COLOR_BLACK { 0, 0, 0, 255 }
|
||||
#define COLOR_MAGENTA { 255, 0, 255, 255 }
|
||||
#define COLOR_DARK_GREY { 50, 50, 50, 255 }
|
||||
#define COLOR_LIGHT_GREY { 204, 204, 204, 255 }
|
||||
#define COLOR_CORNFLOWER_BLUE { 100, 149, 237, 255 }
|
||||
#define COLOR_WHITE_TRANSPARENT { 255, 255, 255, 0 }
|
||||
#define COLOR_WHITE { 1.0f, 1.0f, 1.0f, 1.0f }
|
||||
#define COLOR_RED { 1.0f, 0, 0, 1.0f }
|
||||
#define COLOR_GREEN { 0, 1.0f, 0, 1.0f }
|
||||
#define COLOR_BLUE { 0, 0, 1.0f, 1.0f }
|
||||
#define COLOR_BLACK { 0, 0, 0, 1.0f }
|
||||
#define COLOR_MAGENTA { 1.0f, 0, 1.0f, 1.0f }
|
||||
#define COLOR_DARK_GREY { 0.19607843137254901961f, 0.19607843137254901961f, 0.19607843137254901961f, 1.0f }
|
||||
#define COLOR_LIGHT_GREY { 0.8f, 0.8f, 0.8f, 1.0f }
|
||||
#define COLOR_CORNFLOWER_BLUE { 0.39215686274509803922f, 0.58431372549019607843f, 0.92941176470588235294f, 1.0f }
|
||||
#define COLOR_WHITE_TRANSPARENT { 1.0f, 1.0f, 1.0f, 0 }
|
||||
#define COLOR_BLACK_TRANSPARENT { 0, 0, 0, 0 }
|
||||
#define COLOR_TRANSPARENT COLOR_BLACK_TRANSPARENT
|
||||
}
|
Reference in New Issue
Block a user