mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-28 10:14:14 +00:00
Updated source to match SDL function prototype style
This commit is contained in:
@@ -506,8 +506,7 @@ static void Blit4bto4Key(SDL_BlitInfo *info)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_BlitFunc
|
||||
SDL_CalculateBlit0(SDL_Surface *surface)
|
||||
SDL_BlitFunc SDL_CalculateBlit0(SDL_Surface *surface)
|
||||
{
|
||||
int which;
|
||||
|
||||
|
||||
@@ -512,8 +512,7 @@ static const SDL_BlitFunc one_blitkey[] = {
|
||||
(SDL_BlitFunc)NULL, Blit1to1Key, Blit1to2Key, Blit1to3Key, Blit1to4Key
|
||||
};
|
||||
|
||||
SDL_BlitFunc
|
||||
SDL_CalculateBlit1(SDL_Surface *surface)
|
||||
SDL_BlitFunc SDL_CalculateBlit1(SDL_Surface *surface)
|
||||
{
|
||||
int which;
|
||||
SDL_PixelFormat *dstfmt;
|
||||
|
||||
@@ -1316,8 +1316,7 @@ static void BlitNtoNPixelAlpha(SDL_BlitInfo *info)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_BlitFunc
|
||||
SDL_CalculateBlitA(SDL_Surface *surface)
|
||||
SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface)
|
||||
{
|
||||
SDL_PixelFormat *sf = surface->format;
|
||||
SDL_PixelFormat *df = surface->map->dst->format;
|
||||
|
||||
@@ -48,8 +48,7 @@ enum blit_features
|
||||
#ifdef SDL_ALTIVEC_BLITTERS
|
||||
#ifdef __MACOS__
|
||||
#include <sys/sysctl.h>
|
||||
static size_t
|
||||
GetL3CacheSize(void)
|
||||
static size_t GetL3CacheSize(void)
|
||||
{
|
||||
const char key[] = "hw.l3cachesize";
|
||||
u_int64_t result = 0;
|
||||
@@ -63,8 +62,7 @@ GetL3CacheSize(void)
|
||||
return result;
|
||||
}
|
||||
#else
|
||||
static size_t
|
||||
GetL3CacheSize(void)
|
||||
static size_t GetL3CacheSize(void)
|
||||
{
|
||||
/* XXX: Just guess G4 */
|
||||
return 2097152;
|
||||
@@ -3336,8 +3334,7 @@ static const struct blit_table *const normal_blit[] = {
|
||||
/* Mask matches table, or table entry is zero */
|
||||
#define MASKOK(x, y) (((x) == (y)) || ((y) == 0x00000000))
|
||||
|
||||
SDL_BlitFunc
|
||||
SDL_CalculateBlitN(SDL_Surface *surface)
|
||||
SDL_BlitFunc SDL_CalculateBlitN(SDL_Surface *surface)
|
||||
{
|
||||
SDL_PixelFormat *srcfmt;
|
||||
SDL_PixelFormat *dstfmt;
|
||||
|
||||
@@ -193,8 +193,7 @@ static void CorrectAlphaChannel(SDL_Surface *surface)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_Surface *
|
||||
SDL_LoadBMP_RW(SDL_RWops *src, int freesrc)
|
||||
SDL_Surface *SDL_LoadBMP_RW(SDL_RWops *src, int freesrc)
|
||||
{
|
||||
SDL_bool was_error;
|
||||
Sint64 fp_offset = 0;
|
||||
|
||||
@@ -22,8 +22,7 @@
|
||||
|
||||
#include "SDL_sysvideo.h"
|
||||
|
||||
int
|
||||
SDL_SetClipboardData(SDL_ClipboardDataCallback callback, size_t mime_count, const char **mime_types, void *userdata)
|
||||
int SDL_SetClipboardData(SDL_ClipboardDataCallback callback, size_t mime_count, const char **mime_types, void *userdata)
|
||||
{
|
||||
SDL_VideoDevice *_this = SDL_GetVideoDevice();
|
||||
|
||||
@@ -93,8 +92,7 @@ void *SDL_GetClipboardData(size_t *length, const char *mime_type)
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetClipboardText(void)
|
||||
char *SDL_GetClipboardText(void)
|
||||
{
|
||||
SDL_VideoDevice *_this = SDL_GetVideoDevice();
|
||||
|
||||
@@ -114,8 +112,7 @@ SDL_GetClipboardText(void)
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
SDL_GetPrimarySelectionText(void)
|
||||
char *SDL_GetPrimarySelectionText(void)
|
||||
{
|
||||
SDL_VideoDevice *_this = SDL_GetVideoDevice();
|
||||
|
||||
@@ -135,8 +132,7 @@ SDL_GetPrimarySelectionText(void)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasClipboardData(const char *mime_type)
|
||||
SDL_bool SDL_HasClipboardData(const char *mime_type)
|
||||
{
|
||||
SDL_VideoDevice *_this = SDL_GetVideoDevice();
|
||||
if (_this == NULL) {
|
||||
@@ -150,8 +146,7 @@ SDL_HasClipboardData(const char *mime_type)
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasClipboardText(void)
|
||||
SDL_bool SDL_HasClipboardText(void)
|
||||
{
|
||||
SDL_VideoDevice *_this = SDL_GetVideoDevice();
|
||||
|
||||
@@ -171,8 +166,7 @@ SDL_HasClipboardText(void)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_HasPrimarySelectionText(void)
|
||||
SDL_bool SDL_HasPrimarySelectionText(void)
|
||||
{
|
||||
SDL_VideoDevice *_this = SDL_GetVideoDevice();
|
||||
|
||||
|
||||
@@ -949,8 +949,7 @@ int SDL_EGL_ChooseConfig(SDL_VideoDevice *_this)
|
||||
return SDL_EGL_SetError("Couldn't find matching EGL config", "eglChooseConfig");
|
||||
}
|
||||
|
||||
SDL_GLContext
|
||||
SDL_EGL_CreateContext(SDL_VideoDevice *_this, EGLSurface egl_surface)
|
||||
SDL_GLContext SDL_EGL_CreateContext(SDL_VideoDevice *_this, EGLSurface egl_surface)
|
||||
{
|
||||
/* max 16 key+value pairs plus terminator. */
|
||||
EGLint attribs[33];
|
||||
@@ -1217,8 +1216,7 @@ int SDL_EGL_DeleteContext(SDL_VideoDevice *_this, SDL_GLContext context)
|
||||
return 0;
|
||||
}
|
||||
|
||||
EGLSurface *
|
||||
SDL_EGL_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, NativeWindowType nw)
|
||||
EGLSurface *SDL_EGL_CreateSurface(SDL_VideoDevice *_this, SDL_Window *window, NativeWindowType nw)
|
||||
{
|
||||
#ifdef SDL_VIDEO_DRIVER_ANDROID
|
||||
EGLint format_wanted;
|
||||
|
||||
@@ -83,8 +83,7 @@ Uint8 *SDL_expand_byte[9] = {
|
||||
#define CASE(X) \
|
||||
case X: \
|
||||
return #X;
|
||||
const char *
|
||||
SDL_GetPixelFormatName(Uint32 format)
|
||||
const char *SDL_GetPixelFormatName(Uint32 format)
|
||||
{
|
||||
switch (format) {
|
||||
|
||||
@@ -134,9 +133,8 @@ SDL_GetPixelFormatName(Uint32 format)
|
||||
}
|
||||
#undef CASE
|
||||
|
||||
SDL_bool
|
||||
SDL_GetMasksForPixelFormatEnum(Uint32 format, int *bpp, Uint32 *Rmask,
|
||||
Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask)
|
||||
SDL_bool SDL_GetMasksForPixelFormatEnum(Uint32 format, int *bpp, Uint32 *Rmask,
|
||||
Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask)
|
||||
{
|
||||
Uint32 masks[4];
|
||||
|
||||
@@ -509,8 +507,7 @@ Uint32 SDL_GetPixelFormatEnumForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint3
|
||||
static SDL_PixelFormat *formats;
|
||||
static SDL_SpinLock formats_lock = 0;
|
||||
|
||||
SDL_PixelFormat *
|
||||
SDL_CreatePixelFormat(Uint32 pixel_format)
|
||||
SDL_PixelFormat *SDL_CreatePixelFormat(Uint32 pixel_format)
|
||||
{
|
||||
SDL_PixelFormat *format;
|
||||
|
||||
@@ -657,8 +654,7 @@ void SDL_DestroyPixelFormat(SDL_PixelFormat *format)
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_Palette *
|
||||
SDL_CreatePalette(int ncolors)
|
||||
SDL_Palette *SDL_CreatePalette(int ncolors)
|
||||
{
|
||||
SDL_Palette *palette;
|
||||
|
||||
@@ -998,8 +994,7 @@ static Uint8 *MapNto1(SDL_PixelFormat *src, SDL_PixelFormat *dst, int *identical
|
||||
return Map1to1(&dithered, pal, identical);
|
||||
}
|
||||
|
||||
SDL_BlitMap *
|
||||
SDL_AllocBlitMap(void)
|
||||
SDL_BlitMap *SDL_AllocBlitMap(void)
|
||||
{
|
||||
SDL_BlitMap *map;
|
||||
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
|
||||
/* There's no float version of this at the moment, because it's not a public API
|
||||
and internally we only need the int version. */
|
||||
SDL_bool
|
||||
SDL_GetSpanEnclosingRect(int width, int height,
|
||||
SDL_bool SDL_GetSpanEnclosingRect(int width, int height,
|
||||
int numrects, const SDL_Rect *rects, SDL_Rect *span)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -21,8 +21,7 @@
|
||||
|
||||
/* This file is #included twice to support int and float versions with the same code. */
|
||||
|
||||
SDL_bool
|
||||
SDL_HASINTERSECTION(const RECTTYPE *A, const RECTTYPE *B)
|
||||
SDL_bool SDL_HASINTERSECTION(const RECTTYPE *A, const RECTTYPE *B)
|
||||
{
|
||||
SCALARTYPE Amin, Amax, Bmin, Bmax;
|
||||
|
||||
@@ -67,8 +66,7 @@ SDL_HASINTERSECTION(const RECTTYPE *A, const RECTTYPE *B)
|
||||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_INTERSECTRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result)
|
||||
SDL_bool SDL_INTERSECTRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result)
|
||||
{
|
||||
SCALARTYPE Amin, Amax, Bmin, Bmax;
|
||||
|
||||
@@ -287,9 +285,7 @@ static int COMPUTEOUTCODE(const RECTTYPE *rect, SCALARTYPE x, SCALARTYPE y)
|
||||
return code;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_INTERSECTRECTANDLINE(const RECTTYPE *rect, SCALARTYPE *X1, SCALARTYPE *Y1, SCALARTYPE *X2,
|
||||
SCALARTYPE *Y2)
|
||||
SDL_bool SDL_INTERSECTRECTANDLINE(const RECTTYPE *rect, SCALARTYPE *X1, SCALARTYPE *Y1, SCALARTYPE *X2, SCALARTYPE *Y2)
|
||||
{
|
||||
SCALARTYPE x = 0;
|
||||
SCALARTYPE y = 0;
|
||||
|
||||
@@ -23,8 +23,7 @@
|
||||
#include "SDL_sysvideo.h"
|
||||
#include "SDL_shape_internals.h"
|
||||
|
||||
SDL_Window *
|
||||
SDL_CreateShapedWindow(const char *title, int w, int h, Uint32 flags)
|
||||
SDL_Window *SDL_CreateShapedWindow(const char *title, int w, int h, Uint32 flags)
|
||||
{
|
||||
SDL_Window *result = NULL;
|
||||
result = SDL_CreateWindow(title, w, h, (flags | SDL_WINDOW_BORDERLESS | SDL_WINDOW_HIDDEN) & (~SDL_WINDOW_FULLSCREEN) & (~SDL_WINDOW_RESIZABLE));
|
||||
@@ -47,8 +46,7 @@ SDL_CreateShapedWindow(const char *title, int w, int h, Uint32 flags)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_IsShapedWindow(const SDL_Window *window)
|
||||
SDL_bool SDL_IsShapedWindow(const SDL_Window *window)
|
||||
{
|
||||
if (window == NULL) {
|
||||
return SDL_FALSE;
|
||||
@@ -210,8 +208,7 @@ static SDL_ShapeTree *RecursivelyCalculateShapeTree(SDL_WindowShapeMode mode, SD
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_ShapeTree *
|
||||
SDL_CalculateShapeTree(SDL_WindowShapeMode mode, SDL_Surface *shape)
|
||||
SDL_ShapeTree *SDL_CalculateShapeTree(SDL_WindowShapeMode mode, SDL_Surface *shape)
|
||||
{
|
||||
SDL_Rect dimensions;
|
||||
SDL_ShapeTree *result = NULL;
|
||||
|
||||
@@ -191,8 +191,7 @@ static int SDL_UpperSoftStretch(SDL_Surface *src, const SDL_Rect *srcrect,
|
||||
// OK with clang 12.0.0 / Xcode
|
||||
__attribute__((noinline))
|
||||
#endif
|
||||
static void
|
||||
get_scaler_datas(int src_nb, int dst_nb, int *fp_start, int *fp_step, int *left_pad, int *right_pad)
|
||||
static void get_scaler_datas(int src_nb, int dst_nb, int *fp_start, int *fp_step, int *left_pad, int *right_pad)
|
||||
{
|
||||
|
||||
int step = FIXED_POINT(src_nb) / (dst_nb); /* source step in fixed point */
|
||||
@@ -568,8 +567,7 @@ static SDL_INLINE void INTERPOL_BILINEAR_NEON(const Uint32 *s0, const Uint32 *s1
|
||||
*dst = vget_lane_u32(CAST_uint32x2_t e0, 0);
|
||||
}
|
||||
|
||||
static int
|
||||
scale_mat_NEON(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *dst, int dst_w, int dst_h, int dst_pitch)
|
||||
static int scale_mat_NEON(const Uint32 *src, int src_w, int src_h, int src_pitch, Uint32 *dst, int dst_w, int dst_h, int dst_pitch)
|
||||
{
|
||||
BILINEAR___START
|
||||
|
||||
|
||||
@@ -42,8 +42,7 @@ SDL_COMPILE_TIME_ASSERT(can_indicate_overflow, SDL_SIZE_MAX > SDL_MAX_SINT32);
|
||||
*
|
||||
* for FOURCC, use SDL_CalculateYUVSize()
|
||||
*/
|
||||
static int
|
||||
SDL_CalculateRGBSize(Uint32 format, size_t width, size_t height, size_t *size, size_t *pitch, SDL_bool minimal)
|
||||
static int SDL_CalculateRGBSize(Uint32 format, size_t width, size_t height, size_t *size, size_t *pitch, SDL_bool minimal)
|
||||
{
|
||||
if (SDL_BITSPERPIXEL(format) >= 8) {
|
||||
if (SDL_size_mul_overflow(width, SDL_BYTESPERPIXEL(format), pitch)) {
|
||||
@@ -113,8 +112,7 @@ int SDL_CalculateSize(Uint32 format, int width, int height, size_t *size, size_t
|
||||
* Create an empty RGB surface of the appropriate depth using the given
|
||||
* enum SDL_PIXELFORMAT_* format
|
||||
*/
|
||||
SDL_Surface *
|
||||
SDL_CreateSurface(int width, int height, Uint32 format)
|
||||
SDL_Surface *SDL_CreateSurface(int width, int height, Uint32 format)
|
||||
{
|
||||
size_t pitch, size;
|
||||
SDL_Surface *surface;
|
||||
@@ -206,8 +204,7 @@ SDL_CreateSurface(int width, int height, Uint32 format)
|
||||
* Create an RGB surface from an existing memory buffer using the given given
|
||||
* enum SDL_PIXELFORMAT_* format
|
||||
*/
|
||||
SDL_Surface *
|
||||
SDL_CreateSurfaceFrom(void *pixels,
|
||||
SDL_Surface *SDL_CreateSurfaceFrom(void *pixels,
|
||||
int width, int height, int pitch,
|
||||
Uint32 format)
|
||||
{
|
||||
@@ -285,8 +282,7 @@ int SDL_SetSurfaceRLE(SDL_Surface *surface, int flag)
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_SurfaceHasRLE(SDL_Surface *surface)
|
||||
SDL_bool SDL_SurfaceHasRLE(SDL_Surface *surface)
|
||||
{
|
||||
if (surface == NULL) {
|
||||
return SDL_FALSE;
|
||||
@@ -329,8 +325,7 @@ int SDL_SetSurfaceColorKey(SDL_Surface *surface, int flag, Uint32 key)
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_SurfaceHasColorKey(SDL_Surface *surface)
|
||||
SDL_bool SDL_SurfaceHasColorKey(SDL_Surface *surface)
|
||||
{
|
||||
if (surface == NULL) {
|
||||
return SDL_FALSE;
|
||||
@@ -595,8 +590,7 @@ int SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode)
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect)
|
||||
SDL_bool SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect)
|
||||
{
|
||||
SDL_Rect full_rect;
|
||||
|
||||
@@ -1087,8 +1081,7 @@ void SDL_UnlockSurface(SDL_Surface *surface)
|
||||
/*
|
||||
* Creates a new surface identical to the existing surface
|
||||
*/
|
||||
SDL_Surface *
|
||||
SDL_DuplicateSurface(SDL_Surface *surface)
|
||||
SDL_Surface *SDL_DuplicateSurface(SDL_Surface *surface)
|
||||
{
|
||||
return SDL_ConvertSurface(surface, surface->format);
|
||||
}
|
||||
@@ -1096,8 +1089,7 @@ SDL_DuplicateSurface(SDL_Surface *surface)
|
||||
/*
|
||||
* Convert a surface into the specified pixel format.
|
||||
*/
|
||||
SDL_Surface *
|
||||
SDL_ConvertSurface(SDL_Surface *surface, const SDL_PixelFormat *format)
|
||||
SDL_Surface *SDL_ConvertSurface(SDL_Surface *surface, const SDL_PixelFormat *format)
|
||||
{
|
||||
SDL_Surface *convert;
|
||||
Uint32 copy_flags;
|
||||
@@ -1350,8 +1342,7 @@ end:
|
||||
return convert;
|
||||
}
|
||||
|
||||
SDL_Surface *
|
||||
SDL_ConvertSurfaceFormat(SDL_Surface *surface, Uint32 pixel_format)
|
||||
SDL_Surface *SDL_ConvertSurfaceFormat(SDL_Surface *surface, Uint32 pixel_format)
|
||||
{
|
||||
SDL_PixelFormat *fmt;
|
||||
SDL_Surface *convert = NULL;
|
||||
|
||||
@@ -31,8 +31,7 @@ int Android_SetClipboardText(SDL_VideoDevice *_this, const char *text)
|
||||
return Android_JNI_SetClipboardText(text);
|
||||
}
|
||||
|
||||
char *
|
||||
Android_GetClipboardText(SDL_VideoDevice *_this)
|
||||
char *Android_GetClipboardText(SDL_VideoDevice *_this)
|
||||
{
|
||||
return Android_JNI_GetClipboardText();
|
||||
}
|
||||
|
||||
@@ -44,8 +44,7 @@ int Android_GLES_MakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLC
|
||||
}
|
||||
}
|
||||
|
||||
SDL_GLContext
|
||||
Android_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
SDL_GLContext Android_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
SDL_GLContext ret;
|
||||
|
||||
|
||||
@@ -336,14 +336,12 @@ int Android_OnKeyUp(int keycode)
|
||||
return SDL_SendKeyboardKey(0, SDL_RELEASED, TranslateKeycode(keycode));
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
Android_HasScreenKeyboardSupport(SDL_VideoDevice *_this)
|
||||
SDL_bool Android_HasScreenKeyboardSupport(SDL_VideoDevice *_this)
|
||||
{
|
||||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
Android_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
SDL_bool Android_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
return Android_JNI_IsScreenKeyboardShown();
|
||||
}
|
||||
|
||||
@@ -92,8 +92,7 @@ int Cocoa_SetClipboardText(SDL_VideoDevice *_this, const char *text)
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
Cocoa_GetClipboardText(SDL_VideoDevice *_this)
|
||||
char *Cocoa_GetClipboardText(SDL_VideoDevice *_this)
|
||||
{
|
||||
@autoreleasepool {
|
||||
NSPasteboard *pasteboard;
|
||||
@@ -122,8 +121,7 @@ Cocoa_GetClipboardText(SDL_VideoDevice *_this)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
Cocoa_HasClipboardText(SDL_VideoDevice *_this)
|
||||
SDL_bool Cocoa_HasClipboardText(SDL_VideoDevice *_this)
|
||||
{
|
||||
SDL_bool result = SDL_FALSE;
|
||||
char *text = Cocoa_GetClipboardText(_this);
|
||||
|
||||
@@ -57,8 +57,7 @@ int Cocoa_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path)
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_GLContext
|
||||
Cocoa_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
SDL_GLContext Cocoa_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
@autoreleasepool {
|
||||
SDL_GLContext context;
|
||||
@@ -147,8 +146,7 @@ int Cocoa_GLES_SetupWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_EGLSurface
|
||||
Cocoa_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
SDL_EGLSurface Cocoa_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
@autoreleasepool {
|
||||
return ((__bridge SDL_CocoaWindowData *)window->driverdata).egl_surface;
|
||||
|
||||
@@ -38,8 +38,7 @@
|
||||
@implementation SDL_CocoaClosure
|
||||
@end
|
||||
|
||||
SDL_WindowShaper *
|
||||
Cocoa_CreateShaper(SDL_Window *window)
|
||||
SDL_WindowShaper *Cocoa_CreateShaper(SDL_Window *window)
|
||||
{
|
||||
@autoreleasepool {
|
||||
SDL_WindowShaper *result;
|
||||
|
||||
@@ -2483,8 +2483,7 @@ int Cocoa_GetWindowWMInfo(SDL_VideoDevice *_this, SDL_Window *window, SDL_SysWMi
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
Cocoa_IsWindowInFullscreenSpace(SDL_Window *window)
|
||||
SDL_bool Cocoa_IsWindowInFullscreenSpace(SDL_Window *window)
|
||||
{
|
||||
@autoreleasepool {
|
||||
SDL_CocoaWindowData *data = (__bridge SDL_CocoaWindowData *)window->driverdata;
|
||||
@@ -2497,8 +2496,7 @@ Cocoa_IsWindowInFullscreenSpace(SDL_Window *window)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
Cocoa_SetWindowFullscreenSpace(SDL_Window *window, SDL_bool state)
|
||||
SDL_bool Cocoa_SetWindowFullscreenSpace(SDL_Window *window, SDL_bool state)
|
||||
{
|
||||
@autoreleasepool {
|
||||
SDL_bool succeeded = SDL_FALSE;
|
||||
|
||||
@@ -346,8 +346,7 @@ protected:
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int
|
||||
HAIKU_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
|
||||
int HAIKU_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid)
|
||||
{
|
||||
// Initialize button by closed or error value first.
|
||||
*buttonid = G_CLOSE_BUTTON_ID;
|
||||
|
||||
@@ -349,8 +349,7 @@ static void KMSDRM_FBDestroyCallback(struct gbm_bo *bo, void *data)
|
||||
SDL_free(fb_info);
|
||||
}
|
||||
|
||||
KMSDRM_FBInfo *
|
||||
KMSDRM_FBFromBO(SDL_VideoDevice *_this, struct gbm_bo *bo)
|
||||
KMSDRM_FBInfo *KMSDRM_FBFromBO(SDL_VideoDevice *_this, struct gbm_bo *bo)
|
||||
{
|
||||
SDL_VideoData *viddata = _this->driverdata;
|
||||
unsigned w, h;
|
||||
@@ -401,8 +400,7 @@ static void KMSDRM_FlipHandler(int fd, unsigned int frame, unsigned int sec, uns
|
||||
*((SDL_bool *)data) = SDL_FALSE;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
KMSDRM_WaitPageflip(SDL_VideoDevice *_this, SDL_WindowData *windata)
|
||||
SDL_bool KMSDRM_WaitPageflip(SDL_VideoDevice *_this, SDL_WindowData *windata)
|
||||
{
|
||||
|
||||
SDL_VideoData *viddata = _this->driverdata;
|
||||
|
||||
@@ -33,12 +33,12 @@ typedef struct
|
||||
int width, height;
|
||||
} Dimensions;
|
||||
|
||||
SDL_FORCE_INLINE void FreePreviousWindowFramebuffer(SDL_Window *window);
|
||||
SDL_FORCE_INLINE SDL_Surface *CreateNewWindowFramebuffer(SDL_Window *window);
|
||||
SDL_FORCE_INLINE void CopyFramebuffertoN3DS(u32 *dest, const Dimensions dest_dim, const u32 *source, const Dimensions source_dim);
|
||||
SDL_FORCE_INLINE int GetDestOffset(int x, int y, int dest_width);
|
||||
SDL_FORCE_INLINE int GetSourceOffset(int x, int y, int source_width);
|
||||
SDL_FORCE_INLINE void FlushN3DSBuffer(const void *buffer, u32 bufsize, gfxScreen_t screen);
|
||||
static void FreePreviousWindowFramebuffer(SDL_Window *window);
|
||||
static SDL_Surface *CreateNewWindowFramebuffer(SDL_Window *window);
|
||||
static void CopyFramebuffertoN3DS(u32 *dest, const Dimensions dest_dim, const u32 *source, const Dimensions source_dim);
|
||||
static int GetDestOffset(int x, int y, int dest_width);
|
||||
static int GetSourceOffset(int x, int y, int source_width);
|
||||
static void FlushN3DSBuffer(const void *buffer, u32 bufsize, gfxScreen_t screen);
|
||||
|
||||
int SDL_N3DS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
|
||||
{
|
||||
@@ -58,15 +58,13 @@ int SDL_N3DS_CreateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window,
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_FORCE_INLINE void
|
||||
FreePreviousWindowFramebuffer(SDL_Window *window)
|
||||
static void FreePreviousWindowFramebuffer(SDL_Window *window)
|
||||
{
|
||||
SDL_Surface *surface = (SDL_Surface *)SDL_GetWindowData(window, N3DS_SURFACE);
|
||||
SDL_DestroySurface(surface);
|
||||
}
|
||||
|
||||
SDL_FORCE_INLINE SDL_Surface *
|
||||
CreateNewWindowFramebuffer(SDL_Window *window)
|
||||
static SDL_Surface *CreateNewWindowFramebuffer(SDL_Window *window)
|
||||
{
|
||||
int w, h;
|
||||
SDL_GetWindowSizeInPixels(window, &w, &h);
|
||||
@@ -97,8 +95,7 @@ int SDL_N3DS_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window,
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_FORCE_INLINE void
|
||||
CopyFramebuffertoN3DS(u32 *dest, const Dimensions dest_dim, const u32 *source, const Dimensions source_dim)
|
||||
static void CopyFramebuffertoN3DS(u32 *dest, const Dimensions dest_dim, const u32 *source, const Dimensions source_dim)
|
||||
{
|
||||
int rows = SDL_min(dest_dim.width, source_dim.height);
|
||||
int cols = SDL_min(dest_dim.height, source_dim.width);
|
||||
@@ -112,20 +109,17 @@ CopyFramebuffertoN3DS(u32 *dest, const Dimensions dest_dim, const u32 *source, c
|
||||
}
|
||||
}
|
||||
|
||||
SDL_FORCE_INLINE int
|
||||
GetDestOffset(int x, int y, int dest_width)
|
||||
static int GetDestOffset(int x, int y, int dest_width)
|
||||
{
|
||||
return dest_width - y - 1 + dest_width * x;
|
||||
}
|
||||
|
||||
SDL_FORCE_INLINE int
|
||||
GetSourceOffset(int x, int y, int source_width)
|
||||
static int GetSourceOffset(int x, int y, int source_width)
|
||||
{
|
||||
return x + y * source_width;
|
||||
}
|
||||
|
||||
SDL_FORCE_INLINE void
|
||||
FlushN3DSBuffer(const void *buffer, u32 bufsize, gfxScreen_t screen)
|
||||
static void FlushN3DSBuffer(const void *buffer, u32 bufsize, gfxScreen_t screen)
|
||||
{
|
||||
GSPGPU_FlushDataCache(buffer, bufsize);
|
||||
gfxScreenSwapBuffers(screen, false);
|
||||
|
||||
@@ -45,8 +45,7 @@ void N3DS_SwkbQuit()
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
N3DS_HasScreenKeyboardSupport(SDL_VideoDevice *_this)
|
||||
SDL_bool N3DS_HasScreenKeyboardSupport(SDL_VideoDevice *_this)
|
||||
{
|
||||
return SDL_TRUE;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#define N3DSVID_DRIVER_NAME "n3ds"
|
||||
|
||||
SDL_FORCE_INLINE int AddN3DSDisplay(gfxScreen_t screen);
|
||||
static int AddN3DSDisplay(gfxScreen_t screen);
|
||||
|
||||
static int N3DS_VideoInit(SDL_VideoDevice *_this);
|
||||
static void N3DS_VideoQuit(SDL_VideoDevice *_this);
|
||||
|
||||
@@ -54,8 +54,7 @@ int OFFSCREEN_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path)
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_GLContext
|
||||
OFFSCREEN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
SDL_GLContext OFFSCREEN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
SDL_WindowData *offscreen_window = window->driverdata;
|
||||
|
||||
|
||||
@@ -30,8 +30,7 @@ static EGLDisplay egl_disp;
|
||||
* @param egl_conf EGL configuration to use
|
||||
* @return A SCREEN_FORMAT* constant for the pixel format to use
|
||||
*/
|
||||
static int
|
||||
chooseFormat(EGLConfig egl_conf)
|
||||
static int chooseFormat(EGLConfig egl_conf)
|
||||
{
|
||||
EGLint buffer_bit_depth;
|
||||
EGLint alpha_bit_depth;
|
||||
@@ -64,8 +63,7 @@ chooseFormat(EGLConfig egl_conf)
|
||||
* @param[out] pformat The chosen pixel format
|
||||
* @return 0 if successful, -1 on error
|
||||
*/
|
||||
int
|
||||
glGetConfig(EGLConfig *pconf, int *pformat)
|
||||
int glGetConfig(EGLConfig *pconf, int *pformat)
|
||||
{
|
||||
EGLConfig egl_conf = (EGLConfig)0;
|
||||
EGLConfig *egl_configs;
|
||||
@@ -132,8 +130,7 @@ glGetConfig(EGLConfig *pconf, int *pformat)
|
||||
* @param name unused
|
||||
* @return 0 if successful, -1 on error
|
||||
*/
|
||||
int
|
||||
glLoadLibrary(SDL_VideoDevice *_this, const char *name)
|
||||
int glLoadLibrary(SDL_VideoDevice *_this, const char *name)
|
||||
{
|
||||
EGLNativeDisplayType disp_id = EGL_DEFAULT_DISPLAY;
|
||||
|
||||
@@ -154,8 +151,7 @@ glLoadLibrary(SDL_VideoDevice *_this, const char *name)
|
||||
* @param proc Function name
|
||||
* @return Function address
|
||||
*/
|
||||
SDL_FunctionPointer
|
||||
glGetProcAddress(SDL_VideoDevice *_this, const char *proc)
|
||||
SDL_FunctionPointer glGetProcAddress(SDL_VideoDevice *_this, const char *proc)
|
||||
{
|
||||
return eglGetProcAddress(proc);
|
||||
}
|
||||
@@ -167,8 +163,7 @@ glGetProcAddress(SDL_VideoDevice *_this, const char *proc)
|
||||
* @param window The SDL window to create the context for
|
||||
* @return A pointer to the created context, if successful, NULL on error
|
||||
*/
|
||||
SDL_GLContext
|
||||
glCreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
SDL_GLContext glCreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
window_impl_t *impl = (window_impl_t *)window->driverdata;
|
||||
EGLContext context;
|
||||
@@ -215,8 +210,7 @@ glCreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
* @param interval New interval value
|
||||
* @return 0 if successful, -1 on error
|
||||
*/
|
||||
int
|
||||
glSetSwapInterval(SDL_VideoDevice *_this, int interval)
|
||||
int glSetSwapInterval(SDL_VideoDevice *_this, int interval)
|
||||
{
|
||||
if (eglSwapInterval(egl_disp, interval) != EGL_TRUE) {
|
||||
return -1;
|
||||
@@ -231,8 +225,7 @@ glSetSwapInterval(SDL_VideoDevice *_this, int interval)
|
||||
* @param window Window to swap buffers for
|
||||
* @return 0 if successful, -1 on error
|
||||
*/
|
||||
int
|
||||
glSwapWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
int glSwapWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
/* !!! FIXME: should we migrate this all over to use SDL_egl.c? */
|
||||
window_impl_t *impl = (window_impl_t *)window->driverdata;
|
||||
@@ -246,8 +239,7 @@ glSwapWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
* @param context The context to activate
|
||||
* @return 0 if successful, -1 on error
|
||||
*/
|
||||
int
|
||||
glMakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context)
|
||||
int glMakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context)
|
||||
{
|
||||
window_impl_t *impl;
|
||||
EGLSurface surface = NULL;
|
||||
@@ -269,8 +261,7 @@ glMakeCurrent(SDL_VideoDevice *_this, SDL_Window *window, SDL_GLContext context)
|
||||
* @param SDL_VideoDevice *_this
|
||||
* @param context The context to destroy
|
||||
*/
|
||||
void
|
||||
glDeleteContext(SDL_VideoDevice *_this, SDL_GLContext context)
|
||||
void glDeleteContext(SDL_VideoDevice *_this, SDL_GLContext context)
|
||||
{
|
||||
eglDestroyContext(egl_disp, context);
|
||||
}
|
||||
@@ -279,8 +270,7 @@ glDeleteContext(SDL_VideoDevice *_this, SDL_GLContext context)
|
||||
* Terminates access to the EGL library.
|
||||
* @param SDL_VideoDevice *_this
|
||||
*/
|
||||
void
|
||||
glUnloadLibrary(SDL_VideoDevice *_this)
|
||||
void glUnloadLibrary(SDL_VideoDevice *_this)
|
||||
{
|
||||
eglTerminate(egl_disp);
|
||||
}
|
||||
|
||||
@@ -95,8 +95,7 @@ static int key_to_sdl[] = {
|
||||
* Translates the event such that it can be handled by SDL.
|
||||
* @param event Screen keyboard event
|
||||
*/
|
||||
void
|
||||
handleKeyboardEvent(screen_event_t event)
|
||||
void handleKeyboardEvent(screen_event_t event)
|
||||
{
|
||||
int val;
|
||||
SDL_Scancode scancode;
|
||||
|
||||
@@ -32,8 +32,7 @@ static screen_event_t event;
|
||||
* @param SDL_VideoDevice *_this
|
||||
* @return 0 if successful, -1 on error
|
||||
*/
|
||||
static int
|
||||
videoInit(SDL_VideoDevice *_this)
|
||||
static int videoInit(SDL_VideoDevice *_this)
|
||||
{
|
||||
SDL_VideoDisplay display;
|
||||
|
||||
@@ -55,8 +54,7 @@ videoInit(SDL_VideoDevice *_this)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
videoQuit(SDL_VideoDevice *_this)
|
||||
static void videoQuit(SDL_VideoDevice *_this)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -67,8 +65,7 @@ videoQuit(SDL_VideoDevice *_this)
|
||||
* @param window SDL window to initialize
|
||||
* @return 0 if successful, -1 on error
|
||||
*/
|
||||
static int
|
||||
createWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
static int createWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
window_impl_t *impl;
|
||||
int size[2];
|
||||
@@ -150,8 +147,7 @@ fail:
|
||||
* @param[out] pitch Holds the number of bytes per line
|
||||
* @return 0 if successful, -1 on error
|
||||
*/
|
||||
static int
|
||||
createWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * format,
|
||||
static int createWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * format,
|
||||
void ** pixels, int *pitch)
|
||||
{
|
||||
window_impl_t *impl = (window_impl_t *)window->driverdata;
|
||||
@@ -186,8 +182,7 @@ createWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window * window, Uint32 * fo
|
||||
* @param numrects Rect array length
|
||||
* @return 0 if successful, -1 on error
|
||||
*/
|
||||
static int
|
||||
updateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects,
|
||||
static int updateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Rect *rects,
|
||||
int numrects)
|
||||
{
|
||||
window_impl_t *impl = (window_impl_t *)window->driverdata;
|
||||
@@ -207,8 +202,7 @@ updateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *window, const SDL_Re
|
||||
* Runs the main event loop.
|
||||
* @param SDL_VideoDevice *_this
|
||||
*/
|
||||
static void
|
||||
pumpEvents(SDL_VideoDevice *_this)
|
||||
static void pumpEvents(SDL_VideoDevice *_this)
|
||||
{
|
||||
int type;
|
||||
|
||||
@@ -242,8 +236,7 @@ pumpEvents(SDL_VideoDevice *_this)
|
||||
* @param SDL_VideoDevice *_this
|
||||
* @param window SDL window to update
|
||||
*/
|
||||
static void
|
||||
setWindowSize(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
static void setWindowSize(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
window_impl_t *impl = (window_impl_t *)window->driverdata;
|
||||
int size[2];
|
||||
@@ -261,8 +254,7 @@ setWindowSize(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
* @param SDL_VideoDevice *_this
|
||||
* @param window SDL window to update
|
||||
*/
|
||||
static void
|
||||
showWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
static void showWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
window_impl_t *impl = (window_impl_t *)window->driverdata;
|
||||
const int visible = 1;
|
||||
@@ -276,8 +268,7 @@ showWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
* @param SDL_VideoDevice *_this
|
||||
* @param window SDL window to update
|
||||
*/
|
||||
static void
|
||||
hideWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
static void hideWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
window_impl_t *impl = (window_impl_t *)window->driverdata;
|
||||
const int visible = 0;
|
||||
@@ -291,8 +282,7 @@ hideWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
* @param SDL_VideoDevice *_this
|
||||
* @param window SDL window that is being destroyed
|
||||
*/
|
||||
static void
|
||||
destroyWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
static void destroyWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
window_impl_t *impl = (window_impl_t *)window->driverdata;
|
||||
|
||||
@@ -306,8 +296,7 @@ destroyWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
* Frees the plugin object created by createDevice().
|
||||
* @param device Plugin object to free
|
||||
*/
|
||||
static void
|
||||
deleteDevice(SDL_VideoDevice *device)
|
||||
static void deleteDevice(SDL_VideoDevice *device)
|
||||
{
|
||||
SDL_free(device);
|
||||
}
|
||||
@@ -316,8 +305,7 @@ deleteDevice(SDL_VideoDevice *device)
|
||||
* Creates the QNX video plugin used by SDL.
|
||||
* @return Initialized device if successful, NULL otherwise
|
||||
*/
|
||||
static SDL_VideoDevice *
|
||||
createDevice()
|
||||
static SDL_VideoDevice *createDevice()
|
||||
{
|
||||
SDL_VideoDevice *device;
|
||||
|
||||
|
||||
@@ -85,8 +85,7 @@ static SDL_PixelFormatEnum RISCOS_ModeToPixelFormat(int ncolour, int modeflags,
|
||||
return SDL_PIXELFORMAT_UNKNOWN;
|
||||
}
|
||||
|
||||
static size_t
|
||||
measure_mode_block(const int *block)
|
||||
static size_t measure_mode_block(const int *block)
|
||||
{
|
||||
size_t blockSize = ((block[0] & 0xFF) == 3) ? 7 : 5;
|
||||
while (block[blockSize] != -1) {
|
||||
|
||||
@@ -39,8 +39,7 @@ int UIKit_SetClipboardText(SDL_VideoDevice *_this, const char *text)
|
||||
#endif
|
||||
}
|
||||
|
||||
char *
|
||||
UIKit_GetClipboardText(SDL_VideoDevice *_this)
|
||||
char *UIKit_GetClipboardText(SDL_VideoDevice *_this)
|
||||
{
|
||||
#if TARGET_OS_TV
|
||||
return SDL_strdup(""); // Unsupported.
|
||||
@@ -58,8 +57,7 @@ UIKit_GetClipboardText(SDL_VideoDevice *_this)
|
||||
#endif
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
UIKit_HasClipboardText(SDL_VideoDevice *_this)
|
||||
SDL_bool UIKit_HasClipboardText(SDL_VideoDevice *_this)
|
||||
{
|
||||
@autoreleasepool {
|
||||
#if !TARGET_OS_TV
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
|
||||
static SDL_bool s_showingMessageBox = SDL_FALSE;
|
||||
|
||||
SDL_bool
|
||||
UIKit_ShowingMessageBox(void)
|
||||
SDL_bool UIKit_ShowingMessageBox(void)
|
||||
{
|
||||
return s_showingMessageBox;
|
||||
}
|
||||
|
||||
@@ -257,8 +257,7 @@ void UIKit_DelDisplay(UIScreen *uiscreen)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
UIKit_IsDisplayLandscape(UIScreen *uiscreen)
|
||||
SDL_bool UIKit_IsDisplayLandscape(UIScreen *uiscreen)
|
||||
{
|
||||
#if !TARGET_OS_TV
|
||||
if (uiscreen == [UIScreen mainScreen]) {
|
||||
|
||||
@@ -523,8 +523,7 @@ static SDL_uikitviewcontroller *GetWindowViewController(SDL_Window *window)
|
||||
return data.viewcontroller;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
UIKit_HasScreenKeyboardSupport(SDL_VideoDevice *_this)
|
||||
SDL_bool UIKit_HasScreenKeyboardSupport(SDL_VideoDevice *_this)
|
||||
{
|
||||
return SDL_TRUE;
|
||||
}
|
||||
@@ -545,8 +544,7 @@ void UIKit_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
UIKit_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
SDL_bool UIKit_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
@autoreleasepool {
|
||||
SDL_uikitviewcontroller *vc = GetWindowViewController(window);
|
||||
|
||||
@@ -80,8 +80,7 @@ int VITA_GL_LoadLibrary(SDL_VideoDevice *_this, const char *path)
|
||||
return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType)0, 0);
|
||||
}
|
||||
|
||||
SDL_GLContext
|
||||
VITA_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
SDL_GLContext VITA_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
char gl_version[3];
|
||||
SDL_GLContext context = NULL;
|
||||
@@ -115,8 +114,7 @@ VITA_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
return context;
|
||||
}
|
||||
|
||||
SDL_FunctionPointer
|
||||
VITA_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc)
|
||||
SDL_FunctionPointer VITA_GL_GetProcAddress(SDL_VideoDevice *_this, const char *proc)
|
||||
{
|
||||
return gl4es_GetProcAddress(proc);
|
||||
}
|
||||
|
||||
@@ -67,8 +67,7 @@ int VITA_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path)
|
||||
return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType)0, 0);
|
||||
}
|
||||
|
||||
SDL_GLContext
|
||||
VITA_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
SDL_GLContext VITA_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
return SDL_EGL_CreateContext(_this, window->driverdata->egl_surface);
|
||||
}
|
||||
|
||||
@@ -218,8 +218,7 @@ static void mime_data_list_free(struct wl_list *list)
|
||||
}
|
||||
}
|
||||
|
||||
static size_t
|
||||
Wayland_send_data(void *data, size_t length, int fd)
|
||||
static size_t Wayland_send_data(void *data, size_t length, int fd)
|
||||
{
|
||||
size_t result = 0;
|
||||
|
||||
@@ -233,9 +232,7 @@ Wayland_send_data(void *data, size_t length, int fd)
|
||||
return result;
|
||||
}
|
||||
|
||||
ssize_t
|
||||
Wayland_data_source_send(SDL_WaylandDataSource *source,
|
||||
const char *mime_type, int fd)
|
||||
ssize_t Wayland_data_source_send(SDL_WaylandDataSource *source, const char *mime_type, int fd)
|
||||
{
|
||||
void *data = NULL;
|
||||
size_t length = 0;
|
||||
@@ -247,9 +244,7 @@ Wayland_data_source_send(SDL_WaylandDataSource *source,
|
||||
return Wayland_send_data(data, length, fd);
|
||||
}
|
||||
|
||||
ssize_t
|
||||
Wayland_primary_selection_source_send(SDL_WaylandPrimarySelectionSource *source,
|
||||
const char *mime_type, int fd)
|
||||
ssize_t Wayland_primary_selection_source_send(SDL_WaylandPrimarySelectionSource *source, const char *mime_type, int fd)
|
||||
{
|
||||
void *data = NULL;
|
||||
size_t length = 0;
|
||||
|
||||
@@ -808,8 +808,7 @@ static void pointer_handle_axis(void *data, struct wl_pointer *pointer,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_handle_axis_relative_direction(void *data, struct wl_pointer *pointer,
|
||||
static void pointer_handle_axis_relative_direction(void *data, struct wl_pointer *pointer,
|
||||
uint32_t axis, uint32_t axis_relative_direction)
|
||||
{
|
||||
struct SDL_WaylandInput *input = data;
|
||||
@@ -826,8 +825,7 @@ pointer_handle_axis_relative_direction(void *data, struct wl_pointer *pointer,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_handle_frame(void *data, struct wl_pointer *pointer)
|
||||
static void pointer_handle_frame(void *data, struct wl_pointer *pointer)
|
||||
{
|
||||
struct SDL_WaylandInput *input = data;
|
||||
SDL_WindowData *window = input->pointer_focus;
|
||||
|
||||
@@ -635,8 +635,7 @@ static void Wayland_RecreateCursor(SDL_Cursor *cursor, SDL_VideoData *vdata)
|
||||
wl_surface_set_user_data(cdata->surface, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
Wayland_RecreateCursors(void)
|
||||
void Wayland_RecreateCursors(void)
|
||||
{
|
||||
SDL_Cursor *cursor;
|
||||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
SDL_FORCE_INLINE SDL_bool FloatEqual(float a, float b)
|
||||
static SDL_bool FloatEqual(float a, float b)
|
||||
{
|
||||
const float diff = SDL_fabsf(a - b);
|
||||
const float largest = SDL_max(SDL_fabsf(a), SDL_fabsf(b));
|
||||
|
||||
@@ -100,8 +100,7 @@ int WIN_SetClipboardText(SDL_VideoDevice *_this, const char *text)
|
||||
return result;
|
||||
}
|
||||
|
||||
char *
|
||||
WIN_GetClipboardText(SDL_VideoDevice *_this)
|
||||
char *WIN_GetClipboardText(SDL_VideoDevice *_this)
|
||||
{
|
||||
char *text;
|
||||
|
||||
@@ -127,8 +126,7 @@ WIN_GetClipboardText(SDL_VideoDevice *_this)
|
||||
return text;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
WIN_HasClipboardText(SDL_VideoDevice *_this)
|
||||
SDL_bool WIN_HasClipboardText(SDL_VideoDevice *_this)
|
||||
{
|
||||
SDL_bool result = SDL_FALSE;
|
||||
char *text = WIN_GetClipboardText(_this);
|
||||
|
||||
@@ -282,8 +282,7 @@ SDL_bool WIN_IsTextInputShown(SDL_VideoDevice *_this)
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata)
|
||||
SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata)
|
||||
{
|
||||
return SDL_FALSE;
|
||||
}
|
||||
@@ -994,8 +993,7 @@ static void IME_HideCandidateList(SDL_VideoData *videodata)
|
||||
IME_SendEditingEvent(videodata);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata)
|
||||
SDL_bool IME_HandleMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM *lParam, SDL_VideoData *videodata)
|
||||
{
|
||||
SDL_bool trap = SDL_FALSE;
|
||||
HIMC himc = 0;
|
||||
|
||||
@@ -60,8 +60,7 @@ int WIN_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path)
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_GLContext
|
||||
WIN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
SDL_GLContext WIN_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
SDL_GLContext context;
|
||||
SDL_WindowData *data = window->driverdata;
|
||||
|
||||
@@ -25,8 +25,7 @@
|
||||
#include "SDL_windowsshape.h"
|
||||
#include "SDL_windowsvideo.h"
|
||||
|
||||
SDL_WindowShaper *
|
||||
Win32_CreateShaper(SDL_Window *window)
|
||||
SDL_WindowShaper *Win32_CreateShaper(SDL_Window *window)
|
||||
{
|
||||
SDL_WindowShaper *result = (SDL_WindowShaper *)SDL_malloc(sizeof(SDL_WindowShaper));
|
||||
if (result == NULL) {
|
||||
|
||||
@@ -472,8 +472,7 @@ void WIN_VideoQuit(SDL_VideoDevice *_this)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SDL_bool
|
||||
D3D_LoadDLL(void **pD3DDLL, IDirect3D9 **pDirect3D9Interface)
|
||||
SDL_bool D3D_LoadDLL(void **pD3DDLL, IDirect3D9 **pDirect3D9Interface)
|
||||
{
|
||||
*pD3DDLL = SDL_LoadObject("D3D9.DLL");
|
||||
if (*pD3DDLL) {
|
||||
|
||||
@@ -111,8 +111,7 @@ WINRT_TransformCursorPosition(SDL_Window *window,
|
||||
return outputPosition;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
WINRT_GetSDLButtonForPointerPoint(Windows::UI::Input::PointerPoint ^ pt, Uint8 *button, Uint8 *pressed)
|
||||
SDL_bool WINRT_GetSDLButtonForPointerPoint(Windows::UI::Input::PointerPoint ^ pt, Uint8 *button, Uint8 *pressed)
|
||||
{
|
||||
using namespace Windows::UI::Input;
|
||||
|
||||
|
||||
@@ -284,8 +284,7 @@ int X11_SetPrimarySelectionText(SDL_VideoDevice *_this, const char *text)
|
||||
SDL_strdup(text), SDL_TRUE);
|
||||
}
|
||||
|
||||
char *
|
||||
X11_GetClipboardText(SDL_VideoDevice *_this)
|
||||
char *X11_GetClipboardText(SDL_VideoDevice *_this)
|
||||
{
|
||||
size_t length;
|
||||
SDL_VideoData *videodata = _this->driverdata;
|
||||
@@ -298,15 +297,13 @@ X11_GetClipboardText(SDL_VideoDevice *_this)
|
||||
return GetSelectionData(_this, XA_CLIPBOARD, &length, text_mime_types[0], SDL_TRUE);
|
||||
}
|
||||
|
||||
char *
|
||||
X11_GetPrimarySelectionText(SDL_VideoDevice *_this)
|
||||
char *X11_GetPrimarySelectionText(SDL_VideoDevice *_this)
|
||||
{
|
||||
size_t length;
|
||||
return GetSelectionData(_this, XA_PRIMARY, &length, text_mime_types[0], SDL_TRUE);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
X11_HasClipboardText(SDL_VideoDevice *_this)
|
||||
SDL_bool X11_HasClipboardText(SDL_VideoDevice *_this)
|
||||
{
|
||||
SDL_bool result = SDL_FALSE;
|
||||
char *text = X11_GetClipboardText(_this);
|
||||
@@ -317,8 +314,7 @@ X11_HasClipboardText(SDL_VideoDevice *_this)
|
||||
return result;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
X11_HasPrimarySelectionText(SDL_VideoDevice *_this)
|
||||
SDL_bool X11_HasPrimarySelectionText(SDL_VideoDevice *_this)
|
||||
{
|
||||
SDL_bool result = SDL_FALSE;
|
||||
char *text = X11_GetPrimarySelectionText(_this);
|
||||
@@ -329,8 +325,7 @@ X11_HasPrimarySelectionText(SDL_VideoDevice *_this)
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
X11_QuitClipboard(SDL_VideoDevice *_this)
|
||||
void X11_QuitClipboard(SDL_VideoDevice *_this)
|
||||
{
|
||||
SDL_VideoData *data = _this->driverdata;
|
||||
if (data->primary_selection.internal == SDL_TRUE) {
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
/* Shared memory error handler routine */
|
||||
static int shm_error;
|
||||
static int (*X_handler)(Display *, XErrorEvent *) = NULL;
|
||||
static int
|
||||
shm_errhandler(Display *d, XErrorEvent *e)
|
||||
static int shm_errhandler(Display *d, XErrorEvent *e)
|
||||
{
|
||||
if (e->error_code == BadAccess) {
|
||||
shm_error = True;
|
||||
|
||||
@@ -455,8 +455,7 @@ int X11_SetTextInputRect(SDL_VideoDevice *_this, const SDL_Rect *rect)
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
X11_HasScreenKeyboardSupport(SDL_VideoDevice *_this)
|
||||
SDL_bool X11_HasScreenKeyboardSupport(SDL_VideoDevice *_this)
|
||||
{
|
||||
SDL_VideoData *videodata = _this->driverdata;
|
||||
return videodata->is_steam_deck;
|
||||
@@ -489,8 +488,7 @@ void X11_HideScreenKeyboard(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
}
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
X11_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
SDL_bool X11_IsScreenKeyboardShown(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
SDL_VideoData *videodata = _this->driverdata;
|
||||
|
||||
|
||||
@@ -55,8 +55,7 @@ int X11_GLES_LoadLibrary(SDL_VideoDevice *_this, const char *path)
|
||||
return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType)data->display, _this->gl_config.egl_platform);
|
||||
}
|
||||
|
||||
XVisualInfo *
|
||||
X11_GLES_GetVisual(SDL_VideoDevice *_this, Display *display, int screen, SDL_bool transparent)
|
||||
XVisualInfo *X11_GLES_GetVisual(SDL_VideoDevice *_this, Display *display, int screen, SDL_bool transparent)
|
||||
{
|
||||
|
||||
XVisualInfo *egl_visualinfo = NULL;
|
||||
@@ -105,8 +104,7 @@ X11_GLES_GetVisual(SDL_VideoDevice *_this, Display *display, int screen, SDL_boo
|
||||
return egl_visualinfo;
|
||||
}
|
||||
|
||||
SDL_GLContext
|
||||
X11_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
SDL_GLContext X11_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
SDL_GLContext context;
|
||||
SDL_WindowData *data = window->driverdata;
|
||||
@@ -119,8 +117,7 @@ X11_GLES_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
return context;
|
||||
}
|
||||
|
||||
SDL_EGLSurface
|
||||
X11_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
SDL_EGLSurface X11_GLES_GetEGLSurface(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
SDL_WindowData *data = window->driverdata;
|
||||
return data->egl_surface;
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
#include "SDL_x11window.h"
|
||||
#include "../SDL_shape_internals.h"
|
||||
|
||||
SDL_WindowShaper *
|
||||
X11_CreateShaper(SDL_Window *window)
|
||||
SDL_WindowShaper *X11_CreateShaper(SDL_Window *window)
|
||||
{
|
||||
SDL_WindowShaper *result = NULL;
|
||||
|
||||
|
||||
@@ -505,8 +505,7 @@ void X11_VideoQuit(SDL_VideoDevice *_this)
|
||||
X11_QuitClipboard(_this);
|
||||
}
|
||||
|
||||
SDL_bool
|
||||
X11_UseDirectColorVisuals(void)
|
||||
SDL_bool X11_UseDirectColorVisuals(void)
|
||||
{
|
||||
return SDL_getenv("SDL_VIDEO_X11_NODIRECTCOLOR") ? SDL_FALSE : SDL_TRUE;
|
||||
}
|
||||
|
||||
@@ -43,13 +43,11 @@
|
||||
#define _NET_WM_STATE_REMOVE 0l
|
||||
#define _NET_WM_STATE_ADD 1l
|
||||
|
||||
static Bool
|
||||
isMapNotify(Display *dpy, XEvent *ev, XPointer win) /* NOLINT(readability-non-const-parameter): cannot make XPointer a const pointer due to typedef */
|
||||
static Bool isMapNotify(Display *dpy, XEvent *ev, XPointer win) /* NOLINT(readability-non-const-parameter): cannot make XPointer a const pointer due to typedef */
|
||||
{
|
||||
return ev->type == MapNotify && ev->xmap.window == *((Window *)win);
|
||||
}
|
||||
static Bool
|
||||
isUnmapNotify(Display *dpy, XEvent *ev, XPointer win) /* NOLINT(readability-non-const-parameter): cannot make XPointer a const pointer due to typedef */
|
||||
static Bool isUnmapNotify(Display *dpy, XEvent *ev, XPointer win) /* NOLINT(readability-non-const-parameter): cannot make XPointer a const pointer due to typedef */
|
||||
{
|
||||
return ev->type == UnmapNotify && ev->xunmap.window == *((Window *)win);
|
||||
}
|
||||
@@ -775,8 +773,7 @@ int X11_CreateWindowFrom(SDL_VideoDevice *_this, SDL_Window *window, const void
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *
|
||||
X11_GetWindowTitle(SDL_VideoDevice *_this, Window xwindow)
|
||||
char *X11_GetWindowTitle(SDL_VideoDevice *_this, Window xwindow)
|
||||
{
|
||||
SDL_VideoData *data = _this->driverdata;
|
||||
Display *display = data->display;
|
||||
|
||||
Reference in New Issue
Block a user