Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/c2d/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ static inline void C2D_SceneBegin(C3D_RenderTarget* target)
* the rendered pixels will all have the fading color. Everything inbetween is
* rendered as a blend of the original pixel color and the fading color.
*/
void C2D_Fade(u32 color);
bool C2D_Fade(u32 color);

/** @brief Configures the formula used to calculate the tinted texture color
* @param[in] mode Tinting mode
Expand All @@ -318,7 +318,7 @@ void C2D_Fade(u32 color);
* This function can be used to change how the tinted texture color is precisely
* calculated, refer to \ref C2D_TintMode for a list of available tinting modes.
*/
void C2D_SetTintMode(C2D_TintMode mode);
bool C2D_SetTintMode(C2D_TintMode mode);

/** @} */

Expand Down
6 changes: 4 additions & 2 deletions source/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,17 +299,18 @@ void C2D_TargetClear(C3D_RenderTarget* target, u32 color)
C3D_RenderTargetClear(target, C3D_CLEAR_ALL, __builtin_bswap32(color), 0);
}

void C2D_Fade(u32 color)
bool C2D_Fade(u32 color)
{
C2Di_Context* ctx = C2Di_GetContext();
if (!(ctx->flags & C2DiF_Active))
return false;

ctx->flags |= C2DiF_DirtyFade;
ctx->fadeClr = color;
return true;
}

void C2D_SetTintMode(C2D_TintMode mode)
bool C2D_SetTintMode(C2D_TintMode mode)
{
C2Di_Context* ctx = C2Di_GetContext();
if (!(ctx->flags & C2DiF_Active))
Expand All @@ -331,6 +332,7 @@ void C2D_SetTintMode(C2D_TintMode mode)
}

ctx->flags = (ctx->flags &~ C2DiF_TintMode_Mask) | (new_mode << (C2DiF_TintMode_Shift - C2DiF_Mode_Shift));
return true;
}

static inline void C2Di_RotatePoint(float* point, float rsin, float rcos)
Expand Down