diff options
| author | petrie911 <69443847+petrie911@users.noreply.github.com> | 2021-03-20 14:10:10 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-20 15:10:10 -0400 |
| commit | 8f0549cd9a0c664c1bc26e6395ee5bb24244ebde (patch) | |
| tree | a06649ce6fb7de3a92685b9ea62e4e9d36367772 /include | |
| parent | 493bdbc3c690185898df5d821a48435a34b1d091 (diff) | |
PreRender decomped and equivalent (one small non-matching) (#723)
* now equivalent
* stuff
* remove struct
Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
Diffstat (limited to 'include')
| -rw-r--r-- | include/color.h | 10 | ||||
| -rw-r--r-- | include/macros.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/color.h b/include/color.h index 3152fd3cf..a005f4e6d 100644 --- a/include/color.h +++ b/include/color.h @@ -21,4 +21,14 @@ typedef struct { f32 r, g, b, a; } Color_RGBAf; +typedef union { + struct { + u16 r : 5; + u16 g : 5; + u16 b : 5; + u16 a : 1; + }; + u16 rgba; +} Color_RGB5A1; + #endif diff --git a/include/macros.h b/include/macros.h index 68f140580..b4af32102 100644 --- a/include/macros.h +++ b/include/macros.h @@ -16,6 +16,7 @@ #define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x)) #define CLAMP_MAX(x, max) ((x) > (max) ? (max) : (x)) #define CLAMP_MIN(x, min) ((x) < (min) ? (min) : (x)) +#define MEDIAN3(a1, a2, a3) ((a2 >= a1) ? ((a3 >= a2) ? a2 : ((a1 >= a3) ? a1 : a3)) : ((a2 >= a3) ? a2 : ((a3 >= a1) ? a1 : a3))) #define RGBA8(r, g, b, a) (((r & 0xFF) << 24) | ((g & 0xFF) << 16) | ((b & 0xFF) << 8) | ((a & 0xFF) << 0)) |
