From b96657178f8ef081f115a8a00be8f434b1744510 Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Wed, 9 Sep 2009 21:35:32 +0000 Subject: [PATCH] [CHG] Blend mode functions now using GRRLIB_blendMode --- GRRLIB/GRRLIB/GRRLIB_core.c | 4 ++-- GRRLIB/GRRLIB/grrlib.h | 20 +++++++++----------- GRRLIB/GRRLIB/grrlib/GRRLIB__inline.h | 8 ++++---- GRRLIB/GRRLIB/grrlib/GRRLIB_settings.h | 4 ++-- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/GRRLIB/GRRLIB/GRRLIB_core.c b/GRRLIB/GRRLIB/GRRLIB_core.c index 81f8ee5..3b23d35 100644 --- a/GRRLIB/GRRLIB/GRRLIB_core.c +++ b/GRRLIB/GRRLIB/GRRLIB_core.c @@ -62,14 +62,14 @@ int GRRLIB_Init (void) { switch (rmode->viTVMode) { case VI_DEBUG_PAL: // PAL 50hz 576i //rmode = &TVPal574IntDfScale; - rmode = &TVPal528IntDf; //! BC ...this is still wrong, but "less bad" for now + rmode = &TVPal528IntDf; // BC ...this is still wrong, but "less bad" for now break; } // 16:9 and 4:3 Screen Adjustment if (CONF_GetAspectRatio() == CONF_ASPECT_16_9) { rmode->viWidth = 678; - rmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 678)/2; //! This probably needs to consider PAL + rmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 678)/2; // This probably needs to consider PAL } else { // 4:3 rmode->viWidth = 672; rmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 672)/2; diff --git a/GRRLIB/GRRLIB/grrlib.h b/GRRLIB/GRRLIB/grrlib.h index 3100955..be9af69 100644 --- a/GRRLIB/GRRLIB/grrlib.h +++ b/GRRLIB/GRRLIB/grrlib.h @@ -78,11 +78,10 @@ typedef unsigned int uint; //============================================================================== // Primitive colour macros //============================================================================== -// Feel free to convert these to inline functions if it floats your boat -#define R(c) (((c) >>24) &0xFF) /**< Exract RED component of colour. */ -#define G(c) (((c) >>16) &0xFF) /**< Exract GREEN component of colour. */ -#define B(c) (((c) >> 8) &0xFF) /**< Exract BLUE component of colour. */ -#define A(c) ( (c) &0xFF) /**< Exract ALPHA component of colour. */ +#define R(c) (((c) >>24) &0xFF) /**< Exract Red component of colour. */ +#define G(c) (((c) >>16) &0xFF) /**< Exract Green component of colour. */ +#define B(c) (((c) >> 8) &0xFF) /**< Exract Blue component of colour. */ +#define A(c) ( (c) &0xFF) /**< Exract Alpha component of colour. */ /** * Build an RGB pixel from components. @@ -114,18 +113,17 @@ typedef enum GRRLIB_blendMode { GRRLIB_BLEND_INV = 4, /**< Invert Color Blending. */ } GRRLIB_blendMode; -// Blending mode aliases -#define GRRLIB_BLEND_NONE (GRRLIB_BLEND_ALPHA) -#define GRRLIB_BLEND_LIGHT (GRRLIB_BLEND_ADD) -#define GRRLIB_BLEND_SHADE (GRRLIB_BLEND_MULTI) +#define GRRLIB_BLEND_NONE (GRRLIB_BLEND_ALPHA) /**< Alias for GRRLIB_BLEND_ALPHA. */ +#define GRRLIB_BLEND_LIGHT (GRRLIB_BLEND_ADD) /**< Alias for GRRLIB_BLEND_ADD. */ +#define GRRLIB_BLEND_SHADE (GRRLIB_BLEND_MULTI) /**< Alias for GRRLIB_BLEND_MULTI. */ //------------------------------------------------------------------------------ /** * Structure to hold the current drawing settings. */ typedef struct GRRLIB_drawSettings { - bool antialias; /**< AntiAlias is enabled when set to true. */ - int blend; /**< Blending Mode. */ + bool antialias; /**< AntiAlias is enabled when set to true. */ + GRRLIB_blendMode blend; /**< Blending Mode. */ } GRRLIB_drawSettings; //------------------------------------------------------------------------------ diff --git a/GRRLIB/GRRLIB/grrlib/GRRLIB__inline.h b/GRRLIB/GRRLIB/grrlib/GRRLIB__inline.h index 63c7361..4a93b93 100644 --- a/GRRLIB/GRRLIB/grrlib/GRRLIB__inline.h +++ b/GRRLIB/GRRLIB/grrlib/GRRLIB__inline.h @@ -107,10 +107,10 @@ INLINE void GRRLIB_GetPixelFromFB (int x, int y, //------------------------------------------------------------------------------ // GRRLIB_settings.h - Rendering functions -INLINE void GRRLIB_SetBlend (const int blendmode) ; -INLINE int GRRLIB_GetBlend (void) ; -INLINE void GRRLIB_SetAntiAliasing (const bool aa) ; -INLINE bool GRRLIB_GetAntiAliasing (void) ; +INLINE void GRRLIB_SetBlend (const GRRLIB_blendMode blendmode) ; +INLINE GRRLIB_blendMode GRRLIB_GetBlend (void) ; +INLINE void GRRLIB_SetAntiAliasing (const bool aa) ; +INLINE bool GRRLIB_GetAntiAliasing (void) ; //------------------------------------------------------------------------------ // GRRLIB_texSetup.h - Create and setup textures diff --git a/GRRLIB/GRRLIB/grrlib/GRRLIB_settings.h b/GRRLIB/GRRLIB/grrlib/GRRLIB_settings.h index 1191372..b120764 100644 --- a/GRRLIB/GRRLIB/grrlib/GRRLIB_settings.h +++ b/GRRLIB/GRRLIB/grrlib/GRRLIB_settings.h @@ -36,7 +36,7 @@ extern GRRLIB_drawSettings GRRLIB_Settings; * @param blendmode The blending mode to use (Default: GRRLIB_BLEND_ALPHA). */ INLINE -void GRRLIB_SetBlend (const int blendmode) { +void GRRLIB_SetBlend (const GRRLIB_blendMode blendmode) { GRRLIB_Settings.blend = blendmode; switch (GRRLIB_Settings.blend) { case GRRLIB_BLEND_ALPHA: @@ -62,7 +62,7 @@ void GRRLIB_SetBlend (const int blendmode) { * @return The current blending mode. */ INLINE -int GRRLIB_GetBlend (void) { +GRRLIB_blendMode GRRLIB_GetBlend (void) { return GRRLIB_Settings.blend; }