summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2020-12-31 16:35:40 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2020-12-31 16:35:40 -0500
commit3f22228a220d065af3f99ba6a538ff80517ecaa2 (patch)
tree918e0254e63eb63ad9311491022ee55be2f312ac /math.c
parente26bc35d04c136a142da37a87f6ba47940399879 (diff)
configurable colors
Diffstat (limited to 'math.c')
-rw-r--r--math.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/math.c b/math.c
index 2909c66..d4adf73 100644
--- a/math.c
+++ b/math.c
@@ -700,6 +700,13 @@ static void gl_color2f(float v, float a) {
glColor4f(v,v,v,a);
}
+static void rgba_u32_to_floats(u32 rgba, float floats[static 4]) {
+ floats[0] = (float)(rgba >> 24) / 255.f;
+ floats[1] = (float)(rgba >> 16) / 255.f;
+ floats[2] = (float)(rgba >> 8) / 255.f;
+ floats[3] = (float)(rgba >> 0) / 255.f;
+}
+
// color is 0xRRGGBBAA
static void gl_color_rgba(u32 color) {
glColor4ub((u8)(color >> 24), (u8)(color >> 16), (u8)(color >> 8), (u8)color);