Mercurial > sdl-ios-xcode
diff include/SDL_surface.h @ 4929:aa8888658021
Use the enumerated type for blend and scale mode instead of int
Renamed SDL_TextureScaleMode to SDL_ScaleMode
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 12 Dec 2010 15:19:05 -0800 |
parents | 274743af0430 |
children | 68da5a234bba |
line wrap: on
line diff
--- a/include/SDL_surface.h Thu Dec 02 11:56:23 2010 -0800 +++ b/include/SDL_surface.h Sun Dec 12 15:19:05 2010 -0800 @@ -32,6 +32,8 @@ #include "SDL_stdinc.h" #include "SDL_pixels.h" #include "SDL_rect.h" +#include "SDL_blendmode.h" +#include "SDL_scalemode.h" #include "SDL_rwops.h" #include "begin_code.h" @@ -88,7 +90,7 @@ struct SDL_BlitMap *map; /**< Private */ /** format version, bumped at every change to invalidate blit maps */ - unsigned int format_version; /**< Private */ + int format_version; /**< Private */ /** Reference count -- used when freeing surface */ int refcount; /**< Read-mostly */ @@ -300,7 +302,7 @@ * \sa SDL_GetSurfaceBlendMode() */ extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface, - int blendMode); + SDL_BlendMode blendMode); /** * \brief Get the blend mode used for blit operations. @@ -313,13 +315,13 @@ * \sa SDL_SetSurfaceBlendMode() */ extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface, - int *blendMode); + SDL_BlendMode *blendMode); /** * \brief Set the scale mode used for blit operations. * * \param surface The surface to update. - * \param scaleMode ::SDL_TextureScaleMode to use for blit scaling. + * \param scaleMode ::SDL_ScaleMode to use for blit scaling. * * \return 0 on success, or -1 if the surface is not valid or the scale mode is * not supported. @@ -331,7 +333,7 @@ * \sa SDL_GetSurfaceScaleMode() */ extern DECLSPEC int SDLCALL SDL_SetSurfaceScaleMode(SDL_Surface * surface, - int scaleMode); + SDL_ScaleMode scaleMode); /** * \brief Get the scale mode used for blit operations. @@ -344,7 +346,7 @@ * \sa SDL_SetSurfaceScaleMode() */ extern DECLSPEC int SDLCALL SDL_GetSurfaceScaleMode(SDL_Surface * surface, - int *scaleMode); + SDL_ScaleMode *scaleMode); /** * Sets the clipping rectangle for the destination surface in a blit. @@ -413,10 +415,10 @@ */ extern DECLSPEC int SDLCALL SDL_BlendPoint (SDL_Surface * dst, int x, int y, - int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); extern DECLSPEC int SDLCALL SDL_BlendPoints (SDL_Surface * dst, const SDL_Point * points, int count, - int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /** * Draws a line with \c color. @@ -438,10 +440,10 @@ */ extern DECLSPEC int SDLCALL SDL_BlendLine (SDL_Surface * dst, int x1, int y1, int x2, int y2, - int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); extern DECLSPEC int SDLCALL SDL_BlendLines (SDL_Surface * dst, const SDL_Point * points, int count, - int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /** * Draws the given rectangle with \c color. @@ -467,10 +469,10 @@ */ extern DECLSPEC int SDLCALL SDL_BlendRect (SDL_Surface * dst, const SDL_Rect * rect, - int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); extern DECLSPEC int SDLCALL SDL_BlendRects (SDL_Surface * dst, const SDL_Rect ** rects, int count, - int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /** * Performs a fast fill of the given rectangle with \c color. @@ -496,92 +498,10 @@ */ extern DECLSPEC int SDLCALL SDL_BlendFillRect (SDL_Surface * dst, const SDL_Rect * rect, - int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); extern DECLSPEC int SDLCALL SDL_BlendFillRects (SDL_Surface * dst, const SDL_Rect ** rects, int count, - int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); - -#if 0 -/** - * Draws the given circle with \c color. - * - * The color should be a pixel of the format used by the surface, and - * can be generated by the SDL_MapRGB() function. - * - * \return 0 on success, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_DrawCircle - (SDL_Surface * dst, int x, int y, int radius, Uint32 color); - -/** - * Blends an RGBA value into the outline of the given circle. - * - * \return 0 on success, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_BlendCircle - (SDL_Surface * dst, int x, int y, int radius, - int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); - -/** - * Fills the given circle with \c color. - * - * The color should be a pixel of the format used by the surface, and - * can be generated by the SDL_MapRGB() function. - * - * \return 0 on success, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_FillCircle - (SDL_Surface * dst, int x, int y, int radius, Uint32 color); - -/** - * Blends an RGBA value into the given circle. - * - * \return This function returns 0 on success, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_BlendFillCircle - (SDL_Surface * dst, int x, int y, int radius, - int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); - -/** - * Draws the given ellipse with \c color. - * - * The color should be a pixel of the format used by the surface, and - * can be generated by the SDL_MapRGB() function. - * - * \return 0 on success, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_DrawEllipse - (SDL_Surface * dst, int x, int y, int w, int h, Uint32 color); - -/** - * Blends an RGBA value into the outline of the given ellipse. - * - * \return 0 on success, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_BlendEllipse - (SDL_Surface * dst, int x, int y, int w, int h, - int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); - -/** - * Fills the given ellipse with \c color. - * - * The color should be a pixel of the format used by the surface, and - * can be generated by the SDL_MapRGB() function. - * - * \return 0 on success, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_FillEllipse - (SDL_Surface * dst, int x, int y, int w, int h, Uint32 color); - -/** - * Blends an RGBA value into the given ellipse. - * - * \return This function returns 0 on success, or -1 on error. - */ -extern DECLSPEC int SDLCALL SDL_BlendFillEllipse - (SDL_Surface * dst, int x, int y, int w, int h, - int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); -#endif // 0 + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a); /** * Performs a fast blit from the source surface to the destination surface.