mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-17 10:18:28 +00:00
Fix #ifdef
s to have config flags either defined as 1 or undefined
See 387774ab8a
This commit is contained in:
parent
313d522f39
commit
8b6d3c88cf
31 changed files with 154 additions and 156 deletions
|
@ -1450,7 +1450,7 @@ SDL_Texture *SDL_CreateTextureWithProperties(SDL_Renderer *renderer, SDL_Propert
|
|||
renderer->textures = texture;
|
||||
|
||||
if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
|
||||
#if SDL_HAVE_YUV
|
||||
#ifdef SDL_HAVE_YUV
|
||||
texture->yuv = SDL_SW_CreateYUVTexture(texture->format, texture->colorspace, w, h);
|
||||
#else
|
||||
SDL_SetError("SDL not built with YUV support");
|
||||
|
@ -1971,7 +1971,7 @@ bool SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode)
|
|||
return true;
|
||||
}
|
||||
|
||||
#if SDL_HAVE_YUV
|
||||
#ifdef SDL_HAVE_YUV
|
||||
static bool SDL_UpdateTextureYUV(SDL_Texture *texture, const SDL_Rect *rect,
|
||||
const void *pixels, int pitch)
|
||||
{
|
||||
|
@ -2083,7 +2083,7 @@ bool SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *p
|
|||
|
||||
if (real_rect.w == 0 || real_rect.h == 0) {
|
||||
return true; // nothing to do.
|
||||
#if SDL_HAVE_YUV
|
||||
#ifdef SDL_HAVE_YUV
|
||||
} else if (texture->yuv) {
|
||||
return SDL_UpdateTextureYUV(texture, &real_rect, pixels, pitch);
|
||||
#endif
|
||||
|
@ -2098,7 +2098,7 @@ bool SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *p
|
|||
}
|
||||
}
|
||||
|
||||
#if SDL_HAVE_YUV
|
||||
#ifdef SDL_HAVE_YUV
|
||||
static bool SDL_UpdateTextureYUVPlanar(SDL_Texture *texture, const SDL_Rect *rect,
|
||||
const Uint8 *Yplane, int Ypitch,
|
||||
const Uint8 *Uplane, int Upitch,
|
||||
|
@ -2207,7 +2207,7 @@ bool SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect,
|
|||
const Uint8 *Uplane, int Upitch,
|
||||
const Uint8 *Vplane, int Vpitch)
|
||||
{
|
||||
#if SDL_HAVE_YUV
|
||||
#ifdef SDL_HAVE_YUV
|
||||
SDL_Renderer *renderer;
|
||||
SDL_Rect real_rect;
|
||||
|
||||
|
@ -2273,7 +2273,7 @@ bool SDL_UpdateNVTexture(SDL_Texture *texture, const SDL_Rect *rect,
|
|||
const Uint8 *Yplane, int Ypitch,
|
||||
const Uint8 *UVplane, int UVpitch)
|
||||
{
|
||||
#if SDL_HAVE_YUV
|
||||
#ifdef SDL_HAVE_YUV
|
||||
SDL_Renderer *renderer;
|
||||
SDL_Rect real_rect;
|
||||
|
||||
|
@ -2329,7 +2329,7 @@ bool SDL_UpdateNVTexture(SDL_Texture *texture, const SDL_Rect *rect,
|
|||
#endif
|
||||
}
|
||||
|
||||
#if SDL_HAVE_YUV
|
||||
#ifdef SDL_HAVE_YUV
|
||||
static bool SDL_LockTextureYUV(SDL_Texture *texture, const SDL_Rect *rect,
|
||||
void **pixels, int *pitch)
|
||||
{
|
||||
|
@ -2366,7 +2366,7 @@ bool SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixels,
|
|||
rect = &full_rect;
|
||||
}
|
||||
|
||||
#if SDL_HAVE_YUV
|
||||
#ifdef SDL_HAVE_YUV
|
||||
if (texture->yuv) {
|
||||
if (!FlushRenderCommandsIfTextureNeeded(texture)) {
|
||||
return false;
|
||||
|
@ -2418,7 +2418,7 @@ bool SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Su
|
|||
return true;
|
||||
}
|
||||
|
||||
#if SDL_HAVE_YUV
|
||||
#ifdef SDL_HAVE_YUV
|
||||
static void SDL_UnlockTextureYUV(SDL_Texture *texture)
|
||||
{
|
||||
SDL_Texture *native = texture->native;
|
||||
|
@ -2467,7 +2467,7 @@ void SDL_UnlockTexture(SDL_Texture *texture)
|
|||
if (texture->access != SDL_TEXTUREACCESS_STREAMING) {
|
||||
return;
|
||||
}
|
||||
#if SDL_HAVE_YUV
|
||||
#ifdef SDL_HAVE_YUV
|
||||
if (texture->yuv) {
|
||||
SDL_UnlockTextureYUV(texture);
|
||||
} else
|
||||
|
@ -5148,7 +5148,7 @@ static void SDL_DestroyTextureInternal(SDL_Texture *texture, bool is_destroying)
|
|||
if (texture->native) {
|
||||
SDL_DestroyTextureInternal(texture->native, is_destroying);
|
||||
}
|
||||
#if SDL_HAVE_YUV
|
||||
#ifdef SDL_HAVE_YUV
|
||||
if (texture->yuv) {
|
||||
SDL_SW_DestroyYUVTexture(texture->yuv);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue