summaryrefslogtreecommitdiff
path: root/include/SDL_surface.h
diff options
context:
space:
mode:
authorSam Lantinga <slouken@libsdl.org>2010-12-12 15:19:05 -0800
committerSam Lantinga <slouken@libsdl.org>2010-12-12 15:19:05 -0800
commit638768c2f22d811cf961280ecb27cb39d7b520d5 (patch)
treebdc9c5221cd7e515963b1b927e9f09f0659b31bc /include/SDL_surface.h
parentbf61e1026fdb68d1c6caea8a8c4cfb8c12b520a2 (diff)
downloadsdl-638768c2f22d811cf961280ecb27cb39d7b520d5.tar.gz
Use the enumerated type for blend and scale mode instead of int
Renamed SDL_TextureScaleMode to SDL_ScaleMode
Diffstat (limited to 'include/SDL_surface.h')
-rw-r--r--include/SDL_surface.h112
1 files changed, 16 insertions, 96 deletions
diff --git a/include/SDL_surface.h b/include/SDL_surface.h
index 2068076f3..63c4fac49 100644
--- a/include/SDL_surface.h
+++ b/include/SDL_surface.h
@@ -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 @@ typedef struct SDL_Surface
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 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface,
* \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 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
* \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 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
* \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 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceScaleMode(SDL_Surface * surface,
* \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_DrawPoints
*/
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_DrawLines
*/
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_DrawRects
*/
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_FillRects
*/
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.