From de6d1b558f8096d5859feb4fa1e1c08dff7e2a58 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 12 Dec 2010 15:19:05 -0800 Subject: [PATCH] Use the enumerated type for blend and scale mode instead of int Renamed SDL_TextureScaleMode to SDL_ScaleMode --- Makefile.in | 47 +++++++++- include/SDL_blendmode.h | 64 +++++++++++++ include/SDL_compat.h | 8 ++ include/SDL_scalemode.h | 69 ++++++++++++++ include/SDL_surface.h | 112 ++++------------------- include/SDL_video.h | 48 ++-------- src/video/SDL_blendfillrect.c | 18 ++-- src/video/SDL_blendline.c | 20 ++-- src/video/SDL_blendpoint.c | 18 ++-- src/video/SDL_blendrect.c | 4 +- src/video/SDL_renderer_gl.c | 23 +++-- src/video/SDL_renderer_gles.c | 23 +++-- src/video/SDL_renderer_sw.c | 2 +- src/video/SDL_surface.c | 20 ++-- src/video/SDL_sysvideo.h | 6 +- src/video/SDL_video.c | 18 ++-- src/video/directfb/SDL_DirectFB_render.c | 14 +-- src/video/nds/SDL_ndsrender.c | 2 +- src/video/photon/SDL_photon_render.c | 29 +++--- src/video/ps3/SDL_ps3render.c | 2 +- src/video/qnxgf/SDL_gf_render.c | 2 +- src/video/win32/SDL_ceddrawrender.c | 6 +- src/video/win32/SDL_d3drender.c | 22 ++--- src/video/win32/SDL_gapirender.c | 4 +- src/video/win32/SDL_gdirender.c | 14 +-- src/video/x11/SDL_x11render.c | 22 ++--- test/common.c | 8 +- test/testsprite2.c | 12 +-- 28 files changed, 355 insertions(+), 282 deletions(-) create mode 100644 include/SDL_blendmode.h create mode 100644 include/SDL_scalemode.h diff --git a/Makefile.in b/Makefile.in index 49fe163e7..02bbc9950 100644 --- a/Makefile.in +++ b/Makefile.in @@ -44,7 +44,52 @@ EMBEDSPU = @EMBEDSPU@ DIST = acinclude autogen.sh Borland.html Borland.zip BUGS build-scripts configure configure.in COPYING CREDITS include INSTALL Makefile.minimal Makefile.in README* sdl-config.in sdl.m4 sdl.pc.in SDL.spec SDL.spec.in src test TODO VisualC.html VisualC VisualCE Watcom-Win32.zip WhatsNew Xcode Xcode-iPhoneOS -HDRS = SDL.h SDL_assert.h SDL_atomic.h SDL_audio.h SDL_clipboard.h SDL_compat.h SDL_cpuinfo.h SDL_endian.h SDL_error.h SDL_events.h SDL_gesture.h SDL_haptic.h SDL_input.h SDL_joystick.h SDL_keyboard.h SDL_keysym.h SDL_loadso.h SDL_main.h SDL_mouse.h SDL_mutex.h SDL_name.h SDL_opengl.h SDL_opengles.h SDL_pixels.h SDL_platform.h SDL_power.h SDL_quit.h SDL_rect.h SDL_revision.h SDL_rwops.h SDL_scancode.h SDL_shape.h SDL_stdinc.h SDL_surface.h SDL_syswm.h SDL_thread.h SDL_timer.h SDL_touch.h SDL_types.h SDL_version.h SDL_video.h begin_code.h close_code.h +HDRS = \ + SDL.h \ + SDL_assert.h \ + SDL_atomic.h \ + SDL_audio.h \ + SDL_blendmode.h \ + SDL_clipboard.h \ + SDL_compat.h \ + SDL_cpuinfo.h \ + SDL_endian.h \ + SDL_error.h \ + SDL_events.h \ + SDL_gesture.h \ + SDL_haptic.h \ + SDL_input.h \ + SDL_joystick.h \ + SDL_keyboard.h \ + SDL_keysym.h \ + SDL_loadso.h \ + SDL_main.h \ + SDL_mouse.h \ + SDL_mutex.h \ + SDL_name.h \ + SDL_opengl.h \ + SDL_opengles.h \ + SDL_pixels.h \ + SDL_platform.h \ + SDL_power.h \ + SDL_quit.h \ + SDL_rect.h \ + SDL_revision.h \ + SDL_rwops.h \ + SDL_scalemode.h \ + SDL_scancode.h \ + SDL_shape.h \ + SDL_stdinc.h \ + SDL_surface.h \ + SDL_syswm.h \ + SDL_thread.h \ + SDL_timer.h \ + SDL_touch.h \ + SDL_types.h \ + SDL_version.h \ + SDL_video.h \ + begin_code.h \ + close_code.h LT_AGE = @LT_AGE@ LT_CURRENT = @LT_CURRENT@ diff --git a/include/SDL_blendmode.h b/include/SDL_blendmode.h new file mode 100644 index 000000000..33aa719fe --- /dev/null +++ b/include/SDL_blendmode.h @@ -0,0 +1,64 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2010 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_blendmode.h + * + * Header file declaring the SDL_BlendMode enumeration + */ + +#ifndef _SDL_blendmode_h +#define _SDL_blendmode_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * \brief The blend mode used in SDL_RenderCopy() and drawing operations. + */ +typedef enum +{ + SDL_BLENDMODE_NONE = 0x00000000, /**< No blending */ + SDL_BLENDMODE_MASK = 0x00000001, /**< dst = A ? src : dst + (alpha is mask) */ + + SDL_BLENDMODE_BLEND = 0x00000002, /**< dst = (src * A) + (dst * (1-A)) */ + SDL_BLENDMODE_ADD = 0x00000004, /**< dst = (src * A) + dst */ + SDL_BLENDMODE_MOD = 0x00000008 /**< dst = src * dst */ +} SDL_BlendMode; + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_video_h */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/include/SDL_compat.h b/include/SDL_compat.h index 1af228ac5..3bac6d9ce 100644 --- a/include/SDL_compat.h +++ b/include/SDL_compat.h @@ -202,6 +202,14 @@ typedef enum SDL_GRAB_ON = 1 } SDL_GrabMode; +typedef enum +{ + SDL_TEXTURESCALEMODE_NONE = SDL_SCALEMODE_NONE, + SDL_TEXTURESCALEMODE_FAST = SDL_SCALEMODE_FAST, + SDL_TEXTURESCALEMODE_SLOW = SDL_SCALEMODE_SLOW, + SDL_TEXTURESCALEMODE_BEST = SDL_SCALEMODE_BEST +} SDL_TextureScaleMode; + struct SDL_SysWMinfo; /** diff --git a/include/SDL_scalemode.h b/include/SDL_scalemode.h new file mode 100644 index 000000000..a658c68bb --- /dev/null +++ b/include/SDL_scalemode.h @@ -0,0 +1,69 @@ +/* + SDL - Simple DirectMedia Layer + Copyright (C) 1997-2010 Sam Lantinga + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Sam Lantinga + slouken@libsdl.org +*/ + +/** + * \file SDL_scalemode.h + * + * Header file declaring the SDL_ScaleMode enumeration + */ + +#ifndef _SDL_scalemode_h +#define _SDL_scalemode_h + +#include "begin_code.h" +/* Set up for C function definitions, even when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +extern "C" { +/* *INDENT-ON* */ +#endif + +/** + * \brief The texture scale mode used in SDL_RenderCopy(). + */ +typedef enum +{ + SDL_SCALEMODE_NONE = 0x00000000, /**< No scaling, rectangles must + match dimensions */ + + SDL_SCALEMODE_FAST = 0x00000001, /**< Point sampling or + equivalent algorithm */ + + SDL_SCALEMODE_SLOW = 0x00000002, /**< Linear filtering or + equivalent algorithm */ + + SDL_SCALEMODE_BEST = 0x00000004 /**< Bicubic filtering or + equivalent algorithm */ +} SDL_ScaleMode; + + +/* Ends C function definitions when using C++ */ +#ifdef __cplusplus +/* *INDENT-OFF* */ +} +/* *INDENT-ON* */ +#endif +#include "close_code.h" + +#endif /* _SDL_video_h */ + +/* vi: set ts=4 sw=4 expandtab: */ 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. diff --git a/include/SDL_video.h b/include/SDL_video.h index 5743460fa..83f3d0cbc 100644 --- a/include/SDL_video.h +++ b/include/SDL_video.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_surface.h" #include "begin_code.h" @@ -213,38 +215,6 @@ typedef enum SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */ } SDL_TextureModulate; -/** - * \brief The blend mode used in SDL_RenderCopy() and drawing operations. - */ -typedef enum -{ - SDL_BLENDMODE_NONE = 0x00000000, /**< No blending */ - SDL_BLENDMODE_MASK = 0x00000001, /**< dst = A ? src : dst - (alpha is mask) */ - - SDL_BLENDMODE_BLEND = 0x00000002, /**< dst = (src * A) + (dst * (1-A)) */ - SDL_BLENDMODE_ADD = 0x00000004, /**< dst = (src * A) + dst */ - SDL_BLENDMODE_MOD = 0x00000008 /**< dst = src * dst */ -} SDL_BlendMode; - -/** - * \brief The texture scale mode used in SDL_RenderCopy(). - */ -typedef enum -{ - SDL_TEXTURESCALEMODE_NONE = 0x00000000, /**< No scaling, rectangles must - match dimensions */ - - SDL_TEXTURESCALEMODE_FAST = 0x00000001, /**< Point sampling or - equivalent algorithm */ - - SDL_TEXTURESCALEMODE_SLOW = 0x00000002, /**< Linear filtering or - equivalent algorithm */ - - SDL_TEXTURESCALEMODE_BEST = 0x00000004 /**< Bicubic filtering or - equivalent algorithm */ -} SDL_TextureScaleMode; - /** * \brief An efficient driver-specific representation of pixel data */ @@ -986,7 +956,7 @@ extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture, * \sa SDL_GetTextureBlendMode() */ extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture, - int blendMode); + SDL_BlendMode blendMode); /** * \brief Get the blend mode used for texture copy operations. @@ -999,13 +969,13 @@ extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture, * \sa SDL_SetTextureBlendMode() */ extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture, - int *blendMode); + SDL_BlendMode *blendMode); /** * \brief Set the scale mode used for texture copy operations. * * \param texture The texture to update. - * \param scaleMode ::SDL_TextureScaleMode to use for texture scaling. + * \param scaleMode ::SDL_ScaleMode to use for texture scaling. * * \return 0 on success, or -1 if the texture is not valid or the scale mode is * not supported. @@ -1016,7 +986,7 @@ extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture, * \sa SDL_GetTextureScaleMode() */ extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture, - int scaleMode); + SDL_ScaleMode scaleMode); /** * \brief Get the scale mode used for texture copy operations. @@ -1029,7 +999,7 @@ extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture, * \sa SDL_SetTextureScaleMode() */ extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture, - int *scaleMode); + SDL_ScaleMode *scaleMode); /** * \brief Update the given texture rectangle with new pixel data. @@ -1135,7 +1105,7 @@ extern DECLSPEC int SDL_GetRenderDrawColor(Uint8 * r, Uint8 * g, Uint8 * b, * * \sa SDL_GetRenderDrawBlendMode() */ -extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(int blendMode); +extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_BlendMode blendMode); /** * \brief Get the blend mode used for drawing operations. @@ -1146,7 +1116,7 @@ extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(int blendMode); * * \sa SDL_SetRenderDrawBlendMode() */ -extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(int *blendMode); +extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_BlendMode *blendMode); /** * \brief Clear the current rendering target with the drawing color diff --git a/src/video/SDL_blendfillrect.c b/src/video/SDL_blendfillrect.c index 8c1da6d54..617b1601f 100644 --- a/src/video/SDL_blendfillrect.c +++ b/src/video/SDL_blendfillrect.c @@ -26,7 +26,7 @@ static int SDL_BlendFillRect_RGB555(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) { unsigned inva = 0xff - a; @@ -49,7 +49,7 @@ SDL_BlendFillRect_RGB555(SDL_Surface * dst, const SDL_Rect * rect, static int SDL_BlendFillRect_RGB565(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) { unsigned inva = 0xff - a; @@ -72,7 +72,7 @@ SDL_BlendFillRect_RGB565(SDL_Surface * dst, const SDL_Rect * rect, static int SDL_BlendFillRect_RGB888(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) { unsigned inva = 0xff - a; @@ -95,7 +95,7 @@ SDL_BlendFillRect_RGB888(SDL_Surface * dst, const SDL_Rect * rect, static int SDL_BlendFillRect_ARGB8888(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) { unsigned inva = 0xff - a; @@ -118,7 +118,7 @@ SDL_BlendFillRect_ARGB8888(SDL_Surface * dst, const SDL_Rect * rect, static int SDL_BlendFillRect_RGB(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) { SDL_PixelFormat *fmt = dst->format; unsigned inva = 0xff - a; @@ -164,7 +164,7 @@ SDL_BlendFillRect_RGB(SDL_Surface * dst, const SDL_Rect * rect, static int SDL_BlendFillRect_RGBA(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) { SDL_PixelFormat *fmt = dst->format; unsigned inva = 0xff - a; @@ -194,7 +194,7 @@ SDL_BlendFillRect_RGBA(SDL_Surface * dst, const SDL_Rect * rect, int 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) { SDL_Rect clipped; @@ -263,12 +263,12 @@ SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect, int SDL_BlendFillRects(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) { SDL_Rect clipped; int i; int (*func)(SDL_Surface * dst, const SDL_Rect * rect, - int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) = NULL; + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) = NULL; int status = 0; if (!dst) { diff --git a/src/video/SDL_blendline.c b/src/video/SDL_blendline.c index bf8d04e22..3c24624d4 100644 --- a/src/video/SDL_blendline.c +++ b/src/video/SDL_blendline.c @@ -26,7 +26,7 @@ static void SDL_BlendLine_RGB2(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, SDL_bool draw_end) { const SDL_PixelFormat *fmt = dst->format; @@ -118,7 +118,7 @@ SDL_BlendLine_RGB2(SDL_Surface * dst, int x1, int y1, int x2, int y2, static void SDL_BlendLine_RGB555(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, SDL_bool draw_end) { const SDL_PixelFormat *fmt = dst->format; @@ -210,7 +210,7 @@ SDL_BlendLine_RGB555(SDL_Surface * dst, int x1, int y1, int x2, int y2, static void SDL_BlendLine_RGB565(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, SDL_bool draw_end) { const SDL_PixelFormat *fmt = dst->format; @@ -302,7 +302,7 @@ SDL_BlendLine_RGB565(SDL_Surface * dst, int x1, int y1, int x2, int y2, static void SDL_BlendLine_RGB4(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, SDL_bool draw_end) { const SDL_PixelFormat *fmt = dst->format; @@ -394,7 +394,7 @@ SDL_BlendLine_RGB4(SDL_Surface * dst, int x1, int y1, int x2, int y2, static void SDL_BlendLine_RGBA4(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, SDL_bool draw_end) { const SDL_PixelFormat *fmt = dst->format; @@ -486,7 +486,7 @@ SDL_BlendLine_RGBA4(SDL_Surface * dst, int x1, int y1, int x2, int y2, static void SDL_BlendLine_RGB888(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, SDL_bool draw_end) { const SDL_PixelFormat *fmt = dst->format; @@ -578,7 +578,7 @@ SDL_BlendLine_RGB888(SDL_Surface * dst, int x1, int y1, int x2, int y2, static void SDL_BlendLine_ARGB8888(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, SDL_bool draw_end) { const SDL_PixelFormat *fmt = dst->format; @@ -670,7 +670,7 @@ SDL_BlendLine_ARGB8888(SDL_Surface * dst, int x1, int y1, int x2, int y2, typedef void (*BlendLineFunc) (SDL_Surface * dst, int x1, int y1, int x2, int y2, - int blendMode, + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a, SDL_bool draw_end); @@ -707,7 +707,7 @@ SDL_CalculateBlendLineFunc(const SDL_PixelFormat * fmt) int 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) { BlendLineFunc func; @@ -734,7 +734,7 @@ SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2, int 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) { int i; int x1, y1; diff --git a/src/video/SDL_blendpoint.c b/src/video/SDL_blendpoint.c index ab9ec598d..dfd346804 100644 --- a/src/video/SDL_blendpoint.c +++ b/src/video/SDL_blendpoint.c @@ -24,7 +24,7 @@ #include "SDL_draw.h" static int -SDL_BlendPoint_RGB555(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r, +SDL_BlendPoint_RGB555(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { unsigned inva = 0xff - a; @@ -47,7 +47,7 @@ SDL_BlendPoint_RGB555(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r, } static int -SDL_BlendPoint_RGB565(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r, +SDL_BlendPoint_RGB565(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { unsigned inva = 0xff - a; @@ -70,7 +70,7 @@ SDL_BlendPoint_RGB565(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r, } static int -SDL_BlendPoint_RGB888(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r, +SDL_BlendPoint_RGB888(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { unsigned inva = 0xff - a; @@ -93,7 +93,7 @@ SDL_BlendPoint_RGB888(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r, } static int -SDL_BlendPoint_ARGB8888(SDL_Surface * dst, int x, int y, int blendMode, +SDL_BlendPoint_ARGB8888(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { unsigned inva = 0xff - a; @@ -116,7 +116,7 @@ SDL_BlendPoint_ARGB8888(SDL_Surface * dst, int x, int y, int blendMode, } static int -SDL_BlendPoint_RGB(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r, +SDL_BlendPoint_RGB(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { SDL_PixelFormat *fmt = dst->format; @@ -162,7 +162,7 @@ SDL_BlendPoint_RGB(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r, } static int -SDL_BlendPoint_RGBA(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r, +SDL_BlendPoint_RGBA(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { SDL_PixelFormat *fmt = dst->format; @@ -192,7 +192,7 @@ SDL_BlendPoint_RGBA(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r, } int -SDL_BlendPoint(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r, +SDL_BlendPoint(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) { if (!dst) { @@ -258,14 +258,14 @@ SDL_BlendPoint(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r, int 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) { int minx, miny; int maxx, maxy; int i; int x, y; int (*func)(SDL_Surface * dst, int x, int y, - int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) = NULL; + SDL_BlendMode blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a) = NULL; int status = 0; if (!dst) { diff --git a/src/video/SDL_blendrect.c b/src/video/SDL_blendrect.c index 2045ac30a..850177d47 100644 --- a/src/video/SDL_blendrect.c +++ b/src/video/SDL_blendrect.c @@ -26,7 +26,7 @@ int 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) { SDL_Rect full_rect; SDL_Point points[5]; @@ -60,7 +60,7 @@ SDL_BlendRect(SDL_Surface * dst, const SDL_Rect * rect, int 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) { int i; diff --git a/src/video/SDL_renderer_gl.c b/src/video/SDL_renderer_gl.c index 0f01ff4a8..845309624 100644 --- a/src/video/SDL_renderer_gl.c +++ b/src/video/SDL_renderer_gl.c @@ -126,8 +126,7 @@ SDL_RenderDriver GL_RenderDriver = { SDL_TEXTUREMODULATE_ALPHA), (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD), - (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST | - SDL_TEXTURESCALEMODE_SLOW), + (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST | SDL_SCALEMODE_SLOW), 15, { SDL_PIXELFORMAT_INDEX1LSB, @@ -1004,17 +1003,17 @@ static int GL_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) { switch (texture->scaleMode) { - case SDL_TEXTURESCALEMODE_NONE: - case SDL_TEXTURESCALEMODE_FAST: - case SDL_TEXTURESCALEMODE_SLOW: + case SDL_SCALEMODE_NONE: + case SDL_SCALEMODE_FAST: + case SDL_SCALEMODE_SLOW: return 0; - case SDL_TEXTURESCALEMODE_BEST: + case SDL_SCALEMODE_BEST: SDL_Unsupported(); - texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW; + texture->scaleMode = SDL_SCALEMODE_SLOW; return -1; default: SDL_Unsupported(); - texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; + texture->scaleMode = SDL_SCALEMODE_NONE; return -1; } } @@ -1365,15 +1364,15 @@ GL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, if (texture->scaleMode != data->scaleMode) { switch (texture->scaleMode) { - case SDL_TEXTURESCALEMODE_NONE: - case SDL_TEXTURESCALEMODE_FAST: + case SDL_SCALEMODE_NONE: + case SDL_SCALEMODE_FAST: data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER, GL_NEAREST); data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER, GL_NEAREST); break; - case SDL_TEXTURESCALEMODE_SLOW: - case SDL_TEXTURESCALEMODE_BEST: + case SDL_SCALEMODE_SLOW: + case SDL_SCALEMODE_BEST: data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER, GL_LINEAR); data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER, diff --git a/src/video/SDL_renderer_gles.c b/src/video/SDL_renderer_gles.c index 80397a055..dd81e90bb 100644 --- a/src/video/SDL_renderer_gles.c +++ b/src/video/SDL_renderer_gles.c @@ -112,8 +112,7 @@ SDL_RenderDriver GL_ES_RenderDriver = { SDL_TEXTUREMODULATE_ALPHA), (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD), - (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST | - SDL_TEXTURESCALEMODE_SLOW), 5, + (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST | SDL_SCALEMODE_SLOW), 5, { /* OpenGL ES 1.x supported formats list */ SDL_PIXELFORMAT_ABGR4444, @@ -533,17 +532,17 @@ static int GLES_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) { switch (texture->scaleMode) { - case SDL_TEXTURESCALEMODE_NONE: - case SDL_TEXTURESCALEMODE_FAST: - case SDL_TEXTURESCALEMODE_SLOW: + case SDL_SCALEMODE_NONE: + case SDL_SCALEMODE_FAST: + case SDL_SCALEMODE_SLOW: return 0; - case SDL_TEXTURESCALEMODE_BEST: + case SDL_SCALEMODE_BEST: SDL_Unsupported(); - texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW; + texture->scaleMode = SDL_SCALEMODE_SLOW; return -1; default: SDL_Unsupported(); - texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; + texture->scaleMode = SDL_SCALEMODE_NONE; return -1; } } @@ -859,15 +858,15 @@ GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, GLES_SetBlendMode(data, texture->blendMode, 0); switch (texture->scaleMode) { - case SDL_TEXTURESCALEMODE_NONE: - case SDL_TEXTURESCALEMODE_FAST: + case SDL_SCALEMODE_NONE: + case SDL_SCALEMODE_FAST: data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER, GL_NEAREST); data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER, GL_NEAREST); break; - case SDL_TEXTURESCALEMODE_SLOW: - case SDL_TEXTURESCALEMODE_BEST: + case SDL_SCALEMODE_SLOW: + case SDL_SCALEMODE_BEST: data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER, GL_LINEAR); data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER, diff --git a/src/video/SDL_renderer_sw.c b/src/video/SDL_renderer_sw.c index 4117765e0..604584f20 100644 --- a/src/video/SDL_renderer_sw.c +++ b/src/video/SDL_renderer_sw.c @@ -90,7 +90,7 @@ SDL_RenderDriver SW_RenderDriver = { SDL_TEXTUREMODULATE_ALPHA), (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD), - (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST), + (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST), 14, { SDL_PIXELFORMAT_INDEX8, diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c index 16bce3c1b..810360ee2 100644 --- a/src/video/SDL_surface.c +++ b/src/video/SDL_surface.c @@ -438,7 +438,7 @@ SDL_GetSurfaceAlphaMod(SDL_Surface * surface, Uint8 * alpha) } int -SDL_SetSurfaceBlendMode(SDL_Surface * surface, int blendMode) +SDL_SetSurfaceBlendMode(SDL_Surface * surface, SDL_BlendMode blendMode) { int flags, status; @@ -486,7 +486,7 @@ SDL_SetSurfaceBlendMode(SDL_Surface * surface, int blendMode) } int -SDL_GetSurfaceBlendMode(SDL_Surface * surface, int *blendMode) +SDL_GetSurfaceBlendMode(SDL_Surface * surface, SDL_BlendMode *blendMode) { if (!surface) { return -1; @@ -519,7 +519,7 @@ SDL_GetSurfaceBlendMode(SDL_Surface * surface, int *blendMode) } int -SDL_SetSurfaceScaleMode(SDL_Surface * surface, int scaleMode) +SDL_SetSurfaceScaleMode(SDL_Surface * surface, SDL_ScaleMode scaleMode) { int flags, status; @@ -531,13 +531,13 @@ SDL_SetSurfaceScaleMode(SDL_Surface * surface, int scaleMode) flags = surface->map->info.flags; surface->map->info.flags &= ~(SDL_COPY_NEAREST); switch (scaleMode) { - case SDL_TEXTURESCALEMODE_NONE: + case SDL_SCALEMODE_NONE: break; - case SDL_TEXTURESCALEMODE_FAST: + case SDL_SCALEMODE_FAST: surface->map->info.flags |= SDL_COPY_NEAREST; break; - case SDL_TEXTURESCALEMODE_SLOW: - case SDL_TEXTURESCALEMODE_BEST: + case SDL_SCALEMODE_SLOW: + case SDL_SCALEMODE_BEST: SDL_Unsupported(); surface->map->info.flags |= SDL_COPY_NEAREST; status = -1; @@ -555,7 +555,7 @@ SDL_SetSurfaceScaleMode(SDL_Surface * surface, int scaleMode) } int -SDL_GetSurfaceScaleMode(SDL_Surface * surface, int *scaleMode) +SDL_GetSurfaceScaleMode(SDL_Surface * surface, SDL_ScaleMode *scaleMode) { if (!surface) { return -1; @@ -567,10 +567,10 @@ SDL_GetSurfaceScaleMode(SDL_Surface * surface, int *scaleMode) switch (surface->map->info.flags & SDL_COPY_NEAREST) { case SDL_COPY_NEAREST: - *scaleMode = SDL_TEXTURESCALEMODE_FAST; + *scaleMode = SDL_SCALEMODE_FAST; break; default: - *scaleMode = SDL_TEXTURESCALEMODE_NONE; + *scaleMode = SDL_SCALEMODE_NONE; break; } return 0; diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h index 35e3097a5..0ec683bd8 100644 --- a/src/video/SDL_sysvideo.h +++ b/src/video/SDL_sysvideo.h @@ -46,8 +46,8 @@ struct SDL_Texture int w; /**< The width of the texture */ int h; /**< The height of the texture */ int modMode; /**< The texture modulation mode */ - int blendMode; /**< The texture blend mode */ - int scaleMode; /**< The texture scale mode */ + SDL_BlendMode blendMode; /**< The texture blend mode */ + SDL_ScaleMode scaleMode; /**< The texture scale mode */ Uint8 r, g, b, a; /**< Texture modulation values */ SDL_Renderer *renderer; @@ -121,7 +121,7 @@ struct SDL_Renderer SDL_Texture *textures; Uint8 r, g, b, a; /**< Color for drawing operations values */ - int blendMode; /**< The drawing blend mode */ + SDL_BlendMode blendMode; /**< The drawing blend mode */ void *driverdata; }; diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index b16454620..560e4bbb8 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -1959,8 +1959,8 @@ SDL_CreateTextureFromSurface(Uint32 format, SDL_Surface * surface) { Uint8 r, g, b, a; - int blendMode; - int scaleMode; + SDL_BlendMode blendMode; + SDL_ScaleMode scaleMode; SDL_GetSurfaceColorMod(surface, &r, &g, &b); SDL_SetTextureColorMod(texture, r, g, b); @@ -2129,7 +2129,7 @@ SDL_GetTextureAlphaMod(SDL_Texture * texture, Uint8 * alpha) } int -SDL_SetTextureBlendMode(SDL_Texture * texture, int blendMode) +SDL_SetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode blendMode) { SDL_Renderer *renderer; @@ -2145,7 +2145,7 @@ SDL_SetTextureBlendMode(SDL_Texture * texture, int blendMode) } int -SDL_GetTextureBlendMode(SDL_Texture * texture, int *blendMode) +SDL_GetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode *blendMode) { CHECK_TEXTURE_MAGIC(texture, -1); @@ -2156,7 +2156,7 @@ SDL_GetTextureBlendMode(SDL_Texture * texture, int *blendMode) } int -SDL_SetTextureScaleMode(SDL_Texture * texture, int scaleMode) +SDL_SetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode scaleMode) { SDL_Renderer *renderer; @@ -2172,7 +2172,7 @@ SDL_SetTextureScaleMode(SDL_Texture * texture, int scaleMode) } int -SDL_GetTextureScaleMode(SDL_Texture * texture, int *scaleMode) +SDL_GetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode *scaleMode) { CHECK_TEXTURE_MAGIC(texture, -1); @@ -2315,7 +2315,7 @@ SDL_GetRenderDrawColor(Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a) } int -SDL_SetRenderDrawBlendMode(int blendMode) +SDL_SetRenderDrawBlendMode(SDL_BlendMode blendMode) { SDL_Renderer *renderer; @@ -2332,7 +2332,7 @@ SDL_SetRenderDrawBlendMode(int blendMode) } int -SDL_GetRenderDrawBlendMode(int *blendMode) +SDL_GetRenderDrawBlendMode(SDL_BlendMode *blendMode) { SDL_Renderer *renderer; @@ -2354,7 +2354,7 @@ SDL_RenderClear() return -1; } if (!renderer->RenderClear) { - int blendMode = renderer->blendMode; + SDL_BlendMode blendMode = renderer->blendMode; int status; if (blendMode >= SDL_BLENDMODE_BLEND) { diff --git a/src/video/directfb/SDL_DirectFB_render.c b/src/video/directfb/SDL_DirectFB_render.c index d2c582eee..5320fc662 100644 --- a/src/video/directfb/SDL_DirectFB_render.c +++ b/src/video/directfb/SDL_DirectFB_render.c @@ -104,8 +104,8 @@ SDL_RenderDriver DirectFB_RenderDriver = { SDL_TEXTUREMODULATE_ALPHA), (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD), - (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST | - SDL_TEXTURESCALEMODE_SLOW | SDL_TEXTURESCALEMODE_BEST), + (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST | + SDL_SCALEMODE_SLOW | SDL_SCALEMODE_BEST), 14, { SDL_PIXELFORMAT_INDEX4LSB, @@ -711,21 +711,21 @@ DirectFB_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata; switch (texture->scaleMode) { - case SDL_TEXTURESCALEMODE_NONE: - case SDL_TEXTURESCALEMODE_FAST: + case SDL_SCALEMODE_NONE: + case SDL_SCALEMODE_FAST: data->render_options = DSRO_NONE; break; - case SDL_TEXTURESCALEMODE_SLOW: + case SDL_SCALEMODE_SLOW: data->render_options = DSRO_SMOOTH_UPSCALE | DSRO_SMOOTH_DOWNSCALE; break; - case SDL_TEXTURESCALEMODE_BEST: + case SDL_SCALEMODE_BEST: data->render_options = DSRO_SMOOTH_UPSCALE | DSRO_SMOOTH_DOWNSCALE | DSRO_ANTIALIAS; break; default: SDL_Unsupported(); data->render_options = DSRO_NONE; - texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; + texture->scaleMode = SDL_SCALEMODE_NONE; return -1; } #endif diff --git a/src/video/nds/SDL_ndsrender.c b/src/video/nds/SDL_ndsrender.c index b2af205bb..3ff158372 100644 --- a/src/video/nds/SDL_ndsrender.c +++ b/src/video/nds/SDL_ndsrender.c @@ -82,7 +82,7 @@ SDL_RenderDriver NDS_RenderDriver = { (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC), /* u32 flags */ (SDL_TEXTUREMODULATE_NONE), /* u32 mod_modes */ (SDL_BLENDMODE_MASK), /* u32 blend_modes */ - (SDL_TEXTURESCALEMODE_FAST), /* u32 scale_modes */ + (SDL_SCALEMODE_FAST), /* u32 scale_modes */ 3, /* u32 num_texture_formats */ { SDL_PIXELFORMAT_INDEX8, diff --git a/src/video/photon/SDL_photon_render.c b/src/video/photon/SDL_photon_render.c index cf719a3a1..1e4719bcd 100644 --- a/src/video/photon/SDL_photon_render.c +++ b/src/video/photon/SDL_photon_render.c @@ -104,8 +104,7 @@ SDL_RenderDriver photon_renderdriver = { (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_ALPHA), (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD), - (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_SLOW | - SDL_TEXTURESCALEMODE_FAST), + (SDL_SCALEMODE_NONE | SDL_SCALEMODE_SLOW | SDL_SCALEMODE_FAST), 10, {SDL_PIXELFORMAT_INDEX8, SDL_PIXELFORMAT_RGB555, @@ -254,17 +253,17 @@ photon_createrenderer(SDL_Window * window, Uint32 flags) /* Set current scale blitting capabilities */ if (rdata->surfaces_type==SDL_PHOTON_SURFTYPE_OFFSCREEN) { - renderer->info.scale_modes=SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_SLOW; + renderer->info.scale_modes=SDL_SCALEMODE_NONE | SDL_SCALEMODE_SLOW; if ((didata->mode_2dcaps & SDL_VIDEO_PHOTON_CAP_SCALED_BLIT)==SDL_VIDEO_PHOTON_CAP_SCALED_BLIT) { /* This video mode supports hardware scaling */ - renderer->info.scale_modes|=SDL_TEXTURESCALEMODE_FAST; + renderer->info.scale_modes|=SDL_SCALEMODE_FAST; } } else { /* PhImage blit functions do not support scaling */ - renderer->info.scale_modes=SDL_TEXTURESCALEMODE_NONE; + renderer->info.scale_modes=SDL_SCALEMODE_NONE; } return renderer; @@ -984,39 +983,39 @@ photon_settexturescalemode(SDL_Renderer * renderer, SDL_Texture * texture) switch (texture->scaleMode) { - case SDL_TEXTURESCALEMODE_NONE: + case SDL_SCALEMODE_NONE: return 0; - case SDL_TEXTURESCALEMODE_FAST: - if ((renderer->info.scale_modes & SDL_TEXTURESCALEMODE_FAST)==SDL_TEXTURESCALEMODE_FAST) + case SDL_SCALEMODE_FAST: + if ((renderer->info.scale_modes & SDL_SCALEMODE_FAST)==SDL_SCALEMODE_FAST) { return 0; } else { SDL_Unsupported(); - texture->scaleMode = SDL_TEXTURESCALEMODE_FAST; + texture->scaleMode = SDL_SCALEMODE_FAST; return -1; } break; - case SDL_TEXTURESCALEMODE_SLOW: - if ((renderer->info.scale_modes & SDL_TEXTURESCALEMODE_SLOW)==SDL_TEXTURESCALEMODE_SLOW) + case SDL_SCALEMODE_SLOW: + if ((renderer->info.scale_modes & SDL_SCALEMODE_SLOW)==SDL_SCALEMODE_SLOW) { return 0; } else { SDL_Unsupported(); - texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW; + texture->scaleMode = SDL_SCALEMODE_SLOW; return -1; } break; - case SDL_TEXTURESCALEMODE_BEST: + case SDL_SCALEMODE_BEST: SDL_Unsupported(); - texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW; + texture->scaleMode = SDL_SCALEMODE_SLOW; return -1; default: SDL_Unsupported(); - texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; + texture->scaleMode = SDL_SCALEMODE_NONE; return -1; } diff --git a/src/video/ps3/SDL_ps3render.c b/src/video/ps3/SDL_ps3render.c index 7478891ee..d30a943db 100644 --- a/src/video/ps3/SDL_ps3render.c +++ b/src/video/ps3/SDL_ps3render.c @@ -79,7 +79,7 @@ SDL_RenderDriver SDL_PS3_RenderDriver = { (SDL_BLENDMODE_NONE), /* We use bilinear scaling on the SPE for YV12 & IYUV * (width and height % 8 = 0) */ - (SDL_TEXTURESCALEMODE_SLOW) + (SDL_SCALEMODE_SLOW) } }; diff --git a/src/video/qnxgf/SDL_gf_render.c b/src/video/qnxgf/SDL_gf_render.c index 6f494e7ab..fd94f607f 100644 --- a/src/video/qnxgf/SDL_gf_render.c +++ b/src/video/qnxgf/SDL_gf_render.c @@ -87,7 +87,7 @@ SDL_RenderDriver gf_renderdriver = { SDL_TEXTUREMODULATE_ALPHA), (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD), - (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_SLOW), + (SDL_SCALEMODE_NONE | SDL_SCALEMODE_SLOW), 13, { SDL_PIXELFORMAT_INDEX8, diff --git a/src/video/win32/SDL_ceddrawrender.c b/src/video/win32/SDL_ceddrawrender.c index 43ebe4eba..1b2fd1270 100644 --- a/src/video/win32/SDL_ceddrawrender.c +++ b/src/video/win32/SDL_ceddrawrender.c @@ -85,7 +85,7 @@ SDL_RenderDriver DDRAW_RenderDriver = { SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED), (SDL_TEXTUREMODULATE_NONE), (SDL_BLENDMODE_NONE), - (SDL_TEXTURESCALEMODE_NONE), + (SDL_SCALEMODE_NONE), 0, {0}, 0, @@ -666,10 +666,10 @@ static int DDRAW_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) { switch (texture->scaleMode) { - case SDL_TEXTURESCALEMODE_NONE: + case SDL_SCALEMODE_NONE: default: SDL_Unsupported(); - texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; + texture->scaleMode = SDL_SCALEMODE_NONE; return -1; } return 0; diff --git a/src/video/win32/SDL_d3drender.c b/src/video/win32/SDL_d3drender.c index 661446a7f..53b5e8a7c 100644 --- a/src/video/win32/SDL_d3drender.c +++ b/src/video/win32/SDL_d3drender.c @@ -150,8 +150,8 @@ SDL_RenderDriver D3D_RenderDriver = { SDL_TEXTUREMODULATE_ALPHA), (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD), - (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST | - SDL_TEXTURESCALEMODE_SLOW | SDL_TEXTURESCALEMODE_BEST), + (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST | + SDL_SCALEMODE_SLOW | SDL_SCALEMODE_BEST), 0, {0}, 0, @@ -807,14 +807,14 @@ static int D3D_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) { switch (texture->scaleMode) { - case SDL_TEXTURESCALEMODE_NONE: - case SDL_TEXTURESCALEMODE_FAST: - case SDL_TEXTURESCALEMODE_SLOW: - case SDL_TEXTURESCALEMODE_BEST: + case SDL_SCALEMODE_NONE: + case SDL_SCALEMODE_FAST: + case SDL_SCALEMODE_SLOW: + case SDL_SCALEMODE_BEST: return 0; default: SDL_Unsupported(); - texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; + texture->scaleMode = SDL_SCALEMODE_NONE; return -1; } return 0; @@ -1343,20 +1343,20 @@ D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, } switch (texture->scaleMode) { - case SDL_TEXTURESCALEMODE_NONE: - case SDL_TEXTURESCALEMODE_FAST: + case SDL_SCALEMODE_NONE: + case SDL_SCALEMODE_FAST: IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER, D3DTEXF_POINT); IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER, D3DTEXF_POINT); break; - case SDL_TEXTURESCALEMODE_SLOW: + case SDL_SCALEMODE_SLOW: IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); break; - case SDL_TEXTURESCALEMODE_BEST: + case SDL_SCALEMODE_BEST: IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER, D3DTEXF_GAUSSIANQUAD); IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER, diff --git a/src/video/win32/SDL_gapirender.c b/src/video/win32/SDL_gapirender.c index b54c42705..8a1f4924d 100644 --- a/src/video/win32/SDL_gapirender.c +++ b/src/video/win32/SDL_gapirender.c @@ -210,7 +210,7 @@ SDL_RenderDriver GAPI_RenderDriver = { (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD), (SDL_TEXTUREMODULATE_NONE), (SDL_BLENDMODE_NONE), - (SDL_TEXTURESCALEMODE_NONE), + (SDL_SCALEMODE_NONE), 7, { SDL_PIXELFORMAT_RGB555, @@ -233,7 +233,7 @@ SDL_RenderDriver RAW_RenderDriver = { (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD), (SDL_TEXTUREMODULATE_NONE), (SDL_BLENDMODE_NONE), - (SDL_TEXTURESCALEMODE_NONE), + (SDL_SCALEMODE_NONE), 7, { SDL_PIXELFORMAT_RGB555, diff --git a/src/video/win32/SDL_gdirender.c b/src/video/win32/SDL_gdirender.c index 5c9a3fcf9..729069d9f 100644 --- a/src/video/win32/SDL_gdirender.c +++ b/src/video/win32/SDL_gdirender.c @@ -90,7 +90,7 @@ SDL_RenderDriver GDI_RenderDriver = { SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED), (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_ALPHA), (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK), - (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST), + (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST), 14, { SDL_PIXELFORMAT_INDEX8, @@ -580,17 +580,17 @@ static int GDI_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) { switch (texture->scaleMode) { - case SDL_TEXTURESCALEMODE_NONE: - case SDL_TEXTURESCALEMODE_FAST: + case SDL_SCALEMODE_NONE: + case SDL_SCALEMODE_FAST: return 0; - case SDL_TEXTURESCALEMODE_SLOW: - case SDL_TEXTURESCALEMODE_BEST: + case SDL_SCALEMODE_SLOW: + case SDL_SCALEMODE_BEST: SDL_Unsupported(); - texture->scaleMode = SDL_TEXTURESCALEMODE_FAST; + texture->scaleMode = SDL_SCALEMODE_FAST; return -1; default: SDL_Unsupported(); - texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; + texture->scaleMode = SDL_SCALEMODE_NONE; return -1; } return 0; diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c index 85bc3b308..7a171cd1d 100644 --- a/src/video/x11/SDL_x11render.c +++ b/src/video/x11/SDL_x11render.c @@ -83,7 +83,7 @@ SDL_RenderDriver X11_RenderDriver = { SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED), SDL_TEXTUREMODULATE_NONE, SDL_BLENDMODE_NONE, - SDL_TEXTURESCALEMODE_NONE, + SDL_SCALEMODE_NONE, 0, {0}, 0, @@ -331,8 +331,8 @@ X11_AddRenderDriver(_THIS) /* Update the capabilities of the renderer. */ info->blend_modes |= (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD | SDL_BLENDMODE_MASK); - info->scale_modes |= (SDL_TEXTURESCALEMODE_FAST | SDL_TEXTURESCALEMODE_SLOW | - SDL_TEXTURESCALEMODE_BEST); + info->scale_modes |= (SDL_SCALEMODE_FAST | SDL_SCALEMODE_SLOW | + SDL_SCALEMODE_BEST); info->mod_modes |= (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA); } #endif @@ -1078,7 +1078,7 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) // FIXME: Is the following required? /* Set the default blending and scaling modes. */ texture->blendMode = SDL_BLENDMODE_NONE; - texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; + texture->scaleMode = SDL_SCALEMODE_NONE; data->blend_op = PictOpSrc; data->filter = NULL; } @@ -1216,14 +1216,14 @@ X11_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) X11_RenderData *renderdata = (X11_RenderData *) renderer->driverdata; switch (texture->scaleMode) { - case SDL_TEXTURESCALEMODE_NONE: + case SDL_SCALEMODE_NONE: #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (renderdata->use_xrender) { data->filter = NULL; } #endif return 0; - case SDL_TEXTURESCALEMODE_FAST: + case SDL_SCALEMODE_FAST: /* We can sort of fake it for streaming textures */ if (data->yuv || texture->access == SDL_TEXTUREACCESS_STREAMING) { return 0; @@ -1233,12 +1233,12 @@ X11_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) data->filter = FilterFast; return 0; } - case SDL_TEXTURESCALEMODE_SLOW: + case SDL_SCALEMODE_SLOW: if (renderdata->use_xrender) { data->filter = FilterGood; return 0; } - case SDL_TEXTURESCALEMODE_BEST: + case SDL_SCALEMODE_BEST: if (renderdata->use_xrender) { data->filter = FilterBest; return 0; @@ -1249,12 +1249,12 @@ X11_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) SDL_Unsupported(); #ifdef SDL_VIDEO_DRIVER_X11_XRENDER if (renderdata->use_xrender) { - texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; + texture->scaleMode = SDL_SCALEMODE_NONE; data->filter = NULL; } else #endif - texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; + texture->scaleMode = SDL_SCALEMODE_NONE; return -1; } return 0; @@ -2012,7 +2012,7 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, } /* Set the picture filter only if a scaling mode is set. */ - if (texture->scaleMode != SDL_TEXTURESCALEMODE_NONE) { + if (texture->scaleMode != SDL_SCALEMODE_NONE) { XRenderSetPictureFilter(data->display, src, texturedata->filter, 0, 0); } diff --git a/test/common.c b/test/common.c index 0c0539229..a1cc84e9c 100644 --- a/test/common.c +++ b/test/common.c @@ -437,16 +437,16 @@ static void PrintScaleMode(Uint32 flag) { switch (flag) { - case SDL_TEXTURESCALEMODE_NONE: + case SDL_SCALEMODE_NONE: fprintf(stderr, "None"); break; - case SDL_TEXTURESCALEMODE_FAST: + case SDL_SCALEMODE_FAST: fprintf(stderr, "Fast"); break; - case SDL_TEXTURESCALEMODE_SLOW: + case SDL_SCALEMODE_SLOW: fprintf(stderr, "Slow"); break; - case SDL_TEXTURESCALEMODE_BEST: + case SDL_SCALEMODE_BEST: fprintf(stderr, "Best"); break; default: diff --git a/test/testsprite2.c b/test/testsprite2.c index cc38c4520..3ddda3e28 100644 --- a/test/testsprite2.c +++ b/test/testsprite2.c @@ -21,7 +21,7 @@ static SDL_Rect *positions; static SDL_Rect *velocities; static int sprite_w, sprite_h; static SDL_BlendMode blendMode = SDL_BLENDMODE_MASK; -static SDL_TextureScaleMode scaleMode = SDL_TEXTURESCALEMODE_NONE; +static SDL_ScaleMode scaleMode = SDL_SCALEMODE_NONE; /* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */ static void @@ -256,16 +256,16 @@ main(int argc, char *argv[]) } else if (SDL_strcasecmp(argv[i], "--scale") == 0) { if (argv[i + 1]) { if (SDL_strcasecmp(argv[i + 1], "none") == 0) { - scaleMode = SDL_TEXTURESCALEMODE_NONE; + scaleMode = SDL_SCALEMODE_NONE; consumed = 2; } else if (SDL_strcasecmp(argv[i + 1], "fast") == 0) { - scaleMode = SDL_TEXTURESCALEMODE_FAST; + scaleMode = SDL_SCALEMODE_FAST; consumed = 2; } else if (SDL_strcasecmp(argv[i + 1], "slow") == 0) { - scaleMode = SDL_TEXTURESCALEMODE_SLOW; + scaleMode = SDL_SCALEMODE_SLOW; consumed = 2; } else if (SDL_strcasecmp(argv[i + 1], "best") == 0) { - scaleMode = SDL_TEXTURESCALEMODE_BEST; + scaleMode = SDL_SCALEMODE_BEST; consumed = 2; } } @@ -316,7 +316,7 @@ main(int argc, char *argv[]) quit(2); } srand((unsigned int)time(NULL)); - if (scaleMode != SDL_TEXTURESCALEMODE_NONE) { + if (scaleMode != SDL_SCALEMODE_NONE) { sprite_w += sprite_w / 2; sprite_h += sprite_h / 2; }