From 51229a29f8c7e6b10cb99ee0363a4e2f29df40b6 Mon Sep 17 00:00:00 2001 From: Karl Zylinski Date: Mon, 6 Nov 2023 15:20:41 +0100 Subject: [PATCH] Raylib: use fixed array instead of struct for rl.Color. This makes swizzling etc work, but the memory layout is still the same --- vendor/raylib/raylib.odin | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/vendor/raylib/raylib.odin b/vendor/raylib/raylib.odin index aa67fd906..21d044145 100644 --- a/vendor/raylib/raylib.odin +++ b/vendor/raylib/raylib.odin @@ -245,12 +245,9 @@ when USE_LINALG { } // Color, 4 components, R8G8B8A8 (32bit) -Color :: struct { - r: u8, // Color red value - g: u8, // Color green value - b: u8, // Color blue value - a: u8, // Color alpha value -} +// +// Note: In Raylib this is a struct. But here we use a fixed array, so that .rgba swizzling etc work. +Color :: distinct [4]u8 // Rectangle type Rectangle :: struct {