Loading...
Searching...
No Matches
colormath.h
Go to the documentation of this file.
1
50#ifndef OPENSNES_COLORMATH_H
51#define OPENSNES_COLORMATH_H
52
53#include <snes/types.h>
54
55/*============================================================================
56 * Layer Masks (for colorMathEnable)
57 *============================================================================*/
58
60#define COLORMATH_BG1 BIT(0)
61
63#define COLORMATH_BG2 BIT(1)
64
66#define COLORMATH_BG3 BIT(2)
67
69#define COLORMATH_BG4 BIT(3)
70
72#define COLORMATH_OBJ BIT(4)
73
75#define COLORMATH_BACKDROP BIT(5)
76
78#define COLORMATH_ALL 0x3F
79
80/*============================================================================
81 * Color Math Operations
82 *============================================================================*/
83
85#define COLORMATH_ADD 0
86
88#define COLORMATH_SUB 1
89
90/*============================================================================
91 * Color Math Source
92 *============================================================================*/
93
95#define COLORMATH_SRC_SUBSCREEN 0
96
98#define COLORMATH_SRC_FIXED 1
99
100/*============================================================================
101 * Color Math Enable Conditions
102 *============================================================================*/
103
105#define COLORMATH_ALWAYS 0
106
108#define COLORMATH_INSIDE 1
109
111#define COLORMATH_OUTSIDE 2
112
114#define COLORMATH_NEVER 3
115
116/*============================================================================
117 * Fixed Color Channel Masks
118 *============================================================================*/
119
121#define COLDATA_RED 0x20
122
124#define COLDATA_GREEN 0x40
125
127#define COLDATA_BLUE 0x80
128
130#define COLDATA_ALL (COLDATA_RED | COLDATA_GREEN | COLDATA_BLUE)
131
132/*============================================================================
133 * Core Color Math Functions
134 *============================================================================*/
135
141void colorMathInit(void);
142
150void colorMathEnable(u8 layers);
151
156
163
172void colorMathSetHalf(u8 enable);
173
182
188void colorMathSetCondition(u8 condition);
189
200
207void colorMathSetChannel(u8 channel, u8 intensity);
208
209/*============================================================================
210 * Color Math Effect Helpers
211 *============================================================================*/
212
224
233void colorMathShadow(u8 layers, u8 intensity);
234
245void colorMathTint(u8 layers, u8 r, u8 g, u8 b);
246
255void colorMathSetBrightness(u8 brightness);
256
257#endif /* OPENSNES_COLORMATH_H */
void colorMathSetCondition(u8 condition)
Set when color math is enabled (window control)
void colorMathEnable(u8 layers)
Enable color math for specified layers.
void colorMathShadow(u8 layers, u8 intensity)
Set up shadow/darkening effect.
void colorMathTransparency50(u8 layers)
Set up 50% transparency for layers.
void colorMathSetBrightness(u8 brightness)
Set brightness for fade effects.
void colorMathSetFixedColor(u8 r, u8 g, u8 b)
Set fixed color for blending.
void colorMathSetHalf(u8 enable)
Enable or disable half mode.
void colorMathSetOp(u8 op)
Set color math operation (add or subtract)
void colorMathTint(u8 layers, u8 r, u8 g, u8 b)
Set up color tint effect.
void colorMathDisable(void)
Disable all color math.
void colorMathInit(void)
Initialize color math to defaults.
void colorMathSetSource(u8 source)
Set color math source.
void colorMathSetChannel(u8 channel, u8 intensity)
Set a single fixed color channel.
static u16 b
Definition main.c:157
unsigned char u8
8-bit unsigned integer (0 to 255)
Definition types.h:46
OpenSNES Standard Types.