mirror of
https://github.com/zeldaret/mm.git
synced 2024-11-27 06:40:36 +00:00
f8c167384e
* ovl_fbdemo_wipe5 OK * format * add trailing newline * bring over gbi.h * review Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * format * review Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * minor clenaups * review Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * Update src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> Co-authored-by: Chloe <> Co-authored-by: angie <angheloalf95@gmail.com> Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com>
57 lines
1006 B
C
57 lines
1006 B
C
#ifndef _COLOR_H_
|
|
#define _COLOR_H_
|
|
|
|
#include "PR/ultratypes.h"
|
|
|
|
// For checking the alpha bit in an RGBA16 pixel
|
|
#define RGBA16_PIXEL_OPAQUE 1
|
|
|
|
typedef struct {
|
|
/* 0x0 */ u8 r;
|
|
/* 0x1 */ u8 g;
|
|
/* 0x2 */ u8 b;
|
|
} Color_RGB8; // size = 0x3
|
|
|
|
typedef struct {
|
|
/* 0x0 */ u8 r;
|
|
/* 0x1 */ u8 g;
|
|
/* 0x2 */ u8 b;
|
|
/* 0x3 */ u8 a;
|
|
} Color_RGBA8; // size = 0x4
|
|
|
|
typedef struct {
|
|
/* 0x0 */ s16 r;
|
|
/* 0x2 */ s16 g;
|
|
/* 0x4 */ s16 b;
|
|
} Color_RGB16; // size = 0x6
|
|
|
|
// only use when necessary for alignment purposes
|
|
typedef union {
|
|
struct {
|
|
u8 r, g, b, a;
|
|
};
|
|
u32 rgba;
|
|
} Color_RGBA8_u32;
|
|
|
|
typedef struct {
|
|
f32 r, g, b, a;
|
|
} Color_RGBAf;
|
|
|
|
typedef struct {
|
|
u32 r, g, b, a;
|
|
} Color_RGBAu32;
|
|
|
|
typedef union {
|
|
struct {
|
|
u16 r : 5;
|
|
u16 g : 5;
|
|
u16 b : 5;
|
|
u16 a : 1;
|
|
};
|
|
u16 rgba;
|
|
} Color_RGBA16;
|
|
|
|
#define RGBA8(r, g, b, a) ((((r) & 0xFF) << 24) | (((g) & 0xFF) << 16) | (((b) & 0xFF) << 8) | (((a) & 0xFF) << 0))
|
|
|
|
#endif
|