[CHG] Blend mode functions now using GRRLIB_blendMode

This commit is contained in:
Crayon2000 2009-09-09 21:35:32 +00:00
parent 70ece3cdc5
commit b96657178f
4 changed files with 17 additions and 19 deletions

View file

@ -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;

View file

@ -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,10 +113,9 @@ 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. */
//------------------------------------------------------------------------------
/**
@ -125,7 +123,7 @@ typedef enum GRRLIB_blendMode {
*/
typedef struct GRRLIB_drawSettings {
bool antialias; /**< AntiAlias is enabled when set to true. */
int blend; /**< Blending Mode. */
GRRLIB_blendMode blend; /**< Blending Mode. */
} GRRLIB_drawSettings;
//------------------------------------------------------------------------------

View file

@ -107,8 +107,8 @@ 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_SetBlend (const GRRLIB_blendMode blendmode) ;
INLINE GRRLIB_blendMode GRRLIB_GetBlend (void) ;
INLINE void GRRLIB_SetAntiAliasing (const bool aa) ;
INLINE bool GRRLIB_GetAntiAliasing (void) ;

View file

@ -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;
}