Use the enumerated type for blend and scale mode instead of int
Renamed SDL_TextureScaleMode to SDL_ScaleMode
This commit is contained in:
parent
0893ec9ce4
commit
35cc558917
28 changed files with 355 additions and 282 deletions
47
Makefile.in
47
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
|
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_AGE = @LT_AGE@
|
||||||
LT_CURRENT = @LT_CURRENT@
|
LT_CURRENT = @LT_CURRENT@
|
||||||
|
|
64
include/SDL_blendmode.h
Normal file
64
include/SDL_blendmode.h
Normal file
|
@ -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: */
|
|
@ -202,6 +202,14 @@ typedef enum
|
||||||
SDL_GRAB_ON = 1
|
SDL_GRAB_ON = 1
|
||||||
} SDL_GrabMode;
|
} 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;
|
struct SDL_SysWMinfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
69
include/SDL_scalemode.h
Normal file
69
include/SDL_scalemode.h
Normal file
|
@ -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: */
|
|
@ -32,6 +32,8 @@
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_pixels.h"
|
#include "SDL_pixels.h"
|
||||||
#include "SDL_rect.h"
|
#include "SDL_rect.h"
|
||||||
|
#include "SDL_blendmode.h"
|
||||||
|
#include "SDL_scalemode.h"
|
||||||
#include "SDL_rwops.h"
|
#include "SDL_rwops.h"
|
||||||
|
|
||||||
#include "begin_code.h"
|
#include "begin_code.h"
|
||||||
|
@ -88,7 +90,7 @@ typedef struct SDL_Surface
|
||||||
struct SDL_BlitMap *map; /**< Private */
|
struct SDL_BlitMap *map; /**< Private */
|
||||||
|
|
||||||
/** format version, bumped at every change to invalidate blit maps */
|
/** 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 */
|
/** Reference count -- used when freeing surface */
|
||||||
int refcount; /**< Read-mostly */
|
int refcount; /**< Read-mostly */
|
||||||
|
@ -300,7 +302,7 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface,
|
||||||
* \sa SDL_GetSurfaceBlendMode()
|
* \sa SDL_GetSurfaceBlendMode()
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
|
extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
|
||||||
int blendMode);
|
SDL_BlendMode blendMode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Get the blend mode used for blit operations.
|
* \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()
|
* \sa SDL_SetSurfaceBlendMode()
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
|
extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
|
||||||
int *blendMode);
|
SDL_BlendMode *blendMode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Set the scale mode used for blit operations.
|
* \brief Set the scale mode used for blit operations.
|
||||||
*
|
*
|
||||||
* \param surface The surface to update.
|
* \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
|
* \return 0 on success, or -1 if the surface is not valid or the scale mode is
|
||||||
* not supported.
|
* not supported.
|
||||||
|
@ -331,7 +333,7 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
|
||||||
* \sa SDL_GetSurfaceScaleMode()
|
* \sa SDL_GetSurfaceScaleMode()
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_SetSurfaceScaleMode(SDL_Surface * surface,
|
extern DECLSPEC int SDLCALL SDL_SetSurfaceScaleMode(SDL_Surface * surface,
|
||||||
int scaleMode);
|
SDL_ScaleMode scaleMode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Get the scale mode used for blit operations.
|
* \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()
|
* \sa SDL_SetSurfaceScaleMode()
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_GetSurfaceScaleMode(SDL_Surface * surface,
|
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.
|
* 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
|
extern DECLSPEC int SDLCALL SDL_BlendPoint
|
||||||
(SDL_Surface * dst, int x, int y,
|
(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
|
extern DECLSPEC int SDLCALL SDL_BlendPoints
|
||||||
(SDL_Surface * dst, const SDL_Point * points, int count,
|
(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.
|
* Draws a line with \c color.
|
||||||
|
@ -438,10 +440,10 @@ extern DECLSPEC int SDLCALL SDL_DrawLines
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_BlendLine
|
extern DECLSPEC int SDLCALL SDL_BlendLine
|
||||||
(SDL_Surface * dst, int x1, int y1, int x2, int y2,
|
(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
|
extern DECLSPEC int SDLCALL SDL_BlendLines
|
||||||
(SDL_Surface * dst, const SDL_Point * points, int count,
|
(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.
|
* Draws the given rectangle with \c color.
|
||||||
|
@ -467,10 +469,10 @@ extern DECLSPEC int SDLCALL SDL_DrawRects
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_BlendRect
|
extern DECLSPEC int SDLCALL SDL_BlendRect
|
||||||
(SDL_Surface * dst, const SDL_Rect * rect,
|
(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
|
extern DECLSPEC int SDLCALL SDL_BlendRects
|
||||||
(SDL_Surface * dst, const SDL_Rect ** rects, int count,
|
(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.
|
* 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
|
extern DECLSPEC int SDLCALL SDL_BlendFillRect
|
||||||
(SDL_Surface * dst, const SDL_Rect * rect,
|
(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
|
extern DECLSPEC int SDLCALL SDL_BlendFillRects
|
||||||
(SDL_Surface * dst, const SDL_Rect ** rects, int count,
|
(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);
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a fast blit from the source surface to the destination surface.
|
* Performs a fast blit from the source surface to the destination surface.
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
#include "SDL_stdinc.h"
|
#include "SDL_stdinc.h"
|
||||||
#include "SDL_pixels.h"
|
#include "SDL_pixels.h"
|
||||||
#include "SDL_rect.h"
|
#include "SDL_rect.h"
|
||||||
|
#include "SDL_blendmode.h"
|
||||||
|
#include "SDL_scalemode.h"
|
||||||
#include "SDL_surface.h"
|
#include "SDL_surface.h"
|
||||||
|
|
||||||
#include "begin_code.h"
|
#include "begin_code.h"
|
||||||
|
@ -213,38 +215,6 @@ typedef enum
|
||||||
SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */
|
SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */
|
||||||
} SDL_TextureModulate;
|
} 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
|
* \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()
|
* \sa SDL_GetTextureBlendMode()
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
|
extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
|
||||||
int blendMode);
|
SDL_BlendMode blendMode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Get the blend mode used for texture copy operations.
|
* \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()
|
* \sa SDL_SetTextureBlendMode()
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
|
extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
|
||||||
int *blendMode);
|
SDL_BlendMode *blendMode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Set the scale mode used for texture copy operations.
|
* \brief Set the scale mode used for texture copy operations.
|
||||||
*
|
*
|
||||||
* \param texture The texture to update.
|
* \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
|
* \return 0 on success, or -1 if the texture is not valid or the scale mode is
|
||||||
* not supported.
|
* not supported.
|
||||||
|
@ -1016,7 +986,7 @@ extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
|
||||||
* \sa SDL_GetTextureScaleMode()
|
* \sa SDL_GetTextureScaleMode()
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture,
|
extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture,
|
||||||
int scaleMode);
|
SDL_ScaleMode scaleMode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Get the scale mode used for texture copy operations.
|
* \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()
|
* \sa SDL_SetTextureScaleMode()
|
||||||
*/
|
*/
|
||||||
extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture,
|
extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture,
|
||||||
int *scaleMode);
|
SDL_ScaleMode *scaleMode);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Update the given texture rectangle with new pixel data.
|
* \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()
|
* \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.
|
* \brief Get the blend mode used for drawing operations.
|
||||||
|
@ -1146,7 +1116,7 @@ extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(int blendMode);
|
||||||
*
|
*
|
||||||
* \sa SDL_SetRenderDrawBlendMode()
|
* \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
|
* \brief Clear the current rendering target with the drawing color
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SDL_BlendFillRect_RGB555(SDL_Surface * dst, const SDL_Rect * rect,
|
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;
|
unsigned inva = 0xff - a;
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ SDL_BlendFillRect_RGB555(SDL_Surface * dst, const SDL_Rect * rect,
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SDL_BlendFillRect_RGB565(SDL_Surface * dst, const SDL_Rect * rect,
|
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;
|
unsigned inva = 0xff - a;
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ SDL_BlendFillRect_RGB565(SDL_Surface * dst, const SDL_Rect * rect,
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SDL_BlendFillRect_RGB888(SDL_Surface * dst, const SDL_Rect * rect,
|
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;
|
unsigned inva = 0xff - a;
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ SDL_BlendFillRect_RGB888(SDL_Surface * dst, const SDL_Rect * rect,
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SDL_BlendFillRect_ARGB8888(SDL_Surface * dst, const SDL_Rect * rect,
|
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;
|
unsigned inva = 0xff - a;
|
||||||
|
|
||||||
|
@ -118,7 +118,7 @@ SDL_BlendFillRect_ARGB8888(SDL_Surface * dst, const SDL_Rect * rect,
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SDL_BlendFillRect_RGB(SDL_Surface * dst, const SDL_Rect * rect,
|
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;
|
SDL_PixelFormat *fmt = dst->format;
|
||||||
unsigned inva = 0xff - a;
|
unsigned inva = 0xff - a;
|
||||||
|
@ -164,7 +164,7 @@ SDL_BlendFillRect_RGB(SDL_Surface * dst, const SDL_Rect * rect,
|
||||||
|
|
||||||
static int
|
static int
|
||||||
SDL_BlendFillRect_RGBA(SDL_Surface * dst, const SDL_Rect * rect,
|
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;
|
SDL_PixelFormat *fmt = dst->format;
|
||||||
unsigned inva = 0xff - a;
|
unsigned inva = 0xff - a;
|
||||||
|
@ -194,7 +194,7 @@ SDL_BlendFillRect_RGBA(SDL_Surface * dst, const SDL_Rect * rect,
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect,
|
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;
|
SDL_Rect clipped;
|
||||||
|
|
||||||
|
@ -263,12 +263,12 @@ SDL_BlendFillRect(SDL_Surface * dst, const SDL_Rect * rect,
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_BlendFillRects(SDL_Surface * dst, const SDL_Rect ** rects, int count,
|
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;
|
SDL_Rect clipped;
|
||||||
int i;
|
int i;
|
||||||
int (*func)(SDL_Surface * dst, const SDL_Rect * rect,
|
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;
|
int status = 0;
|
||||||
|
|
||||||
if (!dst) {
|
if (!dst) {
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SDL_BlendLine_RGB2(SDL_Surface * dst, int x1, int y1, int x2, int y2,
|
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)
|
SDL_bool draw_end)
|
||||||
{
|
{
|
||||||
const SDL_PixelFormat *fmt = dst->format;
|
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
|
static void
|
||||||
SDL_BlendLine_RGB555(SDL_Surface * dst, int x1, int y1, int x2, int y2,
|
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)
|
SDL_bool draw_end)
|
||||||
{
|
{
|
||||||
const SDL_PixelFormat *fmt = dst->format;
|
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
|
static void
|
||||||
SDL_BlendLine_RGB565(SDL_Surface * dst, int x1, int y1, int x2, int y2,
|
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)
|
SDL_bool draw_end)
|
||||||
{
|
{
|
||||||
const SDL_PixelFormat *fmt = dst->format;
|
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
|
static void
|
||||||
SDL_BlendLine_RGB4(SDL_Surface * dst, int x1, int y1, int x2, int y2,
|
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)
|
SDL_bool draw_end)
|
||||||
{
|
{
|
||||||
const SDL_PixelFormat *fmt = dst->format;
|
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
|
static void
|
||||||
SDL_BlendLine_RGBA4(SDL_Surface * dst, int x1, int y1, int x2, int y2,
|
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)
|
SDL_bool draw_end)
|
||||||
{
|
{
|
||||||
const SDL_PixelFormat *fmt = dst->format;
|
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
|
static void
|
||||||
SDL_BlendLine_RGB888(SDL_Surface * dst, int x1, int y1, int x2, int y2,
|
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)
|
SDL_bool draw_end)
|
||||||
{
|
{
|
||||||
const SDL_PixelFormat *fmt = dst->format;
|
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
|
static void
|
||||||
SDL_BlendLine_ARGB8888(SDL_Surface * dst, int x1, int y1, int x2, int y2,
|
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)
|
SDL_bool draw_end)
|
||||||
{
|
{
|
||||||
const SDL_PixelFormat *fmt = dst->format;
|
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,
|
typedef void (*BlendLineFunc) (SDL_Surface * dst,
|
||||||
int x1, int y1, int x2, int y2,
|
int x1, int y1, int x2, int y2,
|
||||||
int blendMode,
|
SDL_BlendMode blendMode,
|
||||||
Uint8 r, Uint8 g, Uint8 b, Uint8 a,
|
Uint8 r, Uint8 g, Uint8 b, Uint8 a,
|
||||||
SDL_bool draw_end);
|
SDL_bool draw_end);
|
||||||
|
|
||||||
|
@ -707,7 +707,7 @@ SDL_CalculateBlendLineFunc(const SDL_PixelFormat * fmt)
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2,
|
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;
|
BlendLineFunc func;
|
||||||
|
|
||||||
|
@ -734,7 +734,7 @@ SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2,
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count,
|
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 i;
|
||||||
int x1, y1;
|
int x1, y1;
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "SDL_draw.h"
|
#include "SDL_draw.h"
|
||||||
|
|
||||||
static int
|
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)
|
Uint8 g, Uint8 b, Uint8 a)
|
||||||
{
|
{
|
||||||
unsigned inva = 0xff - 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
|
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)
|
Uint8 g, Uint8 b, Uint8 a)
|
||||||
{
|
{
|
||||||
unsigned inva = 0xff - 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
|
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)
|
Uint8 g, Uint8 b, Uint8 a)
|
||||||
{
|
{
|
||||||
unsigned inva = 0xff - 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
|
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)
|
Uint8 r, Uint8 g, Uint8 b, Uint8 a)
|
||||||
{
|
{
|
||||||
unsigned inva = 0xff - a;
|
unsigned inva = 0xff - a;
|
||||||
|
@ -116,7 +116,7 @@ SDL_BlendPoint_ARGB8888(SDL_Surface * dst, int x, int y, int blendMode,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
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)
|
Uint8 g, Uint8 b, Uint8 a)
|
||||||
{
|
{
|
||||||
SDL_PixelFormat *fmt = dst->format;
|
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
|
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)
|
Uint8 g, Uint8 b, Uint8 a)
|
||||||
{
|
{
|
||||||
SDL_PixelFormat *fmt = dst->format;
|
SDL_PixelFormat *fmt = dst->format;
|
||||||
|
@ -192,7 +192,7 @@ SDL_BlendPoint_RGBA(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r,
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
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)
|
Uint8 g, Uint8 b, Uint8 a)
|
||||||
{
|
{
|
||||||
if (!dst) {
|
if (!dst) {
|
||||||
|
@ -258,14 +258,14 @@ SDL_BlendPoint(SDL_Surface * dst, int x, int y, int blendMode, Uint8 r,
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_BlendPoints(SDL_Surface * dst, const SDL_Point * points, int count,
|
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 minx, miny;
|
||||||
int maxx, maxy;
|
int maxx, maxy;
|
||||||
int i;
|
int i;
|
||||||
int x, y;
|
int x, y;
|
||||||
int (*func)(SDL_Surface * dst, int x, int 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;
|
int status = 0;
|
||||||
|
|
||||||
if (!dst) {
|
if (!dst) {
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_BlendRect(SDL_Surface * dst, const SDL_Rect * rect,
|
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_Rect full_rect;
|
||||||
SDL_Point points[5];
|
SDL_Point points[5];
|
||||||
|
@ -60,7 +60,7 @@ SDL_BlendRect(SDL_Surface * dst, const SDL_Rect * rect,
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_BlendRects(SDL_Surface * dst, const SDL_Rect ** rects, int count,
|
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;
|
int i;
|
||||||
|
|
||||||
|
|
|
@ -126,8 +126,7 @@ SDL_RenderDriver GL_RenderDriver = {
|
||||||
SDL_TEXTUREMODULATE_ALPHA),
|
SDL_TEXTUREMODULATE_ALPHA),
|
||||||
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
|
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
|
||||||
SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
|
SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
|
||||||
(SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST |
|
(SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST | SDL_SCALEMODE_SLOW),
|
||||||
SDL_TEXTURESCALEMODE_SLOW),
|
|
||||||
15,
|
15,
|
||||||
{
|
{
|
||||||
SDL_PIXELFORMAT_INDEX1LSB,
|
SDL_PIXELFORMAT_INDEX1LSB,
|
||||||
|
@ -1004,17 +1003,17 @@ static int
|
||||||
GL_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
|
GL_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
{
|
{
|
||||||
switch (texture->scaleMode) {
|
switch (texture->scaleMode) {
|
||||||
case SDL_TEXTURESCALEMODE_NONE:
|
case SDL_SCALEMODE_NONE:
|
||||||
case SDL_TEXTURESCALEMODE_FAST:
|
case SDL_SCALEMODE_FAST:
|
||||||
case SDL_TEXTURESCALEMODE_SLOW:
|
case SDL_SCALEMODE_SLOW:
|
||||||
return 0;
|
return 0;
|
||||||
case SDL_TEXTURESCALEMODE_BEST:
|
case SDL_SCALEMODE_BEST:
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW;
|
texture->scaleMode = SDL_SCALEMODE_SLOW;
|
||||||
return -1;
|
return -1;
|
||||||
default:
|
default:
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
|
texture->scaleMode = SDL_SCALEMODE_NONE;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1365,15 +1364,15 @@ GL_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||||
|
|
||||||
if (texture->scaleMode != data->scaleMode) {
|
if (texture->scaleMode != data->scaleMode) {
|
||||||
switch (texture->scaleMode) {
|
switch (texture->scaleMode) {
|
||||||
case SDL_TEXTURESCALEMODE_NONE:
|
case SDL_SCALEMODE_NONE:
|
||||||
case SDL_TEXTURESCALEMODE_FAST:
|
case SDL_SCALEMODE_FAST:
|
||||||
data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
|
data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
|
||||||
GL_NEAREST);
|
GL_NEAREST);
|
||||||
data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
|
data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
|
||||||
GL_NEAREST);
|
GL_NEAREST);
|
||||||
break;
|
break;
|
||||||
case SDL_TEXTURESCALEMODE_SLOW:
|
case SDL_SCALEMODE_SLOW:
|
||||||
case SDL_TEXTURESCALEMODE_BEST:
|
case SDL_SCALEMODE_BEST:
|
||||||
data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
|
data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
|
||||||
GL_LINEAR);
|
GL_LINEAR);
|
||||||
data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
|
data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
|
||||||
|
|
|
@ -112,8 +112,7 @@ SDL_RenderDriver GL_ES_RenderDriver = {
|
||||||
SDL_TEXTUREMODULATE_ALPHA),
|
SDL_TEXTUREMODULATE_ALPHA),
|
||||||
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
|
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
|
||||||
SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
|
SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
|
||||||
(SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST |
|
(SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST | SDL_SCALEMODE_SLOW), 5,
|
||||||
SDL_TEXTURESCALEMODE_SLOW), 5,
|
|
||||||
{
|
{
|
||||||
/* OpenGL ES 1.x supported formats list */
|
/* OpenGL ES 1.x supported formats list */
|
||||||
SDL_PIXELFORMAT_ABGR4444,
|
SDL_PIXELFORMAT_ABGR4444,
|
||||||
|
@ -533,17 +532,17 @@ static int
|
||||||
GLES_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
|
GLES_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
{
|
{
|
||||||
switch (texture->scaleMode) {
|
switch (texture->scaleMode) {
|
||||||
case SDL_TEXTURESCALEMODE_NONE:
|
case SDL_SCALEMODE_NONE:
|
||||||
case SDL_TEXTURESCALEMODE_FAST:
|
case SDL_SCALEMODE_FAST:
|
||||||
case SDL_TEXTURESCALEMODE_SLOW:
|
case SDL_SCALEMODE_SLOW:
|
||||||
return 0;
|
return 0;
|
||||||
case SDL_TEXTURESCALEMODE_BEST:
|
case SDL_SCALEMODE_BEST:
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW;
|
texture->scaleMode = SDL_SCALEMODE_SLOW;
|
||||||
return -1;
|
return -1;
|
||||||
default:
|
default:
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
|
texture->scaleMode = SDL_SCALEMODE_NONE;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -859,15 +858,15 @@ GLES_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||||
GLES_SetBlendMode(data, texture->blendMode, 0);
|
GLES_SetBlendMode(data, texture->blendMode, 0);
|
||||||
|
|
||||||
switch (texture->scaleMode) {
|
switch (texture->scaleMode) {
|
||||||
case SDL_TEXTURESCALEMODE_NONE:
|
case SDL_SCALEMODE_NONE:
|
||||||
case SDL_TEXTURESCALEMODE_FAST:
|
case SDL_SCALEMODE_FAST:
|
||||||
data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
|
data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
|
||||||
GL_NEAREST);
|
GL_NEAREST);
|
||||||
data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
|
data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
|
||||||
GL_NEAREST);
|
GL_NEAREST);
|
||||||
break;
|
break;
|
||||||
case SDL_TEXTURESCALEMODE_SLOW:
|
case SDL_SCALEMODE_SLOW:
|
||||||
case SDL_TEXTURESCALEMODE_BEST:
|
case SDL_SCALEMODE_BEST:
|
||||||
data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
|
data->glTexParameteri(texturedata->type, GL_TEXTURE_MIN_FILTER,
|
||||||
GL_LINEAR);
|
GL_LINEAR);
|
||||||
data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
|
data->glTexParameteri(texturedata->type, GL_TEXTURE_MAG_FILTER,
|
||||||
|
|
|
@ -90,7 +90,7 @@ SDL_RenderDriver SW_RenderDriver = {
|
||||||
SDL_TEXTUREMODULATE_ALPHA),
|
SDL_TEXTUREMODULATE_ALPHA),
|
||||||
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
|
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
|
||||||
SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
|
SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
|
||||||
(SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST),
|
(SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST),
|
||||||
14,
|
14,
|
||||||
{
|
{
|
||||||
SDL_PIXELFORMAT_INDEX8,
|
SDL_PIXELFORMAT_INDEX8,
|
||||||
|
|
|
@ -438,7 +438,7 @@ SDL_GetSurfaceAlphaMod(SDL_Surface * surface, Uint8 * alpha)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_SetSurfaceBlendMode(SDL_Surface * surface, int blendMode)
|
SDL_SetSurfaceBlendMode(SDL_Surface * surface, SDL_BlendMode blendMode)
|
||||||
{
|
{
|
||||||
int flags, status;
|
int flags, status;
|
||||||
|
|
||||||
|
@ -486,7 +486,7 @@ SDL_SetSurfaceBlendMode(SDL_Surface * surface, int blendMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_GetSurfaceBlendMode(SDL_Surface * surface, int *blendMode)
|
SDL_GetSurfaceBlendMode(SDL_Surface * surface, SDL_BlendMode *blendMode)
|
||||||
{
|
{
|
||||||
if (!surface) {
|
if (!surface) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -519,7 +519,7 @@ SDL_GetSurfaceBlendMode(SDL_Surface * surface, int *blendMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_SetSurfaceScaleMode(SDL_Surface * surface, int scaleMode)
|
SDL_SetSurfaceScaleMode(SDL_Surface * surface, SDL_ScaleMode scaleMode)
|
||||||
{
|
{
|
||||||
int flags, status;
|
int flags, status;
|
||||||
|
|
||||||
|
@ -531,13 +531,13 @@ SDL_SetSurfaceScaleMode(SDL_Surface * surface, int scaleMode)
|
||||||
flags = surface->map->info.flags;
|
flags = surface->map->info.flags;
|
||||||
surface->map->info.flags &= ~(SDL_COPY_NEAREST);
|
surface->map->info.flags &= ~(SDL_COPY_NEAREST);
|
||||||
switch (scaleMode) {
|
switch (scaleMode) {
|
||||||
case SDL_TEXTURESCALEMODE_NONE:
|
case SDL_SCALEMODE_NONE:
|
||||||
break;
|
break;
|
||||||
case SDL_TEXTURESCALEMODE_FAST:
|
case SDL_SCALEMODE_FAST:
|
||||||
surface->map->info.flags |= SDL_COPY_NEAREST;
|
surface->map->info.flags |= SDL_COPY_NEAREST;
|
||||||
break;
|
break;
|
||||||
case SDL_TEXTURESCALEMODE_SLOW:
|
case SDL_SCALEMODE_SLOW:
|
||||||
case SDL_TEXTURESCALEMODE_BEST:
|
case SDL_SCALEMODE_BEST:
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
surface->map->info.flags |= SDL_COPY_NEAREST;
|
surface->map->info.flags |= SDL_COPY_NEAREST;
|
||||||
status = -1;
|
status = -1;
|
||||||
|
@ -555,7 +555,7 @@ SDL_SetSurfaceScaleMode(SDL_Surface * surface, int scaleMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_GetSurfaceScaleMode(SDL_Surface * surface, int *scaleMode)
|
SDL_GetSurfaceScaleMode(SDL_Surface * surface, SDL_ScaleMode *scaleMode)
|
||||||
{
|
{
|
||||||
if (!surface) {
|
if (!surface) {
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -567,10 +567,10 @@ SDL_GetSurfaceScaleMode(SDL_Surface * surface, int *scaleMode)
|
||||||
|
|
||||||
switch (surface->map->info.flags & SDL_COPY_NEAREST) {
|
switch (surface->map->info.flags & SDL_COPY_NEAREST) {
|
||||||
case SDL_COPY_NEAREST:
|
case SDL_COPY_NEAREST:
|
||||||
*scaleMode = SDL_TEXTURESCALEMODE_FAST;
|
*scaleMode = SDL_SCALEMODE_FAST;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
*scaleMode = SDL_TEXTURESCALEMODE_NONE;
|
*scaleMode = SDL_SCALEMODE_NONE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -46,8 +46,8 @@ struct SDL_Texture
|
||||||
int w; /**< The width of the texture */
|
int w; /**< The width of the texture */
|
||||||
int h; /**< The height of the texture */
|
int h; /**< The height of the texture */
|
||||||
int modMode; /**< The texture modulation mode */
|
int modMode; /**< The texture modulation mode */
|
||||||
int blendMode; /**< The texture blend mode */
|
SDL_BlendMode blendMode; /**< The texture blend mode */
|
||||||
int scaleMode; /**< The texture scale mode */
|
SDL_ScaleMode scaleMode; /**< The texture scale mode */
|
||||||
Uint8 r, g, b, a; /**< Texture modulation values */
|
Uint8 r, g, b, a; /**< Texture modulation values */
|
||||||
|
|
||||||
SDL_Renderer *renderer;
|
SDL_Renderer *renderer;
|
||||||
|
@ -121,7 +121,7 @@ struct SDL_Renderer
|
||||||
SDL_Texture *textures;
|
SDL_Texture *textures;
|
||||||
|
|
||||||
Uint8 r, g, b, a; /**< Color for drawing operations values */
|
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;
|
void *driverdata;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1959,8 +1959,8 @@ SDL_CreateTextureFromSurface(Uint32 format, SDL_Surface * surface)
|
||||||
|
|
||||||
{
|
{
|
||||||
Uint8 r, g, b, a;
|
Uint8 r, g, b, a;
|
||||||
int blendMode;
|
SDL_BlendMode blendMode;
|
||||||
int scaleMode;
|
SDL_ScaleMode scaleMode;
|
||||||
|
|
||||||
SDL_GetSurfaceColorMod(surface, &r, &g, &b);
|
SDL_GetSurfaceColorMod(surface, &r, &g, &b);
|
||||||
SDL_SetTextureColorMod(texture, r, g, b);
|
SDL_SetTextureColorMod(texture, r, g, b);
|
||||||
|
@ -2129,7 +2129,7 @@ SDL_GetTextureAlphaMod(SDL_Texture * texture, Uint8 * alpha)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_SetTextureBlendMode(SDL_Texture * texture, int blendMode)
|
SDL_SetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode blendMode)
|
||||||
{
|
{
|
||||||
SDL_Renderer *renderer;
|
SDL_Renderer *renderer;
|
||||||
|
|
||||||
|
@ -2145,7 +2145,7 @@ SDL_SetTextureBlendMode(SDL_Texture * texture, int blendMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_GetTextureBlendMode(SDL_Texture * texture, int *blendMode)
|
SDL_GetTextureBlendMode(SDL_Texture * texture, SDL_BlendMode *blendMode)
|
||||||
{
|
{
|
||||||
CHECK_TEXTURE_MAGIC(texture, -1);
|
CHECK_TEXTURE_MAGIC(texture, -1);
|
||||||
|
|
||||||
|
@ -2156,7 +2156,7 @@ SDL_GetTextureBlendMode(SDL_Texture * texture, int *blendMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_SetTextureScaleMode(SDL_Texture * texture, int scaleMode)
|
SDL_SetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode scaleMode)
|
||||||
{
|
{
|
||||||
SDL_Renderer *renderer;
|
SDL_Renderer *renderer;
|
||||||
|
|
||||||
|
@ -2172,7 +2172,7 @@ SDL_SetTextureScaleMode(SDL_Texture * texture, int scaleMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_GetTextureScaleMode(SDL_Texture * texture, int *scaleMode)
|
SDL_GetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode *scaleMode)
|
||||||
{
|
{
|
||||||
CHECK_TEXTURE_MAGIC(texture, -1);
|
CHECK_TEXTURE_MAGIC(texture, -1);
|
||||||
|
|
||||||
|
@ -2315,7 +2315,7 @@ SDL_GetRenderDrawColor(Uint8 * r, Uint8 * g, Uint8 * b, Uint8 * a)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_SetRenderDrawBlendMode(int blendMode)
|
SDL_SetRenderDrawBlendMode(SDL_BlendMode blendMode)
|
||||||
{
|
{
|
||||||
SDL_Renderer *renderer;
|
SDL_Renderer *renderer;
|
||||||
|
|
||||||
|
@ -2332,7 +2332,7 @@ SDL_SetRenderDrawBlendMode(int blendMode)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
SDL_GetRenderDrawBlendMode(int *blendMode)
|
SDL_GetRenderDrawBlendMode(SDL_BlendMode *blendMode)
|
||||||
{
|
{
|
||||||
SDL_Renderer *renderer;
|
SDL_Renderer *renderer;
|
||||||
|
|
||||||
|
@ -2354,7 +2354,7 @@ SDL_RenderClear()
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (!renderer->RenderClear) {
|
if (!renderer->RenderClear) {
|
||||||
int blendMode = renderer->blendMode;
|
SDL_BlendMode blendMode = renderer->blendMode;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
if (blendMode >= SDL_BLENDMODE_BLEND) {
|
if (blendMode >= SDL_BLENDMODE_BLEND) {
|
||||||
|
|
|
@ -104,8 +104,8 @@ SDL_RenderDriver DirectFB_RenderDriver = {
|
||||||
SDL_TEXTUREMODULATE_ALPHA),
|
SDL_TEXTUREMODULATE_ALPHA),
|
||||||
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND |
|
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND |
|
||||||
SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
|
SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
|
||||||
(SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST |
|
(SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST |
|
||||||
SDL_TEXTURESCALEMODE_SLOW | SDL_TEXTURESCALEMODE_BEST),
|
SDL_SCALEMODE_SLOW | SDL_SCALEMODE_BEST),
|
||||||
14,
|
14,
|
||||||
{
|
{
|
||||||
SDL_PIXELFORMAT_INDEX4LSB,
|
SDL_PIXELFORMAT_INDEX4LSB,
|
||||||
|
@ -711,21 +711,21 @@ DirectFB_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
|
DirectFB_TextureData *data = (DirectFB_TextureData *) texture->driverdata;
|
||||||
|
|
||||||
switch (texture->scaleMode) {
|
switch (texture->scaleMode) {
|
||||||
case SDL_TEXTURESCALEMODE_NONE:
|
case SDL_SCALEMODE_NONE:
|
||||||
case SDL_TEXTURESCALEMODE_FAST:
|
case SDL_SCALEMODE_FAST:
|
||||||
data->render_options = DSRO_NONE;
|
data->render_options = DSRO_NONE;
|
||||||
break;
|
break;
|
||||||
case SDL_TEXTURESCALEMODE_SLOW:
|
case SDL_SCALEMODE_SLOW:
|
||||||
data->render_options = DSRO_SMOOTH_UPSCALE | DSRO_SMOOTH_DOWNSCALE;
|
data->render_options = DSRO_SMOOTH_UPSCALE | DSRO_SMOOTH_DOWNSCALE;
|
||||||
break;
|
break;
|
||||||
case SDL_TEXTURESCALEMODE_BEST:
|
case SDL_SCALEMODE_BEST:
|
||||||
data->render_options =
|
data->render_options =
|
||||||
DSRO_SMOOTH_UPSCALE | DSRO_SMOOTH_DOWNSCALE | DSRO_ANTIALIAS;
|
DSRO_SMOOTH_UPSCALE | DSRO_SMOOTH_DOWNSCALE | DSRO_ANTIALIAS;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
data->render_options = DSRO_NONE;
|
data->render_options = DSRO_NONE;
|
||||||
texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
|
texture->scaleMode = SDL_SCALEMODE_NONE;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -82,7 +82,7 @@ SDL_RenderDriver NDS_RenderDriver = {
|
||||||
(SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC), /* u32 flags */
|
(SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC), /* u32 flags */
|
||||||
(SDL_TEXTUREMODULATE_NONE), /* u32 mod_modes */
|
(SDL_TEXTUREMODULATE_NONE), /* u32 mod_modes */
|
||||||
(SDL_BLENDMODE_MASK), /* u32 blend_modes */
|
(SDL_BLENDMODE_MASK), /* u32 blend_modes */
|
||||||
(SDL_TEXTURESCALEMODE_FAST), /* u32 scale_modes */
|
(SDL_SCALEMODE_FAST), /* u32 scale_modes */
|
||||||
3, /* u32 num_texture_formats */
|
3, /* u32 num_texture_formats */
|
||||||
{
|
{
|
||||||
SDL_PIXELFORMAT_INDEX8,
|
SDL_PIXELFORMAT_INDEX8,
|
||||||
|
|
|
@ -104,8 +104,7 @@ SDL_RenderDriver photon_renderdriver = {
|
||||||
(SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_ALPHA),
|
(SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_ALPHA),
|
||||||
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND |
|
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND |
|
||||||
SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
|
SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
|
||||||
(SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_SLOW |
|
(SDL_SCALEMODE_NONE | SDL_SCALEMODE_SLOW | SDL_SCALEMODE_FAST),
|
||||||
SDL_TEXTURESCALEMODE_FAST),
|
|
||||||
10,
|
10,
|
||||||
{SDL_PIXELFORMAT_INDEX8,
|
{SDL_PIXELFORMAT_INDEX8,
|
||||||
SDL_PIXELFORMAT_RGB555,
|
SDL_PIXELFORMAT_RGB555,
|
||||||
|
@ -254,17 +253,17 @@ photon_createrenderer(SDL_Window * window, Uint32 flags)
|
||||||
/* Set current scale blitting capabilities */
|
/* Set current scale blitting capabilities */
|
||||||
if (rdata->surfaces_type==SDL_PHOTON_SURFTYPE_OFFSCREEN)
|
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)
|
if ((didata->mode_2dcaps & SDL_VIDEO_PHOTON_CAP_SCALED_BLIT)==SDL_VIDEO_PHOTON_CAP_SCALED_BLIT)
|
||||||
{
|
{
|
||||||
/* This video mode supports hardware scaling */
|
/* This video mode supports hardware scaling */
|
||||||
renderer->info.scale_modes|=SDL_TEXTURESCALEMODE_FAST;
|
renderer->info.scale_modes|=SDL_SCALEMODE_FAST;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* PhImage blit functions do not support scaling */
|
/* PhImage blit functions do not support scaling */
|
||||||
renderer->info.scale_modes=SDL_TEXTURESCALEMODE_NONE;
|
renderer->info.scale_modes=SDL_SCALEMODE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return renderer;
|
return renderer;
|
||||||
|
@ -984,39 +983,39 @@ photon_settexturescalemode(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
|
|
||||||
switch (texture->scaleMode)
|
switch (texture->scaleMode)
|
||||||
{
|
{
|
||||||
case SDL_TEXTURESCALEMODE_NONE:
|
case SDL_SCALEMODE_NONE:
|
||||||
return 0;
|
return 0;
|
||||||
case SDL_TEXTURESCALEMODE_FAST:
|
case SDL_SCALEMODE_FAST:
|
||||||
if ((renderer->info.scale_modes & SDL_TEXTURESCALEMODE_FAST)==SDL_TEXTURESCALEMODE_FAST)
|
if ((renderer->info.scale_modes & SDL_SCALEMODE_FAST)==SDL_SCALEMODE_FAST)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
texture->scaleMode = SDL_TEXTURESCALEMODE_FAST;
|
texture->scaleMode = SDL_SCALEMODE_FAST;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SDL_TEXTURESCALEMODE_SLOW:
|
case SDL_SCALEMODE_SLOW:
|
||||||
if ((renderer->info.scale_modes & SDL_TEXTURESCALEMODE_SLOW)==SDL_TEXTURESCALEMODE_SLOW)
|
if ((renderer->info.scale_modes & SDL_SCALEMODE_SLOW)==SDL_SCALEMODE_SLOW)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW;
|
texture->scaleMode = SDL_SCALEMODE_SLOW;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SDL_TEXTURESCALEMODE_BEST:
|
case SDL_SCALEMODE_BEST:
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
texture->scaleMode = SDL_TEXTURESCALEMODE_SLOW;
|
texture->scaleMode = SDL_SCALEMODE_SLOW;
|
||||||
return -1;
|
return -1;
|
||||||
default:
|
default:
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
|
texture->scaleMode = SDL_SCALEMODE_NONE;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -79,7 +79,7 @@ SDL_RenderDriver SDL_PS3_RenderDriver = {
|
||||||
(SDL_BLENDMODE_NONE),
|
(SDL_BLENDMODE_NONE),
|
||||||
/* We use bilinear scaling on the SPE for YV12 & IYUV
|
/* We use bilinear scaling on the SPE for YV12 & IYUV
|
||||||
* (width and height % 8 = 0) */
|
* (width and height % 8 = 0) */
|
||||||
(SDL_TEXTURESCALEMODE_SLOW)
|
(SDL_SCALEMODE_SLOW)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ SDL_RenderDriver gf_renderdriver = {
|
||||||
SDL_TEXTUREMODULATE_ALPHA),
|
SDL_TEXTUREMODULATE_ALPHA),
|
||||||
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
|
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
|
||||||
SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
|
SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
|
||||||
(SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_SLOW),
|
(SDL_SCALEMODE_NONE | SDL_SCALEMODE_SLOW),
|
||||||
13,
|
13,
|
||||||
{
|
{
|
||||||
SDL_PIXELFORMAT_INDEX8,
|
SDL_PIXELFORMAT_INDEX8,
|
||||||
|
|
|
@ -85,7 +85,7 @@ SDL_RenderDriver DDRAW_RenderDriver = {
|
||||||
SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED),
|
SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED),
|
||||||
(SDL_TEXTUREMODULATE_NONE),
|
(SDL_TEXTUREMODULATE_NONE),
|
||||||
(SDL_BLENDMODE_NONE),
|
(SDL_BLENDMODE_NONE),
|
||||||
(SDL_TEXTURESCALEMODE_NONE),
|
(SDL_SCALEMODE_NONE),
|
||||||
0,
|
0,
|
||||||
{0},
|
{0},
|
||||||
0,
|
0,
|
||||||
|
@ -666,10 +666,10 @@ static int
|
||||||
DDRAW_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
|
DDRAW_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
{
|
{
|
||||||
switch (texture->scaleMode) {
|
switch (texture->scaleMode) {
|
||||||
case SDL_TEXTURESCALEMODE_NONE:
|
case SDL_SCALEMODE_NONE:
|
||||||
default:
|
default:
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
|
texture->scaleMode = SDL_SCALEMODE_NONE;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -150,8 +150,8 @@ SDL_RenderDriver D3D_RenderDriver = {
|
||||||
SDL_TEXTUREMODULATE_ALPHA),
|
SDL_TEXTUREMODULATE_ALPHA),
|
||||||
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
|
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
|
||||||
SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
|
SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
|
||||||
(SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST |
|
(SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST |
|
||||||
SDL_TEXTURESCALEMODE_SLOW | SDL_TEXTURESCALEMODE_BEST),
|
SDL_SCALEMODE_SLOW | SDL_SCALEMODE_BEST),
|
||||||
0,
|
0,
|
||||||
{0},
|
{0},
|
||||||
0,
|
0,
|
||||||
|
@ -807,14 +807,14 @@ static int
|
||||||
D3D_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
|
D3D_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
{
|
{
|
||||||
switch (texture->scaleMode) {
|
switch (texture->scaleMode) {
|
||||||
case SDL_TEXTURESCALEMODE_NONE:
|
case SDL_SCALEMODE_NONE:
|
||||||
case SDL_TEXTURESCALEMODE_FAST:
|
case SDL_SCALEMODE_FAST:
|
||||||
case SDL_TEXTURESCALEMODE_SLOW:
|
case SDL_SCALEMODE_SLOW:
|
||||||
case SDL_TEXTURESCALEMODE_BEST:
|
case SDL_SCALEMODE_BEST:
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
|
texture->scaleMode = SDL_SCALEMODE_NONE;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1343,20 +1343,20 @@ D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (texture->scaleMode) {
|
switch (texture->scaleMode) {
|
||||||
case SDL_TEXTURESCALEMODE_NONE:
|
case SDL_SCALEMODE_NONE:
|
||||||
case SDL_TEXTURESCALEMODE_FAST:
|
case SDL_SCALEMODE_FAST:
|
||||||
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
|
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
|
||||||
D3DTEXF_POINT);
|
D3DTEXF_POINT);
|
||||||
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
|
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
|
||||||
D3DTEXF_POINT);
|
D3DTEXF_POINT);
|
||||||
break;
|
break;
|
||||||
case SDL_TEXTURESCALEMODE_SLOW:
|
case SDL_SCALEMODE_SLOW:
|
||||||
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
|
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
|
||||||
D3DTEXF_LINEAR);
|
D3DTEXF_LINEAR);
|
||||||
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
|
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
|
||||||
D3DTEXF_LINEAR);
|
D3DTEXF_LINEAR);
|
||||||
break;
|
break;
|
||||||
case SDL_TEXTURESCALEMODE_BEST:
|
case SDL_SCALEMODE_BEST:
|
||||||
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
|
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
|
||||||
D3DTEXF_GAUSSIANQUAD);
|
D3DTEXF_GAUSSIANQUAD);
|
||||||
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
|
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
|
||||||
|
|
|
@ -210,7 +210,7 @@ SDL_RenderDriver GAPI_RenderDriver = {
|
||||||
(SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD),
|
(SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD),
|
||||||
(SDL_TEXTUREMODULATE_NONE),
|
(SDL_TEXTUREMODULATE_NONE),
|
||||||
(SDL_BLENDMODE_NONE),
|
(SDL_BLENDMODE_NONE),
|
||||||
(SDL_TEXTURESCALEMODE_NONE),
|
(SDL_SCALEMODE_NONE),
|
||||||
7,
|
7,
|
||||||
{
|
{
|
||||||
SDL_PIXELFORMAT_RGB555,
|
SDL_PIXELFORMAT_RGB555,
|
||||||
|
@ -233,7 +233,7 @@ SDL_RenderDriver RAW_RenderDriver = {
|
||||||
(SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD),
|
(SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD),
|
||||||
(SDL_TEXTUREMODULATE_NONE),
|
(SDL_TEXTUREMODULATE_NONE),
|
||||||
(SDL_BLENDMODE_NONE),
|
(SDL_BLENDMODE_NONE),
|
||||||
(SDL_TEXTURESCALEMODE_NONE),
|
(SDL_SCALEMODE_NONE),
|
||||||
7,
|
7,
|
||||||
{
|
{
|
||||||
SDL_PIXELFORMAT_RGB555,
|
SDL_PIXELFORMAT_RGB555,
|
||||||
|
|
|
@ -90,7 +90,7 @@ SDL_RenderDriver GDI_RenderDriver = {
|
||||||
SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED),
|
SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED),
|
||||||
(SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_ALPHA),
|
(SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_ALPHA),
|
||||||
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK),
|
(SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK),
|
||||||
(SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST),
|
(SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST),
|
||||||
14,
|
14,
|
||||||
{
|
{
|
||||||
SDL_PIXELFORMAT_INDEX8,
|
SDL_PIXELFORMAT_INDEX8,
|
||||||
|
@ -580,17 +580,17 @@ static int
|
||||||
GDI_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
|
GDI_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
{
|
{
|
||||||
switch (texture->scaleMode) {
|
switch (texture->scaleMode) {
|
||||||
case SDL_TEXTURESCALEMODE_NONE:
|
case SDL_SCALEMODE_NONE:
|
||||||
case SDL_TEXTURESCALEMODE_FAST:
|
case SDL_SCALEMODE_FAST:
|
||||||
return 0;
|
return 0;
|
||||||
case SDL_TEXTURESCALEMODE_SLOW:
|
case SDL_SCALEMODE_SLOW:
|
||||||
case SDL_TEXTURESCALEMODE_BEST:
|
case SDL_SCALEMODE_BEST:
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
texture->scaleMode = SDL_TEXTURESCALEMODE_FAST;
|
texture->scaleMode = SDL_SCALEMODE_FAST;
|
||||||
return -1;
|
return -1;
|
||||||
default:
|
default:
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
|
texture->scaleMode = SDL_SCALEMODE_NONE;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -83,7 +83,7 @@ SDL_RenderDriver X11_RenderDriver = {
|
||||||
SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED),
|
SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_ACCELERATED),
|
||||||
SDL_TEXTUREMODULATE_NONE,
|
SDL_TEXTUREMODULATE_NONE,
|
||||||
SDL_BLENDMODE_NONE,
|
SDL_BLENDMODE_NONE,
|
||||||
SDL_TEXTURESCALEMODE_NONE,
|
SDL_SCALEMODE_NONE,
|
||||||
0,
|
0,
|
||||||
{0},
|
{0},
|
||||||
0,
|
0,
|
||||||
|
@ -331,8 +331,8 @@ X11_AddRenderDriver(_THIS)
|
||||||
/* Update the capabilities of the renderer. */
|
/* Update the capabilities of the renderer. */
|
||||||
info->blend_modes |= (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD |
|
info->blend_modes |= (SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD |
|
||||||
SDL_BLENDMODE_MOD | SDL_BLENDMODE_MASK);
|
SDL_BLENDMODE_MOD | SDL_BLENDMODE_MASK);
|
||||||
info->scale_modes |= (SDL_TEXTURESCALEMODE_FAST | SDL_TEXTURESCALEMODE_SLOW |
|
info->scale_modes |= (SDL_SCALEMODE_FAST | SDL_SCALEMODE_SLOW |
|
||||||
SDL_TEXTURESCALEMODE_BEST);
|
SDL_SCALEMODE_BEST);
|
||||||
info->mod_modes |= (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA);
|
info->mod_modes |= (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1078,7 +1078,7 @@ X11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
// FIXME: Is the following required?
|
// FIXME: Is the following required?
|
||||||
/* Set the default blending and scaling modes. */
|
/* Set the default blending and scaling modes. */
|
||||||
texture->blendMode = SDL_BLENDMODE_NONE;
|
texture->blendMode = SDL_BLENDMODE_NONE;
|
||||||
texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
|
texture->scaleMode = SDL_SCALEMODE_NONE;
|
||||||
data->blend_op = PictOpSrc;
|
data->blend_op = PictOpSrc;
|
||||||
data->filter = NULL;
|
data->filter = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1216,14 +1216,14 @@ X11_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
X11_RenderData *renderdata = (X11_RenderData *) renderer->driverdata;
|
X11_RenderData *renderdata = (X11_RenderData *) renderer->driverdata;
|
||||||
|
|
||||||
switch (texture->scaleMode) {
|
switch (texture->scaleMode) {
|
||||||
case SDL_TEXTURESCALEMODE_NONE:
|
case SDL_SCALEMODE_NONE:
|
||||||
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
|
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
|
||||||
if (renderdata->use_xrender) {
|
if (renderdata->use_xrender) {
|
||||||
data->filter = NULL;
|
data->filter = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
case SDL_TEXTURESCALEMODE_FAST:
|
case SDL_SCALEMODE_FAST:
|
||||||
/* We can sort of fake it for streaming textures */
|
/* We can sort of fake it for streaming textures */
|
||||||
if (data->yuv || texture->access == SDL_TEXTUREACCESS_STREAMING) {
|
if (data->yuv || texture->access == SDL_TEXTUREACCESS_STREAMING) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1233,12 +1233,12 @@ X11_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
data->filter = FilterFast;
|
data->filter = FilterFast;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
case SDL_TEXTURESCALEMODE_SLOW:
|
case SDL_SCALEMODE_SLOW:
|
||||||
if (renderdata->use_xrender) {
|
if (renderdata->use_xrender) {
|
||||||
data->filter = FilterGood;
|
data->filter = FilterGood;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
case SDL_TEXTURESCALEMODE_BEST:
|
case SDL_SCALEMODE_BEST:
|
||||||
if (renderdata->use_xrender) {
|
if (renderdata->use_xrender) {
|
||||||
data->filter = FilterBest;
|
data->filter = FilterBest;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1249,12 +1249,12 @@ X11_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||||
SDL_Unsupported();
|
SDL_Unsupported();
|
||||||
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
|
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
|
||||||
if (renderdata->use_xrender) {
|
if (renderdata->use_xrender) {
|
||||||
texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
|
texture->scaleMode = SDL_SCALEMODE_NONE;
|
||||||
data->filter = NULL;
|
data->filter = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
texture->scaleMode = SDL_TEXTURESCALEMODE_NONE;
|
texture->scaleMode = SDL_SCALEMODE_NONE;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return 0;
|
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. */
|
/* 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,
|
XRenderSetPictureFilter(data->display, src,
|
||||||
texturedata->filter, 0, 0);
|
texturedata->filter, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -437,16 +437,16 @@ static void
|
||||||
PrintScaleMode(Uint32 flag)
|
PrintScaleMode(Uint32 flag)
|
||||||
{
|
{
|
||||||
switch (flag) {
|
switch (flag) {
|
||||||
case SDL_TEXTURESCALEMODE_NONE:
|
case SDL_SCALEMODE_NONE:
|
||||||
fprintf(stderr, "None");
|
fprintf(stderr, "None");
|
||||||
break;
|
break;
|
||||||
case SDL_TEXTURESCALEMODE_FAST:
|
case SDL_SCALEMODE_FAST:
|
||||||
fprintf(stderr, "Fast");
|
fprintf(stderr, "Fast");
|
||||||
break;
|
break;
|
||||||
case SDL_TEXTURESCALEMODE_SLOW:
|
case SDL_SCALEMODE_SLOW:
|
||||||
fprintf(stderr, "Slow");
|
fprintf(stderr, "Slow");
|
||||||
break;
|
break;
|
||||||
case SDL_TEXTURESCALEMODE_BEST:
|
case SDL_SCALEMODE_BEST:
|
||||||
fprintf(stderr, "Best");
|
fprintf(stderr, "Best");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -21,7 +21,7 @@ static SDL_Rect *positions;
|
||||||
static SDL_Rect *velocities;
|
static SDL_Rect *velocities;
|
||||||
static int sprite_w, sprite_h;
|
static int sprite_w, sprite_h;
|
||||||
static SDL_BlendMode blendMode = SDL_BLENDMODE_MASK;
|
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. */
|
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
|
||||||
static void
|
static void
|
||||||
|
@ -256,16 +256,16 @@ main(int argc, char *argv[])
|
||||||
} else if (SDL_strcasecmp(argv[i], "--scale") == 0) {
|
} else if (SDL_strcasecmp(argv[i], "--scale") == 0) {
|
||||||
if (argv[i + 1]) {
|
if (argv[i + 1]) {
|
||||||
if (SDL_strcasecmp(argv[i + 1], "none") == 0) {
|
if (SDL_strcasecmp(argv[i + 1], "none") == 0) {
|
||||||
scaleMode = SDL_TEXTURESCALEMODE_NONE;
|
scaleMode = SDL_SCALEMODE_NONE;
|
||||||
consumed = 2;
|
consumed = 2;
|
||||||
} else if (SDL_strcasecmp(argv[i + 1], "fast") == 0) {
|
} else if (SDL_strcasecmp(argv[i + 1], "fast") == 0) {
|
||||||
scaleMode = SDL_TEXTURESCALEMODE_FAST;
|
scaleMode = SDL_SCALEMODE_FAST;
|
||||||
consumed = 2;
|
consumed = 2;
|
||||||
} else if (SDL_strcasecmp(argv[i + 1], "slow") == 0) {
|
} else if (SDL_strcasecmp(argv[i + 1], "slow") == 0) {
|
||||||
scaleMode = SDL_TEXTURESCALEMODE_SLOW;
|
scaleMode = SDL_SCALEMODE_SLOW;
|
||||||
consumed = 2;
|
consumed = 2;
|
||||||
} else if (SDL_strcasecmp(argv[i + 1], "best") == 0) {
|
} else if (SDL_strcasecmp(argv[i + 1], "best") == 0) {
|
||||||
scaleMode = SDL_TEXTURESCALEMODE_BEST;
|
scaleMode = SDL_SCALEMODE_BEST;
|
||||||
consumed = 2;
|
consumed = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -316,7 +316,7 @@ main(int argc, char *argv[])
|
||||||
quit(2);
|
quit(2);
|
||||||
}
|
}
|
||||||
srand((unsigned int)time(NULL));
|
srand((unsigned int)time(NULL));
|
||||||
if (scaleMode != SDL_TEXTURESCALEMODE_NONE) {
|
if (scaleMode != SDL_SCALEMODE_NONE) {
|
||||||
sprite_w += sprite_w / 2;
|
sprite_w += sprite_w / 2;
|
||||||
sprite_h += sprite_h / 2;
|
sprite_h += sprite_h / 2;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue