mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-01-22 03:41:02 +00:00
Updated source to match SDL function prototype style
This commit is contained in:
parent
92f72682e7
commit
3f1fd5abff
19
src/SDL.c
19
src/SDL.c
|
@ -442,8 +442,7 @@ void SDL_QuitSubSystem(Uint32 flags)
|
|||
#endif
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDL_WasInit(Uint32 flags)
|
||||
Uint32 SDL_WasInit(Uint32 flags)
|
||||
{
|
||||
int i;
|
||||
int num_subsystems = SDL_arraysize(SDL_SubsystemRefCount);
|
||||
|
@ -531,22 +530,19 @@ void SDL_GetVersion(SDL_version *ver)
|
|||
}
|
||||
|
||||
/* Get the library source revision */
|
||||
const char *
|
||||
SDL_GetRevision(void)
|
||||
const char *SDL_GetRevision(void)
|
||||
{
|
||||
return SDL_REVISION;
|
||||
}
|
||||
|
||||
/* Get the library source revision number */
|
||||
int
|
||||
SDL_GetRevisionNumber(void)
|
||||
int SDL_GetRevisionNumber(void)
|
||||
{
|
||||
return 0; /* doesn't make sense without Mercurial. */
|
||||
}
|
||||
|
||||
/* Get the name of the platform */
|
||||
const char *
|
||||
SDL_GetPlatform(void)
|
||||
const char *SDL_GetPlatform(void)
|
||||
{
|
||||
#if __AIX__
|
||||
return "AIX";
|
||||
|
@ -619,8 +615,7 @@ SDL_GetPlatform(void)
|
|||
#endif
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_IsTablet(void)
|
||||
SDL_bool SDL_IsTablet(void)
|
||||
{
|
||||
#if __ANDROID__
|
||||
extern SDL_bool SDL_IsAndroidTablet(void);
|
||||
|
@ -638,9 +633,7 @@ SDL_IsTablet(void)
|
|||
#if (!defined(HAVE_LIBC) || defined(__WATCOMC__)) && !defined(SDL_STATIC_LIB)
|
||||
/* Need to include DllMain() on Watcom C for some reason.. */
|
||||
|
||||
BOOL APIENTRY
|
||||
_DllMainCRTStartup(HANDLE hModule,
|
||||
DWORD ul_reason_for_call, LPVOID lpReserved)
|
||||
BOOL APIENTRY _DllMainCRTStartup(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
|
||||
{
|
||||
switch (ul_reason_for_call) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
|
|
|
@ -326,9 +326,7 @@ static SDL_assert_state SDLCALL SDL_PromptAssertion(const SDL_assert_data *data,
|
|||
return state;
|
||||
}
|
||||
|
||||
SDL_assert_state
|
||||
SDL_ReportAssertion(SDL_assert_data *data, const char *func, const char *file,
|
||||
int line)
|
||||
SDL_assert_state SDL_ReportAssertion(SDL_assert_data *data, const char *func, const char *file, int line)
|
||||
{
|
||||
SDL_assert_state state = SDL_ASSERTION_IGNORE;
|
||||
static int assertion_running = 0;
|
||||
|
|
|
@ -50,8 +50,7 @@ static void SDL_FreeDataQueueList(SDL_DataQueuePacket *packet)
|
|||
}
|
||||
}
|
||||
|
||||
SDL_DataQueue *
|
||||
SDL_NewDataQueue(const size_t _packetlen, const size_t initialslack)
|
||||
SDL_DataQueue *SDL_NewDataQueue(const size_t _packetlen, const size_t initialslack)
|
||||
{
|
||||
SDL_DataQueue *queue = (SDL_DataQueue *)SDL_calloc(1, sizeof(SDL_DataQueue));
|
||||
|
||||
|
@ -316,8 +315,7 @@ SDL_CountDataQueue(SDL_DataQueue *queue)
|
|||
return retval;
|
||||
}
|
||||
|
||||
SDL_mutex *
|
||||
SDL_GetDataQueueMutex(SDL_DataQueue *queue)
|
||||
SDL_mutex *SDL_GetDataQueueMutex(SDL_DataQueue *queue)
|
||||
{
|
||||
return queue ? queue->lock : NULL;
|
||||
}
|
||||
|
|
|
@ -61,8 +61,7 @@ int SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...)
|
|||
}
|
||||
|
||||
/* Available for backwards compatibility */
|
||||
const char *
|
||||
SDL_GetError(void)
|
||||
const char *SDL_GetError(void)
|
||||
{
|
||||
const SDL_error *error = SDL_GetErrBuf();
|
||||
return error->error ? error->str : "";
|
||||
|
@ -108,8 +107,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
#endif
|
||||
|
||||
char *
|
||||
SDL_GetErrorMsg(char *errstr, int maxlen)
|
||||
char *SDL_GetErrorMsg(char *errstr, int maxlen)
|
||||
{
|
||||
const SDL_error *error = SDL_GetErrBuf();
|
||||
|
||||
|
|
|
@ -45,9 +45,7 @@ typedef struct SDL_Hint
|
|||
|
||||
static SDL_Hint *SDL_hints;
|
||||
|
||||
SDL_bool
|
||||
SDL_SetHintWithPriority(const char *name, const char *value,
|
||||
SDL_HintPriority priority)
|
||||
SDL_bool SDL_SetHintWithPriority(const char *name, const char *value, SDL_HintPriority priority)
|
||||
{
|
||||
const char *env;
|
||||
SDL_Hint *hint;
|
||||
|
@ -97,8 +95,7 @@ SDL_SetHintWithPriority(const char *name, const char *value,
|
|||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_ResetHint(const char *name)
|
||||
SDL_bool SDL_ResetHint(const char *name)
|
||||
{
|
||||
const char *env;
|
||||
SDL_Hint *hint;
|
||||
|
@ -154,14 +151,12 @@ void SDL_ResetHints(void)
|
|||
}
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_SetHint(const char *name, const char *value)
|
||||
SDL_bool SDL_SetHint(const char *name, const char *value)
|
||||
{
|
||||
return SDL_SetHintWithPriority(name, value, SDL_HINT_NORMAL);
|
||||
}
|
||||
|
||||
const char *
|
||||
SDL_GetHint(const char *name)
|
||||
const char *SDL_GetHint(const char *name)
|
||||
{
|
||||
const char *env;
|
||||
SDL_Hint *hint;
|
||||
|
@ -178,8 +173,7 @@ SDL_GetHint(const char *name)
|
|||
return env;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_GetStringBoolean(const char *value, SDL_bool default_value)
|
||||
SDL_bool SDL_GetStringBoolean(const char *value, SDL_bool default_value)
|
||||
{
|
||||
if (value == NULL || !*value) {
|
||||
return default_value;
|
||||
|
@ -190,8 +184,7 @@ SDL_GetStringBoolean(const char *value, SDL_bool default_value)
|
|||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_GetHintBoolean(const char *name, SDL_bool default_value)
|
||||
SDL_bool SDL_GetHintBoolean(const char *name, SDL_bool default_value)
|
||||
{
|
||||
const char *hint = SDL_GetHint(name);
|
||||
return SDL_GetStringBoolean(hint, default_value);
|
||||
|
|
|
@ -154,8 +154,7 @@ void SDL_LogSetPriority(int category, SDL_LogPriority priority)
|
|||
}
|
||||
}
|
||||
|
||||
SDL_LogPriority
|
||||
SDL_LogGetPriority(int category)
|
||||
SDL_LogPriority SDL_LogGetPriority(int category)
|
||||
{
|
||||
SDL_LogLevel *entry;
|
||||
|
||||
|
|
|
@ -124,8 +124,7 @@ static SDL_INLINE void leaveLock(void *a)
|
|||
}
|
||||
#endif
|
||||
|
||||
SDL_bool
|
||||
SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval)
|
||||
SDL_bool SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval)
|
||||
{
|
||||
#ifdef HAVE_MSC_ATOMICS
|
||||
SDL_COMPILE_TIME_ASSERT(atomic_cas, sizeof(long) == sizeof(a->value));
|
||||
|
@ -154,8 +153,7 @@ SDL_AtomicCAS(SDL_atomic_t *a, int oldval, int newval)
|
|||
#endif
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_AtomicCASPtr(void **a, void *oldval, void *newval)
|
||||
SDL_bool SDL_AtomicCASPtr(void **a, void *oldval, void *newval)
|
||||
{
|
||||
#if defined(HAVE_MSC_ATOMICS)
|
||||
return _InterlockedCompareExchangePointer(a, newval, oldval) == oldval;
|
||||
|
@ -205,8 +203,7 @@ int SDL_AtomicSet(SDL_atomic_t *a, int v)
|
|||
#endif
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_AtomicSetPtr(void **a, void *v)
|
||||
void *SDL_AtomicSetPtr(void **a, void *v)
|
||||
{
|
||||
#if defined(HAVE_MSC_ATOMICS)
|
||||
return _InterlockedExchangePointer(a, v);
|
||||
|
@ -272,8 +269,7 @@ int SDL_AtomicGet(SDL_atomic_t *a)
|
|||
#endif
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_AtomicGetPtr(void **a)
|
||||
void *SDL_AtomicGetPtr(void **a)
|
||||
{
|
||||
#ifdef HAVE_ATOMIC_LOAD_N
|
||||
return __atomic_load_n(a, __ATOMIC_SEQ_CST);
|
||||
|
|
|
@ -61,8 +61,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_AtomicTryLock(SDL_SpinLock *lock)
|
||||
SDL_bool SDL_AtomicTryLock(SDL_SpinLock *lock)
|
||||
{
|
||||
#if SDL_ATOMIC_DISABLED
|
||||
/* Terrible terrible damage */
|
||||
|
|
|
@ -603,8 +603,7 @@ int SDL_QueueAudio(SDL_AudioDeviceID devid, const void *data, Uint32 len)
|
|||
return rc;
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDL_DequeueAudio(SDL_AudioDeviceID devid, void *data, Uint32 len)
|
||||
Uint32 SDL_DequeueAudio(SDL_AudioDeviceID devid, void *data, Uint32 len)
|
||||
{
|
||||
SDL_AudioDevice *device = get_audio_device(devid);
|
||||
Uint32 rc;
|
||||
|
@ -622,8 +621,7 @@ SDL_DequeueAudio(SDL_AudioDeviceID devid, void *data, Uint32 len)
|
|||
return rc;
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDL_GetQueuedAudioSize(SDL_AudioDeviceID devid)
|
||||
Uint32 SDL_GetQueuedAudioSize(SDL_AudioDeviceID devid)
|
||||
{
|
||||
Uint32 retval = 0;
|
||||
SDL_AudioDevice *device = get_audio_device(devid);
|
||||
|
@ -904,8 +902,7 @@ int SDL_GetNumAudioDrivers(void)
|
|||
return SDL_arraysize(bootstrap) - 1;
|
||||
}
|
||||
|
||||
const char *
|
||||
SDL_GetAudioDriver(int index)
|
||||
const char *SDL_GetAudioDriver(int index)
|
||||
{
|
||||
if (index >= 0 && index < SDL_GetNumAudioDrivers()) {
|
||||
return bootstrap[index]->name;
|
||||
|
@ -1012,8 +1009,7 @@ int SDL_AudioInit(const char *driver_name)
|
|||
/*
|
||||
* Get the current audio driver name
|
||||
*/
|
||||
const char *
|
||||
SDL_GetCurrentAudioDriver()
|
||||
const char *SDL_GetCurrentAudioDriver()
|
||||
{
|
||||
return current_audio.name;
|
||||
}
|
||||
|
@ -1073,8 +1069,7 @@ int SDL_GetNumAudioDevices(int iscapture)
|
|||
return retval;
|
||||
}
|
||||
|
||||
const char *
|
||||
SDL_GetAudioDeviceName(int index, int iscapture)
|
||||
const char *SDL_GetAudioDeviceName(int index, int iscapture)
|
||||
{
|
||||
SDL_AudioDeviceItem *item;
|
||||
int i;
|
||||
|
@ -1191,8 +1186,7 @@ static void close_audio_device(SDL_AudioDevice *device)
|
|||
SDL_free(device);
|
||||
}
|
||||
|
||||
static Uint16
|
||||
GetDefaultSamplesFromFreq(int freq)
|
||||
static Uint16 GetDefaultSamplesFromFreq(int freq)
|
||||
{
|
||||
/* Pick a default of ~46 ms at desired frequency */
|
||||
/* !!! FIXME: remove this when the non-Po2 resampling is in. */
|
||||
|
@ -1560,8 +1554,7 @@ int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained)
|
|||
return (id == 0) ? -1 : 0;
|
||||
}
|
||||
|
||||
SDL_AudioDeviceID
|
||||
SDL_OpenAudioDevice(const char *device, int iscapture,
|
||||
SDL_AudioDeviceID SDL_OpenAudioDevice(const char *device, int iscapture,
|
||||
const SDL_AudioSpec *desired, SDL_AudioSpec *obtained,
|
||||
int allowed_changes)
|
||||
{
|
||||
|
@ -1569,8 +1562,7 @@ SDL_OpenAudioDevice(const char *device, int iscapture,
|
|||
allowed_changes, 2);
|
||||
}
|
||||
|
||||
SDL_AudioStatus
|
||||
SDL_GetAudioDeviceStatus(SDL_AudioDeviceID devid)
|
||||
SDL_AudioStatus SDL_GetAudioDeviceStatus(SDL_AudioDeviceID devid)
|
||||
{
|
||||
SDL_AudioDevice *device = get_audio_device(devid);
|
||||
SDL_AudioStatus status = SDL_AUDIO_STOPPED;
|
||||
|
@ -1584,8 +1576,7 @@ SDL_GetAudioDeviceStatus(SDL_AudioDeviceID devid)
|
|||
return status;
|
||||
}
|
||||
|
||||
SDL_AudioStatus
|
||||
SDL_GetAudioStatus(void)
|
||||
SDL_AudioStatus SDL_GetAudioStatus(void)
|
||||
{
|
||||
return SDL_GetAudioDeviceStatus(1);
|
||||
}
|
||||
|
@ -1697,8 +1688,7 @@ static SDL_AudioFormat format_list[NUM_FORMATS][NUM_FORMATS] = {
|
|||
AUDIO_S16LSB, AUDIO_U16MSB, AUDIO_U16LSB, AUDIO_U8, AUDIO_S8 },
|
||||
};
|
||||
|
||||
SDL_AudioFormat
|
||||
SDL_FirstAudioFormat(SDL_AudioFormat format)
|
||||
SDL_AudioFormat SDL_FirstAudioFormat(SDL_AudioFormat format)
|
||||
{
|
||||
for (format_idx = 0; format_idx < NUM_FORMATS; ++format_idx) {
|
||||
if (format_list[format_idx][0] == format) {
|
||||
|
@ -1709,8 +1699,7 @@ SDL_FirstAudioFormat(SDL_AudioFormat format)
|
|||
return SDL_NextAudioFormat();
|
||||
}
|
||||
|
||||
SDL_AudioFormat
|
||||
SDL_NextAudioFormat(void)
|
||||
SDL_AudioFormat SDL_NextAudioFormat(void)
|
||||
{
|
||||
if ((format_idx == NUM_FORMATS) || (format_idx_sub == NUM_FORMATS)) {
|
||||
return 0;
|
||||
|
|
|
@ -1005,8 +1005,7 @@ static void SDL_CleanupAudioStreamResampler(SDL_AudioStream *stream)
|
|||
SDL_free(stream->resampler_state);
|
||||
}
|
||||
|
||||
SDL_AudioStream *
|
||||
SDL_NewAudioStream(const SDL_AudioFormat src_format,
|
||||
SDL_AudioStream *SDL_NewAudioStream(const SDL_AudioFormat src_format,
|
||||
const Uint8 src_channels,
|
||||
const int src_rate,
|
||||
const SDL_AudioFormat dst_format,
|
||||
|
|
|
@ -2077,8 +2077,7 @@ static int WaveLoad(SDL_RWops *src, WaveFile *file, SDL_AudioSpec *spec, Uint8 *
|
|||
return 0;
|
||||
}
|
||||
|
||||
SDL_AudioSpec *
|
||||
SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
|
||||
SDL_AudioSpec *SDL_LoadWAV_RW(SDL_RWops *src, int freesrc, SDL_AudioSpec *spec, Uint8 **audio_buf, Uint32 *audio_len)
|
||||
{
|
||||
int result;
|
||||
WaveFile file;
|
||||
|
|
|
@ -86,8 +86,7 @@ static struct
|
|||
|
||||
#undef SDL_ARTS_SYM
|
||||
|
||||
static void
|
||||
UnloadARTSLibrary()
|
||||
static void UnloadARTSLibrary()
|
||||
{
|
||||
if (arts_handle != NULL) {
|
||||
SDL_UnloadObject(arts_handle);
|
||||
|
@ -95,8 +94,7 @@ UnloadARTSLibrary()
|
|||
}
|
||||
}
|
||||
|
||||
static int
|
||||
LoadARTSLibrary(void)
|
||||
static int LoadARTSLibrary(void)
|
||||
{
|
||||
int i, retval = -1;
|
||||
|
||||
|
@ -121,14 +119,12 @@ LoadARTSLibrary(void)
|
|||
|
||||
#else
|
||||
|
||||
static void
|
||||
UnloadARTSLibrary()
|
||||
static void UnloadARTSLibrary()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static int
|
||||
LoadARTSLibrary(void)
|
||||
static int LoadARTSLibrary(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -136,8 +132,7 @@ LoadARTSLibrary(void)
|
|||
#endif /* SDL_AUDIO_DRIVER_ARTS_DYNAMIC */
|
||||
|
||||
/* This function waits until it is possible to write a full sound buffer */
|
||||
static void
|
||||
ARTS_WaitDevice(_THIS)
|
||||
static void ARTS_WaitDevice(_THIS)
|
||||
{
|
||||
Sint32 ticks;
|
||||
|
||||
|
@ -163,8 +158,7 @@ ARTS_WaitDevice(_THIS)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ARTS_PlayDevice(_THIS)
|
||||
static void ARTS_PlayDevice(_THIS)
|
||||
{
|
||||
/* Write the audio data */
|
||||
int written = SDL_NAME(arts_write) (this->hidden->stream,
|
||||
|
@ -185,15 +179,13 @@ ARTS_PlayDevice(_THIS)
|
|||
#endif
|
||||
}
|
||||
|
||||
static Uint8 *
|
||||
ARTS_GetDeviceBuf(_THIS)
|
||||
static Uint8 *ARTS_GetDeviceBuf(_THIS)
|
||||
{
|
||||
return (this->hidden->mixbuf);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
ARTS_CloseDevice(_THIS)
|
||||
static void ARTS_CloseDevice(_THIS)
|
||||
{
|
||||
if (this->hidden->stream) {
|
||||
SDL_NAME(arts_close_stream) (this->hidden->stream);
|
||||
|
@ -203,8 +195,7 @@ ARTS_CloseDevice(_THIS)
|
|||
SDL_free(this->hidden);
|
||||
}
|
||||
|
||||
static int
|
||||
ARTS_Suspend(void)
|
||||
static int ARTS_Suspend(void)
|
||||
{
|
||||
const Uint32 abortms = SDL_GetTicks() + 3000; /* give up after 3 secs */
|
||||
while ( (!SDL_NAME(arts_suspended)()) && !SDL_TICKS_PASSED(SDL_GetTicks(), abortms) ) {
|
||||
|
@ -215,8 +206,7 @@ ARTS_Suspend(void)
|
|||
return SDL_NAME(arts_suspended)();
|
||||
}
|
||||
|
||||
static int
|
||||
ARTS_OpenDevice(_THIS, const char *devname)
|
||||
static int ARTS_OpenDevice(_THIS, const char *devname)
|
||||
{
|
||||
int rc = 0;
|
||||
int bits, frag_spec = 0;
|
||||
|
@ -304,15 +294,13 @@ ARTS_OpenDevice(_THIS, const char *devname)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
ARTS_Deinitialize(void)
|
||||
static void ARTS_Deinitialize(void)
|
||||
{
|
||||
UnloadARTSLibrary();
|
||||
}
|
||||
|
||||
|
||||
static SDL_bool
|
||||
ARTS_Init(SDL_AudioDriverImpl * impl)
|
||||
static SDL_bool ARTS_Init(SDL_AudioDriverImpl * impl)
|
||||
{
|
||||
if (LoadARTSLibrary() < 0) {
|
||||
return SDL_FALSE;
|
||||
|
|
|
@ -64,8 +64,7 @@ static struct
|
|||
|
||||
#undef SDL_ESD_SYM
|
||||
|
||||
static void
|
||||
UnloadESDLibrary()
|
||||
static void UnloadESDLibrary()
|
||||
{
|
||||
if (esd_handle != NULL) {
|
||||
SDL_UnloadObject(esd_handle);
|
||||
|
@ -73,8 +72,7 @@ UnloadESDLibrary()
|
|||
}
|
||||
}
|
||||
|
||||
static int
|
||||
LoadESDLibrary(void)
|
||||
static int LoadESDLibrary(void)
|
||||
{
|
||||
int i, retval = -1;
|
||||
|
||||
|
@ -98,14 +96,12 @@ LoadESDLibrary(void)
|
|||
|
||||
#else
|
||||
|
||||
static void
|
||||
UnloadESDLibrary()
|
||||
static void UnloadESDLibrary()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static int
|
||||
LoadESDLibrary(void)
|
||||
static int LoadESDLibrary(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -114,8 +110,7 @@ LoadESDLibrary(void)
|
|||
|
||||
|
||||
/* This function waits until it is possible to write a full sound buffer */
|
||||
static void
|
||||
ESD_WaitDevice(_THIS)
|
||||
static void ESD_WaitDevice(_THIS)
|
||||
{
|
||||
Sint32 ticks;
|
||||
|
||||
|
@ -140,8 +135,7 @@ ESD_WaitDevice(_THIS)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
ESD_PlayDevice(_THIS)
|
||||
static void ESD_PlayDevice(_THIS)
|
||||
{
|
||||
int written = 0;
|
||||
|
||||
|
@ -164,14 +158,12 @@ ESD_PlayDevice(_THIS)
|
|||
}
|
||||
}
|
||||
|
||||
static Uint8 *
|
||||
ESD_GetDeviceBuf(_THIS)
|
||||
static Uint8 *ESD_GetDeviceBuf(_THIS)
|
||||
{
|
||||
return (this->hidden->mixbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
ESD_CloseDevice(_THIS)
|
||||
static void ESD_CloseDevice(_THIS)
|
||||
{
|
||||
if (this->hidden->audio_fd >= 0) {
|
||||
SDL_NAME(esd_close) (this->hidden->audio_fd);
|
||||
|
@ -181,8 +173,7 @@ ESD_CloseDevice(_THIS)
|
|||
}
|
||||
|
||||
/* Try to get the name of the program */
|
||||
static char *
|
||||
get_progname(void)
|
||||
static char *get_progname(void)
|
||||
{
|
||||
char *progname = NULL;
|
||||
#ifdef __LINUX__
|
||||
|
@ -207,8 +198,7 @@ get_progname(void)
|
|||
}
|
||||
|
||||
|
||||
static int
|
||||
ESD_OpenDevice(_THIS, const char *devname)
|
||||
static int ESD_OpenDevice(_THIS, const char *devname)
|
||||
{
|
||||
esd_format_t format = (ESD_STREAM | ESD_PLAY);
|
||||
SDL_AudioFormat test_format = 0;
|
||||
|
@ -286,14 +276,12 @@ ESD_OpenDevice(_THIS, const char *devname)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
ESD_Deinitialize(void)
|
||||
static void ESD_Deinitialize(void)
|
||||
{
|
||||
UnloadESDLibrary();
|
||||
}
|
||||
|
||||
static SDL_bool
|
||||
ESD_Init(SDL_AudioDriverImpl * impl)
|
||||
static SDL_bool ESD_Init(SDL_AudioDriverImpl * impl)
|
||||
{
|
||||
if (LoadESDLibrary() < 0) {
|
||||
return SDL_FALSE;
|
||||
|
|
|
@ -77,8 +77,7 @@ static struct
|
|||
|
||||
#undef SDL_FS_SYM
|
||||
|
||||
static void
|
||||
UnloadFusionSoundLibrary()
|
||||
static void UnloadFusionSoundLibrary()
|
||||
{
|
||||
if (fs_handle != NULL) {
|
||||
SDL_UnloadObject(fs_handle);
|
||||
|
@ -86,8 +85,7 @@ UnloadFusionSoundLibrary()
|
|||
}
|
||||
}
|
||||
|
||||
static int
|
||||
LoadFusionSoundLibrary(void)
|
||||
static int LoadFusionSoundLibrary(void)
|
||||
{
|
||||
int i, retval = -1;
|
||||
|
||||
|
@ -112,14 +110,12 @@ LoadFusionSoundLibrary(void)
|
|||
|
||||
#else
|
||||
|
||||
static void
|
||||
UnloadFusionSoundLibrary()
|
||||
static void UnloadFusionSoundLibrary()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
static int
|
||||
LoadFusionSoundLibrary(void)
|
||||
static int LoadFusionSoundLibrary(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -127,15 +123,13 @@ LoadFusionSoundLibrary(void)
|
|||
#endif /* SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC */
|
||||
|
||||
/* This function waits until it is possible to write a full sound buffer */
|
||||
static void
|
||||
SDL_FS_WaitDevice(_THIS)
|
||||
static void SDL_FS_WaitDevice(_THIS)
|
||||
{
|
||||
this->hidden->stream->Wait(this->hidden->stream,
|
||||
this->hidden->mixsamples);
|
||||
}
|
||||
|
||||
static void
|
||||
SDL_FS_PlayDevice(_THIS)
|
||||
static void SDL_FS_PlayDevice(_THIS)
|
||||
{
|
||||
DirectResult ret;
|
||||
|
||||
|
@ -152,15 +146,13 @@ SDL_FS_PlayDevice(_THIS)
|
|||
}
|
||||
|
||||
|
||||
static Uint8 *
|
||||
SDL_FS_GetDeviceBuf(_THIS)
|
||||
static Uint8 *SDL_FS_GetDeviceBuf(_THIS)
|
||||
{
|
||||
return (this->hidden->mixbuf);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
SDL_FS_CloseDevice(_THIS)
|
||||
static void SDL_FS_CloseDevice(_THIS)
|
||||
{
|
||||
if (this->hidden->stream) {
|
||||
this->hidden->stream->Release(this->hidden->stream);
|
||||
|
@ -173,8 +165,7 @@ SDL_FS_CloseDevice(_THIS)
|
|||
}
|
||||
|
||||
|
||||
static int
|
||||
SDL_FS_OpenDevice(_THIS, const char *devname)
|
||||
static int SDL_FS_OpenDevice(_THIS, const char *devname)
|
||||
{
|
||||
int bytes;
|
||||
SDL_AudioFormat test_format;
|
||||
|
@ -269,15 +260,13 @@ SDL_FS_OpenDevice(_THIS, const char *devname)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
SDL_FS_Deinitialize(void)
|
||||
static void SDL_FS_Deinitialize(void)
|
||||
{
|
||||
UnloadFusionSoundLibrary();
|
||||
}
|
||||
|
||||
|
||||
static SDL_bool
|
||||
SDL_FS_Init(SDL_AudioDriverImpl * impl)
|
||||
static SDL_bool SDL_FS_Init(SDL_AudioDriverImpl * impl)
|
||||
{
|
||||
if (LoadFusionSoundLibrary() < 0) {
|
||||
return SDL_FALSE;
|
||||
|
|
|
@ -45,7 +45,8 @@
|
|||
static void nacl_audio_callback(void* samples, uint32_t buffer_size, PP_TimeDelta latency, void* data);
|
||||
|
||||
/* FIXME: Make use of latency if needed */
|
||||
static void nacl_audio_callback(void* stream, uint32_t buffer_size, PP_TimeDelta latency, void* data) {
|
||||
static void nacl_audio_callback(void* stream, uint32_t buffer_size, PP_TimeDelta latency, void* data)
|
||||
{
|
||||
const int len = (int) buffer_size;
|
||||
SDL_AudioDevice* _this = (SDL_AudioDevice*) data;
|
||||
SDL_AudioCallback callback = _this->callbackspec.callback;
|
||||
|
@ -85,7 +86,8 @@ static void nacl_audio_callback(void* stream, uint32_t buffer_size, PP_TimeDelta
|
|||
SDL_UnlockMutex(_this->mixer_lock);
|
||||
}
|
||||
|
||||
static void NACLAUDIO_CloseDevice(SDL_AudioDevice *device) {
|
||||
static void NACLAUDIO_CloseDevice(SDL_AudioDevice *device)
|
||||
{
|
||||
const PPB_Core *core = PSInterfaceCore();
|
||||
const PPB_Audio *ppb_audio = PSInterfaceAudio();
|
||||
SDL_PrivateAudioData *hidden = (SDL_PrivateAudioData *) device->hidden;
|
||||
|
@ -94,8 +96,8 @@ static void NACLAUDIO_CloseDevice(SDL_AudioDevice *device) {
|
|||
core->ReleaseResource(hidden->audio);
|
||||
}
|
||||
|
||||
static int
|
||||
NACLAUDIO_OpenDevice(_THIS, const char *devname) {
|
||||
static int NACLAUDIO_OpenDevice(_THIS, const char *devname)
|
||||
{
|
||||
PP_Instance instance = PSGetInstanceId();
|
||||
const PPB_Audio *ppb_audio = PSInterfaceAudio();
|
||||
const PPB_AudioConfig *ppb_audiocfg = PSInterfaceAudioConfig();
|
||||
|
@ -128,8 +130,7 @@ NACLAUDIO_OpenDevice(_THIS, const char *devname) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static SDL_bool
|
||||
NACLAUDIO_Init(SDL_AudioDriverImpl * impl)
|
||||
static SDL_bool NACLAUDIO_Init(SDL_AudioDriverImpl * impl)
|
||||
{
|
||||
if (PSGetInstanceId() == 0) {
|
||||
return SDL_FALSE;
|
||||
|
|
|
@ -56,8 +56,7 @@ static AuEventHandlerRec *(*NAS_AuRegisterEventHandler)
|
|||
static const char *nas_library = SDL_AUDIO_DRIVER_NAS_DYNAMIC;
|
||||
static void *nas_handle = NULL;
|
||||
|
||||
static int
|
||||
load_nas_sym(const char *fn, void **addr)
|
||||
static int load_nas_sym(const char *fn, void **addr)
|
||||
{
|
||||
*addr = SDL_LoadFunction(nas_handle, fn);
|
||||
if (*addr == NULL) {
|
||||
|
@ -73,8 +72,7 @@ load_nas_sym(const char *fn, void **addr)
|
|||
#define SDL_NAS_SYM(x) NAS_##x = x
|
||||
#endif
|
||||
|
||||
static int
|
||||
load_nas_syms(void)
|
||||
static int load_nas_syms(void)
|
||||
{
|
||||
SDL_NAS_SYM(AuCloseServer);
|
||||
SDL_NAS_SYM(AuNextEvent);
|
||||
|
@ -94,8 +92,7 @@ load_nas_syms(void)
|
|||
|
||||
#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC
|
||||
|
||||
static void
|
||||
UnloadNASLibrary(void)
|
||||
static void UnloadNASLibrary(void)
|
||||
{
|
||||
if (nas_handle != NULL) {
|
||||
SDL_UnloadObject(nas_handle);
|
||||
|
@ -103,8 +100,7 @@ UnloadNASLibrary(void)
|
|||
}
|
||||
}
|
||||
|
||||
static int
|
||||
LoadNASLibrary(void)
|
||||
static int LoadNASLibrary(void)
|
||||
{
|
||||
int retval = 0;
|
||||
if (nas_handle == NULL) {
|
||||
|
@ -130,13 +126,11 @@ LoadNASLibrary(void)
|
|||
|
||||
#else
|
||||
|
||||
static void
|
||||
UnloadNASLibrary(void)
|
||||
static void UnloadNASLibrary(void)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
LoadNASLibrary(void)
|
||||
static int LoadNASLibrary(void)
|
||||
{
|
||||
load_nas_syms();
|
||||
return 0;
|
||||
|
@ -145,8 +139,7 @@ LoadNASLibrary(void)
|
|||
#endif /* SDL_AUDIO_DRIVER_NAS_DYNAMIC */
|
||||
|
||||
/* This function waits until it is possible to write a full sound buffer */
|
||||
static void
|
||||
NAS_WaitDevice(_THIS)
|
||||
static void NAS_WaitDevice(_THIS)
|
||||
{
|
||||
while (this->hidden->buf_free < this->hidden->mixlen) {
|
||||
AuEvent ev;
|
||||
|
@ -155,8 +148,7 @@ NAS_WaitDevice(_THIS)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
NAS_PlayDevice(_THIS)
|
||||
static void NAS_PlayDevice(_THIS)
|
||||
{
|
||||
while (this->hidden->mixlen > this->hidden->buf_free) {
|
||||
/*
|
||||
|
@ -182,14 +174,12 @@ NAS_PlayDevice(_THIS)
|
|||
#endif
|
||||
}
|
||||
|
||||
static Uint8 *
|
||||
NAS_GetDeviceBuf(_THIS)
|
||||
static Uint8 *NAS_GetDeviceBuf(_THIS)
|
||||
{
|
||||
return (this->hidden->mixbuf);
|
||||
}
|
||||
|
||||
static int
|
||||
NAS_CaptureFromDevice(_THIS, void *buffer, int buflen)
|
||||
static int NAS_CaptureFromDevice(_THIS, void *buffer, int buflen)
|
||||
{
|
||||
struct SDL_PrivateAudioData *h = this->hidden;
|
||||
int retval;
|
||||
|
@ -210,8 +200,7 @@ NAS_CaptureFromDevice(_THIS, void *buffer, int buflen)
|
|||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
NAS_FlushCapture(_THIS)
|
||||
static void NAS_FlushCapture(_THIS)
|
||||
{
|
||||
struct SDL_PrivateAudioData *h = this->hidden;
|
||||
AuUint32 total = 0;
|
||||
|
@ -227,8 +216,7 @@ NAS_FlushCapture(_THIS)
|
|||
} while ((br == sizeof(buf)) && (total < this->spec.size));
|
||||
}
|
||||
|
||||
static void
|
||||
NAS_CloseDevice(_THIS)
|
||||
static void NAS_CloseDevice(_THIS)
|
||||
{
|
||||
if (this->hidden->aud) {
|
||||
NAS_AuCloseServer(this->hidden->aud);
|
||||
|
@ -237,8 +225,7 @@ NAS_CloseDevice(_THIS)
|
|||
SDL_free(this->hidden);
|
||||
}
|
||||
|
||||
static AuBool
|
||||
event_handler(AuServer * aud, AuEvent * ev, AuEventHandlerRec * hnd)
|
||||
static AuBool event_handler(AuServer * aud, AuEvent * ev, AuEventHandlerRec * hnd)
|
||||
{
|
||||
SDL_AudioDevice *this = (SDL_AudioDevice *) hnd->data;
|
||||
struct SDL_PrivateAudioData *h = this->hidden;
|
||||
|
@ -281,8 +268,7 @@ event_handler(AuServer * aud, AuEvent * ev, AuEventHandlerRec * hnd)
|
|||
return AuTrue;
|
||||
}
|
||||
|
||||
static AuDeviceID
|
||||
find_device(_THIS)
|
||||
static AuDeviceID find_device(_THIS)
|
||||
{
|
||||
/* These "Au" things are all macros, not functions... */
|
||||
struct SDL_PrivateAudioData *h = this->hidden;
|
||||
|
@ -310,8 +296,7 @@ find_device(_THIS)
|
|||
return AuNone;
|
||||
}
|
||||
|
||||
static int
|
||||
NAS_OpenDevice(_THIS, const char *devname)
|
||||
static int NAS_OpenDevice(_THIS, const char *devname)
|
||||
{
|
||||
AuElement elms[3];
|
||||
int buffer_size;
|
||||
|
@ -414,14 +399,12 @@ NAS_OpenDevice(_THIS, const char *devname)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
NAS_Deinitialize(void)
|
||||
static void NAS_Deinitialize(void)
|
||||
{
|
||||
UnloadNASLibrary();
|
||||
}
|
||||
|
||||
static SDL_bool
|
||||
NAS_Init(SDL_AudioDriverImpl * impl)
|
||||
static SDL_bool NAS_Init(SDL_AudioDriverImpl * impl)
|
||||
{
|
||||
if (LoadNASLibrary() < 0) {
|
||||
return SDL_FALSE;
|
||||
|
|
|
@ -69,8 +69,7 @@ static char devsettings[][3] = {
|
|||
{'\0', '\0', '\0'}
|
||||
};
|
||||
|
||||
static int
|
||||
OpenUserDefinedDevice(char *path, int maxlen, int flags)
|
||||
static int OpenUserDefinedDevice(char *path, int maxlen, int flags)
|
||||
{
|
||||
const char *audiodev;
|
||||
int fd;
|
||||
|
@ -90,8 +89,7 @@ OpenUserDefinedDevice(char *path, int maxlen, int flags)
|
|||
return fd;
|
||||
}
|
||||
|
||||
static int
|
||||
OpenAudioPath(char *path, int maxlen, int flags, int classic)
|
||||
static int OpenAudioPath(char *path, int maxlen, int flags, int classic)
|
||||
{
|
||||
struct stat sb;
|
||||
int cycle = 0;
|
||||
|
@ -123,8 +121,7 @@ OpenAudioPath(char *path, int maxlen, int flags, int classic)
|
|||
}
|
||||
|
||||
/* This function waits until it is possible to write a full sound buffer */
|
||||
static void
|
||||
PAUDIO_WaitDevice(_THIS)
|
||||
static void PAUDIO_WaitDevice(_THIS)
|
||||
{
|
||||
fd_set fdset;
|
||||
|
||||
|
@ -176,8 +173,7 @@ PAUDIO_WaitDevice(_THIS)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
PAUDIO_PlayDevice(_THIS)
|
||||
static void PAUDIO_PlayDevice(_THIS)
|
||||
{
|
||||
int written = 0;
|
||||
const Uint8 *mixbuf = this->hidden->mixbuf;
|
||||
|
@ -206,14 +202,12 @@ PAUDIO_PlayDevice(_THIS)
|
|||
#endif
|
||||
}
|
||||
|
||||
static Uint8 *
|
||||
PAUDIO_GetDeviceBuf(_THIS)
|
||||
static Uint8 *PAUDIO_GetDeviceBuf(_THIS)
|
||||
{
|
||||
return this->hidden->mixbuf;
|
||||
}
|
||||
|
||||
static void
|
||||
PAUDIO_CloseDevice(_THIS)
|
||||
static void PAUDIO_CloseDevice(_THIS)
|
||||
{
|
||||
if (this->hidden->audio_fd >= 0) {
|
||||
close(this->hidden->audio_fd);
|
||||
|
@ -222,8 +216,7 @@ PAUDIO_CloseDevice(_THIS)
|
|||
SDL_free(this->hidden);
|
||||
}
|
||||
|
||||
static int
|
||||
PAUDIO_OpenDevice(_THIS, const char *devname)
|
||||
static int PAUDIO_OpenDevice(_THIS, const char *devname)
|
||||
{
|
||||
const char *workaround = SDL_getenv("SDL_DSP_NOSELECT");
|
||||
char audiodev[1024];
|
||||
|
@ -462,8 +455,7 @@ PAUDIO_OpenDevice(_THIS, const char *devname)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static SDL_bool
|
||||
PAUDIO_Init(SDL_AudioDriverImpl * impl)
|
||||
static SDL_bool PAUDIO_Init(SDL_AudioDriverImpl * impl)
|
||||
{
|
||||
/* !!! FIXME: not right for device enum? */
|
||||
int fd = OpenAudioPath(NULL, 0, OPEN_FLAGS, 0);
|
||||
|
|
|
@ -74,15 +74,13 @@ uint32_t qsa_playback_devices;
|
|||
QSA_Device qsa_capture_device[QSA_MAX_DEVICES];
|
||||
uint32_t qsa_capture_devices;
|
||||
|
||||
static SDL_INLINE int
|
||||
QSA_SetError(const char *fn, int status)
|
||||
static int QSA_SetError(const char *fn, int status)
|
||||
{
|
||||
return SDL_SetError("QSA: %s() failed: %s", fn, snd_strerror(status));
|
||||
}
|
||||
|
||||
/* !!! FIXME: does this need to be here? Does the SDL version not work? */
|
||||
static void
|
||||
QSA_ThreadInit(_THIS)
|
||||
static void QSA_ThreadInit(_THIS)
|
||||
{
|
||||
/* Increase default 10 priority to 25 to avoid jerky sound */
|
||||
struct sched_param param;
|
||||
|
@ -93,8 +91,7 @@ QSA_ThreadInit(_THIS)
|
|||
}
|
||||
|
||||
/* PCM channel parameters initialize function */
|
||||
static void
|
||||
QSA_InitAudioParams(snd_pcm_channel_params_t * cpars)
|
||||
static void QSA_InitAudioParams(snd_pcm_channel_params_t * cpars)
|
||||
{
|
||||
SDL_zerop(cpars);
|
||||
cpars->channel = SND_PCM_CHANNEL_PLAYBACK;
|
||||
|
@ -111,8 +108,7 @@ QSA_InitAudioParams(snd_pcm_channel_params_t * cpars)
|
|||
}
|
||||
|
||||
/* This function waits until it is possible to write a full sound buffer */
|
||||
static void
|
||||
QSA_WaitDevice(_THIS)
|
||||
static void QSA_WaitDevice(_THIS)
|
||||
{
|
||||
int result;
|
||||
|
||||
|
@ -137,8 +133,7 @@ QSA_WaitDevice(_THIS)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
QSA_PlayDevice(_THIS)
|
||||
static void QSA_PlayDevice(_THIS)
|
||||
{
|
||||
snd_pcm_channel_status_t cstatus;
|
||||
int written;
|
||||
|
@ -230,14 +225,12 @@ QSA_PlayDevice(_THIS)
|
|||
}
|
||||
}
|
||||
|
||||
static Uint8 *
|
||||
QSA_GetDeviceBuf(_THIS)
|
||||
static Uint8 *QSA_GetDeviceBuf(_THIS)
|
||||
{
|
||||
return this->hidden->pcm_buf;
|
||||
}
|
||||
|
||||
static void
|
||||
QSA_CloseDevice(_THIS)
|
||||
static void QSA_CloseDevice(_THIS)
|
||||
{
|
||||
if (this->hidden->audio_handle != NULL) {
|
||||
if (!this->iscapture) {
|
||||
|
@ -256,8 +249,7 @@ QSA_CloseDevice(_THIS)
|
|||
SDL_free(this->hidden);
|
||||
}
|
||||
|
||||
static int
|
||||
QSA_OpenDevice(_THIS, const char *devname)
|
||||
static int QSA_OpenDevice(_THIS, const char *devname)
|
||||
{
|
||||
const QSA_Device *device = (const QSA_Device *) this->handle;
|
||||
SDL_bool iscapture = this->iscapture;
|
||||
|
@ -435,8 +427,7 @@ QSA_OpenDevice(_THIS, const char *devname)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
QSA_DetectDevices(void)
|
||||
static void QSA_DetectDevices(void)
|
||||
{
|
||||
uint32_t it;
|
||||
uint32_t cards;
|
||||
|
@ -581,8 +572,7 @@ QSA_DetectDevices(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
QSA_Deinitialize(void)
|
||||
static void QSA_Deinitialize(void)
|
||||
{
|
||||
/* Clear devices array on shutdown */
|
||||
/* !!! FIXME: we zero these on init...any reason to do it here? */
|
||||
|
@ -592,8 +582,7 @@ QSA_Deinitialize(void)
|
|||
qsa_capture_devices = 0;
|
||||
}
|
||||
|
||||
static SDL_bool
|
||||
QSA_Init(SDL_AudioDriverImpl * impl)
|
||||
static SDL_bool QSA_Init(SDL_AudioDriverImpl * impl)
|
||||
{
|
||||
/* Clear devices array */
|
||||
SDL_zeroa(qsa_playback_device);
|
||||
|
|
|
@ -55,15 +55,13 @@
|
|||
static Uint8 snd2au(int sample);
|
||||
|
||||
/* Audio driver bootstrap functions */
|
||||
static void
|
||||
SUNAUDIO_DetectDevices(void)
|
||||
static void SUNAUDIO_DetectDevices(void)
|
||||
{
|
||||
SDL_EnumUnixAudioDevices(1, (int (*)(int)) NULL);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_AUDIO
|
||||
void
|
||||
CheckUnderflow(_THIS)
|
||||
void CheckUnderflow(_THIS)
|
||||
{
|
||||
#ifdef AUDIO_GETBUFINFO
|
||||
audio_info_t info;
|
||||
|
@ -78,8 +76,7 @@ CheckUnderflow(_THIS)
|
|||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
SUNAUDIO_WaitDevice(_THIS)
|
||||
static void SUNAUDIO_WaitDevice(_THIS)
|
||||
{
|
||||
#ifdef AUDIO_GETBUFINFO
|
||||
#define SLEEP_FUDGE 10 /* 10 ms scheduling fudge factor */
|
||||
|
@ -102,8 +99,7 @@ SUNAUDIO_WaitDevice(_THIS)
|
|||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
SUNAUDIO_PlayDevice(_THIS)
|
||||
static void SUNAUDIO_PlayDevice(_THIS)
|
||||
{
|
||||
/* Write the audio data */
|
||||
if (this->hidden->ulaw_only) {
|
||||
|
@ -170,14 +166,12 @@ SUNAUDIO_PlayDevice(_THIS)
|
|||
}
|
||||
}
|
||||
|
||||
static Uint8 *
|
||||
SUNAUDIO_GetDeviceBuf(_THIS)
|
||||
static Uint8 *SUNAUDIO_GetDeviceBuf(_THIS)
|
||||
{
|
||||
return (this->hidden->mixbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
SUNAUDIO_CloseDevice(_THIS)
|
||||
static void SUNAUDIO_CloseDevice(_THIS)
|
||||
{
|
||||
SDL_free(this->hidden->ulaw_buf);
|
||||
if (this->hidden->audio_fd >= 0) {
|
||||
|
@ -187,8 +181,7 @@ SUNAUDIO_CloseDevice(_THIS)
|
|||
SDL_free(this->hidden);
|
||||
}
|
||||
|
||||
static int
|
||||
SUNAUDIO_OpenDevice(_THIS, const char *devname)
|
||||
static int SUNAUDIO_OpenDevice(_THIS, const char *devname)
|
||||
{
|
||||
#ifdef AUDIO_SETINFO
|
||||
int enc;
|
||||
|
@ -359,8 +352,7 @@ SUNAUDIO_OpenDevice(_THIS, const char *devname)
|
|||
/* provided "as is" without express or implied warranty. */
|
||||
/************************************************************************/
|
||||
|
||||
static Uint8
|
||||
snd2au(int sample)
|
||||
static Uint8 snd2au(int sample)
|
||||
{
|
||||
|
||||
int mask;
|
||||
|
@ -394,8 +386,7 @@ snd2au(int sample)
|
|||
return (mask & sample);
|
||||
}
|
||||
|
||||
static SDL_bool
|
||||
SUNAUDIO_Init(SDL_AudioDriverImpl * impl)
|
||||
static SDL_bool SUNAUDIO_Init(SDL_AudioDriverImpl * impl)
|
||||
{
|
||||
/* Set the function pointers */
|
||||
impl->DetectDevices = SUNAUDIO_DetectDevices;
|
||||
|
|
|
@ -97,16 +97,13 @@ static void DetectWave##typ##Devs(void) { \
|
|||
DETECT_DEV_IMPL(SDL_FALSE, Out, WAVEOUTCAPS)
|
||||
DETECT_DEV_IMPL(SDL_TRUE, In, WAVEINCAPS)
|
||||
|
||||
static void
|
||||
WINMM_DetectDevices(void)
|
||||
static void WINMM_DetectDevices(void)
|
||||
{
|
||||
DetectWaveInDevs();
|
||||
DetectWaveOutDevs();
|
||||
}
|
||||
|
||||
static void CALLBACK
|
||||
CaptureSound(HWAVEIN hwi, UINT uMsg, DWORD_PTR dwInstance,
|
||||
DWORD_PTR dwParam1, DWORD_PTR dwParam2)
|
||||
static void CALLBACK CaptureSound(HWAVEIN hwi, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
|
||||
{
|
||||
SDL_AudioDevice *this = (SDL_AudioDevice *) dwInstance;
|
||||
|
||||
|
@ -120,9 +117,7 @@ CaptureSound(HWAVEIN hwi, UINT uMsg, DWORD_PTR dwInstance,
|
|||
|
||||
|
||||
/* The Win32 callback for filling the WAVE device */
|
||||
static void CALLBACK
|
||||
FillSound(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance,
|
||||
DWORD_PTR dwParam1, DWORD_PTR dwParam2)
|
||||
static void CALLBACK FillSound(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2)
|
||||
{
|
||||
SDL_AudioDevice *this = (SDL_AudioDevice *) dwInstance;
|
||||
|
||||
|
@ -134,8 +129,7 @@ FillSound(HWAVEOUT hwo, UINT uMsg, DWORD_PTR dwInstance,
|
|||
ReleaseSemaphore(this->hidden->audio_sem, 1, NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
SetMMerror(const char *function, MMRESULT code)
|
||||
static int SetMMerror(const char *function, MMRESULT code)
|
||||
{
|
||||
int len;
|
||||
char errbuf[MAXERRORLENGTH];
|
||||
|
@ -151,22 +145,19 @@ SetMMerror(const char *function, MMRESULT code)
|
|||
return SDL_SetError("%s", errbuf);
|
||||
}
|
||||
|
||||
static void
|
||||
WINMM_WaitDevice(_THIS)
|
||||
static void WINMM_WaitDevice(_THIS)
|
||||
{
|
||||
/* Wait for an audio chunk to finish */
|
||||
WaitForSingleObject(this->hidden->audio_sem, INFINITE);
|
||||
}
|
||||
|
||||
static Uint8 *
|
||||
WINMM_GetDeviceBuf(_THIS)
|
||||
static Uint8 *WINMM_GetDeviceBuf(_THIS)
|
||||
{
|
||||
return (Uint8 *) (this->hidden->
|
||||
wavebuf[this->hidden->next_buffer].lpData);
|
||||
}
|
||||
|
||||
static void
|
||||
WINMM_PlayDevice(_THIS)
|
||||
static void WINMM_PlayDevice(_THIS)
|
||||
{
|
||||
/* Queue it up */
|
||||
waveOutWrite(this->hidden->hout,
|
||||
|
@ -175,8 +166,7 @@ WINMM_PlayDevice(_THIS)
|
|||
this->hidden->next_buffer = (this->hidden->next_buffer + 1) % NUM_BUFFERS;
|
||||
}
|
||||
|
||||
static int
|
||||
WINMM_CaptureFromDevice(_THIS, void *buffer, int buflen)
|
||||
static int WINMM_CaptureFromDevice(_THIS, void *buffer, int buflen)
|
||||
{
|
||||
const int nextbuf = this->hidden->next_buffer;
|
||||
MMRESULT result;
|
||||
|
@ -202,8 +192,7 @@ WINMM_CaptureFromDevice(_THIS, void *buffer, int buflen)
|
|||
return this->spec.size;
|
||||
}
|
||||
|
||||
static void
|
||||
WINMM_FlushCapture(_THIS)
|
||||
static void WINMM_FlushCapture(_THIS)
|
||||
{
|
||||
/* Wait for an audio chunk to finish */
|
||||
if (WaitForSingleObject(this->hidden->audio_sem, 0) == WAIT_OBJECT_0) {
|
||||
|
@ -216,8 +205,7 @@ WINMM_FlushCapture(_THIS)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
WINMM_CloseDevice(_THIS)
|
||||
static void WINMM_CloseDevice(_THIS)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -258,8 +246,7 @@ WINMM_CloseDevice(_THIS)
|
|||
SDL_free(this->hidden);
|
||||
}
|
||||
|
||||
static SDL_bool
|
||||
PrepWaveFormat(_THIS, UINT devId, WAVEFORMATEX *pfmt, const int iscapture)
|
||||
static SDL_bool PrepWaveFormat(_THIS, UINT devId, WAVEFORMATEX *pfmt, const int iscapture)
|
||||
{
|
||||
SDL_zerop(pfmt);
|
||||
|
||||
|
@ -282,8 +269,7 @@ PrepWaveFormat(_THIS, UINT devId, WAVEFORMATEX *pfmt, const int iscapture)
|
|||
}
|
||||
}
|
||||
|
||||
static int
|
||||
WINMM_OpenDevice(_THIS, const char *devname)
|
||||
static int WINMM_OpenDevice(_THIS, const char *devname)
|
||||
{
|
||||
SDL_AudioFormat test_format;
|
||||
SDL_bool iscapture = this->iscapture;
|
||||
|
@ -431,8 +417,7 @@ WINMM_OpenDevice(_THIS, const char *devname)
|
|||
return 0; /* Ready to go! */
|
||||
}
|
||||
|
||||
static SDL_bool
|
||||
WINMM_Init(SDL_AudioDriverImpl * impl)
|
||||
static SDL_bool WINMM_Init(SDL_AudioDriverImpl * impl)
|
||||
{
|
||||
/* Set the function pointers */
|
||||
impl->DetectDevices = WINMM_DetectDevices;
|
||||
|
|
|
@ -221,8 +221,7 @@ static void kbd_register_emerg_cleanup(SDL_EVDEV_keyboard_state *kbd)
|
|||
}
|
||||
}
|
||||
|
||||
SDL_EVDEV_keyboard_state *
|
||||
SDL_EVDEV_kbd_init(void)
|
||||
SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void)
|
||||
{
|
||||
SDL_EVDEV_keyboard_state *kbd;
|
||||
struct mouse_info mData;
|
||||
|
|
|
@ -193,8 +193,7 @@ void SDL_DBus_Quit(void)
|
|||
inhibit_handle = NULL;
|
||||
}
|
||||
|
||||
SDL_DBusContext *
|
||||
SDL_DBus_GetContext(void)
|
||||
SDL_DBusContext *SDL_DBus_GetContext(void)
|
||||
{
|
||||
if (dbus_handle == NULL || !dbus.session_conn) {
|
||||
SDL_DBus_Init();
|
||||
|
@ -246,8 +245,7 @@ static SDL_bool SDL_DBus_CallMethodInternal(DBusConnection *conn, const char *no
|
|||
return retval;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_DBus_CallMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...)
|
||||
SDL_bool SDL_DBus_CallMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...)
|
||||
{
|
||||
SDL_bool retval;
|
||||
va_list ap;
|
||||
|
@ -257,8 +255,7 @@ SDL_DBus_CallMethodOnConnection(DBusConnection *conn, const char *node, const ch
|
|||
return retval;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_DBus_CallMethod(const char *node, const char *path, const char *interface, const char *method, ...)
|
||||
SDL_bool SDL_DBus_CallMethod(const char *node, const char *path, const char *interface, const char *method, ...)
|
||||
{
|
||||
SDL_bool retval;
|
||||
va_list ap;
|
||||
|
@ -315,8 +312,7 @@ static SDL_bool SDL_DBus_CallWithBasicReply(DBusConnection *conn, DBusMessage *m
|
|||
return retval;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_DBus_CallVoidMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...)
|
||||
SDL_bool SDL_DBus_CallVoidMethodOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *method, ...)
|
||||
{
|
||||
SDL_bool retval;
|
||||
va_list ap;
|
||||
|
@ -326,8 +322,7 @@ SDL_DBus_CallVoidMethodOnConnection(DBusConnection *conn, const char *node, cons
|
|||
return retval;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_DBus_CallVoidMethod(const char *node, const char *path, const char *interface, const char *method, ...)
|
||||
SDL_bool SDL_DBus_CallVoidMethod(const char *node, const char *path, const char *interface, const char *method, ...)
|
||||
{
|
||||
SDL_bool retval;
|
||||
va_list ap;
|
||||
|
@ -337,8 +332,7 @@ SDL_DBus_CallVoidMethod(const char *node, const char *path, const char *interfac
|
|||
return retval;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result)
|
||||
SDL_bool SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result)
|
||||
{
|
||||
SDL_bool retval = SDL_FALSE;
|
||||
|
||||
|
@ -355,8 +349,7 @@ SDL_DBus_QueryPropertyOnConnection(DBusConnection *conn, const char *node, const
|
|||
return retval;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_DBus_QueryProperty(const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result)
|
||||
SDL_bool SDL_DBus_QueryProperty(const char *node, const char *path, const char *interface, const char *property, const int expectedtype, void *result)
|
||||
{
|
||||
return SDL_DBus_QueryPropertyOnConnection(dbus.session_conn, node, path, interface, property, expectedtype, result);
|
||||
}
|
||||
|
@ -407,8 +400,7 @@ failed:
|
|||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_DBus_ScreensaverInhibit(SDL_bool inhibit)
|
||||
SDL_bool SDL_DBus_ScreensaverInhibit(SDL_bool inhibit)
|
||||
{
|
||||
const char *default_inhibit_reason = "Playing a game";
|
||||
|
||||
|
|
|
@ -296,8 +296,7 @@ static void kbd_register_emerg_cleanup(SDL_EVDEV_keyboard_state *kbd)
|
|||
}
|
||||
}
|
||||
|
||||
SDL_EVDEV_keyboard_state *
|
||||
SDL_EVDEV_kbd_init(void)
|
||||
SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void)
|
||||
{
|
||||
SDL_EVDEV_keyboard_state *kbd;
|
||||
char flag_state;
|
||||
|
@ -805,8 +804,7 @@ void SDL_EVDEV_kbd_keycode(SDL_EVDEV_keyboard_state *state, unsigned int keycode
|
|||
|
||||
#elif !defined(SDL_INPUT_FBSDKBIO) /* !SDL_INPUT_LINUXKD */
|
||||
|
||||
SDL_EVDEV_keyboard_state *
|
||||
SDL_EVDEV_kbd_init(void)
|
||||
SDL_EVDEV_keyboard_state *SDL_EVDEV_kbd_init(void)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -83,8 +83,7 @@ static char *GetAppName()
|
|||
return SDL_strdup("SDL_App");
|
||||
}
|
||||
|
||||
static size_t
|
||||
Fcitx_GetPreeditString(SDL_DBusContext *dbus,
|
||||
static size_t Fcitx_GetPreeditString(SDL_DBusContext *dbus,
|
||||
DBusMessage *msg,
|
||||
char **ret,
|
||||
Sint32 *start_pos,
|
||||
|
@ -369,8 +368,7 @@ static Uint32 Fcitx_ModState(void)
|
|||
return fcitx_mods;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_Fcitx_Init()
|
||||
SDL_bool SDL_Fcitx_Init()
|
||||
{
|
||||
fcitx_client.dbus = SDL_DBus_GetContext();
|
||||
|
||||
|
@ -406,8 +404,7 @@ void SDL_Fcitx_Reset(void)
|
|||
FcitxClientICCallMethod(&fcitx_client, "CloseIC");
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state)
|
||||
SDL_bool SDL_Fcitx_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state)
|
||||
{
|
||||
Uint32 mod_state = Fcitx_ModState();
|
||||
Uint32 handled = SDL_FALSE;
|
||||
|
|
|
@ -555,8 +555,7 @@ static SDL_bool IBus_CheckConnection(SDL_DBusContext *dbus)
|
|||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_IBus_Init(void)
|
||||
SDL_bool SDL_IBus_Init(void)
|
||||
{
|
||||
SDL_bool result = SDL_FALSE;
|
||||
SDL_DBusContext *dbus = SDL_DBus_GetContext();
|
||||
|
@ -671,8 +670,7 @@ void SDL_IBus_Reset(void)
|
|||
IBus_SimpleMessage("Reset");
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state)
|
||||
SDL_bool SDL_IBus_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state)
|
||||
{
|
||||
Uint32 result = 0;
|
||||
SDL_DBusContext *dbus = SDL_DBus_GetContext();
|
||||
|
@ -717,16 +715,16 @@ void SDL_IBus_UpdateTextRect(const SDL_Rect *rect)
|
|||
}
|
||||
|
||||
SDL_GetWindowPosition(focused_win, &x, &y);
|
||||
|
||||
#if SDL_VIDEO_DRIVER_X11
|
||||
|
||||
#if SDL_VIDEO_DRIVER_X11
|
||||
if (info.subsystem == SDL_SYSWM_X11) {
|
||||
SDL_DisplayData *displaydata = (SDL_DisplayData *) SDL_GetDisplayForWindow(focused_win)->driverdata;
|
||||
|
||||
|
||||
Display *x_disp = info.info.x11.display;
|
||||
Window x_win = info.info.x11.window;
|
||||
int x_screen = displaydata->screen;
|
||||
Window unused;
|
||||
|
||||
|
||||
X11_XTranslateCoordinates(x_disp, x_win, RootWindow(x_disp, x_screen), 0, 0, &x, &y, &unused);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -83,8 +83,7 @@ static void InitIME()
|
|||
#endif /* HAVE_IBUS_IBUS_H */
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_IME_Init(void)
|
||||
SDL_bool SDL_IME_Init(void)
|
||||
{
|
||||
InitIME();
|
||||
|
||||
|
@ -127,8 +126,7 @@ void SDL_IME_Reset(void)
|
|||
}
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state)
|
||||
SDL_bool SDL_IME_ProcessKeyEvent(Uint32 keysym, Uint32 keycode, Uint8 state)
|
||||
{
|
||||
if (SDL_IME_ProcessKeyEvent_Real) {
|
||||
return SDL_IME_ProcessKeyEvent_Real(keysym, keycode, state);
|
||||
|
|
|
@ -222,8 +222,7 @@ void SDL_UDEV_Scan(void)
|
|||
_this->syms.udev_enumerate_unref(enumerate);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_UDEV_GetProductInfo(const char *device_path, Uint16 *vendor, Uint16 *product, Uint16 *version)
|
||||
SDL_bool SDL_UDEV_GetProductInfo(const char *device_path, Uint16 *vendor, Uint16 *product, Uint16 *version)
|
||||
{
|
||||
struct udev_enumerate *enumerate = NULL;
|
||||
struct udev_list_entry *devs = NULL;
|
||||
|
@ -550,8 +549,7 @@ void SDL_UDEV_DelCallback(SDL_UDEV_Callback cb)
|
|||
}
|
||||
}
|
||||
|
||||
const SDL_UDEV_Symbols *
|
||||
SDL_UDEV_GetUdevSyms(void)
|
||||
const SDL_UDEV_Symbols *SDL_UDEV_GetUdevSyms(void)
|
||||
{
|
||||
if (SDL_UDEV_Init() < 0) {
|
||||
SDL_SetError("Could not initialize UDEV");
|
||||
|
|
|
@ -505,8 +505,7 @@ int SDL_IMMDevice_GetDefaultAudioInfo(char **name, SDL_AudioSpec *spec, int isca
|
|||
return 0;
|
||||
}
|
||||
|
||||
SDL_AudioFormat
|
||||
WaveFormatToSDLFormat(WAVEFORMATEX *waveformat)
|
||||
SDL_AudioFormat WaveFormatToSDLFormat(WAVEFORMATEX *waveformat)
|
||||
{
|
||||
if ((waveformat->wFormatTag == WAVE_FORMAT_IEEE_FLOAT) && (waveformat->wBitsPerSample == 32)) {
|
||||
return AUDIO_F32SYS;
|
||||
|
|
|
@ -122,8 +122,7 @@ void WIN_CoUninitialize(void)
|
|||
}
|
||||
|
||||
#ifndef __WINRT__
|
||||
void *
|
||||
WIN_LoadComBaseFunction(const char *name)
|
||||
void *WIN_LoadComBaseFunction(const char *name)
|
||||
{
|
||||
static SDL_bool s_bLoaded;
|
||||
static HMODULE s_hComBase;
|
||||
|
@ -248,8 +247,7 @@ has the same problem.)
|
|||
|
||||
WASAPI doesn't need this. This is just for DirectSound/WinMM.
|
||||
*/
|
||||
char *
|
||||
WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid)
|
||||
char *WIN_LookupAudioDeviceName(const WCHAR *name, const GUID *guid)
|
||||
{
|
||||
#if defined(__WINRT__) || defined(__XBOXONE__) || defined(__XBOXSERIES__)
|
||||
return WIN_StringToUTF8(name); /* No registry access on WinRT/UWP and Xbox, go with what we've got. */
|
||||
|
@ -370,8 +368,7 @@ int SDL_Direct3D9GetAdapterIndex(int displayIndex)
|
|||
return 0; /* D3DADAPTER_DEFAULT */
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_DXGIGetOutputInfo(int displayIndex, int *adapterIndex, int *outputIndex)
|
||||
SDL_bool SDL_DXGIGetOutputInfo(int displayIndex, int *adapterIndex, int *outputIndex)
|
||||
{
|
||||
(void)displayIndex;
|
||||
if (adapterIndex) {
|
||||
|
|
|
@ -991,92 +991,77 @@ SDL_bool SDL_HasRDTSC(void)
|
|||
return CPU_FEATURE_AVAILABLE(CPU_HAS_RDTSC);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasAltiVec(void)
|
||||
SDL_bool SDL_HasAltiVec(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_ALTIVEC);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasMMX(void)
|
||||
SDL_bool SDL_HasMMX(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_MMX);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_Has3DNow(void)
|
||||
SDL_bool SDL_Has3DNow(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_3DNOW);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasSSE(void)
|
||||
SDL_bool SDL_HasSSE(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasSSE2(void)
|
||||
SDL_bool SDL_HasSSE2(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE2);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasSSE3(void)
|
||||
SDL_bool SDL_HasSSE3(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE3);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasSSE41(void)
|
||||
SDL_bool SDL_HasSSE41(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE41);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasSSE42(void)
|
||||
SDL_bool SDL_HasSSE42(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_SSE42);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasAVX(void)
|
||||
SDL_bool SDL_HasAVX(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasAVX2(void)
|
||||
SDL_bool SDL_HasAVX2(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX2);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasAVX512F(void)
|
||||
SDL_bool SDL_HasAVX512F(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_AVX512F);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasARMSIMD(void)
|
||||
SDL_bool SDL_HasARMSIMD(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_ARM_SIMD);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasNEON(void)
|
||||
SDL_bool SDL_HasNEON(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_NEON);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasLSX(void)
|
||||
SDL_bool SDL_HasLSX(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_LSX);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasLASX(void)
|
||||
SDL_bool SDL_HasLASX(void)
|
||||
{
|
||||
return CPU_FEATURE_AVAILABLE(CPU_HAS_LASX);
|
||||
}
|
||||
|
@ -1155,8 +1140,7 @@ int SDL_GetSystemRAM(void)
|
|||
return SDL_SystemRAM;
|
||||
}
|
||||
|
||||
size_t
|
||||
SDL_SIMDGetAlignment(void)
|
||||
size_t SDL_SIMDGetAlignment(void)
|
||||
{
|
||||
if (SDL_SIMDAlignment == 0xFFFFFFFF) {
|
||||
SDL_GetCPUFeatures(); /* make sure this has been calculated */
|
||||
|
@ -1165,8 +1149,7 @@ SDL_SIMDGetAlignment(void)
|
|||
return SDL_SIMDAlignment;
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_SIMDAlloc(const size_t len)
|
||||
void *SDL_SIMDAlloc(const size_t len)
|
||||
{
|
||||
const size_t alignment = SDL_SIMDGetAlignment();
|
||||
const size_t padding = (alignment - (len % alignment)) % alignment;
|
||||
|
@ -1190,8 +1173,7 @@ SDL_SIMDAlloc(const size_t len)
|
|||
return retval;
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_SIMDRealloc(void *mem, const size_t len)
|
||||
void *SDL_SIMDRealloc(void *mem, const size_t len)
|
||||
{
|
||||
const size_t alignment = SDL_SIMDGetAlignment();
|
||||
const size_t padding = (alignment - (len % alignment)) % alignment;
|
||||
|
|
|
@ -350,8 +350,7 @@ static Sint32 initialize_jumptable(Uint32 apiver, void *table, Uint32 tablesize)
|
|||
typedef Sint32(SDLCALL *SDL_DYNAPI_ENTRYFN)(Uint32 apiver, void *table, Uint32 tablesize);
|
||||
extern DECLSPEC Sint32 SDLCALL SDL_DYNAPI_entry(Uint32, void *, Uint32);
|
||||
|
||||
Sint32
|
||||
SDL_DYNAPI_entry(Uint32 apiver, void *table, Uint32 tablesize)
|
||||
Sint32 SDL_DYNAPI_entry(Uint32 apiver, void *table, Uint32 tablesize)
|
||||
{
|
||||
return initialize_jumptable(apiver, table, tablesize);
|
||||
}
|
||||
|
|
|
@ -640,8 +640,7 @@ static const char *SDL_scancode_names[SDL_NUM_SCANCODES] = {
|
|||
};
|
||||
|
||||
/* Taken from SDL_iconv() */
|
||||
char *
|
||||
SDL_UCS4ToUTF8(Uint32 ch, char *dst)
|
||||
char *SDL_UCS4ToUTF8(Uint32 ch, char *dst)
|
||||
{
|
||||
Uint8 *p = (Uint8 *)dst;
|
||||
if (ch <= 0x7F) {
|
||||
|
@ -756,8 +755,7 @@ void SDL_SetScancodeName(SDL_Scancode scancode, const char *name)
|
|||
SDL_scancode_names[scancode] = name;
|
||||
}
|
||||
|
||||
SDL_Window *
|
||||
SDL_GetKeyboardFocus(void)
|
||||
SDL_Window *SDL_GetKeyboardFocus(void)
|
||||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
|
||||
|
@ -1011,8 +1009,7 @@ void SDL_ReleaseAutoReleaseKeys(void)
|
|||
}
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HardwareKeyboardKeyPressed(void)
|
||||
SDL_bool SDL_HardwareKeyboardKeyPressed(void)
|
||||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
SDL_Scancode scancode;
|
||||
|
@ -1089,8 +1086,7 @@ void SDL_KeyboardQuit(void)
|
|||
{
|
||||
}
|
||||
|
||||
const Uint8 *
|
||||
SDL_GetKeyboardState(int *numkeys)
|
||||
const Uint8 *SDL_GetKeyboardState(int *numkeys)
|
||||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
|
||||
|
@ -1100,8 +1096,7 @@ SDL_GetKeyboardState(int *numkeys)
|
|||
return keyboard->keystate;
|
||||
}
|
||||
|
||||
SDL_Keymod
|
||||
SDL_GetModState(void)
|
||||
SDL_Keymod SDL_GetModState(void)
|
||||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
|
||||
|
@ -1126,8 +1121,7 @@ void SDL_ToggleModState(const SDL_Keymod modstate, const SDL_bool toggle)
|
|||
}
|
||||
}
|
||||
|
||||
SDL_Keycode
|
||||
SDL_GetKeyFromScancode(SDL_Scancode scancode)
|
||||
SDL_Keycode SDL_GetKeyFromScancode(SDL_Scancode scancode)
|
||||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
|
||||
|
@ -1139,8 +1133,7 @@ SDL_GetKeyFromScancode(SDL_Scancode scancode)
|
|||
return keyboard->keymap[scancode];
|
||||
}
|
||||
|
||||
SDL_Keycode
|
||||
SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode)
|
||||
SDL_Keycode SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode)
|
||||
{
|
||||
if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) {
|
||||
SDL_InvalidParamError("scancode");
|
||||
|
@ -1150,8 +1143,7 @@ SDL_GetDefaultKeyFromScancode(SDL_Scancode scancode)
|
|||
return SDL_default_keymap[scancode];
|
||||
}
|
||||
|
||||
SDL_Scancode
|
||||
SDL_GetScancodeFromKey(SDL_Keycode key)
|
||||
SDL_Scancode SDL_GetScancodeFromKey(SDL_Keycode key)
|
||||
{
|
||||
SDL_Keyboard *keyboard = &SDL_keyboard;
|
||||
SDL_Scancode scancode;
|
||||
|
@ -1165,8 +1157,7 @@ SDL_GetScancodeFromKey(SDL_Keycode key)
|
|||
return SDL_SCANCODE_UNKNOWN;
|
||||
}
|
||||
|
||||
const char *
|
||||
SDL_GetScancodeName(SDL_Scancode scancode)
|
||||
const char *SDL_GetScancodeName(SDL_Scancode scancode)
|
||||
{
|
||||
const char *name;
|
||||
if (((int)scancode) < SDL_SCANCODE_UNKNOWN || scancode >= SDL_NUM_SCANCODES) {
|
||||
|
@ -1204,8 +1195,7 @@ SDL_Scancode SDL_GetScancodeFromName(const char *name)
|
|||
return SDL_SCANCODE_UNKNOWN;
|
||||
}
|
||||
|
||||
const char *
|
||||
SDL_GetKeyName(SDL_Keycode key)
|
||||
const char *SDL_GetKeyName(SDL_Keycode key)
|
||||
{
|
||||
static char name[8];
|
||||
char *end;
|
||||
|
@ -1242,8 +1232,7 @@ SDL_GetKeyName(SDL_Keycode key)
|
|||
}
|
||||
}
|
||||
|
||||
SDL_Keycode
|
||||
SDL_GetKeyFromName(const char *name)
|
||||
SDL_Keycode SDL_GetKeyFromName(const char *name)
|
||||
{
|
||||
SDL_Keycode key;
|
||||
|
||||
|
|
|
@ -387,8 +387,7 @@ static const struct {
|
|||
};
|
||||
/* *INDENT-ON* */ /* clang-format on */
|
||||
|
||||
SDL_Scancode
|
||||
SDL_GetScancodeFromKeySym(Uint32 keysym, Uint32 keycode)
|
||||
SDL_Scancode SDL_GetScancodeFromKeySym(Uint32 keysym, Uint32 keycode)
|
||||
{
|
||||
int i;
|
||||
Uint32 linux_keycode = 0;
|
||||
|
|
|
@ -226,8 +226,7 @@ void SDL_SetDefaultCursor(SDL_Cursor *cursor)
|
|||
}
|
||||
}
|
||||
|
||||
SDL_Mouse *
|
||||
SDL_GetMouse(void)
|
||||
SDL_Mouse *SDL_GetMouse(void)
|
||||
{
|
||||
return &SDL_mouse;
|
||||
}
|
||||
|
@ -245,8 +244,7 @@ static Uint32 GetButtonState(SDL_Mouse *mouse, SDL_bool include_touch)
|
|||
return buttonstate;
|
||||
}
|
||||
|
||||
SDL_Window *
|
||||
SDL_GetMouseFocus(void)
|
||||
SDL_Window *SDL_GetMouseFocus(void)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
|
@ -261,8 +259,7 @@ SDL_GetMouseFocus(void)
|
|||
* -flibit
|
||||
*/
|
||||
#if 0
|
||||
void
|
||||
SDL_ResetMouse(void)
|
||||
void SDL_ResetMouse(void)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
Uint32 buttonState = GetButtonState(mouse, SDL_FALSE);
|
||||
|
@ -946,8 +943,7 @@ void SDL_MouseQuit(void)
|
|||
SDL_MouseRelativeWarpMotionChanged, mouse);
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDL_GetMouseState(int *x, int *y)
|
||||
Uint32 SDL_GetMouseState(int *x, int *y)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
|
@ -960,8 +956,7 @@ SDL_GetMouseState(int *x, int *y)
|
|||
return GetButtonState(mouse, SDL_TRUE);
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDL_GetRelativeMouseState(int *x, int *y)
|
||||
Uint32 SDL_GetRelativeMouseState(int *x, int *y)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
|
@ -976,8 +971,7 @@ SDL_GetRelativeMouseState(int *x, int *y)
|
|||
return GetButtonState(mouse, SDL_TRUE);
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDL_GetGlobalMouseState(int *x, int *y)
|
||||
Uint32 SDL_GetGlobalMouseState(int *x, int *y)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
|
@ -1133,8 +1127,7 @@ int SDL_SetRelativeMouseMode(SDL_bool enabled)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_GetRelativeMouseMode()
|
||||
SDL_bool SDL_GetRelativeMouseMode()
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
|
@ -1219,8 +1212,7 @@ int SDL_CaptureMouse(SDL_bool enabled)
|
|||
return SDL_UpdateMouseCapture(SDL_FALSE);
|
||||
}
|
||||
|
||||
SDL_Cursor *
|
||||
SDL_CreateCursor(const Uint8 *data, const Uint8 *mask,
|
||||
SDL_Cursor *SDL_CreateCursor(const Uint8 *data, const Uint8 *mask,
|
||||
int w, int h, int hot_x, int hot_y)
|
||||
{
|
||||
SDL_Surface *surface;
|
||||
|
@ -1268,8 +1260,7 @@ SDL_CreateCursor(const Uint8 *data, const Uint8 *mask,
|
|||
return cursor;
|
||||
}
|
||||
|
||||
SDL_Cursor *
|
||||
SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y)
|
||||
SDL_Cursor *SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
SDL_Surface *temp = NULL;
|
||||
|
@ -1311,8 +1302,7 @@ SDL_CreateColorCursor(SDL_Surface *surface, int hot_x, int hot_y)
|
|||
return cursor;
|
||||
}
|
||||
|
||||
SDL_Cursor *
|
||||
SDL_CreateSystemCursor(SDL_SystemCursor id)
|
||||
SDL_Cursor *SDL_CreateSystemCursor(SDL_SystemCursor id)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
SDL_Cursor *cursor;
|
||||
|
@ -1379,8 +1369,7 @@ void SDL_SetCursor(SDL_Cursor *cursor)
|
|||
}
|
||||
}
|
||||
|
||||
SDL_Cursor *
|
||||
SDL_GetCursor(void)
|
||||
SDL_Cursor *SDL_GetCursor(void)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
|
@ -1390,8 +1379,7 @@ SDL_GetCursor(void)
|
|||
return mouse->cur_cursor;
|
||||
}
|
||||
|
||||
SDL_Cursor *
|
||||
SDL_GetDefaultCursor(void)
|
||||
SDL_Cursor *SDL_GetDefaultCursor(void)
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
|
|
|
@ -50,8 +50,7 @@ int SDL_GetNumTouchDevices(void)
|
|||
return SDL_num_touch;
|
||||
}
|
||||
|
||||
SDL_TouchID
|
||||
SDL_GetTouchDevice(int index)
|
||||
SDL_TouchID SDL_GetTouchDevice(int index)
|
||||
{
|
||||
if (index < 0 || index >= SDL_num_touch) {
|
||||
SDL_SetError("Unknown touch device index %d", index);
|
||||
|
@ -60,8 +59,7 @@ SDL_GetTouchDevice(int index)
|
|||
return SDL_touchDevices[index]->id;
|
||||
}
|
||||
|
||||
const char *
|
||||
SDL_GetTouchName(int index)
|
||||
const char *SDL_GetTouchName(int index)
|
||||
{
|
||||
if (index < 0 || index >= SDL_num_touch) {
|
||||
SDL_SetError("Unknown touch device");
|
||||
|
@ -84,8 +82,7 @@ static int SDL_GetTouchIndex(SDL_TouchID id)
|
|||
return -1;
|
||||
}
|
||||
|
||||
SDL_Touch *
|
||||
SDL_GetTouch(SDL_TouchID id)
|
||||
SDL_Touch *SDL_GetTouch(SDL_TouchID id)
|
||||
{
|
||||
int index = SDL_GetTouchIndex(id);
|
||||
if (index < 0 || index >= SDL_num_touch) {
|
||||
|
@ -100,8 +97,7 @@ SDL_GetTouch(SDL_TouchID id)
|
|||
return SDL_touchDevices[index];
|
||||
}
|
||||
|
||||
SDL_TouchDeviceType
|
||||
SDL_GetTouchDeviceType(SDL_TouchID id)
|
||||
SDL_TouchDeviceType SDL_GetTouchDeviceType(SDL_TouchID id)
|
||||
{
|
||||
SDL_Touch *touch = SDL_GetTouch(id);
|
||||
if (touch) {
|
||||
|
@ -139,8 +135,7 @@ int SDL_GetNumTouchFingers(SDL_TouchID touchID)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SDL_Finger *
|
||||
SDL_GetTouchFinger(SDL_TouchID touchID, int index)
|
||||
SDL_Finger *SDL_GetTouchFinger(SDL_TouchID touchID, int index)
|
||||
{
|
||||
SDL_Touch *touch = SDL_GetTouch(touchID);
|
||||
if (touch == NULL) {
|
||||
|
|
|
@ -522,8 +522,7 @@ static int SDLCALL mem_close(SDL_RWops *context)
|
|||
|
||||
/* Functions to create SDL_RWops structures from various data sources */
|
||||
|
||||
SDL_RWops *
|
||||
SDL_RWFromFile(const char *file, const char *mode)
|
||||
SDL_RWops *SDL_RWFromFile(const char *file, const char *mode)
|
||||
{
|
||||
SDL_RWops *rwops = NULL;
|
||||
if (file == NULL || !*file || mode == NULL || !*mode) {
|
||||
|
@ -616,8 +615,7 @@ SDL_RWFromFile(const char *file, const char *mode)
|
|||
}
|
||||
|
||||
#ifdef HAVE_STDIO_H
|
||||
SDL_RWops *
|
||||
SDL_RWFromFP(FILE * fp, SDL_bool autoclose)
|
||||
SDL_RWops *SDL_RWFromFP(FILE * fp, SDL_bool autoclose)
|
||||
{
|
||||
SDL_RWops *rwops = NULL;
|
||||
|
||||
|
@ -635,16 +633,14 @@ SDL_RWFromFP(FILE * fp, SDL_bool autoclose)
|
|||
return rwops;
|
||||
}
|
||||
#else
|
||||
SDL_RWops *
|
||||
SDL_RWFromFP(void * fp, SDL_bool autoclose)
|
||||
SDL_RWops *SDL_RWFromFP(void * fp, SDL_bool autoclose)
|
||||
{
|
||||
SDL_SetError("SDL not compiled with stdio support");
|
||||
return NULL;
|
||||
}
|
||||
#endif /* HAVE_STDIO_H */
|
||||
|
||||
SDL_RWops *
|
||||
SDL_RWFromMem(void *mem, int size)
|
||||
SDL_RWops *SDL_RWFromMem(void *mem, int size)
|
||||
{
|
||||
SDL_RWops *rwops = NULL;
|
||||
if (mem == NULL) {
|
||||
|
@ -671,8 +667,7 @@ SDL_RWFromMem(void *mem, int size)
|
|||
return rwops;
|
||||
}
|
||||
|
||||
SDL_RWops *
|
||||
SDL_RWFromConstMem(const void *mem, int size)
|
||||
SDL_RWops *SDL_RWFromConstMem(const void *mem, int size)
|
||||
{
|
||||
SDL_RWops *rwops = NULL;
|
||||
if (mem == NULL) {
|
||||
|
@ -699,8 +694,7 @@ SDL_RWFromConstMem(const void *mem, int size)
|
|||
return rwops;
|
||||
}
|
||||
|
||||
SDL_RWops *
|
||||
SDL_AllocRW(void)
|
||||
SDL_RWops *SDL_AllocRW(void)
|
||||
{
|
||||
SDL_RWops *area;
|
||||
|
||||
|
@ -719,8 +713,7 @@ void SDL_FreeRW(SDL_RWops *area)
|
|||
}
|
||||
|
||||
/* Load all the data from an SDL data stream */
|
||||
void *
|
||||
SDL_LoadFile_RW(SDL_RWops *src, size_t *datasize, int freesrc)
|
||||
void *SDL_LoadFile_RW(SDL_RWops *src, size_t *datasize, int freesrc)
|
||||
{
|
||||
static const Sint64 FILE_CHUNK_SIZE = 1024;
|
||||
Sint64 size;
|
||||
|
@ -771,26 +764,22 @@ done:
|
|||
return data;
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_LoadFile(const char *file, size_t *datasize)
|
||||
void *SDL_LoadFile(const char *file, size_t *datasize)
|
||||
{
|
||||
return SDL_LoadFile_RW(SDL_RWFromFile(file, "rb"), datasize, 1);
|
||||
}
|
||||
|
||||
Sint64
|
||||
SDL_RWsize(SDL_RWops *context)
|
||||
Sint64 SDL_RWsize(SDL_RWops *context)
|
||||
{
|
||||
return context->size(context);
|
||||
}
|
||||
|
||||
Sint64
|
||||
SDL_RWseek(SDL_RWops *context, Sint64 offset, int whence)
|
||||
Sint64 SDL_RWseek(SDL_RWops *context, Sint64 offset, int whence)
|
||||
{
|
||||
return context->seek(context, offset, whence);
|
||||
}
|
||||
|
||||
Sint64
|
||||
SDL_RWtell(SDL_RWops *context)
|
||||
Sint64 SDL_RWtell(SDL_RWops *context)
|
||||
{
|
||||
return context->seek(context, 0, RW_SEEK_CUR);
|
||||
}
|
||||
|
@ -822,8 +811,7 @@ Uint8 SDL_ReadU8(SDL_RWops *src)
|
|||
return value;
|
||||
}
|
||||
|
||||
Uint16
|
||||
SDL_ReadLE16(SDL_RWops *src)
|
||||
Uint16 SDL_ReadLE16(SDL_RWops *src)
|
||||
{
|
||||
Uint16 value = 0;
|
||||
|
||||
|
@ -831,8 +819,7 @@ SDL_ReadLE16(SDL_RWops *src)
|
|||
return SDL_SwapLE16(value);
|
||||
}
|
||||
|
||||
Uint16
|
||||
SDL_ReadBE16(SDL_RWops *src)
|
||||
Uint16 SDL_ReadBE16(SDL_RWops *src)
|
||||
{
|
||||
Uint16 value = 0;
|
||||
|
||||
|
@ -840,8 +827,7 @@ SDL_ReadBE16(SDL_RWops *src)
|
|||
return SDL_SwapBE16(value);
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDL_ReadLE32(SDL_RWops *src)
|
||||
Uint32 SDL_ReadLE32(SDL_RWops *src)
|
||||
{
|
||||
Uint32 value = 0;
|
||||
|
||||
|
@ -849,8 +835,7 @@ SDL_ReadLE32(SDL_RWops *src)
|
|||
return SDL_SwapLE32(value);
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDL_ReadBE32(SDL_RWops *src)
|
||||
Uint32 SDL_ReadBE32(SDL_RWops *src)
|
||||
{
|
||||
Uint32 value = 0;
|
||||
|
||||
|
@ -858,8 +843,7 @@ SDL_ReadBE32(SDL_RWops *src)
|
|||
return SDL_SwapBE32(value);
|
||||
}
|
||||
|
||||
Uint64
|
||||
SDL_ReadLE64(SDL_RWops *src)
|
||||
Uint64 SDL_ReadLE64(SDL_RWops *src)
|
||||
{
|
||||
Uint64 value = 0;
|
||||
|
||||
|
@ -867,8 +851,7 @@ SDL_ReadLE64(SDL_RWops *src)
|
|||
return SDL_SwapLE64(value);
|
||||
}
|
||||
|
||||
Uint64
|
||||
SDL_ReadBE64(SDL_RWops *src)
|
||||
Uint64 SDL_ReadBE64(SDL_RWops *src)
|
||||
{
|
||||
Uint64 value = 0;
|
||||
|
||||
|
|
|
@ -23,21 +23,20 @@
|
|||
#include "SDL_error.h"
|
||||
|
||||
/* Checks if the mode is a kind of reading */
|
||||
SDL_FORCE_INLINE SDL_bool IsReadMode(const char *mode);
|
||||
static SDL_bool IsReadMode(const char *mode);
|
||||
|
||||
/* Checks if the file starts with the given prefix */
|
||||
SDL_FORCE_INLINE SDL_bool HasPrefix(const char *file, const char *prefix);
|
||||
static SDL_bool HasPrefix(const char *file, const char *prefix);
|
||||
|
||||
SDL_FORCE_INLINE FILE *TryOpenFile(const char *file, const char *mode);
|
||||
SDL_FORCE_INLINE FILE *TryOpenInRomfs(const char *file, const char *mode);
|
||||
static FILE *TryOpenFile(const char *file, const char *mode);
|
||||
static FILE *TryOpenInRomfs(const char *file, const char *mode);
|
||||
|
||||
/* Nintendo 3DS applications may embed resources in the executable. The
|
||||
resources are stored in a special read-only partition prefixed with
|
||||
'romfs:/'. As such, when opening a file, we should first try the romfs
|
||||
unless sdmc is specifically mentionned.
|
||||
*/
|
||||
FILE *
|
||||
N3DS_FileOpen(const char *file, const char *mode)
|
||||
FILE *N3DS_FileOpen(const char *file, const char *mode)
|
||||
{
|
||||
/* romfs are read-only */
|
||||
if (!IsReadMode(mode)) {
|
||||
|
@ -52,20 +51,17 @@ N3DS_FileOpen(const char *file, const char *mode)
|
|||
return TryOpenFile(file, mode);
|
||||
}
|
||||
|
||||
SDL_FORCE_INLINE SDL_bool
|
||||
IsReadMode(const char *mode)
|
||||
static SDL_bool IsReadMode(const char *mode)
|
||||
{
|
||||
return SDL_strchr(mode, 'r') != NULL;
|
||||
}
|
||||
|
||||
SDL_FORCE_INLINE SDL_bool
|
||||
HasPrefix(const char *file, const char *prefix)
|
||||
static SDL_bool HasPrefix(const char *file, const char *prefix)
|
||||
{
|
||||
return SDL_strncmp(prefix, file, SDL_strlen(prefix)) == 0;
|
||||
}
|
||||
|
||||
SDL_FORCE_INLINE FILE *
|
||||
TryOpenFile(const char *file, const char *mode)
|
||||
static FILE *TryOpenFile(const char *file, const char *mode)
|
||||
{
|
||||
FILE *fp = NULL;
|
||||
|
||||
|
@ -77,8 +73,7 @@ TryOpenFile(const char *file, const char *mode)
|
|||
return fp;
|
||||
}
|
||||
|
||||
SDL_FORCE_INLINE FILE *
|
||||
TryOpenInRomfs(const char *file, const char *mode)
|
||||
static FILE *TryOpenInRomfs(const char *file, const char *mode)
|
||||
{
|
||||
FILE *fp = NULL;
|
||||
char *prefixed_filepath = NULL;
|
||||
|
|
|
@ -32,16 +32,14 @@
|
|||
#include "SDL_system.h"
|
||||
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
/* The current working directory is / on Android */
|
||||
SDL_Unsupported();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
const char *path = SDL_AndroidGetInternalStoragePath();
|
||||
if (path) {
|
||||
|
|
|
@ -33,8 +33,7 @@
|
|||
#include "SDL_stdinc.h"
|
||||
#include "SDL_filesystem.h"
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
@autoreleasepool {
|
||||
NSBundle *bundle = [NSBundle mainBundle];
|
||||
|
@ -68,8 +67,7 @@ SDL_GetBasePath(void)
|
|||
}
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
@autoreleasepool {
|
||||
char *retval = NULL;
|
||||
|
|
|
@ -28,15 +28,13 @@
|
|||
#include "SDL_error.h"
|
||||
#include "SDL_filesystem.h"
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
return NULL;
|
||||
|
|
|
@ -32,15 +32,13 @@
|
|||
|
||||
#include <emscripten/emscripten.h>
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
char *retval = "/";
|
||||
return SDL_strdup(retval);
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
const char *append = "/libsdl/";
|
||||
char *retval;
|
||||
|
|
|
@ -34,8 +34,7 @@
|
|||
#include "SDL_stdinc.h"
|
||||
#include "SDL_filesystem.h"
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
image_info info;
|
||||
int32 cookie = 0;
|
||||
|
@ -69,8 +68,7 @@ SDL_GetBasePath(void)
|
|||
}
|
||||
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
// !!! FIXME: is there a better way to do this?
|
||||
const char *home = SDL_getenv("HOME");
|
||||
|
|
|
@ -35,15 +35,13 @@
|
|||
SDL_FORCE_INLINE char *MakePrefPath(const char *app);
|
||||
SDL_FORCE_INLINE int CreatePrefPathDir(const char *pref);
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
char *base_path = SDL_strdup("romfs:/");
|
||||
return base_path;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
char *pref_path = NULL;
|
||||
if (app == NULL) {
|
||||
|
|
|
@ -24,15 +24,13 @@
|
|||
|
||||
#ifdef SDL_FILESYSTEM_NACL
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
return NULL;
|
||||
|
|
|
@ -36,8 +36,7 @@
|
|||
#include <os2.h>
|
||||
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
PTIB tib;
|
||||
PPIB pib;
|
||||
|
@ -71,8 +70,7 @@ SDL_GetBasePath(void)
|
|||
return OS2_SysToUTF8(acBuf);
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
PSZ pszPath;
|
||||
CHAR acBuf[CCHMAXPATH];
|
||||
|
|
|
@ -31,8 +31,7 @@
|
|||
#include "SDL_error.h"
|
||||
#include "SDL_filesystem.h"
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
char *retval;
|
||||
size_t len;
|
||||
|
@ -78,8 +77,7 @@ static void recursive_mkdir(const char *dir)
|
|||
mkdir(tmp, S_IRWXU);
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
char *retval = NULL;
|
||||
size_t len;
|
||||
|
|
|
@ -31,8 +31,7 @@
|
|||
#include "SDL_error.h"
|
||||
#include "SDL_filesystem.h"
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
char *retval = NULL;
|
||||
size_t len;
|
||||
|
@ -46,8 +45,7 @@ SDL_GetBasePath(void)
|
|||
return retval;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
char *retval = NULL;
|
||||
size_t len;
|
||||
|
|
|
@ -129,8 +129,7 @@ static _kernel_oserror *createDirectoryRecursive(char *path)
|
|||
return _kernel_swi(OS_File, ®s, ®s);
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
_kernel_swi_regs regs;
|
||||
_kernel_oserror *error;
|
||||
|
@ -157,8 +156,7 @@ SDL_GetBasePath(void)
|
|||
return retval;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
char *canon, *dir, *retval;
|
||||
size_t len;
|
||||
|
|
|
@ -45,8 +45,7 @@
|
|||
|
||||
/* QNX's /proc/self/exefile is a text file and not a symlink. */
|
||||
#if !defined(__QNXNTO__)
|
||||
static char *
|
||||
readSymLink(const char *path)
|
||||
static char *readSymLink(const char *path)
|
||||
{
|
||||
char *retval = NULL;
|
||||
ssize_t len = 64;
|
||||
|
@ -129,8 +128,7 @@ static char *search_path_for_binary(const char *bin)
|
|||
}
|
||||
#endif
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
char *retval = NULL;
|
||||
|
||||
|
@ -271,8 +269,7 @@ SDL_GetBasePath(void)
|
|||
return retval;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
/*
|
||||
* We use XDG's base directory spec, even if you're not on Linux.
|
||||
|
|
|
@ -39,16 +39,14 @@
|
|||
#include "SDL_filesystem.h"
|
||||
#include "SDL_rwops.h"
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
const char *basepath = "app0:/";
|
||||
char *retval = SDL_strdup(basepath);
|
||||
return retval;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
const char *envr = "ux0:/data/";
|
||||
char *retval = NULL;
|
||||
|
|
|
@ -32,8 +32,7 @@
|
|||
#include "SDL_stdinc.h"
|
||||
#include "SDL_filesystem.h"
|
||||
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
DWORD buflen = 128;
|
||||
WCHAR *path = NULL;
|
||||
|
@ -83,8 +82,7 @@ SDL_GetBasePath(void)
|
|||
return retval;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
/*
|
||||
* Vista and later has a new API for this, but SHGetFolderPath works there,
|
||||
|
@ -175,15 +173,13 @@ SDL_GetPrefPath(const char *org, const char *app)
|
|||
#ifdef SDL_FILESYSTEM_XBOX
|
||||
#include "SDL_filesystem.h"
|
||||
#include "SDL_error.h"
|
||||
char *
|
||||
SDL_GetBasePath(void)
|
||||
char *SDL_GetBasePath(void)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrefPath(const char *org, const char *app)
|
||||
char *SDL_GetPrefPath(const char *org, const char *app)
|
||||
{
|
||||
SDL_Unsupported();
|
||||
return NULL;
|
||||
|
|
|
@ -85,8 +85,7 @@ int SDL_NumHaptics(void)
|
|||
/*
|
||||
* Gets the name of a Haptic device by index.
|
||||
*/
|
||||
const char *
|
||||
SDL_HapticName(int device_index)
|
||||
const char *SDL_HapticName(int device_index)
|
||||
{
|
||||
if ((device_index < 0) || (device_index >= SDL_NumHaptics())) {
|
||||
SDL_SetError("Haptic: There are %d haptic devices available",
|
||||
|
@ -99,8 +98,7 @@ SDL_HapticName(int device_index)
|
|||
/*
|
||||
* Opens a Haptic device.
|
||||
*/
|
||||
SDL_Haptic *
|
||||
SDL_HapticOpen(int device_index)
|
||||
SDL_Haptic *SDL_HapticOpen(int device_index)
|
||||
{
|
||||
SDL_Haptic *haptic;
|
||||
SDL_Haptic *hapticlist;
|
||||
|
@ -211,8 +209,7 @@ int SDL_MouseIsHaptic(void)
|
|||
/*
|
||||
* Returns the haptic device if mouse is haptic or NULL elsewise.
|
||||
*/
|
||||
SDL_Haptic *
|
||||
SDL_HapticOpenFromMouse(void)
|
||||
SDL_Haptic *SDL_HapticOpenFromMouse(void)
|
||||
{
|
||||
int device_index;
|
||||
|
||||
|
@ -257,8 +254,7 @@ int SDL_JoystickIsHaptic(SDL_Joystick *joystick)
|
|||
/*
|
||||
* Opens a haptic device from a joystick.
|
||||
*/
|
||||
SDL_Haptic *
|
||||
SDL_HapticOpenFromJoystick(SDL_Joystick *joystick)
|
||||
SDL_Haptic *SDL_HapticOpenFromJoystick(SDL_Joystick *joystick)
|
||||
{
|
||||
SDL_Haptic *haptic;
|
||||
SDL_Haptic *hapticlist;
|
||||
|
@ -415,8 +411,7 @@ int SDL_HapticNumEffectsPlaying(SDL_Haptic *haptic)
|
|||
/*
|
||||
* Returns supported effects by the device.
|
||||
*/
|
||||
unsigned int
|
||||
SDL_HapticQuery(SDL_Haptic *haptic)
|
||||
unsigned int SDL_HapticQuery(SDL_Haptic *haptic)
|
||||
{
|
||||
if (!ValidHaptic(haptic)) {
|
||||
return 0; /* same as if no effects were supported */
|
||||
|
|
|
@ -89,8 +89,7 @@ static SDL_hapticlist_item *HapticByDevId(int device_id)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
const char *
|
||||
SDL_SYS_HapticName(int index)
|
||||
const char *SDL_SYS_HapticName(int index)
|
||||
{
|
||||
SDL_hapticlist_item *item = HapticByOrder(index);
|
||||
if (item == NULL) {
|
||||
|
|
|
@ -319,8 +319,7 @@ int MacHaptic_MaybeRemoveDevice(io_object_t device)
|
|||
/*
|
||||
* Return the name of a haptic device, does not need to be opened.
|
||||
*/
|
||||
const char *
|
||||
SDL_SYS_HapticName(int index)
|
||||
const char *SDL_SYS_HapticName(int index)
|
||||
{
|
||||
SDL_hapticlist_item *item;
|
||||
item = HapticByDevIndex(index);
|
||||
|
|
|
@ -40,8 +40,7 @@ int SDL_SYS_NumHaptics(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
const char *
|
||||
SDL_SYS_HapticName(int index)
|
||||
const char *SDL_SYS_HapticName(int index)
|
||||
{
|
||||
SDL_SYS_LogicError();
|
||||
return NULL;
|
||||
|
|
|
@ -351,8 +351,7 @@ static const char *SDL_SYS_HapticNameFromFD(int fd)
|
|||
/*
|
||||
* Return the name of a haptic device, does not need to be opened.
|
||||
*/
|
||||
const char *
|
||||
SDL_SYS_HapticName(int index)
|
||||
const char *SDL_SYS_HapticName(int index)
|
||||
{
|
||||
SDL_hapticlist_item *item;
|
||||
int fd;
|
||||
|
|
|
@ -136,8 +136,7 @@ static SDL_hapticlist_item *HapticByDevIndex(int device_index)
|
|||
/*
|
||||
* Return the name of a haptic device, does not need to be opened.
|
||||
*/
|
||||
const char *
|
||||
SDL_SYS_HapticName(int index)
|
||||
const char *SDL_SYS_HapticName(int index)
|
||||
{
|
||||
SDL_hapticlist_item *item = HapticByDevIndex(index);
|
||||
return item->name;
|
||||
|
|
|
@ -198,14 +198,12 @@ static int SDL_inotify_init1(void)
|
|||
}
|
||||
#endif
|
||||
|
||||
static int
|
||||
StrHasPrefix(const char *string, const char *prefix)
|
||||
static int StrHasPrefix(const char *string, const char *prefix)
|
||||
{
|
||||
return SDL_strncmp(string, prefix, SDL_strlen(prefix)) == 0;
|
||||
}
|
||||
|
||||
static int
|
||||
StrIsInteger(const char *string)
|
||||
static int StrIsInteger(const char *string)
|
||||
{
|
||||
const char *p;
|
||||
|
||||
|
@ -223,8 +221,7 @@ StrIsInteger(const char *string)
|
|||
}
|
||||
#endif /* HAVE_INOTIFY */
|
||||
|
||||
static void
|
||||
HIDAPI_InitializeDiscovery()
|
||||
static void HIDAPI_InitializeDiscovery()
|
||||
{
|
||||
SDL_HIDAPI_discovery.m_bInitialized = SDL_TRUE;
|
||||
SDL_HIDAPI_discovery.m_unDeviceChangeCounter = 1;
|
||||
|
@ -363,8 +360,7 @@ HIDAPI_InitializeDiscovery()
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
HIDAPI_UpdateDiscovery()
|
||||
static void HIDAPI_UpdateDiscovery()
|
||||
{
|
||||
if (!SDL_HIDAPI_discovery.m_bInitialized) {
|
||||
HIDAPI_InitializeDiscovery();
|
||||
|
@ -481,8 +477,7 @@ HIDAPI_UpdateDiscovery()
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
HIDAPI_ShutdownDiscovery()
|
||||
static void HIDAPI_ShutdownDiscovery()
|
||||
{
|
||||
if (!SDL_HIDAPI_discovery.m_bInitialized) {
|
||||
return;
|
||||
|
@ -813,8 +808,7 @@ static struct
|
|||
#ifndef __FreeBSD__
|
||||
/* this is awkwardly inlined, so we need to re-implement it here
|
||||
* so we can override the libusb_control_transfer call */
|
||||
static int
|
||||
SDL_libusb_get_string_descriptor(libusb_device_handle *dev,
|
||||
static int SDL_libusb_get_string_descriptor(libusb_device_handle *dev,
|
||||
uint8_t descriptor_index, uint16_t lang_id,
|
||||
unsigned char *data, int length)
|
||||
{
|
||||
|
@ -965,8 +959,7 @@ static char device_magic;
|
|||
|
||||
#if HAVE_PLATFORM_BACKEND || HAVE_DRIVER_BACKEND || defined(HAVE_LIBUSB)
|
||||
|
||||
static SDL_hid_device *
|
||||
CreateHIDDeviceWrapper(void *device, const struct hidapi_backend *backend)
|
||||
static SDL_hid_device *CreateHIDDeviceWrapper(void *device, const struct hidapi_backend *backend)
|
||||
{
|
||||
SDL_hid_device *wrapper = (SDL_hid_device *)SDL_malloc(sizeof(*wrapper));
|
||||
wrapper->magic = &device_magic;
|
||||
|
@ -977,8 +970,7 @@ CreateHIDDeviceWrapper(void *device, const struct hidapi_backend *backend)
|
|||
|
||||
#endif /* HAVE_PLATFORM_BACKEND || HAVE_DRIVER_BACKEND || HAVE_LIBUSB */
|
||||
|
||||
static void
|
||||
DeleteHIDDeviceWrapper(SDL_hid_device *device)
|
||||
static void DeleteHIDDeviceWrapper(SDL_hid_device *device)
|
||||
{
|
||||
device->magic = NULL;
|
||||
SDL_free(device);
|
||||
|
@ -1006,8 +998,7 @@ DeleteHIDDeviceWrapper(SDL_hid_device *device)
|
|||
pDst->var = NULL; \
|
||||
}
|
||||
|
||||
static void
|
||||
CopyHIDDeviceInfo(struct SDL_hid_device_info *pSrc, struct SDL_hid_device_info *pDst)
|
||||
static void CopyHIDDeviceInfo(struct SDL_hid_device_info *pSrc, struct SDL_hid_device_info *pDst)
|
||||
{
|
||||
COPY_IF_EXISTS(path)
|
||||
pDst->vendor_id = pSrc->vendor_id;
|
||||
|
|
|
@ -701,15 +701,13 @@ static void DARWIN_JoystickDetect(void)
|
|||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
DARWIN_JoystickGetDeviceName(int device_index)
|
||||
const char *DARWIN_JoystickGetDeviceName(int device_index)
|
||||
{
|
||||
recDevice *device = GetDeviceForIndex(device_index);
|
||||
return device ? device->product : "UNKNOWN";
|
||||
}
|
||||
|
||||
const char *
|
||||
DARWIN_JoystickGetDevicePath(int device_index)
|
||||
const char *DARWIN_JoystickGetDevicePath(int device_index)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -1764,8 +1764,7 @@ static void HandleSimpleControllerState(SDL_Joystick *joystick, SDL_DriverSwitch
|
|||
ctx->m_lastSimpleState = *packet;
|
||||
}
|
||||
|
||||
static void
|
||||
SendSensorUpdate(SDL_Joystick *joystick, SDL_DriverSwitch_Context *ctx, SDL_SensorType type, Uint64 timestamp_us, const Sint16 *values)
|
||||
static void SendSensorUpdate(SDL_Joystick *joystick, SDL_DriverSwitch_Context *ctx, SDL_SensorType type, Uint64 timestamp_us, const Sint16 *values)
|
||||
{
|
||||
float data[3];
|
||||
|
||||
|
|
|
@ -1163,8 +1163,7 @@ static SDL_bool HIDAPI_IsEquivalentToDevice(Uint16 vendor_id, Uint16 product_id,
|
|||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
HIDAPI_IsDeviceTypePresent(SDL_GameControllerType type)
|
||||
SDL_bool HIDAPI_IsDeviceTypePresent(SDL_GameControllerType type)
|
||||
{
|
||||
SDL_HIDAPI_Device *device;
|
||||
SDL_bool result = SDL_FALSE;
|
||||
|
@ -1245,8 +1244,7 @@ SDL_bool HIDAPI_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 vers
|
|||
return result;
|
||||
}
|
||||
|
||||
SDL_JoystickType
|
||||
HIDAPI_GetJoystickTypeFromGUID(SDL_JoystickGUID guid)
|
||||
SDL_JoystickType HIDAPI_GetJoystickTypeFromGUID(SDL_JoystickGUID guid)
|
||||
{
|
||||
SDL_HIDAPI_Device *device;
|
||||
SDL_JoystickType type = SDL_JOYSTICK_TYPE_UNKNOWN;
|
||||
|
@ -1263,8 +1261,7 @@ HIDAPI_GetJoystickTypeFromGUID(SDL_JoystickGUID guid)
|
|||
return type;
|
||||
}
|
||||
|
||||
SDL_GameControllerType
|
||||
HIDAPI_GetGameControllerTypeFromGUID(SDL_JoystickGUID guid)
|
||||
SDL_GameControllerType HIDAPI_GetGameControllerTypeFromGUID(SDL_JoystickGUID guid)
|
||||
{
|
||||
SDL_HIDAPI_Device *device;
|
||||
SDL_GameControllerType type = SDL_CONTROLLER_TYPE_UNKNOWN;
|
||||
|
|
|
@ -1726,8 +1726,7 @@ static GCControllerDirectionPad *GetDirectionalPadForController(GCController *co
|
|||
|
||||
static char elementName[256];
|
||||
|
||||
const char *
|
||||
IOS_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)
|
||||
const char *IOS_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontroller, SDL_GameControllerButton button)
|
||||
{
|
||||
elementName[0] = '\0';
|
||||
#if defined(SDL_JOYSTICK_MFI) && defined(ENABLE_PHYSICAL_INPUT_PROFILE)
|
||||
|
@ -1842,8 +1841,7 @@ IOS_GameControllerGetAppleSFSymbolsNameForButton(SDL_GameController *gamecontrol
|
|||
return elementName;
|
||||
}
|
||||
|
||||
const char *
|
||||
IOS_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)
|
||||
const char *IOS_GameControllerGetAppleSFSymbolsNameForAxis(SDL_GameController *gamecontroller, SDL_GameControllerAxis axis)
|
||||
{
|
||||
elementName[0] = '\0';
|
||||
#if defined(SDL_JOYSTICK_MFI) && defined(ENABLE_PHYSICAL_INPUT_PROFILE)
|
||||
|
|
|
@ -593,8 +593,7 @@ err:
|
|||
#undef CHECK
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_DINPUT_JoystickPresent(Uint16 vendor_id, Uint16 product_id, Uint16 version_number)
|
||||
SDL_bool SDL_DINPUT_JoystickPresent(Uint16 vendor_id, Uint16 product_id, Uint16 version_number)
|
||||
{
|
||||
Joystick_PresentData data;
|
||||
|
||||
|
@ -945,8 +944,7 @@ int SDL_DINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumbl
|
|||
return 0;
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
|
||||
Uint32 SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
|
||||
{
|
||||
Uint32 result = 0;
|
||||
|
||||
|
@ -1177,8 +1175,7 @@ void SDL_DINPUT_JoystickDetect(JoyStick_DeviceData **pContext)
|
|||
{
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_DINPUT_JoystickPresent(Uint16 vendor, Uint16 product, Uint16 version)
|
||||
SDL_bool SDL_DINPUT_JoystickPresent(Uint16 vendor, Uint16 product, Uint16 version)
|
||||
{
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
@ -1193,8 +1190,7 @@ int SDL_DINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumbl
|
|||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
|
||||
Uint32 SDL_DINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -883,14 +883,12 @@ static int RAWINPUT_JoystickGetCount(void)
|
|||
return SDL_RAWINPUT_numjoysticks;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
RAWINPUT_IsEnabled()
|
||||
SDL_bool RAWINPUT_IsEnabled()
|
||||
{
|
||||
return SDL_RAWINPUT_inited;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
RAWINPUT_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name)
|
||||
SDL_bool RAWINPUT_IsDevicePresent(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name)
|
||||
{
|
||||
SDL_RAWINPUT_Device *device;
|
||||
|
||||
|
@ -1874,8 +1872,7 @@ static void RAWINPUT_JoystickClose(SDL_Joystick *joystick)
|
|||
}
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
RAWINPUT_RegisterNotifications(HWND hWnd)
|
||||
SDL_bool RAWINPUT_RegisterNotifications(HWND hWnd)
|
||||
{
|
||||
RAWINPUTDEVICE rid[SDL_arraysize(subscribed_devices)];
|
||||
int i;
|
||||
|
|
|
@ -497,8 +497,7 @@ int SDL_XINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumbl
|
|||
return 0;
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
|
||||
Uint32 SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
|
||||
{
|
||||
return SDL_JOYCAP_RUMBLE;
|
||||
}
|
||||
|
@ -583,8 +582,7 @@ int SDL_XINPUT_JoystickRumble(SDL_Joystick *joystick, Uint16 low_frequency_rumbl
|
|||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
|
||||
Uint32 SDL_XINPUT_JoystickGetCapabilities(SDL_Joystick *joystick)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -34,8 +34,7 @@
|
|||
#include "../../video/uikit/SDL_uikitvideo.h"
|
||||
#endif
|
||||
|
||||
void *
|
||||
SDL_LoadObject(const char *sofile)
|
||||
void *SDL_LoadObject(const char *sofile)
|
||||
{
|
||||
void *handle;
|
||||
const char *loaderror;
|
||||
|
@ -55,8 +54,7 @@ SDL_LoadObject(const char *sofile)
|
|||
return handle;
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_LoadFunction(void *handle, const char *name)
|
||||
void *SDL_LoadFunction(void *handle, const char *name)
|
||||
{
|
||||
void *symbol = dlsym(handle, name);
|
||||
if (symbol == NULL) {
|
||||
|
|
|
@ -27,16 +27,14 @@
|
|||
|
||||
#include "SDL_loadso.h"
|
||||
|
||||
void *
|
||||
SDL_LoadObject(const char *sofile)
|
||||
void *SDL_LoadObject(const char *sofile)
|
||||
{
|
||||
const char *loaderror = "SDL_LoadObject() not implemented";
|
||||
SDL_SetError("Failed loading %s: %s", sofile, loaderror);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_LoadFunction(void *handle, const char *name)
|
||||
void *SDL_LoadFunction(void *handle, const char *name)
|
||||
{
|
||||
const char *loaderror = "SDL_LoadFunction() not implemented";
|
||||
SDL_SetError("Failed loading %s: %s", name, loaderror);
|
||||
|
|
|
@ -32,8 +32,7 @@
|
|||
#define INCL_DOSERRORS
|
||||
#include <os2.h>
|
||||
|
||||
void *
|
||||
SDL_LoadObject(const char *sofile)
|
||||
void *SDL_LoadObject(const char *sofile)
|
||||
{
|
||||
ULONG ulRC;
|
||||
HMODULE hModule;
|
||||
|
@ -65,8 +64,7 @@ SDL_LoadObject(const char *sofile)
|
|||
return (void *)hModule;
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_LoadFunction(void *handle, const char *name)
|
||||
void *SDL_LoadFunction(void *handle, const char *name)
|
||||
{
|
||||
ULONG ulRC;
|
||||
PFN pFN;
|
||||
|
@ -90,8 +88,7 @@ SDL_LoadFunction(void *handle, const char *name)
|
|||
return (void *)pFN;
|
||||
}
|
||||
|
||||
void
|
||||
SDL_UnloadObject(void *handle)
|
||||
void SDL_UnloadObject(void *handle)
|
||||
{
|
||||
if (handle != NULL) {
|
||||
DosFreeModule((HMODULE)handle);
|
||||
|
|
|
@ -29,8 +29,7 @@
|
|||
|
||||
#include "SDL_loadso.h"
|
||||
|
||||
void *
|
||||
SDL_LoadObject(const char *sofile)
|
||||
void *SDL_LoadObject(const char *sofile)
|
||||
{
|
||||
void *handle;
|
||||
LPTSTR tstr;
|
||||
|
@ -61,8 +60,7 @@ SDL_LoadObject(const char *sofile)
|
|||
return handle;
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_LoadFunction(void *handle, const char *name)
|
||||
void *SDL_LoadFunction(void *handle, const char *name)
|
||||
{
|
||||
void *symbol = (void *)GetProcAddress((HMODULE)handle, name);
|
||||
if (symbol == NULL) {
|
||||
|
|
|
@ -87,8 +87,7 @@ static SDL_Locale *build_locales_from_csv_string(char *csv)
|
|||
return retval;
|
||||
}
|
||||
|
||||
SDL_Locale *
|
||||
SDL_GetPreferredLocales(void)
|
||||
SDL_Locale *SDL_GetPreferredLocales(void)
|
||||
{
|
||||
char locbuf[128]; /* enough for 21 "xx_YY," language strings. */
|
||||
const char *hint = SDL_GetHint(SDL_HINT_PREFERRED_LOCALES);
|
||||
|
|
|
@ -26,8 +26,7 @@
|
|||
#include "../../SDL_internal.h"
|
||||
#include "../SDL_syslocale.h"
|
||||
|
||||
void
|
||||
SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
|
||||
void SDL_SYS_GetPreferredLocales(char *buf, size_t buflen)
|
||||
{
|
||||
BLocaleRoster *roster = BLocaleRoster::Default();
|
||||
roster->Refresh();
|
||||
|
|
|
@ -105,8 +105,7 @@ static int StartBeApp(void *unused)
|
|||
}
|
||||
|
||||
|
||||
static int
|
||||
StartBeLooper()
|
||||
static int StartBeLooper()
|
||||
{
|
||||
if (!be_app) {
|
||||
SDL_AppThread = SDL_CreateThreadInternal(StartBeApp, "SDLApplication", 0, NULL);
|
||||
|
@ -141,8 +140,7 @@ StartBeLooper()
|
|||
|
||||
|
||||
/* Initialize the Be Application, if it's not already started */
|
||||
int
|
||||
SDL_InitBeApp(void)
|
||||
int SDL_InitBeApp(void)
|
||||
{
|
||||
/* Create the BApplication that handles appserver interaction */
|
||||
if (SDL_BeAppActive <= 0) {
|
||||
|
@ -160,8 +158,7 @@ SDL_InitBeApp(void)
|
|||
}
|
||||
|
||||
/* Quit the Be Application, if there's nothing left to do */
|
||||
void
|
||||
SDL_QuitBeApp(void)
|
||||
void SDL_QuitBeApp(void)
|
||||
{
|
||||
/* Decrement the application reference count */
|
||||
--SDL_BeAppActive;
|
||||
|
|
|
@ -33,20 +33,19 @@
|
|||
|
||||
extern void NACL_SetScreenResolution(int width, int height, Uint32 format);
|
||||
|
||||
int
|
||||
nacl_main(int argc, char *argv[])
|
||||
int nacl_main(int argc, char *argv[])
|
||||
{
|
||||
int status;
|
||||
PSEvent* ps_event;
|
||||
PP_Resource event;
|
||||
PP_Resource event;
|
||||
struct PP_Rect rect;
|
||||
int ready = 0;
|
||||
const PPB_View *ppb_view = PSInterfaceView();
|
||||
|
||||
|
||||
/* This is started in a worker thread by ppapi_simple! */
|
||||
|
||||
|
||||
/* Wait for the first PSE_INSTANCE_DIDCHANGEVIEW event before starting the app */
|
||||
|
||||
|
||||
PSEventSetFilter(PSE_INSTANCE_DIDCHANGEVIEW);
|
||||
while (!ready) {
|
||||
/* Process all waiting events without blocking */
|
||||
|
@ -65,13 +64,13 @@ nacl_main(int argc, char *argv[])
|
|||
PSEventRelease(ps_event);
|
||||
}
|
||||
}
|
||||
|
||||
/* Do a default httpfs mount on /,
|
||||
* apps can override this by unmounting /
|
||||
|
||||
/* Do a default httpfs mount on /,
|
||||
* apps can override this by unmounting /
|
||||
* and remounting with the desired configuration
|
||||
*/
|
||||
nacl_io_init_ppapi(PSGetInstanceId(), PSGetInterface);
|
||||
|
||||
|
||||
umount("/");
|
||||
mount(
|
||||
"", /* source */
|
||||
|
@ -79,7 +78,7 @@ nacl_main(int argc, char *argv[])
|
|||
"httpfs", /* filesystemtype */
|
||||
0, /* mountflags */
|
||||
""); /* data specific to the html5fs type */
|
||||
|
||||
|
||||
/* Everything is ready, start the user main function */
|
||||
SDL_SetMainReady();
|
||||
status = SDL_main(argc, argv);
|
||||
|
|
|
@ -22,8 +22,7 @@
|
|||
#include "../SDL_sysurl.h"
|
||||
#include <Url.h>
|
||||
|
||||
int
|
||||
SDL_SYS_OpenURL(const char *url)
|
||||
int SDL_SYS_OpenURL(const char *url)
|
||||
{
|
||||
BUrl burl(url);
|
||||
const status_t rc = burl.OpenWithPreferredApplication(false);
|
||||
|
|
|
@ -85,8 +85,7 @@ static SDL_GetPowerInfo_Impl implementations[] = {
|
|||
};
|
||||
#endif
|
||||
|
||||
SDL_PowerState
|
||||
SDL_GetPowerInfo(int *seconds, int *percent)
|
||||
SDL_PowerState SDL_GetPowerInfo(int *seconds, int *percent)
|
||||
{
|
||||
#ifndef SDL_POWER_DISABLED
|
||||
const int total = sizeof(implementations) / sizeof(implementations[0]);
|
||||
|
|
|
@ -28,8 +28,7 @@
|
|||
|
||||
#include "../../core/android/SDL_android.h"
|
||||
|
||||
SDL_bool
|
||||
SDL_GetPowerInfo_Android(SDL_PowerState *state, int *seconds, int *percent)
|
||||
SDL_bool SDL_GetPowerInfo_Android(SDL_PowerState *state, int *seconds, int *percent)
|
||||
{
|
||||
int battery;
|
||||
int plugged;
|
||||
|
|
|
@ -27,8 +27,7 @@
|
|||
|
||||
#include "SDL_power.h"
|
||||
|
||||
SDL_bool
|
||||
SDL_GetPowerInfo_Emscripten(SDL_PowerState *state, int *seconds, int *percent)
|
||||
SDL_bool SDL_GetPowerInfo_Emscripten(SDL_PowerState *state, int *seconds, int *percent)
|
||||
{
|
||||
EmscriptenBatteryEvent batteryState;
|
||||
int haveBattery = 0;
|
||||
|
|
|
@ -42,8 +42,7 @@
|
|||
|
||||
#include "SDL_power.h"
|
||||
|
||||
SDL_bool
|
||||
SDL_GetPowerInfo_Haiku(SDL_PowerState *state, int *seconds, int *percent)
|
||||
SDL_bool SDL_GetPowerInfo_Haiku(SDL_PowerState *state, int *seconds, int *percent)
|
||||
{
|
||||
const int fd = open("/dev/misc/apm", O_RDONLY | O_CLOEXEC);
|
||||
SDL_bool need_details = SDL_FALSE;
|
||||
|
|
|
@ -229,9 +229,7 @@ static void check_proc_acpi_ac_adapter(const char *node, SDL_bool *have_ac)
|
|||
}
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState *state,
|
||||
int *seconds, int *percent)
|
||||
SDL_bool SDL_GetPowerInfo_Linux_proc_acpi(SDL_PowerState *state, int *seconds, int *percent)
|
||||
{
|
||||
struct dirent *dent = NULL;
|
||||
DIR *dirp = NULL;
|
||||
|
@ -314,9 +312,7 @@ static SDL_bool int_string(char *str, int *val)
|
|||
}
|
||||
|
||||
/* http://lxr.linux.no/linux+v2.6.29/drivers/char/apm-emulation.c */
|
||||
SDL_bool
|
||||
SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState *state,
|
||||
int *seconds, int *percent)
|
||||
SDL_bool SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState *state, int *seconds, int *percent)
|
||||
{
|
||||
SDL_bool need_details = SDL_FALSE;
|
||||
int ac_status = 0;
|
||||
|
@ -422,8 +418,7 @@ SDL_GetPowerInfo_Linux_proc_apm(SDL_PowerState *state,
|
|||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *state, int *seconds, int *percent)
|
||||
SDL_bool SDL_GetPowerInfo_Linux_sys_class_power_supply(SDL_PowerState *state, int *seconds, int *percent)
|
||||
{
|
||||
const char *base = sys_class_power_supply_path;
|
||||
struct dirent *dent;
|
||||
|
@ -612,8 +607,7 @@ static void check_upower_device(DBusConnection *conn, const char *path, SDL_Powe
|
|||
}
|
||||
#endif
|
||||
|
||||
SDL_bool
|
||||
SDL_GetPowerInfo_Linux_org_freedesktop_upower(SDL_PowerState *state, int *seconds, int *percent)
|
||||
SDL_bool SDL_GetPowerInfo_Linux_org_freedesktop_upower(SDL_PowerState *state, int *seconds, int *percent)
|
||||
{
|
||||
SDL_bool retval = SDL_FALSE;
|
||||
|
||||
|
|
|
@ -138,8 +138,7 @@ static void checkps(CFDictionaryRef dict, SDL_bool *have_ac, SDL_bool *have_batt
|
|||
#undef GETVAL
|
||||
#undef STRMATCH
|
||||
|
||||
SDL_bool
|
||||
SDL_GetPowerInfo_MacOSX(SDL_PowerState *state, int *seconds, int *percent)
|
||||
SDL_bool SDL_GetPowerInfo_MacOSX(SDL_PowerState *state, int *seconds, int *percent)
|
||||
{
|
||||
CFTypeRef blob = IOPSCopyPowerSourcesInfo();
|
||||
|
||||
|
|
|
@ -35,8 +35,7 @@ SDL_FORCE_INLINE int GetBatteryPercentage(void);
|
|||
#define BATTERY_PERCENT_REG 0xB
|
||||
#define BATTERY_PERCENT_REG_SIZE 2
|
||||
|
||||
SDL_bool
|
||||
SDL_GetPowerInfo_N3DS(SDL_PowerState *state, int *seconds, int *percent)
|
||||
SDL_bool SDL_GetPowerInfo_N3DS(SDL_PowerState *state, int *seconds, int *percent)
|
||||
{
|
||||
*state = GetPowerState();
|
||||
*percent = GetBatteryPercentage();
|
||||
|
@ -45,8 +44,7 @@ SDL_GetPowerInfo_N3DS(SDL_PowerState *state, int *seconds, int *percent)
|
|||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
SDL_FORCE_INLINE SDL_PowerState
|
||||
GetPowerState(void)
|
||||
static SDL_PowerState GetPowerState(void)
|
||||
{
|
||||
bool is_plugged;
|
||||
u8 is_charging;
|
||||
|
@ -66,8 +64,7 @@ GetPowerState(void)
|
|||
return SDL_POWERSTATE_ON_BATTERY;
|
||||
}
|
||||
|
||||
SDL_FORCE_INLINE int
|
||||
ReadStateFromPTMU(bool *is_plugged, u8 *is_charging)
|
||||
static int ReadStateFromPTMU(bool *is_plugged, u8 *is_charging)
|
||||
{
|
||||
if (R_FAILED(ptmuInit())) {
|
||||
return SDL_SetError("Failed to initialise PTMU service");
|
||||
|
|
|
@ -27,9 +27,7 @@
|
|||
#include "SDL_power.h"
|
||||
#include <psppower.h>
|
||||
|
||||
SDL_bool
|
||||
SDL_GetPowerInfo_PSP(SDL_PowerState *state, int *seconds,
|
||||
int *percent)
|
||||
SDL_bool SDL_GetPowerInfo_PSP(SDL_PowerState *state, int *seconds, int *percent)
|
||||
{
|
||||
int battery = scePowerIsBatteryExist();
|
||||
int plugged = scePowerIsPowerOnline();
|
||||
|
|
|
@ -52,8 +52,7 @@ void SDL_UIKit_UpdateBatteryMonitoring(void)
|
|||
}
|
||||
#endif /* !TARGET_OS_TV */
|
||||
|
||||
SDL_bool
|
||||
SDL_GetPowerInfo_UIKit(SDL_PowerState *state, int *seconds, int *percent)
|
||||
SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState *state, int *seconds, int *percent)
|
||||
{
|
||||
#if TARGET_OS_TV
|
||||
*state = SDL_POWERSTATE_NO_BATTERY;
|
||||
|
|
|
@ -27,9 +27,7 @@
|
|||
#include "SDL_power.h"
|
||||
#include <psp2/power.h>
|
||||
|
||||
SDL_bool
|
||||
SDL_GetPowerInfo_VITA(SDL_PowerState *state, int *seconds,
|
||||
int *percent)
|
||||
SDL_bool SDL_GetPowerInfo_VITA(SDL_PowerState *state, int *seconds, int *percent)
|
||||
{
|
||||
int battery = 1;
|
||||
int plugged = scePowerIsPowerOnline();
|
||||
|
|
|
@ -27,8 +27,7 @@
|
|||
|
||||
#include "SDL_power.h"
|
||||
|
||||
SDL_bool
|
||||
SDL_GetPowerInfo_Windows(SDL_PowerState *state, int *seconds, int *percent)
|
||||
SDL_bool SDL_GetPowerInfo_Windows(SDL_PowerState *state, int *seconds, int *percent)
|
||||
{
|
||||
SYSTEM_POWER_STATUS status;
|
||||
SDL_bool need_details = SDL_FALSE;
|
||||
|
|
|
@ -26,8 +26,7 @@
|
|||
#include "SDL_power.h"
|
||||
|
||||
extern "C"
|
||||
SDL_bool
|
||||
SDL_GetPowerInfo_WinRT(SDL_PowerState * state, int *seconds, int *percent)
|
||||
SDL_bool SDL_GetPowerInfo_WinRT(SDL_PowerState * state, int *seconds, int *percent)
|
||||
{
|
||||
/* TODO, WinRT: Battery info is available on at least one WinRT platform (Windows Phone 8). Implement SDL_GetPowerInfo_WinRT as appropriate. */
|
||||
/* Notes:
|
||||
|
|
|
@ -283,8 +283,7 @@ int SDL_RenderFlush(SDL_Renderer *renderer)
|
|||
return FlushRenderCommands(renderer);
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_AllocateRenderVertices(SDL_Renderer *renderer, const size_t numbytes, const size_t alignment, size_t *offset)
|
||||
void *SDL_AllocateRenderVertices(SDL_Renderer *renderer, const size_t numbytes, const size_t alignment, size_t *offset)
|
||||
{
|
||||
const size_t needed = renderer->vertex_data_used + numbytes + alignment;
|
||||
const size_t current_offset = renderer->vertex_data_used;
|
||||
|
@ -934,8 +933,7 @@ static void SDL_CalculateSimulatedVSyncInterval(SDL_Renderer *renderer, SDL_Wind
|
|||
}
|
||||
#endif /* !SDL_RENDER_DISABLED */
|
||||
|
||||
SDL_Renderer *
|
||||
SDL_CreateRenderer(SDL_Window *window, int index, Uint32 flags)
|
||||
SDL_Renderer *SDL_CreateRenderer(SDL_Window *window, int index, Uint32 flags)
|
||||
{
|
||||
#if !SDL_RENDER_DISABLED
|
||||
SDL_Renderer *renderer = NULL;
|
||||
|
@ -1103,8 +1101,7 @@ error:
|
|||
#endif
|
||||
}
|
||||
|
||||
SDL_Renderer *
|
||||
SDL_CreateSoftwareRenderer(SDL_Surface *surface)
|
||||
SDL_Renderer *SDL_CreateSoftwareRenderer(SDL_Surface *surface)
|
||||
{
|
||||
#if !SDL_RENDER_DISABLED && SDL_VIDEO_RENDER_SW
|
||||
SDL_Renderer *renderer;
|
||||
|
@ -1133,14 +1130,12 @@ SDL_CreateSoftwareRenderer(SDL_Surface *surface)
|
|||
#endif /* !SDL_RENDER_DISABLED */
|
||||
}
|
||||
|
||||
SDL_Renderer *
|
||||
SDL_GetRenderer(SDL_Window *window)
|
||||
SDL_Renderer *SDL_GetRenderer(SDL_Window *window)
|
||||
{
|
||||
return (SDL_Renderer *)SDL_GetWindowData(window, SDL_WINDOWRENDERDATA);
|
||||
}
|
||||
|
||||
SDL_Window *
|
||||
SDL_RenderGetWindow(SDL_Renderer *renderer)
|
||||
SDL_Window *SDL_RenderGetWindow(SDL_Renderer *renderer)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, NULL);
|
||||
return renderer->window;
|
||||
|
@ -1239,8 +1234,7 @@ static SDL_ScaleMode SDL_GetScaleMode(void)
|
|||
}
|
||||
}
|
||||
|
||||
SDL_Texture *
|
||||
SDL_CreateTexture(SDL_Renderer *renderer, Uint32 format, int access, int w, int h)
|
||||
SDL_Texture *SDL_CreateTexture(SDL_Renderer *renderer, Uint32 format, int access, int w, int h)
|
||||
{
|
||||
SDL_Texture *texture;
|
||||
SDL_bool texture_is_fourcc_and_target;
|
||||
|
@ -1350,8 +1344,7 @@ SDL_CreateTexture(SDL_Renderer *renderer, Uint32 format, int access, int w, int
|
|||
return texture;
|
||||
}
|
||||
|
||||
SDL_Texture *
|
||||
SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *surface)
|
||||
SDL_Texture *SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *surface)
|
||||
{
|
||||
const SDL_PixelFormat *fmt;
|
||||
SDL_bool needAlpha;
|
||||
|
@ -1648,8 +1641,7 @@ int SDL_SetTextureUserData(SDL_Texture *texture, void *userdata)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_GetTextureUserData(SDL_Texture *texture)
|
||||
void *SDL_GetTextureUserData(SDL_Texture *texture)
|
||||
{
|
||||
CHECK_TEXTURE_MAGIC(texture, NULL);
|
||||
|
||||
|
@ -2173,8 +2165,7 @@ void SDL_UnlockTexture(SDL_Texture *texture)
|
|||
texture->locked_surface = NULL;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_RenderTargetSupported(SDL_Renderer *renderer)
|
||||
SDL_bool SDL_RenderTargetSupported(SDL_Renderer *renderer)
|
||||
{
|
||||
if (renderer == NULL || !renderer->SetRenderTarget) {
|
||||
return SDL_FALSE;
|
||||
|
@ -2261,8 +2252,7 @@ int SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
|
|||
return FlushRenderCommandsIfNotBatching(renderer);
|
||||
}
|
||||
|
||||
SDL_Texture *
|
||||
SDL_GetRenderTarget(SDL_Renderer *renderer)
|
||||
SDL_Texture *SDL_GetRenderTarget(SDL_Renderer *renderer)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, NULL);
|
||||
|
||||
|
@ -2428,9 +2418,7 @@ int SDL_RenderSetIntegerScale(SDL_Renderer *renderer, SDL_bool enable)
|
|||
return UpdateLogicalSize(renderer, SDL_TRUE);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDLCALL
|
||||
SDL_RenderGetIntegerScale(SDL_Renderer *renderer)
|
||||
SDL_bool SDL_RenderGetIntegerScale(SDL_Renderer *renderer)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, SDL_FALSE);
|
||||
|
||||
|
@ -2515,8 +2503,7 @@ void SDL_RenderGetClipRect(SDL_Renderer *renderer, SDL_Rect *rect)
|
|||
}
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_RenderIsClipEnabled(SDL_Renderer *renderer)
|
||||
SDL_bool SDL_RenderIsClipEnabled(SDL_Renderer *renderer)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, SDL_FALSE)
|
||||
return renderer->clipping_enabled;
|
||||
|
@ -4382,8 +4369,7 @@ int SDL_GL_UnbindTexture(SDL_Texture *texture)
|
|||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_RenderGetMetalLayer(SDL_Renderer *renderer)
|
||||
void *SDL_RenderGetMetalLayer(SDL_Renderer *renderer)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, NULL);
|
||||
|
||||
|
@ -4394,8 +4380,7 @@ SDL_RenderGetMetalLayer(SDL_Renderer *renderer)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void *
|
||||
SDL_RenderGetMetalCommandEncoder(SDL_Renderer *renderer)
|
||||
void *SDL_RenderGetMetalCommandEncoder(SDL_Renderer *renderer)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, NULL);
|
||||
|
||||
|
@ -4446,8 +4431,7 @@ static SDL_BlendMode SDL_GetLongBlendMode(SDL_BlendMode blendMode)
|
|||
return blendMode;
|
||||
}
|
||||
|
||||
SDL_BlendMode
|
||||
SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor,
|
||||
SDL_BlendMode SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstColorFactor,
|
||||
SDL_BlendOperation colorOperation,
|
||||
SDL_BlendFactor srcAlphaFactor, SDL_BlendFactor dstAlphaFactor,
|
||||
SDL_BlendOperation alphaOperation)
|
||||
|
@ -4457,43 +4441,37 @@ SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, SDL_BlendFactor dstCo
|
|||
return SDL_GetShortBlendMode(blendMode);
|
||||
}
|
||||
|
||||
SDL_BlendFactor
|
||||
SDL_GetBlendModeSrcColorFactor(SDL_BlendMode blendMode)
|
||||
SDL_BlendFactor SDL_GetBlendModeSrcColorFactor(SDL_BlendMode blendMode)
|
||||
{
|
||||
blendMode = SDL_GetLongBlendMode(blendMode);
|
||||
return (SDL_BlendFactor)(((Uint32)blendMode >> 4) & 0xF);
|
||||
}
|
||||
|
||||
SDL_BlendFactor
|
||||
SDL_GetBlendModeDstColorFactor(SDL_BlendMode blendMode)
|
||||
SDL_BlendFactor SDL_GetBlendModeDstColorFactor(SDL_BlendMode blendMode)
|
||||
{
|
||||
blendMode = SDL_GetLongBlendMode(blendMode);
|
||||
return (SDL_BlendFactor)(((Uint32)blendMode >> 8) & 0xF);
|
||||
}
|
||||
|
||||
SDL_BlendOperation
|
||||
SDL_GetBlendModeColorOperation(SDL_BlendMode blendMode)
|
||||
SDL_BlendOperation SDL_GetBlendModeColorOperation(SDL_BlendMode blendMode)
|
||||
{
|
||||
blendMode = SDL_GetLongBlendMode(blendMode);
|
||||
return (SDL_BlendOperation)(((Uint32)blendMode >> 0) & 0xF);
|
||||
}
|
||||
|
||||
SDL_BlendFactor
|
||||
SDL_GetBlendModeSrcAlphaFactor(SDL_BlendMode blendMode)
|
||||
SDL_BlendFactor SDL_GetBlendModeSrcAlphaFactor(SDL_BlendMode blendMode)
|
||||
{
|
||||
blendMode = SDL_GetLongBlendMode(blendMode);
|
||||
return (SDL_BlendFactor)(((Uint32)blendMode >> 20) & 0xF);
|
||||
}
|
||||
|
||||
SDL_BlendFactor
|
||||
SDL_GetBlendModeDstAlphaFactor(SDL_BlendMode blendMode)
|
||||
SDL_BlendFactor SDL_GetBlendModeDstAlphaFactor(SDL_BlendMode blendMode)
|
||||
{
|
||||
blendMode = SDL_GetLongBlendMode(blendMode);
|
||||
return (SDL_BlendFactor)(((Uint32)blendMode >> 24) & 0xF);
|
||||
}
|
||||
|
||||
SDL_BlendOperation
|
||||
SDL_GetBlendModeAlphaOperation(SDL_BlendMode blendMode)
|
||||
SDL_BlendOperation SDL_GetBlendModeAlphaOperation(SDL_BlendMode blendMode)
|
||||
{
|
||||
blendMode = SDL_GetLongBlendMode(blendMode);
|
||||
return (SDL_BlendOperation)(((Uint32)blendMode >> 16) & 0xF);
|
||||
|
|
|
@ -28,8 +28,7 @@
|
|||
#include "../video/SDL_yuv_c.h"
|
||||
#include "SDL_cpuinfo.h"
|
||||
|
||||
SDL_SW_YUVTexture *
|
||||
SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
|
||||
SDL_SW_YUVTexture *SDL_SW_CreateYUVTexture(Uint32 format, int w, int h)
|
||||
{
|
||||
SDL_SW_YUVTexture *swdata;
|
||||
|
||||
|
|
|
@ -1546,8 +1546,7 @@ static int D3D_SetVSync(SDL_Renderer *renderer, const int vsync)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SDL_Renderer *
|
||||
D3D_CreateRenderer(SDL_Window *window, Uint32 flags)
|
||||
SDL_Renderer *D3D_CreateRenderer(SDL_Window *window, Uint32 flags)
|
||||
{
|
||||
SDL_Renderer *renderer;
|
||||
D3D_RenderData *data;
|
||||
|
@ -1736,8 +1735,7 @@ SDL_RenderDriver D3D_RenderDriver = {
|
|||
|
||||
#if defined(__WIN32__) || defined(__WINGDK__)
|
||||
/* This function needs to always exist on Windows, for the Dynamic API. */
|
||||
IDirect3DDevice9 *
|
||||
SDL_RenderGetD3D9Device(SDL_Renderer *renderer)
|
||||
IDirect3DDevice9 *SDL_RenderGetD3D9Device(SDL_Renderer *renderer)
|
||||
{
|
||||
IDirect3DDevice9 *device = NULL;
|
||||
|
||||
|
|
|
@ -200,8 +200,7 @@ static const GUID SDL_IID_ID3D11DeviceContext1 = { 0xbb2c6faa, 0xb5fb, 0x4082, {
|
|||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
Uint32
|
||||
D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat)
|
||||
Uint32 D3D11_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat)
|
||||
{
|
||||
switch (dxgiFormat) {
|
||||
case DXGI_FORMAT_B8G8R8A8_UNORM:
|
||||
|
@ -2300,8 +2299,7 @@ static int D3D11_SetVSync(SDL_Renderer *renderer, const int vsync)
|
|||
}
|
||||
#endif
|
||||
|
||||
SDL_Renderer *
|
||||
D3D11_CreateRenderer(SDL_Window *window, Uint32 flags)
|
||||
SDL_Renderer *D3D11_CreateRenderer(SDL_Window *window, Uint32 flags)
|
||||
{
|
||||
SDL_Renderer *renderer;
|
||||
D3D11_RenderData *data;
|
||||
|
@ -2413,8 +2411,7 @@ SDL_RenderDriver D3D11_RenderDriver = {
|
|||
|
||||
#if defined(__WIN32__) || defined(__WINGDK__)
|
||||
/* This function needs to always exist on Windows, for the Dynamic API. */
|
||||
ID3D11Device *
|
||||
SDL_RenderGetD3D11Device(SDL_Renderer *renderer)
|
||||
ID3D11Device *SDL_RenderGetD3D11Device(SDL_Renderer *renderer)
|
||||
{
|
||||
ID3D11Device *device = NULL;
|
||||
|
||||
|
|
|
@ -276,8 +276,7 @@ UINT D3D12_Align(UINT location, UINT alignment)
|
|||
return (location + (alignment - 1)) & ~(alignment - 1);
|
||||
}
|
||||
|
||||
Uint32
|
||||
D3D12_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat)
|
||||
Uint32 D3D12_DXGIFormatToSDLPixelFormat(DXGI_FORMAT dxgiFormat)
|
||||
{
|
||||
switch (dxgiFormat) {
|
||||
case DXGI_FORMAT_B8G8R8A8_UNORM:
|
||||
|
@ -2949,8 +2948,7 @@ static int D3D12_SetVSync(SDL_Renderer *renderer, const int vsync)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SDL_Renderer *
|
||||
D3D12_CreateRenderer(SDL_Window *window, Uint32 flags)
|
||||
SDL_Renderer *D3D12_CreateRenderer(SDL_Window *window, Uint32 flags)
|
||||
{
|
||||
SDL_Renderer *renderer;
|
||||
D3D12_RenderData *data;
|
||||
|
|
|
@ -159,8 +159,7 @@ typedef struct METAL_ShaderPipelines
|
|||
@implementation METAL_TextureData
|
||||
@end
|
||||
|
||||
static int
|
||||
IsMetalAvailable(const SDL_SysWMinfo *syswm)
|
||||
static int IsMetalAvailable(const SDL_SysWMinfo *syswm)
|
||||
{
|
||||
if (syswm->subsystem != SDL_SYSWM_COCOA && syswm->subsystem != SDL_SYSWM_UIKIT) {
|
||||
return SDL_SetError("Metal render target only supports Cocoa and UIKit video targets at the moment.");
|
||||
|
@ -179,8 +178,7 @@ IsMetalAvailable(const SDL_SysWMinfo *syswm)
|
|||
static const MTLBlendOperation invalidBlendOperation = (MTLBlendOperation)0xFFFFFFFF;
|
||||
static const MTLBlendFactor invalidBlendFactor = (MTLBlendFactor)0xFFFFFFFF;
|
||||
|
||||
static MTLBlendOperation
|
||||
GetBlendOperation(SDL_BlendOperation operation)
|
||||
static MTLBlendOperation GetBlendOperation(SDL_BlendOperation operation)
|
||||
{
|
||||
switch (operation) {
|
||||
case SDL_BLENDOPERATION_ADD: return MTLBlendOperationAdd;
|
||||
|
@ -192,8 +190,7 @@ GetBlendOperation(SDL_BlendOperation operation)
|
|||
}
|
||||
}
|
||||
|
||||
static MTLBlendFactor
|
||||
GetBlendFactor(SDL_BlendFactor factor)
|
||||
static MTLBlendFactor GetBlendFactor(SDL_BlendFactor factor)
|
||||
{
|
||||
switch (factor) {
|
||||
case SDL_BLENDFACTOR_ZERO: return MTLBlendFactorZero;
|
||||
|
@ -210,8 +207,7 @@ GetBlendFactor(SDL_BlendFactor factor)
|
|||
}
|
||||
}
|
||||
|
||||
static NSString *
|
||||
GetVertexFunctionName(SDL_MetalVertexFunction function)
|
||||
static NSString *GetVertexFunctionName(SDL_MetalVertexFunction function)
|
||||
{
|
||||
switch (function) {
|
||||
case SDL_METAL_VERTEX_SOLID: return @"SDL_Solid_vertex";
|
||||
|
@ -220,8 +216,7 @@ GetVertexFunctionName(SDL_MetalVertexFunction function)
|
|||
}
|
||||
}
|
||||
|
||||
static NSString *
|
||||
GetFragmentFunctionName(SDL_MetalFragmentFunction function)
|
||||
static NSString *GetFragmentFunctionName(SDL_MetalFragmentFunction function)
|
||||
{
|
||||
switch (function) {
|
||||
case SDL_METAL_FRAGMENT_SOLID: return @"SDL_Solid_fragment";
|
||||
|
@ -233,9 +228,7 @@ GetFragmentFunctionName(SDL_MetalFragmentFunction function)
|
|||
}
|
||||
}
|
||||
|
||||
static id<MTLRenderPipelineState>
|
||||
MakePipelineState(METAL_RenderData *data, METAL_PipelineCache *cache,
|
||||
NSString *blendlabel, SDL_BlendMode blendmode)
|
||||
static id<MTLRenderPipelineState> MakePipelineState(METAL_RenderData *data, METAL_PipelineCache *cache, NSString *blendlabel, SDL_BlendMode blendmode)
|
||||
{
|
||||
MTLRenderPipelineDescriptor *mtlpipedesc;
|
||||
MTLVertexDescriptor *vertdesc;
|
||||
|
@ -328,8 +321,7 @@ MakePipelineState(METAL_RenderData *data, METAL_PipelineCache *cache,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
MakePipelineCache(METAL_RenderData *data, METAL_PipelineCache *cache, const char *label,
|
||||
static void MakePipelineCache(METAL_RenderData *data, METAL_PipelineCache *cache, const char *label,
|
||||
MTLPixelFormat rtformat, SDL_MetalVertexFunction vertfn, SDL_MetalFragmentFunction fragfn)
|
||||
{
|
||||
SDL_zerop(cache);
|
||||
|
@ -348,8 +340,7 @@ MakePipelineCache(METAL_RenderData *data, METAL_PipelineCache *cache, const char
|
|||
MakePipelineState(data, cache, @" (blend=mul)", SDL_BLENDMODE_MUL);
|
||||
}
|
||||
|
||||
static void
|
||||
DestroyPipelineCache(METAL_PipelineCache *cache)
|
||||
static void DestroyPipelineCache(METAL_PipelineCache *cache)
|
||||
{
|
||||
if (cache != NULL) {
|
||||
for (int i = 0; i < cache->count; i++) {
|
||||
|
@ -360,8 +351,7 @@ DestroyPipelineCache(METAL_PipelineCache *cache)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
MakeShaderPipelines(METAL_RenderData *data, METAL_ShaderPipelines *pipelines, MTLPixelFormat rtformat)
|
||||
static void MakeShaderPipelines(METAL_RenderData *data, METAL_ShaderPipelines *pipelines, MTLPixelFormat rtformat)
|
||||
{
|
||||
SDL_zerop(pipelines);
|
||||
|
||||
|
@ -374,8 +364,7 @@ MakeShaderPipelines(METAL_RenderData *data, METAL_ShaderPipelines *pipelines, MT
|
|||
MakePipelineCache(data, &pipelines->caches[SDL_METAL_FRAGMENT_NV21], "SDL NV21 pipeline", rtformat, SDL_METAL_VERTEX_COPY, SDL_METAL_FRAGMENT_NV21);
|
||||
}
|
||||
|
||||
static METAL_ShaderPipelines *
|
||||
ChooseShaderPipelines(METAL_RenderData *data, MTLPixelFormat rtformat)
|
||||
static METAL_ShaderPipelines *ChooseShaderPipelines(METAL_RenderData *data, MTLPixelFormat rtformat)
|
||||
{
|
||||
METAL_ShaderPipelines *allpipelines = data.allpipelines;
|
||||
int count = data.pipelinescount;
|
||||
|
@ -401,8 +390,7 @@ ChooseShaderPipelines(METAL_RenderData *data, MTLPixelFormat rtformat)
|
|||
return &data.allpipelines[count];
|
||||
}
|
||||
|
||||
static void
|
||||
DestroyAllPipelines(METAL_ShaderPipelines *allpipelines, int count)
|
||||
static void DestroyAllPipelines(METAL_ShaderPipelines *allpipelines, int count)
|
||||
{
|
||||
if (allpipelines != NULL) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
|
@ -415,8 +403,7 @@ DestroyAllPipelines(METAL_ShaderPipelines *allpipelines, int count)
|
|||
}
|
||||
}
|
||||
|
||||
static inline id<MTLRenderPipelineState>
|
||||
ChoosePipelineState(METAL_RenderData *data, METAL_ShaderPipelines *pipelines, SDL_MetalFragmentFunction fragfn, SDL_BlendMode blendmode)
|
||||
static inline id<MTLRenderPipelineState> ChoosePipelineState(METAL_RenderData *data, METAL_ShaderPipelines *pipelines, SDL_MetalFragmentFunction fragfn, SDL_BlendMode blendmode)
|
||||
{
|
||||
METAL_PipelineCache *cache = &pipelines->caches[fragfn];
|
||||
|
||||
|
@ -429,8 +416,7 @@ ChoosePipelineState(METAL_RenderData *data, METAL_ShaderPipelines *pipelines, SD
|
|||
return MakePipelineState(data, cache, [NSString stringWithFormat:@" (blend=custom 0x%x)", blendmode], blendmode);
|
||||
}
|
||||
|
||||
static SDL_bool
|
||||
METAL_ActivateRenderCommandEncoder(SDL_Renderer * renderer, MTLLoadAction load, MTLClearColor *clear_color, id<MTLBuffer> vertex_buffer)
|
||||
static SDL_bool METAL_ActivateRenderCommandEncoder(SDL_Renderer * renderer, MTLLoadAction load, MTLClearColor *clear_color, id<MTLBuffer> vertex_buffer)
|
||||
{
|
||||
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
||||
|
||||
|
@ -497,13 +483,11 @@ METAL_ActivateRenderCommandEncoder(SDL_Renderer * renderer, MTLLoadAction load,
|
|||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
METAL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
|
||||
static void METAL_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
|
||||
{
|
||||
}
|
||||
|
||||
static int
|
||||
METAL_GetOutputSize(SDL_Renderer * renderer, int *w, int *h)
|
||||
static int METAL_GetOutputSize(SDL_Renderer * renderer, int *w, int *h)
|
||||
{ @autoreleasepool {
|
||||
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
||||
if (w) {
|
||||
|
@ -515,8 +499,7 @@ METAL_GetOutputSize(SDL_Renderer * renderer, int *w, int *h)
|
|||
return 0;
|
||||
}}
|
||||
|
||||
static SDL_bool
|
||||
METAL_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode)
|
||||
static SDL_bool METAL_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode)
|
||||
{
|
||||
SDL_BlendFactor srcColorFactor = SDL_GetBlendModeSrcColorFactor(blendMode);
|
||||
SDL_BlendFactor srcAlphaFactor = SDL_GetBlendModeSrcAlphaFactor(blendMode);
|
||||
|
@ -536,8 +519,7 @@ METAL_SupportsBlendMode(SDL_Renderer * renderer, SDL_BlendMode blendMode)
|
|||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
static int
|
||||
METAL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
static int METAL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
{ @autoreleasepool {
|
||||
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
||||
MTLPixelFormat pixfmt;
|
||||
|
@ -645,8 +627,7 @@ METAL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
|||
return 0;
|
||||
}}
|
||||
|
||||
static void
|
||||
METAL_UploadTextureData(id<MTLTexture> texture, SDL_Rect rect, int slice,
|
||||
static void METAL_UploadTextureData(id<MTLTexture> texture, SDL_Rect rect, int slice,
|
||||
const void * pixels, int pitch)
|
||||
{
|
||||
[texture replaceRegion:MTLRegionMake2D(rect.x, rect.y, rect.w, rect.h)
|
||||
|
@ -657,8 +638,7 @@ METAL_UploadTextureData(id<MTLTexture> texture, SDL_Rect rect, int slice,
|
|||
bytesPerImage:0];
|
||||
}
|
||||
|
||||
static MTLStorageMode
|
||||
METAL_GetStorageMode(id<MTLResource> resource)
|
||||
static MTLStorageMode METAL_GetStorageMode(id<MTLResource> resource)
|
||||
{
|
||||
/* iOS 8 does not have this method. */
|
||||
if ([resource respondsToSelector:@selector(storageMode)]) {
|
||||
|
@ -667,8 +647,7 @@ METAL_GetStorageMode(id<MTLResource> resource)
|
|||
return MTLStorageModeShared;
|
||||
}
|
||||
|
||||
static int
|
||||
METAL_UpdateTextureInternal(SDL_Renderer * renderer, METAL_TextureData *texturedata,
|
||||
static int METAL_UpdateTextureInternal(SDL_Renderer * renderer, METAL_TextureData *texturedata,
|
||||
id<MTLTexture> texture, SDL_Rect rect, int slice,
|
||||
const void * pixels, int pitch)
|
||||
{
|
||||
|
@ -736,8 +715,7 @@ METAL_UpdateTextureInternal(SDL_Renderer * renderer, METAL_TextureData *textured
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
METAL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
static int METAL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
const SDL_Rect * rect, const void *pixels, int pitch)
|
||||
{ @autoreleasepool {
|
||||
METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata;
|
||||
|
@ -782,8 +760,7 @@ METAL_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
|||
}}
|
||||
|
||||
#if SDL_HAVE_YUV
|
||||
static int
|
||||
METAL_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
static int METAL_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
const SDL_Rect * rect,
|
||||
const Uint8 *Yplane, int Ypitch,
|
||||
const Uint8 *Uplane, int Upitch,
|
||||
|
@ -814,8 +791,7 @@ METAL_UpdateTextureYUV(SDL_Renderer * renderer, SDL_Texture * texture,
|
|||
return 0;
|
||||
}}
|
||||
|
||||
static int
|
||||
METAL_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
static int METAL_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
const SDL_Rect * rect,
|
||||
const Uint8 *Yplane, int Ypitch,
|
||||
const Uint8 *UVplane, int UVpitch)
|
||||
|
@ -842,8 +818,7 @@ METAL_UpdateTextureNV(SDL_Renderer * renderer, SDL_Texture * texture,
|
|||
}}
|
||||
#endif
|
||||
|
||||
static int
|
||||
METAL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
static int METAL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
||||
const SDL_Rect * rect, void **pixels, int *pitch)
|
||||
{ @autoreleasepool {
|
||||
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
||||
|
@ -877,8 +852,7 @@ METAL_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
|
|||
return 0;
|
||||
}}
|
||||
|
||||
static void
|
||||
METAL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
static void METAL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
{ @autoreleasepool {
|
||||
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
||||
METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata;
|
||||
|
@ -961,8 +935,7 @@ METAL_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
|||
texturedata.hasdata = YES;
|
||||
}}
|
||||
|
||||
static void
|
||||
METAL_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode)
|
||||
static void METAL_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_ScaleMode scaleMode)
|
||||
{ @autoreleasepool {
|
||||
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
||||
METAL_TextureData *texturedata = (__bridge METAL_TextureData *)texture->driverdata;
|
||||
|
@ -974,8 +947,7 @@ METAL_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture, SDL_Sc
|
|||
}
|
||||
}}
|
||||
|
||||
static int
|
||||
METAL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
static int METAL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
{ @autoreleasepool {
|
||||
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
||||
|
||||
|
@ -996,8 +968,7 @@ METAL_SetRenderTarget(SDL_Renderer * renderer, SDL_Texture * texture)
|
|||
}}
|
||||
|
||||
|
||||
static int
|
||||
METAL_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd)
|
||||
static int METAL_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd)
|
||||
{
|
||||
float projection[4][4]; /* Prepare an orthographic projection */
|
||||
const int w = cmd->data.viewport.rect.w;
|
||||
|
@ -1021,8 +992,7 @@ METAL_QueueSetViewport(SDL_Renderer * renderer, SDL_RenderCommand *cmd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
METAL_QueueSetDrawColor(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
|
||||
static int METAL_QueueSetDrawColor(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
|
||||
{
|
||||
const size_t vertlen = sizeof(float) * 4;
|
||||
float *verts = (float *) SDL_AllocateRenderVertices(renderer, vertlen, DEVICE_ALIGN(16), &cmd->data.color.first);
|
||||
|
@ -1040,8 +1010,7 @@ METAL_QueueSetDrawColor(SDL_Renderer *renderer, SDL_RenderCommand *cmd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
METAL_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count)
|
||||
static int METAL_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count)
|
||||
{
|
||||
const SDL_Color color = {
|
||||
cmd->data.draw.r,
|
||||
|
@ -1065,8 +1034,7 @@ METAL_QueueDrawPoints(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
METAL_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count)
|
||||
static int METAL_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_FPoint * points, int count)
|
||||
{
|
||||
const SDL_Color color = {
|
||||
cmd->data.draw.r,
|
||||
|
@ -1119,8 +1087,7 @@ METAL_QueueDrawLines(SDL_Renderer * renderer, SDL_RenderCommand *cmd, const SDL_
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
METAL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture,
|
||||
static int METAL_QueueGeometry(SDL_Renderer *renderer, SDL_RenderCommand *cmd, SDL_Texture *texture,
|
||||
const float *xy, int xy_stride, const SDL_Color *color, int color_stride, const float *uv, int uv_stride,
|
||||
int num_vertices, const void *indices, int num_indices, int size_indices,
|
||||
float scale_x, float scale_y)
|
||||
|
@ -1181,8 +1148,7 @@ typedef struct
|
|||
size_t color_offset;
|
||||
} METAL_DrawStateCache;
|
||||
|
||||
static SDL_bool
|
||||
SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const SDL_MetalFragmentFunction shader,
|
||||
static SDL_bool SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const SDL_MetalFragmentFunction shader,
|
||||
const size_t constants_offset, id<MTLBuffer> mtlbufvertex, METAL_DrawStateCache *statecache)
|
||||
{
|
||||
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
||||
|
@ -1262,8 +1228,7 @@ SetDrawState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const SDL_Met
|
|||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
static SDL_bool
|
||||
SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const size_t constants_offset,
|
||||
static SDL_bool SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const size_t constants_offset,
|
||||
id<MTLBuffer> mtlbufvertex, METAL_DrawStateCache *statecache)
|
||||
{
|
||||
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
||||
|
@ -1295,8 +1260,7 @@ SetCopyState(SDL_Renderer *renderer, const SDL_RenderCommand *cmd, const size_t
|
|||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
static int
|
||||
METAL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize)
|
||||
static int METAL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertices, size_t vertsize)
|
||||
{ @autoreleasepool {
|
||||
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
||||
id<MTLBuffer> mtlbufvertex = nil;
|
||||
|
@ -1437,8 +1401,7 @@ METAL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *ver
|
|||
return 0;
|
||||
}}
|
||||
|
||||
static int
|
||||
METAL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
|
||||
static int METAL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
|
||||
Uint32 pixel_format, void * pixels, int pitch)
|
||||
{ @autoreleasepool {
|
||||
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
||||
|
@ -1490,8 +1453,7 @@ METAL_RenderReadPixels(SDL_Renderer * renderer, const SDL_Rect * rect,
|
|||
return status;
|
||||
}}
|
||||
|
||||
static int
|
||||
METAL_RenderPresent(SDL_Renderer * renderer)
|
||||
static int METAL_RenderPresent(SDL_Renderer * renderer)
|
||||
{ @autoreleasepool {
|
||||
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
||||
SDL_bool ready = SDL_TRUE;
|
||||
|
@ -1528,15 +1490,13 @@ METAL_RenderPresent(SDL_Renderer * renderer)
|
|||
return 0;
|
||||
}}
|
||||
|
||||
static void
|
||||
METAL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
static void METAL_DestroyTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
{ @autoreleasepool {
|
||||
CFBridgingRelease(texture->driverdata);
|
||||
texture->driverdata = NULL;
|
||||
}}
|
||||
|
||||
static void
|
||||
METAL_DestroyRenderer(SDL_Renderer * renderer)
|
||||
static void METAL_DestroyRenderer(SDL_Renderer * renderer)
|
||||
{ @autoreleasepool {
|
||||
if (renderer->driverdata) {
|
||||
METAL_RenderData *data = CFBridgingRelease(renderer->driverdata);
|
||||
|
@ -1557,15 +1517,13 @@ METAL_DestroyRenderer(SDL_Renderer * renderer)
|
|||
SDL_free(renderer);
|
||||
}}
|
||||
|
||||
static void *
|
||||
METAL_GetMetalLayer(SDL_Renderer * renderer)
|
||||
static void *METAL_GetMetalLayer(SDL_Renderer * renderer)
|
||||
{ @autoreleasepool {
|
||||
METAL_RenderData *data = (__bridge METAL_RenderData *) renderer->driverdata;
|
||||
return (__bridge void*)data.mtllayer;
|
||||
}}
|
||||
|
||||
static void *
|
||||
METAL_GetMetalCommandEncoder(SDL_Renderer * renderer)
|
||||
static void *METAL_GetMetalCommandEncoder(SDL_Renderer * renderer)
|
||||
{ @autoreleasepool {
|
||||
// note that data.mtlcmdencoder can be nil if METAL_ActivateRenderCommandEncoder fails.
|
||||
// Before SDL 2.0.18, it might have returned a non-nil encoding that might not have been
|
||||
|
@ -1576,8 +1534,7 @@ METAL_GetMetalCommandEncoder(SDL_Renderer * renderer)
|
|||
return (__bridge void*)data.mtlcmdencoder;
|
||||
}}
|
||||
|
||||
static int
|
||||
METAL_SetVSync(SDL_Renderer * renderer, const int vsync)
|
||||
static int METAL_SetVSync(SDL_Renderer * renderer, const int vsync)
|
||||
{
|
||||
#if (defined(__MACOSX__) && defined(MAC_OS_X_VERSION_10_13)) || TARGET_OS_MACCATALYST
|
||||
if (@available(macOS 10.13, *)) {
|
||||
|
@ -1623,8 +1580,7 @@ static SDL_MetalView GetWindowView(SDL_Window *window)
|
|||
return nil;
|
||||
}
|
||||
|
||||
static SDL_Renderer *
|
||||
METAL_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
static SDL_Renderer *METAL_CreateRenderer(SDL_Window * window, Uint32 flags)
|
||||
{ @autoreleasepool {
|
||||
SDL_Renderer *renderer = NULL;
|
||||
METAL_RenderData *data = NULL;
|
||||
|
|
|
@ -490,8 +490,7 @@ static void DestroyShaderProgram(GL_ShaderContext *ctx, GL_ShaderData *data)
|
|||
ctx->glDeleteObjectARB(data->program);
|
||||
}
|
||||
|
||||
GL_ShaderContext *
|
||||
GL_CreateShaderContext(void)
|
||||
GL_ShaderContext *GL_CreateShaderContext(void)
|
||||
{
|
||||
GL_ShaderContext *ctx;
|
||||
SDL_bool shaders_supported;
|
||||
|
|
|
@ -1291,8 +1291,7 @@ static int PSP_SetVSync(SDL_Renderer *renderer, const int vsync)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SDL_Renderer *
|
||||
PSP_CreateRenderer(SDL_Window *window, Uint32 flags)
|
||||
SDL_Renderer *PSP_CreateRenderer(SDL_Window *window, Uint32 flags)
|
||||
{
|
||||
|
||||
SDL_Renderer *renderer;
|
||||
|
|
|
@ -986,8 +986,7 @@ static void SW_DestroyRenderer(SDL_Renderer *renderer)
|
|||
SDL_free(renderer);
|
||||
}
|
||||
|
||||
SDL_Renderer *
|
||||
SW_CreateRendererForSurface(SDL_Surface *surface)
|
||||
SDL_Renderer *SW_CreateRendererForSurface(SDL_Surface *surface)
|
||||
{
|
||||
SDL_Renderer *renderer;
|
||||
SW_RenderData *data;
|
||||
|
|
|
@ -488,8 +488,7 @@ When using the NONE and MOD modes, color and alpha modulation must be applied be
|
|||
|
||||
*/
|
||||
|
||||
SDL_Surface *
|
||||
SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, int flipx, int flipy,
|
||||
SDL_Surface *SDLgfx_rotateSurface(SDL_Surface *src, double angle, int smooth, int flipx, int flipy,
|
||||
const SDL_Rect *rect_dest, double cangle, double sangle, const SDL_FPoint *center)
|
||||
{
|
||||
SDL_Surface *rz_dst;
|
||||
|
|
|
@ -211,8 +211,7 @@ static int VITA_GXM_SetVSync(SDL_Renderer *renderer, const int vsync)
|
|||
return 0;
|
||||
}
|
||||
|
||||
SDL_Renderer *
|
||||
VITA_GXM_CreateRenderer(SDL_Window *window, Uint32 flags)
|
||||
SDL_Renderer *VITA_GXM_CreateRenderer(SDL_Window *window, Uint32 flags)
|
||||
{
|
||||
SDL_Renderer *renderer;
|
||||
VITA_GXM_RenderData *data;
|
||||
|
|
|
@ -25,8 +25,7 @@
|
|||
|
||||
#include "SDL_render_vita_gxm_memory.h"
|
||||
|
||||
void *
|
||||
vita_mem_alloc(unsigned int type, unsigned int size, unsigned int alignment, unsigned int attribs, SceUID *uid)
|
||||
void *vita_mem_alloc(unsigned int type, unsigned int size, unsigned int alignment, unsigned int attribs, SceUID *uid)
|
||||
{
|
||||
void *mem;
|
||||
|
||||
|
@ -63,8 +62,7 @@ void vita_mem_free(SceUID uid)
|
|||
sceKernelFreeMemBlock(uid);
|
||||
}
|
||||
|
||||
void *
|
||||
vita_gpu_mem_alloc(VITA_GXM_RenderData *data, unsigned int size)
|
||||
void *vita_gpu_mem_alloc(VITA_GXM_RenderData *data, unsigned int size)
|
||||
{
|
||||
void *mem;
|
||||
|
||||
|
@ -122,8 +120,7 @@ void vita_gpu_mem_destroy(VITA_GXM_RenderData *data)
|
|||
}
|
||||
}
|
||||
|
||||
void *
|
||||
vita_mem_vertex_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset)
|
||||
void *vita_mem_vertex_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset)
|
||||
{
|
||||
void *mem = NULL;
|
||||
|
||||
|
@ -150,8 +147,7 @@ void vita_mem_vertex_usse_free(SceUID uid)
|
|||
sceKernelFreeMemBlock(uid);
|
||||
}
|
||||
|
||||
void *
|
||||
vita_mem_fragment_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset)
|
||||
void *vita_mem_fragment_usse_alloc(unsigned int size, SceUID *uid, unsigned int *usse_offset)
|
||||
{
|
||||
void *mem = NULL;
|
||||
|
||||
|
|
|
@ -81,8 +81,7 @@ static void patcher_host_free(void *user_data, void *mem)
|
|||
SDL_free(mem);
|
||||
}
|
||||
|
||||
void *
|
||||
pool_malloc(VITA_GXM_RenderData *data, unsigned int size)
|
||||
void *pool_malloc(VITA_GXM_RenderData *data, unsigned int size)
|
||||
{
|
||||
|
||||
if ((data->pool_index + size) < VITA_GXM_POOL_SIZE) {
|
||||
|
@ -94,8 +93,7 @@ pool_malloc(VITA_GXM_RenderData *data, unsigned int size)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void *
|
||||
pool_memalign(VITA_GXM_RenderData *data, unsigned int size, unsigned int alignment)
|
||||
void *pool_memalign(VITA_GXM_RenderData *data, unsigned int size, unsigned int alignment)
|
||||
{
|
||||
unsigned int new_index = (data->pool_index + alignment - 1) & ~(alignment - 1);
|
||||
if ((new_index + size) < VITA_GXM_POOL_SIZE) {
|
||||
|
@ -959,8 +957,7 @@ gxm_texture_get_format(const gxm_texture *texture)
|
|||
return sceGxmTextureGetFormat(&texture->gxm_tex);
|
||||
}
|
||||
|
||||
void *
|
||||
gxm_texture_get_datap(const gxm_texture *texture)
|
||||
void *gxm_texture_get_datap(const gxm_texture *texture)
|
||||
{
|
||||
return sceGxmTextureGetData(&texture->gxm_tex);
|
||||
}
|
||||
|
@ -985,8 +982,7 @@ static SceGxmColorFormat tex_format_to_color_format(SceGxmTextureFormat format)
|
|||
}
|
||||
}
|
||||
|
||||
gxm_texture *
|
||||
create_gxm_texture(VITA_GXM_RenderData *data, unsigned int w, unsigned int h, SceGxmTextureFormat format, unsigned int isRenderTarget, unsigned int *return_w, unsigned int *return_h, unsigned int *return_pitch, float *return_wscale)
|
||||
gxm_texture *create_gxm_texture(VITA_GXM_RenderData *data, unsigned int w, unsigned int h, SceGxmTextureFormat format, unsigned int isRenderTarget, unsigned int *return_w, unsigned int *return_h, unsigned int *return_pitch, float *return_wscale)
|
||||
{
|
||||
gxm_texture *texture = SDL_calloc(1, sizeof(gxm_texture));
|
||||
int aligned_w = ALIGN(w, 8);
|
||||
|
|
|
@ -168,8 +168,7 @@ int SDL_setenv(const char *name, const char *value, int overwrite)
|
|||
|
||||
/* Retrieve a variable named "name" from the environment */
|
||||
#if defined(HAVE_GETENV)
|
||||
char *
|
||||
SDL_getenv(const char *name)
|
||||
char *SDL_getenv(const char *name)
|
||||
{
|
||||
#if defined(__ANDROID__)
|
||||
/* Make sure variables from the application manifest are available */
|
||||
|
@ -184,8 +183,7 @@ SDL_getenv(const char *name)
|
|||
return getenv(name);
|
||||
}
|
||||
#elif defined(__WIN32__) || defined(__WINGDK__)
|
||||
char *
|
||||
SDL_getenv(const char *name)
|
||||
char *SDL_getenv(const char *name)
|
||||
{
|
||||
size_t bufferlen;
|
||||
|
||||
|
@ -211,8 +209,7 @@ SDL_getenv(const char *name)
|
|||
return SDL_envmem;
|
||||
}
|
||||
#else
|
||||
char *
|
||||
SDL_getenv(const char *name)
|
||||
char *SDL_getenv(const char *name)
|
||||
{
|
||||
size_t len, i;
|
||||
char *value;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue