mirror of
https://github.com/GRRLIB/GRRLIB.git
synced 2024-09-20 12:45:05 +00:00
[CHG] Blend mode functions now using GRRLIB_blendMode
This commit is contained in:
parent
70ece3cdc5
commit
b96657178f
4 changed files with 17 additions and 19 deletions
|
@ -62,14 +62,14 @@ int GRRLIB_Init (void) {
|
||||||
switch (rmode->viTVMode) {
|
switch (rmode->viTVMode) {
|
||||||
case VI_DEBUG_PAL: // PAL 50hz 576i
|
case VI_DEBUG_PAL: // PAL 50hz 576i
|
||||||
//rmode = &TVPal574IntDfScale;
|
//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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 16:9 and 4:3 Screen Adjustment
|
// 16:9 and 4:3 Screen Adjustment
|
||||||
if (CONF_GetAspectRatio() == CONF_ASPECT_16_9) {
|
if (CONF_GetAspectRatio() == CONF_ASPECT_16_9) {
|
||||||
rmode->viWidth = 678;
|
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
|
} else { // 4:3
|
||||||
rmode->viWidth = 672;
|
rmode->viWidth = 672;
|
||||||
rmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 672)/2;
|
rmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 672)/2;
|
||||||
|
|
|
@ -78,11 +78,10 @@ typedef unsigned int uint;
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
// Primitive colour macros
|
// 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 R(c) (((c) >>24) &0xFF) /**< Exract RED component of colour. */
|
#define G(c) (((c) >>16) &0xFF) /**< Exract Green 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 B(c) (((c) >> 8) &0xFF) /**< Exract BLUE component of colour. */
|
#define A(c) ( (c) &0xFF) /**< Exract Alpha component of colour. */
|
||||||
#define A(c) ( (c) &0xFF) /**< Exract ALPHA component of colour. */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Build an RGB pixel from components.
|
* Build an RGB pixel from components.
|
||||||
|
@ -114,18 +113,17 @@ typedef enum GRRLIB_blendMode {
|
||||||
GRRLIB_BLEND_INV = 4, /**< Invert Color Blending. */
|
GRRLIB_BLEND_INV = 4, /**< Invert Color Blending. */
|
||||||
} GRRLIB_blendMode;
|
} GRRLIB_blendMode;
|
||||||
|
|
||||||
// Blending mode aliases
|
#define GRRLIB_BLEND_NONE (GRRLIB_BLEND_ALPHA) /**< Alias for GRRLIB_BLEND_ALPHA. */
|
||||||
#define GRRLIB_BLEND_NONE (GRRLIB_BLEND_ALPHA)
|
#define GRRLIB_BLEND_LIGHT (GRRLIB_BLEND_ADD) /**< Alias for GRRLIB_BLEND_ADD. */
|
||||||
#define GRRLIB_BLEND_LIGHT (GRRLIB_BLEND_ADD)
|
#define GRRLIB_BLEND_SHADE (GRRLIB_BLEND_MULTI) /**< Alias for GRRLIB_BLEND_MULTI. */
|
||||||
#define GRRLIB_BLEND_SHADE (GRRLIB_BLEND_MULTI)
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* Structure to hold the current drawing settings.
|
* Structure to hold the current drawing settings.
|
||||||
*/
|
*/
|
||||||
typedef struct GRRLIB_drawSettings {
|
typedef struct GRRLIB_drawSettings {
|
||||||
bool antialias; /**< AntiAlias is enabled when set to true. */
|
bool antialias; /**< AntiAlias is enabled when set to true. */
|
||||||
int blend; /**< Blending Mode. */
|
GRRLIB_blendMode blend; /**< Blending Mode. */
|
||||||
} GRRLIB_drawSettings;
|
} GRRLIB_drawSettings;
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
|
@ -107,10 +107,10 @@ INLINE void GRRLIB_GetPixelFromFB (int x, int y,
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// GRRLIB_settings.h - Rendering functions
|
// GRRLIB_settings.h - Rendering functions
|
||||||
INLINE void GRRLIB_SetBlend (const int blendmode) ;
|
INLINE void GRRLIB_SetBlend (const GRRLIB_blendMode blendmode) ;
|
||||||
INLINE int GRRLIB_GetBlend (void) ;
|
INLINE GRRLIB_blendMode GRRLIB_GetBlend (void) ;
|
||||||
INLINE void GRRLIB_SetAntiAliasing (const bool aa) ;
|
INLINE void GRRLIB_SetAntiAliasing (const bool aa) ;
|
||||||
INLINE bool GRRLIB_GetAntiAliasing (void) ;
|
INLINE bool GRRLIB_GetAntiAliasing (void) ;
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// GRRLIB_texSetup.h - Create and setup textures
|
// GRRLIB_texSetup.h - Create and setup textures
|
||||||
|
|
|
@ -36,7 +36,7 @@ extern GRRLIB_drawSettings GRRLIB_Settings;
|
||||||
* @param blendmode The blending mode to use (Default: GRRLIB_BLEND_ALPHA).
|
* @param blendmode The blending mode to use (Default: GRRLIB_BLEND_ALPHA).
|
||||||
*/
|
*/
|
||||||
INLINE
|
INLINE
|
||||||
void GRRLIB_SetBlend (const int blendmode) {
|
void GRRLIB_SetBlend (const GRRLIB_blendMode blendmode) {
|
||||||
GRRLIB_Settings.blend = blendmode;
|
GRRLIB_Settings.blend = blendmode;
|
||||||
switch (GRRLIB_Settings.blend) {
|
switch (GRRLIB_Settings.blend) {
|
||||||
case GRRLIB_BLEND_ALPHA:
|
case GRRLIB_BLEND_ALPHA:
|
||||||
|
@ -62,7 +62,7 @@ void GRRLIB_SetBlend (const int blendmode) {
|
||||||
* @return The current blending mode.
|
* @return The current blending mode.
|
||||||
*/
|
*/
|
||||||
INLINE
|
INLINE
|
||||||
int GRRLIB_GetBlend (void) {
|
GRRLIB_blendMode GRRLIB_GetBlend (void) {
|
||||||
return GRRLIB_Settings.blend;
|
return GRRLIB_Settings.blend;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue