mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-14 23:38:14 +00:00
Use #ifdef/#ifndef instead of #if defined/#if \!defined
This commit is contained in:

committed by
Anonymous Maarten

parent
308bcbbe76
commit
b6ae281e97
@@ -27,7 +27,7 @@
|
||||
#include "../video/SDL_pixels_c.h"
|
||||
#include "../video/SDL_video_c.h"
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
#ifdef __ANDROID__
|
||||
#include "../core/android/SDL_android.h"
|
||||
#endif
|
||||
|
||||
@@ -668,7 +668,7 @@ static int UpdateLogicalPresentation(SDL_Renderer *renderer);
|
||||
|
||||
int SDL_GetNumRenderDrivers(void)
|
||||
{
|
||||
#if !defined(SDL_RENDER_DISABLED)
|
||||
#ifndef SDL_RENDER_DISABLED
|
||||
return SDL_arraysize(render_drivers);
|
||||
#else
|
||||
return 0;
|
||||
@@ -677,7 +677,7 @@ int SDL_GetNumRenderDrivers(void)
|
||||
|
||||
const char *SDL_GetRenderDriver(int index)
|
||||
{
|
||||
#if !defined(SDL_RENDER_DISABLED)
|
||||
#ifndef SDL_RENDER_DISABLED
|
||||
if (index < 0 || index >= SDL_GetNumRenderDrivers()) {
|
||||
SDL_SetError("index must be in the range of 0 - %d",
|
||||
SDL_GetNumRenderDrivers() - 1);
|
||||
@@ -741,7 +741,7 @@ int SDL_CreateWindowAndRenderer(int width, int height, Uint32 window_flags, SDL_
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if !defined(SDL_RENDER_DISABLED)
|
||||
#ifndef SDL_RENDER_DISABLED
|
||||
static SDL_INLINE void VerifyDrawQueueFunctions(const SDL_Renderer *renderer)
|
||||
{
|
||||
/* all of these functions are required to be implemented, even as no-ops, so we don't
|
||||
@@ -801,14 +801,14 @@ static void SDL_CalculateSimulatedVSyncInterval(SDL_Renderer *renderer, SDL_Wind
|
||||
|
||||
SDL_Renderer *SDL_CreateRenderer(SDL_Window *window, const char *name, Uint32 flags)
|
||||
{
|
||||
#if !defined(SDL_RENDER_DISABLED)
|
||||
#ifndef SDL_RENDER_DISABLED
|
||||
SDL_Renderer *renderer = NULL;
|
||||
const int n = SDL_GetNumRenderDrivers();
|
||||
SDL_bool batching = SDL_TRUE;
|
||||
const char *hint;
|
||||
int i;
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
#ifdef __ANDROID__
|
||||
Android_ActivityMutex_Lock_Running();
|
||||
#endif
|
||||
|
||||
@@ -928,14 +928,14 @@ SDL_Renderer *SDL_CreateRenderer(SDL_Window *window, const char *name, Uint32 fl
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_RENDER,
|
||||
"Created renderer: %s", renderer->info.name);
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
#ifdef __ANDROID__
|
||||
Android_ActivityMutex_Unlock();
|
||||
#endif
|
||||
return renderer;
|
||||
|
||||
error:
|
||||
|
||||
#if defined(__ANDROID__)
|
||||
#ifdef __ANDROID__
|
||||
Android_ActivityMutex_Unlock();
|
||||
#endif
|
||||
return NULL;
|
||||
|
@@ -24,7 +24,7 @@
|
||||
|
||||
#define COBJMACROS
|
||||
#include "../../core/windows/SDL_windows.h"
|
||||
#if !defined(__WINRT__)
|
||||
#ifndef __WINRT__
|
||||
#include "../../video/windows/SDL_windowswindow.h"
|
||||
#endif
|
||||
#include "../SDL_sysrender.h"
|
||||
@@ -895,7 +895,7 @@ static HRESULT D3D11_CreateWindowSizeDependentResources(SDL_Renderer *renderer)
|
||||
/* The width and height of the swap chain must be based on the display's
|
||||
* non-rotated size.
|
||||
*/
|
||||
#if defined(__WINRT__)
|
||||
#ifdef __WINRT__
|
||||
SDL_GetWindowSize(renderer->window, &w, &h);
|
||||
#else
|
||||
SDL_GetWindowSizeInPixels(renderer->window, &w, &h);
|
||||
|
@@ -77,7 +77,7 @@
|
||||
return input.color;
|
||||
}
|
||||
*/
|
||||
#if defined(D3D11_USE_SHADER_MODEL_4_0_level_9_1)
|
||||
#ifdef D3D11_USE_SHADER_MODEL_4_0_level_9_1
|
||||
static const DWORD D3D11_PixelShader_Colors[] = {
|
||||
0x43425844, 0xd74c28fe, 0xa1eb8804, 0x269d512a, 0x7699723d, 0x00000001,
|
||||
0x00000240, 0x00000006, 0x00000038, 0x00000084, 0x000000c4, 0x00000140,
|
||||
@@ -153,7 +153,7 @@ static const DWORD D3D11_PixelShader_Colors[] = {
|
||||
return theTexture.Sample(theSampler, input.tex) * input.color;
|
||||
}
|
||||
*/
|
||||
#if defined(D3D11_USE_SHADER_MODEL_4_0_level_9_1)
|
||||
#ifdef D3D11_USE_SHADER_MODEL_4_0_level_9_1
|
||||
static const DWORD D3D11_PixelShader_Textures[] = {
|
||||
0x43425844, 0x6299b59f, 0x155258f2, 0x873ab86a, 0xfcbb6dcd, 0x00000001,
|
||||
0x00000330, 0x00000006, 0x00000038, 0x000000c0, 0x0000015c, 0x000001d8,
|
||||
@@ -270,7 +270,7 @@ static const DWORD D3D11_PixelShader_Textures[] = {
|
||||
}
|
||||
|
||||
*/
|
||||
#if defined(D3D11_USE_SHADER_MODEL_4_0_level_9_1)
|
||||
#ifdef D3D11_USE_SHADER_MODEL_4_0_level_9_1
|
||||
static const DWORD D3D11_PixelShader_YUV_JPEG[] = {
|
||||
0x43425844, 0x10359e9c, 0x92c3d2c4, 0x00bf0cd5, 0x5ce8c499, 0x00000001,
|
||||
0x000005e8, 0x00000006, 0x00000038, 0x000001dc, 0x000003bc, 0x00000438,
|
||||
@@ -444,7 +444,7 @@ static const DWORD D3D11_PixelShader_YUV_JPEG[] = {
|
||||
}
|
||||
|
||||
*/
|
||||
#if defined(D3D11_USE_SHADER_MODEL_4_0_level_9_1)
|
||||
#ifdef D3D11_USE_SHADER_MODEL_4_0_level_9_1
|
||||
static const DWORD D3D11_PixelShader_YUV_BT601[] = {
|
||||
0x43425844, 0x628ec838, 0xbe9cec6a, 0xc9ee10bb, 0x63283218, 0x00000001,
|
||||
0x000005e8, 0x00000006, 0x00000038, 0x000001dc, 0x000003bc, 0x00000438,
|
||||
@@ -618,7 +618,7 @@ static const DWORD D3D11_PixelShader_YUV_BT601[] = {
|
||||
}
|
||||
|
||||
*/
|
||||
#if defined(D3D11_USE_SHADER_MODEL_4_0_level_9_1)
|
||||
#ifdef D3D11_USE_SHADER_MODEL_4_0_level_9_1
|
||||
static const DWORD D3D11_PixelShader_YUV_BT709[] = {
|
||||
0x43425844, 0x5045fa84, 0xc2908cce, 0x278dacc3, 0xd4276f8f, 0x00000001,
|
||||
0x000005e8, 0x00000006, 0x00000038, 0x000001dc, 0x000003bc, 0x00000438,
|
||||
@@ -790,7 +790,7 @@ static const DWORD D3D11_PixelShader_YUV_BT709[] = {
|
||||
}
|
||||
|
||||
*/
|
||||
#if defined(D3D11_USE_SHADER_MODEL_4_0_level_9_1)
|
||||
#ifdef D3D11_USE_SHADER_MODEL_4_0_level_9_1
|
||||
static const DWORD D3D11_PixelShader_NV12_JPEG[] = {
|
||||
0x43425844, 0x8fb9c77a, 0xe9e39686, 0x62b0e0e9, 0xd2bf8183, 0x00000001,
|
||||
0x00000548, 0x00000006, 0x00000038, 0x000001b0, 0x00000348, 0x000003c4,
|
||||
@@ -949,7 +949,7 @@ static const DWORD D3D11_PixelShader_NV12_JPEG[] = {
|
||||
}
|
||||
|
||||
*/
|
||||
#if defined(D3D11_USE_SHADER_MODEL_4_0_level_9_1)
|
||||
#ifdef D3D11_USE_SHADER_MODEL_4_0_level_9_1
|
||||
static const DWORD D3D11_PixelShader_NV12_BT601[] = {
|
||||
0x43425844, 0xd1d24a0c, 0x337c447a, 0x22b55cff, 0xb5c9c74b, 0x00000001,
|
||||
0x00000548, 0x00000006, 0x00000038, 0x000001b0, 0x00000348, 0x000003c4,
|
||||
@@ -1108,7 +1108,7 @@ static const DWORD D3D11_PixelShader_NV12_BT601[] = {
|
||||
}
|
||||
|
||||
*/
|
||||
#if defined(D3D11_USE_SHADER_MODEL_4_0_level_9_1)
|
||||
#ifdef D3D11_USE_SHADER_MODEL_4_0_level_9_1
|
||||
static const DWORD D3D11_PixelShader_NV12_BT709[] = {
|
||||
0x43425844, 0x40d1b8d5, 0xaf4b78b5, 0x907fd0b5, 0xa2d23686, 0x00000001,
|
||||
0x00000548, 0x00000006, 0x00000038, 0x000001b0, 0x00000348, 0x000003c4,
|
||||
@@ -1267,7 +1267,7 @@ static const DWORD D3D11_PixelShader_NV12_BT709[] = {
|
||||
}
|
||||
|
||||
*/
|
||||
#if defined(D3D11_USE_SHADER_MODEL_4_0_level_9_1)
|
||||
#ifdef D3D11_USE_SHADER_MODEL_4_0_level_9_1
|
||||
static const DWORD D3D11_PixelShader_NV21_JPEG[] = {
|
||||
0x43425844, 0x9c41f579, 0xfd1019d8, 0x7c27e3ae, 0x52e3a5ff, 0x00000001,
|
||||
0x00000554, 0x00000006, 0x00000038, 0x000001bc, 0x00000354, 0x000003d0,
|
||||
@@ -1426,7 +1426,7 @@ static const DWORD D3D11_PixelShader_NV21_JPEG[] = {
|
||||
}
|
||||
|
||||
*/
|
||||
#if defined(D3D11_USE_SHADER_MODEL_4_0_level_9_1)
|
||||
#ifdef D3D11_USE_SHADER_MODEL_4_0_level_9_1
|
||||
static const DWORD D3D11_PixelShader_NV21_BT601[] = {
|
||||
0x43425844, 0x7fc6cfdc, 0xba87a4ff, 0xa72685a6, 0xa051b38c, 0x00000001,
|
||||
0x00000554, 0x00000006, 0x00000038, 0x000001bc, 0x00000354, 0x000003d0,
|
||||
@@ -1585,7 +1585,7 @@ static const DWORD D3D11_PixelShader_NV21_BT601[] = {
|
||||
}
|
||||
|
||||
*/
|
||||
#if defined(D3D11_USE_SHADER_MODEL_4_0_level_9_1)
|
||||
#ifdef D3D11_USE_SHADER_MODEL_4_0_level_9_1
|
||||
static const DWORD D3D11_PixelShader_NV21_BT709[] = {
|
||||
0x43425844, 0x754ba6c4, 0xe321a747, 0x23680787, 0x6bb1bdcc, 0x00000001,
|
||||
0x00000554, 0x00000006, 0x00000038, 0x000001bc, 0x00000354, 0x000003d0,
|
||||
@@ -1749,7 +1749,7 @@ static const DWORD D3D11_PixelShader_NV21_BT709[] = {
|
||||
return output;
|
||||
}
|
||||
*/
|
||||
#if defined(D3D11_USE_SHADER_MODEL_4_0_level_9_1)
|
||||
#ifdef D3D11_USE_SHADER_MODEL_4_0_level_9_1
|
||||
static const DWORD D3D11_VertexShader[] = {
|
||||
0x43425844, 0x62dfae5f, 0x3e8bd8df, 0x9ec97127, 0x5044eefb, 0x00000001,
|
||||
0x00000598, 0x00000006, 0x00000038, 0x0000016c, 0x00000334, 0x000003b0,
|
||||
|
@@ -33,7 +33,7 @@
|
||||
In all other cases, attempt to use client-side arrays, as they tend to
|
||||
be dramatically faster when not batching, and about the same when
|
||||
we are. */
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
#ifdef __EMSCRIPTEN__
|
||||
#define USE_VERTEX_BUFFER_OBJECTS 1
|
||||
#else
|
||||
#define USE_VERTEX_BUFFER_OBJECTS 0
|
||||
|
Reference in New Issue
Block a user