Removed SDL_bool in favor of plain bool
We require stdbool.h in the build environment, so we might as well use the plain bool type. If your environment doesn't have stdbool.h, this simple replacement will suffice: typedef signed char bool;
This commit is contained in:
1 parent
9dd8859240
commit
a90ad3b0e2
258 files changed
+4052
-4057
No files matched your search
@@ -110,7 +110,7 @@ SDL_NORETURN void SDL_ExitProcess(int exitcode)
|
||||
|
||||
// App metadata
|
||||
|
||||
SDL_bool SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier)
|
||||
bool SDL_SetAppMetadata(const char *appname, const char *appversion, const char *appidentifier)
|
||||
{
|
||||
SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_NAME_STRING, appname);
|
||||
SDL_SetAppMetadataProperty(SDL_PROP_APP_METADATA_VERSION_STRING, appversion);
|
||||
@@ -136,7 +136,7 @@ static bool SDL_ValidMetadataProperty(const char *name)
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetAppMetadataProperty(const char *name, const char *value)
|
||||
bool SDL_SetAppMetadataProperty(const char *name, const char *value)
|
||||
{
|
||||
if (!SDL_ValidMetadataProperty(name)) {
|
||||
return SDL_InvalidParamError("name");
|
||||
@@ -264,7 +264,7 @@ static void SDL_QuitMainThread(void)
|
||||
SDL_QuitTLSData();
|
||||
}
|
||||
|
||||
SDL_bool SDL_InitSubSystem(SDL_InitFlags flags)
|
||||
bool SDL_InitSubSystem(SDL_InitFlags flags)
|
||||
{
|
||||
Uint32 flags_initialized = 0;
|
||||
|
||||
@@ -471,7 +471,7 @@ quit_and_error:
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_bool SDL_Init(SDL_InitFlags flags)
|
||||
bool SDL_Init(SDL_InitFlags flags)
|
||||
{
|
||||
return SDL_InitSubSystem(flags);
|
||||
}
|
||||
@@ -707,7 +707,7 @@ const char *SDL_GetPlatform(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
SDL_bool SDL_IsTablet(void)
|
||||
bool SDL_IsTablet(void)
|
||||
{
|
||||
#ifdef SDL_PLATFORM_ANDROID
|
||||
extern bool SDL_IsAndroidTablet(void);
|
||||
|
||||
+3
-3
@@ -24,7 +24,7 @@
|
||||
|
||||
#include "SDL_error_c.h"
|
||||
|
||||
SDL_bool SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
|
||||
bool SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
|
||||
{
|
||||
// Ignore call if invalid format pointer was passed
|
||||
if (fmt) {
|
||||
@@ -77,7 +77,7 @@ const char *SDL_GetError(void)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_ClearError(void)
|
||||
bool SDL_ClearError(void)
|
||||
{
|
||||
SDL_error *error = SDL_GetErrBuf(false);
|
||||
|
||||
@@ -87,7 +87,7 @@ SDL_bool SDL_ClearError(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_OutOfMemory(void)
|
||||
bool SDL_OutOfMemory(void)
|
||||
{
|
||||
SDL_error *error = SDL_GetErrBuf(true);
|
||||
|
||||
|
||||
+5
-5
@@ -83,7 +83,7 @@ static void SDLCALL CleanupHintProperty(void *userdata, void *value)
|
||||
SDL_free(hint);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority)
|
||||
bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority)
|
||||
{
|
||||
if (!name || !*name) {
|
||||
return SDL_InvalidParamError("name");
|
||||
@@ -137,7 +137,7 @@ SDL_bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPr
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ResetHint(const char *name)
|
||||
bool SDL_ResetHint(const char *name)
|
||||
{
|
||||
if (!name || !*name) {
|
||||
return SDL_InvalidParamError("name");
|
||||
@@ -202,7 +202,7 @@ void SDL_ResetHints(void)
|
||||
SDL_EnumerateProperties(GetHintProperties(false), ResetHintsCallback, NULL);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetHint(const char *name, const char *value)
|
||||
bool SDL_SetHint(const char *name, const char *value)
|
||||
{
|
||||
return SDL_SetHintWithPriority(name, value, SDL_HINT_NORMAL);
|
||||
}
|
||||
@@ -260,13 +260,13 @@ bool SDL_GetStringBoolean(const char *value, bool default_value)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetHintBoolean(const char *name, SDL_bool default_value)
|
||||
bool SDL_GetHintBoolean(const char *name, bool default_value)
|
||||
{
|
||||
const char *hint = SDL_GetHint(name);
|
||||
return SDL_GetStringBoolean(hint, default_value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata)
|
||||
bool SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata)
|
||||
{
|
||||
if (!name || !*name) {
|
||||
return SDL_InvalidParamError("name");
|
||||
|
||||
+3
-3
@@ -241,9 +241,9 @@ extern void SDL_InitMainThread(void);
|
||||
/* The internal implementations of these functions have up to nanosecond precision.
|
||||
We can expose these functions as part of the API if we want to later.
|
||||
*/
|
||||
extern SDL_bool SDLCALL SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS);
|
||||
extern SDL_bool SDLCALL SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS);
|
||||
extern SDL_bool SDLCALL SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS);
|
||||
extern bool SDLCALL SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS);
|
||||
extern bool SDLCALL SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS);
|
||||
extern bool SDLCALL SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS);
|
||||
|
||||
// Ends C function definitions when using C++
|
||||
#ifdef __cplusplus
|
||||
|
||||
+1
-1
@@ -446,7 +446,7 @@ static const char *GetLogPriorityPrefix(SDL_LogPriority priority)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetLogPriorityPrefix(SDL_LogPriority priority, const char *prefix)
|
||||
bool SDL_SetLogPriorityPrefix(SDL_LogPriority priority, const char *prefix)
|
||||
{
|
||||
char *prefix_copy;
|
||||
|
||||
|
||||
+13
-13
@@ -210,7 +210,7 @@ error:
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_bool SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst)
|
||||
bool SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst)
|
||||
{
|
||||
SDL_Properties *src_properties = NULL;
|
||||
SDL_Properties *dst_properties = NULL;
|
||||
@@ -282,7 +282,7 @@ SDL_bool SDL_CopyProperties(SDL_PropertiesID src, SDL_PropertiesID dst)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_LockProperties(SDL_PropertiesID props)
|
||||
bool SDL_LockProperties(SDL_PropertiesID props)
|
||||
{
|
||||
SDL_Properties *properties = NULL;
|
||||
|
||||
@@ -321,7 +321,7 @@ void SDL_UnlockProperties(SDL_PropertiesID props)
|
||||
SDL_UnlockMutex(properties->lock);
|
||||
}
|
||||
|
||||
static SDL_bool SDL_PrivateSetProperty(SDL_PropertiesID props, const char *name, SDL_Property *property)
|
||||
static bool SDL_PrivateSetProperty(SDL_PropertiesID props, const char *name, SDL_Property *property)
|
||||
{
|
||||
SDL_Properties *properties = NULL;
|
||||
bool result = true;
|
||||
@@ -360,7 +360,7 @@ static SDL_bool SDL_PrivateSetProperty(SDL_PropertiesID props, const char *name,
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata)
|
||||
bool SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *name, void *value, SDL_CleanupPropertyCallback cleanup, void *userdata)
|
||||
{
|
||||
SDL_Property *property;
|
||||
|
||||
@@ -386,7 +386,7 @@ SDL_bool SDL_SetPointerPropertyWithCleanup(SDL_PropertiesID props, const char *n
|
||||
return SDL_PrivateSetProperty(props, name, property);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value)
|
||||
bool SDL_SetPointerProperty(SDL_PropertiesID props, const char *name, void *value)
|
||||
{
|
||||
SDL_Property *property;
|
||||
|
||||
@@ -425,7 +425,7 @@ bool SDL_SetSurfaceProperty(SDL_PropertiesID props, const char *name, SDL_Surfac
|
||||
return SDL_SetPointerPropertyWithCleanup(props, name, surface, CleanupSurface, NULL);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value)
|
||||
bool SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const char *value)
|
||||
{
|
||||
SDL_Property *property;
|
||||
|
||||
@@ -446,7 +446,7 @@ SDL_bool SDL_SetStringProperty(SDL_PropertiesID props, const char *name, const c
|
||||
return SDL_PrivateSetProperty(props, name, property);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value)
|
||||
bool SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64 value)
|
||||
{
|
||||
SDL_Property *property = (SDL_Property *)SDL_calloc(1, sizeof(*property));
|
||||
if (!property) {
|
||||
@@ -457,7 +457,7 @@ SDL_bool SDL_SetNumberProperty(SDL_PropertiesID props, const char *name, Sint64
|
||||
return SDL_PrivateSetProperty(props, name, property);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value)
|
||||
bool SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float value)
|
||||
{
|
||||
SDL_Property *property = (SDL_Property *)SDL_calloc(1, sizeof(*property));
|
||||
if (!property) {
|
||||
@@ -468,7 +468,7 @@ SDL_bool SDL_SetFloatProperty(SDL_PropertiesID props, const char *name, float va
|
||||
return SDL_PrivateSetProperty(props, name, property);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool value)
|
||||
bool SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, bool value)
|
||||
{
|
||||
SDL_Property *property = (SDL_Property *)SDL_calloc(1, sizeof(*property));
|
||||
if (!property) {
|
||||
@@ -479,7 +479,7 @@ SDL_bool SDL_SetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bo
|
||||
return SDL_PrivateSetProperty(props, name, property);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasProperty(SDL_PropertiesID props, const char *name)
|
||||
bool SDL_HasProperty(SDL_PropertiesID props, const char *name)
|
||||
{
|
||||
return (SDL_GetPropertyType(props, name) != SDL_PROPERTY_TYPE_INVALID);
|
||||
}
|
||||
@@ -709,7 +709,7 @@ float SDL_GetFloatProperty(SDL_PropertiesID props, const char *name, float defau
|
||||
return value;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bool default_value)
|
||||
bool SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, bool default_value)
|
||||
{
|
||||
SDL_Properties *properties = NULL;
|
||||
bool value = default_value ? true : false;
|
||||
@@ -756,12 +756,12 @@ SDL_bool SDL_GetBooleanProperty(SDL_PropertiesID props, const char *name, SDL_bo
|
||||
return value;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ClearProperty(SDL_PropertiesID props, const char *name)
|
||||
bool SDL_ClearProperty(SDL_PropertiesID props, const char *name)
|
||||
{
|
||||
return SDL_PrivateSetProperty(props, name, NULL);
|
||||
}
|
||||
|
||||
SDL_bool SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata)
|
||||
bool SDL_EnumerateProperties(SDL_PropertiesID props, SDL_EnumeratePropertiesCallback callback, void *userdata)
|
||||
{
|
||||
SDL_Properties *properties = NULL;
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ static SDL_INLINE void leaveLock(void *a)
|
||||
}
|
||||
#endif
|
||||
|
||||
SDL_bool SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval)
|
||||
bool SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval)
|
||||
{
|
||||
#ifdef HAVE_MSC_ATOMICS
|
||||
SDL_COMPILE_TIME_ASSERT(atomic_cas, sizeof(long) == sizeof(a->value));
|
||||
@@ -152,7 +152,7 @@ SDL_bool SDL_CompareAndSwapAtomicInt(SDL_AtomicInt *a, int oldval, int newval)
|
||||
#endif
|
||||
}
|
||||
|
||||
SDL_bool SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval)
|
||||
bool SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 newval)
|
||||
{
|
||||
#ifdef HAVE_MSC_ATOMICS
|
||||
SDL_COMPILE_TIME_ASSERT(atomic_cas, sizeof(long) == sizeof(a->value));
|
||||
@@ -183,7 +183,7 @@ SDL_bool SDL_CompareAndSwapAtomicU32(SDL_AtomicU32 *a, Uint32 oldval, Uint32 new
|
||||
#endif
|
||||
}
|
||||
|
||||
SDL_bool SDL_CompareAndSwapAtomicPointer(void **a, void *oldval, void *newval)
|
||||
bool SDL_CompareAndSwapAtomicPointer(void **a, void *oldval, void *newval)
|
||||
{
|
||||
#ifdef HAVE_MSC_ATOMICS
|
||||
return _InterlockedCompareExchangePointer(a, newval, oldval) == oldval;
|
||||
|
||||
@@ -57,7 +57,7 @@ extern __inline int _SDL_xchg_watcom(volatile int *a, int v);
|
||||
/* *INDENT-ON* */ // clang-format on
|
||||
|
||||
// This function is where all the magic happens...
|
||||
SDL_bool SDL_TryLockSpinlock(SDL_SpinLock *lock)
|
||||
bool SDL_TryLockSpinlock(SDL_SpinLock *lock)
|
||||
{
|
||||
#if defined(HAVE_GCC_ATOMICS) || defined(HAVE_GCC_SYNC_LOCK_TEST_AND_SET)
|
||||
return __sync_lock_test_and_set(lock, 1) == 0;
|
||||
|
||||
+10
-10
@@ -1443,7 +1443,7 @@ const char *SDL_GetAudioDeviceName(SDL_AudioDeviceID devid)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames)
|
||||
bool SDL_GetAudioDeviceFormat(SDL_AudioDeviceID devid, SDL_AudioSpec *spec, int *sample_frames)
|
||||
{
|
||||
if (!spec) {
|
||||
return SDL_InvalidParamError("spec");
|
||||
@@ -1767,17 +1767,17 @@ static bool SetLogicalAudioDevicePauseState(SDL_AudioDeviceID devid, int value)
|
||||
return logdev ? true : false; // ObtainLogicalAudioDevice will have set an error.
|
||||
}
|
||||
|
||||
SDL_bool SDL_PauseAudioDevice(SDL_AudioDeviceID devid)
|
||||
bool SDL_PauseAudioDevice(SDL_AudioDeviceID devid)
|
||||
{
|
||||
return SetLogicalAudioDevicePauseState(devid, 1);
|
||||
}
|
||||
|
||||
SDL_bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID devid)
|
||||
bool SDLCALL SDL_ResumeAudioDevice(SDL_AudioDeviceID devid)
|
||||
{
|
||||
return SetLogicalAudioDevicePauseState(devid, 0);
|
||||
}
|
||||
|
||||
SDL_bool SDL_AudioDevicePaused(SDL_AudioDeviceID devid)
|
||||
bool SDL_AudioDevicePaused(SDL_AudioDeviceID devid)
|
||||
{
|
||||
SDL_AudioDevice *device = NULL;
|
||||
SDL_LogicalAudioDevice *logdev = ObtainLogicalAudioDevice(devid, &device);
|
||||
@@ -1798,7 +1798,7 @@ float SDL_GetAudioDeviceGain(SDL_AudioDeviceID devid)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain)
|
||||
bool SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain)
|
||||
{
|
||||
if (gain < 0.0f) {
|
||||
return SDL_InvalidParamError("gain");
|
||||
@@ -1827,7 +1827,7 @@ SDL_bool SDL_SetAudioDeviceGain(SDL_AudioDeviceID devid, float gain)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata)
|
||||
bool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCallback callback, void *userdata)
|
||||
{
|
||||
SDL_AudioDevice *device = NULL;
|
||||
SDL_LogicalAudioDevice *logdev = ObtainLogicalAudioDevice(devid, &device);
|
||||
@@ -1862,7 +1862,7 @@ SDL_bool SDL_SetAudioPostmixCallback(SDL_AudioDeviceID devid, SDL_AudioPostmixCa
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams)
|
||||
bool SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams, int num_streams)
|
||||
{
|
||||
const bool islogical = !(devid & (1<<1));
|
||||
SDL_AudioDevice *device = NULL;
|
||||
@@ -1955,7 +1955,7 @@ SDL_bool SDL_BindAudioStreams(SDL_AudioDeviceID devid, SDL_AudioStream **streams
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream)
|
||||
bool SDL_BindAudioStream(SDL_AudioDeviceID devid, SDL_AudioStream *stream)
|
||||
{
|
||||
return SDL_BindAudioStreams(devid, &stream, 1);
|
||||
}
|
||||
@@ -2120,7 +2120,7 @@ SDL_AudioStream *SDL_OpenAudioDeviceStream(SDL_AudioDeviceID devid, const SDL_Au
|
||||
return stream;
|
||||
}
|
||||
|
||||
SDL_bool SDL_PauseAudioStreamDevice(SDL_AudioStream *stream)
|
||||
bool SDL_PauseAudioStreamDevice(SDL_AudioStream *stream)
|
||||
{
|
||||
SDL_AudioDeviceID devid = SDL_GetAudioStreamDevice(stream);
|
||||
if (!devid) {
|
||||
@@ -2130,7 +2130,7 @@ SDL_bool SDL_PauseAudioStreamDevice(SDL_AudioStream *stream)
|
||||
return SDL_PauseAudioDevice(devid);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream)
|
||||
bool SDL_ResumeAudioStreamDevice(SDL_AudioStream *stream)
|
||||
{
|
||||
SDL_AudioDeviceID devid = SDL_GetAudioStreamDevice(stream);
|
||||
if (!devid) {
|
||||
|
||||
+14
-14
@@ -448,7 +448,7 @@ SDL_PropertiesID SDL_GetAudioStreamProperties(SDL_AudioStream *stream)
|
||||
return stream->props;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata)
|
||||
bool SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata)
|
||||
{
|
||||
if (!stream) {
|
||||
return SDL_InvalidParamError("stream");
|
||||
@@ -460,7 +460,7 @@ SDL_bool SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamC
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata)
|
||||
bool SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata)
|
||||
{
|
||||
if (!stream) {
|
||||
return SDL_InvalidParamError("stream");
|
||||
@@ -472,7 +472,7 @@ SDL_bool SDL_SetAudioStreamPutCallback(SDL_AudioStream *stream, SDL_AudioStreamC
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_LockAudioStream(SDL_AudioStream *stream)
|
||||
bool SDL_LockAudioStream(SDL_AudioStream *stream)
|
||||
{
|
||||
if (!stream) {
|
||||
return SDL_InvalidParamError("stream");
|
||||
@@ -481,7 +481,7 @@ SDL_bool SDL_LockAudioStream(SDL_AudioStream *stream)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_UnlockAudioStream(SDL_AudioStream *stream)
|
||||
bool SDL_UnlockAudioStream(SDL_AudioStream *stream)
|
||||
{
|
||||
if (!stream) {
|
||||
return SDL_InvalidParamError("stream");
|
||||
@@ -490,7 +490,7 @@ SDL_bool SDL_UnlockAudioStream(SDL_AudioStream *stream)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_spec, SDL_AudioSpec *dst_spec)
|
||||
bool SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_spec, SDL_AudioSpec *dst_spec)
|
||||
{
|
||||
if (!stream) {
|
||||
return SDL_InvalidParamError("stream");
|
||||
@@ -514,7 +514,7 @@ SDL_bool SDL_GetAudioStreamFormat(SDL_AudioStream *stream, SDL_AudioSpec *src_sp
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec)
|
||||
bool SDL_SetAudioStreamFormat(SDL_AudioStream *stream, const SDL_AudioSpec *src_spec, const SDL_AudioSpec *dst_spec)
|
||||
{
|
||||
if (!stream) {
|
||||
return SDL_InvalidParamError("stream");
|
||||
@@ -626,12 +626,12 @@ bool SetAudioStreamChannelMap(SDL_AudioStream *stream, const SDL_AudioSpec *spec
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int channels)
|
||||
bool SDL_SetAudioStreamInputChannelMap(SDL_AudioStream *stream, const int *chmap, int channels)
|
||||
{
|
||||
return SetAudioStreamChannelMap(stream, &stream->src_spec, &stream->src_chmap, chmap, channels, true);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int channels)
|
||||
bool SDL_SetAudioStreamOutputChannelMap(SDL_AudioStream *stream, const int *chmap, int channels)
|
||||
{
|
||||
return SetAudioStreamChannelMap(stream, &stream->dst_spec, &stream->dst_chmap, chmap, channels, false);
|
||||
}
|
||||
@@ -686,7 +686,7 @@ float SDL_GetAudioStreamFrequencyRatio(SDL_AudioStream *stream)
|
||||
return freq_ratio;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float freq_ratio)
|
||||
bool SDL_SetAudioStreamFrequencyRatio(SDL_AudioStream *stream, float freq_ratio)
|
||||
{
|
||||
if (!stream) {
|
||||
return SDL_InvalidParamError("stream");
|
||||
@@ -723,7 +723,7 @@ float SDL_GetAudioStreamGain(SDL_AudioStream *stream)
|
||||
return gain;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain)
|
||||
bool SDL_SetAudioStreamGain(SDL_AudioStream *stream, float gain)
|
||||
{
|
||||
if (!stream) {
|
||||
return SDL_InvalidParamError("stream");
|
||||
@@ -805,7 +805,7 @@ static void SDLCALL FreeAllocatedAudioBuffer(void *userdata, const void *buf, in
|
||||
SDL_free((void*) buf);
|
||||
}
|
||||
|
||||
SDL_bool SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len)
|
||||
bool SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int len)
|
||||
{
|
||||
if (!stream) {
|
||||
return SDL_InvalidParamError("stream");
|
||||
@@ -841,7 +841,7 @@ SDL_bool SDL_PutAudioStreamData(SDL_AudioStream *stream, const void *buf, int le
|
||||
return PutAudioStreamBuffer(stream, buf, len, NULL, NULL);
|
||||
}
|
||||
|
||||
SDL_bool SDL_FlushAudioStream(SDL_AudioStream *stream)
|
||||
bool SDL_FlushAudioStream(SDL_AudioStream *stream)
|
||||
{
|
||||
if (!stream) {
|
||||
return SDL_InvalidParamError("stream");
|
||||
@@ -1254,7 +1254,7 @@ int SDL_GetAudioStreamQueued(SDL_AudioStream *stream)
|
||||
return (int) SDL_min(total, SDL_INT_MAX);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ClearAudioStream(SDL_AudioStream *stream)
|
||||
bool SDL_ClearAudioStream(SDL_AudioStream *stream)
|
||||
{
|
||||
if (!stream) {
|
||||
return SDL_InvalidParamError("stream");
|
||||
@@ -1303,7 +1303,7 @@ static void SDLCALL DontFreeThisAudioBuffer(void *userdata, const void *buf, int
|
||||
// We don't own the buffer, but know it will outlive the stream
|
||||
}
|
||||
|
||||
SDL_bool SDL_ConvertAudioSamples(const SDL_AudioSpec *src_spec, const Uint8 *src_data, int src_len, const SDL_AudioSpec *dst_spec, Uint8 **dst_data, int *dst_len)
|
||||
bool SDL_ConvertAudioSamples(const SDL_AudioSpec *src_spec, const Uint8 *src_data, int src_len, const SDL_AudioSpec *dst_spec, Uint8 **dst_data, int *dst_len)
|
||||
{
|
||||
if (dst_data) {
|
||||
*dst_data = NULL;
|
||||
|
||||
@@ -86,7 +86,7 @@ static const Uint8 mix8[] = {
|
||||
// !!! FIXME: Add fast-path for volume = 1
|
||||
// !!! FIXME: Use larger scales for 16-bit/32-bit integers
|
||||
|
||||
SDL_bool SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, Uint32 len, float fvolume)
|
||||
bool SDL_MixAudio(Uint8 *dst, const Uint8 *src, SDL_AudioFormat format, Uint32 len, float fvolume)
|
||||
{
|
||||
int volume = (int)SDL_roundf(fvolume * MIX_MAXVOLUME);
|
||||
|
||||
|
||||
@@ -2076,7 +2076,7 @@ static bool WaveLoad(SDL_IOStream *src, WaveFile *file, SDL_AudioSpec *spec, Uin
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_LoadWAV_IO(SDL_IOStream *src, SDL_bool closeio, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
|
||||
bool SDL_LoadWAV_IO(SDL_IOStream *src, bool closeio, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
|
||||
{
|
||||
bool result = false;
|
||||
WaveFile file;
|
||||
@@ -2130,7 +2130,7 @@ done:
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_LoadWAV(const char *path, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
|
||||
bool SDL_LoadWAV(const char *path, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
|
||||
{
|
||||
return SDL_LoadWAV_IO(SDL_IOFromFile(path, "rb"), 1, spec, audio_buf, audio_len);
|
||||
}
|
||||
|
||||
@@ -386,7 +386,7 @@ static bool BuildAAudioStream(SDL_AudioDevice *device)
|
||||
}
|
||||
|
||||
// !!! FIXME: make this non-blocking!
|
||||
static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted)
|
||||
static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, bool granted)
|
||||
{
|
||||
SDL_SetAtomicInt((SDL_AtomicInt *) userdata, granted ? 1 : -1);
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ static void OPENSLES_DestroyPCMRecorder(SDL_AudioDevice *device)
|
||||
}
|
||||
|
||||
// !!! FIXME: make this non-blocking!
|
||||
static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted)
|
||||
static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, bool granted)
|
||||
{
|
||||
SDL_SetAtomicInt((SDL_AtomicInt *) userdata, granted ? 1 : -1);
|
||||
}
|
||||
|
||||
@@ -650,7 +650,7 @@ void SDL_CloseCamera(SDL_Camera *camera)
|
||||
ClosePhysicalCamera(device);
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec)
|
||||
bool SDL_GetCameraFormat(SDL_Camera *camera, SDL_CameraSpec *spec)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -1407,7 +1407,7 @@ static void NukeCameraHashItem(const void *key, const void *value, void *data)
|
||||
// no-op, keys and values in this hashtable are treated as Plain Old Data and don't get freed here.
|
||||
}
|
||||
|
||||
SDL_bool SDL_CameraInit(const char *driver_name)
|
||||
bool SDL_CameraInit(const char *driver_name)
|
||||
{
|
||||
if (SDL_GetCurrentCameraDriver()) {
|
||||
SDL_QuitCamera(); // shutdown driver if already running.
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#define SDL_camera_c_h_
|
||||
|
||||
// Initialize the camera subsystem
|
||||
extern SDL_bool SDL_CameraInit(const char *driver_name);
|
||||
extern bool SDL_CameraInit(const char *driver_name);
|
||||
|
||||
// Shutdown the camera subsystem
|
||||
extern void SDL_QuitCamera(void);
|
||||
|
||||
@@ -516,7 +516,7 @@ static bool PrepareCamera(SDL_Camera *device)
|
||||
return true;
|
||||
}
|
||||
|
||||
static void SDLCALL CameraPermissionCallback(void *userdata, const char *permission, SDL_bool granted)
|
||||
static void SDLCALL CameraPermissionCallback(void *userdata, const char *permission, bool granted)
|
||||
{
|
||||
SDL_Camera *device = (SDL_Camera *) userdata;
|
||||
if (device->hidden != NULL) { // if device was already closed, don't send an event.
|
||||
|
||||
@@ -31,16 +31,16 @@ void SDL_SetX11EventHook(SDL_X11EventHook callback, void *userdata)
|
||||
|
||||
#ifndef SDL_PLATFORM_LINUX
|
||||
|
||||
SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority);
|
||||
SDL_bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority)
|
||||
SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriority(Sint64 threadID, int priority);
|
||||
bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority)
|
||||
{
|
||||
(void)threadID;
|
||||
(void)priority;
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
SDL_DECLSPEC SDL_bool SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
|
||||
SDL_bool SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy)
|
||||
SDL_DECLSPEC bool SDLCALL SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy);
|
||||
bool SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy)
|
||||
{
|
||||
(void)threadID;
|
||||
(void)sdlPriority;
|
||||
@@ -58,8 +58,8 @@ void SDL_GDKSuspendComplete(void)
|
||||
SDL_Unsupported();
|
||||
}
|
||||
|
||||
SDL_DECLSPEC SDL_bool SDLCALL SDL_GetGDKDefaultUser(void *outUserHandle); /* XUserHandle *outUserHandle */
|
||||
SDL_bool SDL_GetGDKDefaultUser(void *outUserHandle)
|
||||
SDL_DECLSPEC bool SDLCALL SDL_GetGDKDefaultUser(void *outUserHandle); /* XUserHandle *outUserHandle */
|
||||
bool SDL_GetGDKDefaultUser(void *outUserHandle)
|
||||
{
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
@@ -78,8 +78,8 @@ void SDL_GDKResumeGPU(SDL_GPUDevice *device)
|
||||
|
||||
#if !defined(SDL_PLATFORM_WINDOWS)
|
||||
|
||||
SDL_DECLSPEC SDL_bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
|
||||
SDL_bool SDL_RegisterApp(const char *name, Uint32 style, void *hInst)
|
||||
SDL_DECLSPEC bool SDLCALL SDL_RegisterApp(const char *name, Uint32 style, void *hInst);
|
||||
bool SDL_RegisterApp(const char *name, Uint32 style, void *hInst)
|
||||
{
|
||||
(void)name;
|
||||
(void)style;
|
||||
@@ -154,8 +154,8 @@ void *SDL_GetAndroidJNIEnv(void)
|
||||
}
|
||||
|
||||
typedef void (SDLCALL *SDL_RequestAndroidPermissionCallback)(void *userdata, const char *permission, bool granted);
|
||||
SDL_DECLSPEC SDL_bool SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata);
|
||||
SDL_bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata)
|
||||
SDL_DECLSPEC bool SDLCALL SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata);
|
||||
bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata)
|
||||
{
|
||||
(void)permission;
|
||||
(void)cb;
|
||||
@@ -163,16 +163,16 @@ SDL_bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroid
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
SDL_DECLSPEC SDL_bool SDLCALL SDL_SendAndroidMessage(Uint32 command, int param);
|
||||
SDL_bool SDL_SendAndroidMessage(Uint32 command, int param)
|
||||
SDL_DECLSPEC bool SDLCALL SDL_SendAndroidMessage(Uint32 command, int param);
|
||||
bool SDL_SendAndroidMessage(Uint32 command, int param)
|
||||
{
|
||||
(void)command;
|
||||
(void)param;
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
SDL_DECLSPEC SDL_bool SDLCALL SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
|
||||
SDL_bool SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset)
|
||||
SDL_DECLSPEC bool SDLCALL SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset);
|
||||
bool SDL_ShowAndroidToast(const char* message, int duration, int gravity, int xoffset, int yoffset)
|
||||
{
|
||||
(void)message;
|
||||
(void)duration;
|
||||
@@ -188,22 +188,22 @@ int SDL_GetAndroidSDKVersion(void)
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
SDL_DECLSPEC SDL_bool SDLCALL SDL_IsAndroidTV(void);
|
||||
SDL_bool SDL_IsAndroidTV(void)
|
||||
SDL_DECLSPEC bool SDLCALL SDL_IsAndroidTV(void);
|
||||
bool SDL_IsAndroidTV(void)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_DECLSPEC SDL_bool SDLCALL SDL_IsChromebook(void);
|
||||
SDL_bool SDL_IsChromebook(void)
|
||||
SDL_DECLSPEC bool SDLCALL SDL_IsChromebook(void);
|
||||
bool SDL_IsChromebook(void)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_DECLSPEC SDL_bool SDLCALL SDL_IsDeXMode(void);
|
||||
SDL_bool SDL_IsDeXMode(void)
|
||||
SDL_DECLSPEC bool SDLCALL SDL_IsDeXMode(void);
|
||||
bool SDL_IsDeXMode(void)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
return false;
|
||||
|
||||
@@ -1829,7 +1829,7 @@ Sint64 Android_JNI_FileSeek(void *userdata, Sint64 offset, SDL_IOWhence whence)
|
||||
return (Sint64) AAsset_seek64((AAsset *)userdata, offset, (int)whence);
|
||||
}
|
||||
|
||||
SDL_bool Android_JNI_FileClose(void *userdata)
|
||||
bool Android_JNI_FileClose(void *userdata)
|
||||
{
|
||||
AAsset_close((AAsset *)userdata);
|
||||
return true;
|
||||
@@ -2029,7 +2029,7 @@ void Android_JNI_HapticStop(int device_id)
|
||||
// See SDLActivity.java for constants.
|
||||
#define COMMAND_SET_KEEP_SCREEN_ON 5
|
||||
|
||||
SDL_bool SDL_SendAndroidMessage(Uint32 command, int param)
|
||||
bool SDL_SendAndroidMessage(Uint32 command, int param)
|
||||
{
|
||||
if (command < 0x8000) {
|
||||
return SDL_InvalidParamError("command");
|
||||
@@ -2211,19 +2211,19 @@ bool SDL_IsAndroidTablet(void)
|
||||
return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsTablet);
|
||||
}
|
||||
|
||||
SDL_bool SDL_IsAndroidTV(void)
|
||||
bool SDL_IsAndroidTV(void)
|
||||
{
|
||||
JNIEnv *env = Android_JNI_GetEnv();
|
||||
return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsAndroidTV);
|
||||
}
|
||||
|
||||
SDL_bool SDL_IsChromebook(void)
|
||||
bool SDL_IsChromebook(void)
|
||||
{
|
||||
JNIEnv *env = Android_JNI_GetEnv();
|
||||
return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsChromebook);
|
||||
}
|
||||
|
||||
SDL_bool SDL_IsDeXMode(void)
|
||||
bool SDL_IsDeXMode(void)
|
||||
{
|
||||
JNIEnv *env = Android_JNI_GetEnv();
|
||||
return (*env)->CallStaticBooleanMethod(env, mActivityClass, midIsDeXMode);
|
||||
@@ -2420,7 +2420,7 @@ const char *SDL_GetAndroidCachePath(void)
|
||||
return s_AndroidCachePath;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xOffset, int yOffset)
|
||||
bool SDL_ShowAndroidToast(const char *message, int duration, int gravity, int xOffset, int yOffset)
|
||||
{
|
||||
return Android_JNI_ShowToast(message, duration, gravity, xOffset, yOffset);
|
||||
}
|
||||
@@ -2519,7 +2519,7 @@ JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(nativePermissionResult)(
|
||||
SDL_UnlockMutex(Android_ActivityMutex);
|
||||
}
|
||||
|
||||
SDL_bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata)
|
||||
bool SDL_RequestAndroidPermission(const char *permission, SDL_RequestAndroidPermissionCallback cb, void *userdata)
|
||||
{
|
||||
if (!permission) {
|
||||
return SDL_InvalidParamError("permission");
|
||||
|
||||
@@ -85,7 +85,7 @@ Sint64 Android_JNI_FileSize(void *userdata);
|
||||
Sint64 Android_JNI_FileSeek(void *userdata, Sint64 offset, SDL_IOWhence whence);
|
||||
size_t Android_JNI_FileRead(void *userdata, void *buffer, size_t size, SDL_IOStatus *status);
|
||||
size_t Android_JNI_FileWrite(void *userdata, const void *buffer, size_t size, SDL_IOStatus *status);
|
||||
SDL_bool Android_JNI_FileClose(void *userdata);
|
||||
bool Android_JNI_FileClose(void *userdata);
|
||||
|
||||
// Environment support
|
||||
void Android_JNI_GetManifestEnvironmentVariables(void);
|
||||
|
||||
@@ -35,7 +35,7 @@ PAPPCONSTRAIN_REGISTRATION hCPLM = {};
|
||||
HANDLE plmSuspendComplete = nullptr;
|
||||
|
||||
extern "C"
|
||||
SDL_bool SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue)
|
||||
bool SDL_GetGDKTaskQueue(XTaskQueueHandle *outTaskQueue)
|
||||
{
|
||||
// If this is the first call, first create the global task queue.
|
||||
if (!GDK_GlobalTaskQueue) {
|
||||
@@ -139,7 +139,7 @@ void SDL_GDKSuspendComplete()
|
||||
}
|
||||
|
||||
extern "C"
|
||||
SDL_bool SDL_GetGDKDefaultUser(XUserHandle *outUserHandle)
|
||||
bool SDL_GetGDKDefaultUser(XUserHandle *outUserHandle)
|
||||
{
|
||||
XAsyncBlock block = { 0 };
|
||||
HRESULT result;
|
||||
|
||||
@@ -164,7 +164,7 @@ static void SDL_EVDEV_UpdateKeyboardMute(void)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_EVDEV_Init(void)
|
||||
bool SDL_EVDEV_Init(void)
|
||||
{
|
||||
if (!_this) {
|
||||
_this = (SDL_EVDEV_PrivateData *)SDL_calloc(1, sizeof(*_this));
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
struct input_event;
|
||||
|
||||
extern SDL_bool SDL_EVDEV_Init(void);
|
||||
extern bool SDL_EVDEV_Init(void);
|
||||
extern void SDL_EVDEV_Quit(void);
|
||||
extern void SDL_EVDEV_SetVTSwitchCallbacks(void (*release_callback)(void*), void *release_callback_data,
|
||||
void (*acquire_callback)(void*), void *acquire_callback_data);
|
||||
|
||||
@@ -249,7 +249,7 @@ static bool rtkit_setpriority_realtime(pid_t thread, int rt_priority)
|
||||
#endif // threads
|
||||
|
||||
// this is a public symbol, so it has to exist even if threads are disabled.
|
||||
SDL_bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority)
|
||||
bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority)
|
||||
{
|
||||
#ifdef SDL_THREADS_DISABLED
|
||||
return SDL_Unsupported();
|
||||
@@ -281,7 +281,7 @@ SDL_bool SDL_SetLinuxThreadPriority(Sint64 threadID, int priority)
|
||||
}
|
||||
|
||||
// this is a public symbol, so it has to exist even if threads are disabled.
|
||||
SDL_bool SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy)
|
||||
bool SDL_SetLinuxThreadPriorityAndPolicy(Sint64 threadID, int sdlPriority, int schedPolicy)
|
||||
{
|
||||
#ifdef SDL_THREADS_DISABLED
|
||||
return SDL_Unsupported();
|
||||
|
||||
+14
-14
@@ -1035,72 +1035,72 @@ void SDL_QuitCPUInfo(void) {
|
||||
|
||||
#define CPU_FEATURE_AVAILABLE(f) ((SDL_GetCPUFeatures() & (f)) ? true : false)
|
||||
|
||||
SDL_bool SDL_HasAltiVec(void)
|
||||
bool SDL_HasAltiVec(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_ALTIVEC);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasMMX(void)
|
||||
bool SDL_HasMMX(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_MMX);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasSSE(void)
|
||||
bool SDL_HasSSE(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasSSE2(void)
|
||||
bool SDL_HasSSE2(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE2);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasSSE3(void)
|
||||
bool SDL_HasSSE3(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE3);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasSSE41(void)
|
||||
bool SDL_HasSSE41(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE41);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasSSE42(void)
|
||||
bool SDL_HasSSE42(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE42);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasAVX(void)
|
||||
bool SDL_HasAVX(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasAVX2(void)
|
||||
bool SDL_HasAVX2(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX2);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasAVX512F(void)
|
||||
bool SDL_HasAVX512F(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX512F);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasARMSIMD(void)
|
||||
bool SDL_HasARMSIMD(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_ARM_SIMD);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasNEON(void)
|
||||
bool SDL_HasNEON(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_NEON);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasLSX(void)
|
||||
bool SDL_HasLSX(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_LSX);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasLASX(void)
|
||||
bool SDL_HasLASX(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_LASX);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "SDL_internal.h"
|
||||
#include "../../core/android/SDL_android.h"
|
||||
|
||||
void SDLCALL SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, SDL_bool allow_many)
|
||||
void SDLCALL SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, bool allow_many)
|
||||
{
|
||||
if (!Android_JNI_OpenFileDialog(callback, userdata, filters, nfilters, false, allow_many)) {
|
||||
// SDL_SetError is already called when it fails
|
||||
@@ -38,7 +38,7 @@ void SDLCALL SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void *userd
|
||||
}
|
||||
}
|
||||
|
||||
void SDLCALL SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char *default_location, SDL_bool allow_many)
|
||||
void SDLCALL SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char *default_location, bool allow_many)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
callback(userdata, NULL, -1);
|
||||
|
||||
@@ -178,7 +178,7 @@ void show_file_dialog(cocoa_FileDialogType type, SDL_DialogFileCallback callback
|
||||
#endif // defined(SDL_PLATFORM_TVOS) || defined(SDL_PLATFORM_IOS)
|
||||
}
|
||||
|
||||
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, SDL_bool allow_many)
|
||||
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, bool allow_many)
|
||||
{
|
||||
show_file_dialog(FDT_OPEN, callback, userdata, window, filters, nfilters, default_location, allow_many);
|
||||
}
|
||||
@@ -188,7 +188,7 @@ void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL
|
||||
show_file_dialog(FDT_SAVE, callback, userdata, window, filters, nfilters, default_location, 0);
|
||||
}
|
||||
|
||||
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, SDL_bool allow_many)
|
||||
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, bool allow_many)
|
||||
{
|
||||
show_file_dialog(FDT_OPENFOLDER, callback, userdata, window, NULL, 0, default_location, allow_many);
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
#include "SDL_internal.h"
|
||||
|
||||
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, SDL_bool allow_many)
|
||||
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, bool allow_many)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
callback(userdata, NULL, -1);
|
||||
@@ -32,7 +32,7 @@ void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL
|
||||
callback(userdata, NULL, -1);
|
||||
}
|
||||
|
||||
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, SDL_bool allow_many)
|
||||
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, bool allow_many)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
callback(userdata, NULL, -1);
|
||||
|
||||
@@ -243,7 +243,7 @@ void ShowDialog(bool save, SDL_DialogFileCallback callback, void *userdata, bool
|
||||
panel->Show();
|
||||
}
|
||||
|
||||
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, SDL_bool allow_many)
|
||||
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const SDL_DialogFileFilter *filters, int nfilters, const char *default_location, bool allow_many)
|
||||
{
|
||||
ShowDialog(false, callback, userdata, allow_many == true, !!window, filters, nfilters, false, default_location);
|
||||
}
|
||||
@@ -253,7 +253,7 @@ void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void *userdata, SDL
|
||||
ShowDialog(true, callback, userdata, false, !!window, filters, nfilters, false, default_location);
|
||||
}
|
||||
|
||||
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char* default_location, SDL_bool allow_many)
|
||||
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void *userdata, SDL_Window *window, const char* default_location, bool allow_many)
|
||||
{
|
||||
ShowDialog(false, callback, userdata, allow_many == true, !!window, NULL, 0, true, default_location);
|
||||
}
|
||||
@@ -73,7 +73,7 @@ static int detect_available_methods(const char *value)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, SDL_bool allow_many)
|
||||
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, bool allow_many)
|
||||
{
|
||||
// Call detect_available_methods() again each time in case the situation changed
|
||||
if (!detected_open && !detect_available_methods(NULL)) {
|
||||
@@ -97,7 +97,7 @@ void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL
|
||||
detected_save(callback, userdata, window, filters, nfilters, default_location);
|
||||
}
|
||||
|
||||
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, SDL_bool allow_many)
|
||||
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, bool allow_many)
|
||||
{
|
||||
// Call detect_available_methods() again each time in case the situation changed
|
||||
if (!detected_folder && !detect_available_methods(NULL)) {
|
||||
|
||||
@@ -213,12 +213,12 @@ static void run_zenity(zenityArgs* arg_struct)
|
||||
|
||||
/* Recent versions of Zenity have different exit codes, but picks up
|
||||
different codes from the environment */
|
||||
SDL_SetEnvironmentVariable(env, "ZENITY_OK", "0", SDL_TRUE);
|
||||
SDL_SetEnvironmentVariable(env, "ZENITY_CANCEL", "1", SDL_TRUE);
|
||||
SDL_SetEnvironmentVariable(env, "ZENITY_ESC", "1", SDL_TRUE);
|
||||
SDL_SetEnvironmentVariable(env, "ZENITY_EXTRA", "2", SDL_TRUE);
|
||||
SDL_SetEnvironmentVariable(env, "ZENITY_ERROR", "2", SDL_TRUE);
|
||||
SDL_SetEnvironmentVariable(env, "ZENITY_TIMEOUT", "2", SDL_TRUE);
|
||||
SDL_SetEnvironmentVariable(env, "ZENITY_OK", "0", true);
|
||||
SDL_SetEnvironmentVariable(env, "ZENITY_CANCEL", "1", true);
|
||||
SDL_SetEnvironmentVariable(env, "ZENITY_ESC", "1", true);
|
||||
SDL_SetEnvironmentVariable(env, "ZENITY_EXTRA", "2", true);
|
||||
SDL_SetEnvironmentVariable(env, "ZENITY_ERROR", "2", true);
|
||||
SDL_SetEnvironmentVariable(env, "ZENITY_TIMEOUT", "2", true);
|
||||
|
||||
SDL_PropertiesID props = SDL_CreateProperties();
|
||||
SDL_SetPointerProperty(props, SDL_PROP_PROCESS_CREATE_ARGS_POINTER, args);
|
||||
|
||||
@@ -426,7 +426,7 @@ int windows_folder_dialog_thread(void* ptr)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, SDL_bool allow_many)
|
||||
void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const SDL_DialogFileFilter *filters, int nfilters, const char* default_location, bool allow_many)
|
||||
{
|
||||
winArgs *args;
|
||||
SDL_Thread *thread;
|
||||
@@ -449,7 +449,7 @@ void SDL_ShowOpenFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL
|
||||
args->nfilters = nfilters;
|
||||
args->default_file = default_location;
|
||||
args->parent = window;
|
||||
args->flags = (allow_many != SDL_FALSE) ? OFN_ALLOWMULTISELECT : 0;
|
||||
args->flags = (allow_many != false) ? OFN_ALLOWMULTISELECT : 0;
|
||||
args->callback = callback;
|
||||
args->userdata = userdata;
|
||||
|
||||
@@ -501,7 +501,7 @@ void SDL_ShowSaveFileDialog(SDL_DialogFileCallback callback, void* userdata, SDL
|
||||
SDL_DetachThread(thread);
|
||||
}
|
||||
|
||||
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, SDL_bool allow_many)
|
||||
void SDL_ShowOpenFolderDialog(SDL_DialogFileCallback callback, void* userdata, SDL_Window* window, const char* default_location, bool allow_many)
|
||||
{
|
||||
winFArgs *args;
|
||||
SDL_Thread *thread;
|
||||
|
||||
@@ -76,7 +76,7 @@ static void SDL_InitDynamicAPI(void);
|
||||
}
|
||||
|
||||
#define SDL_DYNAPI_VARARGS(_static, name, initcall) \
|
||||
_static SDL_bool SDLCALL SDL_SetError##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) \
|
||||
_static bool SDLCALL SDL_SetError##name(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) \
|
||||
{ \
|
||||
char buf[128], *str = buf; \
|
||||
int result; \
|
||||
@@ -100,7 +100,7 @@ static void SDL_InitDynamicAPI(void);
|
||||
if (str != buf) { \
|
||||
jump_table.SDL_free(str); \
|
||||
} \
|
||||
return SDL_FALSE; \
|
||||
return false; \
|
||||
} \
|
||||
_static int SDLCALL SDL_sscanf##name(const char *buf, SDL_SCANF_FORMAT_STRING const char *fmt, ...) \
|
||||
{ \
|
||||
@@ -233,7 +233,7 @@ SDL_DYNAPI_VARARGS(, , )
|
||||
|
||||
#define ENABLE_SDL_CALL_LOGGING 0
|
||||
#if ENABLE_SDL_CALL_LOGGING
|
||||
static SDL_bool SDLCALL SDL_SetError_LOGSDLCALLS(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
|
||||
static bool SDLCALL SDL_SetError_LOGSDLCALLS(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
|
||||
{
|
||||
char buf[512]; // !!! FIXME: dynamic allocation
|
||||
va_list ap;
|
||||
@@ -354,7 +354,7 @@ static Sint32 initialize_jumptable(Uint32 apiver, void *table, Uint32 tablesize)
|
||||
#if ENABLE_SDL_CALL_LOGGING
|
||||
{
|
||||
const char *env = SDL_getenv_unsafe_REAL("SDL_DYNAPI_LOG_CALLS");
|
||||
const SDL_bool log_calls = (env && SDL_atoi_REAL(env));
|
||||
const bool log_calls = (env && SDL_atoi_REAL(env));
|
||||
if (log_calls) {
|
||||
#define SDL_DYNAPI_PROC(rc, fn, params, args, ret) jump_table.fn = fn##_LOGSDLCALLS;
|
||||
#include "SDL_dynapi_procs.h"
|
||||
@@ -465,13 +465,13 @@ static void SDL_InitDynamicAPILocked(void)
|
||||
{
|
||||
const char *libname = SDL_getenv_unsafe_REAL(SDL_DYNAMIC_API_ENVVAR);
|
||||
SDL_DYNAPI_ENTRYFN entry = NULL; // funcs from here by default.
|
||||
SDL_bool use_internal = SDL_TRUE;
|
||||
bool use_internal = true;
|
||||
|
||||
if (libname) {
|
||||
while (*libname && !entry) {
|
||||
// This is evil, but we're not making any permanent changes...
|
||||
char *ptr = (char *)libname;
|
||||
while (SDL_TRUE) {
|
||||
while (true) {
|
||||
char ch = *ptr;
|
||||
if ((ch == ',') || (ch == '\0')) {
|
||||
*ptr = '\0';
|
||||
@@ -495,7 +495,7 @@ static void SDL_InitDynamicAPILocked(void)
|
||||
dynapi_warn("Couldn't override SDL library. Using a newer SDL build might help. Please fix or remove the " SDL_DYNAMIC_API_ENVVAR " environment variable. Using the default SDL.");
|
||||
// Just fill in the function pointers from this library, later.
|
||||
} else {
|
||||
use_internal = SDL_FALSE; // We overrode SDL! Don't use the internal version!
|
||||
use_internal = false; // We overrode SDL! Don't use the internal version!
|
||||
}
|
||||
}
|
||||
|
||||
@@ -524,14 +524,14 @@ static void SDL_InitDynamicAPI(void)
|
||||
* SDL_CreateThread() would also call this function before building the
|
||||
* new thread).
|
||||
*/
|
||||
static SDL_bool already_initialized = SDL_FALSE;
|
||||
static bool already_initialized = false;
|
||||
|
||||
static SDL_SpinLock lock = 0;
|
||||
SDL_LockSpinlock_REAL(&lock);
|
||||
|
||||
if (!already_initialized) {
|
||||
SDL_InitDynamicAPILocked();
|
||||
already_initialized = SDL_TRUE;
|
||||
already_initialized = true;
|
||||
}
|
||||
|
||||
SDL_UnlockSpinlock_REAL(&lock);
|
||||
|
||||
+454
-454
File diff suppressed because it is too large.
Load diff
+12
-12
@@ -1103,12 +1103,12 @@ int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_EventAction action,
|
||||
return SDL_PeepEventsInternal(events, numevents, action, minType, maxType, false);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasEvent(Uint32 type)
|
||||
bool SDL_HasEvent(Uint32 type)
|
||||
{
|
||||
return SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, type, type) > 0;
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasEvents(Uint32 minType, Uint32 maxType)
|
||||
bool SDL_HasEvents(Uint32 minType, Uint32 maxType)
|
||||
{
|
||||
return SDL_PeepEvents(NULL, 0, SDL_PEEKEVENT, minType, maxType) > 0;
|
||||
}
|
||||
@@ -1215,7 +1215,7 @@ void SDL_PumpEvents(void)
|
||||
|
||||
// Public functions
|
||||
|
||||
SDL_bool SDL_PollEvent(SDL_Event *event)
|
||||
bool SDL_PollEvent(SDL_Event *event)
|
||||
{
|
||||
return SDL_WaitEventTimeoutNS(event, 0);
|
||||
}
|
||||
@@ -1330,12 +1330,12 @@ static SDL_Window *SDL_find_active_window(SDL_VideoDevice *_this)
|
||||
|
||||
#endif // !SDL_PLATFORM_ANDROID
|
||||
|
||||
SDL_bool SDL_WaitEvent(SDL_Event *event)
|
||||
bool SDL_WaitEvent(SDL_Event *event)
|
||||
{
|
||||
return SDL_WaitEventTimeoutNS(event, -1);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS)
|
||||
bool SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS)
|
||||
{
|
||||
Sint64 timeoutNS;
|
||||
|
||||
@@ -1347,7 +1347,7 @@ SDL_bool SDL_WaitEventTimeout(SDL_Event *event, Sint32 timeoutMS)
|
||||
return SDL_WaitEventTimeoutNS(event, timeoutNS);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS)
|
||||
bool SDL_WaitEventTimeoutNS(SDL_Event *event, Sint64 timeoutNS)
|
||||
{
|
||||
Uint64 start, expiration;
|
||||
bool include_sentinel = (timeoutNS == 0);
|
||||
@@ -1500,7 +1500,7 @@ static bool SDL_CallEventWatchers(SDL_Event *event)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_PushEvent(SDL_Event *event)
|
||||
bool SDL_PushEvent(SDL_Event *event)
|
||||
{
|
||||
if (!event->common.timestamp) {
|
||||
event->common.timestamp = SDL_GetTicksNS();
|
||||
@@ -1543,7 +1543,7 @@ void SDL_SetEventFilter(SDL_EventFilter filter, void *userdata)
|
||||
SDL_UnlockMutex(SDL_event_watchers_lock);
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata)
|
||||
bool SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata)
|
||||
{
|
||||
SDL_EventWatcher event_ok;
|
||||
|
||||
@@ -1562,7 +1562,7 @@ SDL_bool SDL_GetEventFilter(SDL_EventFilter *filter, void **userdata)
|
||||
return event_ok.callback ? true : false;
|
||||
}
|
||||
|
||||
SDL_bool SDL_AddEventWatch(SDL_EventFilter filter, void *userdata)
|
||||
bool SDL_AddEventWatch(SDL_EventFilter filter, void *userdata)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
@@ -1628,7 +1628,7 @@ void SDL_FilterEvents(SDL_EventFilter filter, void *userdata)
|
||||
SDL_UnlockMutex(SDL_EventQ.lock);
|
||||
}
|
||||
|
||||
void SDL_SetEventEnabled(Uint32 type, SDL_bool enabled)
|
||||
void SDL_SetEventEnabled(Uint32 type, bool enabled)
|
||||
{
|
||||
bool current_state;
|
||||
Uint8 hi = ((type >> 8) & 0xff);
|
||||
@@ -1641,7 +1641,7 @@ void SDL_SetEventEnabled(Uint32 type, SDL_bool enabled)
|
||||
current_state = true;
|
||||
}
|
||||
|
||||
if ((enabled != SDL_FALSE) != current_state) {
|
||||
if ((enabled != false) != current_state) {
|
||||
if (enabled) {
|
||||
SDL_assert(SDL_disabled_events[hi] != NULL);
|
||||
SDL_disabled_events[hi]->bits[lo / 32] &= ~(1 << (lo & 31));
|
||||
@@ -1688,7 +1688,7 @@ void SDL_SetEventEnabled(Uint32 type, SDL_bool enabled)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_EventEnabled(Uint32 type)
|
||||
bool SDL_EventEnabled(Uint32 type)
|
||||
{
|
||||
Uint8 hi = ((type >> 8) & 0xff);
|
||||
Uint8 lo = (type & 0xff);
|
||||
|
||||
@@ -54,7 +54,7 @@ typedef struct SDL_Keyboard
|
||||
SDL_Window *focus;
|
||||
SDL_Keymod modstate;
|
||||
Uint8 keysource[SDL_SCANCODE_COUNT];
|
||||
SDL_bool keystate[SDL_SCANCODE_COUNT];
|
||||
bool keystate[SDL_SCANCODE_COUNT];
|
||||
SDL_Keymap *keymap;
|
||||
bool french_numbers;
|
||||
bool latin_letters;
|
||||
@@ -173,7 +173,7 @@ void SDL_RemoveKeyboard(SDL_KeyboardID keyboardID, bool send_event)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasKeyboard(void)
|
||||
bool SDL_HasKeyboard(void)
|
||||
{
|
||||
return (SDL_keyboard_count > 0);
|
||||
}
|
||||
@@ -453,7 +453,7 @@ static SDL_Keycode SDL_ConvertNumpadKeycode(SDL_Keycode keycode, bool numlock)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, SDL_bool key_event)
|
||||
SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode, SDL_Keymod modstate, bool key_event)
|
||||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
|
||||
@@ -863,7 +863,7 @@ void SDL_QuitKeyboard(void)
|
||||
SDL_KeycodeOptionsChanged, &SDL_keyboard);
|
||||
}
|
||||
|
||||
const SDL_bool *SDL_GetKeyboardState(int *numkeys)
|
||||
const bool *SDL_GetKeyboardState(int *numkeys)
|
||||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
|
||||
|
||||
@@ -933,7 +933,7 @@ static const char *SDL_scancode_names[SDL_SCANCODE_COUNT] =
|
||||
/* 290 */ "EndCall",
|
||||
};
|
||||
|
||||
SDL_bool SDL_SetScancodeName(SDL_Scancode scancode, const char *name)
|
||||
bool SDL_SetScancodeName(SDL_Scancode scancode, const char *name)
|
||||
{
|
||||
if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_SCANCODE_COUNT) {
|
||||
return SDL_InvalidParamError("scancode");
|
||||
|
||||
@@ -356,7 +356,7 @@ void SDL_RemoveMouse(SDL_MouseID mouseID, bool send_event)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasMouse(void)
|
||||
bool SDL_HasMouse(void)
|
||||
{
|
||||
return (SDL_mouse_count > 0);
|
||||
}
|
||||
@@ -1305,7 +1305,7 @@ void SDL_WarpMouseInWindow(SDL_Window *window, float x, float y)
|
||||
SDL_PerformWarpMouseInWindow(window, x, y, mouse->warp_emulation_active);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WarpMouseGlobal(float x, float y)
|
||||
bool SDL_WarpMouseGlobal(float x, float y)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
@@ -1462,7 +1462,7 @@ bool SDL_UpdateMouseCapture(bool force_release)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_CaptureMouse(SDL_bool enabled)
|
||||
bool SDL_CaptureMouse(bool enabled)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
@@ -1602,7 +1602,7 @@ SDL_Cursor *SDL_CreateSystemCursor(SDL_SystemCursor id)
|
||||
if this is desired for any reason. This is used when setting
|
||||
the video mode and when the SDL window gains the mouse focus.
|
||||
*/
|
||||
SDL_bool SDL_SetCursor(SDL_Cursor *cursor)
|
||||
bool SDL_SetCursor(SDL_Cursor *cursor)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
@@ -1701,7 +1701,7 @@ void SDL_DestroyCursor(SDL_Cursor *cursor)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_ShowCursor(void)
|
||||
bool SDL_ShowCursor(void)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
@@ -1717,7 +1717,7 @@ SDL_bool SDL_ShowCursor(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_HideCursor(void)
|
||||
bool SDL_HideCursor(void)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
@@ -1728,7 +1728,7 @@ SDL_bool SDL_HideCursor(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_CursorVisible(void)
|
||||
bool SDL_CursorVisible(void)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ const char *SDL_GetPenName(SDL_PenID instance_id)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetPenInfo(SDL_PenID instance_id, SDL_PenInfo *info)
|
||||
bool SDL_GetPenInfo(SDL_PenID instance_id, SDL_PenInfo *info)
|
||||
{
|
||||
SDL_LockRWLockForReading(pen_device_rwlock);
|
||||
const SDL_Pen *pen = FindPenByInstanceId(instance_id);
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include "SDL_mouse_c.h"
|
||||
|
||||
|
||||
static SDL_bool SDLCALL RemoveSupercededWindowEvents(void *userdata, SDL_Event *event)
|
||||
static bool SDLCALL RemoveSupercededWindowEvents(void *userdata, SDL_Event *event)
|
||||
{
|
||||
SDL_Event *new_event = (SDL_Event *)userdata;
|
||||
|
||||
|
||||
+36
-36
@@ -275,7 +275,7 @@ static size_t SDLCALL windows_file_write(void *userdata, const void *ptr, size_t
|
||||
return bytes;
|
||||
}
|
||||
|
||||
static SDL_bool SDLCALL windows_file_close(void *userdata)
|
||||
static bool SDLCALL windows_file_close(void *userdata)
|
||||
{
|
||||
IOStreamWindowsData *iodata = (IOStreamWindowsData *) userdata;
|
||||
if (iodata->h != INVALID_HANDLE_VALUE) {
|
||||
@@ -451,7 +451,7 @@ static size_t SDLCALL stdio_write(void *userdata, const void *ptr, size_t size,
|
||||
return bytes;
|
||||
}
|
||||
|
||||
static SDL_bool SDLCALL stdio_flush(void *userdata, SDL_IOStatus *status)
|
||||
static bool SDLCALL stdio_flush(void *userdata, SDL_IOStatus *status)
|
||||
{
|
||||
IOStreamStdioData *iodata = (IOStreamStdioData *) userdata;
|
||||
if (fflush(iodata->fp) != 0) {
|
||||
@@ -465,7 +465,7 @@ static SDL_bool SDLCALL stdio_flush(void *userdata, SDL_IOStatus *status)
|
||||
return true;
|
||||
}
|
||||
|
||||
static SDL_bool SDLCALL stdio_close(void *userdata)
|
||||
static bool SDLCALL stdio_close(void *userdata)
|
||||
{
|
||||
IOStreamStdioData *iodata = (IOStreamStdioData *) userdata;
|
||||
bool status = true;
|
||||
@@ -583,7 +583,7 @@ static size_t SDLCALL mem_write(void *userdata, const void *ptr, size_t size, SD
|
||||
return mem_io(userdata, iodata->here, ptr, size);
|
||||
}
|
||||
|
||||
static SDL_bool SDLCALL mem_close(void *userdata)
|
||||
static bool SDLCALL mem_close(void *userdata)
|
||||
{
|
||||
SDL_free(userdata);
|
||||
return true;
|
||||
@@ -851,7 +851,7 @@ static size_t SDLCALL dynamic_mem_write(void *userdata, const void *ptr, size_t
|
||||
return mem_io(&iodata->data, iodata->data.here, ptr, size);
|
||||
}
|
||||
|
||||
static SDL_bool SDLCALL dynamic_mem_close(void *userdata)
|
||||
static bool SDLCALL dynamic_mem_close(void *userdata)
|
||||
{
|
||||
const IOStreamDynamicMemData *iodata = (IOStreamDynamicMemData *) userdata;
|
||||
void *mem = SDL_GetPointerProperty(SDL_GetIOProperties(iodata->stream), SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL);
|
||||
@@ -915,7 +915,7 @@ SDL_IOStream *SDL_OpenIO(const SDL_IOStreamInterface *iface, void *userdata)
|
||||
return iostr;
|
||||
}
|
||||
|
||||
SDL_bool SDL_CloseIO(SDL_IOStream *iostr)
|
||||
bool SDL_CloseIO(SDL_IOStream *iostr)
|
||||
{
|
||||
bool result = true;
|
||||
if (iostr) {
|
||||
@@ -929,7 +929,7 @@ SDL_bool SDL_CloseIO(SDL_IOStream *iostr)
|
||||
}
|
||||
|
||||
// Load all the data from an SDL data stream
|
||||
void *SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, SDL_bool closeio)
|
||||
void *SDL_LoadFile_IO(SDL_IOStream *src, size_t *datasize, bool closeio)
|
||||
{
|
||||
const int FILE_CHUNK_SIZE = 1024;
|
||||
Sint64 size, size_total = 0;
|
||||
@@ -1148,7 +1148,7 @@ size_t SDL_IOvprintf(SDL_IOStream *context, SDL_PRINTF_FORMAT_STRING const char
|
||||
return bytes;
|
||||
}
|
||||
|
||||
SDL_bool SDL_FlushIO(SDL_IOStream *context)
|
||||
bool SDL_FlushIO(SDL_IOStream *context)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
@@ -1170,7 +1170,7 @@ SDL_bool SDL_FlushIO(SDL_IOStream *context)
|
||||
|
||||
// Functions for dynamically reading and writing endian-specific values
|
||||
|
||||
SDL_bool SDL_ReadU8(SDL_IOStream *src, Uint8 *value)
|
||||
bool SDL_ReadU8(SDL_IOStream *src, Uint8 *value)
|
||||
{
|
||||
Uint8 data = 0;
|
||||
bool result = false;
|
||||
@@ -1184,7 +1184,7 @@ SDL_bool SDL_ReadU8(SDL_IOStream *src, Uint8 *value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadS8(SDL_IOStream *src, Sint8 *value)
|
||||
bool SDL_ReadS8(SDL_IOStream *src, Sint8 *value)
|
||||
{
|
||||
Sint8 data = 0;
|
||||
bool result = false;
|
||||
@@ -1198,7 +1198,7 @@ SDL_bool SDL_ReadS8(SDL_IOStream *src, Sint8 *value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value)
|
||||
bool SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value)
|
||||
{
|
||||
Uint16 data = 0;
|
||||
bool result = false;
|
||||
@@ -1212,12 +1212,12 @@ SDL_bool SDL_ReadU16LE(SDL_IOStream *src, Uint16 *value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value)
|
||||
bool SDL_ReadS16LE(SDL_IOStream *src, Sint16 *value)
|
||||
{
|
||||
return SDL_ReadU16LE(src, (Uint16 *)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value)
|
||||
bool SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value)
|
||||
{
|
||||
Uint16 data = 0;
|
||||
bool result = false;
|
||||
@@ -1231,12 +1231,12 @@ SDL_bool SDL_ReadU16BE(SDL_IOStream *src, Uint16 *value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value)
|
||||
bool SDL_ReadS16BE(SDL_IOStream *src, Sint16 *value)
|
||||
{
|
||||
return SDL_ReadU16BE(src, (Uint16 *)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value)
|
||||
bool SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value)
|
||||
{
|
||||
Uint32 data = 0;
|
||||
bool result = false;
|
||||
@@ -1250,12 +1250,12 @@ SDL_bool SDL_ReadU32LE(SDL_IOStream *src, Uint32 *value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value)
|
||||
bool SDL_ReadS32LE(SDL_IOStream *src, Sint32 *value)
|
||||
{
|
||||
return SDL_ReadU32LE(src, (Uint32 *)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value)
|
||||
bool SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value)
|
||||
{
|
||||
Uint32 data = 0;
|
||||
bool result = false;
|
||||
@@ -1269,12 +1269,12 @@ SDL_bool SDL_ReadU32BE(SDL_IOStream *src, Uint32 *value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value)
|
||||
bool SDL_ReadS32BE(SDL_IOStream *src, Sint32 *value)
|
||||
{
|
||||
return SDL_ReadU32BE(src, (Uint32 *)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value)
|
||||
bool SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value)
|
||||
{
|
||||
Uint64 data = 0;
|
||||
bool result = false;
|
||||
@@ -1288,12 +1288,12 @@ SDL_bool SDL_ReadU64LE(SDL_IOStream *src, Uint64 *value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value)
|
||||
bool SDL_ReadS64LE(SDL_IOStream *src, Sint64 *value)
|
||||
{
|
||||
return SDL_ReadU64LE(src, (Uint64 *)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value)
|
||||
bool SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value)
|
||||
{
|
||||
Uint64 data = 0;
|
||||
bool result = false;
|
||||
@@ -1307,83 +1307,83 @@ SDL_bool SDL_ReadU64BE(SDL_IOStream *src, Uint64 *value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value)
|
||||
bool SDL_ReadS64BE(SDL_IOStream *src, Sint64 *value)
|
||||
{
|
||||
return SDL_ReadU64BE(src, (Uint64 *)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteU8(SDL_IOStream *dst, Uint8 value)
|
||||
bool SDL_WriteU8(SDL_IOStream *dst, Uint8 value)
|
||||
{
|
||||
return (SDL_WriteIO(dst, &value, sizeof(value)) == sizeof(value));
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteS8(SDL_IOStream *dst, Sint8 value)
|
||||
bool SDL_WriteS8(SDL_IOStream *dst, Sint8 value)
|
||||
{
|
||||
return (SDL_WriteIO(dst, &value, sizeof(value)) == sizeof(value));
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteU16LE(SDL_IOStream *dst, Uint16 value)
|
||||
bool SDL_WriteU16LE(SDL_IOStream *dst, Uint16 value)
|
||||
{
|
||||
const Uint16 swapped = SDL_Swap16LE(value);
|
||||
return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped));
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value)
|
||||
bool SDL_WriteS16LE(SDL_IOStream *dst, Sint16 value)
|
||||
{
|
||||
return SDL_WriteU16LE(dst, (Uint16)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteU16BE(SDL_IOStream *dst, Uint16 value)
|
||||
bool SDL_WriteU16BE(SDL_IOStream *dst, Uint16 value)
|
||||
{
|
||||
const Uint16 swapped = SDL_Swap16BE(value);
|
||||
return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped));
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteS16BE(SDL_IOStream *dst, Sint16 value)
|
||||
bool SDL_WriteS16BE(SDL_IOStream *dst, Sint16 value)
|
||||
{
|
||||
return SDL_WriteU16BE(dst, (Uint16)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteU32LE(SDL_IOStream *dst, Uint32 value)
|
||||
bool SDL_WriteU32LE(SDL_IOStream *dst, Uint32 value)
|
||||
{
|
||||
const Uint32 swapped = SDL_Swap32LE(value);
|
||||
return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped));
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteS32LE(SDL_IOStream *dst, Sint32 value)
|
||||
bool SDL_WriteS32LE(SDL_IOStream *dst, Sint32 value)
|
||||
{
|
||||
return SDL_WriteU32LE(dst, (Uint32)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteU32BE(SDL_IOStream *dst, Uint32 value)
|
||||
bool SDL_WriteU32BE(SDL_IOStream *dst, Uint32 value)
|
||||
{
|
||||
const Uint32 swapped = SDL_Swap32BE(value);
|
||||
return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped));
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteS32BE(SDL_IOStream *dst, Sint32 value)
|
||||
bool SDL_WriteS32BE(SDL_IOStream *dst, Sint32 value)
|
||||
{
|
||||
return SDL_WriteU32BE(dst, (Uint32)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteU64LE(SDL_IOStream *dst, Uint64 value)
|
||||
bool SDL_WriteU64LE(SDL_IOStream *dst, Uint64 value)
|
||||
{
|
||||
const Uint64 swapped = SDL_Swap64LE(value);
|
||||
return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped));
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteS64LE(SDL_IOStream *dst, Sint64 value)
|
||||
bool SDL_WriteS64LE(SDL_IOStream *dst, Sint64 value)
|
||||
{
|
||||
return SDL_WriteU64LE(dst, (Uint64)value);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteU64BE(SDL_IOStream *dst, Uint64 value)
|
||||
bool SDL_WriteU64BE(SDL_IOStream *dst, Uint64 value)
|
||||
{
|
||||
const Uint64 swapped = SDL_Swap64BE(value);
|
||||
return (SDL_WriteIO(dst, &swapped, sizeof(swapped)) == sizeof(swapped));
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteS64BE(SDL_IOStream *dst, Sint64 value)
|
||||
bool SDL_WriteS64BE(SDL_IOStream *dst, Sint64 value)
|
||||
{
|
||||
return SDL_WriteU64BE(dst, (Uint64)value);
|
||||
}
|
||||
@@ -25,7 +25,7 @@
|
||||
#include "SDL_sysfilesystem.h"
|
||||
#include "../stdlib/SDL_sysstdlib.h"
|
||||
|
||||
SDL_bool SDL_RemovePath(const char *path)
|
||||
bool SDL_RemovePath(const char *path)
|
||||
{
|
||||
if (!path) {
|
||||
return SDL_InvalidParamError("path");
|
||||
@@ -33,7 +33,7 @@ SDL_bool SDL_RemovePath(const char *path)
|
||||
return SDL_SYS_RemovePath(path);
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenamePath(const char *oldpath, const char *newpath)
|
||||
bool SDL_RenamePath(const char *oldpath, const char *newpath)
|
||||
{
|
||||
if (!oldpath) {
|
||||
return SDL_InvalidParamError("oldpath");
|
||||
@@ -43,7 +43,7 @@ SDL_bool SDL_RenamePath(const char *oldpath, const char *newpath)
|
||||
return SDL_SYS_RenamePath(oldpath, newpath);
|
||||
}
|
||||
|
||||
SDL_bool SDL_CopyFile(const char *oldpath, const char *newpath)
|
||||
bool SDL_CopyFile(const char *oldpath, const char *newpath)
|
||||
{
|
||||
if (!oldpath) {
|
||||
return SDL_InvalidParamError("oldpath");
|
||||
@@ -53,7 +53,7 @@ SDL_bool SDL_CopyFile(const char *oldpath, const char *newpath)
|
||||
return SDL_SYS_CopyFile(oldpath, newpath);
|
||||
}
|
||||
|
||||
SDL_bool SDL_CreateDirectory(const char *path)
|
||||
bool SDL_CreateDirectory(const char *path)
|
||||
{
|
||||
// TODO: Recursively create subdirectories
|
||||
if (!path) {
|
||||
@@ -62,7 +62,7 @@ SDL_bool SDL_CreateDirectory(const char *path)
|
||||
return SDL_SYS_CreateDirectory(path);
|
||||
}
|
||||
|
||||
SDL_bool SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata)
|
||||
bool SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata)
|
||||
{
|
||||
if (!path) {
|
||||
return SDL_InvalidParamError("path");
|
||||
@@ -75,7 +75,7 @@ SDL_bool SDL_EnumerateDirectory(const char *path, SDL_EnumerateDirectoryCallback
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetPathInfo(const char *path, SDL_PathInfo *info)
|
||||
bool SDL_GetPathInfo(const char *path, SDL_PathInfo *info)
|
||||
{
|
||||
SDL_PathInfo dummy;
|
||||
|
||||
@@ -399,12 +399,12 @@ char **SDL_InternalGlobDirectory(const char *path, const char *pattern, SDL_Glob
|
||||
return result;
|
||||
}
|
||||
|
||||
static SDL_bool GlobDirectoryGetPathInfo(const char *path, SDL_PathInfo *info, void *userdata)
|
||||
static bool GlobDirectoryGetPathInfo(const char *path, SDL_PathInfo *info, void *userdata)
|
||||
{
|
||||
return SDL_GetPathInfo(path, info);
|
||||
}
|
||||
|
||||
static SDL_bool GlobDirectoryEnumerator(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata)
|
||||
static bool GlobDirectoryEnumerator(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata)
|
||||
{
|
||||
return SDL_EnumerateDirectory(path, cb, cbuserdata);
|
||||
}
|
||||
|
||||
@@ -34,8 +34,8 @@ extern bool SDL_SYS_CopyFile(const char *oldpath, const char *newpath);
|
||||
extern bool SDL_SYS_CreateDirectory(const char *path);
|
||||
extern bool SDL_SYS_GetPathInfo(const char *path, SDL_PathInfo *info);
|
||||
|
||||
typedef SDL_bool (*SDL_GlobEnumeratorFunc)(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata);
|
||||
typedef SDL_bool (*SDL_GlobGetPathInfoFunc)(const char *path, SDL_PathInfo *info, void *userdata);
|
||||
typedef bool (*SDL_GlobEnumeratorFunc)(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata);
|
||||
typedef bool (*SDL_GlobGetPathInfoFunc)(const char *path, SDL_PathInfo *info, void *userdata);
|
||||
extern char **SDL_InternalGlobDirectory(const char *path, const char *pattern, SDL_GlobFlags flags, int *count, SDL_GlobEnumeratorFunc enumerator, SDL_GlobGetPathInfoFunc getpathinfo, void *userdata);
|
||||
|
||||
#endif
|
||||
|
||||
+21
-21
@@ -225,7 +225,7 @@ SDL_GPUGraphicsPipeline *SDL_GPU_FetchBlitPipeline(
|
||||
}
|
||||
|
||||
blit_pipeline_create_info.multisample_state.sample_count = SDL_GPU_SAMPLECOUNT_1;
|
||||
blit_pipeline_create_info.multisample_state.enable_mask = SDL_FALSE;
|
||||
blit_pipeline_create_info.multisample_state.enable_mask = false;
|
||||
|
||||
blit_pipeline_create_info.primitive_type = SDL_GPU_PRIMITIVETYPE_TRIANGLELIST;
|
||||
|
||||
@@ -442,7 +442,7 @@ static const SDL_GPUBootstrap * SDL_GPUSelectBackend(SDL_PropertiesID props)
|
||||
static void SDL_GPU_FillProperties(
|
||||
SDL_PropertiesID props,
|
||||
SDL_GPUShaderFormat format_flags,
|
||||
SDL_bool debug_mode,
|
||||
bool debug_mode,
|
||||
const char *name)
|
||||
{
|
||||
if (format_flags & SDL_GPU_SHADERFORMAT_PRIVATE) {
|
||||
@@ -468,36 +468,36 @@ static void SDL_GPU_FillProperties(
|
||||
}
|
||||
#endif // SDL_GPU_DISABLED
|
||||
|
||||
SDL_bool SDL_GPUSupportsShaderFormats(
|
||||
bool SDL_GPUSupportsShaderFormats(
|
||||
SDL_GPUShaderFormat format_flags,
|
||||
const char *name)
|
||||
{
|
||||
#ifndef SDL_GPU_DISABLED
|
||||
bool result;
|
||||
SDL_PropertiesID props = SDL_CreateProperties();
|
||||
SDL_GPU_FillProperties(props, format_flags, SDL_FALSE, name);
|
||||
SDL_GPU_FillProperties(props, format_flags, false, name);
|
||||
result = SDL_GPUSupportsProperties(props);
|
||||
SDL_DestroyProperties(props);
|
||||
return result;
|
||||
#else
|
||||
SDL_SetError("SDL not built with GPU support");
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
SDL_bool SDL_GPUSupportsProperties(SDL_PropertiesID props)
|
||||
bool SDL_GPUSupportsProperties(SDL_PropertiesID props)
|
||||
{
|
||||
#ifndef SDL_GPU_DISABLED
|
||||
return (SDL_GPUSelectBackend(props) != NULL);
|
||||
#else
|
||||
SDL_SetError("SDL not built with GPU support");
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
SDL_GPUDevice *SDL_CreateGPUDevice(
|
||||
SDL_GPUShaderFormat format_flags,
|
||||
SDL_bool debug_mode,
|
||||
bool debug_mode,
|
||||
const char *name)
|
||||
{
|
||||
#ifndef SDL_GPU_DISABLED
|
||||
@@ -641,7 +641,7 @@ Uint32 SDL_GPUTextureFormatTexelBlockSize(
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_GPUTextureSupportsFormat(
|
||||
bool SDL_GPUTextureSupportsFormat(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_GPUTextureFormat format,
|
||||
SDL_GPUTextureType type,
|
||||
@@ -660,7 +660,7 @@ SDL_bool SDL_GPUTextureSupportsFormat(
|
||||
usage);
|
||||
}
|
||||
|
||||
SDL_bool SDL_GPUTextureSupportsSampleCount(
|
||||
bool SDL_GPUTextureSupportsSampleCount(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_GPUTextureFormat format,
|
||||
SDL_GPUSampleCount sample_count)
|
||||
@@ -2074,7 +2074,7 @@ void SDL_EndGPUComputePass(
|
||||
void *SDL_MapGPUTransferBuffer(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_GPUTransferBuffer *transfer_buffer,
|
||||
SDL_bool cycle)
|
||||
bool cycle)
|
||||
{
|
||||
CHECK_DEVICE_MAGIC(device, NULL);
|
||||
if (transfer_buffer == NULL) {
|
||||
@@ -2132,7 +2132,7 @@ void SDL_UploadToGPUTexture(
|
||||
SDL_GPUCopyPass *copy_pass,
|
||||
const SDL_GPUTextureTransferInfo *source,
|
||||
const SDL_GPUTextureRegion *destination,
|
||||
SDL_bool cycle)
|
||||
bool cycle)
|
||||
{
|
||||
if (copy_pass == NULL) {
|
||||
SDL_InvalidParamError("copy_pass");
|
||||
@@ -2170,7 +2170,7 @@ void SDL_UploadToGPUBuffer(
|
||||
SDL_GPUCopyPass *copy_pass,
|
||||
const SDL_GPUTransferBufferLocation *source,
|
||||
const SDL_GPUBufferRegion *destination,
|
||||
SDL_bool cycle)
|
||||
bool cycle)
|
||||
{
|
||||
if (copy_pass == NULL) {
|
||||
SDL_InvalidParamError("copy_pass");
|
||||
@@ -2211,7 +2211,7 @@ void SDL_CopyGPUTextureToTexture(
|
||||
Uint32 w,
|
||||
Uint32 h,
|
||||
Uint32 d,
|
||||
SDL_bool cycle)
|
||||
bool cycle)
|
||||
{
|
||||
if (copy_pass == NULL) {
|
||||
SDL_InvalidParamError("copy_pass");
|
||||
@@ -2253,7 +2253,7 @@ void SDL_CopyGPUBufferToBuffer(
|
||||
const SDL_GPUBufferLocation *source,
|
||||
const SDL_GPUBufferLocation *destination,
|
||||
Uint32 size,
|
||||
SDL_bool cycle)
|
||||
bool cycle)
|
||||
{
|
||||
if (copy_pass == NULL) {
|
||||
SDL_InvalidParamError("copy_pass");
|
||||
@@ -2475,7 +2475,7 @@ void SDL_BlitGPUTexture(
|
||||
|
||||
// Submission/Presentation
|
||||
|
||||
SDL_bool SDL_WindowSupportsGPUSwapchainComposition(
|
||||
bool SDL_WindowSupportsGPUSwapchainComposition(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_Window *window,
|
||||
SDL_GPUSwapchainComposition swapchain_composition)
|
||||
@@ -2496,7 +2496,7 @@ SDL_bool SDL_WindowSupportsGPUSwapchainComposition(
|
||||
swapchain_composition);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WindowSupportsGPUPresentMode(
|
||||
bool SDL_WindowSupportsGPUPresentMode(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_Window *window,
|
||||
SDL_GPUPresentMode present_mode)
|
||||
@@ -2517,7 +2517,7 @@ SDL_bool SDL_WindowSupportsGPUPresentMode(
|
||||
present_mode);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ClaimWindowForGPUDevice(
|
||||
bool SDL_ClaimWindowForGPUDevice(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_Window *window)
|
||||
{
|
||||
@@ -2547,7 +2547,7 @@ void SDL_ReleaseWindowFromGPUDevice(
|
||||
window);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetGPUSwapchainParameters(
|
||||
bool SDL_SetGPUSwapchainParameters(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_Window *window,
|
||||
SDL_GPUSwapchainComposition swapchain_composition,
|
||||
@@ -2686,7 +2686,7 @@ void SDL_WaitForGPUIdle(
|
||||
|
||||
void SDL_WaitForGPUFences(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_bool wait_all,
|
||||
bool wait_all,
|
||||
SDL_GPUFence *const *fences,
|
||||
Uint32 num_fences)
|
||||
{
|
||||
@@ -2703,7 +2703,7 @@ void SDL_WaitForGPUFences(
|
||||
num_fences);
|
||||
}
|
||||
|
||||
SDL_bool SDL_QueryGPUFence(
|
||||
bool SDL_QueryGPUFence(
|
||||
SDL_GPUDevice *device,
|
||||
SDL_GPUFence *fence)
|
||||
{
|
||||
|
||||
@@ -6008,7 +6008,7 @@ static void D3D11_INTERNAL_InitBlitPipelines(
|
||||
blitPipelineCreateInfo.fragment_shader = blitFrom2DPixelShader;
|
||||
|
||||
blitPipelineCreateInfo.multisample_state.sample_count = SDL_GPU_SAMPLECOUNT_1;
|
||||
blitPipelineCreateInfo.multisample_state.enable_mask = SDL_FALSE;
|
||||
blitPipelineCreateInfo.multisample_state.enable_mask = false;
|
||||
|
||||
blitPipelineCreateInfo.primitive_type = SDL_GPU_PRIMITIVETYPE_TRIANGLELIST;
|
||||
|
||||
|
||||
@@ -9355,7 +9355,7 @@ static WindowData *VULKAN_INTERNAL_FetchWindowData(
|
||||
return (WindowData *)SDL_GetPointerProperty(properties, WINDOW_PROPERTY_DATA, NULL);
|
||||
}
|
||||
|
||||
static SDL_bool VULKAN_INTERNAL_OnWindowResize(void *userdata, SDL_Event *e)
|
||||
static bool VULKAN_INTERNAL_OnWindowResize(void *userdata, SDL_Event *e)
|
||||
{
|
||||
SDL_Window *w = (SDL_Window *)userdata;
|
||||
WindowData *data;
|
||||
|
||||
+16
-16
@@ -185,7 +185,7 @@ const char *SDL_GetHapticName(SDL_Haptic *haptic)
|
||||
return SDL_GetPersistentString(haptic->name);
|
||||
}
|
||||
|
||||
SDL_bool SDL_IsMouseHaptic(void)
|
||||
bool SDL_IsMouseHaptic(void)
|
||||
{
|
||||
if (SDL_SYS_HapticMouse() < 0) {
|
||||
return false;
|
||||
@@ -207,7 +207,7 @@ SDL_Haptic *SDL_OpenHapticFromMouse(void)
|
||||
return SDL_OpenHaptic(device_index);
|
||||
}
|
||||
|
||||
SDL_bool SDL_IsJoystickHaptic(SDL_Joystick *joystick)
|
||||
bool SDL_IsJoystickHaptic(SDL_Joystick *joystick)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@@ -370,7 +370,7 @@ int SDL_GetNumHapticAxes(SDL_Haptic *haptic)
|
||||
return haptic->naxes;
|
||||
}
|
||||
|
||||
SDL_bool SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect)
|
||||
bool SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@@ -429,7 +429,7 @@ static bool ValidEffect(SDL_Haptic *haptic, int effect)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data)
|
||||
bool SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_HapticEffect *data)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@@ -456,7 +456,7 @@ SDL_bool SDL_UpdateHapticEffect(SDL_Haptic *haptic, int effect, const SDL_Haptic
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations)
|
||||
bool SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@@ -472,7 +472,7 @@ SDL_bool SDL_RunHapticEffect(SDL_Haptic *haptic, int effect, Uint32 iterations)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_StopHapticEffect(SDL_Haptic *haptic, int effect)
|
||||
bool SDL_StopHapticEffect(SDL_Haptic *haptic, int effect)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@@ -504,7 +504,7 @@ void SDL_DestroyHapticEffect(SDL_Haptic *haptic, int effect)
|
||||
SDL_SYS_HapticDestroyEffect(haptic, &haptic->effects[effect]);
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect)
|
||||
bool SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@@ -521,7 +521,7 @@ SDL_bool SDL_GetHapticEffectStatus(SDL_Haptic *haptic, int effect)
|
||||
return SDL_SYS_HapticGetEffectStatus(haptic, &haptic->effects[effect]);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetHapticGain(SDL_Haptic *haptic, int gain)
|
||||
bool SDL_SetHapticGain(SDL_Haptic *haptic, int gain)
|
||||
{
|
||||
const char *env;
|
||||
int real_gain, max_gain;
|
||||
@@ -557,7 +557,7 @@ SDL_bool SDL_SetHapticGain(SDL_Haptic *haptic, int gain)
|
||||
return SDL_SYS_HapticSetGain(haptic, real_gain);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter)
|
||||
bool SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@@ -572,7 +572,7 @@ SDL_bool SDL_SetHapticAutocenter(SDL_Haptic *haptic, int autocenter)
|
||||
return SDL_SYS_HapticSetAutocenter(haptic, autocenter);
|
||||
}
|
||||
|
||||
SDL_bool SDL_PauseHaptic(SDL_Haptic *haptic)
|
||||
bool SDL_PauseHaptic(SDL_Haptic *haptic)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@@ -583,7 +583,7 @@ SDL_bool SDL_PauseHaptic(SDL_Haptic *haptic)
|
||||
return SDL_SYS_HapticPause(haptic);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ResumeHaptic(SDL_Haptic *haptic)
|
||||
bool SDL_ResumeHaptic(SDL_Haptic *haptic)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@@ -594,14 +594,14 @@ SDL_bool SDL_ResumeHaptic(SDL_Haptic *haptic)
|
||||
return SDL_SYS_HapticResume(haptic);
|
||||
}
|
||||
|
||||
SDL_bool SDL_StopHapticEffects(SDL_Haptic *haptic)
|
||||
bool SDL_StopHapticEffects(SDL_Haptic *haptic)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
return SDL_SYS_HapticStopAll(haptic);
|
||||
}
|
||||
|
||||
SDL_bool SDL_HapticRumbleSupported(SDL_Haptic *haptic)
|
||||
bool SDL_HapticRumbleSupported(SDL_Haptic *haptic)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
@@ -609,7 +609,7 @@ SDL_bool SDL_HapticRumbleSupported(SDL_Haptic *haptic)
|
||||
return (haptic->supported & (SDL_HAPTIC_SINE | SDL_HAPTIC_LEFTRIGHT)) != 0;
|
||||
}
|
||||
|
||||
SDL_bool SDL_InitHapticRumble(SDL_Haptic *haptic)
|
||||
bool SDL_InitHapticRumble(SDL_Haptic *haptic)
|
||||
{
|
||||
SDL_HapticEffect *efx = &haptic->rumble_effect;
|
||||
|
||||
@@ -645,7 +645,7 @@ SDL_bool SDL_InitHapticRumble(SDL_Haptic *haptic)
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_bool SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length)
|
||||
bool SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length)
|
||||
{
|
||||
SDL_HapticEffect *efx;
|
||||
Sint16 magnitude;
|
||||
@@ -682,7 +682,7 @@ SDL_bool SDL_PlayHapticRumble(SDL_Haptic *haptic, float strength, Uint32 length)
|
||||
return SDL_RunHapticEffect(haptic, haptic->rumble_id, 1);
|
||||
}
|
||||
|
||||
SDL_bool SDL_StopHapticRumble(SDL_Haptic *haptic)
|
||||
bool SDL_StopHapticRumble(SDL_Haptic *haptic)
|
||||
{
|
||||
CHECK_HAPTIC_MAGIC(haptic, false);
|
||||
|
||||
|
||||
@@ -1685,7 +1685,7 @@ int SDL_hid_get_report_descriptor(SDL_hid_device *device, unsigned char *buf, si
|
||||
return device->backend->hid_get_report_descriptor(device->device, buf, buf_size);
|
||||
}
|
||||
|
||||
void SDL_hid_ble_scan(SDL_bool active)
|
||||
void SDL_hid_ble_scan(bool active)
|
||||
{
|
||||
#if !defined(SDL_HIDAPI_DISABLED) && (defined(SDL_PLATFORM_IOS) || defined(SDL_PLATFORM_TVOS))
|
||||
extern void hid_ble_scan(int bStart);
|
||||
|
||||
@@ -1030,7 +1030,7 @@ extern "C"
|
||||
{
|
||||
|
||||
// !!! FIXME: make this non-blocking!
|
||||
static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, SDL_bool granted)
|
||||
static void SDLCALL RequestAndroidPermissionBlockingCallback(void *userdata, const char *permission, bool granted)
|
||||
{
|
||||
SDL_SetAtomicInt((SDL_AtomicInt *) userdata, granted ? 1 : -1);
|
||||
}
|
||||
|
||||
+23
-23
@@ -363,7 +363,7 @@ static void SDL_PrivateGamepadRemapped(SDL_JoystickID instance_id)
|
||||
/*
|
||||
* Event filter to fire gamepad events from joystick ones
|
||||
*/
|
||||
static SDL_bool SDLCALL SDL_GamepadEventWatcher(void *userdata, SDL_Event *event)
|
||||
static bool SDLCALL SDL_GamepadEventWatcher(void *userdata, SDL_Event *event)
|
||||
{
|
||||
SDL_Gamepad *gamepad;
|
||||
|
||||
@@ -1799,7 +1799,7 @@ static GamepadMapping_t *SDL_PrivateGetGamepadMapping(SDL_JoystickID instance_id
|
||||
/*
|
||||
* Add or update an entry into the Mappings Database
|
||||
*/
|
||||
int SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, SDL_bool closeio)
|
||||
int SDL_AddGamepadMappingsFromIO(SDL_IOStream *src, bool closeio)
|
||||
{
|
||||
const char *platform = SDL_GetPlatform();
|
||||
int gamepads = 0;
|
||||
@@ -1859,7 +1859,7 @@ int SDL_AddGamepadMappingsFromFile(const char *file)
|
||||
return SDL_AddGamepadMappingsFromIO(SDL_IOFromFile(file, "rb"), true);
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReloadGamepadMappings(void)
|
||||
bool SDL_ReloadGamepadMappings(void)
|
||||
{
|
||||
SDL_Gamepad *gamepad;
|
||||
|
||||
@@ -2245,7 +2245,7 @@ char *SDL_GetGamepadMapping(SDL_Gamepad *gamepad)
|
||||
/*
|
||||
* Set the mapping string for this device
|
||||
*/
|
||||
SDL_bool SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping)
|
||||
bool SDL_SetGamepadMapping(SDL_JoystickID instance_id, const char *mapping)
|
||||
{
|
||||
SDL_GUID guid = SDL_GetJoystickGUIDForID(instance_id);
|
||||
bool result = false;
|
||||
@@ -2380,7 +2380,7 @@ bool SDL_InitGamepads(void)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasGamepad(void)
|
||||
bool SDL_HasGamepad(void)
|
||||
{
|
||||
int num_joysticks = 0;
|
||||
int num_gamepads = 0;
|
||||
@@ -2562,7 +2562,7 @@ bool SDL_IsGamepadNameAndGUID(const char *name, SDL_GUID guid)
|
||||
/*
|
||||
* Return 1 if the joystick at this device index is a supported gamepad
|
||||
*/
|
||||
SDL_bool SDL_IsGamepad(SDL_JoystickID instance_id)
|
||||
bool SDL_IsGamepad(SDL_JoystickID instance_id)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -2751,7 +2751,7 @@ void SDL_UpdateGamepads(void)
|
||||
/**
|
||||
* Return whether a gamepad has a given axis
|
||||
*/
|
||||
SDL_bool SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis)
|
||||
bool SDL_GamepadHasAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@@ -2841,7 +2841,7 @@ Sint16 SDL_GetGamepadAxis(SDL_Gamepad *gamepad, SDL_GamepadAxis axis)
|
||||
/**
|
||||
* Return whether a gamepad has a given button
|
||||
*/
|
||||
SDL_bool SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button)
|
||||
bool SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@@ -2867,7 +2867,7 @@ SDL_bool SDL_GamepadHasButton(SDL_Gamepad *gamepad, SDL_GamepadButton button)
|
||||
/*
|
||||
* Get the current state of a button on a gamepad
|
||||
*/
|
||||
SDL_bool SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button)
|
||||
bool SDL_GetGamepadButton(SDL_Gamepad *gamepad, SDL_GamepadButton button)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@@ -3053,7 +3053,7 @@ int SDL_GetNumGamepadTouchpadFingers(SDL_Gamepad *gamepad, int touchpad)
|
||||
/**
|
||||
* Get the current state of a finger on a touchpad on a gamepad.
|
||||
*/
|
||||
SDL_bool SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, SDL_bool *down, float *x, float *y, float *pressure)
|
||||
bool SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int finger, bool *down, float *x, float *y, float *pressure)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@@ -3095,7 +3095,7 @@ SDL_bool SDL_GetGamepadTouchpadFinger(SDL_Gamepad *gamepad, int touchpad, int fi
|
||||
/**
|
||||
* Return whether a gamepad has a particular sensor.
|
||||
*/
|
||||
SDL_bool SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type)
|
||||
bool SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@@ -3120,7 +3120,7 @@ SDL_bool SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type)
|
||||
/*
|
||||
* Set whether data reporting for a gamepad sensor is enabled
|
||||
*/
|
||||
SDL_bool SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, SDL_bool enabled)
|
||||
bool SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type, bool enabled)
|
||||
{
|
||||
SDL_LockJoysticks();
|
||||
{
|
||||
@@ -3131,7 +3131,7 @@ SDL_bool SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type,
|
||||
SDL_JoystickSensorInfo *sensor = &joystick->sensors[i];
|
||||
|
||||
if (sensor->type == type) {
|
||||
if (sensor->enabled == (enabled != SDL_FALSE)) {
|
||||
if (sensor->enabled == (enabled != false)) {
|
||||
SDL_UnlockJoysticks();
|
||||
return true;
|
||||
}
|
||||
@@ -3197,7 +3197,7 @@ SDL_bool SDL_SetGamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type,
|
||||
/*
|
||||
* Query whether sensor data reporting is enabled for a gamepad
|
||||
*/
|
||||
SDL_bool SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type)
|
||||
bool SDL_GamepadSensorEnabled(SDL_Gamepad *gamepad, SDL_SensorType type)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@@ -3249,7 +3249,7 @@ float SDL_GetGamepadSensorDataRate(SDL_Gamepad *gamepad, SDL_SensorType type)
|
||||
/*
|
||||
* Get the current state of a gamepad sensor.
|
||||
*/
|
||||
SDL_bool SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values)
|
||||
bool SDL_GetGamepadSensorData(SDL_Gamepad *gamepad, SDL_SensorType type, float *data, int num_values)
|
||||
{
|
||||
SDL_LockJoysticks();
|
||||
{
|
||||
@@ -3372,7 +3372,7 @@ int SDL_GetGamepadPlayerIndex(SDL_Gamepad *gamepad)
|
||||
/**
|
||||
* Set the player index of an opened gamepad
|
||||
*/
|
||||
SDL_bool SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index)
|
||||
bool SDL_SetGamepadPlayerIndex(SDL_Gamepad *gamepad, int player_index)
|
||||
{
|
||||
SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad);
|
||||
|
||||
@@ -3476,7 +3476,7 @@ SDL_PowerState SDL_GetGamepadPowerInfo(SDL_Gamepad *gamepad, int *percent)
|
||||
* Return if the gamepad in question is currently attached to the system,
|
||||
* \return 0 if not plugged in, 1 if still present.
|
||||
*/
|
||||
SDL_bool SDL_GamepadConnected(SDL_Gamepad *gamepad)
|
||||
bool SDL_GamepadConnected(SDL_Gamepad *gamepad)
|
||||
{
|
||||
SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad);
|
||||
|
||||
@@ -3580,7 +3580,7 @@ SDL_GamepadBinding **SDL_GetGamepadBindings(SDL_Gamepad *gamepad, int *count)
|
||||
return bindings;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)
|
||||
bool SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)
|
||||
{
|
||||
SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad);
|
||||
|
||||
@@ -3590,7 +3590,7 @@ SDL_bool SDL_RumbleGamepad(SDL_Gamepad *gamepad, Uint16 low_frequency_rumble, Ui
|
||||
return SDL_RumbleJoystick(joystick, low_frequency_rumble, high_frequency_rumble, duration_ms);
|
||||
}
|
||||
|
||||
SDL_bool SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms)
|
||||
bool SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms)
|
||||
{
|
||||
SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad);
|
||||
|
||||
@@ -3600,7 +3600,7 @@ SDL_bool SDL_RumbleGamepadTriggers(SDL_Gamepad *gamepad, Uint16 left_rumble, Uin
|
||||
return SDL_RumbleJoystickTriggers(joystick, left_rumble, right_rumble, duration_ms);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue)
|
||||
bool SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 blue)
|
||||
{
|
||||
SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad);
|
||||
|
||||
@@ -3610,7 +3610,7 @@ SDL_bool SDL_SetGamepadLED(SDL_Gamepad *gamepad, Uint8 red, Uint8 green, Uint8 b
|
||||
return SDL_SetJoystickLED(joystick, red, green, blue);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const void *data, int size)
|
||||
bool SDL_SendGamepadEffect(SDL_Gamepad *gamepad, const void *data, int size)
|
||||
{
|
||||
SDL_Joystick *joystick = SDL_GetGamepadJoystick(gamepad);
|
||||
|
||||
@@ -3788,7 +3788,7 @@ static const Uint32 SDL_gamepad_event_list[] = {
|
||||
SDL_EVENT_GAMEPAD_SENSOR_UPDATE,
|
||||
};
|
||||
|
||||
void SDL_SetGamepadEventsEnabled(SDL_bool enabled)
|
||||
void SDL_SetGamepadEventsEnabled(bool enabled)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
@@ -3797,7 +3797,7 @@ void SDL_SetGamepadEventsEnabled(SDL_bool enabled)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_GamepadEventsEnabled(void)
|
||||
bool SDL_GamepadEventsEnabled(void)
|
||||
{
|
||||
bool enabled = false;
|
||||
unsigned int i;
|
||||
|
||||
+21
-21
@@ -696,7 +696,7 @@ bool SDL_JoystickHandledByAnotherDriver(struct SDL_JoystickDriver *driver, Uint1
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_HasJoystick(void)
|
||||
bool SDL_HasJoystick(void)
|
||||
{
|
||||
int i;
|
||||
int total_joysticks = 0;
|
||||
@@ -1127,7 +1127,7 @@ SDL_Joystick *SDL_OpenJoystick(SDL_JoystickID instance_id)
|
||||
joystick->hats = (Uint8 *)SDL_calloc(joystick->nhats, sizeof(*joystick->hats));
|
||||
}
|
||||
if (joystick->nbuttons > 0) {
|
||||
joystick->buttons = (SDL_bool *)SDL_calloc(joystick->nbuttons, sizeof(*joystick->buttons));
|
||||
joystick->buttons = (bool *)SDL_calloc(joystick->nbuttons, sizeof(*joystick->buttons));
|
||||
}
|
||||
if (((joystick->naxes > 0) && !joystick->axes) ||
|
||||
((joystick->nballs > 0) && !joystick->balls) ||
|
||||
@@ -1186,7 +1186,7 @@ SDL_JoystickID SDL_AttachVirtualJoystick(const SDL_VirtualJoystickDesc *desc)
|
||||
#endif
|
||||
}
|
||||
|
||||
SDL_bool SDL_DetachVirtualJoystick(SDL_JoystickID instance_id)
|
||||
bool SDL_DetachVirtualJoystick(SDL_JoystickID instance_id)
|
||||
{
|
||||
#ifdef SDL_JOYSTICK_VIRTUAL
|
||||
bool result;
|
||||
@@ -1200,7 +1200,7 @@ SDL_bool SDL_DetachVirtualJoystick(SDL_JoystickID instance_id)
|
||||
#endif
|
||||
}
|
||||
|
||||
SDL_bool SDL_IsJoystickVirtual(SDL_JoystickID instance_id)
|
||||
bool SDL_IsJoystickVirtual(SDL_JoystickID instance_id)
|
||||
{
|
||||
#ifdef SDL_JOYSTICK_VIRTUAL
|
||||
SDL_JoystickDriver *driver;
|
||||
@@ -1221,7 +1221,7 @@ SDL_bool SDL_IsJoystickVirtual(SDL_JoystickID instance_id)
|
||||
#endif
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value)
|
||||
bool SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 value)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -1240,7 +1240,7 @@ SDL_bool SDL_SetJoystickVirtualAxis(SDL_Joystick *joystick, int axis, Sint16 val
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xrel, Sint16 yrel)
|
||||
bool SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xrel, Sint16 yrel)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -1259,7 +1259,7 @@ SDL_bool SDL_SetJoystickVirtualBall(SDL_Joystick *joystick, int ball, Sint16 xre
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, SDL_bool down)
|
||||
bool SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, bool down)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -1278,7 +1278,7 @@ SDL_bool SDL_SetJoystickVirtualButton(SDL_Joystick *joystick, int button, SDL_bo
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value)
|
||||
bool SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -1297,7 +1297,7 @@ SDL_bool SDL_SetJoystickVirtualHat(SDL_Joystick *joystick, int hat, Uint8 value)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, int finger, SDL_bool down, float x, float y, float pressure)
|
||||
bool SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, int finger, bool down, float x, float y, float pressure)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -1316,7 +1316,7 @@ SDL_bool SDL_SetJoystickVirtualTouchpad(SDL_Joystick *joystick, int touchpad, in
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SendJoystickVirtualSensorData(SDL_Joystick *joystick, SDL_SensorType type, Uint64 sensor_timestamp, const float *data, int num_values)
|
||||
bool SDL_SendJoystickVirtualSensorData(SDL_Joystick *joystick, SDL_SensorType type, Uint64 sensor_timestamp, const float *data, int num_values)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -1449,7 +1449,7 @@ Sint16 SDL_GetJoystickAxis(SDL_Joystick *joystick, int axis)
|
||||
/*
|
||||
* Get the initial state of an axis control on a joystick
|
||||
*/
|
||||
SDL_bool SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state)
|
||||
bool SDL_GetJoystickAxisInitialState(SDL_Joystick *joystick, int axis, Sint16 *state)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -1498,7 +1498,7 @@ Uint8 SDL_GetJoystickHat(SDL_Joystick *joystick, int hat)
|
||||
/*
|
||||
* Get the ball axis change since the last poll
|
||||
*/
|
||||
SDL_bool SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy)
|
||||
bool SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -1528,7 +1528,7 @@ SDL_bool SDL_GetJoystickBall(SDL_Joystick *joystick, int ball, int *dx, int *dy)
|
||||
/*
|
||||
* Get the current state of a button on a joystick
|
||||
*/
|
||||
SDL_bool SDL_GetJoystickButton(SDL_Joystick *joystick, int button)
|
||||
bool SDL_GetJoystickButton(SDL_Joystick *joystick, int button)
|
||||
{
|
||||
bool down = false;
|
||||
|
||||
@@ -1551,7 +1551,7 @@ SDL_bool SDL_GetJoystickButton(SDL_Joystick *joystick, int button)
|
||||
* Return if the joystick in question is currently attached to the system,
|
||||
* \return false if not plugged in, true if still present.
|
||||
*/
|
||||
SDL_bool SDL_JoystickConnected(SDL_Joystick *joystick)
|
||||
bool SDL_JoystickConnected(SDL_Joystick *joystick)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -1709,7 +1709,7 @@ int SDL_GetJoystickPlayerIndex(SDL_Joystick *joystick)
|
||||
/**
|
||||
* Set the player index of an opened joystick
|
||||
*/
|
||||
SDL_bool SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index)
|
||||
bool SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -1724,7 +1724,7 @@ SDL_bool SDL_SetJoystickPlayerIndex(SDL_Joystick *joystick, int player_index)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)
|
||||
bool SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble, Uint16 high_frequency_rumble, Uint32 duration_ms)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -1768,7 +1768,7 @@ SDL_bool SDL_RumbleJoystick(SDL_Joystick *joystick, Uint16 low_frequency_rumble,
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms)
|
||||
bool SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble, Uint16 right_rumble, Uint32 duration_ms)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -1799,7 +1799,7 @@ SDL_bool SDL_RumbleJoystickTriggers(SDL_Joystick *joystick, Uint16 left_rumble,
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue)
|
||||
bool SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint8 blue)
|
||||
{
|
||||
bool result;
|
||||
bool isfreshvalue;
|
||||
@@ -1830,7 +1830,7 @@ SDL_bool SDL_SetJoystickLED(SDL_Joystick *joystick, Uint8 red, Uint8 green, Uint
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size)
|
||||
bool SDL_SendJoystickEffect(SDL_Joystick *joystick, const void *data, int size)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -2463,7 +2463,7 @@ static const Uint32 SDL_joystick_event_list[] = {
|
||||
SDL_EVENT_JOYSTICK_BATTERY_UPDATED
|
||||
};
|
||||
|
||||
void SDL_SetJoystickEventsEnabled(SDL_bool enabled)
|
||||
void SDL_SetJoystickEventsEnabled(bool enabled)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
@@ -2472,7 +2472,7 @@ void SDL_SetJoystickEventsEnabled(SDL_bool enabled)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_JoystickEventsEnabled(void)
|
||||
bool SDL_JoystickEventsEnabled(void)
|
||||
{
|
||||
bool enabled = false;
|
||||
unsigned int i;
|
||||
|
||||
@@ -250,7 +250,7 @@ SDL_JoystickID SDL_JoystickAttachVirtualInner(const SDL_VirtualJoystickDesc *des
|
||||
}
|
||||
}
|
||||
if (hwdata->desc.nbuttons > 0) {
|
||||
hwdata->buttons = (SDL_bool *)SDL_calloc(hwdata->desc.nbuttons, sizeof(*hwdata->buttons));
|
||||
hwdata->buttons = (bool *)SDL_calloc(hwdata->desc.nbuttons, sizeof(*hwdata->buttons));
|
||||
if (!hwdata->buttons) {
|
||||
VIRTUAL_FreeHWData(hwdata);
|
||||
return 0;
|
||||
|
||||
@@ -69,7 +69,7 @@ static void SDL_DispatchMainCallbackEvents(void)
|
||||
}
|
||||
}
|
||||
|
||||
static SDL_bool SDLCALL SDL_MainCallbackEventWatcher(void *userdata, SDL_Event *event)
|
||||
static bool SDLCALL SDL_MainCallbackEventWatcher(void *userdata, SDL_Event *event)
|
||||
{
|
||||
if (ShouldDispatchImmediately(event)) {
|
||||
// Make sure any currently queued events are processed then dispatch this before continuing
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "SDL_sysurl.h"
|
||||
|
||||
SDL_bool SDL_OpenURL(const char *url)
|
||||
bool SDL_OpenURL(const char *url)
|
||||
{
|
||||
if (!url) {
|
||||
return SDL_InvalidParamError("url");
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "SDL_sysprocess.h"
|
||||
|
||||
|
||||
SDL_Process *SDL_CreateProcess(const char * const *args, SDL_bool pipe_stdio)
|
||||
SDL_Process *SDL_CreateProcess(const char * const *args, bool pipe_stdio)
|
||||
{
|
||||
if (!args || !args[0] || !args[0][0]) {
|
||||
SDL_InvalidParamError("args");
|
||||
@@ -140,7 +140,7 @@ SDL_IOStream *SDL_GetProcessOutput(SDL_Process *process)
|
||||
return io;
|
||||
}
|
||||
|
||||
SDL_bool SDL_KillProcess(SDL_Process *process, SDL_bool force)
|
||||
bool SDL_KillProcess(SDL_Process *process, bool force)
|
||||
{
|
||||
if (!process) {
|
||||
return SDL_InvalidParamError("process");
|
||||
@@ -153,7 +153,7 @@ SDL_bool SDL_KillProcess(SDL_Process *process, SDL_bool force)
|
||||
return SDL_SYS_KillProcess(process, force);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WaitProcess(SDL_Process *process, SDL_bool block, int *exitcode)
|
||||
bool SDL_WaitProcess(SDL_Process *process, bool block, int *exitcode)
|
||||
{
|
||||
if (!process) {
|
||||
return SDL_InvalidParamError("process");
|
||||
|
||||
@@ -32,6 +32,6 @@ struct SDL_Process
|
||||
};
|
||||
|
||||
bool SDL_SYS_CreateProcessWithProperties(SDL_Process *process, SDL_PropertiesID props);
|
||||
bool SDL_SYS_KillProcess(SDL_Process *process, SDL_bool force);
|
||||
bool SDL_SYS_WaitProcess(SDL_Process *process, SDL_bool block, int *exitcode);
|
||||
bool SDL_SYS_KillProcess(SDL_Process *process, bool force);
|
||||
bool SDL_SYS_WaitProcess(SDL_Process *process, bool block, int *exitcode);
|
||||
void SDL_SYS_DestroyProcess(SDL_Process *process);
|
||||
@@ -30,12 +30,12 @@ bool SDL_SYS_CreateProcessWithProperties(SDL_Process *process, SDL_PropertiesID
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
bool SDL_SYS_KillProcess(SDL_Process *process, SDL_bool force)
|
||||
bool SDL_SYS_KillProcess(SDL_Process *process, bool force)
|
||||
{
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
bool SDL_SYS_WaitProcess(SDL_Process *process, SDL_bool block, int *exitcode)
|
||||
bool SDL_SYS_WaitProcess(SDL_Process *process, bool block, int *exitcode)
|
||||
{
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
@@ -441,7 +441,7 @@ posix_spawn_fail_none:
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SDL_SYS_KillProcess(SDL_Process *process, SDL_bool force)
|
||||
bool SDL_SYS_KillProcess(SDL_Process *process, bool force)
|
||||
{
|
||||
int ret = kill(process->internal->pid, force ? SIGKILL : SIGTERM);
|
||||
if (ret == 0) {
|
||||
@@ -451,7 +451,7 @@ bool SDL_SYS_KillProcess(SDL_Process *process, SDL_bool force)
|
||||
}
|
||||
}
|
||||
|
||||
bool SDL_SYS_WaitProcess(SDL_Process *process, SDL_bool block, int *exitcode)
|
||||
bool SDL_SYS_WaitProcess(SDL_Process *process, bool block, int *exitcode)
|
||||
{
|
||||
int wstatus = 0;
|
||||
int ret;
|
||||
|
||||
@@ -441,7 +441,7 @@ done:
|
||||
return result;
|
||||
}
|
||||
|
||||
bool SDL_SYS_KillProcess(SDL_Process *process, SDL_bool force)
|
||||
bool SDL_SYS_KillProcess(SDL_Process *process, bool force)
|
||||
{
|
||||
if (!TerminateProcess(process->internal->process_information.hProcess, 1)) {
|
||||
return WIN_SetError("TerminateProcess failed");
|
||||
@@ -449,7 +449,7 @@ bool SDL_SYS_KillProcess(SDL_Process *process, SDL_bool force)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SDL_SYS_WaitProcess(SDL_Process *process, SDL_bool block, int *exitcode)
|
||||
bool SDL_SYS_WaitProcess(SDL_Process *process, bool block, int *exitcode)
|
||||
{
|
||||
DWORD result;
|
||||
|
||||
|
||||
+66
-66
@@ -343,7 +343,7 @@ static bool FlushRenderCommandsIfTextureNeeded(SDL_Texture *texture)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_FlushRenderer(SDL_Renderer *renderer)
|
||||
bool SDL_FlushRenderer(SDL_Renderer *renderer)
|
||||
{
|
||||
if (!FlushRenderCommands(renderer)) {
|
||||
return false;
|
||||
@@ -821,7 +821,7 @@ const char *SDL_GetRenderDriver(int index)
|
||||
#endif
|
||||
}
|
||||
|
||||
static SDL_bool SDLCALL SDL_RendererEventWatch(void *userdata, SDL_Event *event)
|
||||
static bool SDLCALL SDL_RendererEventWatch(void *userdata, SDL_Event *event)
|
||||
{
|
||||
SDL_Renderer *renderer = (SDL_Renderer *)userdata;
|
||||
|
||||
@@ -861,7 +861,7 @@ static SDL_bool SDLCALL SDL_RendererEventWatch(void *userdata, SDL_Event *event)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer)
|
||||
bool SDL_CreateWindowAndRenderer(const char *title, int width, int height, SDL_WindowFlags window_flags, SDL_Window **window, SDL_Renderer **renderer)
|
||||
{
|
||||
bool hidden = (window_flags & SDL_WINDOW_HIDDEN) != 0;
|
||||
|
||||
@@ -1219,7 +1219,7 @@ SDL_PropertiesID SDL_GetRendererProperties(SDL_Renderer *renderer)
|
||||
return renderer->props;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h)
|
||||
bool SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h)
|
||||
{
|
||||
if (w) {
|
||||
*w = 0;
|
||||
@@ -1240,7 +1240,7 @@ SDL_bool SDL_GetRenderOutputSize(SDL_Renderer *renderer, int *w, int *h)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h)
|
||||
bool SDL_GetCurrentRenderOutputSize(SDL_Renderer *renderer, int *w, int *h)
|
||||
{
|
||||
if (w) {
|
||||
*w = 0;
|
||||
@@ -1753,7 +1753,7 @@ SDL_PropertiesID SDL_GetTextureProperties(SDL_Texture *texture)
|
||||
return texture->props;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetTextureSize(SDL_Texture *texture, float *w, float *h)
|
||||
bool SDL_GetTextureSize(SDL_Texture *texture, float *w, float *h)
|
||||
{
|
||||
if (w) {
|
||||
*w = 0;
|
||||
@@ -1773,7 +1773,7 @@ SDL_bool SDL_GetTextureSize(SDL_Texture *texture, float *w, float *h)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b)
|
||||
bool SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b)
|
||||
{
|
||||
const float fR = (float)r / 255.0f;
|
||||
const float fG = (float)g / 255.0f;
|
||||
@@ -1782,7 +1782,7 @@ SDL_bool SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b)
|
||||
return SDL_SetTextureColorModFloat(texture, fR, fG, fB);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b)
|
||||
bool SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, float b)
|
||||
{
|
||||
CHECK_TEXTURE_MAGIC(texture, false);
|
||||
|
||||
@@ -1795,7 +1795,7 @@ SDL_bool SDL_SetTextureColorModFloat(SDL_Texture *texture, float r, float g, flo
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b)
|
||||
bool SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b)
|
||||
{
|
||||
float fR = 1.0f, fG = 1.0f, fB = 1.0f;
|
||||
|
||||
@@ -1824,7 +1824,7 @@ SDL_bool SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b)
|
||||
bool SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, float *b)
|
||||
{
|
||||
SDL_FColor color;
|
||||
|
||||
@@ -1854,14 +1854,14 @@ SDL_bool SDL_GetTextureColorModFloat(SDL_Texture *texture, float *r, float *g, f
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha)
|
||||
bool SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha)
|
||||
{
|
||||
const float fA = (float)alpha / 255.0f;
|
||||
|
||||
return SDL_SetTextureAlphaModFloat(texture, fA);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha)
|
||||
bool SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha)
|
||||
{
|
||||
CHECK_TEXTURE_MAGIC(texture, false);
|
||||
|
||||
@@ -1872,7 +1872,7 @@ SDL_bool SDL_SetTextureAlphaModFloat(SDL_Texture *texture, float alpha)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha)
|
||||
bool SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha)
|
||||
{
|
||||
float fA = 1.0f;
|
||||
|
||||
@@ -1889,7 +1889,7 @@ SDL_bool SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha)
|
||||
bool SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha)
|
||||
{
|
||||
if (alpha) {
|
||||
*alpha = 1.0f;
|
||||
@@ -1903,7 +1903,7 @@ SDL_bool SDL_GetTextureAlphaModFloat(SDL_Texture *texture, float *alpha)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode)
|
||||
bool SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode)
|
||||
{
|
||||
SDL_Renderer *renderer;
|
||||
|
||||
@@ -1924,7 +1924,7 @@ SDL_bool SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode)
|
||||
bool SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode)
|
||||
{
|
||||
if (blendMode) {
|
||||
*blendMode = SDL_BLENDMODE_INVALID;
|
||||
@@ -1938,7 +1938,7 @@ SDL_bool SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode)
|
||||
bool SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode)
|
||||
{
|
||||
SDL_Renderer *renderer;
|
||||
|
||||
@@ -1959,7 +1959,7 @@ SDL_bool SDL_SetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode scaleMode)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode)
|
||||
bool SDL_GetTextureScaleMode(SDL_Texture *texture, SDL_ScaleMode *scaleMode)
|
||||
{
|
||||
if (scaleMode) {
|
||||
*scaleMode = SDL_SCALEMODE_LINEAR;
|
||||
@@ -2060,7 +2060,7 @@ static bool SDL_UpdateTextureNative(SDL_Texture *texture, const SDL_Rect *rect,
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch)
|
||||
bool SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch)
|
||||
{
|
||||
SDL_Rect real_rect;
|
||||
|
||||
@@ -2204,7 +2204,7 @@ static bool SDL_UpdateTextureNVPlanar(SDL_Texture *texture, const SDL_Rect *rect
|
||||
|
||||
#endif // SDL_HAVE_YUV
|
||||
|
||||
SDL_bool SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect,
|
||||
bool SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect,
|
||||
const Uint8 *Yplane, int Ypitch,
|
||||
const Uint8 *Uplane, int Upitch,
|
||||
const Uint8 *Vplane, int Vpitch)
|
||||
@@ -2271,7 +2271,7 @@ SDL_bool SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect,
|
||||
#endif
|
||||
}
|
||||
|
||||
SDL_bool SDL_UpdateNVTexture(SDL_Texture *texture, const SDL_Rect *rect,
|
||||
bool SDL_UpdateNVTexture(SDL_Texture *texture, const SDL_Rect *rect,
|
||||
const Uint8 *Yplane, int Ypitch,
|
||||
const Uint8 *UVplane, int UVpitch)
|
||||
{
|
||||
@@ -2350,7 +2350,7 @@ static bool SDL_LockTextureNative(SDL_Texture *texture, const SDL_Rect *rect,
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch)
|
||||
bool SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch)
|
||||
{
|
||||
SDL_Rect full_rect;
|
||||
|
||||
@@ -2388,7 +2388,7 @@ SDL_bool SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixe
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface)
|
||||
bool SDL_LockTextureToSurface(SDL_Texture *texture, const SDL_Rect *rect, SDL_Surface **surface)
|
||||
{
|
||||
SDL_Rect real_rect;
|
||||
void *pixels = NULL;
|
||||
@@ -2537,7 +2537,7 @@ static bool SDL_SetRenderTargetInternal(SDL_Renderer *renderer, SDL_Texture *tex
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
|
||||
bool SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
|
||||
{
|
||||
if (!texture && renderer->logical_target) {
|
||||
return SDL_SetRenderTargetInternal(renderer, renderer->logical_target);
|
||||
@@ -2659,7 +2659,7 @@ error:
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode)
|
||||
bool SDL_SetRenderLogicalPresentation(SDL_Renderer *renderer, int w, int h, SDL_RendererLogicalPresentation mode, SDL_ScaleMode scale_mode)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, false);
|
||||
|
||||
@@ -2700,7 +2700,7 @@ error:
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode)
|
||||
bool SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h, SDL_RendererLogicalPresentation *mode, SDL_ScaleMode *scale_mode)
|
||||
{
|
||||
if (w) {
|
||||
*w = 0;
|
||||
@@ -2741,7 +2741,7 @@ SDL_bool SDL_GetRenderLogicalPresentation(SDL_Renderer *renderer, int *w, int *h
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect)
|
||||
bool SDL_GetRenderLogicalPresentationRect(SDL_Renderer *renderer, SDL_FRect *rect)
|
||||
{
|
||||
if (rect) {
|
||||
SDL_zerop(rect);
|
||||
@@ -2822,7 +2822,7 @@ static void SDL_RenderLogicalPresentation(SDL_Renderer *renderer)
|
||||
SDL_RenderTexture(renderer, renderer->logical_target, &renderer->logical_src_rect, &renderer->logical_dst_rect);
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y)
|
||||
bool SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x, float window_y, float *x, float *y)
|
||||
{
|
||||
SDL_RenderViewState *view;
|
||||
float render_x, render_y;
|
||||
@@ -2859,7 +2859,7 @@ SDL_bool SDL_RenderCoordinatesFromWindow(SDL_Renderer *renderer, float window_x,
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y)
|
||||
bool SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y, float *window_x, float *window_y)
|
||||
{
|
||||
SDL_RenderViewState *view;
|
||||
|
||||
@@ -2895,7 +2895,7 @@ SDL_bool SDL_RenderCoordinatesToWindow(SDL_Renderer *renderer, float x, float y,
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event)
|
||||
bool SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *event)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, false);
|
||||
|
||||
@@ -2988,7 +2988,7 @@ SDL_bool SDL_ConvertEventToRenderCoordinates(SDL_Renderer *renderer, SDL_Event *
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect)
|
||||
bool SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, false);
|
||||
|
||||
@@ -3005,7 +3005,7 @@ SDL_bool SDL_SetRenderViewport(SDL_Renderer *renderer, const SDL_Rect *rect)
|
||||
return QueueCmdSetViewport(renderer);
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect)
|
||||
bool SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect)
|
||||
{
|
||||
if (rect) {
|
||||
SDL_zerop(rect);
|
||||
@@ -3030,7 +3030,7 @@ SDL_bool SDL_GetRenderViewport(SDL_Renderer *renderer, SDL_Rect *rect)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderViewportSet(SDL_Renderer *renderer)
|
||||
bool SDL_RenderViewportSet(SDL_Renderer *renderer)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, false);
|
||||
|
||||
@@ -3057,7 +3057,7 @@ static void GetRenderViewportSize(SDL_Renderer *renderer, SDL_FRect *rect)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect)
|
||||
bool SDL_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect)
|
||||
{
|
||||
if (rect) {
|
||||
SDL_zerop(rect);
|
||||
@@ -3104,7 +3104,7 @@ SDL_bool SDL_GetRenderSafeArea(SDL_Renderer *renderer, SDL_Rect *rect)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect)
|
||||
bool SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, false)
|
||||
|
||||
@@ -3120,7 +3120,7 @@ SDL_bool SDL_SetRenderClipRect(SDL_Renderer *renderer, const SDL_Rect *rect)
|
||||
return QueueCmdSetClipRect(renderer);
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect)
|
||||
bool SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect)
|
||||
{
|
||||
if (rect) {
|
||||
SDL_zerop(rect);
|
||||
@@ -3134,13 +3134,13 @@ SDL_bool SDL_GetRenderClipRect(SDL_Renderer *renderer, SDL_Rect *rect)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderClipEnabled(SDL_Renderer *renderer)
|
||||
bool SDL_RenderClipEnabled(SDL_Renderer *renderer)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, false)
|
||||
return renderer->view->clipping_enabled;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY)
|
||||
bool SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
@@ -3162,7 +3162,7 @@ SDL_bool SDL_SetRenderScale(SDL_Renderer *renderer, float scaleX, float scaleY)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY)
|
||||
bool SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY)
|
||||
{
|
||||
if (scaleX) {
|
||||
*scaleX = 1.0f;
|
||||
@@ -3182,7 +3182,7 @@ SDL_bool SDL_GetRenderScale(SDL_Renderer *renderer, float *scaleX, float *scaleY
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
|
||||
bool SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
|
||||
{
|
||||
const float fR = (float)r / 255.0f;
|
||||
const float fG = (float)g / 255.0f;
|
||||
@@ -3192,7 +3192,7 @@ SDL_bool SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8
|
||||
return SDL_SetRenderDrawColorFloat(renderer, fR, fG, fB, fA);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a)
|
||||
bool SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, float b, float a)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, false);
|
||||
|
||||
@@ -3203,7 +3203,7 @@ SDL_bool SDL_SetRenderDrawColorFloat(SDL_Renderer *renderer, float r, float g, f
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
|
||||
bool SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
|
||||
{
|
||||
float fR, fG, fB, fA;
|
||||
|
||||
@@ -3238,7 +3238,7 @@ SDL_bool SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a)
|
||||
bool SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g, float *b, float *a)
|
||||
{
|
||||
SDL_FColor color;
|
||||
|
||||
@@ -3274,7 +3274,7 @@ SDL_bool SDL_GetRenderDrawColorFloat(SDL_Renderer *renderer, float *r, float *g,
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale)
|
||||
bool SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, false);
|
||||
|
||||
@@ -3283,7 +3283,7 @@ SDL_bool SDL_SetRenderColorScale(SDL_Renderer *renderer, float scale)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale)
|
||||
bool SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale)
|
||||
{
|
||||
if (scale) {
|
||||
*scale = 1.0f;
|
||||
@@ -3297,7 +3297,7 @@ SDL_bool SDL_GetRenderColorScale(SDL_Renderer *renderer, float *scale)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode)
|
||||
bool SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, false);
|
||||
|
||||
@@ -3317,7 +3317,7 @@ SDL_bool SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendM
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode)
|
||||
bool SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode)
|
||||
{
|
||||
if (blendMode) {
|
||||
*blendMode = SDL_BLENDMODE_INVALID;
|
||||
@@ -3331,14 +3331,14 @@ SDL_bool SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blend
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderClear(SDL_Renderer *renderer)
|
||||
bool SDL_RenderClear(SDL_Renderer *renderer)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, false);
|
||||
|
||||
return QueueCmdClear(renderer);
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderPoint(SDL_Renderer *renderer, float x, float y)
|
||||
bool SDL_RenderPoint(SDL_Renderer *renderer, float x, float y)
|
||||
{
|
||||
SDL_FPoint fpoint;
|
||||
fpoint.x = x;
|
||||
@@ -3376,7 +3376,7 @@ static bool RenderPointsWithRects(SDL_Renderer *renderer, const SDL_FPoint *fpoi
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
|
||||
bool SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
|
||||
{
|
||||
bool result;
|
||||
|
||||
@@ -3404,7 +3404,7 @@ SDL_bool SDL_RenderPoints(SDL_Renderer *renderer, const SDL_FPoint *points, int
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2)
|
||||
bool SDL_RenderLine(SDL_Renderer *renderer, float x1, float y1, float x2, float y2)
|
||||
{
|
||||
SDL_FPoint points[2];
|
||||
points[0].x = x1;
|
||||
@@ -3580,7 +3580,7 @@ static bool RenderLinesWithRectsF(SDL_Renderer *renderer,
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
|
||||
bool SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
@@ -3731,7 +3731,7 @@ SDL_bool SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int c
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect)
|
||||
bool SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect)
|
||||
{
|
||||
SDL_FRect frect;
|
||||
SDL_FPoint points[5];
|
||||
@@ -3757,7 +3757,7 @@ SDL_bool SDL_RenderRect(SDL_Renderer *renderer, const SDL_FRect *rect)
|
||||
return SDL_RenderLines(renderer, points, 5);
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count)
|
||||
bool SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -3785,7 +3785,7 @@ SDL_bool SDL_RenderRects(SDL_Renderer *renderer, const SDL_FRect *rects, int cou
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect)
|
||||
bool SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect)
|
||||
{
|
||||
SDL_FRect frect;
|
||||
|
||||
@@ -3799,7 +3799,7 @@ SDL_bool SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_FRect *rect)
|
||||
return SDL_RenderFillRects(renderer, rect, 1);
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count)
|
||||
bool SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_FRect *rects, int count)
|
||||
{
|
||||
SDL_FRect *frects;
|
||||
int i;
|
||||
@@ -3904,7 +3904,7 @@ static bool SDL_RenderTextureInternal(SDL_Renderer *renderer, SDL_Texture *textu
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect)
|
||||
bool SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, const SDL_FRect *dstrect)
|
||||
{
|
||||
SDL_FRect real_srcrect;
|
||||
SDL_FRect real_dstrect;
|
||||
@@ -3950,7 +3950,7 @@ SDL_bool SDL_RenderTexture(SDL_Renderer *renderer, SDL_Texture *texture, const S
|
||||
return SDL_RenderTextureInternal(renderer, texture, &real_srcrect, &real_dstrect);
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture,
|
||||
bool SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture,
|
||||
const SDL_FRect *srcrect, const SDL_FRect *dstrect,
|
||||
const double angle, const SDL_FPoint *center, const SDL_FlipMode flip)
|
||||
{
|
||||
@@ -4213,7 +4213,7 @@ static bool SDL_RenderTextureTiled_Iterate(SDL_Renderer *renderer, SDL_Texture *
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect)
|
||||
bool SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float scale, const SDL_FRect *dstrect)
|
||||
{
|
||||
SDL_FRect real_srcrect;
|
||||
SDL_FRect real_dstrect;
|
||||
@@ -4271,7 +4271,7 @@ SDL_bool SDL_RenderTextureTiled(SDL_Renderer *renderer, SDL_Texture *texture, co
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect)
|
||||
bool SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_FRect *srcrect, float left_width, float right_width, float top_height, float bottom_height, float scale, const SDL_FRect *dstrect)
|
||||
{
|
||||
SDL_FRect full_src, full_dst;
|
||||
SDL_FRect curr_src, curr_dst;
|
||||
@@ -4406,7 +4406,7 @@ SDL_bool SDL_RenderTexture9Grid(SDL_Renderer *renderer, SDL_Texture *texture, co
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderGeometry(SDL_Renderer *renderer,
|
||||
bool SDL_RenderGeometry(SDL_Renderer *renderer,
|
||||
SDL_Texture *texture,
|
||||
const SDL_Vertex *vertices, int num_vertices,
|
||||
const int *indices, int num_indices)
|
||||
@@ -4796,7 +4796,7 @@ end:
|
||||
}
|
||||
#endif // SDL_VIDEO_RENDER_SW
|
||||
|
||||
SDL_bool SDL_RenderGeometryRaw(SDL_Renderer *renderer,
|
||||
bool SDL_RenderGeometryRaw(SDL_Renderer *renderer,
|
||||
SDL_Texture *texture,
|
||||
const float *xy, int xy_stride,
|
||||
const SDL_FColor *color, int color_stride,
|
||||
@@ -5002,7 +5002,7 @@ static void SDL_SimulateRenderVSync(SDL_Renderer *renderer)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenderPresent(SDL_Renderer *renderer)
|
||||
bool SDL_RenderPresent(SDL_Renderer *renderer)
|
||||
{
|
||||
bool presented = true;
|
||||
|
||||
@@ -5227,7 +5227,7 @@ void *SDL_GetRenderMetalCommandEncoder(SDL_Renderer *renderer)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SDL_bool SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore)
|
||||
bool SDL_AddVulkanRenderSemaphores(SDL_Renderer *renderer, Uint32 wait_stage_mask, Sint64 wait_semaphore, Sint64 signal_semaphore)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, false);
|
||||
|
||||
@@ -5335,7 +5335,7 @@ SDL_BlendOperation SDL_GetBlendModeAlphaOperation(SDL_BlendMode blendMode)
|
||||
return (SDL_BlendOperation)(((Uint32)blendMode >> 16) & 0xF);
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync)
|
||||
bool SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, false);
|
||||
|
||||
@@ -5380,7 +5380,7 @@ SDL_bool SDL_SetRenderVSync(SDL_Renderer *renderer, int vsync)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync)
|
||||
bool SDL_GetRenderVSync(SDL_Renderer *renderer, int *vsync)
|
||||
{
|
||||
if (vsync) {
|
||||
*vsync = 0;
|
||||
|
||||
@@ -119,7 +119,7 @@ static SDL_GPUGraphicsPipeline *MakePipeline(SDL_GPUDevice *device, GPU_Shaders
|
||||
pci.vertex_shader = GPU_GetVertexShader(shaders, params->vert_shader);
|
||||
pci.fragment_shader = GPU_GetFragmentShader(shaders, params->frag_shader);
|
||||
pci.multisample_state.sample_count = SDL_GPU_SAMPLECOUNT_1;
|
||||
pci.multisample_state.enable_mask = SDL_FALSE;
|
||||
pci.multisample_state.enable_mask = false;
|
||||
pci.primitive_type = params->primitive_type;
|
||||
|
||||
pci.rasterizer_state.cull_mode = SDL_GPU_CULLMODE_NONE;
|
||||
|
||||
@@ -472,7 +472,7 @@ SDL_SensorID SDL_GetSensorID(SDL_Sensor *sensor)
|
||||
/*
|
||||
* Get the current state of this sensor
|
||||
*/
|
||||
SDL_bool SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values)
|
||||
bool SDL_GetSensorData(SDL_Sensor *sensor, float *data, int num_values)
|
||||
{
|
||||
SDL_LockSensors();
|
||||
{
|
||||
|
||||
@@ -66,7 +66,7 @@ SDL_Environment *SDL_GetEnvironment(void)
|
||||
return SDL_environment;
|
||||
}
|
||||
|
||||
SDL_bool SDL_InitEnvironment(void)
|
||||
bool SDL_InitEnvironment(void)
|
||||
{
|
||||
return (SDL_GetEnvironment() != NULL);
|
||||
}
|
||||
@@ -81,7 +81,7 @@ void SDL_QuitEnvironment(void)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_Environment *SDL_CreateEnvironment(SDL_bool populated)
|
||||
SDL_Environment *SDL_CreateEnvironment(bool populated)
|
||||
{
|
||||
SDL_Environment *env = SDL_calloc(1, sizeof(*env));
|
||||
if (!env) {
|
||||
@@ -221,7 +221,7 @@ char **SDL_GetEnvironmentVariables(SDL_Environment *env)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, const char *value, SDL_bool overwrite)
|
||||
bool SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, const char *value, bool overwrite)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@@ -263,7 +263,7 @@ SDL_bool SDL_SetEnvironmentVariable(SDL_Environment *env, const char *name, cons
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_UnsetEnvironmentVariable(SDL_Environment *env, const char *name)
|
||||
bool SDL_UnsetEnvironmentVariable(SDL_Environment *env, const char *name)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
|
||||
@@ -6390,7 +6390,7 @@ void SDL_GetMemoryFunctions(SDL_malloc_func *malloc_func,
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
|
||||
bool SDL_SetMemoryFunctions(SDL_malloc_func malloc_func,
|
||||
SDL_calloc_func calloc_func,
|
||||
SDL_realloc_func realloc_func,
|
||||
SDL_free_func free_func)
|
||||
|
||||
+13
-13
@@ -167,7 +167,7 @@ SDL_Storage *SDL_OpenStorage(const SDL_StorageInterface *iface, void *userdata)
|
||||
return storage;
|
||||
}
|
||||
|
||||
SDL_bool SDL_CloseStorage(SDL_Storage *storage)
|
||||
bool SDL_CloseStorage(SDL_Storage *storage)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
@@ -180,7 +180,7 @@ SDL_bool SDL_CloseStorage(SDL_Storage *storage)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_StorageReady(SDL_Storage *storage)
|
||||
bool SDL_StorageReady(SDL_Storage *storage)
|
||||
{
|
||||
CHECK_STORAGE_MAGIC_RET(false)
|
||||
|
||||
@@ -190,7 +190,7 @@ SDL_bool SDL_StorageReady(SDL_Storage *storage)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length)
|
||||
bool SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *length)
|
||||
{
|
||||
SDL_PathInfo info;
|
||||
|
||||
@@ -207,7 +207,7 @@ SDL_bool SDL_GetStorageFileSize(SDL_Storage *storage, const char *path, Uint64 *
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length)
|
||||
bool SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *destination, Uint64 length)
|
||||
{
|
||||
CHECK_STORAGE_MAGIC()
|
||||
|
||||
@@ -222,7 +222,7 @@ SDL_bool SDL_ReadStorageFile(SDL_Storage *storage, const char *path, void *desti
|
||||
return storage->iface.read_file(storage->userdata, path, destination, length);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length)
|
||||
bool SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void *source, Uint64 length)
|
||||
{
|
||||
CHECK_STORAGE_MAGIC()
|
||||
|
||||
@@ -237,7 +237,7 @@ SDL_bool SDL_WriteStorageFile(SDL_Storage *storage, const char *path, const void
|
||||
return storage->iface.write_file(storage->userdata, path, source, length);
|
||||
}
|
||||
|
||||
SDL_bool SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path)
|
||||
bool SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path)
|
||||
{
|
||||
CHECK_STORAGE_MAGIC()
|
||||
|
||||
@@ -252,7 +252,7 @@ SDL_bool SDL_CreateStorageDirectory(SDL_Storage *storage, const char *path)
|
||||
return storage->iface.mkdir(storage->userdata, path);
|
||||
}
|
||||
|
||||
SDL_bool SDL_EnumerateStorageDirectory(SDL_Storage *storage, const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata)
|
||||
bool SDL_EnumerateStorageDirectory(SDL_Storage *storage, const char *path, SDL_EnumerateDirectoryCallback callback, void *userdata)
|
||||
{
|
||||
CHECK_STORAGE_MAGIC()
|
||||
|
||||
@@ -267,7 +267,7 @@ SDL_bool SDL_EnumerateStorageDirectory(SDL_Storage *storage, const char *path, S
|
||||
return storage->iface.enumerate(storage->userdata, path, callback, userdata);
|
||||
}
|
||||
|
||||
SDL_bool SDL_RemoveStoragePath(SDL_Storage *storage, const char *path)
|
||||
bool SDL_RemoveStoragePath(SDL_Storage *storage, const char *path)
|
||||
{
|
||||
CHECK_STORAGE_MAGIC()
|
||||
|
||||
@@ -282,7 +282,7 @@ SDL_bool SDL_RemoveStoragePath(SDL_Storage *storage, const char *path)
|
||||
return storage->iface.remove(storage->userdata, path);
|
||||
}
|
||||
|
||||
SDL_bool SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath)
|
||||
bool SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const char *newpath)
|
||||
{
|
||||
CHECK_STORAGE_MAGIC()
|
||||
|
||||
@@ -300,7 +300,7 @@ SDL_bool SDL_RenameStoragePath(SDL_Storage *storage, const char *oldpath, const
|
||||
return storage->iface.rename(storage->userdata, oldpath, newpath);
|
||||
}
|
||||
|
||||
SDL_bool SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const char *newpath)
|
||||
bool SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const char *newpath)
|
||||
{
|
||||
CHECK_STORAGE_MAGIC()
|
||||
|
||||
@@ -318,7 +318,7 @@ SDL_bool SDL_CopyStorageFile(SDL_Storage *storage, const char *oldpath, const ch
|
||||
return storage->iface.copy(storage->userdata, oldpath, newpath);
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info)
|
||||
bool SDL_GetStoragePathInfo(SDL_Storage *storage, const char *path, SDL_PathInfo *info)
|
||||
{
|
||||
SDL_PathInfo dummy;
|
||||
|
||||
@@ -352,12 +352,12 @@ Uint64 SDL_GetStorageSpaceRemaining(SDL_Storage *storage)
|
||||
return storage->iface.space_remaining(storage->userdata);
|
||||
}
|
||||
|
||||
static SDL_bool GlobStorageDirectoryGetPathInfo(const char *path, SDL_PathInfo *info, void *userdata)
|
||||
static bool GlobStorageDirectoryGetPathInfo(const char *path, SDL_PathInfo *info, void *userdata)
|
||||
{
|
||||
return SDL_GetStoragePathInfo((SDL_Storage *) userdata, path, info);
|
||||
}
|
||||
|
||||
static SDL_bool GlobStorageDirectoryEnumerator(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata)
|
||||
static bool GlobStorageDirectoryEnumerator(const char *path, SDL_EnumerateDirectoryCallback cb, void *cbuserdata, void *userdata)
|
||||
{
|
||||
return SDL_EnumerateStorageDirectory((SDL_Storage *) userdata, path, cb, cbuserdata);
|
||||
}
|
||||
|
||||
@@ -38,13 +38,13 @@ static char *GENERIC_INTERNAL_CreateFullPath(const char *base, const char *relat
|
||||
return result;
|
||||
}
|
||||
|
||||
static SDL_bool GENERIC_CloseStorage(void *userdata)
|
||||
static bool GENERIC_CloseStorage(void *userdata)
|
||||
{
|
||||
SDL_free(userdata);
|
||||
return true;
|
||||
}
|
||||
|
||||
static SDL_bool GENERIC_EnumerateStorageDirectory(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)
|
||||
static bool GENERIC_EnumerateStorageDirectory(void *userdata, const char *path, SDL_EnumerateDirectoryCallback callback, void *callback_userdata)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@@ -57,7 +57,7 @@ static SDL_bool GENERIC_EnumerateStorageDirectory(void *userdata, const char *pa
|
||||
return result;
|
||||
}
|
||||
|
||||
static SDL_bool GENERIC_GetStoragePathInfo(void *userdata, const char *path, SDL_PathInfo *info)
|
||||
static bool GENERIC_GetStoragePathInfo(void *userdata, const char *path, SDL_PathInfo *info)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@@ -70,7 +70,7 @@ static SDL_bool GENERIC_GetStoragePathInfo(void *userdata, const char *path, SDL
|
||||
return result;
|
||||
}
|
||||
|
||||
static SDL_bool GENERIC_ReadStorageFile(void *userdata, const char *path, void *destination, Uint64 length)
|
||||
static bool GENERIC_ReadStorageFile(void *userdata, const char *path, void *destination, Uint64 length)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@@ -93,7 +93,7 @@ static SDL_bool GENERIC_ReadStorageFile(void *userdata, const char *path, void *
|
||||
return result;
|
||||
}
|
||||
|
||||
static SDL_bool GENERIC_WriteStorageFile(void *userdata, const char *path, const void *source, Uint64 length)
|
||||
static bool GENERIC_WriteStorageFile(void *userdata, const char *path, const void *source, Uint64 length)
|
||||
{
|
||||
// TODO: Recursively create subdirectories with SDL_CreateDirectory
|
||||
bool result = false;
|
||||
@@ -118,7 +118,7 @@ static SDL_bool GENERIC_WriteStorageFile(void *userdata, const char *path, const
|
||||
return result;
|
||||
}
|
||||
|
||||
static SDL_bool GENERIC_CreateStorageDirectory(void *userdata, const char *path)
|
||||
static bool GENERIC_CreateStorageDirectory(void *userdata, const char *path)
|
||||
{
|
||||
// TODO: Recursively create subdirectories with SDL_CreateDirectory
|
||||
bool result = false;
|
||||
@@ -132,7 +132,7 @@ static SDL_bool GENERIC_CreateStorageDirectory(void *userdata, const char *path)
|
||||
return result;
|
||||
}
|
||||
|
||||
static SDL_bool GENERIC_RemoveStoragePath(void *userdata, const char *path)
|
||||
static bool GENERIC_RemoveStoragePath(void *userdata, const char *path)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@@ -145,7 +145,7 @@ static SDL_bool GENERIC_RemoveStoragePath(void *userdata, const char *path)
|
||||
return result;
|
||||
}
|
||||
|
||||
static SDL_bool GENERIC_RenameStoragePath(void *userdata, const char *oldpath, const char *newpath)
|
||||
static bool GENERIC_RenameStoragePath(void *userdata, const char *oldpath, const char *newpath)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
@@ -160,7 +160,7 @@ static SDL_bool GENERIC_RenameStoragePath(void *userdata, const char *oldpath, c
|
||||
return result;
|
||||
}
|
||||
|
||||
static SDL_bool GENERIC_CopyStorageFile(void *userdata, const char *oldpath, const char *newpath)
|
||||
static bool GENERIC_CopyStorageFile(void *userdata, const char *oldpath, const char *newpath)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ typedef struct STEAM_RemoteStorage
|
||||
#include "SDL_steamstorage_proc.h"
|
||||
} STEAM_RemoteStorage;
|
||||
|
||||
static SDL_bool STEAM_CloseStorage(void *userdata)
|
||||
static bool STEAM_CloseStorage(void *userdata)
|
||||
{
|
||||
bool result = true;
|
||||
STEAM_RemoteStorage *steam = (STEAM_RemoteStorage*) userdata;
|
||||
@@ -53,12 +53,12 @@ static SDL_bool STEAM_CloseStorage(void *userdata)
|
||||
return result;
|
||||
}
|
||||
|
||||
static SDL_bool STEAM_StorageReady(void *userdata)
|
||||
static bool STEAM_StorageReady(void *userdata)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static SDL_bool STEAM_GetStoragePathInfo(void *userdata, const char *path, SDL_PathInfo *info)
|
||||
static bool STEAM_GetStoragePathInfo(void *userdata, const char *path, SDL_PathInfo *info)
|
||||
{
|
||||
STEAM_RemoteStorage *steam = (STEAM_RemoteStorage*) userdata;
|
||||
void *steamremotestorage = steam->SteamAPI_SteamRemoteStorage_v016();
|
||||
@@ -74,7 +74,7 @@ static SDL_bool STEAM_GetStoragePathInfo(void *userdata, const char *path, SDL_P
|
||||
return true;
|
||||
}
|
||||
|
||||
static SDL_bool STEAM_ReadStorageFile(void *userdata, const char *path, void *destination, Uint64 length)
|
||||
static bool STEAM_ReadStorageFile(void *userdata, const char *path, void *destination, Uint64 length)
|
||||
{
|
||||
bool result = false;
|
||||
STEAM_RemoteStorage *steam = (STEAM_RemoteStorage*) userdata;
|
||||
@@ -93,7 +93,7 @@ static SDL_bool STEAM_ReadStorageFile(void *userdata, const char *path, void *de
|
||||
return result;
|
||||
}
|
||||
|
||||
static SDL_bool STEAM_WriteStorageFile(void *userdata, const char *path, const void *source, Uint64 length)
|
||||
static bool STEAM_WriteStorageFile(void *userdata, const char *path, const void *source, Uint64 length)
|
||||
{
|
||||
int result = false;
|
||||
STEAM_RemoteStorage *steam = (STEAM_RemoteStorage*) userdata;
|
||||
|
||||
+37
-37
@@ -264,13 +264,13 @@ static int SDLCALL SDLTest_CommonStateParseVideoArguments(void *data, char **arg
|
||||
}
|
||||
if (SDL_strcasecmp(argv[index], "--fullscreen") == 0) {
|
||||
state->window_flags |= SDL_WINDOW_FULLSCREEN;
|
||||
state->fullscreen_exclusive = SDL_TRUE;
|
||||
state->fullscreen_exclusive = true;
|
||||
state->num_windows = 1;
|
||||
return 1;
|
||||
}
|
||||
if (SDL_strcasecmp(argv[index], "--fullscreen-desktop") == 0) {
|
||||
state->window_flags |= SDL_WINDOW_FULLSCREEN;
|
||||
state->fullscreen_exclusive = SDL_FALSE;
|
||||
state->fullscreen_exclusive = false;
|
||||
state->num_windows = 1;
|
||||
return 1;
|
||||
}
|
||||
@@ -344,7 +344,7 @@ static int SDLCALL SDLTest_CommonStateParseVideoArguments(void *data, char **arg
|
||||
return 2;
|
||||
}
|
||||
if (SDL_strcasecmp(argv[index], "--usable-bounds") == 0) {
|
||||
state->fill_usable_bounds = SDL_TRUE;
|
||||
state->fill_usable_bounds = true;
|
||||
return 1;
|
||||
}
|
||||
if (SDL_strcasecmp(argv[index], "--geometry") == 0) {
|
||||
@@ -448,7 +448,7 @@ static int SDLCALL SDLTest_CommonStateParseVideoArguments(void *data, char **arg
|
||||
return 1;
|
||||
}
|
||||
if (SDL_strcasecmp(argv[index], "--auto-scale-content") == 0) {
|
||||
state->auto_scale_content = SDL_TRUE;
|
||||
state->auto_scale_content = true;
|
||||
|
||||
if (state->logical_presentation == SDL_LOGICAL_PRESENTATION_DISABLED) {
|
||||
state->logical_presentation = SDL_LOGICAL_PRESENTATION_STRETCH;
|
||||
@@ -562,7 +562,7 @@ static int SDLCALL SDLTest_CommonStateParseVideoArguments(void *data, char **arg
|
||||
return 1;
|
||||
}
|
||||
if (SDL_strcasecmp(argv[index], "--flash-on-focus-loss") == 0) {
|
||||
state->flash_on_focus_loss = SDL_TRUE;
|
||||
state->flash_on_focus_loss = true;
|
||||
return 1;
|
||||
}
|
||||
if (SDL_strcasecmp(argv[index], "--grab") == 0) {
|
||||
@@ -578,7 +578,7 @@ static int SDLCALL SDLTest_CommonStateParseVideoArguments(void *data, char **arg
|
||||
return 1;
|
||||
}
|
||||
if (SDL_strcasecmp(argv[index], "--hide-cursor") == 0) {
|
||||
state->hide_cursor = SDL_TRUE;
|
||||
state->hide_cursor = true;
|
||||
return 1;
|
||||
}
|
||||
if (SDL_strcasecmp(argv[index], "--gpu") == 0) {
|
||||
@@ -803,18 +803,18 @@ void SDLTest_CommonLogUsage(SDLTest_CommonState *state, const char *argv0, const
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv)
|
||||
bool SDLTest_CommonDefaultArgs(SDLTest_CommonState *state, const int argc, char **argv)
|
||||
{
|
||||
int i = 1;
|
||||
while (i < argc) {
|
||||
const int consumed = SDLTest_CommonArg(state, i);
|
||||
if (consumed <= 0) {
|
||||
SDLTest_CommonLogUsage(state, argv[0], NULL);
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
i += consumed;
|
||||
}
|
||||
return SDL_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void SDLTest_PrintDisplayOrientation(char *text, size_t maxlen, SDL_DisplayOrientation orientation)
|
||||
@@ -1192,7 +1192,7 @@ static SDL_HitTestResult SDLCALL SDLTest_ExampleHitTestCallback(SDL_Window *win,
|
||||
return SDL_HITTEST_NORMAL;
|
||||
}
|
||||
|
||||
SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
|
||||
bool SDLTest_CommonInit(SDLTest_CommonState *state)
|
||||
{
|
||||
int i, j, m, n, w, h;
|
||||
char text[1024];
|
||||
@@ -1216,7 +1216,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
|
||||
if (!SDL_InitSubSystem(SDL_INIT_VIDEO)) {
|
||||
SDL_Log("Couldn't initialize video driver: %s\n",
|
||||
SDL_GetError());
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
if (state->verbose & VERBOSE_VIDEO) {
|
||||
SDL_Log("Video driver: %s\n",
|
||||
@@ -1367,9 +1367,9 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
|
||||
}
|
||||
|
||||
{
|
||||
SDL_bool include_high_density_modes = SDL_FALSE;
|
||||
bool include_high_density_modes = false;
|
||||
if (state->window_flags & SDL_WINDOW_HIGH_PIXEL_DENSITY) {
|
||||
include_high_density_modes = SDL_TRUE;
|
||||
include_high_density_modes = true;
|
||||
}
|
||||
SDL_GetClosestFullscreenDisplayMode(state->displayID, state->window_w, state->window_h, state->refresh_rate, include_high_density_modes, &state->fullscreen_mode);
|
||||
}
|
||||
@@ -1385,7 +1385,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
|
||||
sizeof(*state->targets));
|
||||
if (!state->windows || !state->renderers) {
|
||||
SDL_Log("Out of memory!\n");
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
for (i = 0; i < state->num_windows; ++i) {
|
||||
char title[1024];
|
||||
@@ -1424,7 +1424,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
|
||||
if (!state->windows[i]) {
|
||||
SDL_Log("Couldn't create window: %s\n",
|
||||
SDL_GetError());
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
if (state->window_minW || state->window_minH) {
|
||||
SDL_SetWindowMinimumSize(state->windows[i], state->window_minW, state->window_minH);
|
||||
@@ -1445,7 +1445,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
|
||||
if (state->fullscreen_exclusive) {
|
||||
SDL_SetWindowFullscreenMode(state->windows[i], &state->fullscreen_mode);
|
||||
}
|
||||
SDL_SetWindowFullscreen(state->windows[i], SDL_TRUE);
|
||||
SDL_SetWindowFullscreen(state->windows[i], true);
|
||||
}
|
||||
|
||||
/* Add resize/drag areas for windows that are borderless and resizable */
|
||||
@@ -1471,7 +1471,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
|
||||
if (!state->renderers[i]) {
|
||||
SDL_Log("Couldn't create renderer: %s\n",
|
||||
SDL_GetError());
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
if (state->logical_w == 0 || state->logical_h == 0) {
|
||||
state->logical_w = state->window_w;
|
||||
@@ -1482,7 +1482,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
|
||||
}
|
||||
if (!SDL_SetRenderLogicalPresentation(state->renderers[i], state->logical_w, state->logical_h, state->logical_presentation, state->logical_scale_mode)) {
|
||||
SDL_Log("Couldn't set logical presentation: %s\n", SDL_GetError());
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
if (state->scale != 0.0f) {
|
||||
SDL_SetRenderScale(state->renderers[i], state->scale, state->scale);
|
||||
@@ -1519,7 +1519,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
|
||||
if (!SDL_InitSubSystem(SDL_INIT_AUDIO)) {
|
||||
SDL_Log("Couldn't initialize audio driver: %s\n",
|
||||
SDL_GetError());
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
if (state->verbose & VERBOSE_AUDIO) {
|
||||
SDL_Log("Audio driver: %s\n",
|
||||
@@ -1530,7 +1530,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
|
||||
state->audio_id = SDL_OpenAudioDevice(SDL_AUDIO_DEVICE_DEFAULT_PLAYBACK, &spec);
|
||||
if (!state->audio_id) {
|
||||
SDL_Log("Couldn't open audio: %s\n", SDL_GetError());
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1538,7 +1538,7 @@ SDL_bool SDLTest_CommonInit(SDLTest_CommonState *state)
|
||||
SDL_InitSubSystem(SDL_INIT_CAMERA);
|
||||
}
|
||||
|
||||
return SDL_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
static const char *SystemThemeName(void)
|
||||
@@ -2108,7 +2108,7 @@ static void FullscreenTo(SDLTest_CommonState *state, int index, int windowId)
|
||||
|
||||
flags = SDL_GetWindowFlags(window);
|
||||
if (flags & SDL_WINDOW_FULLSCREEN) {
|
||||
SDL_SetWindowFullscreen(window, SDL_FALSE);
|
||||
SDL_SetWindowFullscreen(window, false);
|
||||
SDL_Delay(15);
|
||||
}
|
||||
|
||||
@@ -2121,9 +2121,9 @@ static void FullscreenTo(SDLTest_CommonState *state, int index, int windowId)
|
||||
new_mode.displayID = displays[index];
|
||||
if (!SDL_SetWindowFullscreenMode(window, &new_mode)) {
|
||||
/* Try again with a default mode */
|
||||
SDL_bool include_high_density_modes = SDL_FALSE;
|
||||
bool include_high_density_modes = false;
|
||||
if (state->window_flags & SDL_WINDOW_HIGH_PIXEL_DENSITY) {
|
||||
include_high_density_modes = SDL_TRUE;
|
||||
include_high_density_modes = true;
|
||||
}
|
||||
if (SDL_GetClosestFullscreenDisplayMode(displays[index], state->window_w, state->window_h, state->refresh_rate, include_high_density_modes, &new_mode)) {
|
||||
SDL_SetWindowFullscreenMode(window, &new_mode);
|
||||
@@ -2133,7 +2133,7 @@ static void FullscreenTo(SDLTest_CommonState *state, int index, int windowId)
|
||||
if (!mode) {
|
||||
SDL_SetWindowPosition(window, rect.x, rect.y);
|
||||
}
|
||||
SDL_SetWindowFullscreen(window, SDL_TRUE);
|
||||
SDL_SetWindowFullscreen(window, true);
|
||||
}
|
||||
}
|
||||
SDL_free(displays);
|
||||
@@ -2184,9 +2184,9 @@ SDL_AppResult SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const
|
||||
}
|
||||
case SDL_EVENT_KEY_DOWN:
|
||||
{
|
||||
SDL_bool withControl = !!(event->key.mod & SDL_KMOD_CTRL);
|
||||
SDL_bool withShift = !!(event->key.mod & SDL_KMOD_SHIFT);
|
||||
SDL_bool withAlt = !!(event->key.mod & SDL_KMOD_ALT);
|
||||
bool withControl = !!(event->key.mod & SDL_KMOD_CTRL);
|
||||
bool withShift = !!(event->key.mod & SDL_KMOD_SHIFT);
|
||||
bool withAlt = !!(event->key.mod & SDL_KMOD_ALT);
|
||||
|
||||
switch (event->key.key) {
|
||||
/* Add hotkeys here */
|
||||
@@ -2404,8 +2404,8 @@ SDL_AppResult SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const
|
||||
if (withShift) {
|
||||
SDL_Window *window = SDL_GetWindowFromEvent(event);
|
||||
if (window) {
|
||||
const SDL_bool shouldCapture = !(SDL_GetWindowFlags(window) & SDL_WINDOW_MOUSE_CAPTURE);
|
||||
const SDL_bool rc = SDL_CaptureMouse(shouldCapture);
|
||||
const bool shouldCapture = !(SDL_GetWindowFlags(window) & SDL_WINDOW_MOUSE_CAPTURE);
|
||||
const bool rc = SDL_CaptureMouse(shouldCapture);
|
||||
SDL_Log("%sapturing mouse %s!\n", shouldCapture ? "C" : "Unc", rc ? "succeeded" : "failed");
|
||||
}
|
||||
}
|
||||
@@ -2426,9 +2426,9 @@ SDL_AppResult SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const
|
||||
if (window) {
|
||||
SDL_WindowFlags flags = SDL_GetWindowFlags(window);
|
||||
if (flags & SDL_WINDOW_ALWAYS_ON_TOP) {
|
||||
SDL_SetWindowAlwaysOnTop(window, SDL_FALSE);
|
||||
SDL_SetWindowAlwaysOnTop(window, false);
|
||||
} else {
|
||||
SDL_SetWindowAlwaysOnTop(window, SDL_TRUE);
|
||||
SDL_SetWindowAlwaysOnTop(window, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2451,9 +2451,9 @@ SDL_AppResult SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const
|
||||
if (!(flags & SDL_WINDOW_FULLSCREEN) ||
|
||||
!SDL_GetWindowFullscreenMode(window)) {
|
||||
SDL_SetWindowFullscreenMode(window, &state->fullscreen_mode);
|
||||
SDL_SetWindowFullscreen(window, SDL_TRUE);
|
||||
SDL_SetWindowFullscreen(window, true);
|
||||
} else {
|
||||
SDL_SetWindowFullscreen(window, SDL_FALSE);
|
||||
SDL_SetWindowFullscreen(window, false);
|
||||
}
|
||||
}
|
||||
} else if (withAlt) {
|
||||
@@ -2464,9 +2464,9 @@ SDL_AppResult SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const
|
||||
if (!(flags & SDL_WINDOW_FULLSCREEN) ||
|
||||
SDL_GetWindowFullscreenMode(window)) {
|
||||
SDL_SetWindowFullscreenMode(window, NULL);
|
||||
SDL_SetWindowFullscreen(window, SDL_TRUE);
|
||||
SDL_SetWindowFullscreen(window, true);
|
||||
} else {
|
||||
SDL_SetWindowFullscreen(window, SDL_FALSE);
|
||||
SDL_SetWindowFullscreen(window, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2478,7 +2478,7 @@ SDL_AppResult SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const
|
||||
SDL_Window *window = SDL_GetWindowFromEvent(event);
|
||||
if (window) {
|
||||
const SDL_WindowFlags flags = SDL_GetWindowFlags(window);
|
||||
const SDL_bool b = (flags & SDL_WINDOW_BORDERLESS) ? SDL_TRUE : SDL_FALSE;
|
||||
const bool b = (flags & SDL_WINDOW_BORDERLESS) ? true : false;
|
||||
SDL_SetWindowBordered(window, b);
|
||||
}
|
||||
}
|
||||
|
||||
+15
-15
@@ -27,7 +27,7 @@
|
||||
*/
|
||||
#include <SDL3/SDL_test.h>
|
||||
|
||||
SDL_bool SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext)
|
||||
bool SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext)
|
||||
{
|
||||
int i, j;
|
||||
CrcUint32 c;
|
||||
@@ -61,30 +61,30 @@ SDL_bool SDLTest_Crc32Init(SDLTest_Crc32Context *crcContext)
|
||||
}
|
||||
#endif
|
||||
|
||||
return SDL_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Complete CRC32 calculation on a memory block */
|
||||
SDL_bool SDLTest_Crc32Calc(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32)
|
||||
bool SDLTest_Crc32Calc(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32)
|
||||
{
|
||||
if (!SDLTest_Crc32CalcStart(crcContext, crc32)) {
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!SDLTest_Crc32CalcBuffer(crcContext, inBuf, inLen, crc32)) {
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!SDLTest_Crc32CalcEnd(crcContext, crc32)) {
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
return SDL_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Start crc calculation */
|
||||
|
||||
SDL_bool SDLTest_Crc32CalcStart(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32)
|
||||
bool SDLTest_Crc32CalcStart(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32)
|
||||
{
|
||||
/* Sanity check pointers */
|
||||
if (!crcContext) {
|
||||
@@ -97,12 +97,12 @@ SDL_bool SDLTest_Crc32CalcStart(SDLTest_Crc32Context *crcContext, CrcUint32 *crc
|
||||
*/
|
||||
*crc32 = 0xffffffff;
|
||||
|
||||
return SDL_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Finish crc calculation */
|
||||
|
||||
SDL_bool SDLTest_Crc32CalcEnd(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32)
|
||||
bool SDLTest_Crc32CalcEnd(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32)
|
||||
{
|
||||
/* Sanity check pointers */
|
||||
if (!crcContext) {
|
||||
@@ -115,12 +115,12 @@ SDL_bool SDLTest_Crc32CalcEnd(SDLTest_Crc32Context *crcContext, CrcUint32 *crc32
|
||||
*/
|
||||
*crc32 = (~(*crc32));
|
||||
|
||||
return SDL_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Include memory block in crc */
|
||||
|
||||
SDL_bool SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32)
|
||||
bool SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context *crcContext, CrcUint8 *inBuf, CrcUint32 inLen, CrcUint32 *crc32)
|
||||
{
|
||||
CrcUint8 *p;
|
||||
register CrcUint32 crc;
|
||||
@@ -147,14 +147,14 @@ SDL_bool SDLTest_Crc32CalcBuffer(SDLTest_Crc32Context *crcContext, CrcUint8 *inB
|
||||
}
|
||||
*crc32 = crc;
|
||||
|
||||
return SDL_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDLTest_Crc32Done(SDLTest_Crc32Context *crcContext)
|
||||
bool SDLTest_Crc32Done(SDLTest_Crc32Context *crcContext)
|
||||
{
|
||||
if (!crcContext) {
|
||||
return SDL_InvalidParamError("crcContext");
|
||||
}
|
||||
|
||||
return SDL_TRUE;
|
||||
return true;
|
||||
}
|
||||
+17
-17
@@ -3142,13 +3142,13 @@ static struct SDLTest_CharTextureCache *SDLTest_CharTextureCacheList;
|
||||
|
||||
int FONT_CHARACTER_SIZE = 8;
|
||||
|
||||
SDL_bool SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c)
|
||||
bool SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32 c)
|
||||
{
|
||||
const Uint32 charWidth = FONT_CHARACTER_SIZE;
|
||||
const Uint32 charHeight = FONT_CHARACTER_SIZE;
|
||||
SDL_FRect srect;
|
||||
SDL_FRect drect;
|
||||
SDL_bool result;
|
||||
bool result;
|
||||
Uint32 ix, iy;
|
||||
const unsigned char *charpos;
|
||||
Uint32 *curpos;
|
||||
@@ -3205,7 +3205,7 @@ SDL_bool SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32
|
||||
*/
|
||||
character = SDL_CreateSurface(charWidth, charHeight, SDL_PIXELFORMAT_RGBA8888);
|
||||
if (!character) {
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
charpos = SDLTest_FontData + ci * 8;
|
||||
@@ -3237,7 +3237,7 @@ SDL_bool SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32
|
||||
* Check pointer
|
||||
*/
|
||||
if (cache->charTextureCache[ci] == NULL) {
|
||||
return SDL_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_SetTextureScaleMode(cache->charTextureCache[ci], SDL_SCALEMODE_NEAREST);
|
||||
@@ -3246,7 +3246,7 @@ SDL_bool SDLTest_DrawCharacter(SDL_Renderer *renderer, float x, float y, Uint32
|
||||
/*
|
||||
* Set color
|
||||
*/
|
||||
result = SDL_TRUE;
|
||||
result = true;
|
||||
result &= SDL_GetRenderDrawColor(renderer, &r, &g, &b, &a);
|
||||
result &= SDL_SetTextureColorMod(cache->charTextureCache[ci], r, g, b);
|
||||
result &= SDL_SetTextureAlphaMod(cache->charTextureCache[ci], a);
|
||||
@@ -3267,8 +3267,8 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc)
|
||||
const Uint8 *p = (const Uint8 *)src;
|
||||
size_t left = 0;
|
||||
size_t save_srclen = srclen;
|
||||
SDL_bool overlong = SDL_FALSE;
|
||||
SDL_bool underflow = SDL_FALSE;
|
||||
bool overlong = false;
|
||||
bool underflow = false;
|
||||
Uint32 ch = UNKNOWN_UNICODE;
|
||||
|
||||
if (srclen == 0) {
|
||||
@@ -3277,7 +3277,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc)
|
||||
if (p[0] >= 0xFC) {
|
||||
if ((p[0] & 0xFE) == 0xFC) {
|
||||
if (p[0] == 0xFC && (p[1] & 0xFC) == 0x80) {
|
||||
overlong = SDL_TRUE;
|
||||
overlong = true;
|
||||
}
|
||||
ch = (Uint32)(p[0] & 0x01);
|
||||
left = 5;
|
||||
@@ -3285,7 +3285,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc)
|
||||
} else if (p[0] >= 0xF8) {
|
||||
if ((p[0] & 0xFC) == 0xF8) {
|
||||
if (p[0] == 0xF8 && (p[1] & 0xF8) == 0x80) {
|
||||
overlong = SDL_TRUE;
|
||||
overlong = true;
|
||||
}
|
||||
ch = (Uint32)(p[0] & 0x03);
|
||||
left = 4;
|
||||
@@ -3293,7 +3293,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc)
|
||||
} else if (p[0] >= 0xF0) {
|
||||
if ((p[0] & 0xF8) == 0xF0) {
|
||||
if (p[0] == 0xF0 && (p[1] & 0xF0) == 0x80) {
|
||||
overlong = SDL_TRUE;
|
||||
overlong = true;
|
||||
}
|
||||
ch = (Uint32)(p[0] & 0x07);
|
||||
left = 3;
|
||||
@@ -3301,7 +3301,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc)
|
||||
} else if (p[0] >= 0xE0) {
|
||||
if ((p[0] & 0xF0) == 0xE0) {
|
||||
if (p[0] == 0xE0 && (p[1] & 0xE0) == 0x80) {
|
||||
overlong = SDL_TRUE;
|
||||
overlong = true;
|
||||
}
|
||||
ch = (Uint32)(p[0] & 0x0F);
|
||||
left = 2;
|
||||
@@ -3309,7 +3309,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc)
|
||||
} else if (p[0] >= 0xC0) {
|
||||
if ((p[0] & 0xE0) == 0xC0) {
|
||||
if ((p[0] & 0xDE) == 0xC0) {
|
||||
overlong = SDL_TRUE;
|
||||
overlong = true;
|
||||
}
|
||||
ch = (Uint32)(p[0] & 0x1F);
|
||||
left = 1;
|
||||
@@ -3332,7 +3332,7 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc)
|
||||
--left;
|
||||
}
|
||||
if (left > 0) {
|
||||
underflow = SDL_TRUE;
|
||||
underflow = true;
|
||||
}
|
||||
|
||||
if (overlong || underflow ||
|
||||
@@ -3348,10 +3348,10 @@ static Uint32 UTF8_getch(const char *src, size_t srclen, int *inc)
|
||||
|
||||
#define UTF8_IsTrailingByte(c) ((c) >= 0x80 && (c) <= 0xBF)
|
||||
|
||||
SDL_bool SDLTest_DrawString(SDL_Renderer *renderer, float x, float y, const char *s)
|
||||
bool SDLTest_DrawString(SDL_Renderer *renderer, float x, float y, const char *s)
|
||||
{
|
||||
const Uint32 charWidth = FONT_CHARACTER_SIZE;
|
||||
SDL_bool result = SDL_TRUE;
|
||||
bool result = true;
|
||||
float curx = x;
|
||||
float cury = y;
|
||||
size_t len = SDL_strlen(s);
|
||||
@@ -3417,12 +3417,12 @@ void SDLTest_TextWindowAddText(SDLTest_TextWindow *textwin, const char *fmt, ...
|
||||
void SDLTest_TextWindowAddTextWithLength(SDLTest_TextWindow *textwin, const char *text, size_t len)
|
||||
{
|
||||
size_t existing;
|
||||
SDL_bool newline = SDL_FALSE;
|
||||
bool newline = false;
|
||||
char *line;
|
||||
|
||||
if (len > 0 && text[len - 1] == '\n') {
|
||||
--len;
|
||||
newline = SDL_TRUE;
|
||||
newline = true;
|
||||
}
|
||||
|
||||
if (textwin->lines[textwin->current]) {
|
||||
|
||||
+12
-12
@@ -170,7 +170,7 @@ Sint32 SDLTest_RandomIntegerInRange(Sint32 min, Sint32 max)
|
||||
*
|
||||
* \returns Returns a random boundary value for the domain or 0 in case of error
|
||||
*/
|
||||
static Uint64 SDLTest_GenerateUnsignedBoundaryValues(const Uint64 maxValue, Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain)
|
||||
static Uint64 SDLTest_GenerateUnsignedBoundaryValues(const Uint64 maxValue, Uint64 boundary1, Uint64 boundary2, bool validDomain)
|
||||
{
|
||||
Uint64 b1, b2;
|
||||
Uint64 delta;
|
||||
@@ -187,7 +187,7 @@ static Uint64 SDLTest_GenerateUnsignedBoundaryValues(const Uint64 maxValue, Uint
|
||||
}
|
||||
|
||||
index = 0;
|
||||
if (validDomain == SDL_TRUE) {
|
||||
if (validDomain == true) {
|
||||
if (b1 == b2) {
|
||||
return b1;
|
||||
}
|
||||
@@ -231,7 +231,7 @@ static Uint64 SDLTest_GenerateUnsignedBoundaryValues(const Uint64 maxValue, Uint
|
||||
return tempBuf[SDLTest_RandomUint8() % index];
|
||||
}
|
||||
|
||||
Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_bool validDomain)
|
||||
Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, bool validDomain)
|
||||
{
|
||||
/* max value for Uint8 */
|
||||
const Uint64 maxValue = UCHAR_MAX;
|
||||
@@ -240,7 +240,7 @@ Uint8 SDLTest_RandomUint8BoundaryValue(Uint8 boundary1, Uint8 boundary2, SDL_boo
|
||||
validDomain);
|
||||
}
|
||||
|
||||
Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL_bool validDomain)
|
||||
Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, bool validDomain)
|
||||
{
|
||||
/* max value for Uint16 */
|
||||
const Uint64 maxValue = USHRT_MAX;
|
||||
@@ -249,7 +249,7 @@ Uint16 SDLTest_RandomUint16BoundaryValue(Uint16 boundary1, Uint16 boundary2, SDL
|
||||
validDomain);
|
||||
}
|
||||
|
||||
Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL_bool validDomain)
|
||||
Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, bool validDomain)
|
||||
{
|
||||
/* max value for Uint32 */
|
||||
#if ((ULONG_MAX) == (UINT_MAX))
|
||||
@@ -262,7 +262,7 @@ Uint32 SDLTest_RandomUint32BoundaryValue(Uint32 boundary1, Uint32 boundary2, SDL
|
||||
validDomain);
|
||||
}
|
||||
|
||||
Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool validDomain)
|
||||
Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, bool validDomain)
|
||||
{
|
||||
/* max value for Uint64 */
|
||||
const Uint64 maxValue = UINT64_MAX;
|
||||
@@ -296,7 +296,7 @@ Uint64 SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL
|
||||
*
|
||||
* \returns Returns a random boundary value for the domain or 0 in case of error
|
||||
*/
|
||||
static Sint64 SDLTest_GenerateSignedBoundaryValues(const Sint64 minValue, const Sint64 maxValue, Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain)
|
||||
static Sint64 SDLTest_GenerateSignedBoundaryValues(const Sint64 minValue, const Sint64 maxValue, Sint64 boundary1, Sint64 boundary2, bool validDomain)
|
||||
{
|
||||
Sint64 b1, b2;
|
||||
Sint64 delta;
|
||||
@@ -313,7 +313,7 @@ static Sint64 SDLTest_GenerateSignedBoundaryValues(const Sint64 minValue, const
|
||||
}
|
||||
|
||||
index = 0;
|
||||
if (validDomain == SDL_TRUE) {
|
||||
if (validDomain == true) {
|
||||
if (b1 == b2) {
|
||||
return b1;
|
||||
}
|
||||
@@ -357,7 +357,7 @@ static Sint64 SDLTest_GenerateSignedBoundaryValues(const Sint64 minValue, const
|
||||
return tempBuf[SDLTest_RandomUint8() % index];
|
||||
}
|
||||
|
||||
Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_bool validDomain)
|
||||
Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, bool validDomain)
|
||||
{
|
||||
/* min & max values for Sint8 */
|
||||
const Sint64 maxValue = SCHAR_MAX;
|
||||
@@ -367,7 +367,7 @@ Sint8 SDLTest_RandomSint8BoundaryValue(Sint8 boundary1, Sint8 boundary2, SDL_boo
|
||||
validDomain);
|
||||
}
|
||||
|
||||
Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL_bool validDomain)
|
||||
Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, bool validDomain)
|
||||
{
|
||||
/* min & max values for Sint16 */
|
||||
const Sint64 maxValue = SHRT_MAX;
|
||||
@@ -377,7 +377,7 @@ Sint16 SDLTest_RandomSint16BoundaryValue(Sint16 boundary1, Sint16 boundary2, SDL
|
||||
validDomain);
|
||||
}
|
||||
|
||||
Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL_bool validDomain)
|
||||
Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, bool validDomain)
|
||||
{
|
||||
/* min & max values for Sint32 */
|
||||
#if ((ULONG_MAX) == (UINT_MAX))
|
||||
@@ -392,7 +392,7 @@ Sint32 SDLTest_RandomSint32BoundaryValue(Sint32 boundary1, Sint32 boundary2, SDL
|
||||
validDomain);
|
||||
}
|
||||
|
||||
Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, SDL_bool validDomain)
|
||||
Sint64 SDLTest_RandomSint64BoundaryValue(Sint64 boundary1, Sint64 boundary2, bool validDomain)
|
||||
{
|
||||
/* min & max values for Sint64 */
|
||||
const Sint64 maxValue = INT64_MAX;
|
||||
|
||||
@@ -55,7 +55,7 @@ struct SDLTest_TestSuiteRunner {
|
||||
Uint64 execKey;
|
||||
char *filter;
|
||||
int testIterations;
|
||||
SDL_bool randomOrder;
|
||||
bool randomOrder;
|
||||
} user;
|
||||
|
||||
SDLTest_ArgumentParser argparser;
|
||||
@@ -229,7 +229,7 @@ static Uint32 SDLCALL SDLTest_BailOut(void *userdata, SDL_TimerID timerID, Uint3
|
||||
*
|
||||
* \returns Test case result.
|
||||
*/
|
||||
static int SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, const SDLTest_TestCaseReference *testCase, Uint64 execKey, SDL_bool forceTestRun)
|
||||
static int SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, const SDLTest_TestCaseReference *testCase, Uint64 execKey, bool forceTestRun)
|
||||
{
|
||||
SDL_TimerID timer = 0;
|
||||
int testCaseResult = 0;
|
||||
@@ -242,7 +242,7 @@ static int SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, const SDLTest_
|
||||
return TEST_RESULT_SETUP_FAILURE;
|
||||
}
|
||||
|
||||
if (!testCase->enabled && forceTestRun == SDL_FALSE) {
|
||||
if (!testCase->enabled && forceTestRun == false) {
|
||||
SDLTest_Log(SDLTEST_FINAL_RESULT_FORMAT, "Test", testCase->name, "Skipped (Disabled)");
|
||||
return TEST_RESULT_SKIPPED;
|
||||
}
|
||||
@@ -387,7 +387,7 @@ int SDLTest_ExecuteTestSuiteRunner(SDLTest_TestSuiteRunner *runner)
|
||||
const char *suiteFilterName = NULL;
|
||||
int testFilter = 0;
|
||||
const char *testFilterName = NULL;
|
||||
SDL_bool forceTestRun = SDL_FALSE;
|
||||
bool forceTestRun = false;
|
||||
int testResult = 0;
|
||||
int runResult = 0;
|
||||
int totalTestFailedCount = 0;
|
||||
@@ -505,7 +505,7 @@ int SDLTest_ExecuteTestSuiteRunner(SDLTest_TestSuiteRunner *runner)
|
||||
return 2;
|
||||
}
|
||||
|
||||
runner->user.randomOrder = SDL_FALSE;
|
||||
runner->user.randomOrder = false;
|
||||
}
|
||||
|
||||
/* Number of test suites */
|
||||
@@ -640,7 +640,7 @@ int SDLTest_ExecuteTestSuiteRunner(SDLTest_TestSuiteRunner *runner)
|
||||
/* Override 'disabled' flag if we specified a test filter (i.e. force run for debugging) */
|
||||
if (testFilter == 1 && !testCase->enabled) {
|
||||
SDLTest_Log("Force run of disabled test since test filter was set");
|
||||
forceTestRun = SDL_TRUE;
|
||||
forceTestRun = true;
|
||||
}
|
||||
|
||||
/* Take time - test start */
|
||||
@@ -812,7 +812,7 @@ static int SDLCALL SDLTest_TestSuiteCommonArg(void *data, char **argv, int index
|
||||
}
|
||||
}
|
||||
else if (SDL_strcasecmp(argv[index], "--random-order") == 0) {
|
||||
runner->user.randomOrder = SDL_TRUE;
|
||||
runner->user.randomOrder = true;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <libunwind.h>
|
||||
#ifndef unw_get_proc_name_by_ip
|
||||
#define SDLTEST_UNWIND_NO_PROC_NAME_BY_IP
|
||||
static SDL_bool s_unwind_symbol_names = SDL_TRUE;
|
||||
static bool s_unwind_symbol_names = true;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -73,7 +73,7 @@ static SDL_realloc_func SDL_realloc_orig = NULL;
|
||||
static SDL_free_func SDL_free_orig = NULL;
|
||||
static int s_previous_allocations = 0;
|
||||
static SDL_tracked_allocation *s_tracked_allocations[256];
|
||||
static SDL_bool s_randfill_allocations = SDL_FALSE;
|
||||
static bool s_randfill_allocations = false;
|
||||
static SDL_AtomicInt s_lock;
|
||||
|
||||
#define LOCK_ALLOCATOR() \
|
||||
@@ -82,7 +82,7 @@ static SDL_AtomicInt s_lock;
|
||||
break; \
|
||||
} \
|
||||
SDL_CPUPauseInstruction(); \
|
||||
} while (SDL_TRUE)
|
||||
} while (true)
|
||||
#define UNLOCK_ALLOCATOR() do { SDL_SetAtomicInt(&s_lock, 0); } while (0)
|
||||
|
||||
static unsigned int get_allocation_bucket(void *mem)
|
||||
@@ -116,7 +116,7 @@ static size_t SDL_GetTrackedAllocationSize(void *mem)
|
||||
return entry ? entry->size : SIZE_MAX;
|
||||
}
|
||||
|
||||
static SDL_bool SDL_IsAllocationTracked(void *mem)
|
||||
static bool SDL_IsAllocationTracked(void *mem)
|
||||
{
|
||||
return SDL_GetTrackedAllocation(mem) != NULL;
|
||||
}
|
||||
@@ -302,9 +302,9 @@ void SDLTest_TrackAllocations(void)
|
||||
const char *env_trackmem = SDL_getenv_unsafe("SDL_TRACKMEM_SYMBOL_NAMES");
|
||||
if (env_trackmem) {
|
||||
if (SDL_strcasecmp(env_trackmem, "1") == 0 || SDL_strcasecmp(env_trackmem, "yes") == 0 || SDL_strcasecmp(env_trackmem, "true") == 0) {
|
||||
s_unwind_symbol_names = SDL_TRUE;
|
||||
s_unwind_symbol_names = true;
|
||||
} else if (SDL_strcasecmp(env_trackmem, "0") == 0 || SDL_strcasecmp(env_trackmem, "no") == 0 || SDL_strcasecmp(env_trackmem, "false") == 0) {
|
||||
s_unwind_symbol_names = SDL_FALSE;
|
||||
s_unwind_symbol_names = false;
|
||||
}
|
||||
}
|
||||
} while (0);
|
||||
@@ -348,7 +348,7 @@ void SDLTest_RandFillAllocations(void)
|
||||
{
|
||||
SDLTest_TrackAllocations();
|
||||
|
||||
s_randfill_allocations = SDL_TRUE;
|
||||
s_randfill_allocations = true;
|
||||
}
|
||||
|
||||
void SDLTest_LogAllocations(void)
|
||||
|
||||
@@ -54,7 +54,7 @@ void *SDL_GetTLS(SDL_TLSID *id)
|
||||
return storage->array[storage_index].data;
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback destructor)
|
||||
bool SDL_SetTLS(SDL_TLSID *id, const void *value, SDL_TLSDestructorCallback destructor)
|
||||
{
|
||||
SDL_TLSData *storage;
|
||||
int storage_index;
|
||||
@@ -439,7 +439,7 @@ const char *SDL_GetThreadName(SDL_Thread *thread)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_SetThreadPriority(SDL_ThreadPriority priority)
|
||||
bool SDL_SetThreadPriority(SDL_ThreadPriority priority)
|
||||
{
|
||||
return SDL_SYS_SetThreadPriority(priority);
|
||||
}
|
||||
@@ -483,12 +483,12 @@ void SDL_WaitSemaphore(SDL_Semaphore *sem)
|
||||
SDL_WaitSemaphoreTimeoutNS(sem, -1);
|
||||
}
|
||||
|
||||
SDL_bool SDL_TryWaitSemaphore(SDL_Semaphore *sem)
|
||||
bool SDL_TryWaitSemaphore(SDL_Semaphore *sem)
|
||||
{
|
||||
return SDL_WaitSemaphoreTimeoutNS(sem, 0);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS)
|
||||
bool SDL_WaitSemaphoreTimeout(SDL_Semaphore *sem, Sint32 timeoutMS)
|
||||
{
|
||||
Sint64 timeoutNS;
|
||||
|
||||
@@ -505,7 +505,7 @@ void SDL_WaitCondition(SDL_Condition *cond, SDL_Mutex *mutex)
|
||||
SDL_WaitConditionTimeoutNS(cond, mutex, -1);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WaitConditionTimeout(SDL_Condition *cond, SDL_Mutex *mutex, Sint32 timeoutMS)
|
||||
bool SDL_WaitConditionTimeout(SDL_Condition *cond, SDL_Mutex *mutex, Sint32 timeoutMS)
|
||||
{
|
||||
Sint64 timeoutNS;
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ bool SDL_WaitConditionTimeoutNS_generic(SDL_Condition *_cond, SDL_Mutex *mutex,
|
||||
}
|
||||
|
||||
#ifndef SDL_THREAD_GENERIC_COND_SUFFIX
|
||||
SDL_bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS)
|
||||
bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS)
|
||||
{
|
||||
return SDL_WaitConditionTimeoutNS_generic(cond, mutex, timeoutNS);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ void SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS // clang doe
|
||||
#endif // SDL_THREADS_DISABLED
|
||||
}
|
||||
|
||||
SDL_bool SDL_TryLockMutex(SDL_Mutex *mutex)
|
||||
bool SDL_TryLockMutex(SDL_Mutex *mutex)
|
||||
{
|
||||
bool result = true;
|
||||
#ifndef SDL_THREADS_DISABLED
|
||||
|
||||
@@ -139,7 +139,7 @@ bool SDL_TryLockRWLockForReading_generic(SDL_RWLock *rwlock)
|
||||
}
|
||||
|
||||
#ifndef SDL_THREAD_GENERIC_RWLOCK_SUFFIX
|
||||
SDL_bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock)
|
||||
bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock)
|
||||
{
|
||||
return SDL_TryLockRWLockForReading_generic(rwlock);
|
||||
}
|
||||
@@ -167,7 +167,7 @@ bool SDL_TryLockRWLockForWriting_generic(SDL_RWLock *rwlock)
|
||||
}
|
||||
|
||||
#ifndef SDL_THREAD_GENERIC_RWLOCK_SUFFIX
|
||||
SDL_bool SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock)
|
||||
bool SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock)
|
||||
{
|
||||
return SDL_TryLockRWLockForWriting_generic(rwlock);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ void SDL_DestroySemaphore(SDL_Semaphore *sem)
|
||||
{
|
||||
}
|
||||
|
||||
SDL_bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -103,7 +103,7 @@ void SDL_DestroySemaphore(SDL_Semaphore *sem)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
{
|
||||
bool result = false;
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ Thread B:
|
||||
SDL_SignalCondition(cond);
|
||||
SDL_UnlockMutex(lock);
|
||||
*/
|
||||
SDL_bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS)
|
||||
bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS)
|
||||
{
|
||||
Result res;
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ void SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS // clang doe
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_TryLockMutex(SDL_Mutex *mutex)
|
||||
bool SDL_TryLockMutex(SDL_Mutex *mutex)
|
||||
{
|
||||
if (mutex) {
|
||||
return RecursiveLock_TryLock(&mutex->lock);
|
||||
|
||||
@@ -74,7 +74,7 @@ static bool WaitOnSemaphoreFor(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
{
|
||||
if (!sem) {
|
||||
return true;
|
||||
|
||||
@@ -78,7 +78,7 @@ void SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS // clang does
|
||||
|
||||
// Try to lock the mutex
|
||||
#if 0
|
||||
SDL_bool SDL_TryLockMutex(SDL_Mutex *mutex)
|
||||
bool SDL_TryLockMutex(SDL_Mutex *mutex)
|
||||
{
|
||||
if (mutex) {
|
||||
// Not yet implemented.
|
||||
|
||||
@@ -72,7 +72,7 @@ void SDL_DestroySemaphore(SDL_Semaphore *sem)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
{
|
||||
u64 timeout_usec;
|
||||
u64 *timeout_ptr;
|
||||
|
||||
@@ -72,7 +72,7 @@ void SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS // clang doe
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_TryLockMutex(SDL_Mutex *mutex)
|
||||
bool SDL_TryLockMutex(SDL_Mutex *mutex)
|
||||
{
|
||||
bool result = true;
|
||||
if (mutex) {
|
||||
|
||||
@@ -71,7 +71,7 @@ void SDL_DestroySemaphore(SDL_Semaphore *sem)
|
||||
* If the timeout is 0 then just poll the semaphore; if it's -1, pass
|
||||
* NULL to sceKernelWaitSema() so that it waits indefinitely; and if the timeout
|
||||
* is specified, convert it to microseconds. */
|
||||
SDL_bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
{
|
||||
SceUInt timeoutUS;
|
||||
SceUInt *pTimeout = NULL;
|
||||
|
||||
@@ -78,7 +78,7 @@ void SDL_BroadcastCondition(SDL_Condition *cond)
|
||||
pthread_cond_broadcast(&cond->cond);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS)
|
||||
bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS)
|
||||
{
|
||||
#ifndef HAVE_CLOCK_GETTIME
|
||||
struct timeval delta;
|
||||
|
||||
@@ -82,7 +82,7 @@ void SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS // clang does
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_TryLockMutex(SDL_Mutex *mutex)
|
||||
bool SDL_TryLockMutex(SDL_Mutex *mutex)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ void SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SDL_NO_THREAD_SAFETY_ANALYSIS
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock)
|
||||
bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
@@ -86,7 +86,7 @@ SDL_bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock)
|
||||
bool SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ void SDL_DestroySemaphore(SDL_Semaphore *sem)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
{
|
||||
#ifdef HAVE_SEM_TIMEDWAIT
|
||||
#ifndef HAVE_CLOCK_GETTIME
|
||||
|
||||
@@ -68,7 +68,7 @@ void SDL_LockMutex(SDL_Mutex *mutex) SDL_NO_THREAD_SAFETY_ANALYSIS // clang doe
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_TryLockMutex(SDL_Mutex *mutex)
|
||||
bool SDL_TryLockMutex(SDL_Mutex *mutex)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ void SDL_DestroySemaphore(SDL_Semaphore *sem)
|
||||
* If the timeout is 0 then just poll the semaphore; if it's -1, pass
|
||||
* NULL to sceKernelWaitSema() so that it waits indefinitely; and if the timeout
|
||||
* is specified, convert it to microseconds. */
|
||||
SDL_bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
{
|
||||
SceUInt timeoutUS;
|
||||
SceUInt *pTimeout = NULL;
|
||||
|
||||
@@ -216,7 +216,7 @@ void SDL_BroadcastCondition(SDL_Condition *cond)
|
||||
SDL_cond_impl_active.Broadcast(cond);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS)
|
||||
bool SDL_WaitConditionTimeoutNS(SDL_Condition *cond, SDL_Mutex *mutex, Sint64 timeoutNS)
|
||||
{
|
||||
if (!cond || !mutex) {
|
||||
return true;
|
||||
|
||||
@@ -218,7 +218,7 @@ void SDL_LockMutex(SDL_Mutex *mutex)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_TryLockMutex(SDL_Mutex *mutex)
|
||||
bool SDL_TryLockMutex(SDL_Mutex *mutex)
|
||||
{
|
||||
bool result = true;
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ void SDL_LockRWLockForWriting(SDL_RWLock *rwlock) SDL_NO_THREAD_SAFETY_ANALYSIS
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock)
|
||||
bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock)
|
||||
{
|
||||
bool result = true;
|
||||
if (rwlock) {
|
||||
@@ -213,7 +213,7 @@ SDL_bool SDL_TryLockRWLockForReading(SDL_RWLock *rwlock)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock)
|
||||
bool SDL_TryLockRWLockForWriting(SDL_RWLock *rwlock)
|
||||
{
|
||||
bool result = true;
|
||||
if (rwlock) {
|
||||
|
||||
@@ -333,7 +333,7 @@ void SDL_DestroySemaphore(SDL_Semaphore *sem)
|
||||
SDL_sem_impl_active.Destroy(sem);
|
||||
}
|
||||
|
||||
SDL_bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
bool SDL_WaitSemaphoreTimeoutNS(SDL_Semaphore *sem, Sint64 timeoutNS)
|
||||
{
|
||||
return SDL_sem_impl_active.WaitTimeoutNS(sem, timeoutNS);
|
||||
}
|
||||
|
||||
+2
-2
@@ -57,7 +57,7 @@ Sint64 SDL_CivilToDays(int year, int month, int day, int *day_of_week, int *day_
|
||||
return z;
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetDateTimeLocalePreferences(SDL_DateFormat *dateFormat, SDL_TimeFormat *timeFormat)
|
||||
bool SDL_GetDateTimeLocalePreferences(SDL_DateFormat *dateFormat, SDL_TimeFormat *timeFormat)
|
||||
{
|
||||
// Default to ISO 8061 date format, as it is unambiguous, and 24 hour time.
|
||||
if (dateFormat) {
|
||||
@@ -162,7 +162,7 @@ static bool SDL_DateTimeIsValid(const SDL_DateTime *dt)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks)
|
||||
bool SDL_DateTimeToTime(const SDL_DateTime *dt, SDL_Time *ticks)
|
||||
{
|
||||
static const Sint64 max_seconds = SDL_NS_TO_SECONDS(SDL_MAX_TIME) - 1;
|
||||
static const Sint64 min_seconds = SDL_NS_TO_SECONDS(SDL_MIN_TIME) + 1;
|
||||
|
||||
@@ -106,7 +106,7 @@ void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
{
|
||||
if (!ticks) {
|
||||
return SDL_InvalidParamError("ticks");
|
||||
@@ -121,7 +121,7 @@ SDL_bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime)
|
||||
bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime)
|
||||
{
|
||||
if (!dt) {
|
||||
return SDL_InvalidParamError("dt");
|
||||
|
||||
@@ -32,7 +32,7 @@ void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf)
|
||||
{
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
{
|
||||
if (!ticks) {
|
||||
return SDL_InvalidParamError("ticks");
|
||||
@@ -43,7 +43,7 @@ SDL_bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
return true;
|
||||
}
|
||||
|
||||
SDL_bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime)
|
||||
bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime)
|
||||
{
|
||||
if (!dt) {
|
||||
return SDL_InvalidParamError("dt");
|
||||
|
||||
@@ -65,7 +65,7 @@ void SDL_GetSystemTimeLocalePreferences(SDL_DateFormat *df, SDL_TimeFormat *tf)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
{
|
||||
u64 sceTicks;
|
||||
|
||||
@@ -93,7 +93,7 @@ SDL_bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
return SDL_SetError("Failed to retrieve system time (%i)", ret);
|
||||
}
|
||||
|
||||
SDL_bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime)
|
||||
bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime)
|
||||
{
|
||||
ScePspDateTime t;
|
||||
u64 local;
|
||||
|
||||
@@ -98,7 +98,7 @@ found_date:
|
||||
#endif
|
||||
}
|
||||
|
||||
SDL_bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
{
|
||||
if (!ticks) {
|
||||
return SDL_InvalidParamError("ticks");
|
||||
@@ -150,7 +150,7 @@ SDL_bool SDL_GetCurrentTime(SDL_Time *ticks)
|
||||
return false;
|
||||
}
|
||||
|
||||
SDL_bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, SDL_bool localTime)
|
||||
bool SDL_TimeToDateTime(SDL_Time ticks, SDL_DateTime *dt, bool localTime)
|
||||
{
|
||||
#if defined (HAVE_GMTIME_R) || defined(HAVE_LOCALTIME_R)
|
||||
struct tm tm_storage;
|
||||
|
||||
Loaded 100 of 258 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user