mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-04 07:10:15 +02:00
Use consistent style for pointer declarations and casts
This commit is contained in:
@@ -486,8 +486,8 @@ static void SDL_TARGETING("mmx") Blit565to565SurfaceAlphaMMX(SDL_BlitInfo *info)
|
||||
d &= 0x07e0f81f;
|
||||
*dstp++ = (Uint16)(d | d >> 16);
|
||||
},{
|
||||
src1 = *(__m64*)srcp; // 4 src pixels -> src1
|
||||
dst1 = *(__m64*)dstp; // 4 dst pixels -> dst1
|
||||
src1 = *(__m64 *)srcp; // 4 src pixels -> src1
|
||||
dst1 = *(__m64 *)dstp; // 4 dst pixels -> dst1
|
||||
|
||||
// red
|
||||
src2 = src1;
|
||||
@@ -536,7 +536,7 @@ static void SDL_TARGETING("mmx") Blit565to565SurfaceAlphaMMX(SDL_BlitInfo *info)
|
||||
|
||||
mm_res = _mm_or_si64(mm_res, dst2); // RED | GREEN | BLUE -> mm_res
|
||||
|
||||
*(__m64*)dstp = mm_res; // mm_res -> 4 dst pixels
|
||||
*(__m64 *)dstp = mm_res; // mm_res -> 4 dst pixels
|
||||
|
||||
srcp += 4;
|
||||
dstp += 4;
|
||||
@@ -624,8 +624,8 @@ static void SDL_TARGETING("mmx") Blit555to555SurfaceAlphaMMX(SDL_BlitInfo *info)
|
||||
d &= 0x03e07c1f;
|
||||
*dstp++ = (Uint16)(d | d >> 16);
|
||||
},{
|
||||
src1 = *(__m64*)srcp; // 4 src pixels -> src1
|
||||
dst1 = *(__m64*)dstp; // 4 dst pixels -> dst1
|
||||
src1 = *(__m64 *)srcp; // 4 src pixels -> src1
|
||||
dst1 = *(__m64 *)dstp; // 4 dst pixels -> dst1
|
||||
|
||||
// red -- process the bits in place
|
||||
src2 = src1;
|
||||
@@ -674,7 +674,7 @@ static void SDL_TARGETING("mmx") Blit555to555SurfaceAlphaMMX(SDL_BlitInfo *info)
|
||||
|
||||
mm_res = _mm_or_si64(mm_res, dst2); // RED | GREEN | BLUE -> mm_res
|
||||
|
||||
*(__m64*)dstp = mm_res; // mm_res -> 4 dst pixels
|
||||
*(__m64 *)dstp = mm_res; // mm_res -> 4 dst pixels
|
||||
|
||||
srcp += 4;
|
||||
dstp += 4;
|
||||
@@ -1061,8 +1061,8 @@ static void SDL_TARGETING("sse4.1") Blit8888to8888PixelAlphaSwizzleSSE41(SDL_Bli
|
||||
__m128i dst_hi = _mm_maddubs_epi16(srca_hi, _mm_unpackhi_epi8(src128, dst128));
|
||||
|
||||
// dst += 0x1U (use 0x80 to round instead of floor) + 128*255 (to fix maddubs result)
|
||||
dst_lo = _mm_add_epi16(dst_lo, _mm_set1_epi16(1 + 128*255));
|
||||
dst_hi = _mm_add_epi16(dst_hi, _mm_set1_epi16(1 + 128*255));
|
||||
dst_lo = _mm_add_epi16(dst_lo, _mm_set1_epi16(1 + 128 * 255));
|
||||
dst_hi = _mm_add_epi16(dst_hi, _mm_set1_epi16(1 + 128 * 255));
|
||||
|
||||
// dst = (dst + (dst >> 8)) >> 8 = (dst * 257) >> 16
|
||||
dst_lo = _mm_mulhi_epu16(dst_lo, _mm_set1_epi16(257));
|
||||
@@ -1165,8 +1165,8 @@ static void SDL_TARGETING("avx2") Blit8888to8888PixelAlphaSwizzleAVX2(SDL_BlitIn
|
||||
__m256i dst_hi = _mm256_maddubs_epi16(alpha_hi, _mm256_unpackhi_epi8(src256, dst256));
|
||||
|
||||
// dst += 0x1U (use 0x80 to round instead of floor) + 128*255 (to fix maddubs result)
|
||||
dst_lo = _mm256_add_epi16(dst_lo, _mm256_set1_epi16(1 + 128*255));
|
||||
dst_hi = _mm256_add_epi16(dst_hi, _mm256_set1_epi16(1 + 128*255));
|
||||
dst_lo = _mm256_add_epi16(dst_lo, _mm256_set1_epi16(1 + 128 * 255));
|
||||
dst_hi = _mm256_add_epi16(dst_hi, _mm256_set1_epi16(1 + 128 * 255));
|
||||
|
||||
// dst = (dst + (dst >> 8)) >> 8 = (dst * 257) >> 16
|
||||
dst_lo = _mm256_mulhi_epu16(dst_lo, _mm256_set1_epi16(257));
|
||||
@@ -1290,8 +1290,8 @@ static void Blit8888to8888PixelAlphaSwizzleNEON(SDL_BlitInfo *info)
|
||||
// Process 1 pixel per iteration, max 3 iterations, same calculations as above
|
||||
for (; i < width; ++i) {
|
||||
// Top 32-bits will be not used in src32 & dst32
|
||||
uint8x8_t src32 = vreinterpret_u8_u32(vld1_dup_u32((Uint32*)src));
|
||||
uint8x8_t dst32 = vreinterpret_u8_u32(vld1_dup_u32((Uint32*)dst));
|
||||
uint8x8_t src32 = vreinterpret_u8_u32(vld1_dup_u32((Uint32 *)src));
|
||||
uint8x8_t dst32 = vreinterpret_u8_u32(vld1_dup_u32((Uint32 *)dst));
|
||||
|
||||
uint8x8_t srcA = vtbl1_u8(src32, vget_low_u8(alpha_splat_mask));
|
||||
src32 = vtbl1_u8(src32, vget_low_u8(convert_mask));
|
||||
@@ -1309,7 +1309,7 @@ static void Blit8888to8888PixelAlphaSwizzleNEON(SDL_BlitInfo *info)
|
||||
}
|
||||
|
||||
// Save the result, only low 32-bits
|
||||
vst1_lane_u32((Uint32*)dst, vreinterpret_u32_u8(dst32), 0);
|
||||
vst1_lane_u32((Uint32 *)dst, vreinterpret_u32_u8(dst32), 0);
|
||||
|
||||
src += 4;
|
||||
dst += 4;
|
||||
|
||||
@@ -2258,7 +2258,7 @@ static void BlitNtoNKey(SDL_BlitInfo *info)
|
||||
/* *INDENT-OFF* */ // clang-format off
|
||||
DUFFS_LOOP(
|
||||
{
|
||||
Uint32 *src32 = (Uint32*)src;
|
||||
Uint32 *src32 = (Uint32 *)src;
|
||||
|
||||
if ((*src32 & rgbmask) != ckey) {
|
||||
dst[0] = src[p0];
|
||||
@@ -2366,7 +2366,7 @@ static void BlitNtoNKey(SDL_BlitInfo *info)
|
||||
/* *INDENT-OFF* */ // clang-format off
|
||||
DUFFS_LOOP(
|
||||
{
|
||||
Uint32 *src32 = (Uint32*)src;
|
||||
Uint32 *src32 = (Uint32 *)src;
|
||||
if ((*src32 & rgbmask) != ckey) {
|
||||
dst[0] = src[p0];
|
||||
dst[1] = src[p1];
|
||||
@@ -2516,7 +2516,7 @@ static void BlitNtoNKeyCopyAlpha(SDL_BlitInfo *info)
|
||||
/* *INDENT-OFF* */ // clang-format off
|
||||
DUFFS_LOOP(
|
||||
{
|
||||
Uint32 *src32 = (Uint32*)src;
|
||||
Uint32 *src32 = (Uint32 *)src;
|
||||
if ((*src32 & rgbmask) != ckey) {
|
||||
dst[0] = src[p0];
|
||||
dst[1] = src[p1];
|
||||
@@ -2777,7 +2777,7 @@ static void Blit8888to8888PixelSwizzleNEON(SDL_BlitInfo *info)
|
||||
// Process 1 pixel per iteration, max 3 iterations, same calculations as above
|
||||
for (; i < width; ++i) {
|
||||
// Top 32-bits will be not used in src32
|
||||
uint8x8_t src32 = vreinterpret_u8_u32(vld1_dup_u32((Uint32*)src));
|
||||
uint8x8_t src32 = vreinterpret_u8_u32(vld1_dup_u32((Uint32 *)src));
|
||||
|
||||
// Convert to dst format
|
||||
src32 = vtbl1_u8(src32, vget_low_u8(convert_mask));
|
||||
@@ -2788,7 +2788,7 @@ static void Blit8888to8888PixelSwizzleNEON(SDL_BlitInfo *info)
|
||||
}
|
||||
|
||||
// Save the result, only low 32-bits
|
||||
vst1_lane_u32((Uint32*)dst, vreinterpret_u32_u8(src32), 0);
|
||||
vst1_lane_u32((Uint32 *)dst, vreinterpret_u32_u8(src32), 0);
|
||||
|
||||
src += 4;
|
||||
dst += 4;
|
||||
@@ -2829,7 +2829,7 @@ static void Blit_3or4_to_3or4__same_rgb(SDL_BlitInfo *info)
|
||||
/* *INDENT-OFF* */ // clang-format off
|
||||
DUFFS_LOOP(
|
||||
{
|
||||
Uint32 *dst32 = (Uint32*)dst;
|
||||
Uint32 *dst32 = (Uint32 *)dst;
|
||||
Uint8 s0 = src[i0];
|
||||
Uint8 s1 = src[i1];
|
||||
Uint8 s2 = src[i2];
|
||||
@@ -2901,7 +2901,7 @@ static void Blit_3or4_to_3or4__inversed_rgb(SDL_BlitInfo *info)
|
||||
/* *INDENT-OFF* */ // clang-format off
|
||||
DUFFS_LOOP(
|
||||
{
|
||||
Uint32 *dst32 = (Uint32*)dst;
|
||||
Uint32 *dst32 = (Uint32 *)dst;
|
||||
Uint8 s0 = src[i0];
|
||||
Uint8 s1 = src[i1];
|
||||
Uint8 s2 = src[i2];
|
||||
@@ -2929,7 +2929,7 @@ static void Blit_3or4_to_3or4__inversed_rgb(SDL_BlitInfo *info)
|
||||
/* *INDENT-OFF* */ // clang-format off
|
||||
DUFFS_LOOP(
|
||||
{
|
||||
Uint32 *dst32 = (Uint32*)dst;
|
||||
Uint32 *dst32 = (Uint32 *)dst;
|
||||
Uint8 s0 = src[i0];
|
||||
Uint8 s1 = src[i1];
|
||||
Uint8 s2 = src[i2];
|
||||
|
||||
@@ -288,7 +288,7 @@ typedef struct color_t
|
||||
#if 0
|
||||
static void printf_64(const char *str, void *var)
|
||||
{
|
||||
uint8_t *val = (uint8_t*) var;
|
||||
uint8_t *val = (uint8_t *)var;
|
||||
printf(" * %s: %02x %02x %02x %02x _ %02x %02x %02x %02x\n",
|
||||
str, val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]);
|
||||
}
|
||||
@@ -394,7 +394,7 @@ static bool scale_mat(const Uint32 *src, int src_w, int src_h, int src_pitch, Ui
|
||||
#if 0
|
||||
static void SDL_TARGETING("sse2") printf_128(const char *str, __m128i var)
|
||||
{
|
||||
uint16_t *val = (uint16_t*) &var;
|
||||
uint16_t *val = (uint16_t *)&var;
|
||||
printf(" * %s: %04x %04x %04x %04x _ %04x %04x %04x %04x\n",
|
||||
str, val[0], val[1], val[2], val[3], val[4], val[5], val[6], val[7]);
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ struct SDL_VideoDevice
|
||||
*/
|
||||
bool (*Vulkan_LoadLibrary)(SDL_VideoDevice *_this, const char *path);
|
||||
void (*Vulkan_UnloadLibrary)(SDL_VideoDevice *_this);
|
||||
char const* const* (*Vulkan_GetInstanceExtensions)(SDL_VideoDevice *_this, Uint32 *count);
|
||||
char const * const *(*Vulkan_GetInstanceExtensions)(SDL_VideoDevice *_this, Uint32 *count);
|
||||
bool (*Vulkan_CreateSurface)(SDL_VideoDevice *_this, SDL_Window *window, VkInstance instance, const struct VkAllocationCallbacks *allocator, VkSurfaceKHR *surface);
|
||||
void (*Vulkan_DestroySurface)(SDL_VideoDevice *_this, VkInstance instance, VkSurfaceKHR surface, const struct VkAllocationCallbacks *allocator);
|
||||
bool (*Vulkan_GetPresentationSupport)(SDL_VideoDevice *_this, VkInstance instance, VkPhysicalDevice physicalDevice, Uint32 queueFamilyIndex);
|
||||
|
||||
@@ -6024,7 +6024,7 @@ void SDL_Vulkan_UnloadLibrary(void)
|
||||
}
|
||||
}
|
||||
|
||||
char const* const* SDL_Vulkan_GetInstanceExtensions(Uint32 *count)
|
||||
char const * const *SDL_Vulkan_GetInstanceExtensions(Uint32 *count)
|
||||
{
|
||||
return _this->Vulkan_GetInstanceExtensions(_this, count);
|
||||
}
|
||||
|
||||
@@ -110,8 +110,7 @@ void Android_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
|
||||
}
|
||||
}
|
||||
|
||||
char const* const* Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
|
||||
Uint32 *count)
|
||||
char const * const *Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
|
||||
{
|
||||
static const char *const extensionsForAndroid[] = {
|
||||
VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_ANDROID_SURFACE_EXTENSION_NAME
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
extern bool Android_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
|
||||
extern void Android_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
|
||||
extern char const* const* Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
|
||||
extern char const * const *Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
|
||||
extern bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this,
|
||||
SDL_Window *window,
|
||||
VkInstance instance,
|
||||
|
||||
@@ -244,7 +244,7 @@ void Cocoa_VideoQuit(SDL_VideoDevice *_this)
|
||||
SDL_SystemTheme Cocoa_GetSystemTheme(void)
|
||||
{
|
||||
if (@available(macOS 10.14, *)) {
|
||||
NSAppearance* appearance = [[NSApplication sharedApplication] effectiveAppearance];
|
||||
NSAppearance *appearance = [[NSApplication sharedApplication] effectiveAppearance];
|
||||
|
||||
if ([appearance.name containsString: @"Dark"]) {
|
||||
return SDL_SYSTEM_THEME_DARK;
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
extern bool Cocoa_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
|
||||
extern void Cocoa_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
|
||||
extern char const* const* Cocoa_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
|
||||
extern char const * const *Cocoa_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
|
||||
extern bool Cocoa_Vulkan_CreateSurface(SDL_VideoDevice *_this,
|
||||
SDL_Window *window,
|
||||
VkInstance instance,
|
||||
|
||||
@@ -161,8 +161,7 @@ void Cocoa_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
|
||||
}
|
||||
}
|
||||
|
||||
char const* const* Cocoa_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
|
||||
Uint32 *count)
|
||||
char const * const *Cocoa_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
|
||||
{
|
||||
static const char *const extensionsForCocoa[] = {
|
||||
VK_KHR_SURFACE_EXTENSION_NAME, VK_EXT_METAL_SURFACE_EXTENSION_NAME, VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME
|
||||
|
||||
@@ -110,7 +110,7 @@ bool Emscripten_UpdateWindowFramebuffer(SDL_VideoDevice *_this, SDL_Window *wind
|
||||
data32.set(HEAP32.subarray(src, src + num));
|
||||
var data8 = SDL3.data8;
|
||||
var i = 3;
|
||||
var j = i + 4*num;
|
||||
var j = i + 4 * num;
|
||||
if (num % 8 == 0) {
|
||||
// unrolling gives big speedups
|
||||
while (i < j) {
|
||||
|
||||
@@ -59,7 +59,7 @@ char *HAIKU_GetClipboardText(SDL_VideoDevice *_this) {
|
||||
if (be_clipboard->Lock()) {
|
||||
if ((clip = be_clipboard->Data())) {
|
||||
// Presumably the string of characters is ascii-format
|
||||
clip->FindData("text/plain", B_MIME_TYPE, (const void**)&text,
|
||||
clip->FindData("text/plain", B_MIME_TYPE, (const void **)&text,
|
||||
&length);
|
||||
}
|
||||
be_clipboard->Unlock();
|
||||
|
||||
@@ -324,7 +324,7 @@ protected:
|
||||
}
|
||||
|
||||
virtual void
|
||||
SetTitle(const char* aTitle)
|
||||
SetTitle(const char *aTitle)
|
||||
{
|
||||
fTitle = aTitle;
|
||||
BAlert::SetTitle(aTitle);
|
||||
|
||||
@@ -178,7 +178,7 @@ static void _BDisplayModeToSdlDisplayMode(display_mode *bmode, SDL_DisplayMode *
|
||||
get_refresh_rate(*bmode, &mode->refresh_rate_numerator, &mode->refresh_rate_denominator);
|
||||
|
||||
#if WRAP_BMODE
|
||||
SDL_DisplayModeData *data = (SDL_DisplayModeData*)SDL_calloc(1, sizeof(SDL_DisplayModeData));
|
||||
SDL_DisplayModeData *data = (SDL_DisplayModeData *)SDL_calloc(1, sizeof(SDL_DisplayModeData));
|
||||
data->bmode = bmode;
|
||||
|
||||
mode->internal = data;
|
||||
|
||||
@@ -94,7 +94,7 @@ bool HAIKU_GL_SwapWindow(SDL_VideoDevice *_this, SDL_Window * window)
|
||||
|
||||
bool HAIKU_GL_MakeCurrent(SDL_VideoDevice *_this, SDL_Window * window, SDL_GLContext context)
|
||||
{
|
||||
BGLView* glView = (BGLView*)context;
|
||||
BGLView *glView = (BGLView *)context;
|
||||
// printf("HAIKU_GL_MakeCurrent(%llx), win = %llx, thread = %d\n", (uint64)context, (uint64)window, find_thread(NULL));
|
||||
if (glView) {
|
||||
if ((glView->Window() == NULL) || (!window) || (_ToBeWin(window)->GetGLView() != glView)) {
|
||||
@@ -150,8 +150,8 @@ SDL_GLContext HAIKU_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window * window
|
||||
bool HAIKU_GL_DestroyContext(SDL_VideoDevice *_this, SDL_GLContext context)
|
||||
{
|
||||
// printf("HAIKU_GL_DestroyContext(%llx), thread = %d\n", (uint64)context, find_thread(NULL));
|
||||
BGLView* glView = (BGLView*)context;
|
||||
SDL_BWin *bwin = (SDL_BWin*)glView->Window();
|
||||
BGLView *glView = (BGLView *)context;
|
||||
SDL_BWin *bwin = (SDL_BWin *)glView->Window();
|
||||
if (!bwin) {
|
||||
delete glView;
|
||||
} else {
|
||||
|
||||
@@ -140,8 +140,7 @@ void KMSDRM_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
|
||||
// members of the VkInstanceCreateInfo struct passed to
|
||||
// vkCreateInstance().
|
||||
/*********************************************************************/
|
||||
char const* const* KMSDRM_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
|
||||
Uint32 *count)
|
||||
char const * const *KMSDRM_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
|
||||
{
|
||||
static const char *const extensionsForKMSDRM[] = {
|
||||
VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_DISPLAY_EXTENSION_NAME
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
extern bool KMSDRM_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
|
||||
extern void KMSDRM_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
|
||||
extern char const* const* KMSDRM_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
|
||||
extern char const * const *KMSDRM_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
|
||||
extern bool KMSDRM_Vulkan_CreateSurface(SDL_VideoDevice *_this,
|
||||
SDL_Window *window,
|
||||
VkInstance instance,
|
||||
|
||||
@@ -108,7 +108,7 @@ static BOOL (*ov_wglMakeCurrent)(HDC, HGLRC);
|
||||
#define OPENVR_DEFAULT_WIDTH 1920
|
||||
#define OPENVR_DEFAULT_HEIGHT 1080
|
||||
|
||||
#define OPENVR_SetupProc(proc) { proc = (void*)SDL_GL_GetProcAddress((#proc)+3); if (!proc) { failed_extension = (#proc)+3; } }
|
||||
#define OPENVR_SetupProc(proc) { proc = (void *)SDL_GL_GetProcAddress((#proc)+3); if (!proc) { failed_extension = (#proc)+3; } }
|
||||
|
||||
static bool OPENVR_InitExtensions(SDL_VideoDevice *_this)
|
||||
{
|
||||
@@ -211,7 +211,7 @@ static bool OPENVR_VideoInit(SDL_VideoDevice *_this)
|
||||
}
|
||||
|
||||
display.internal = (SDL_DisplayData *)data;
|
||||
display.name = (char*)"OpenVRDisplay";
|
||||
display.name = (char *)"OpenVRDisplay";
|
||||
SDL_AddVideoDisplay(&display, false);
|
||||
|
||||
return true;
|
||||
@@ -250,7 +250,7 @@ static uint32_t *ImageSDLToOpenVRGL(SDL_Surface * surf, bool bFlipY)
|
||||
int x, y;
|
||||
uint32_t * pxd = SDL_malloc(4 * surf->w * surf->h);
|
||||
for(y = 0; y < h; y++) {
|
||||
uint32_t * iline = (uint32_t*)&(((uint8_t*)surf->pixels)[y*pitch]);
|
||||
uint32_t * iline = (uint32_t *)&(((uint8_t *)surf->pixels)[y * pitch]);
|
||||
uint32_t * oline = &pxd[(bFlipY?(h-y-1):y)*w];
|
||||
for(x = 0; x < w; x++)
|
||||
{
|
||||
@@ -430,7 +430,7 @@ static void OPENVR_VirtualControllerUpdate(void *userdata)
|
||||
xval *= -1.0f;
|
||||
if (a == SDL_GAMEPAD_AXIS_LEFT_TRIGGER || a == SDL_GAMEPAD_AXIS_RIGHT_TRIGGER)
|
||||
xval = xval * 2.0f - 1.0f;
|
||||
//SDL_SetJoystickVirtualAxis(joystick, a, analog_input_action.x*32767);
|
||||
//SDL_SetJoystickVirtualAxis(joystick, a, analog_input_action.x * 32767);
|
||||
xval *= SDL_JOYSTICK_AXIS_MAX;
|
||||
SDL_SetJoystickVirtualAxis(joystick, a, xval);
|
||||
#ifdef DEBUG_OPENVR
|
||||
@@ -1039,7 +1039,7 @@ static SDL_GLContext OVR_EGL_CreateContext(SDL_VideoDevice *_this, SDL_Window *
|
||||
|
||||
ov_glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
|
||||
for(int i = 0; i < numExtensions; i++) {
|
||||
const char * ccc = (const char*)ov_glGetStringi(GL_EXTENSIONS, i);
|
||||
const char * ccc = (const char *)ov_glGetStringi(GL_EXTENSIONS, i);
|
||||
if (SDL_strcmp(ccc, "GL_KHR_debug") == 0) {
|
||||
#ifdef DEBUG_OPENVR
|
||||
SDL_Log("Found renderdoc debug extension.");
|
||||
@@ -1327,7 +1327,7 @@ static bool OPENVR_ShowCursor(SDL_Cursor * cursor)
|
||||
hotspot.v[0] = (float)ovrc->hot_x / (float)ovrc->w;
|
||||
hotspot.v[1] = (float)ovrc->hot_y / (float)ovrc->h;
|
||||
|
||||
texture.handle = (void*)(intptr_t)(ovrc->texture_id_handle);
|
||||
texture.handle = (void *)(intptr_t)(ovrc->texture_id_handle);
|
||||
texture.eType = ETextureType_TextureType_OpenGL;
|
||||
texture.eColorSpace = EColorSpace_ColorSpace_Auto;
|
||||
|
||||
@@ -1395,7 +1395,7 @@ static bool OPENVR_SetWindowIcon(SDL_VideoDevice *_this, SDL_Window * window, SD
|
||||
SDL_free(pixels);
|
||||
ov_glBindTexture(GL_TEXTURE_2D, 0);
|
||||
|
||||
texture.handle = (void*)(intptr_t)(texture_id_handle);
|
||||
texture.handle = (void *)(intptr_t)(texture_id_handle);
|
||||
texture.eType = ETextureType_TextureType_OpenGL;
|
||||
texture.eColorSpace = EColorSpace_ColorSpace_Auto;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ static int forward_argc;
|
||||
static char **forward_argv;
|
||||
static int exit_status;
|
||||
|
||||
int SDL_RunApp(int argc, char* argv[], SDL_main_func mainFunction, void * reserved)
|
||||
int SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void *reserved)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
extern bool UIKit_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
|
||||
extern void UIKit_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
|
||||
extern char const* const* UIKit_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
|
||||
extern char const * const *UIKit_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
|
||||
extern bool UIKit_Vulkan_CreateSurface(SDL_VideoDevice *_this,
|
||||
SDL_Window *window,
|
||||
VkInstance instance,
|
||||
|
||||
@@ -167,8 +167,7 @@ void UIKit_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
|
||||
}
|
||||
}
|
||||
|
||||
char const* const* UIKit_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
|
||||
Uint32 *count)
|
||||
char const * const *UIKit_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
|
||||
{
|
||||
static const char *const extensionsForUIKit[] = {
|
||||
VK_KHR_SURFACE_EXTENSION_NAME, VK_EXT_METAL_SURFACE_EXTENSION_NAME
|
||||
|
||||
@@ -117,8 +117,7 @@ void VIVANTE_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
|
||||
}
|
||||
}
|
||||
|
||||
char const* const* VIVANTE_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
|
||||
Uint32 *count)
|
||||
char const * const *VIVANTE_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
|
||||
{
|
||||
static const char *const extensionsForVivante[] = {
|
||||
VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_DISPLAY_EXTENSION_NAME
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
extern bool VIVANTE_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
|
||||
extern void VIVANTE_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
|
||||
extern char const* const* VIVANTE_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
|
||||
extern char const * const *VIVANTE_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
|
||||
extern bool VIVANTE_Vulkan_CreateSurface(SDL_VideoDevice *_this,
|
||||
SDL_Window *window,
|
||||
VkInstance instance,
|
||||
|
||||
@@ -84,13 +84,13 @@ SDL_WAYLAND_SYM(const char * const *, wl_proxy_get_tag, (struct wl_proxy *))
|
||||
* non-optional when we are compiling against Wayland 1.20. We don't
|
||||
* explicitly call them ourselves, though, so if we are only compiling
|
||||
* against Wayland 1.18, they're unnecessary. */
|
||||
SDL_WAYLAND_SYM(struct wl_proxy*, wl_proxy_marshal_flags, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interfac, uint32_t version, uint32_t flags, ...))
|
||||
SDL_WAYLAND_SYM(struct wl_proxy*, wl_proxy_marshal_array_flags, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interface, uint32_t version, uint32_t flags, union wl_argument *args))
|
||||
SDL_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_flags, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interfac, uint32_t version, uint32_t flags, ...))
|
||||
SDL_WAYLAND_SYM(struct wl_proxy *, wl_proxy_marshal_array_flags, (struct wl_proxy *proxy, uint32_t opcode, const struct wl_interface *interface, uint32_t version, uint32_t flags, union wl_argument *args))
|
||||
#endif
|
||||
|
||||
#if 0 // TODO RECONNECT: See waylandvideo.c for more information!
|
||||
#if SDL_WAYLAND_CHECK_VERSION(broken, on, purpose)
|
||||
SDL_WAYLAND_SYM(int, wl_display_reconnect, (struct wl_display*))
|
||||
SDL_WAYLAND_SYM(int, wl_display_reconnect, (struct wl_display *))
|
||||
#endif
|
||||
#endif // 0
|
||||
|
||||
@@ -149,7 +149,7 @@ SDL_WAYLAND_SYM(void, xkb_compose_state_unref, (struct xkb_compose_state *) )
|
||||
SDL_WAYLAND_SYM(enum xkb_compose_feed_result, xkb_compose_state_feed, (struct xkb_compose_state *, xkb_keysym_t) )
|
||||
SDL_WAYLAND_SYM(enum xkb_compose_status, xkb_compose_state_get_status, (struct xkb_compose_state *) )
|
||||
SDL_WAYLAND_SYM(xkb_keysym_t, xkb_compose_state_get_one_sym, (struct xkb_compose_state *) )
|
||||
SDL_WAYLAND_SYM(void, xkb_keymap_key_for_each, (struct xkb_keymap *, xkb_keymap_key_iter_t, void*) )
|
||||
SDL_WAYLAND_SYM(void, xkb_keymap_key_for_each, (struct xkb_keymap *, xkb_keymap_key_iter_t, void *) )
|
||||
SDL_WAYLAND_SYM(int, xkb_keymap_key_get_syms_by_level, (struct xkb_keymap *,
|
||||
xkb_keycode_t,
|
||||
xkb_layout_index_t,
|
||||
@@ -158,9 +158,9 @@ SDL_WAYLAND_SYM(int, xkb_keymap_key_get_syms_by_level, (struct xkb_keymap *,
|
||||
SDL_WAYLAND_SYM(uint32_t, xkb_keysym_to_utf32, (xkb_keysym_t) )
|
||||
SDL_WAYLAND_SYM(uint32_t, xkb_keymap_mod_get_index, (struct xkb_keymap *,
|
||||
const char *) )
|
||||
SDL_WAYLAND_SYM(const char *, xkb_keymap_layout_get_name, (struct xkb_keymap*, xkb_layout_index_t))
|
||||
SDL_WAYLAND_SYM(const char *, xkb_keymap_layout_get_name, (struct xkb_keymap *, xkb_layout_index_t))
|
||||
#if SDL_XKBCOMMON_CHECK_VERSION(1, 10, 0)
|
||||
SDL_WAYLAND_SYM(xkb_mod_mask_t, xkb_keymap_mod_get_mask, (struct xkb_keymap*, const char*))
|
||||
SDL_WAYLAND_SYM(xkb_mod_mask_t, xkb_keymap_mod_get_mask, (struct xkb_keymap *, const char *))
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBDECOR_H
|
||||
|
||||
@@ -115,7 +115,7 @@ void Wayland_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
|
||||
}
|
||||
}
|
||||
|
||||
char const* const* Wayland_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
|
||||
char const * const *Wayland_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
|
||||
{
|
||||
static const char *const extensionsForWayland[] = {
|
||||
VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
extern bool Wayland_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
|
||||
extern void Wayland_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
|
||||
extern char const* const* Wayland_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
|
||||
extern char const * const *Wayland_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
|
||||
extern bool Wayland_Vulkan_CreateSurface(SDL_VideoDevice *_this,
|
||||
SDL_Window *window,
|
||||
VkInstance instance,
|
||||
|
||||
@@ -1794,7 +1794,7 @@ static struct wl_callback_listener show_hide_sync_listener = {
|
||||
|
||||
static void exported_handle_handler(void *data, struct zxdg_exported_v2 *zxdg_exported_v2, const char *handle)
|
||||
{
|
||||
SDL_WindowData *wind = (SDL_WindowData*)data;
|
||||
SDL_WindowData *wind = (SDL_WindowData *)data;
|
||||
SDL_PropertiesID props = SDL_GetWindowProperties(wind->sdlwindow);
|
||||
|
||||
SDL_SetStringProperty(props, SDL_PROP_WINDOW_WAYLAND_XDG_TOPLEVEL_EXPORT_HANDLE_STRING, handle);
|
||||
@@ -2065,7 +2065,7 @@ void Wayland_ShowWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
|
||||
data->show_hide_sync_required = true;
|
||||
struct wl_callback *cb = wl_display_sync(_this->internal->display);
|
||||
wl_callback_add_listener(cb, &show_hide_sync_listener, (void*)((uintptr_t)window->id));
|
||||
wl_callback_add_listener(cb, &show_hide_sync_listener, (void *)((uintptr_t)window->id));
|
||||
|
||||
data->showing_window = true;
|
||||
SDL_SendWindowEvent(window, SDL_EVENT_WINDOW_SHOWN, 0, 0);
|
||||
@@ -2181,7 +2181,7 @@ void Wayland_HideWindow(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
|
||||
wind->show_hide_sync_required = true;
|
||||
struct wl_callback *cb = wl_display_sync(_this->internal->display);
|
||||
wl_callback_add_listener(cb, &show_hide_sync_listener, (void*)((uintptr_t)window->id));
|
||||
wl_callback_add_listener(cb, &show_hide_sync_listener, (void *)((uintptr_t)window->id));
|
||||
}
|
||||
|
||||
static void handle_xdg_activation_done(void *data,
|
||||
|
||||
@@ -46,7 +46,7 @@ HICON CreateIconFromSurface(SDL_Surface *surface)
|
||||
bmpInfo.bmiHeader.biCompression = BI_RGB;
|
||||
|
||||
HDC hdc = GetDC(NULL);
|
||||
void* pBits = NULL;
|
||||
void *pBits = NULL;
|
||||
HBITMAP hBitmap = CreateDIBSection(hdc, &bmpInfo, DIB_RGB_COLORS, &pBits, NULL, 0);
|
||||
if (!hBitmap) {
|
||||
ReleaseDC(NULL, hdc);
|
||||
|
||||
@@ -185,7 +185,7 @@ done:
|
||||
|
||||
static void CALLBACK GAMEINPUT_InternalDeviceCallback(
|
||||
_In_ GameInputCallbackToken callbackToken,
|
||||
_In_ void* context,
|
||||
_In_ void *context,
|
||||
_In_ IGameInputDevice *pDevice,
|
||||
_In_ uint64_t timestamp,
|
||||
_In_ GameInputDeviceStatus currentStatus,
|
||||
@@ -594,7 +594,7 @@ void WIN_QuitGameInput(SDL_VideoDevice *_this)
|
||||
|
||||
#else // !HAVE_GAMEINPUT_H
|
||||
|
||||
bool WIN_InitGameInput(SDL_VideoDevice* _this)
|
||||
bool WIN_InitGameInput(SDL_VideoDevice *_this)
|
||||
{
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
@@ -604,12 +604,12 @@ bool WIN_UpdateGameInputEnabled(SDL_VideoDevice *_this)
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
void WIN_UpdateGameInput(SDL_VideoDevice* _this)
|
||||
void WIN_UpdateGameInput(SDL_VideoDevice *_this)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
void WIN_QuitGameInput(SDL_VideoDevice* _this)
|
||||
void WIN_QuitGameInput(SDL_VideoDevice *_this)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -696,8 +696,8 @@ static void ReadMouseCurve(int v, Uint64 xs[5], Uint64 ys[5])
|
||||
ys[0] = 0; // first node must always be origin
|
||||
int i;
|
||||
for (i = 1; i < 5; i++) {
|
||||
xs[i] = (7 * (Uint64)xbuff[i*2]);
|
||||
ys[i] = (v * (Uint64)ybuff[i*2]) << 17;
|
||||
xs[i] = (7 * (Uint64)xbuff[i * 2]);
|
||||
ys[i] = (v * (Uint64)ybuff[i * 2]) << 17;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -168,8 +168,8 @@ static SDL_VideoDevice *WIN_CreateDevice(void)
|
||||
data->GetDpiForWindow = (UINT (WINAPI *)(HWND))SDL_LoadFunction(data->userDLL, "GetDpiForWindow");
|
||||
data->AreDpiAwarenessContextsEqual = (BOOL (WINAPI *)(DPI_AWARENESS_CONTEXT, DPI_AWARENESS_CONTEXT))SDL_LoadFunction(data->userDLL, "AreDpiAwarenessContextsEqual");
|
||||
data->IsValidDpiAwarenessContext = (BOOL (WINAPI *)(DPI_AWARENESS_CONTEXT))SDL_LoadFunction(data->userDLL, "IsValidDpiAwarenessContext");
|
||||
data->GetDisplayConfigBufferSizes = (LONG (WINAPI *)(UINT32,UINT32*,UINT32* ))SDL_LoadFunction(data->userDLL, "GetDisplayConfigBufferSizes");
|
||||
data->QueryDisplayConfig = (LONG (WINAPI *)(UINT32,UINT32*,DISPLAYCONFIG_PATH_INFO*,UINT32*,DISPLAYCONFIG_MODE_INFO*,DISPLAYCONFIG_TOPOLOGY_ID*))SDL_LoadFunction(data->userDLL, "QueryDisplayConfig");
|
||||
data->GetDisplayConfigBufferSizes = (LONG (WINAPI *)(UINT32,UINT32 *,UINT32 *))SDL_LoadFunction(data->userDLL, "GetDisplayConfigBufferSizes");
|
||||
data->QueryDisplayConfig = (LONG (WINAPI *)(UINT32,UINT32 *,DISPLAYCONFIG_PATH_INFO*,UINT32 *,DISPLAYCONFIG_MODE_INFO*,DISPLAYCONFIG_TOPOLOGY_ID*))SDL_LoadFunction(data->userDLL, "QueryDisplayConfig");
|
||||
data->DisplayConfigGetDeviceInfo = (LONG (WINAPI *)(DISPLAYCONFIG_DEVICE_INFO_HEADER*))SDL_LoadFunction(data->userDLL, "DisplayConfigGetDeviceInfo");
|
||||
data->GetPointerType = (BOOL (WINAPI *)(UINT32, POINTER_INPUT_TYPE *))SDL_LoadFunction(data->userDLL, "GetPointerType");
|
||||
data->GetPointerPenInfo = (BOOL (WINAPI *)(UINT32, POINTER_PEN_INFO *))SDL_LoadFunction(data->userDLL, "GetPointerPenInfo");
|
||||
@@ -624,7 +624,7 @@ bool D3D_LoadDLL(void **pD3DDLL, IDirect3D9 **pDirect3D9Interface)
|
||||
if (*pD3DDLL) {
|
||||
/* *INDENT-OFF* */ // clang-format off
|
||||
typedef IDirect3D9 *(WINAPI *Direct3DCreate9_t)(UINT SDKVersion);
|
||||
typedef HRESULT (WINAPI* Direct3DCreate9Ex_t)(UINT SDKVersion, IDirect3D9Ex** ppD3D);
|
||||
typedef HRESULT (WINAPI* Direct3DCreate9Ex_t)(UINT SDKVersion, IDirect3D9Ex **ppD3D);
|
||||
/* *INDENT-ON* */ // clang-format on
|
||||
Direct3DCreate9_t Direct3DCreate9Func;
|
||||
|
||||
|
||||
@@ -448,8 +448,8 @@ struct SDL_VideoData
|
||||
BOOL (WINAPI *AreDpiAwarenessContextsEqual)(DPI_AWARENESS_CONTEXT, DPI_AWARENESS_CONTEXT);
|
||||
BOOL (WINAPI *IsValidDpiAwarenessContext)(DPI_AWARENESS_CONTEXT);
|
||||
// DisplayConfig functions
|
||||
LONG (WINAPI *GetDisplayConfigBufferSizes)( UINT32, UINT32*, UINT32* );
|
||||
LONG (WINAPI *QueryDisplayConfig)( UINT32, UINT32*, DISPLAYCONFIG_PATH_INFO*, UINT32*, DISPLAYCONFIG_MODE_INFO*, DISPLAYCONFIG_TOPOLOGY_ID*);
|
||||
LONG (WINAPI *GetDisplayConfigBufferSizes)( UINT32, UINT32 *, UINT32 *);
|
||||
LONG (WINAPI *QueryDisplayConfig)( UINT32, UINT32 *, DISPLAYCONFIG_PATH_INFO*, UINT32 *, DISPLAYCONFIG_MODE_INFO*, DISPLAYCONFIG_TOPOLOGY_ID*);
|
||||
LONG (WINAPI *DisplayConfigGetDeviceInfo)( DISPLAYCONFIG_DEVICE_INFO_HEADER*);
|
||||
/* *INDENT-ON* */ // clang-format on
|
||||
|
||||
|
||||
@@ -110,8 +110,7 @@ void WIN_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
|
||||
}
|
||||
}
|
||||
|
||||
char const* const* WIN_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
|
||||
Uint32 *count)
|
||||
char const * const *WIN_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
|
||||
{
|
||||
static const char *const extensionsForWin32[] = {
|
||||
VK_KHR_SURFACE_EXTENSION_NAME, VK_KHR_WIN32_SURFACE_EXTENSION_NAME
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
extern bool WIN_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
|
||||
extern void WIN_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
|
||||
extern char const* const* WIN_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
|
||||
extern char const * const *WIN_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
|
||||
extern bool WIN_Vulkan_CreateSurface(SDL_VideoDevice *_this,
|
||||
SDL_Window *window,
|
||||
VkInstance instance,
|
||||
|
||||
@@ -186,7 +186,7 @@ static DWORD GetWindowStyleEx(SDL_Window *window)
|
||||
}
|
||||
|
||||
#ifdef HAVE_SHOBJIDL_CORE_H
|
||||
static ITaskbarList3 *GetTaskbarList(SDL_Window* window)
|
||||
static ITaskbarList3 *GetTaskbarList(SDL_Window *window)
|
||||
{
|
||||
const SDL_WindowData *data = window->internal;
|
||||
SDL_assert(data->taskbar_button_created);
|
||||
@@ -2264,7 +2264,7 @@ bool WIN_FlashWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_FlashOperat
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WIN_ApplyWindowProgress(SDL_VideoDevice *_this, SDL_Window* window)
|
||||
bool WIN_ApplyWindowProgress(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
{
|
||||
#ifdef HAVE_SHOBJIDL_CORE_H
|
||||
SDL_WindowData *data = window->internal;
|
||||
|
||||
@@ -771,7 +771,7 @@ static void X11_HandleClipboardEvent(SDL_VideoDevice *_this, const XEvent *xeven
|
||||
/* the new mime formats are the SDL_FORMATS property as an array of Atoms */
|
||||
Atom atom = None;
|
||||
Atom *patom;
|
||||
unsigned char* data = NULL;
|
||||
unsigned char *data = NULL;
|
||||
int format_property = 0;
|
||||
unsigned long length = 0;
|
||||
unsigned long bytes_left = 0;
|
||||
@@ -780,8 +780,8 @@ static void X11_HandleClipboardEvent(SDL_VideoDevice *_this, const XEvent *xeven
|
||||
X11_XGetWindowProperty(display, GetWindow(_this), videodata->atoms.SDL_FORMATS, 0, 200,
|
||||
0, XA_ATOM, &atom, &format_property, &length, &bytes_left, &data);
|
||||
|
||||
int allocationsize = (length + 1) * sizeof(char*);
|
||||
for (j = 0, patom = (Atom*)data; j < length; j++, patom++) {
|
||||
int allocationsize = (length + 1) * sizeof(char *);
|
||||
for (j = 0, patom = (Atom *)data; j < length; j++, patom++) {
|
||||
char *atomStr = X11_XGetAtomName(display, *patom);
|
||||
allocationsize += SDL_strlen(atomStr) + 1;
|
||||
X11_XFree(atomStr);
|
||||
@@ -791,7 +791,7 @@ static void X11_HandleClipboardEvent(SDL_VideoDevice *_this, const XEvent *xeven
|
||||
if (new_mime_types) {
|
||||
char *strPtr = (char *)(new_mime_types + length + 1);
|
||||
|
||||
for (j = 0, patom = (Atom*)data; j < length; j++, patom++) {
|
||||
for (j = 0, patom = (Atom *)data; j < length; j++, patom++) {
|
||||
char *atomStr = X11_XGetAtomName(display, *patom);
|
||||
new_mime_types[j] = strPtr;
|
||||
strPtr = stpcpy(strPtr, atomStr) + 1;
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
static const char g_MessageBoxFontLatin1[] =
|
||||
"-*-*-medium-r-normal--0-120-*-*-p-0-iso8859-1";
|
||||
|
||||
static const char* g_MessageBoxFont[] = {
|
||||
static const char *g_MessageBoxFont[] = {
|
||||
"-*-*-medium-r-normal--*-120-*-*-*-*-iso10646-1", // explicitly unicode (iso10646-1)
|
||||
"-*-*-medium-r-*--*-120-*-*-*-*-iso10646-1", // explicitly unicode (iso10646-1)
|
||||
"-misc-*-*-*-*--*-*-*-*-*-*-iso10646-1", // misc unicode (fix for some systems)
|
||||
@@ -242,9 +242,9 @@ static bool X11_MessageBoxInit(SDL_MessageBoxDataX11 *data, const SDL_MessageBox
|
||||
// Convert colors to 16 bpc XColor format
|
||||
for (i = 0; i < SDL_MESSAGEBOX_COLOR_COUNT; i++) {
|
||||
data->xcolor[i].flags = DoRed|DoGreen|DoBlue;
|
||||
data->xcolor[i].red = colorhints[i].r*257;
|
||||
data->xcolor[i].green = colorhints[i].g*257;
|
||||
data->xcolor[i].blue = colorhints[i].b*257;
|
||||
data->xcolor[i].red = colorhints[i].r * 257;
|
||||
data->xcolor[i].green = colorhints[i].g * 257;
|
||||
data->xcolor[i].blue = colorhints[i].b * 257;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -610,9 +610,9 @@ static int X11_GL_GetAttributes(SDL_VideoDevice *_this, Display *display, int sc
|
||||
}
|
||||
|
||||
//get the first transparent Visual
|
||||
static XVisualInfo* X11_GL_GetTransparentVisualInfo(Display *display, int screen)
|
||||
static XVisualInfo *X11_GL_GetTransparentVisualInfo(Display *display, int screen)
|
||||
{
|
||||
XVisualInfo* visualinfo = NULL;
|
||||
XVisualInfo *visualinfo = NULL;
|
||||
XVisualInfo vi_in;
|
||||
int out_count = 0;
|
||||
|
||||
@@ -621,7 +621,7 @@ static XVisualInfo* X11_GL_GetTransparentVisualInfo(Display *display, int screen
|
||||
if (visualinfo != NULL) {
|
||||
int i = 0;
|
||||
for (i = 0; i < out_count; i++) {
|
||||
XVisualInfo* v = &visualinfo[i];
|
||||
XVisualInfo *v = &visualinfo[i];
|
||||
Uint32 format = X11_GetPixelFormatFromVisualInfo(display, v);
|
||||
if (SDL_ISPIXELFORMAT_ALPHA(format)) {
|
||||
vi_in.screen = screen;
|
||||
@@ -697,7 +697,7 @@ XVisualInfo *X11_GL_GetVisual(SDL_VideoDevice *_this, Display *display, int scre
|
||||
Uint32 format = X11_GetPixelFormatFromVisualInfo(display, vinfo);
|
||||
if (!SDL_ISPIXELFORMAT_ALPHA(format)) {
|
||||
// not transparent!
|
||||
XVisualInfo* visualinfo = X11_GL_GetTransparentVisualInfo(display, screen);
|
||||
XVisualInfo *visualinfo = X11_GL_GetTransparentVisualInfo(display, screen);
|
||||
if (visualinfo != NULL) {
|
||||
X11_XFree(vinfo);
|
||||
vinfo = visualinfo;
|
||||
@@ -856,7 +856,7 @@ SDL_GLContext X11_GL_CreateContext(SDL_VideoDevice *_this, SDL_Window *window)
|
||||
if (transparent && (framebuffer_config != NULL)) {
|
||||
int i;
|
||||
for (i = 0; i < fbcount; i++) {
|
||||
XVisualInfo* vinfo_temp = _this->gl_data->glXGetVisualFromFBConfig(display, framebuffer_config[i]);
|
||||
XVisualInfo *vinfo_temp = _this->gl_data->glXGetVisualFromFBConfig(display, framebuffer_config[i]);
|
||||
if ( vinfo_temp != NULL) {
|
||||
Uint32 format = X11_GetPixelFormatFromVisualInfo(display, vinfo_temp);
|
||||
if (SDL_ISPIXELFORMAT_ALPHA(format)) {
|
||||
|
||||
@@ -144,8 +144,7 @@ void X11_Vulkan_UnloadLibrary(SDL_VideoDevice *_this)
|
||||
}
|
||||
}
|
||||
|
||||
char const* const* X11_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
|
||||
Uint32 *count)
|
||||
char const * const *X11_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count)
|
||||
{
|
||||
SDL_VideoData *videoData = _this->internal;
|
||||
if (videoData->vulkan_xlib_xcb_library) {
|
||||
|
||||
@@ -32,7 +32,7 @@ typedef xcb_connection_t *(*PFN_XGetXCBConnection)(Display *dpy);
|
||||
|
||||
extern bool X11_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
|
||||
extern void X11_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
|
||||
extern char const* const* X11_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
|
||||
extern char const * const *X11_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this, Uint32 *count);
|
||||
extern bool X11_Vulkan_CreateSurface(SDL_VideoDevice *_this,
|
||||
SDL_Window *window,
|
||||
VkInstance instance,
|
||||
|
||||
@@ -71,7 +71,7 @@ static Bool isUnmapNotify(Display *dpy, XEvent *ev, XPointer win) // NOLINT(read
|
||||
/*
|
||||
static Bool isConfigureNotify(Display *dpy, XEvent *ev, XPointer win)
|
||||
{
|
||||
return ev->type == ConfigureNotify && ev->xconfigure.window == *((Window*)win);
|
||||
return ev->type == ConfigureNotify && ev->xconfigure.window == *((Window *)win);
|
||||
}
|
||||
static Bool X11_XIfEventTimeout(Display *display, XEvent *event_return, Bool (*predicate)(), XPointer arg, int timeoutMS)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user