mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-24 08:15:37 +08:00
OCD fixes: Adds a space after /* (glory to regular expressions!)
This commit is contained in:
@@ -196,7 +196,7 @@ explodeEmitter(struct particle *emitter)
|
||||
float speed = randomFloat(0.00, powf(0.17, exponent));
|
||||
speed = powf(speed, 1.0f / exponent);
|
||||
|
||||
/*select the particle at the end of our array */
|
||||
/* select the particle at the end of our array */
|
||||
struct particle *p = &particles[num_active_particles];
|
||||
|
||||
/* set the particles properties */
|
||||
|
||||
@@ -80,7 +80,7 @@ fontMapping map[TABLE_SIZE] = {
|
||||
{SDL_SCANCODE_7, 1, 0, 23}, /* 7 */
|
||||
{SDL_SCANCODE_8, 1, 0, 24}, /* 8 */
|
||||
{SDL_SCANCODE_9, 1, 0, 25}, /* 9 */
|
||||
{SDL_SCANCODE_SPACE, 1, 0, 0}, /*' ' */
|
||||
{SDL_SCANCODE_SPACE, 1, 0, 0}, /* ' ' */
|
||||
{SDL_SCANCODE_1, 0, KMOD_SHIFT, 1}, /* ! */
|
||||
{SDL_SCANCODE_SLASH, 0, KMOD_SHIFT, 31}, /* ? */
|
||||
{SDL_SCANCODE_SLASH, 1, 0, 15}, /* / */
|
||||
|
||||
@@ -92,7 +92,7 @@ main(int argc, char *argv[])
|
||||
SDL_WINDOW_BORDERLESS);
|
||||
renderer = SDL_CreateRenderer(window, 0, 0);
|
||||
|
||||
/*load brush texture */
|
||||
/* load brush texture */
|
||||
initializeTexture(renderer);
|
||||
|
||||
/* fill canvass initially with all black */
|
||||
|
||||
+2
-2
@@ -106,7 +106,7 @@ extern "C" {
|
||||
* These are the flags which may be passed to SDL_Init(). You should
|
||||
* specify the subsystems which you will be using in your application.
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
#define SDL_INIT_TIMER 0x00000001
|
||||
#define SDL_INIT_AUDIO 0x00000010
|
||||
#define SDL_INIT_VIDEO 0x00000020 /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */
|
||||
@@ -119,7 +119,7 @@ extern "C" {
|
||||
SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \
|
||||
SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER \
|
||||
)
|
||||
/*@} */
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
* This function initializes the subsystems specified by \c flags
|
||||
|
||||
@@ -91,7 +91,7 @@ extern "C" {
|
||||
* The spin lock functions and type are required and can not be
|
||||
* emulated because they are used in the atomic emulation code.
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
|
||||
typedef int SDL_SpinLock;
|
||||
|
||||
@@ -118,7 +118,7 @@ extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
|
||||
|
||||
/*@} *//*SDL AtomicLock */
|
||||
/* @} *//* SDL AtomicLock */
|
||||
|
||||
|
||||
/**
|
||||
|
||||
+22
-22
@@ -66,7 +66,7 @@ typedef Uint16 SDL_AudioFormat;
|
||||
/**
|
||||
* \name Audio flags
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
|
||||
#define SDL_AUDIO_MASK_BITSIZE (0xFF)
|
||||
#define SDL_AUDIO_MASK_DATATYPE (1<<8)
|
||||
@@ -85,7 +85,7 @@ typedef Uint16 SDL_AudioFormat;
|
||||
*
|
||||
* Defaults to LSB byte order.
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
#define AUDIO_U8 0x0008 /**< Unsigned 8-bit samples */
|
||||
#define AUDIO_S8 0x8008 /**< Signed 8-bit samples */
|
||||
#define AUDIO_U16LSB 0x0010 /**< Unsigned 16-bit samples */
|
||||
@@ -94,30 +94,30 @@ typedef Uint16 SDL_AudioFormat;
|
||||
#define AUDIO_S16MSB 0x9010 /**< As above, but big-endian byte order */
|
||||
#define AUDIO_U16 AUDIO_U16LSB
|
||||
#define AUDIO_S16 AUDIO_S16LSB
|
||||
/*@} */
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
* \name int32 support
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
#define AUDIO_S32LSB 0x8020 /**< 32-bit integer samples */
|
||||
#define AUDIO_S32MSB 0x9020 /**< As above, but big-endian byte order */
|
||||
#define AUDIO_S32 AUDIO_S32LSB
|
||||
/*@} */
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
* \name float32 support
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
#define AUDIO_F32LSB 0x8120 /**< 32-bit floating point samples */
|
||||
#define AUDIO_F32MSB 0x9120 /**< As above, but big-endian byte order */
|
||||
#define AUDIO_F32 AUDIO_F32LSB
|
||||
/*@} */
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
* \name Native audio byte ordering
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
||||
#define AUDIO_U16SYS AUDIO_U16LSB
|
||||
#define AUDIO_S16SYS AUDIO_S16LSB
|
||||
@@ -129,21 +129,21 @@ typedef Uint16 SDL_AudioFormat;
|
||||
#define AUDIO_S32SYS AUDIO_S32MSB
|
||||
#define AUDIO_F32SYS AUDIO_F32MSB
|
||||
#endif
|
||||
/*@} */
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
* \name Allow change flags
|
||||
*
|
||||
* Which audio format changes are allowed when opening a device.
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
#define SDL_AUDIO_ALLOW_FREQUENCY_CHANGE 0x00000001
|
||||
#define SDL_AUDIO_ALLOW_FORMAT_CHANGE 0x00000002
|
||||
#define SDL_AUDIO_ALLOW_CHANNELS_CHANGE 0x00000004
|
||||
#define SDL_AUDIO_ALLOW_ANY_CHANGE (SDL_AUDIO_ALLOW_FREQUENCY_CHANGE|SDL_AUDIO_ALLOW_FORMAT_CHANGE|SDL_AUDIO_ALLOW_CHANNELS_CHANGE)
|
||||
/*@} */
|
||||
/* @} */
|
||||
|
||||
/*@} *//*Audio flags */
|
||||
/* @} *//* Audio flags */
|
||||
|
||||
/**
|
||||
* This function is called when the audio device needs more data.
|
||||
@@ -218,10 +218,10 @@ typedef struct SDL_AudioCVT
|
||||
* These functions return the list of built in audio drivers, in the
|
||||
* order that they are normally initialized by default.
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
extern DECLSPEC int SDLCALL SDL_GetNumAudioDrivers(void);
|
||||
extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index);
|
||||
/*@} */
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
* \name Initialization and cleanup
|
||||
@@ -230,10 +230,10 @@ extern DECLSPEC const char *SDLCALL SDL_GetAudioDriver(int index);
|
||||
* you have a specific need to specify the audio driver you want to
|
||||
* use. You should normally use SDL_Init() or SDL_InitSubSystem().
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
extern DECLSPEC int SDLCALL SDL_AudioInit(const char *driver_name);
|
||||
extern DECLSPEC void SDLCALL SDL_AudioQuit(void);
|
||||
/*@} */
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
* This function returns the name of the current audio driver, or NULL
|
||||
@@ -359,7 +359,7 @@ extern DECLSPEC SDL_AudioDeviceID SDLCALL SDL_OpenAudioDevice(const char
|
||||
*
|
||||
* Get the current audio state.
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
typedef enum
|
||||
{
|
||||
SDL_AUDIO_STOPPED = 0,
|
||||
@@ -370,7 +370,7 @@ extern DECLSPEC SDL_AudioStatus SDLCALL SDL_GetAudioStatus(void);
|
||||
|
||||
extern DECLSPEC SDL_AudioStatus SDLCALL
|
||||
SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev);
|
||||
/*@} *//*Audio State */
|
||||
/* @} *//* Audio State */
|
||||
|
||||
/**
|
||||
* \name Pause audio functions
|
||||
@@ -381,11 +381,11 @@ SDL_GetAudioDeviceStatus(SDL_AudioDeviceID dev);
|
||||
* data for your callback function after opening the audio device.
|
||||
* Silence will be written to the audio device during the pause.
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
extern DECLSPEC void SDLCALL SDL_PauseAudio(int pause_on);
|
||||
extern DECLSPEC void SDLCALL SDL_PauseAudioDevice(SDL_AudioDeviceID dev,
|
||||
int pause_on);
|
||||
/*@} *//*Pause audio functions */
|
||||
/* @} *//* Pause audio functions */
|
||||
|
||||
/**
|
||||
* This function loads a WAVE from the data source, automatically freeing
|
||||
@@ -482,12 +482,12 @@ extern DECLSPEC void SDLCALL SDL_MixAudioFormat(Uint8 * dst,
|
||||
* the callback function is not running. Do not call these from the callback
|
||||
* function or you will cause deadlock.
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
extern DECLSPEC void SDLCALL SDL_LockAudio(void);
|
||||
extern DECLSPEC void SDLCALL SDL_LockAudioDevice(SDL_AudioDeviceID dev);
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockAudio(void);
|
||||
extern DECLSPEC void SDLCALL SDL_UnlockAudioDevice(SDL_AudioDeviceID dev);
|
||||
/*@} *//*Audio lock functions */
|
||||
/* @} *//* Audio lock functions */
|
||||
|
||||
/**
|
||||
* This function shuts down audio processing and closes the audio device.
|
||||
|
||||
@@ -99,8 +99,8 @@
|
||||
#define HAVE_SQRT 1
|
||||
#define HAVE_SETJMP 1
|
||||
#define HAVE_NANOSLEEP 1
|
||||
/*#define HAVE_SYSCONF 1 */
|
||||
/*#define HAVE_SIGACTION 1 */
|
||||
/* #define HAVE_SYSCONF 1 */
|
||||
/* #define HAVE_SIGACTION 1 */
|
||||
|
||||
|
||||
/* PSP isn't that sophisticated */
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
/**
|
||||
* \name The two types of endianness
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
#define SDL_LIL_ENDIAN 1234
|
||||
#define SDL_BIG_ENDIAN 4321
|
||||
/*@} */
|
||||
/* @} */
|
||||
|
||||
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
|
||||
#ifdef __linux__
|
||||
@@ -206,7 +206,7 @@ SDL_SwapFloat(float x)
|
||||
* \name Swap to native
|
||||
* Byteswap item from the specified endianness to the native endianness.
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
|
||||
#define SDL_SwapLE16(X) (X)
|
||||
#define SDL_SwapLE32(X) (X)
|
||||
@@ -226,7 +226,7 @@ SDL_SwapFloat(float x)
|
||||
#define SDL_SwapBE64(X) (X)
|
||||
#define SDL_SwapFloatBE(X) (X)
|
||||
#endif
|
||||
/*@} *//*Swap to native */
|
||||
/* @} *//* Swap to native */
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
||||
+2
-2
@@ -48,7 +48,7 @@ extern DECLSPEC void SDLCALL SDL_ClearError(void);
|
||||
* \internal
|
||||
* Private error reporting function - used internally.
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
#define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM)
|
||||
#define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED)
|
||||
#define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param))
|
||||
@@ -63,7 +63,7 @@ typedef enum
|
||||
} SDL_errorcode;
|
||||
/* SDL_Error() unconditionally returns -1. */
|
||||
extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code);
|
||||
/*@} *//*Internal error functions */
|
||||
/* @} *//* Internal error functions */
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -541,7 +541,7 @@ typedef union SDL_Event
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_PumpEvents(void);
|
||||
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
typedef enum
|
||||
{
|
||||
SDL_ADDEVENT,
|
||||
@@ -570,7 +570,7 @@ typedef enum
|
||||
extern DECLSPEC int SDLCALL SDL_PeepEvents(SDL_Event * events, int numevents,
|
||||
SDL_eventaction action,
|
||||
Uint32 minType, Uint32 maxType);
|
||||
/*@} */
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
* Checks to see if certain event types are in the event queue.
|
||||
@@ -681,7 +681,7 @@ extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
|
||||
extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
|
||||
void *userdata);
|
||||
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
#define SDL_QUERY -1
|
||||
#define SDL_IGNORE 0
|
||||
#define SDL_DISABLE 0
|
||||
@@ -697,7 +697,7 @@ extern DECLSPEC void SDLCALL SDL_FilterEvents(SDL_EventFilter filter,
|
||||
* current processing state of the specified event.
|
||||
*/
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_EventState(Uint32 type, int state);
|
||||
/*@} */
|
||||
/* @} */
|
||||
#define SDL_GetEventState(type) SDL_EventState(type, SDL_QUERY)
|
||||
|
||||
/**
|
||||
|
||||
@@ -140,12 +140,12 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||
*
|
||||
* Different haptic features a device can have.
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
|
||||
/**
|
||||
* \name Haptic effects
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
|
||||
/**
|
||||
* \brief Constant effect supported.
|
||||
@@ -177,7 +177,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||
#define SDL_HAPTIC_LEFTRIGHT (1<<2)
|
||||
|
||||
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
||||
/*#define SDL_HAPTIC_SQUARE (1<<2) */
|
||||
/* #define SDL_HAPTIC_SQUARE (1<<2) */
|
||||
|
||||
/**
|
||||
* \brief Triangle wave effect supported.
|
||||
@@ -262,7 +262,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||
*/
|
||||
#define SDL_HAPTIC_CUSTOM (1<<11)
|
||||
|
||||
/*@} *//*Haptic effects */
|
||||
/* @} *//* Haptic effects */
|
||||
|
||||
/* These last few are features the device has, not effects */
|
||||
|
||||
@@ -305,7 +305,7 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||
/**
|
||||
* \name Direction encodings
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
|
||||
/**
|
||||
* \brief Uses polar coordinates for the direction.
|
||||
@@ -328,9 +328,9 @@ typedef struct _SDL_Haptic SDL_Haptic;
|
||||
*/
|
||||
#define SDL_HAPTIC_SPHERICAL 2
|
||||
|
||||
/*@} *//*Direction encodings */
|
||||
/* @} *//* Direction encodings */
|
||||
|
||||
/*@} *//*Haptic features */
|
||||
/* @} *//* Haptic features */
|
||||
|
||||
/*
|
||||
* Misc defines.
|
||||
|
||||
@@ -187,7 +187,7 @@ extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick,
|
||||
/**
|
||||
* \name Hat positions
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
#define SDL_HAT_CENTERED 0x00
|
||||
#define SDL_HAT_UP 0x01
|
||||
#define SDL_HAT_RIGHT 0x02
|
||||
@@ -197,7 +197,7 @@ extern DECLSPEC Sint16 SDLCALL SDL_JoystickGetAxis(SDL_Joystick * joystick,
|
||||
#define SDL_HAT_RIGHTDOWN (SDL_HAT_RIGHT|SDL_HAT_DOWN)
|
||||
#define SDL_HAT_LEFTUP (SDL_HAT_LEFT|SDL_HAT_UP)
|
||||
#define SDL_HAT_LEFTDOWN (SDL_HAT_LEFT|SDL_HAT_DOWN)
|
||||
/*@} */
|
||||
/* @} */
|
||||
|
||||
/**
|
||||
* Get the current state of a POV hat on a joystick.
|
||||
|
||||
+6
-6
@@ -52,7 +52,7 @@ extern "C" {
|
||||
/**
|
||||
* \name Mutex functions
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
|
||||
/* The SDL mutex structure, defined in SDL_sysmutex.c */
|
||||
struct SDL_mutex;
|
||||
@@ -94,13 +94,13 @@ extern DECLSPEC int SDLCALL SDL_UnlockMutex(SDL_mutex * mutex);
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_DestroyMutex(SDL_mutex * mutex);
|
||||
|
||||
/*@} *//*Mutex functions */
|
||||
/* @} *//* Mutex functions */
|
||||
|
||||
|
||||
/**
|
||||
* \name Semaphore functions
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
|
||||
/* The SDL semaphore structure, defined in SDL_syssem.c */
|
||||
struct SDL_semaphore;
|
||||
@@ -154,13 +154,13 @@ extern DECLSPEC int SDLCALL SDL_SemPost(SDL_sem * sem);
|
||||
*/
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_SemValue(SDL_sem * sem);
|
||||
|
||||
/*@} *//*Semaphore functions */
|
||||
/* @} *//* Semaphore functions */
|
||||
|
||||
|
||||
/**
|
||||
* \name Condition variable functions
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
|
||||
/* The SDL condition variable structure, defined in SDL_syscond.c */
|
||||
struct SDL_cond;
|
||||
@@ -237,7 +237,7 @@ extern DECLSPEC int SDLCALL SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex);
|
||||
extern DECLSPEC int SDLCALL SDL_CondWaitTimeout(SDL_cond * cond,
|
||||
SDL_mutex * mutex, Uint32 ms);
|
||||
|
||||
/*@} *//*Condition variable functions */
|
||||
/* @} *//* Condition variable functions */
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
||||
@@ -39,10 +39,10 @@ extern "C" {
|
||||
*
|
||||
* These define alpha as the opacity of a surface.
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
#define SDL_ALPHA_OPAQUE 255
|
||||
#define SDL_ALPHA_TRANSPARENT 0
|
||||
/*@} */
|
||||
/* @} */
|
||||
|
||||
/** Pixel type. */
|
||||
enum
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
#endif
|
||||
#if defined(ANDROID)
|
||||
#undef __ANDROID__
|
||||
#undef __LINUX__ /*do we need to do this? */
|
||||
#undef __LINUX__ /* do we need to do this? */
|
||||
#define __ANDROID__ 1
|
||||
#endif
|
||||
|
||||
|
||||
+8
-8
@@ -148,7 +148,7 @@ typedef struct SDL_RWops
|
||||
*
|
||||
* Functions to create SDL_RWops structures from various data streams.
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
|
||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromFile(const char *file,
|
||||
const char *mode);
|
||||
@@ -165,7 +165,7 @@ extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromMem(void *mem, int size);
|
||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_RWFromConstMem(const void *mem,
|
||||
int size);
|
||||
|
||||
/*@} *//*RWFrom functions */
|
||||
/* @} *//* RWFrom functions */
|
||||
|
||||
|
||||
extern DECLSPEC SDL_RWops *SDLCALL SDL_AllocRW(void);
|
||||
@@ -180,14 +180,14 @@ extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
|
||||
*
|
||||
* Macros to easily read and write from an SDL_RWops structure.
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
#define SDL_RWsize(ctx) (ctx)->size(ctx)
|
||||
#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
|
||||
#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR)
|
||||
#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n)
|
||||
#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
|
||||
#define SDL_RWclose(ctx) (ctx)->close(ctx)
|
||||
/*@} *//*Read/write macros */
|
||||
/* @} *//* Read/write macros */
|
||||
|
||||
|
||||
/**
|
||||
@@ -195,7 +195,7 @@ extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops * area);
|
||||
*
|
||||
* Read an item of the specified endianness and return in native format.
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
extern DECLSPEC Uint8 SDLCALL SDL_ReadU8(SDL_RWops * src);
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops * src);
|
||||
extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops * src);
|
||||
@@ -203,14 +203,14 @@ extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops * src);
|
||||
extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops * src);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops * src);
|
||||
extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops * src);
|
||||
/*@} *//*Read endian functions */
|
||||
/* @} *//* Read endian functions */
|
||||
|
||||
/**
|
||||
* \name Write endian functions
|
||||
*
|
||||
* Write an item of native format to the specified endianness.
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteU8(SDL_RWops * dst, Uint8 value);
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteLE16(SDL_RWops * dst, Uint16 value);
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteBE16(SDL_RWops * dst, Uint16 value);
|
||||
@@ -218,7 +218,7 @@ extern DECLSPEC size_t SDLCALL SDL_WriteLE32(SDL_RWops * dst, Uint32 value);
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteBE32(SDL_RWops * dst, Uint32 value);
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteLE64(SDL_RWops * dst, Uint64 value);
|
||||
extern DECLSPEC size_t SDLCALL SDL_WriteBE64(SDL_RWops * dst, Uint64 value);
|
||||
/*@} *//*Write endian functions */
|
||||
/* @} *//* Write endian functions */
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
||||
@@ -49,7 +49,7 @@ typedef enum
|
||||
*
|
||||
* These values are from usage page 0x07 (USB keyboard page).
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
|
||||
SDL_SCANCODE_A = 4,
|
||||
SDL_SCANCODE_B = 5,
|
||||
@@ -339,14 +339,14 @@ typedef enum
|
||||
* special KMOD_MODE for it I'm adding it here
|
||||
*/
|
||||
|
||||
/*@} *//*Usage page 0x07 */
|
||||
/* @} *//* Usage page 0x07 */
|
||||
|
||||
/**
|
||||
* \name Usage page 0x0C
|
||||
*
|
||||
* These values are mapped from usage page 0x0C (USB consumer page).
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
|
||||
SDL_SCANCODE_AUDIONEXT = 258,
|
||||
SDL_SCANCODE_AUDIOPREV = 259,
|
||||
@@ -366,14 +366,14 @@ typedef enum
|
||||
SDL_SCANCODE_AC_REFRESH = 273,
|
||||
SDL_SCANCODE_AC_BOOKMARKS = 274,
|
||||
|
||||
/*@} *//*Usage page 0x0C */
|
||||
/* @} *//* Usage page 0x0C */
|
||||
|
||||
/**
|
||||
* \name Walther keys
|
||||
*
|
||||
* These are values that Christian Walther added (for mac keyboard?).
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
|
||||
SDL_SCANCODE_BRIGHTNESSDOWN = 275,
|
||||
SDL_SCANCODE_BRIGHTNESSUP = 276,
|
||||
@@ -388,7 +388,7 @@ typedef enum
|
||||
SDL_SCANCODE_APP1 = 283,
|
||||
SDL_SCANCODE_APP2 = 284,
|
||||
|
||||
/*@} *//*Walther keys */
|
||||
/* @} *//* Walther keys */
|
||||
|
||||
/* Add any other keys here. */
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
* Use proper C++ casts when compiled as C++ to be compatible with the option
|
||||
* -Wold-style-cast of GCC (and -Werror=old-style-cast in GCC 4.2 and above).
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
#ifdef __cplusplus
|
||||
#define SDL_reinterpret_cast(type, expression) reinterpret_cast<type>(expression)
|
||||
#define SDL_static_cast(type, expression) static_cast<type>(expression)
|
||||
@@ -99,7 +99,7 @@
|
||||
#define SDL_static_cast(type, expression) ((type)(expression))
|
||||
#define SDL_const_cast(type, expression) ((type)(expression))
|
||||
#endif
|
||||
/*@} *//*Cast operators */
|
||||
/* @} *//* Cast operators */
|
||||
|
||||
/* Define a four character code as a Uint32 */
|
||||
#define SDL_FOURCC(A, B, C, D) \
|
||||
@@ -111,7 +111,7 @@
|
||||
/**
|
||||
* \name Basic data types
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
|
||||
typedef enum
|
||||
{
|
||||
@@ -153,7 +153,7 @@ typedef int64_t Sint64;
|
||||
*/
|
||||
typedef uint64_t Uint64;
|
||||
|
||||
/*@} *//*Basic data types */
|
||||
/* @} *//* Basic data types */
|
||||
|
||||
|
||||
#define SDL_COMPILE_TIME_ASSERT(name, x) \
|
||||
|
||||
@@ -48,12 +48,12 @@ extern "C" {
|
||||
* \internal
|
||||
* Used internally (read-only).
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
#define SDL_SWSURFACE 0 /**< Just here for compatibility */
|
||||
#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */
|
||||
#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */
|
||||
#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */
|
||||
/*@} *//*Surface flags */
|
||||
/* @} *//* Surface flags */
|
||||
|
||||
/**
|
||||
* Evaluates to true if the surface needs to be locked before access.
|
||||
|
||||
+14
-14
@@ -43,43 +43,43 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*! Definitions for test case structures */
|
||||
/* ! Definitions for test case structures */
|
||||
#define TEST_ENABLED 1
|
||||
#define TEST_DISABLED 0
|
||||
|
||||
/*! Definition of all the possible test return values of the test case method */
|
||||
/* ! Definition of all the possible test return values of the test case method */
|
||||
#define TEST_ABORTED -1
|
||||
#define TEST_STARTED 0
|
||||
#define TEST_COMPLETED 1
|
||||
#define TEST_SKIPPED 2
|
||||
|
||||
/*! Definition of all the possible test results for the harness */
|
||||
/* ! Definition of all the possible test results for the harness */
|
||||
#define TEST_RESULT_PASSED 0
|
||||
#define TEST_RESULT_FAILED 1
|
||||
#define TEST_RESULT_NO_ASSERT 2
|
||||
#define TEST_RESULT_SKIPPED 3
|
||||
#define TEST_RESULT_SETUP_FAILURE 4
|
||||
|
||||
/*!< Function pointer to a test case setup function (run before every test) */
|
||||
/* !< Function pointer to a test case setup function (run before every test) */
|
||||
typedef void (*SDLTest_TestCaseSetUpFp)(void *arg);
|
||||
|
||||
/*!< Function pointer to a test case function */
|
||||
/* !< Function pointer to a test case function */
|
||||
typedef int (*SDLTest_TestCaseFp)(void *arg);
|
||||
|
||||
/*!< Function pointer to a test case teardown function (run after every test) */
|
||||
/* !< Function pointer to a test case teardown function (run after every test) */
|
||||
typedef void (*SDLTest_TestCaseTearDownFp)(void *arg);
|
||||
|
||||
/**
|
||||
* Holds information about a single test case.
|
||||
*/
|
||||
typedef struct SDLTest_TestCaseReference {
|
||||
/*!< Func2Stress */
|
||||
/* !< Func2Stress */
|
||||
SDLTest_TestCaseFp testCase;
|
||||
/*!< Short name (or function name) "Func2Stress" */
|
||||
/* !< Short name (or function name) "Func2Stress" */
|
||||
char *name;
|
||||
/*!< Long name or full description "This test pushes func2() to the limit." */
|
||||
/* !< Long name or full description "This test pushes func2() to the limit." */
|
||||
char *description;
|
||||
/*!< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */
|
||||
/* !< Set to TEST_ENABLED or TEST_DISABLED (test won't be run) */
|
||||
int enabled;
|
||||
} SDLTest_TestCaseReference;
|
||||
|
||||
@@ -87,13 +87,13 @@ typedef struct SDLTest_TestCaseReference {
|
||||
* Holds information about a test suite (multiple test cases).
|
||||
*/
|
||||
typedef struct SDLTest_TestSuiteReference {
|
||||
/*!< "PlatformSuite" */
|
||||
/* !< "PlatformSuite" */
|
||||
char *name;
|
||||
/*!< The function that is run before each test. NULL skips. */
|
||||
/* !< The function that is run before each test. NULL skips. */
|
||||
SDLTest_TestCaseSetUpFp testSetUp;
|
||||
/*!< The test cases that are run as part of the suite. Last item should be NULL. */
|
||||
/* !< The test cases that are run as part of the suite. Last item should be NULL. */
|
||||
const SDLTest_TestCaseReference **testCases;
|
||||
/*!< The function that is run after each test. NULL skips. */
|
||||
/* !< The function that is run after each test. NULL skips. */
|
||||
SDLTest_TestCaseTearDownFp testTearDown;
|
||||
} SDLTest_TestSuiteReference;
|
||||
|
||||
|
||||
+2
-2
@@ -821,7 +821,7 @@ extern DECLSPEC void SDLCALL SDL_DisableScreenSaver(void);
|
||||
/**
|
||||
* \name OpenGL support functions
|
||||
*/
|
||||
/*@{ */
|
||||
/* @{ */
|
||||
|
||||
/**
|
||||
* \brief Dynamically load an OpenGL library.
|
||||
@@ -939,7 +939,7 @@ extern DECLSPEC void SDLCALL SDL_GL_SwapWindow(SDL_Window * window);
|
||||
*/
|
||||
extern DECLSPEC void SDLCALL SDL_GL_DeleteContext(SDL_GLContext context);
|
||||
|
||||
/*@} *//*OpenGL support functions */
|
||||
/* @} *//* OpenGL support functions */
|
||||
|
||||
|
||||
/* Ends C function definitions when using C++ */
|
||||
|
||||
@@ -419,7 +419,7 @@ SDL_RunAudio(void *devicep)
|
||||
if (istream == NULL) {
|
||||
istream = device->fake_stream;
|
||||
}
|
||||
/*SDL_memcpy(istream, device->convert.buf, device->convert.len_cvt); */
|
||||
/* SDL_memcpy(istream, device->convert.buf, device->convert.len_cvt); */
|
||||
SDL_StreamWrite(&device->streamer, device->convert.buf,
|
||||
device->convert.len_cvt);
|
||||
} else {
|
||||
|
||||
@@ -61,7 +61,7 @@ InitMS_ADPCM(WaveFMT * format)
|
||||
SDL_SwapLE16(format->bitspersample);
|
||||
rogue_feel = (Uint8 *) format + sizeof(*format);
|
||||
if (sizeof(*format) == 16) {
|
||||
/*const Uint16 extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]); */
|
||||
/* const Uint16 extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]); */
|
||||
rogue_feel += sizeof(Uint16);
|
||||
}
|
||||
MS_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1] << 8) | rogue_feel[0]);
|
||||
@@ -242,7 +242,7 @@ InitIMA_ADPCM(WaveFMT * format)
|
||||
SDL_SwapLE16(format->bitspersample);
|
||||
rogue_feel = (Uint8 *) format + sizeof(*format);
|
||||
if (sizeof(*format) == 16) {
|
||||
/*const Uint16 extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]); */
|
||||
/* const Uint16 extra_info = ((rogue_feel[1] << 8) | rogue_feel[0]); */
|
||||
rogue_feel += sizeof(Uint16);
|
||||
}
|
||||
IMA_ADPCM_state.wSamplesPerBlock = ((rogue_feel[1] << 8) | rogue_feel[0]);
|
||||
|
||||
@@ -304,7 +304,7 @@ ALSA_PlayDevice(_THIS)
|
||||
|
||||
while ( frames_left > 0 && this->enabled ) {
|
||||
/* !!! FIXME: This works, but needs more testing before going live */
|
||||
/*ALSA_snd_pcm_wait(this->hidden->pcm_handle, -1); */
|
||||
/* ALSA_snd_pcm_wait(this->hidden->pcm_handle, -1); */
|
||||
status = ALSA_snd_pcm_writei(this->hidden->pcm_handle,
|
||||
sample_buf, frames_left);
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ PSPAUD_OpenDevice(_THIS, const char *devname, int iscapture)
|
||||
this->spec.size *= this->spec.channels;
|
||||
this->spec.size *= this->spec.samples;
|
||||
|
||||
/*========================================== */
|
||||
/* ========================================== */
|
||||
|
||||
/* Allocate the mixing buffer. Its size and starting address must
|
||||
be a multiple of 64 bytes. Our sample count is already a multiple of
|
||||
@@ -171,7 +171,7 @@ PSPAUD_Init(SDL_AudioDriverImpl * impl)
|
||||
impl->CloseDevice = PSPAUD_CloseDevice;
|
||||
impl->ThreadInit = PSPAUD_ThreadInit;
|
||||
|
||||
/*PSP audio device */
|
||||
/* PSP audio device */
|
||||
impl->OnlyHasDefaultOutputDevice = 1;
|
||||
/*
|
||||
impl->HasCaptureSupport = 1;
|
||||
|
||||
@@ -40,13 +40,13 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#define LOG_TAG "SDL_android"
|
||||
/*#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) */
|
||||
/*#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) */
|
||||
/* #define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) */
|
||||
/* #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) */
|
||||
#define LOGI(...) do {} while (false)
|
||||
#define LOGE(...) do {} while (false)
|
||||
|
||||
/* Uncomment this to log messages entering and exiting methods in this file */
|
||||
/*#define DEBUG_JNI */
|
||||
/* #define DEBUG_JNI */
|
||||
|
||||
static void Android_JNI_ThreadDestroyed(void*);
|
||||
|
||||
@@ -680,7 +680,7 @@ static int Internal_Android_JNI_FileOpen(SDL_RWops* ctx)
|
||||
if (false) {
|
||||
fallback:
|
||||
/* Disabled log message because of spam on the Nexus 7 */
|
||||
/*__android_log_print(ANDROID_LOG_DEBUG, "SDL", "Falling back to legacy InputStream method for opening file"); */
|
||||
/* __android_log_print(ANDROID_LOG_DEBUG, "SDL", "Falling back to legacy InputStream method for opening file"); */
|
||||
|
||||
/* Try the old method using InputStream */
|
||||
ctx->hidden.androidio.assetFileDescriptorRef = NULL;
|
||||
@@ -688,7 +688,7 @@ fallback:
|
||||
/* inputStream = assetManager.open(<filename>); */
|
||||
mid = (*mEnv)->GetMethodID(mEnv, (*mEnv)->GetObjectClass(mEnv, assetManager),
|
||||
"open", "(Ljava/lang/String;I)Ljava/io/InputStream;");
|
||||
inputStream = (*mEnv)->CallObjectMethod(mEnv, assetManager, mid, fileNameJString, 1 /*ACCESS_RANDOM */);
|
||||
inputStream = (*mEnv)->CallObjectMethod(mEnv, assetManager, mid, fileNameJString, 1 /* ACCESS_RANDOM */);
|
||||
if (Android_JNI_ExceptionOccurred(false)) {
|
||||
goto failure;
|
||||
}
|
||||
@@ -790,7 +790,7 @@ size_t Android_JNI_FileRead(SDL_RWops* ctx, void* buffer,
|
||||
|
||||
if (ctx->hidden.androidio.assetFileDescriptorRef) {
|
||||
size_t bytesMax = size * maxnum;
|
||||
if (ctx->hidden.androidio.size != -1 /*UNKNOWN_LENGTH */ && ctx->hidden.androidio.position + bytesMax > ctx->hidden.androidio.size) {
|
||||
if (ctx->hidden.androidio.size != -1 /* UNKNOWN_LENGTH */ && ctx->hidden.androidio.position + bytesMax > ctx->hidden.androidio.size) {
|
||||
bytesMax = ctx->hidden.androidio.size - ctx->hidden.androidio.position;
|
||||
}
|
||||
size_t result = read(ctx->hidden.androidio.fd, buffer, bytesMax );
|
||||
@@ -909,12 +909,12 @@ Sint64 Android_JNI_FileSeek(SDL_RWops* ctx, Sint64 offset, int whence)
|
||||
if (ctx->hidden.androidio.assetFileDescriptorRef) {
|
||||
switch (whence) {
|
||||
case RW_SEEK_SET:
|
||||
if (ctx->hidden.androidio.size != -1 /*UNKNOWN_LENGTH */ && offset > ctx->hidden.androidio.size) offset = ctx->hidden.androidio.size;
|
||||
if (ctx->hidden.androidio.size != -1 /* UNKNOWN_LENGTH */ && offset > ctx->hidden.androidio.size) offset = ctx->hidden.androidio.size;
|
||||
offset += ctx->hidden.androidio.offset;
|
||||
break;
|
||||
case RW_SEEK_CUR:
|
||||
offset += ctx->hidden.androidio.position;
|
||||
if (ctx->hidden.androidio.size != -1 /*UNKNOWN_LENGTH */ && offset > ctx->hidden.androidio.size) offset = ctx->hidden.androidio.size;
|
||||
if (ctx->hidden.androidio.size != -1 /* UNKNOWN_LENGTH */ && offset > ctx->hidden.androidio.size) offset = ctx->hidden.androidio.size;
|
||||
offset += ctx->hidden.androidio.offset;
|
||||
break;
|
||||
case RW_SEEK_END:
|
||||
|
||||
@@ -33,7 +33,7 @@ extern "C" {
|
||||
#include "SDL_rect.h"
|
||||
|
||||
/* Interface from the SDL library into the Android Java activity */
|
||||
/*extern SDL_bool Android_JNI_CreateContext(int majorVersion, int minorVersion, int red, int green, int blue, int alpha, int buffer, int depth, int stencil, int buffers, int samples);
|
||||
/* extern SDL_bool Android_JNI_CreateContext(int majorVersion, int minorVersion, int red, int green, int blue, int alpha, int buffer, int depth, int stencil, int buffers, int samples);
|
||||
extern SDL_bool Android_JNI_DeleteContext(void); */
|
||||
extern void Android_JNI_SwapWindow();
|
||||
extern void Android_JNI_SetActivityTitle(const char *title);
|
||||
|
||||
+37
-37
@@ -121,8 +121,8 @@ static int SaveTemplate(SDL_DollarTemplate *templ, SDL_RWops * src)
|
||||
if (src == NULL) return 0;
|
||||
|
||||
|
||||
/*No Longer storing the Hash, rehash on load */
|
||||
/*if(SDL_RWops.write(src,&(templ->hash),sizeof(templ->hash),1) != 1) return 0; */
|
||||
/* No Longer storing the Hash, rehash on load */
|
||||
/* if(SDL_RWops.write(src,&(templ->hash),sizeof(templ->hash),1) != 1) return 0; */
|
||||
|
||||
if (SDL_RWwrite(src,templ->path,
|
||||
sizeof(templ->path[0]),DOLLARNPOINTS) != DOLLARNPOINTS)
|
||||
@@ -158,7 +158,7 @@ int SDL_SaveDollarTemplate(SDL_GestureID gestureId, SDL_RWops *src)
|
||||
return SDL_SetError("Unknown gestureId");
|
||||
}
|
||||
|
||||
/*path is an already sampled set of points
|
||||
/* path is an already sampled set of points
|
||||
Returns the index of the gesture on success, or -1 */
|
||||
static int SDL_AddDollarGesture_one(SDL_GestureTouch* inTouch, SDL_FloatPoint* path)
|
||||
{
|
||||
@@ -223,16 +223,16 @@ int SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src)
|
||||
DOLLARNPOINTS) break;
|
||||
|
||||
if (touchId >= 0) {
|
||||
/*printf("Adding loaded gesture to 1 touch\n"); */
|
||||
/* printf("Adding loaded gesture to 1 touch\n"); */
|
||||
if (SDL_AddDollarGesture(touch, templ.path) >= 0)
|
||||
loaded++;
|
||||
}
|
||||
else {
|
||||
/*printf("Adding to: %i touches\n",SDL_numGestureTouches); */
|
||||
/* printf("Adding to: %i touches\n",SDL_numGestureTouches); */
|
||||
for (i = 0; i < SDL_numGestureTouches; i++) {
|
||||
touch = &SDL_gestureTouch[i];
|
||||
/*printf("Adding loaded gesture to + touches\n"); */
|
||||
/*TODO: What if this fails? */
|
||||
/* printf("Adding loaded gesture to + touches\n"); */
|
||||
/* TODO: What if this fails? */
|
||||
SDL_AddDollarGesture(touch,templ.path);
|
||||
}
|
||||
loaded++;
|
||||
@@ -297,7 +297,7 @@ static float bestDollarDifference(SDL_FloatPoint* points,SDL_FloatPoint* templ)
|
||||
return SDL_min(f1,f2);
|
||||
}
|
||||
|
||||
/*DollarPath contains raw points, plus (possibly) the calculated length */
|
||||
/* DollarPath contains raw points, plus (possibly) the calculated length */
|
||||
static int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points)
|
||||
{
|
||||
int i;
|
||||
@@ -310,7 +310,7 @@ static int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points)
|
||||
float w,h;
|
||||
float length = path->length;
|
||||
|
||||
/*Calculate length if it hasn't already been done */
|
||||
/* Calculate length if it hasn't already been done */
|
||||
if (length <= 0) {
|
||||
for (i=1;i < path->numPoints; i++) {
|
||||
float dx = path->p[i ].x - path->p[i-1].x;
|
||||
@@ -319,17 +319,17 @@ static int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points)
|
||||
}
|
||||
}
|
||||
|
||||
/*Resample */
|
||||
/* Resample */
|
||||
interval = length/(DOLLARNPOINTS - 1);
|
||||
dist = interval;
|
||||
|
||||
centroid.x = 0;centroid.y = 0;
|
||||
|
||||
/*printf("(%f,%f)\n",path->p[path->numPoints-1].x,path->p[path->numPoints-1].y); */
|
||||
/* printf("(%f,%f)\n",path->p[path->numPoints-1].x,path->p[path->numPoints-1].y); */
|
||||
for (i = 1; i < path->numPoints; i++) {
|
||||
float d = (float)(SDL_sqrt((path->p[i-1].x-path->p[i].x)*(path->p[i-1].x-path->p[i].x)+
|
||||
(path->p[i-1].y-path->p[i].y)*(path->p[i-1].y-path->p[i].y)));
|
||||
/*printf("d = %f dist = %f/%f\n",d,dist,interval); */
|
||||
/* printf("d = %f dist = %f/%f\n",d,dist,interval); */
|
||||
while (dist + d > interval) {
|
||||
points[numPoints].x = path->p[i-1].x +
|
||||
((interval-dist)/d)*(path->p[i].x-path->p[i-1].x);
|
||||
@@ -347,15 +347,15 @@ static int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points)
|
||||
SDL_SetError("ERROR: NumPoints = %i\n",numPoints);
|
||||
return 0;
|
||||
}
|
||||
/*copy the last point */
|
||||
/* copy the last point */
|
||||
points[DOLLARNPOINTS-1] = path->p[path->numPoints-1];
|
||||
numPoints = DOLLARNPOINTS;
|
||||
|
||||
centroid.x /= numPoints;
|
||||
centroid.y /= numPoints;
|
||||
|
||||
/*printf("Centroid (%f,%f)",centroid.x,centroid.y); */
|
||||
/*Rotate Points so point 0 is left of centroid and solve for the bounding box */
|
||||
/* printf("Centroid (%f,%f)",centroid.x,centroid.y); */
|
||||
/* Rotate Points so point 0 is left of centroid and solve for the bounding box */
|
||||
xmin = centroid.x;
|
||||
xmax = centroid.x;
|
||||
ymin = centroid.y;
|
||||
@@ -379,7 +379,7 @@ static int dollarNormalize(const SDL_DollarPath *path,SDL_FloatPoint *points)
|
||||
if (points[i].y > ymax) ymax = points[i].y;
|
||||
}
|
||||
|
||||
/*Scale points to DOLLARSIZE, and translate to the origin */
|
||||
/* Scale points to DOLLARSIZE, and translate to the origin */
|
||||
w = xmax-xmin;
|
||||
h = ymax-ymin;
|
||||
|
||||
@@ -400,7 +400,7 @@ static float dollarRecognize(const SDL_DollarPath *path,int *bestTempl,SDL_Gestu
|
||||
|
||||
dollarNormalize(path,points);
|
||||
|
||||
/*PrintPath(points); */
|
||||
/* PrintPath(points); */
|
||||
*bestTempl = -1;
|
||||
for (i = 0; i < touch->numDollarTemplates; i++) {
|
||||
float diff = bestDollarDifference(points,touch->dollarTemplate[i].path);
|
||||
@@ -436,7 +436,7 @@ 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); */
|
||||
/* printf("%i ?= %i\n",SDL_gestureTouch[i].id,id); */
|
||||
if (SDL_gestureTouch[i].id == id)
|
||||
return &SDL_gestureTouch[i];
|
||||
}
|
||||
@@ -466,7 +466,7 @@ static int SDL_SendGestureDollar(SDL_GestureTouch* touch,
|
||||
event.mgesture.y = touch->centroid.y;
|
||||
event.dgesture.gestureId = gestureId;
|
||||
event.dgesture.error = error;
|
||||
/*A finger came up to trigger this event. */
|
||||
/* A finger came up to trigger this event. */
|
||||
event.dgesture.numFingers = touch->numDownFingers + 1;
|
||||
return SDL_PushEvent(&event) > 0;
|
||||
}
|
||||
@@ -501,13 +501,13 @@ void SDL_GestureProcessEvent(SDL_Event* event)
|
||||
event->type == SDL_FINGERUP) {
|
||||
SDL_GestureTouch* inTouch = SDL_GetGestureTouch(event->tfinger.touchId);
|
||||
|
||||
/*Shouldn't be possible */
|
||||
/* Shouldn't be possible */
|
||||
if (inTouch == NULL) return;
|
||||
|
||||
x = event->tfinger.x;
|
||||
y = event->tfinger.y;
|
||||
|
||||
/*Finger Up */
|
||||
/* Finger Up */
|
||||
if (event->type == SDL_FINGERUP) {
|
||||
inTouch->numDownFingers--;
|
||||
|
||||
@@ -515,7 +515,7 @@ void SDL_GestureProcessEvent(SDL_Event* event)
|
||||
if (inTouch->recording) {
|
||||
inTouch->recording = SDL_FALSE;
|
||||
dollarNormalize(&inTouch->dollarPath,path);
|
||||
/*PrintPath(path); */
|
||||
/* PrintPath(path); */
|
||||
if (recordAll) {
|
||||
index = SDL_AddDollarGesture(NULL,path);
|
||||
for (i = 0; i < SDL_numGestureTouches; i++)
|
||||
@@ -538,14 +538,14 @@ void SDL_GestureProcessEvent(SDL_Event* event)
|
||||
error = dollarRecognize(&inTouch->dollarPath,
|
||||
&bestTempl,inTouch);
|
||||
if (bestTempl >= 0){
|
||||
/*Send Event */
|
||||
/* Send Event */
|
||||
unsigned long gestureId = inTouch->dollarTemplate[bestTempl].hash;
|
||||
SDL_SendGestureDollar(inTouch,gestureId,error);
|
||||
/*printf ("%s\n",);("Dollar error: %f\n",error); */
|
||||
/* printf ("%s\n",);("Dollar error: %f\n",error); */
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/*inTouch->gestureLast[j] = inTouch->gestureLast[inTouch->numDownFingers]; */
|
||||
/* inTouch->gestureLast[j] = inTouch->gestureLast[inTouch->numDownFingers]; */
|
||||
if (inTouch->numDownFingers > 0) {
|
||||
inTouch->centroid.x = (inTouch->centroid.x*(inTouch->numDownFingers+1)-
|
||||
x)/inTouch->numDownFingers;
|
||||
@@ -575,22 +575,22 @@ void SDL_GestureProcessEvent(SDL_Event* event)
|
||||
|
||||
inTouch->centroid.x += dx/inTouch->numDownFingers;
|
||||
inTouch->centroid.y += dy/inTouch->numDownFingers;
|
||||
/*printf("Centrid : (%f,%f)\n",inTouch->centroid.x,inTouch->centroid.y); */
|
||||
/* printf("Centrid : (%f,%f)\n",inTouch->centroid.x,inTouch->centroid.y); */
|
||||
if (inTouch->numDownFingers > 1) {
|
||||
SDL_FloatPoint lv; /*Vector from centroid to last x,y position */
|
||||
SDL_FloatPoint v; /*Vector from centroid to current x,y position */
|
||||
/*lv = inTouch->gestureLast[j].cv; */
|
||||
SDL_FloatPoint lv; /* Vector from centroid to last x,y position */
|
||||
SDL_FloatPoint v; /* Vector from centroid to current x,y position */
|
||||
/* lv = inTouch->gestureLast[j].cv; */
|
||||
lv.x = lastP.x - lastCentroid.x;
|
||||
lv.y = lastP.y - lastCentroid.y;
|
||||
lDist = (float)SDL_sqrt(lv.x*lv.x + lv.y*lv.y);
|
||||
/*printf("lDist = %f\n",lDist); */
|
||||
/* printf("lDist = %f\n",lDist); */
|
||||
v.x = x - inTouch->centroid.x;
|
||||
v.y = y - inTouch->centroid.y;
|
||||
/*inTouch->gestureLast[j].cv = v; */
|
||||
/* inTouch->gestureLast[j].cv = v; */
|
||||
Dist = (float)SDL_sqrt(v.x*v.x+v.y*v.y);
|
||||
/* SDL_cos(dTheta) = (v . lv)/(|v| * |lv|) */
|
||||
|
||||
/*Normalize Vectors to simplify angle calculation */
|
||||
/* Normalize Vectors to simplify angle calculation */
|
||||
lv.x/=lDist;
|
||||
lv.y/=lDist;
|
||||
v.x/=Dist;
|
||||
@@ -598,9 +598,9 @@ void SDL_GestureProcessEvent(SDL_Event* event)
|
||||
dtheta = (float)SDL_atan2(lv.x*v.y - lv.y*v.x,lv.x*v.x + lv.y*v.y);
|
||||
|
||||
dDist = (Dist - lDist);
|
||||
if (lDist == 0) {dDist = 0;dtheta = 0;} /*To avoid impossible values */
|
||||
if (lDist == 0) {dDist = 0;dtheta = 0;} /* To avoid impossible values */
|
||||
|
||||
/*inTouch->gestureLast[j].dDist = dDist;
|
||||
/* inTouch->gestureLast[j].dDist = dDist;
|
||||
inTouch->gestureLast[j].dtheta = dtheta;
|
||||
|
||||
printf("dDist = %f, dTheta = %f\n",dDist,dtheta);
|
||||
@@ -613,12 +613,12 @@ void SDL_GestureProcessEvent(SDL_Event* event)
|
||||
SDL_SendGestureMulti(inTouch,dtheta,dDist);
|
||||
}
|
||||
else {
|
||||
/*inTouch->gestureLast[j].dDist = 0;
|
||||
/* inTouch->gestureLast[j].dDist = 0;
|
||||
inTouch->gestureLast[j].dtheta = 0;
|
||||
inTouch->gestureLast[j].cv.x = 0;
|
||||
inTouch->gestureLast[j].cv.y = 0; */
|
||||
}
|
||||
/*inTouch->gestureLast[j].f.p.x = x;
|
||||
/* inTouch->gestureLast[j].f.p.x = x;
|
||||
inTouch->gestureLast[j].f.p.y = y;
|
||||
break;
|
||||
pressure? */
|
||||
@@ -631,7 +631,7 @@ void SDL_GestureProcessEvent(SDL_Event* event)
|
||||
x)/inTouch->numDownFingers;
|
||||
inTouch->centroid.y = (inTouch->centroid.y*(inTouch->numDownFingers - 1)+
|
||||
y)/inTouch->numDownFingers;
|
||||
/*printf("Finger Down: (%f,%f). Centroid: (%f,%f\n",x,y,
|
||||
/* printf("Finger Down: (%f,%f). Centroid: (%f,%f\n",x,y,
|
||||
inTouch->centroid.x,inTouch->centroid.y); */
|
||||
|
||||
#ifdef ENABLE_DOLLAR
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "../video/SDL_sysvideo.h"
|
||||
|
||||
|
||||
/*#define DEBUG_KEYBOARD */
|
||||
/* #define DEBUG_KEYBOARD */
|
||||
|
||||
/* Global keyboard information */
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include "default_cursor.h"
|
||||
#include "../video/SDL_sysvideo.h"
|
||||
|
||||
/*#define DEBUG_MOUSE */
|
||||
/* #define DEBUG_MOUSE */
|
||||
|
||||
/* The mouse state */
|
||||
static SDL_Mouse SDL_mouse;
|
||||
|
||||
@@ -93,7 +93,7 @@ FFStrError(HRESULT err)
|
||||
case FFERR_DEVICEFULL:
|
||||
return "device full";
|
||||
/* This should be valid, but for some reason isn't defined... */
|
||||
/*case FFERR_DEVICENOTREG:
|
||||
/* case FFERR_DEVICENOTREG:
|
||||
return "device not registered"; */
|
||||
case FFERR_DEVICEPAUSED:
|
||||
return "device paused";
|
||||
@@ -343,7 +343,7 @@ GetSupportedFeatures(SDL_Haptic * haptic)
|
||||
FF_TEST(FFCAP_ET_CONSTANTFORCE, SDL_HAPTIC_CONSTANT);
|
||||
FF_TEST(FFCAP_ET_RAMPFORCE, SDL_HAPTIC_RAMP);
|
||||
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
||||
/*FF_TEST(FFCAP_ET_SQUARE, SDL_HAPTIC_SQUARE); */
|
||||
/* FF_TEST(FFCAP_ET_SQUARE, SDL_HAPTIC_SQUARE); */
|
||||
FF_TEST(FFCAP_ET_SINE, SDL_HAPTIC_SINE);
|
||||
FF_TEST(FFCAP_ET_TRIANGLE, SDL_HAPTIC_TRIANGLE);
|
||||
FF_TEST(FFCAP_ET_SAWTOOTHUP, SDL_HAPTIC_SAWTOOTHUP);
|
||||
@@ -752,7 +752,7 @@ SDL_SYS_ToFFEFFECT(SDL_Haptic * haptic, FFEFFECT * dest,
|
||||
|
||||
case SDL_HAPTIC_SINE:
|
||||
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
||||
/*case SDL_HAPTIC_SQUARE: */
|
||||
/* case SDL_HAPTIC_SQUARE: */
|
||||
case SDL_HAPTIC_TRIANGLE:
|
||||
case SDL_HAPTIC_SAWTOOTHUP:
|
||||
case SDL_HAPTIC_SAWTOOTHDOWN:
|
||||
@@ -981,7 +981,7 @@ SDL_SYS_HapticEffectType(Uint16 type)
|
||||
return kFFEffectType_RampForce_ID;
|
||||
|
||||
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
||||
/*case SDL_HAPTIC_SQUARE:
|
||||
/* case SDL_HAPTIC_SQUARE:
|
||||
return kFFEffectType_Square_ID; */
|
||||
|
||||
case SDL_HAPTIC_SINE:
|
||||
|
||||
@@ -100,7 +100,7 @@ EV_IsHaptic(int fd)
|
||||
EV_TEST(FF_CONSTANT, SDL_HAPTIC_CONSTANT);
|
||||
EV_TEST(FF_SINE, SDL_HAPTIC_SINE);
|
||||
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
||||
/*EV_TEST(FF_SQUARE, SDL_HAPTIC_SQUARE); */
|
||||
/* EV_TEST(FF_SQUARE, SDL_HAPTIC_SQUARE); */
|
||||
EV_TEST(FF_TRIANGLE, SDL_HAPTIC_TRIANGLE);
|
||||
EV_TEST(FF_SAW_UP, SDL_HAPTIC_SAWTOOTHUP);
|
||||
EV_TEST(FF_SAW_DOWN, SDL_HAPTIC_SAWTOOTHDOWN);
|
||||
@@ -600,7 +600,7 @@ SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src)
|
||||
|
||||
case SDL_HAPTIC_SINE:
|
||||
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
||||
/*case SDL_HAPTIC_SQUARE: */
|
||||
/* case SDL_HAPTIC_SQUARE: */
|
||||
case SDL_HAPTIC_TRIANGLE:
|
||||
case SDL_HAPTIC_SAWTOOTHUP:
|
||||
case SDL_HAPTIC_SAWTOOTHDOWN:
|
||||
@@ -625,7 +625,7 @@ SDL_SYS_ToFFEffect(struct ff_effect *dest, SDL_HapticEffect * src)
|
||||
if (periodic->type == SDL_HAPTIC_SINE)
|
||||
dest->u.periodic.waveform = FF_SINE;
|
||||
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
||||
/*else if (periodic->type == SDL_HAPTIC_SQUARE)
|
||||
/* else if (periodic->type == SDL_HAPTIC_SQUARE)
|
||||
dest->u.periodic.waveform = FF_SQUARE; */
|
||||
else if (periodic->type == SDL_HAPTIC_TRIANGLE)
|
||||
dest->u.periodic.waveform = FF_TRIANGLE;
|
||||
|
||||
@@ -304,7 +304,7 @@ DI_EffectCallback(LPCDIEFFECTINFO pei, LPVOID pv)
|
||||
EFFECT_TEST(GUID_CustomForce, SDL_HAPTIC_CUSTOM);
|
||||
EFFECT_TEST(GUID_Sine, SDL_HAPTIC_SINE);
|
||||
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
||||
/*EFFECT_TEST(GUID_Square, SDL_HAPTIC_SQUARE); */
|
||||
/* EFFECT_TEST(GUID_Square, SDL_HAPTIC_SQUARE); */
|
||||
EFFECT_TEST(GUID_Triangle, SDL_HAPTIC_TRIANGLE);
|
||||
EFFECT_TEST(GUID_SawtoothUp, SDL_HAPTIC_SAWTOOTHUP);
|
||||
EFFECT_TEST(GUID_SawtoothDown, SDL_HAPTIC_SAWTOOTHDOWN);
|
||||
@@ -936,7 +936,7 @@ SDL_SYS_ToDIEFFECT(SDL_Haptic * haptic, DIEFFECT * dest,
|
||||
|
||||
case SDL_HAPTIC_SINE:
|
||||
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
||||
/*case SDL_HAPTIC_SQUARE: */
|
||||
/* case SDL_HAPTIC_SQUARE: */
|
||||
case SDL_HAPTIC_TRIANGLE:
|
||||
case SDL_HAPTIC_SAWTOOTHUP:
|
||||
case SDL_HAPTIC_SAWTOOTHDOWN:
|
||||
@@ -1165,7 +1165,7 @@ SDL_SYS_HapticEffectType(SDL_HapticEffect * effect)
|
||||
return &GUID_RampForce;
|
||||
|
||||
/* !!! FIXME: put this back when we have more bits in 2.1 */
|
||||
/*case SDL_HAPTIC_SQUARE:
|
||||
/* case SDL_HAPTIC_SQUARE:
|
||||
return &GUID_Square; */
|
||||
|
||||
case SDL_HAPTIC_SINE:
|
||||
|
||||
+2
-2
@@ -81,8 +81,8 @@ double attribute_hidden __ieee754_atan2(double y, double x)
|
||||
switch(m) {
|
||||
case 0: return pi_o_4+tiny;/* atan(+INF,+INF) */
|
||||
case 1: return -pi_o_4-tiny;/* atan(-INF,+INF) */
|
||||
case 2: return 3.0*pi_o_4+tiny;/*atan(+INF,-INF) */
|
||||
case 3: return -3.0*pi_o_4-tiny;/*atan(-INF,-INF) */
|
||||
case 2: return 3.0*pi_o_4+tiny;/* atan(+INF,-INF) */
|
||||
case 3: return -3.0*pi_o_4-tiny;/* atan(-INF,-INF) */
|
||||
}
|
||||
} else {
|
||||
switch(m) {
|
||||
|
||||
+1
-1
@@ -178,7 +178,7 @@ libm_hidden_proto(scalbn)
|
||||
/* special value of x */
|
||||
if (lx == 0) {
|
||||
if (ix == 0x7ff00000 || ix == 0 || ix == 0x3ff00000) {
|
||||
z = ax; /*x is +-0,+-inf,+-1 */
|
||||
z = ax; /* x is +-0,+-inf,+-1 */
|
||||
if (hy < 0)
|
||||
z = one / z; /* z = (1/|x|) */
|
||||
if (hx < 0) {
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
#ifndef _MATH_PRIVATE_H_
|
||||
#define _MATH_PRIVATE_H_
|
||||
|
||||
/*#include <endian.h> */
|
||||
/* #include <endian.h> */
|
||||
#include "SDL_endian.h"
|
||||
/*#include <sys/types.h> */
|
||||
/* #include <sys/types.h> */
|
||||
|
||||
#define attribute_hidden
|
||||
#define libm_hidden_proto(x)
|
||||
|
||||
+3
-3
@@ -54,7 +54,7 @@ libm_hidden_proto(scalbn)
|
||||
GET_HIGH_WORD(hx, x);
|
||||
k = ((hx & 0x7ff00000) >> 20) - 54;
|
||||
if (n < -50000)
|
||||
return tiny * x; /*underflow */
|
||||
return tiny * x; /* underflow */
|
||||
}
|
||||
if (k == 0x7ff)
|
||||
return x + x; /* NaN or Inf */
|
||||
@@ -67,9 +67,9 @@ libm_hidden_proto(scalbn)
|
||||
}
|
||||
if (k <= -54) {
|
||||
if (n > 50000) /* in case integer overflow in n+k */
|
||||
return huge_val * copysign(huge_val, x); /*overflow */
|
||||
return huge_val * copysign(huge_val, x); /* overflow */
|
||||
else
|
||||
return tiny * copysign(tiny, x); /*underflow */
|
||||
return tiny * copysign(tiny, x); /* underflow */
|
||||
}
|
||||
k += 54; /* subnormal result */
|
||||
SET_HIGH_WORD(x, (hx & 0x800fffff) | (k << 20));
|
||||
|
||||
@@ -30,7 +30,7 @@ void Java_org_libsdl_app_SDLActivity_nativeInit(JNIEnv* env, jclass cls, jobject
|
||||
status = SDL_main(1, argv);
|
||||
|
||||
/* Do not issue an exit or the whole application will terminate instead of just the SDL thread */
|
||||
/*exit(status); */
|
||||
/* exit(status); */
|
||||
}
|
||||
|
||||
#endif /* __ANDROID__ */
|
||||
|
||||
@@ -958,10 +958,10 @@ SDL_SW_SetupYUVDisplay(SDL_SW_YUVTexture * swdata, Uint32 target_format)
|
||||
if (SDL_HasMMX() && (Rmask == 0xF800) &&
|
||||
(Gmask == 0x07E0) && (Bmask == 0x001F)
|
||||
&& (swdata->w & 15) == 0) {
|
||||
/*printf("Using MMX 16-bit 565 dither\n"); */
|
||||
/* printf("Using MMX 16-bit 565 dither\n"); */
|
||||
swdata->Display1X = Color565DitherYV12MMX1X;
|
||||
} else {
|
||||
/*printf("Using C 16-bit dither\n"); */
|
||||
/* printf("Using C 16-bit dither\n"); */
|
||||
swdata->Display1X = Color16DitherYV12Mod1X;
|
||||
}
|
||||
#else
|
||||
@@ -979,10 +979,10 @@ SDL_SW_SetupYUVDisplay(SDL_SW_YUVTexture * swdata, Uint32 target_format)
|
||||
if (SDL_HasMMX() && (Rmask == 0x00FF0000) &&
|
||||
(Gmask == 0x0000FF00) &&
|
||||
(Bmask == 0x000000FF) && (swdata->w & 15) == 0) {
|
||||
/*printf("Using MMX 32-bit dither\n"); */
|
||||
/* printf("Using MMX 32-bit dither\n"); */
|
||||
swdata->Display1X = ColorRGBDitherYV12MMX1X;
|
||||
} else {
|
||||
/*printf("Using C 32-bit dither\n"); */
|
||||
/* printf("Using C 32-bit dither\n"); */
|
||||
swdata->Display1X = Color32DitherYV12Mod1X;
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -874,7 +874,7 @@ GetScaleQuality(void)
|
||||
|
||||
if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) {
|
||||
return D3DTEXF_POINT;
|
||||
} else /*if (*hint == '1' || SDL_strcasecmp(hint, "linear") == 0) */ {
|
||||
} else /* if (*hint == '1' || SDL_strcasecmp(hint, "linear") == 0) */ {
|
||||
return D3DTEXF_LINEAR;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ GL_ResetState(SDL_Renderer *renderer)
|
||||
data->glDisable(GL_DEPTH_TEST);
|
||||
data->glDisable(GL_CULL_FACE);
|
||||
/* This ended up causing video discrepancies between OpenGL and Direct3D */
|
||||
/*data->glEnable(GL_LINE_SMOOTH); */
|
||||
/* data->glEnable(GL_LINE_SMOOTH); */
|
||||
|
||||
data->glMatrixMode(GL_MODELVIEW);
|
||||
data->glLoadIdentity();
|
||||
@@ -638,7 +638,7 @@ GL_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture)
|
||||
return -1;
|
||||
}
|
||||
if ((renderdata->GL_ARB_texture_rectangle_supported)
|
||||
/*&& texture->access != SDL_TEXTUREACCESS_TARGET */){
|
||||
/* && texture->access != SDL_TEXTUREACCESS_TARGET */){
|
||||
data->type = GL_TEXTURE_RECTANGLE_ARB;
|
||||
texture_w = texture->w;
|
||||
texture_h = texture->h;
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
/* OpenGL shader implementation */
|
||||
|
||||
/*#define DEBUG_SHADERS */
|
||||
/* #define DEBUG_SHADERS */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ Andreas Schiffler -- aschiffler at ferzkopp dot net
|
||||
|
||||
/* ---- Internally used structures */
|
||||
|
||||
/*!
|
||||
/* !
|
||||
\brief A 32 bit RGBA pixel.
|
||||
*/
|
||||
typedef struct tColorRGBA {
|
||||
@@ -52,19 +52,19 @@ typedef struct tColorRGBA {
|
||||
Uint8 a;
|
||||
} tColorRGBA;
|
||||
|
||||
/*!
|
||||
/* !
|
||||
\brief A 8bit Y/palette pixel.
|
||||
*/
|
||||
typedef struct tColorY {
|
||||
Uint8 y;
|
||||
} tColorY;
|
||||
|
||||
/*!
|
||||
/* !
|
||||
\brief Returns maximum of two numbers a and b.
|
||||
*/
|
||||
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
|
||||
|
||||
/*!
|
||||
/* !
|
||||
\brief Number of guard rows added to destination surfaces.
|
||||
|
||||
This is a simple but effective workaround for observed issues.
|
||||
@@ -76,12 +76,12 @@ to a situation where the program can segfault.
|
||||
*/
|
||||
#define GUARD_ROWS (2)
|
||||
|
||||
/*!
|
||||
/* !
|
||||
\brief Lower limit of absolute zoom factor or rotation degrees.
|
||||
*/
|
||||
#define VALUE_LIMIT 0.001
|
||||
|
||||
/*!
|
||||
/* !
|
||||
\brief Returns colorkey info for a surface
|
||||
*/
|
||||
Uint32 _colorkey(SDL_Surface *src)
|
||||
@@ -92,7 +92,7 @@ Uint32 _colorkey(SDL_Surface *src)
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
/* !
|
||||
\brief Internal target surface sizing function for rotations with trig result return.
|
||||
|
||||
\param width The source surface width.
|
||||
@@ -134,7 +134,7 @@ void _rotozoomSurfaceSizeTrig(int width, int height, double angle,
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
/* !
|
||||
\brief Internal 32 bit rotozoomer with optional anti-aliasing.
|
||||
|
||||
Rotates and zooms 32 bit RGBA/ABGR 'src' surface to 'dst' surface based on the control
|
||||
@@ -252,7 +252,7 @@ void _transformSurfaceRGBA(SDL_Surface * src, SDL_Surface * dst, int cx, int cy,
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
/* !
|
||||
|
||||
\brief Rotates and zooms 8 bit palette/Y 'src' surface to 'dst' surface without smoothing.
|
||||
|
||||
@@ -317,7 +317,7 @@ void transformSurfaceY(SDL_Surface * src, SDL_Surface * dst, int cx, int cy, int
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
/* !
|
||||
\brief Rotates and zooms a surface with different horizontal and vertival scaling factors and optional anti-aliasing.
|
||||
|
||||
Rotates a 32bit or 8bit 'src' surface to newly created 'dst' surface.
|
||||
@@ -357,7 +357,7 @@ SDL_Surface *_rotateSurface(SDL_Surface * src, double angle, int centerx, int ce
|
||||
if (src == NULL)
|
||||
return (NULL);
|
||||
|
||||
if (src->flags & SDL_TRUE/*SDL_SRCCOLORKEY */)
|
||||
if (src->flags & SDL_TRUE/* SDL_SRCCOLORKEY */)
|
||||
{
|
||||
colorkey = _colorkey(src);
|
||||
SDL_GetRGB(colorkey, src->format, &r, &g, &b);
|
||||
@@ -391,14 +391,14 @@ SDL_Surface *_rotateSurface(SDL_Surface * src, double angle, int centerx, int ce
|
||||
SDL_BlitSurface(src, NULL, rz_src, NULL);
|
||||
|
||||
if(colorKeyAvailable)
|
||||
SDL_SetColorKey(src, SDL_TRUE /*SDL_SRCCOLORKEY */, colorkey);
|
||||
SDL_SetColorKey(src, SDL_TRUE /* SDL_SRCCOLORKEY */, colorkey);
|
||||
src_converted = 1;
|
||||
is32bit = 1;
|
||||
}
|
||||
|
||||
|
||||
/* Determine target size */
|
||||
/*_rotozoomSurfaceSizeTrig(rz_src->w, rz_src->h, angle, &dstwidth, &dstheight, &cangle, &sangle); */
|
||||
/* _rotozoomSurfaceSizeTrig(rz_src->w, rz_src->h, angle, &dstwidth, &dstheight, &cangle, &sangle); */
|
||||
|
||||
/*
|
||||
* Calculate target factors from sin/cos and zoom
|
||||
@@ -459,8 +459,8 @@ SDL_Surface *_rotateSurface(SDL_Surface * src, double angle, int centerx, int ce
|
||||
/*
|
||||
* Turn on source-alpha support
|
||||
*/
|
||||
/*SDL_SetAlpha(rz_dst, SDL_SRCALPHA, 255); */
|
||||
SDL_SetColorKey(rz_dst, /*SDL_SRCCOLORKEY */ SDL_TRUE | SDL_RLEACCEL, _colorkey(rz_src));
|
||||
/* SDL_SetAlpha(rz_dst, SDL_SRCALPHA, 255); */
|
||||
SDL_SetColorKey(rz_dst, /* SDL_SRCCOLORKEY */ SDL_TRUE | SDL_RLEACCEL, _colorkey(rz_src));
|
||||
} else {
|
||||
/*
|
||||
* Copy palette and colorkey info
|
||||
@@ -475,7 +475,7 @@ SDL_Surface *_rotateSurface(SDL_Surface * src, double angle, int centerx, int ce
|
||||
transformSurfaceY(rz_src, rz_dst, centerx, centery,
|
||||
(int) (sangleinv), (int) (cangleinv),
|
||||
flipx, flipy);
|
||||
SDL_SetColorKey(rz_dst, /*SDL_SRCCOLORKEY */ SDL_TRUE | SDL_RLEACCEL, _colorkey(rz_src));
|
||||
SDL_SetColorKey(rz_dst, /* SDL_SRCCOLORKEY */ SDL_TRUE | SDL_RLEACCEL, _colorkey(rz_src));
|
||||
}
|
||||
/*
|
||||
* Unlock source surface
|
||||
|
||||
@@ -35,10 +35,10 @@ const char *SDLTest_AssertCheckFormat = "Assert '%s': %s";
|
||||
/* Assert summary message format */
|
||||
const char *SDLTest_AssertSummaryFormat = "Assert Summary: Total=%d Passed=%d Failed=%d";
|
||||
|
||||
/*! \brief counts the failed asserts */
|
||||
/* ! \brief counts the failed asserts */
|
||||
static Uint32 SDLTest_AssertsFailed = 0;
|
||||
|
||||
/*! \brief counts the passed asserts */
|
||||
/* ! \brief counts the passed asserts */
|
||||
static Uint32 SDLTest_AssertsPassed = 0;
|
||||
|
||||
/*
|
||||
|
||||
+128
-128
File diff suppressed because it is too large
Load Diff
@@ -173,7 +173,7 @@ SDLTest_RandomIntegerInRange(Sint32 pMin, Sint32 pMax)
|
||||
return (Sint32)((number % ((max + 1) - min)) + min);
|
||||
}
|
||||
|
||||
/*!
|
||||
/* !
|
||||
* Generates a unsigned boundary value between the given boundaries.
|
||||
* Boundary values are inclusive. See the examples below.
|
||||
* If boundary2 < boundary1, the values are swapped.
|
||||
@@ -303,7 +303,7 @@ SDLTest_RandomUint64BoundaryValue(Uint64 boundary1, Uint64 boundary2, SDL_bool v
|
||||
validDomain);
|
||||
}
|
||||
|
||||
/*!
|
||||
/* !
|
||||
* Generates a signed boundary value between the given boundaries.
|
||||
* Boundary values are inclusive. See the examples below.
|
||||
* If boundary2 < boundary1, the values are swapped.
|
||||
|
||||
@@ -37,7 +37,7 @@ const char *SDLTest_LogSummaryFormat = "%s Summary: Total=%d Passed=%d Failed=%d
|
||||
/* Final result message format */
|
||||
const char *SDLTest_FinalResultFormat = ">>> %s '%s': %s\n";
|
||||
|
||||
/*! \brief Timeout for single test case execution */
|
||||
/* ! \brief Timeout for single test case execution */
|
||||
static Uint32 SDLTest_TestCaseTimeout = 3600;
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
#include "SDL_test.h"
|
||||
|
||||
/*!
|
||||
/* !
|
||||
* Converts unix timestamp to its ascii representation in localtime
|
||||
*
|
||||
* Note: Uses a static buffer internally, so the return value
|
||||
|
||||
+17
-17
@@ -97,23 +97,23 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
|
||||
|
||||
/* The Win32 BMP file header (14 bytes) */
|
||||
char magic[2];
|
||||
/*Uint32 bfSize = 0; */
|
||||
/*Uint16 bfReserved1 = 0; */
|
||||
/*Uint16 bfReserved2 = 0; */
|
||||
/* Uint32 bfSize = 0; */
|
||||
/* Uint16 bfReserved1 = 0; */
|
||||
/* Uint16 bfReserved2 = 0; */
|
||||
Uint32 bfOffBits = 0;
|
||||
|
||||
/* The Win32 BITMAPINFOHEADER struct (40 bytes) */
|
||||
Uint32 biSize = 0;
|
||||
Sint32 biWidth = 0;
|
||||
Sint32 biHeight = 0;
|
||||
/*Uint16 biPlanes = 0; */
|
||||
/* Uint16 biPlanes = 0; */
|
||||
Uint16 biBitCount = 0;
|
||||
Uint32 biCompression = 0;
|
||||
/*Uint32 biSizeImage = 0; */
|
||||
/*Sint32 biXPelsPerMeter = 0; */
|
||||
/*Sint32 biYPelsPerMeter = 0; */
|
||||
/* Uint32 biSizeImage = 0; */
|
||||
/* Sint32 biXPelsPerMeter = 0; */
|
||||
/* Sint32 biYPelsPerMeter = 0; */
|
||||
Uint32 biClrUsed = 0;
|
||||
/*Uint32 biClrImportant = 0; */
|
||||
/* Uint32 biClrImportant = 0; */
|
||||
|
||||
/* Make sure we are passed a valid data source */
|
||||
surface = NULL;
|
||||
@@ -136,9 +136,9 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
|
||||
was_error = SDL_TRUE;
|
||||
goto done;
|
||||
}
|
||||
/*bfSize = */ SDL_ReadLE32(src);
|
||||
/*bfReserved1 = */ SDL_ReadLE16(src);
|
||||
/*bfReserved2 = */ SDL_ReadLE16(src);
|
||||
/* bfSize = */ SDL_ReadLE32(src);
|
||||
/* bfReserved1 = */ SDL_ReadLE16(src);
|
||||
/* bfReserved2 = */ SDL_ReadLE16(src);
|
||||
bfOffBits = SDL_ReadLE32(src);
|
||||
|
||||
/* Read the Win32 BITMAPINFOHEADER */
|
||||
@@ -146,20 +146,20 @@ SDL_LoadBMP_RW(SDL_RWops * src, int freesrc)
|
||||
if (biSize == 12) {
|
||||
biWidth = (Uint32) SDL_ReadLE16(src);
|
||||
biHeight = (Uint32) SDL_ReadLE16(src);
|
||||
/*biPlanes = */ SDL_ReadLE16(src);
|
||||
/* biPlanes = */ SDL_ReadLE16(src);
|
||||
biBitCount = SDL_ReadLE16(src);
|
||||
biCompression = BI_RGB;
|
||||
} else {
|
||||
biWidth = SDL_ReadLE32(src);
|
||||
biHeight = SDL_ReadLE32(src);
|
||||
/*biPlanes = */ SDL_ReadLE16(src);
|
||||
/* biPlanes = */ SDL_ReadLE16(src);
|
||||
biBitCount = SDL_ReadLE16(src);
|
||||
biCompression = SDL_ReadLE32(src);
|
||||
/*biSizeImage = */ SDL_ReadLE32(src);
|
||||
/*biXPelsPerMeter = */ SDL_ReadLE32(src);
|
||||
/*biYPelsPerMeter = */ SDL_ReadLE32(src);
|
||||
/* biSizeImage = */ SDL_ReadLE32(src);
|
||||
/* biXPelsPerMeter = */ SDL_ReadLE32(src);
|
||||
/* biYPelsPerMeter = */ SDL_ReadLE32(src);
|
||||
biClrUsed = SDL_ReadLE32(src);
|
||||
/*biClrImportant = */ SDL_ReadLE32(src);
|
||||
/* biClrImportant = */ SDL_ReadLE32(src);
|
||||
}
|
||||
if (biHeight < 0) {
|
||||
topDown = SDL_TRUE;
|
||||
|
||||
@@ -119,7 +119,7 @@ SDL_FillRect1SSE(Uint8 *pixels, int pitch, Uint32 color, int w, int h)
|
||||
|
||||
SSE_END;
|
||||
}
|
||||
/*DEFINE_SSE_FILLRECT(1, Uint8) */
|
||||
/* DEFINE_SSE_FILLRECT(1, Uint8) */
|
||||
DEFINE_SSE_FILLRECT(2, Uint16)
|
||||
DEFINE_SSE_FILLRECT(4, Uint32)
|
||||
|
||||
@@ -212,7 +212,7 @@ SDL_FillRect1MMX(Uint8 *pixels, int pitch, Uint32 color, int w, int h)
|
||||
|
||||
MMX_END;
|
||||
}
|
||||
/*DEFINE_MMX_FILLRECT(1, Uint8) */
|
||||
/* DEFINE_MMX_FILLRECT(1, Uint8) */
|
||||
DEFINE_MMX_FILLRECT(2, Uint16)
|
||||
DEFINE_MMX_FILLRECT(4, Uint32)
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user