Added a single SDL_LEAN_AND_MEAN define to turn on minimal SDL builds

Protected more code with #ifdefs to reduce the size of minimal shared library builds
This commit is contained in:
Sam Lantinga
2020-01-23 01:00:52 -08:00
parent b1c6e7c244
commit b5e3d264f2
21 changed files with 108 additions and 21 deletions

View File

@@ -1426,6 +1426,7 @@ SDL_GetTextureScaleMode(SDL_Texture * texture, SDL_ScaleMode *scaleMode)
return 0;
}
#if SDL_HAVE_YUV
static int
SDL_UpdateTextureYUV(SDL_Texture * texture, const SDL_Rect * rect,
const void *pixels, int pitch)
@@ -1471,6 +1472,7 @@ SDL_UpdateTextureYUV(SDL_Texture * texture, const SDL_Rect * rect,
}
return 0;
}
#endif /* SDL_HAVE_YUV */
static int
SDL_UpdateTextureNative(SDL_Texture * texture, const SDL_Rect * rect,
@@ -1553,6 +1555,7 @@ SDL_UpdateTexture(SDL_Texture * texture, const SDL_Rect * rect,
}
}
#if SDL_HAVE_YUV
static int
SDL_UpdateTextureYUVPlanar(SDL_Texture * texture, const SDL_Rect * rect,
const Uint8 *Yplane, int Ypitch,
@@ -1604,6 +1607,7 @@ SDL_UpdateTextureYUVPlanar(SDL_Texture * texture, const SDL_Rect * rect,
}
return 0;
}
#endif /* SDL_HAVE_YUV */
int SDL_UpdateYUVTexture(SDL_Texture * texture, const SDL_Rect * rect,
const Uint8 *Yplane, int Ypitch,
@@ -1672,12 +1676,14 @@ int SDL_UpdateYUVTexture(SDL_Texture * texture, const SDL_Rect * rect,
#endif
}
#if SDL_HAVE_YUV
static int
SDL_LockTextureYUV(SDL_Texture * texture, const SDL_Rect * rect,
void **pixels, int *pitch)
{
return SDL_SW_LockYUVTexture(texture->yuv, rect, pixels, pitch);
}
#endif /* SDL_HAVE_YUV */
static int
SDL_LockTextureNative(SDL_Texture * texture, const SDL_Rect * rect,
@@ -1767,6 +1773,7 @@ SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect,
return 0;
}
#if SDL_HAVE_YUV
static void
SDL_UnlockTextureYUV(SDL_Texture * texture)
{
@@ -1787,6 +1794,7 @@ SDL_UnlockTextureYUV(SDL_Texture * texture)
rect.w, rect.h, native_pixels, native_pitch);
SDL_UnlockTexture(native);
}
#endif /* SDL_HAVE_YUV */
static void
SDL_UnlockTextureNative(SDL_Texture * texture)

View File

@@ -22,6 +22,8 @@
/* This is the software implementation of the YUV texture support */
#if SDL_HAVE_YUV
#include "SDL_assert.h"
#include "SDL_yuv_sw_c.h"
@@ -411,4 +413,6 @@ SDL_SW_DestroyYUVTexture(SDL_SW_YUVTexture * swdata)
}
}
#endif /* SDL_HAVE_YUV */
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
#include "SDL_draw.h"
#include "SDL_blendfillrect.h"
@@ -352,6 +352,6 @@ SDL_BlendFillRects(SDL_Surface * dst, const SDL_Rect * rects, int count,
return status;
}
#endif /* !SDL_RENDER_DISABLED */
#endif /* SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED */
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
#include "SDL_draw.h"
#include "SDL_blendline.h"
@@ -870,6 +870,6 @@ SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count,
return 0;
}
#endif /* !SDL_RENDER_DISABLED */
#endif /* SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED */
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
#include "SDL_draw.h"
#include "SDL_blendpoint.h"
@@ -357,6 +357,6 @@ SDL_BlendPoints(SDL_Surface * dst, const SDL_Point * points, int count,
return status;
}
#endif /* !SDL_RENDER_DISABLED */
#endif /* SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED */
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
#include "SDL_draw.h"
#include "SDL_drawline.h"
@@ -204,6 +204,6 @@ SDL_DrawLines(SDL_Surface * dst, const SDL_Point * points, int count,
return 0;
}
#endif /* !SDL_RENDER_DISABLED */
#endif /* SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED */
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
#include "SDL_draw.h"
#include "SDL_drawpoint.h"
@@ -109,6 +109,6 @@ SDL_DrawPoints(SDL_Surface * dst, const SDL_Point * points, int count,
return 0;
}
#endif /* !SDL_RENDER_DISABLED */
#endif /* SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED */
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -20,7 +20,7 @@
*/
#include "../../SDL_internal.h"
#if !SDL_RENDER_DISABLED
#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
#include "../SDL_sysrender.h"
#include "SDL_render_sw_c.h"
@@ -889,6 +889,6 @@ SDL_RenderDriver SW_RenderDriver = {
0}
};
#endif /* !SDL_RENDER_DISABLED */
#endif /* SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED */
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -30,6 +30,8 @@ Andreas Schiffler -- aschiffler at ferzkopp dot net
*/
#include "../../SDL_internal.h"
#if SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED
#if defined(__WIN32__)
#include "../../core/windows/SDL_windows.h"
#endif
@@ -532,3 +534,5 @@ SDLgfx_rotateSurface(SDL_Surface * src, double angle, int centerx, int centery,
/* Return rotated surface */
return rz_dst;
}
#endif /* SDL_VIDEO_RENDER_SW && !SDL_RENDER_DISABLED */