Lots of fixes importing SDL source wholesale into a new iOS project
--HG-- rename : src/libm/math.h => src/libm/math_libm.h
This commit is contained in:
parent
e112859e94
commit
ad2a21d404
135 changed files with 493 additions and 1093 deletions
|
@ -233,7 +233,6 @@
|
|||
#undef SDL_THREAD_PTHREAD
|
||||
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
|
||||
#undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
|
||||
#undef SDL_THREAD_SPROC
|
||||
#undef SDL_THREAD_WINDOWS
|
||||
|
||||
/* Enable various timer systems */
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef __IPHONEOS__
|
||||
|
||||
#ifdef __WIN32__
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#ifndef NOMINMAX
|
||||
|
@ -11123,6 +11125,8 @@ typedef void (APIENTRYP PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, cons
|
|||
/* *INDENT-ON* */
|
||||
#endif /* NO_SDL_GLEXT */
|
||||
|
||||
#endif /* !__IPHONEOS__ */
|
||||
|
||||
#endif /* _SDL_opengl_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -56,6 +56,9 @@ typedef struct SDL_error
|
|||
} args[ERR_MAX_ARGS];
|
||||
} SDL_error;
|
||||
|
||||
/* Defined in SDL_thread.c */
|
||||
extern SDL_error *SDL_GetErrBuf(void);
|
||||
|
||||
#endif /* _SDL_error_c_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_ALSA
|
||||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -33,7 +35,7 @@
|
|||
#include "../SDL_audio_c.h"
|
||||
#include "SDL_alsa_audio.h"
|
||||
|
||||
#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
|
||||
#if SDL_AUDIO_DRIVER_ALSA_DYNAMIC
|
||||
#include "SDL_loadso.h"
|
||||
#endif
|
||||
|
||||
|
@ -84,7 +86,7 @@ static int (*ALSA_snd_pcm_wait)(snd_pcm_t *, int);
|
|||
static int (*ALSA_snd_pcm_sw_params_set_avail_min)
|
||||
(snd_pcm_t *, snd_pcm_sw_params_t *, snd_pcm_uframes_t);
|
||||
|
||||
#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
|
||||
#if SDL_AUDIO_DRIVER_ALSA_DYNAMIC
|
||||
#define snd_pcm_hw_params_sizeof ALSA_snd_pcm_hw_params_sizeof
|
||||
#define snd_pcm_sw_params_sizeof ALSA_snd_pcm_sw_params_sizeof
|
||||
|
||||
|
@ -147,7 +149,7 @@ load_alsa_syms(void)
|
|||
|
||||
#undef SDL_ALSA_SYM
|
||||
|
||||
#ifdef SDL_AUDIO_DRIVER_ALSA_DYNAMIC
|
||||
#if SDL_AUDIO_DRIVER_ALSA_DYNAMIC
|
||||
|
||||
static void
|
||||
UnloadALSALibrary(void)
|
||||
|
@ -693,4 +695,6 @@ AudioBootStrap ALSA_bootstrap = {
|
|||
"alsa", "ALSA PCM audio", ALSA_Init, 0
|
||||
};
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_ALSA */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_ANDROID
|
||||
|
||||
/* Output audio to Android */
|
||||
|
||||
#include "SDL_audio.h"
|
||||
|
@ -154,4 +156,6 @@ Android_RunAudioThread()
|
|||
SDL_RunAudio(audioDevice);
|
||||
}
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_ANDROID */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_ARTS
|
||||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#ifdef HAVE_SIGNAL_H
|
||||
|
@ -34,14 +36,14 @@
|
|||
#include "../SDL_audio_c.h"
|
||||
#include "SDL_artsaudio.h"
|
||||
|
||||
#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
|
||||
#if SDL_AUDIO_DRIVER_ARTS_DYNAMIC
|
||||
#include "SDL_name.h"
|
||||
#include "SDL_loadso.h"
|
||||
#else
|
||||
#define SDL_NAME(X) X
|
||||
#endif
|
||||
|
||||
#ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
|
||||
#if SDL_AUDIO_DRIVER_ARTS_DYNAMIC
|
||||
|
||||
static const char *arts_library = SDL_AUDIO_DRIVER_ARTS_DYNAMIC;
|
||||
static void *arts_handle = NULL;
|
||||
|
@ -372,4 +374,6 @@ AudioBootStrap ARTS_bootstrap = {
|
|||
"arts", "Analog RealTime Synthesizer", ARTS_Init, 0
|
||||
};
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_ARTS */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_BEOSAUDIO
|
||||
|
||||
/* Allow access to the audio stream on BeOS */
|
||||
|
||||
#include <SoundPlayer.h>
|
||||
|
@ -214,4 +216,6 @@ AudioBootStrap BEOSAUDIO_bootstrap = {
|
|||
"baudio", "BeOS BSoundPlayer", BEOSAUDIO_Init, 0
|
||||
};
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_BEOSAUDIO */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_BSD
|
||||
|
||||
/*
|
||||
* Driver for native OpenBSD/NetBSD audio(4).
|
||||
* vedge@vedge.com.ar.
|
||||
|
@ -364,4 +366,6 @@ AudioBootStrap BSD_AUDIO_bootstrap = {
|
|||
"bsd", "BSD audio", BSDAUDIO_Init, 0
|
||||
};
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_BSD */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_DSOUND
|
||||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include "SDL_timer.h"
|
||||
|
@ -549,4 +551,6 @@ AudioBootStrap DSOUND_bootstrap = {
|
|||
"directsound", "DirectSound", DSOUND_Init, 0
|
||||
};
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_DSOUND */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_DISK
|
||||
|
||||
/* Output raw audio data to a file. */
|
||||
|
||||
#if HAVE_STDIO_H
|
||||
|
@ -159,4 +161,6 @@ AudioBootStrap DISKAUD_bootstrap = {
|
|||
"disk", "direct-to-disk audio", DISKAUD_Init, 1
|
||||
};
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_DISK */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_OSS
|
||||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include <stdio.h> /* For perror() */
|
||||
|
@ -312,4 +314,6 @@ AudioBootStrap DSP_bootstrap = {
|
|||
"dsp", "OSS /dev/dsp standard audio", DSP_Init, 0
|
||||
};
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_OSS */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_ESD
|
||||
|
||||
/* Allow access to an ESD network stream mixing buffer */
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -34,14 +36,14 @@
|
|||
#include "../SDL_audio_c.h"
|
||||
#include "SDL_esdaudio.h"
|
||||
|
||||
#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC
|
||||
#if SDL_AUDIO_DRIVER_ESD_DYNAMIC
|
||||
#include "SDL_name.h"
|
||||
#include "SDL_loadso.h"
|
||||
#else
|
||||
#define SDL_NAME(X) X
|
||||
#endif
|
||||
|
||||
#ifdef SDL_AUDIO_DRIVER_ESD_DYNAMIC
|
||||
#if SDL_AUDIO_DRIVER_ESD_DYNAMIC
|
||||
|
||||
static const char *esd_library = SDL_AUDIO_DRIVER_ESD_DYNAMIC;
|
||||
static void *esd_handle = NULL;
|
||||
|
@ -345,4 +347,6 @@ AudioBootStrap ESD_bootstrap = {
|
|||
"esd", "Enlightened Sound Daemon", ESD_Init, 0
|
||||
};
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_ESD */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_FUSIONSOUND
|
||||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#ifdef HAVE_SIGNAL_H
|
||||
|
@ -37,7 +39,7 @@
|
|||
|
||||
//#define SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC "libfusionsound.so"
|
||||
|
||||
#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
|
||||
#if SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
|
||||
#include "SDL_name.h"
|
||||
#include "SDL_loadso.h"
|
||||
#else
|
||||
|
@ -51,7 +53,7 @@ typedef DFBResult DirectResult;
|
|||
/* Buffers to use - more than 2 gives a lot of latency */
|
||||
#define FUSION_BUFFERS (2)
|
||||
|
||||
#ifdef SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
|
||||
#if SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC
|
||||
|
||||
static const char *fs_library = SDL_AUDIO_DRIVER_FUSIONSOUND_DYNAMIC;
|
||||
static void *fs_handle = NULL;
|
||||
|
@ -345,4 +347,6 @@ AudioBootStrap FUSIONSOUND_bootstrap = {
|
|||
"fusionsound", "FusionSound", SDL_FS_Init, 0
|
||||
};
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_FUSIONSOUND */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_NAS
|
||||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include <signal.h>
|
||||
|
@ -50,7 +52,7 @@ static AuEventHandlerRec *(*NAS_AuRegisterEventHandler)
|
|||
(AuServer *, AuMask, int, AuID, AuEventHandlerCallback, AuPointer);
|
||||
|
||||
|
||||
#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC
|
||||
#if SDL_AUDIO_DRIVER_NAS_DYNAMIC
|
||||
|
||||
static const char *nas_library = SDL_AUDIO_DRIVER_NAS_DYNAMIC;
|
||||
static void *nas_handle = NULL;
|
||||
|
@ -89,7 +91,7 @@ load_nas_syms(void)
|
|||
|
||||
#undef SDL_NAS_SYM
|
||||
|
||||
#ifdef SDL_AUDIO_DRIVER_NAS_DYNAMIC
|
||||
#if SDL_AUDIO_DRIVER_NAS_DYNAMIC
|
||||
|
||||
static void
|
||||
UnloadNASLibrary(void)
|
||||
|
@ -397,4 +399,6 @@ AudioBootStrap NAS_bootstrap = {
|
|||
"nas", "Network Audio System", NAS_Init, 0
|
||||
};
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_NAS */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_NDS
|
||||
|
||||
/* Output audio to NDS */
|
||||
|
||||
#include <nds.h>
|
||||
|
@ -122,4 +124,6 @@ AudioBootStrap NDSAUD_bootstrap = {
|
|||
"nds", "SDL NDS audio driver", NDSAUD_Init, 0 /*1? */
|
||||
};
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_NDS */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_PAUDIO
|
||||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include <errno.h>
|
||||
|
@ -545,4 +547,6 @@ AudioBootStrap PAUDIO_bootstrap = {
|
|||
"paud", "AIX Paudio", PAUDIO_Init, 0
|
||||
};
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_PAUDIO */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -106,7 +106,7 @@ static void (*PULSEAUDIO_pa_stream_unref) (pa_stream *);
|
|||
static int load_pulseaudio_syms(void);
|
||||
|
||||
|
||||
#ifdef SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
|
||||
#if SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC
|
||||
|
||||
static const char *pulseaudio_library = SDL_AUDIO_DRIVER_PULSEAUDIO_DYNAMIC;
|
||||
static void *pulseaudio_handle = NULL;
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_QSA
|
||||
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
@ -863,4 +865,6 @@ AudioBootStrap QSAAUDIO_bootstrap = {
|
|||
"qsa", "QNX QSA Audio", QSA_Init, 0
|
||||
};
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_QSA */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -1,8 +1,3 @@
|
|||
/* I'm gambling no one uses this audio backend...we'll see who emails. :) */
|
||||
#error this code has not been updated for SDL 1.3.
|
||||
#error if no one emails icculus at icculus.org and tells him that this
|
||||
#error code is needed, this audio backend will eventually be removed from SDL.
|
||||
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
|
||||
|
@ -25,6 +20,13 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_SUNAUDIO
|
||||
|
||||
/* I'm gambling no one uses this audio backend...we'll see who emails. :) */
|
||||
#error this code has not been updated for SDL 1.3.
|
||||
#error if no one emails icculus at icculus.org and tells him that this
|
||||
#error code is needed, this audio backend will eventually be removed from SDL.
|
||||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include <fcntl.h>
|
||||
|
@ -450,4 +452,6 @@ snd2au(int sample)
|
|||
return (mask & sample);
|
||||
}
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_SUNAUDIO */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -1,556 +0,0 @@
|
|||
/* I'm gambling no one uses this audio backend...we'll see who emails. :) */
|
||||
#error this code has not been updated for SDL 1.3.
|
||||
#error if no one emails icculus at icculus.org and tells him that this
|
||||
#error code is needed, this audio backend will eventually be removed from SDL.
|
||||
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mman.h>
|
||||
|
||||
#include "SDL_audio.h"
|
||||
#include "../SDL_audio_c.h"
|
||||
#include "SDL_umsaudio.h"
|
||||
|
||||
#define DEBUG_AUDIO 1
|
||||
|
||||
/* Audio driver functions */
|
||||
static int UMS_OpenAudio(_THIS, SDL_AudioSpec * spec);
|
||||
static void UMS_PlayAudio(_THIS);
|
||||
static Uint8 *UMS_GetAudioBuf(_THIS);
|
||||
static void UMS_CloseAudio(_THIS);
|
||||
|
||||
static UMSAudioDevice_ReturnCode UADOpen(_THIS, string device, string mode,
|
||||
long flags);
|
||||
static UMSAudioDevice_ReturnCode UADClose(_THIS);
|
||||
static UMSAudioDevice_ReturnCode UADGetBitsPerSample(_THIS, long *bits);
|
||||
static UMSAudioDevice_ReturnCode UADSetBitsPerSample(_THIS, long bits);
|
||||
static UMSAudioDevice_ReturnCode UADSetSampleRate(_THIS, long rate,
|
||||
long *set_rate);
|
||||
static UMSAudioDevice_ReturnCode UADSetByteOrder(_THIS, string byte_order);
|
||||
static UMSAudioDevice_ReturnCode UADSetAudioFormatType(_THIS, string fmt);
|
||||
static UMSAudioDevice_ReturnCode UADSetNumberFormat(_THIS, string fmt);
|
||||
static UMSAudioDevice_ReturnCode UADInitialize(_THIS);
|
||||
static UMSAudioDevice_ReturnCode UADStart(_THIS);
|
||||
static UMSAudioDevice_ReturnCode UADStop(_THIS);
|
||||
static UMSAudioDevice_ReturnCode UADSetTimeFormat(_THIS,
|
||||
UMSAudioTypes_TimeFormat
|
||||
fmt);
|
||||
static UMSAudioDevice_ReturnCode UADWriteBuffSize(_THIS, long *buff_size);
|
||||
static UMSAudioDevice_ReturnCode UADWriteBuffRemain(_THIS, long *buff_size);
|
||||
static UMSAudioDevice_ReturnCode UADWriteBuffUsed(_THIS, long *buff_size);
|
||||
static UMSAudioDevice_ReturnCode UADSetDMABufferSize(_THIS, long bytes,
|
||||
long *bytes_ret);
|
||||
static UMSAudioDevice_ReturnCode UADSetVolume(_THIS, long volume);
|
||||
static UMSAudioDevice_ReturnCode UADSetBalance(_THIS, long balance);
|
||||
static UMSAudioDevice_ReturnCode UADSetChannels(_THIS, long channels);
|
||||
static UMSAudioDevice_ReturnCode UADPlayRemainingData(_THIS, boolean block);
|
||||
static UMSAudioDevice_ReturnCode UADEnableOutput(_THIS, string output,
|
||||
long *left_gain,
|
||||
long *right_gain);
|
||||
static UMSAudioDevice_ReturnCode UADWrite(_THIS, UMSAudioTypes_Buffer * buff,
|
||||
long samples,
|
||||
long *samples_written);
|
||||
|
||||
/* Audio driver bootstrap functions */
|
||||
static int
|
||||
Audio_Available(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
Audio_DeleteDevice(_THIS)
|
||||
{
|
||||
if (this->hidden->playbuf._buffer)
|
||||
SDL_free(this->hidden->playbuf._buffer);
|
||||
if (this->hidden->fillbuf._buffer)
|
||||
SDL_free(this->hidden->fillbuf._buffer);
|
||||
_somFree(this->hidden->umsdev);
|
||||
SDL_free(this->hidden);
|
||||
SDL_free(this);
|
||||
}
|
||||
|
||||
static SDL_AudioDevice *
|
||||
Audio_CreateDevice(int devindex)
|
||||
{
|
||||
SDL_AudioDevice *this;
|
||||
|
||||
/*
|
||||
* Allocate and initialize management storage and private management
|
||||
* storage for this SDL-using library.
|
||||
*/
|
||||
this = (SDL_AudioDevice *) SDL_malloc(sizeof(SDL_AudioDevice));
|
||||
if (this) {
|
||||
SDL_memset(this, 0, (sizeof *this));
|
||||
this->hidden = (struct SDL_PrivateAudioData *)
|
||||
SDL_malloc((sizeof *this->hidden));
|
||||
}
|
||||
if ((this == NULL) || (this->hidden == NULL)) {
|
||||
SDL_OutOfMemory();
|
||||
if (this) {
|
||||
SDL_free(this);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
SDL_memset(this->hidden, 0, (sizeof *this->hidden));
|
||||
#ifdef DEBUG_AUDIO
|
||||
fprintf(stderr, "Creating UMS Audio device\n");
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Calls for UMS env initialization and audio object construction.
|
||||
*/
|
||||
this->hidden->ev = somGetGlobalEnvironment();
|
||||
this->hidden->umsdev = UMSAudioDeviceNew();
|
||||
|
||||
/*
|
||||
* Set the function pointers.
|
||||
*/
|
||||
this->OpenAudio = UMS_OpenAudio;
|
||||
this->WaitAudio = NULL; /* we do blocking output */
|
||||
this->PlayAudio = UMS_PlayAudio;
|
||||
this->GetAudioBuf = UMS_GetAudioBuf;
|
||||
this->CloseAudio = UMS_CloseAudio;
|
||||
this->free = Audio_DeleteDevice;
|
||||
|
||||
#ifdef DEBUG_AUDIO
|
||||
fprintf(stderr, "done\n");
|
||||
#endif
|
||||
return this;
|
||||
}
|
||||
|
||||
AudioBootStrap UMS_bootstrap = {
|
||||
"ums", "AIX UMS audio", Audio_Available, Audio_CreateDevice, 0
|
||||
};
|
||||
|
||||
static Uint8 *
|
||||
UMS_GetAudioBuf(_THIS)
|
||||
{
|
||||
#ifdef DEBUG_AUDIO
|
||||
fprintf(stderr, "enter UMS_GetAudioBuf\n");
|
||||
#endif
|
||||
return this->hidden->fillbuf._buffer;
|
||||
/*
|
||||
long bufSize;
|
||||
UMSAudioDevice_ReturnCode rc;
|
||||
|
||||
rc = UADSetTimeFormat(this, UMSAudioTypes_Bytes );
|
||||
rc = UADWriteBuffSize(this, bufSize );
|
||||
*/
|
||||
}
|
||||
|
||||
static void
|
||||
UMS_CloseAudio(_THIS)
|
||||
{
|
||||
UMSAudioDevice_ReturnCode rc;
|
||||
|
||||
#ifdef DEBUG_AUDIO
|
||||
fprintf(stderr, "enter UMS_CloseAudio\n");
|
||||
#endif
|
||||
rc = UADPlayRemainingData(this, TRUE);
|
||||
rc = UADStop(this);
|
||||
rc = UADClose(this);
|
||||
}
|
||||
|
||||
static void
|
||||
UMS_PlayAudio(_THIS)
|
||||
{
|
||||
UMSAudioDevice_ReturnCode rc;
|
||||
long samplesToWrite;
|
||||
long samplesWritten;
|
||||
UMSAudioTypes_Buffer swpbuf;
|
||||
|
||||
#ifdef DEBUG_AUDIO
|
||||
fprintf(stderr, "enter UMS_PlayAudio\n");
|
||||
#endif
|
||||
samplesToWrite =
|
||||
this->hidden->playbuf._length / this->hidden->bytesPerSample;
|
||||
do {
|
||||
rc = UADWrite(this, &this->hidden->playbuf,
|
||||
samplesToWrite, &samplesWritten);
|
||||
samplesToWrite -= samplesWritten;
|
||||
|
||||
/* rc values: UMSAudioDevice_Success
|
||||
* UMSAudioDevice_Failure
|
||||
* UMSAudioDevice_Preempted
|
||||
* UMSAudioDevice_Interrupted
|
||||
* UMSAudioDevice_DeviceError
|
||||
*/
|
||||
if (rc == UMSAudioDevice_DeviceError) {
|
||||
#ifdef DEBUG_AUDIO
|
||||
fprintf(stderr, "Returning from PlayAudio with devices error\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
} while (samplesToWrite > 0);
|
||||
|
||||
SDL_LockAudio();
|
||||
SDL_memcpy(&swpbuf, &this->hidden->playbuf, sizeof(UMSAudioTypes_Buffer));
|
||||
SDL_memcpy(&this->hidden->playbuf, &this->hidden->fillbuf,
|
||||
sizeof(UMSAudioTypes_Buffer));
|
||||
SDL_memcpy(&this->hidden->fillbuf, &swpbuf, sizeof(UMSAudioTypes_Buffer));
|
||||
SDL_UnlockAudio();
|
||||
|
||||
#ifdef DEBUG_AUDIO
|
||||
fprintf(stderr, "Wrote audio data and swapped buffer\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
#if 0
|
||||
// /* Set the DSP frequency */
|
||||
// value = spec->freq;
|
||||
// if ( ioctl(this->hidden->audio_fd, SOUND_PCM_WRITE_RATE, &value) < 0 ) {
|
||||
// SDL_SetError("Couldn't set audio frequency");
|
||||
// return(-1);
|
||||
// }
|
||||
// spec->freq = value;
|
||||
#endif
|
||||
|
||||
static int
|
||||
UMS_OpenAudio(_THIS, SDL_AudioSpec * spec)
|
||||
{
|
||||
char *audiodev = "/dev/paud0";
|
||||
long lgain;
|
||||
long rgain;
|
||||
long outRate;
|
||||
long outBufSize;
|
||||
long bitsPerSample;
|
||||
long samplesPerSec;
|
||||
long success;
|
||||
SDL_AudioFormat test_format;
|
||||
int frag_spec;
|
||||
UMSAudioDevice_ReturnCode rc;
|
||||
|
||||
#ifdef DEBUG_AUDIO
|
||||
fprintf(stderr, "enter UMS_OpenAudio\n");
|
||||
#endif
|
||||
rc = UADOpen(this, audiodev, "PLAY", UMSAudioDevice_BlockingIO);
|
||||
if (rc != UMSAudioDevice_Success) {
|
||||
SDL_SetError("Couldn't open %s: %s", audiodev, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = UADSetAudioFormatType(this, "PCM");
|
||||
|
||||
success = 0;
|
||||
test_format = SDL_FirstAudioFormat(spec->format);
|
||||
do {
|
||||
#ifdef DEBUG_AUDIO
|
||||
fprintf(stderr, "Trying format 0x%4.4x\n", test_format);
|
||||
#endif
|
||||
switch (test_format) {
|
||||
case AUDIO_U8:
|
||||
/* from the mac code: better ? */
|
||||
/* sample_bits = spec->size / spec->samples / spec->channels * 8; */
|
||||
success = 1;
|
||||
bitsPerSample = 8;
|
||||
rc = UADSetSampleRate(this, spec->freq << 16, &outRate);
|
||||
rc = UADSetByteOrder(this, "MSB"); /* irrelevant */
|
||||
rc = UADSetNumberFormat(this, "UNSIGNED");
|
||||
break;
|
||||
case AUDIO_S8:
|
||||
success = 1;
|
||||
bitsPerSample = 8;
|
||||
rc = UADSetSampleRate(this, spec->freq << 16, &outRate);
|
||||
rc = UADSetByteOrder(this, "MSB"); /* irrelevant */
|
||||
rc = UADSetNumberFormat(this, "SIGNED");
|
||||
break;
|
||||
case AUDIO_S16LSB:
|
||||
success = 1;
|
||||
bitsPerSample = 16;
|
||||
rc = UADSetSampleRate(this, spec->freq << 16, &outRate);
|
||||
rc = UADSetByteOrder(this, "LSB");
|
||||
rc = UADSetNumberFormat(this, "SIGNED");
|
||||
break;
|
||||
case AUDIO_S16MSB:
|
||||
success = 1;
|
||||
bitsPerSample = 16;
|
||||
rc = UADSetSampleRate(this, spec->freq << 16, &outRate);
|
||||
rc = UADSetByteOrder(this, "MSB");
|
||||
rc = UADSetNumberFormat(this, "SIGNED");
|
||||
break;
|
||||
case AUDIO_U16LSB:
|
||||
success = 1;
|
||||
bitsPerSample = 16;
|
||||
rc = UADSetSampleRate(this, spec->freq << 16, &outRate);
|
||||
rc = UADSetByteOrder(this, "LSB");
|
||||
rc = UADSetNumberFormat(this, "UNSIGNED");
|
||||
break;
|
||||
case AUDIO_U16MSB:
|
||||
success = 1;
|
||||
bitsPerSample = 16;
|
||||
rc = UADSetSampleRate(this, spec->freq << 16, &outRate);
|
||||
rc = UADSetByteOrder(this, "MSB");
|
||||
rc = UADSetNumberFormat(this, "UNSIGNED");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (!success) {
|
||||
test_format = SDL_NextAudioFormat();
|
||||
}
|
||||
} while (!success && test_format);
|
||||
|
||||
if (success == 0) {
|
||||
SDL_SetError("Couldn't find any hardware audio formats");
|
||||
return -1;
|
||||
}
|
||||
|
||||
spec->format = test_format;
|
||||
|
||||
for (frag_spec = 0; (0x01 << frag_spec) < spec->size; ++frag_spec);
|
||||
if ((0x01 << frag_spec) != spec->size) {
|
||||
SDL_SetError("Fragment size must be a power of two");
|
||||
return -1;
|
||||
}
|
||||
if (frag_spec > 2048)
|
||||
frag_spec = 2048;
|
||||
|
||||
this->hidden->bytesPerSample = (bitsPerSample / 8) * spec->channels;
|
||||
samplesPerSec = this->hidden->bytesPerSample * outRate;
|
||||
|
||||
this->hidden->playbuf._length = 0;
|
||||
this->hidden->playbuf._maximum = spec->size;
|
||||
this->hidden->playbuf._buffer = (unsigned char *) SDL_malloc(spec->size);
|
||||
this->hidden->fillbuf._length = 0;
|
||||
this->hidden->fillbuf._maximum = spec->size;
|
||||
this->hidden->fillbuf._buffer = (unsigned char *) SDL_malloc(spec->size);
|
||||
|
||||
rc = UADSetBitsPerSample(this, bitsPerSample);
|
||||
rc = UADSetDMABufferSize(this, frag_spec, &outBufSize);
|
||||
rc = UADSetChannels(this, spec->channels); /* functions reduces to mono or stereo */
|
||||
|
||||
lgain = 100; /*maximum left input gain */
|
||||
rgain = 100; /*maimum right input gain */
|
||||
rc = UADEnableOutput(this, "LINE_OUT", &lgain, &rgain);
|
||||
rc = UADInitialize(this);
|
||||
rc = UADStart(this);
|
||||
rc = UADSetVolume(this, 100);
|
||||
rc = UADSetBalance(this, 0);
|
||||
|
||||
/* We're ready to rock and roll. :-) */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADGetBitsPerSample(_THIS, long *bits)
|
||||
{
|
||||
return UMSAudioDevice_get_bits_per_sample(this->hidden->umsdev,
|
||||
this->hidden->ev, bits);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADSetBitsPerSample(_THIS, long bits)
|
||||
{
|
||||
return UMSAudioDevice_set_bits_per_sample(this->hidden->umsdev,
|
||||
this->hidden->ev, bits);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADSetSampleRate(_THIS, long rate, long *set_rate)
|
||||
{
|
||||
/* from the mac code: sample rate = spec->freq << 16; */
|
||||
return UMSAudioDevice_set_sample_rate(this->hidden->umsdev,
|
||||
this->hidden->ev, rate, set_rate);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADSetByteOrder(_THIS, string byte_order)
|
||||
{
|
||||
return UMSAudioDevice_set_byte_order(this->hidden->umsdev,
|
||||
this->hidden->ev, byte_order);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADSetAudioFormatType(_THIS, string fmt)
|
||||
{
|
||||
/* possible PCM, A_LAW or MU_LAW */
|
||||
return UMSAudioDevice_set_audio_format_type(this->hidden->umsdev,
|
||||
this->hidden->ev, fmt);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADSetNumberFormat(_THIS, string fmt)
|
||||
{
|
||||
/* possible SIGNED, UNSIGNED, or TWOS_COMPLEMENT */
|
||||
return UMSAudioDevice_set_number_format(this->hidden->umsdev,
|
||||
this->hidden->ev, fmt);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADInitialize(_THIS)
|
||||
{
|
||||
return UMSAudioDevice_initialize(this->hidden->umsdev, this->hidden->ev);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADStart(_THIS)
|
||||
{
|
||||
return UMSAudioDevice_start(this->hidden->umsdev, this->hidden->ev);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADSetTimeFormat(_THIS, UMSAudioTypes_TimeFormat fmt)
|
||||
{
|
||||
/*
|
||||
* Switches the time format to the new format, immediately.
|
||||
* possible UMSAudioTypes_Msecs, UMSAudioTypes_Bytes or UMSAudioTypes_Samples
|
||||
*/
|
||||
return UMSAudioDevice_set_time_format(this->hidden->umsdev,
|
||||
this->hidden->ev, fmt);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADWriteBuffSize(_THIS, long *buff_size)
|
||||
{
|
||||
/*
|
||||
* returns write buffer size in the current time format
|
||||
*/
|
||||
return UMSAudioDevice_write_buff_size(this->hidden->umsdev,
|
||||
this->hidden->ev, buff_size);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADWriteBuffRemain(_THIS, long *buff_size)
|
||||
{
|
||||
/*
|
||||
* returns amount of available space in the write buffer
|
||||
* in the current time format
|
||||
*/
|
||||
return UMSAudioDevice_write_buff_remain(this->hidden->umsdev,
|
||||
this->hidden->ev, buff_size);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADWriteBuffUsed(_THIS, long *buff_size)
|
||||
{
|
||||
/*
|
||||
* returns amount of filled space in the write buffer
|
||||
* in the current time format
|
||||
*/
|
||||
return UMSAudioDevice_write_buff_used(this->hidden->umsdev,
|
||||
this->hidden->ev, buff_size);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADSetDMABufferSize(_THIS, long bytes, long *bytes_ret)
|
||||
{
|
||||
/*
|
||||
* Request a new DMA buffer size, maximum requested size 2048.
|
||||
* Takes effect with next initialize() call.
|
||||
* Devices may or may not support DMA.
|
||||
*/
|
||||
return UMSAudioDevice_set_DMA_buffer_size(this->hidden->umsdev,
|
||||
this->hidden->ev,
|
||||
bytes, bytes_ret);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADSetVolume(_THIS, long volume)
|
||||
{
|
||||
/*
|
||||
* Set the volume.
|
||||
* Takes effect immediately.
|
||||
*/
|
||||
return UMSAudioDevice_set_volume(this->hidden->umsdev,
|
||||
this->hidden->ev, volume);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADSetBalance(_THIS, long balance)
|
||||
{
|
||||
/*
|
||||
* Set the balance.
|
||||
* Takes effect immediately.
|
||||
*/
|
||||
return UMSAudioDevice_set_balance(this->hidden->umsdev,
|
||||
this->hidden->ev, balance);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADSetChannels(_THIS, long channels)
|
||||
{
|
||||
/*
|
||||
* Set mono or stereo.
|
||||
* Takes effect with next initialize() call.
|
||||
*/
|
||||
if (channels != 1)
|
||||
channels = 2;
|
||||
return UMSAudioDevice_set_number_of_channels(this->hidden->umsdev,
|
||||
this->hidden->ev, channels);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADOpen(_THIS, string device, string mode, long flags)
|
||||
{
|
||||
return UMSAudioDevice_open(this->hidden->umsdev,
|
||||
this->hidden->ev, device, mode, flags);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADWrite(_THIS, UMSAudioTypes_Buffer * buff,
|
||||
long samples, long *samples_written)
|
||||
{
|
||||
return UMSAudioDevice_write(this->hidden->umsdev,
|
||||
this->hidden->ev,
|
||||
buff, samples, samples_written);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADPlayRemainingData(_THIS, boolean block)
|
||||
{
|
||||
return UMSAudioDevice_play_remaining_data(this->hidden->umsdev,
|
||||
this->hidden->ev, block);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADStop(_THIS)
|
||||
{
|
||||
return UMSAudioDevice_stop(this->hidden->umsdev, this->hidden->ev);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADClose(_THIS)
|
||||
{
|
||||
return UMSAudioDevice_close(this->hidden->umsdev, this->hidden->ev);
|
||||
}
|
||||
|
||||
static UMSAudioDevice_ReturnCode
|
||||
UADEnableOutput(_THIS, string output, long *left_gain, long *right_gain)
|
||||
{
|
||||
return UMSAudioDevice_enable_output(this->hidden->umsdev,
|
||||
this->hidden->ev,
|
||||
output, left_gain, right_gain);
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,47 +0,0 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_UMSaudio_h
|
||||
#define _SDL_UMSaudio_h
|
||||
|
||||
#include <UMS/UMSAudioDevice.h>
|
||||
|
||||
#include "../SDL_sysaudio.h"
|
||||
|
||||
/* Hidden "this" pointer for the audio functions */
|
||||
#define _THIS SDL_AudioDevice *this
|
||||
|
||||
struct SDL_PrivateAudioData
|
||||
{
|
||||
/* Pointer to the (open) UMS audio device */
|
||||
Environment *ev;
|
||||
UMSAudioDevice umsdev;
|
||||
|
||||
/* Raw mixing buffer */
|
||||
UMSAudioTypes_Buffer playbuf;
|
||||
UMSAudioTypes_Buffer fillbuf;
|
||||
|
||||
long bytesPerSample;
|
||||
};
|
||||
|
||||
#endif /* _SDL_UMSaudio_h */
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_WINMM
|
||||
|
||||
/* Allow access to a raw mixing buffer */
|
||||
|
||||
#include "../../core/windows/SDL_windows.h"
|
||||
|
@ -406,4 +408,6 @@ AudioBootStrap WINMM_bootstrap = {
|
|||
"winmm", "Windows Waveform Audio", WINMM_Init, 0
|
||||
};
|
||||
|
||||
#endif /* SDL_AUDIO_DRIVER_WINMM */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -19,14 +19,15 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_XAUDIO2
|
||||
|
||||
#include "../../core/windows/SDL_windows.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "../SDL_audio_c.h"
|
||||
#include "../SDL_sysaudio.h"
|
||||
#include "SDL_assert.h"
|
||||
|
||||
#if SDL_AUDIO_DRIVER_XAUDIO2
|
||||
|
||||
#include <dxsdkver.h> /* XAudio2 exists as of the March 2008 DirectX SDK */
|
||||
#if (!defined(_DXSDK_BUILD_MAJOR) || (_DXSDK_BUILD_MAJOR < 1284))
|
||||
# warning Your DirectX SDK is too old. Disabling XAudio2 support.
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
#include "SDL_config.h"
|
||||
#include "SDL_stdinc.h"
|
||||
|
||||
#ifdef __ANDROID__
|
||||
|
||||
#include "SDL_android.h"
|
||||
|
||||
extern "C" {
|
||||
|
@ -605,4 +607,6 @@ extern "C" int Android_JNI_FileClose(SDL_RWops* ctx)
|
|||
return Android_JNI_FileClose(ctx, true);
|
||||
}
|
||||
|
||||
#endif /* __ANDROID__ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifdef __WIN32__
|
||||
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_windows.h"
|
||||
|
||||
|
@ -59,4 +61,6 @@ WIN_CoUninitialize(void)
|
|||
CoUninitialize();
|
||||
}
|
||||
|
||||
#endif /* __WIN32__ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -103,7 +103,7 @@ int SDL_RecordGesture(SDL_TouchID touchId) {
|
|||
return (touchId < 0);
|
||||
}
|
||||
|
||||
unsigned long SDL_HashDollar(SDL_FloatPoint* points) {
|
||||
static unsigned long SDL_HashDollar(SDL_FloatPoint* points) {
|
||||
unsigned long hash = 5381;
|
||||
int i;
|
||||
for(i = 0;i < DOLLARNPOINTS; i++) {
|
||||
|
@ -242,7 +242,7 @@ int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src) {
|
|||
}
|
||||
|
||||
|
||||
float dollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ,float ang) {
|
||||
static float dollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ,float ang) {
|
||||
// SDL_FloatPoint p[DOLLARNPOINTS];
|
||||
float dist = 0;
|
||||
SDL_FloatPoint p;
|
||||
|
@ -257,7 +257,7 @@ float dollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ,float ang) {
|
|||
|
||||
}
|
||||
|
||||
float bestDollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ) {
|
||||
static float bestDollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ) {
|
||||
//------------BEGIN DOLLAR BLACKBOX----------------//
|
||||
//-TRANSLATED DIRECTLY FROM PSUDEO-CODE AVAILABLE AT-//
|
||||
//-"http://depts.washington.edu/aimgroup/proj/dollar/"-//
|
||||
|
@ -294,7 +294,7 @@ float bestDollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ) {
|
|||
}
|
||||
|
||||
//DollarPath contains raw points, plus (possibly) the calculated length
|
||||
int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points) {
|
||||
static int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points) {
|
||||
int i;
|
||||
float interval;
|
||||
float dist;
|
||||
|
@ -387,7 +387,7 @@ int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points) {
|
|||
return numPoints;
|
||||
}
|
||||
|
||||
float dollarRecognize(const SDL_DollarPath *path,int *bestTempl,SDL_GestureTouch* touch) {
|
||||
static float dollarRecognize(const SDL_DollarPath *path,int *bestTempl,SDL_GestureTouch* touch) {
|
||||
|
||||
SDL_FloatPoint points[DOLLARNPOINTS];
|
||||
int i;
|
||||
|
@ -431,20 +431,7 @@ int SDL_GestureAddTouch(SDL_Touch* touch) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int SDL_GestureRemoveTouch(SDL_TouchID id) {
|
||||
int i;
|
||||
for (i = 0; i < SDL_numGestureTouches; i++) {
|
||||
if (SDL_gestureTouch[i].id == id) {
|
||||
SDL_numGestureTouches--;
|
||||
SDL_memcpy(&SDL_gestureTouch[i], &SDL_gestureTouch[SDL_numGestureTouches], sizeof(SDL_gestureTouch[i]));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
SDL_GestureTouch * SDL_GetGestureTouch(SDL_TouchID id) {
|
||||
static SDL_GestureTouch * SDL_GetGestureTouch(SDL_TouchID id) {
|
||||
int i;
|
||||
for(i = 0;i < SDL_numGestureTouches; i++) {
|
||||
//printf("%i ?= %i\n",SDL_gestureTouch[i].id,id);
|
||||
|
@ -453,7 +440,7 @@ SDL_GestureTouch * SDL_GetGestureTouch(SDL_TouchID id) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDist) {
|
||||
static int SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDist) {
|
||||
SDL_Event event;
|
||||
event.mgesture.type = SDL_MULTIGESTURE;
|
||||
event.mgesture.touchId = touch->id;
|
||||
|
@ -465,7 +452,7 @@ int SDL_SendGestureMulti(SDL_GestureTouch* touch,float dTheta,float dDist) {
|
|||
return SDL_PushEvent(&event) > 0;
|
||||
}
|
||||
|
||||
int SDL_SendGestureDollar(SDL_GestureTouch* touch,
|
||||
static int SDL_SendGestureDollar(SDL_GestureTouch* touch,
|
||||
SDL_GestureID gestureId,float error) {
|
||||
SDL_Event event;
|
||||
event.dgesture.type = SDL_DOLLARGESTURE;
|
||||
|
@ -483,7 +470,7 @@ int SDL_SendGestureDollar(SDL_GestureTouch* touch,
|
|||
}
|
||||
|
||||
|
||||
int SDL_SendDollarRecord(SDL_GestureTouch* touch,SDL_GestureID gestureId) {
|
||||
static int SDL_SendDollarRecord(SDL_GestureTouch* touch,SDL_GestureID gestureId) {
|
||||
SDL_Event event;
|
||||
event.dgesture.type = SDL_DOLLARRECORD;
|
||||
event.dgesture.touchId = touch->id;
|
||||
|
|
|
@ -854,23 +854,6 @@ SDL_GetKeyFromScancode(SDL_Scancode scancode)
|
|||
return keyboard->keymap[scancode];
|
||||
}
|
||||
|
||||
SDL_Keycode SDL_GetKeycodeFromName(const char *name)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!name || !*name) {
|
||||
return SDL_SCANCODE_UNKNOWN;
|
||||
}
|
||||
|
||||
for (i = 0; i < SDL_arraysize(SDL_scancode_names); ++i) {
|
||||
if (SDL_strcasecmp(name, SDL_scancode_names[i]) == 0) {
|
||||
return (SDL_Scancode)i;
|
||||
}
|
||||
}
|
||||
return SDL_SCANCODE_UNKNOWN;
|
||||
}
|
||||
|
||||
|
||||
SDL_Scancode
|
||||
SDL_GetScancodeFromKey(SDL_Keycode key)
|
||||
{
|
||||
|
|
|
@ -59,7 +59,7 @@ SDL_GetTouchIndex(int index)
|
|||
return SDL_touchPads[index];
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
SDL_GetFingerIndexId(SDL_Touch* touch,SDL_FingerID fingerid)
|
||||
{
|
||||
int i;
|
||||
|
@ -190,6 +190,7 @@ SDL_GetNumTouch(void)
|
|||
{
|
||||
return SDL_num_touch;
|
||||
}
|
||||
|
||||
SDL_Window *
|
||||
SDL_GetTouchFocusWindow(SDL_TouchID id)
|
||||
{
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
* to produce the hexadecimal values shown.
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_libm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
static const double
|
||||
|
|
|
@ -66,7 +66,7 @@ static const char rcsid[] =
|
|||
* to produce the hexadecimal values shown.
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_libm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
#ifdef __STDC__
|
||||
|
|
|
@ -59,7 +59,7 @@ static char rcsid[] = "$NetBSD: e_pow.c,v 1.9 1995/05/12 04:57:32 jtc Exp $";
|
|||
* to produce the hexadecimal values shown.
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_libm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
libm_hidden_proto(scalbn)
|
||||
|
|
|
@ -21,7 +21,7 @@ static const char rcsid[] =
|
|||
* use __kernel_rem_pio2()
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_libm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
libm_hidden_proto(fabs)
|
||||
|
|
|
@ -85,7 +85,7 @@ static const char rcsid[] =
|
|||
*---------------
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_libm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
#ifdef __STDC__
|
||||
|
|
|
@ -50,7 +50,7 @@ static const char rcsid[] =
|
|||
* thus, reducing the rounding error in the subtraction.
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_libm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
#ifdef __STDC__
|
||||
|
|
|
@ -131,7 +131,7 @@ static const char rcsid[] =
|
|||
* to produce the hexadecimal values shown.
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_libm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
libm_hidden_proto(scalbn)
|
||||
|
|
|
@ -43,7 +43,7 @@ static const char rcsid[] =
|
|||
* sin(x) = x + (S1*x + (x *(r-y/2)+y))
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_libm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
#ifdef __STDC__
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#else
|
||||
#define atan SDL_atan
|
||||
#endif
|
||||
double atan(double x);
|
||||
|
||||
#ifndef HAVE_ATAN2
|
||||
#define __ieee754_atan2 SDL_atan2
|
||||
|
@ -38,24 +39,28 @@
|
|||
#else
|
||||
#define copysign SDL_copysign
|
||||
#endif
|
||||
double copysign(double x, double y);
|
||||
|
||||
#ifdef HAVE_COS
|
||||
#define cos SDL_uclibc_cos
|
||||
#else
|
||||
#define cos SDL_cos
|
||||
#endif
|
||||
double cos(double x);
|
||||
|
||||
#ifdef HAVE_FABS
|
||||
#define fabs SDL_uclibc_fabs
|
||||
#else
|
||||
#define fabs SDL_fabs
|
||||
#endif
|
||||
double fabs(double x);
|
||||
|
||||
#ifdef HAVE_FLOOR
|
||||
#define floor SDL_uclibc_floor
|
||||
#else
|
||||
#define floor SDL_floor
|
||||
#endif
|
||||
double floor(double x);
|
||||
|
||||
#ifndef HAVE_LOG
|
||||
#define __ieee754_log SDL_log
|
||||
|
@ -70,12 +75,14 @@
|
|||
#else
|
||||
#define scalbn SDL_scalbn
|
||||
#endif
|
||||
double scalbn(double x, int n);
|
||||
|
||||
#ifdef HAVE_SIN
|
||||
#define sin SDL_uclibc_sin
|
||||
#else
|
||||
#define sin SDL_sin
|
||||
#endif
|
||||
double sin(double x);
|
||||
|
||||
#ifndef HAVE_SQRT
|
||||
#define __ieee754_sqrt SDL_sqrt
|
|
@ -29,7 +29,7 @@
|
|||
* to produce the hexadecimal values shown.
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_libm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
static const double atanhi[] = {
|
||||
|
|
|
@ -21,7 +21,7 @@ static const char rcsid[] =
|
|||
* with the sign bit of y.
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_libm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
libm_hidden_proto(copysign)
|
||||
|
|
|
@ -46,7 +46,7 @@ static const char rcsid[] =
|
|||
* TRIG(x) returns trig(x) nearly rounded
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_libm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
libm_hidden_proto(cos)
|
||||
|
|
|
@ -19,7 +19,7 @@ static const char rcsid[] =
|
|||
* fabs(x) returns the absolute value of x.
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_libm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
libm_hidden_proto(fabs)
|
||||
|
|
|
@ -24,7 +24,7 @@ static const char rcsid[] =
|
|||
* Inexact flag raised if x not equal to floor(x).
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_libm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
#ifdef __STDC__
|
||||
|
|
|
@ -22,7 +22,7 @@ static const char rcsid[] =
|
|||
* exponentiation or a multiplication.
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_libm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
libm_hidden_proto(copysign)
|
||||
|
|
|
@ -46,7 +46,7 @@ static const char rcsid[] =
|
|||
* TRIG(x) returns trig(x) nearly rounded
|
||||
*/
|
||||
|
||||
#include "math.h"
|
||||
#include "math_libm.h"
|
||||
#include "math_private.h"
|
||||
|
||||
libm_hidden_proto(sin)
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifdef __ANDROID__
|
||||
|
||||
/* Include the SDL main definition header */
|
||||
#include "SDL_main.h"
|
||||
|
||||
|
@ -33,4 +37,6 @@ extern "C" void Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass c
|
|||
exit(status);
|
||||
}
|
||||
|
||||
#endif /* __ANDROID__ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifdef __BEOS__
|
||||
|
||||
/* Handle the BeApp specific portions of the application */
|
||||
|
||||
#include <AppKit.h>
|
||||
|
@ -116,8 +118,6 @@ SDL_QuitBeApp(void)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -131,3 +131,7 @@ void SDL_BApp::ClearID(SDL_BWin *bwin) {
|
|||
--i;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* __BEOS__ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -3,6 +3,9 @@
|
|||
|
||||
The WinMain function -- calls your program's main() function
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifdef __WIN32__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -202,4 +205,6 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPTSTR szCmdLine, int sw)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#endif /* __WIN32__ */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "SDL_config.h"
|
||||
|
||||
#ifndef SDL_POWER_DISABLED
|
||||
#ifdef SDL_POWER_BEOS
|
||||
#if SDL_POWER_BEOS
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "SDL_config.h"
|
||||
|
||||
#ifndef SDL_POWER_DISABLED
|
||||
#ifdef SDL_POWER_LINUX
|
||||
#if SDL_POWER_LINUX
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "SDL_config.h"
|
||||
|
||||
#ifndef SDL_POWER_DISABLED
|
||||
#ifdef SDL_POWER_MACOSX
|
||||
#if SDL_POWER_MACOSX
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <IOKit/ps/IOPowerSources.h>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "SDL_config.h"
|
||||
|
||||
#ifndef SDL_POWER_DISABLED
|
||||
#ifdef SDL_POWER_NINTENDODS
|
||||
#if SDL_POWER_NINTENDODS
|
||||
|
||||
#include "SDL_power.h"
|
||||
|
||||
|
|
|
@ -20,8 +20,13 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
#if SDL_POWER_UIKIT
|
||||
|
||||
typedef pid_t SYS_ThreadHandle;
|
||||
#include "SDL_power.h"
|
||||
|
||||
void SDL_UIKit_UpdateBatteryMonitoring(void);
|
||||
SDL_bool SDL_GetPowerInfo_UIKit(SDL_PowerState * state, int *seconds, int *percent);
|
||||
|
||||
#endif /* SDL_POWER_UIKIT */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -21,13 +21,14 @@
|
|||
#include "SDL_config.h"
|
||||
|
||||
#ifndef SDL_POWER_DISABLED
|
||||
#ifdef SDL_POWER_UIKIT
|
||||
#if SDL_POWER_UIKIT
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#include "SDL_power.h"
|
||||
#include "SDL_timer.h"
|
||||
#include "SDL_assert.h"
|
||||
#include "SDL_syspower.h"
|
||||
|
||||
// turn off the battery monitor if it's been more than X ms since last check.
|
||||
static const int BATTERY_MONITORING_TIMEOUT = 3000;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "SDL_config.h"
|
||||
|
||||
#ifndef SDL_POWER_DISABLED
|
||||
#ifdef SDL_POWER_WINDOWS
|
||||
#if SDL_POWER_WINDOWS
|
||||
|
||||
#include "../../core/windows/SDL_windows.h"
|
||||
|
||||
|
|
|
@ -745,7 +745,7 @@ SDL_UnlockTextureYUV(SDL_Texture * texture)
|
|||
SDL_UnlockTexture(native);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
SDL_UnlockTextureNative(SDL_Texture * texture)
|
||||
{
|
||||
SDL_Texture *native = texture->native;
|
||||
|
|
|
@ -581,7 +581,6 @@ static int
|
|||
GLES_RenderDrawPoints(SDL_Renderer * renderer, const SDL_Point * points,
|
||||
int count)
|
||||
{
|
||||
GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
|
||||
int i;
|
||||
GLshort *vertices;
|
||||
|
||||
|
@ -603,7 +602,6 @@ static int
|
|||
GLES_RenderDrawLines(SDL_Renderer * renderer, const SDL_Point * points,
|
||||
int count)
|
||||
{
|
||||
GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
|
||||
int i;
|
||||
GLshort *vertices;
|
||||
|
||||
|
@ -632,7 +630,6 @@ static int
|
|||
GLES_RenderFillRects(SDL_Renderer * renderer, const SDL_Rect * rects,
|
||||
int count)
|
||||
{
|
||||
GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
|
||||
int i;
|
||||
|
||||
GLES_SetDrawingState(renderer);
|
||||
|
|
|
@ -877,7 +877,6 @@ GLES2_SetDrawingState(SDL_Renderer * renderer)
|
|||
static int
|
||||
GLES2_RenderDrawPoints(SDL_Renderer *renderer, const SDL_Point *points, int count)
|
||||
{
|
||||
GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata;
|
||||
GLfloat *vertices;
|
||||
int idx;
|
||||
|
||||
|
@ -910,7 +909,6 @@ GLES2_RenderDrawPoints(SDL_Renderer *renderer, const SDL_Point *points, int coun
|
|||
static int
|
||||
GLES2_RenderDrawLines(SDL_Renderer *renderer, const SDL_Point *points, int count)
|
||||
{
|
||||
GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata;
|
||||
GLfloat *vertices;
|
||||
int idx;
|
||||
|
||||
|
@ -943,7 +941,6 @@ GLES2_RenderDrawLines(SDL_Renderer *renderer, const SDL_Point *points, int count
|
|||
static int
|
||||
GLES2_RenderFillRects(SDL_Renderer *renderer, const SDL_Rect *rects, int count)
|
||||
{
|
||||
GLES2_DriverContext *rdata = (GLES2_DriverContext *)renderer->driverdata;
|
||||
GLfloat vertices[8];
|
||||
int idx;
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#if !SDL_RENDER_DISABLED
|
||||
|
||||
#include "../SDL_sysrender.h"
|
||||
#include "SDL_render_sw_c.h"
|
||||
|
||||
#include "SDL_draw.h"
|
||||
#include "SDL_blendfillrect.h"
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#define UTF8_IsLeadByte(c) ((c) >= 0xC0 && (c) <= 0xF4)
|
||||
#define UTF8_IsTrailingByte(c) ((c) >= 0x80 && (c) <= 0xBF)
|
||||
|
||||
int UTF8_TrailingBytes(unsigned char c)
|
||||
static int UTF8_TrailingBytes(unsigned char c)
|
||||
{
|
||||
if (c >= 0xC0 && c <= 0xDF)
|
||||
return 1;
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
#include "SDL_thread.h"
|
||||
#include "SDL_thread_c.h"
|
||||
#include "SDL_systhread.h"
|
||||
#include "../SDL_error_c.h"
|
||||
|
||||
#define ARRAY_CHUNKSIZE 32
|
||||
/* The array of threads currently active in the application
|
||||
|
|
|
@ -32,8 +32,6 @@
|
|||
#include "epoc/SDL_systhread_c.h"
|
||||
#elif SDL_THREAD_PTHREAD
|
||||
#include "pthread/SDL_systhread_c.h"
|
||||
#elif SDL_THREAD_SPROC
|
||||
#include "irix/SDL_systhread_c.h"
|
||||
#elif SDL_THREAD_WINDOWS
|
||||
#include "windows/SDL_systhread_c.h"
|
||||
#elif SDL_THREAD_NDS
|
||||
|
@ -59,4 +57,5 @@ struct SDL_Thread
|
|||
extern void SDL_RunThread(void *data);
|
||||
|
||||
#endif /* _SDL_thread_c_h */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifdef SDL_THREAD_BEOS
|
||||
|
||||
/* Semaphores in the BeOS environment */
|
||||
|
||||
#include <be/kernel/OS.h>
|
||||
|
@ -148,4 +150,6 @@ SDL_SemPost(SDL_sem * sem)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#endif /* SDL_THREAD_BEOS */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifdef SDL_THREAD_BEOS
|
||||
|
||||
/* BeOS thread management routines for SDL */
|
||||
|
||||
#include <stdio.h>
|
||||
|
@ -120,4 +122,6 @@ SDL_SYS_WaitThread(SDL_Thread * thread)
|
|||
wait_for_thread(thread->handle, &the_status);
|
||||
}
|
||||
|
||||
#endif /* SDL_THREAD_BEOS */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -1,230 +0,0 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include "SDL_thread.h"
|
||||
#include "SDL_timer.h"
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/ipc.h>
|
||||
#include <sys/sem.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "SDL_error.h"
|
||||
#include "SDL_thread.h"
|
||||
|
||||
|
||||
struct SDL_semaphore
|
||||
{
|
||||
int id;
|
||||
};
|
||||
|
||||
/* Not defined by many operating systems, use configure to detect */
|
||||
/*
|
||||
#if !defined(HAVE_SEMUN)
|
||||
union semun {
|
||||
int val;
|
||||
struct semid_ds *buf;
|
||||
ushort *array;
|
||||
};
|
||||
#endif
|
||||
*/
|
||||
|
||||
static struct sembuf op_trywait[2] = {
|
||||
{0, -1, (IPC_NOWAIT | SEM_UNDO)} /* Decrement semaphore, no block */
|
||||
};
|
||||
|
||||
static struct sembuf op_wait[2] = {
|
||||
{0, -1, SEM_UNDO} /* Decrement semaphore */
|
||||
};
|
||||
|
||||
static struct sembuf op_post[1] = {
|
||||
{0, 1, (IPC_NOWAIT | SEM_UNDO)} /* Increment semaphore */
|
||||
};
|
||||
|
||||
/* Create a blockable semaphore */
|
||||
SDL_sem *
|
||||
SDL_CreateSemaphore(Uint32 initial_value)
|
||||
{
|
||||
extern int _creating_thread_lock; /* SDL_threads.c */
|
||||
SDL_sem *sem;
|
||||
union semun init;
|
||||
|
||||
sem = (SDL_sem *) SDL_malloc(sizeof(*sem));
|
||||
if (sem == NULL) {
|
||||
SDL_OutOfMemory();
|
||||
return (NULL);
|
||||
}
|
||||
sem->id = semget(IPC_PRIVATE, 1, (0600 | IPC_CREAT));
|
||||
if (sem->id < 0) {
|
||||
SDL_SetError("Couldn't create semaphore");
|
||||
SDL_free(sem);
|
||||
return (NULL);
|
||||
}
|
||||
init.val = initial_value; /* Initialize semaphore */
|
||||
semctl(sem->id, 0, SETVAL, init);
|
||||
return (sem);
|
||||
}
|
||||
|
||||
void
|
||||
SDL_DestroySemaphore(SDL_sem * sem)
|
||||
{
|
||||
if (sem) {
|
||||
#ifdef __IRIX__
|
||||
semctl(sem->id, 0, IPC_RMID);
|
||||
#else
|
||||
union semun dummy;
|
||||
dummy.val = 0;
|
||||
semctl(sem->id, 0, IPC_RMID, dummy);
|
||||
#endif
|
||||
SDL_free(sem);
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
SDL_SemTryWait(SDL_sem * sem)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (!sem) {
|
||||
SDL_SetError("Passed a NULL semaphore");
|
||||
return -1;
|
||||
}
|
||||
|
||||
retval = 0;
|
||||
tryagain:
|
||||
if (semop(sem->id, op_trywait, 1) < 0) {
|
||||
if (errno == EINTR) {
|
||||
goto tryagain;
|
||||
}
|
||||
retval = SDL_MUTEX_TIMEDOUT;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int
|
||||
SDL_SemWait(SDL_sem * sem)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (!sem) {
|
||||
SDL_SetError("Passed a NULL semaphore");
|
||||
return -1;
|
||||
}
|
||||
|
||||
retval = 0;
|
||||
tryagain:
|
||||
if (semop(sem->id, op_wait, 1) < 0) {
|
||||
if (errno == EINTR) {
|
||||
goto tryagain;
|
||||
}
|
||||
SDL_SetError("Semaphore operation error");
|
||||
retval = -1;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int
|
||||
SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (!sem) {
|
||||
SDL_SetError("Passed a NULL semaphore");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Try the easy cases first */
|
||||
if (timeout == 0) {
|
||||
return SDL_SemTryWait(sem);
|
||||
}
|
||||
if (timeout == SDL_MUTEX_MAXWAIT) {
|
||||
return SDL_SemWait(sem);
|
||||
}
|
||||
|
||||
/* Ack! We have to busy wait... */
|
||||
timeout += SDL_GetTicks();
|
||||
do {
|
||||
retval = SDL_SemTryWait(sem);
|
||||
if (retval == 0) {
|
||||
break;
|
||||
}
|
||||
SDL_Delay(1);
|
||||
} while (SDL_GetTicks() < timeout);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
Uint32
|
||||
SDL_SemValue(SDL_sem * sem)
|
||||
{
|
||||
int semval;
|
||||
Uint32 value;
|
||||
|
||||
value = 0;
|
||||
if (sem) {
|
||||
tryagain:
|
||||
#ifdef __IRIX__
|
||||
semval = semctl(sem->id, 0, GETVAL);
|
||||
#else
|
||||
{
|
||||
union semun arg;
|
||||
arg.val = 0;
|
||||
semval = semctl(sem->id, 0, GETVAL, arg);
|
||||
}
|
||||
#endif
|
||||
if (semval < 0) {
|
||||
if (errno == EINTR) {
|
||||
goto tryagain;
|
||||
}
|
||||
} else {
|
||||
value = (Uint32) semval;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
int
|
||||
SDL_SemPost(SDL_sem * sem)
|
||||
{
|
||||
int retval;
|
||||
|
||||
if (!sem) {
|
||||
SDL_SetError("Passed a NULL semaphore");
|
||||
return -1;
|
||||
}
|
||||
|
||||
retval = 0;
|
||||
tryagain:
|
||||
if (semop(sem->id, op_post, 1) < 0) {
|
||||
if (errno == EINTR) {
|
||||
goto tryagain;
|
||||
}
|
||||
SDL_SetError("Semaphore operation error");
|
||||
retval = -1;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -1,81 +0,0 @@
|
|||
/*
|
||||
Simple DirectMedia Layer
|
||||
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* IRIX thread management routines for SDL */
|
||||
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/prctl.h>
|
||||
|
||||
#include "SDL_thread.h"
|
||||
#include "../SDL_systhread.h"
|
||||
|
||||
|
||||
static int sig_list[] = {
|
||||
SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCLD, SIGWINCH,
|
||||
SIGVTALRM, SIGPROF, 0
|
||||
};
|
||||
|
||||
|
||||
int
|
||||
SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
|
||||
{
|
||||
/* Create the thread and go! */
|
||||
if (sproc(SDL_RunThread, PR_SALL, args) < 0) {
|
||||
SDL_SetError("Not enough resources to create thread");
|
||||
return (-1);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
SDL_SYS_SetupThread(const char *name)
|
||||
{
|
||||
int i;
|
||||
sigset_t mask;
|
||||
|
||||
/* Mask asynchronous signals for this thread */
|
||||
sigemptyset(&mask);
|
||||
for (i = 0; sig_list[i]; ++i) {
|
||||
sigaddset(&mask, sig_list[i]);
|
||||
}
|
||||
sigprocmask(SIG_BLOCK, &mask, NULL);
|
||||
}
|
||||
|
||||
SDL_threadID
|
||||
SDL_ThreadID(void)
|
||||
{
|
||||
return ((SDL_threadID) getpid());
|
||||
}
|
||||
|
||||
void
|
||||
SDL_WaitThread(SDL_Thread * thread, int *status)
|
||||
{
|
||||
errno = 0;
|
||||
while (errno != ECHILD) {
|
||||
waitpid(thread->handle, NULL, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
|
@ -61,10 +61,4 @@ SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority)
|
|||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
SDL_SYS_KillThread(SDL_Thread * thread)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_THREAD_WINDOWS
|
||||
|
||||
/* Mutex functions using the Win32 API */
|
||||
|
||||
#include "../../core/windows/SDL_windows.h"
|
||||
|
@ -90,4 +92,6 @@ SDL_mutexV(SDL_mutex * mutex)
|
|||
return (0);
|
||||
}
|
||||
|
||||
#endif /* SDL_THREAD_WINDOWS */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_THREAD_WINDOWS
|
||||
|
||||
/* Semaphore functions using the Win32 API */
|
||||
|
||||
#include "../../core/windows/SDL_windows.h"
|
||||
|
@ -169,4 +171,6 @@ SDL_SemPost(SDL_sem * sem)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#endif /* SDL_THREAD_WINDOWS */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_THREAD_WINDOWS
|
||||
|
||||
/* Win32 thread management routines for SDL */
|
||||
|
||||
#include "SDL_thread.h"
|
||||
|
@ -216,4 +218,6 @@ SDL_SYS_WaitThread(SDL_Thread * thread)
|
|||
CloseHandle(thread->handle);
|
||||
}
|
||||
|
||||
#endif /* SDL_THREAD_WINDOWS */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -26,7 +26,11 @@
|
|||
6. The wait function emulates WaitForSingleObject only. An emulation of
|
||||
WaitForMultipleObjects is much harder to implement outside the kernel,
|
||||
and it is not clear how to handle a mixture of WCE semaphores and normal
|
||||
events and mutexes. */
|
||||
events and mutexes.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_THREAD_WINDOWS
|
||||
|
||||
#include "../../core/windows/SDL_windows.h"
|
||||
|
||||
|
@ -224,4 +228,6 @@ CleanUp(SYNCHHANDLE hSynch, DWORD Flags)
|
|||
return hSynch;
|
||||
}
|
||||
|
||||
#endif /* SDL_THREAD_WINDOWS */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "SDL_config.h"
|
||||
|
||||
#include "SDL_rect.h"
|
||||
#include "SDL_rect_c.h"
|
||||
|
||||
|
||||
SDL_bool
|
||||
|
|
|
@ -115,7 +115,7 @@ SDL_CalculateShapeBitmap(SDL_WindowShapeMode mode,SDL_Surface *shape,Uint8* bitm
|
|||
SDL_UnlockSurface(shape);
|
||||
}
|
||||
|
||||
SDL_ShapeTree*
|
||||
static SDL_ShapeTree*
|
||||
RecursivelyCalculateShapeTree(SDL_WindowShapeMode mode,SDL_Surface* mask,SDL_Rect dimensions) {
|
||||
int x = 0,y = 0;
|
||||
Uint8* pixel = NULL;
|
||||
|
@ -249,7 +249,7 @@ SDL_SetWindowShape(SDL_Window *window,SDL_Surface *shape,SDL_WindowShapeMode *sh
|
|||
return result;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
static SDL_bool
|
||||
SDL_WindowHasAShape(SDL_Window *window) {
|
||||
if (window == NULL || !SDL_IsShapedWindow(window))
|
||||
return SDL_FALSE;
|
||||
|
|
|
@ -576,7 +576,7 @@ SDL_GetNumVideoDisplays(void)
|
|||
return _this->num_displays;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
SDL_GetIndexOfDisplay(SDL_VideoDisplay *display)
|
||||
{
|
||||
int displayIndex;
|
||||
|
@ -655,12 +655,6 @@ SDL_AddDisplayMode(SDL_VideoDisplay * display, const SDL_DisplayMode * mode)
|
|||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
SDL_VideoDisplay *
|
||||
SDL_GetFirstDisplay(void)
|
||||
{
|
||||
return &_this->displays[0];
|
||||
}
|
||||
|
||||
static int
|
||||
SDL_GetNumDisplayModesForDisplay(SDL_VideoDisplay * display)
|
||||
{
|
||||
|
@ -847,7 +841,7 @@ SDL_GetClosestDisplayMode(int displayIndex,
|
|||
return SDL_GetClosestDisplayModeForDisplay(display, mode, closest);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode)
|
||||
{
|
||||
SDL_DisplayMode display_mode;
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_ANDROID
|
||||
|
||||
#include "SDL_androidevents.h"
|
||||
|
||||
void
|
||||
|
@ -28,4 +30,6 @@ Android_PumpEvents(_THIS)
|
|||
/* No polling necessary */
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_ANDROID */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_ANDROID
|
||||
|
||||
/* Android SDL video driver implementation */
|
||||
|
||||
#include "SDL_video.h"
|
||||
|
@ -112,4 +114,6 @@ Android_GL_DeleteContext(_THIS, SDL_GLContext context)
|
|||
__android_log_print(ANDROID_LOG_INFO, "SDL", "[STUB] GL_DeleteContext\n");
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_ANDROID */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_ANDROID
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
#include "../../events/SDL_events_c.h"
|
||||
|
@ -176,4 +178,6 @@ Android_OnKeyUp(int keycode)
|
|||
return SDL_SendKeyboardKey(SDL_RELEASED, TranslateKeycode(keycode));
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_ANDROID */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_ANDROID
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
#include "SDL_events.h"
|
||||
|
@ -85,4 +87,6 @@ void Android_OnTouch(int touch_device_id_in, int pointer_finger_id_in, int actio
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_ANDROID */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_ANDROID
|
||||
|
||||
/* Android SDL video driver implementation
|
||||
*/
|
||||
|
||||
|
@ -166,4 +168,6 @@ Android_SetScreenResolution(int width, int height, Uint32 format)
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_ANDROID */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_ANDROID
|
||||
|
||||
#include "../SDL_sysvideo.h"
|
||||
|
||||
#include "SDL_androidvideo.h"
|
||||
|
@ -62,4 +64,6 @@ Android_DestroyWindow(_THIS, SDL_Window * window)
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_ANDROID */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -18,10 +18,11 @@
|
|||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_BWINDOW
|
||||
|
||||
/* BWindow based framebuffer implementation */
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <TypeConstants.h>
|
||||
|
@ -91,3 +92,4 @@ SDL_bool BE_HasClipboardText(_THIS) {
|
|||
} /* Extern C */
|
||||
#endif
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_BWINDOW */
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_BWINDOW
|
||||
|
||||
#include "SDL_bevents.h"
|
||||
|
||||
|
@ -32,3 +35,5 @@ void BE_PumpEvents(_THIS) {
|
|||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_BWINDOW */
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_BWINDOW
|
||||
|
||||
#include "SDL_bframebuffer.h"
|
||||
|
||||
|
@ -248,3 +251,5 @@ int32 BE_UpdateOnce(SDL_Window *window) {
|
|||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_BWINDOW */
|
||||
|
|
|
@ -19,6 +19,9 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_BWINDOW
|
||||
|
||||
#include <SupportDefs.h>
|
||||
#include <support/UTF8.h>
|
||||
|
@ -182,3 +185,5 @@ void BE_SetKeyState(int32 bkey, int8 state) {
|
|||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_BWINDOW */
|
||||
|
|
|
@ -18,8 +18,9 @@
|
|||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
|
||||
#if SDL_VIDEO_DRIVER_BWINDOW
|
||||
|
||||
#include <AppKit.h>
|
||||
#include <InterfaceKit.h>
|
||||
|
@ -327,3 +328,5 @@ int BE_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode){
|
|||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_BWINDOW */
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_BWINDOW
|
||||
|
||||
#include "SDL_bopengl.h"
|
||||
|
||||
|
@ -209,11 +212,8 @@ void BE_GL_RebootContexts(_THIS) {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_BWINDOW */
|
||||
|
|
|
@ -18,8 +18,9 @@
|
|||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
|
||||
#if SDL_VIDEO_DRIVER_BWINDOW
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -168,3 +169,5 @@ void BE_VideoQuit(_THIS)
|
|||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_BWINDOW */
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_BWINDOW
|
||||
#include "../SDL_sysvideo.h"
|
||||
|
||||
#include "SDL_BWin.h"
|
||||
|
@ -210,3 +212,4 @@ SDL_bool BE_GetWindowWMInfo(_THIS, SDL_Window * window,
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_BWINDOW */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
|
||||
#include "SDL_cocoavideo.h"
|
||||
#include "../../events/SDL_clipboardevents_c.h"
|
||||
|
||||
|
@ -124,4 +126,6 @@ Cocoa_CheckClipboardUpdate(struct SDL_VideoData * data)
|
|||
[pool release];
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_COCOA */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
#include "SDL_timer.h"
|
||||
|
||||
#include "SDL_cocoavideo.h"
|
||||
|
@ -220,4 +222,6 @@ Cocoa_PumpEvents(_THIS)
|
|||
[pool release];
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_COCOA */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
|
||||
#include "SDL_cocoavideo.h"
|
||||
|
||||
#include "../../events/SDL_keyboard_c.h"
|
||||
|
@ -28,7 +30,7 @@
|
|||
#include <Carbon/Carbon.h>
|
||||
|
||||
//#define DEBUG_IME NSLog
|
||||
#define DEBUG_IME (void)
|
||||
#define DEBUG_IME(...)
|
||||
|
||||
#ifndef NX_DEVICERCTLKEYMASK
|
||||
#define NX_DEVICELCTLKEYMASK 0x00000001
|
||||
|
@ -733,4 +735,6 @@ Cocoa_QuitKeyboard(_THIS)
|
|||
{
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_COCOA */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
|
||||
#include "SDL_cocoavideo.h"
|
||||
|
||||
/* !!! FIXME: clean out the pre-10.6 code when it makes sense to do so. */
|
||||
|
@ -113,7 +115,6 @@ static SDL_bool
|
|||
GetDisplayMode(_THIS, const void *moderef, SDL_DisplayMode *mode)
|
||||
{
|
||||
SDL_DisplayModeData *data;
|
||||
CFNumberRef number;
|
||||
long width, height, bpp, refreshRate;
|
||||
|
||||
data = (SDL_DisplayModeData *) SDL_malloc(sizeof(*data));
|
||||
|
@ -146,6 +147,7 @@ GetDisplayMode(_THIS, const void *moderef, SDL_DisplayMode *mode)
|
|||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
||||
if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||
CFNumberRef number;
|
||||
CFDictionaryRef vidmode = (CFDictionaryRef) moderef;
|
||||
number = CFDictionaryGetValue(vidmode, kCGDisplayWidth);
|
||||
CFNumberGetValue(number, kCFNumberLongType, &width);
|
||||
|
@ -448,4 +450,6 @@ Cocoa_QuitModes(_THIS)
|
|||
ShowMenuBar();
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_COCOA */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
|
||||
#include "SDL_events.h"
|
||||
#include "SDL_cocoavideo.h"
|
||||
|
||||
|
@ -147,21 +149,6 @@ Cocoa_InitMouse(_THIS)
|
|||
SDL_SetDefaultCursor(Cocoa_CreateDefaultCursor());
|
||||
}
|
||||
|
||||
static int
|
||||
ConvertMouseButtonToSDL(int button)
|
||||
{
|
||||
switch (button)
|
||||
{
|
||||
case 0:
|
||||
return(SDL_BUTTON_LEFT); /* 1 */
|
||||
case 1:
|
||||
return(SDL_BUTTON_RIGHT); /* 3 */
|
||||
case 2:
|
||||
return(SDL_BUTTON_MIDDLE); /* 2 */
|
||||
}
|
||||
return button+1;
|
||||
}
|
||||
|
||||
void
|
||||
Cocoa_HandleMouseEvent(_THIS, NSEvent *event)
|
||||
{
|
||||
|
@ -202,4 +189,6 @@ Cocoa_QuitMouse(_THIS)
|
|||
{
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_COCOA */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,11 +20,11 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include "SDL_cocoavideo.h"
|
||||
|
||||
/* NSOpenGL implementation of SDL OpenGL support */
|
||||
|
||||
#if SDL_VIDEO_OPENGL_CGL
|
||||
#include "SDL_cocoavideo.h"
|
||||
|
||||
#include <OpenGL/CGLTypes.h>
|
||||
#include <OpenGL/OpenGL.h>
|
||||
#include <OpenGL/CGLRenderers.h>
|
||||
|
|
|
@ -19,6 +19,10 @@
|
|||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
|
||||
#include "SDL_cocoavideo.h"
|
||||
#include "SDL_shape.h"
|
||||
#include "SDL_cocoashape.h"
|
||||
|
@ -89,6 +93,8 @@ Cocoa_SetWindowShape(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShape
|
|||
closure.window = shaper->window;
|
||||
SDL_TraverseShapeTree(data->shape,&ConvertRects,&closure);
|
||||
[closure.path addClip];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -97,3 +103,7 @@ Cocoa_ResizeWindowShape(SDL_Window *window) {
|
|||
assert(data != NULL);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_COCOA */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
|
||||
#include "SDL.h"
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_cocoavideo.h"
|
||||
|
@ -259,4 +261,6 @@ SDL_PromptAssertion_cocoa(const SDL_assert_data *data)
|
|||
return (SDL_assert_state) (clicked - NSAlertFirstButtonReturn);
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_COCOA */
|
||||
|
||||
/* vim: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
|
||||
#include "SDL_syswm.h"
|
||||
#include "SDL_timer.h" /* For SDL_GetTicks() */
|
||||
#include "../SDL_sysvideo.h"
|
||||
|
@ -277,8 +279,6 @@ static __inline__ void ConvertNSRect(NSRect *r)
|
|||
|
||||
- (void)mouseEntered:(NSEvent *)theEvent
|
||||
{
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
SDL_SetMouseFocus(_data->window);
|
||||
|
||||
SDL_SetCursor(NULL);
|
||||
|
@ -991,4 +991,6 @@ Cocoa_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_COCOA */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_DIRECTFB
|
||||
|
||||
#include "SDL_DirectFB_video.h"
|
||||
#include "SDL_DirectFB_window.h"
|
||||
|
@ -407,3 +410,4 @@ DirectFB_WM_ProcessEvent(_THIS, SDL_Window * window, DFBWindowEvent * evt)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
|
||||
|
|
|
@ -18,9 +18,10 @@
|
|||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_DIRECTFB
|
||||
|
||||
#include "SDL_DirectFB_video.h"
|
||||
#include "SDL_DirectFB_dyn.h"
|
||||
|
||||
|
@ -112,3 +113,5 @@ SDL_DirectFB_UnLoadLibrary(void)
|
|||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_DIRECTFB
|
||||
|
||||
/* Handle the event stream, converting DirectFB input events into SDL events */
|
||||
|
||||
|
@ -743,3 +746,4 @@ DirectFB_QuitKeyboard(_THIS)
|
|||
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
|
||||
|
|
|
@ -18,6 +18,9 @@
|
|||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_VIDEO_DRIVER_DIRECTFB
|
||||
|
||||
#include "SDL_DirectFB_video.h"
|
||||
#include "SDL_DirectFB_modes.h"
|
||||
|
@ -406,4 +409,6 @@ DirectFB_QuitModes(_THIS)
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* SDL_VIDEO_DRIVER_DIRECTFB */
|
||||
|
||||
/* vi: set ts=4 sw=4 expandtab: */
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue