Fixed whitespace

This commit is contained in:
Sam Lantinga 2021-11-12 08:28:02 -08:00
parent 4a1524350c
commit c2dd50a9a0
17 changed files with 102 additions and 102 deletions

View file

@ -564,10 +564,10 @@ class HIDDeviceBLESteamController extends BluetoothGattCallback implements HIDDe
return "Steam Controller"; return "Steam Controller";
} }
@Override @Override
public UsbDevice getDevice() { public UsbDevice getDevice() {
return null; return null;
} }
@Override @Override
public boolean open() { public boolean open() {

View file

@ -554,7 +554,7 @@ public class HIDDeviceManager {
if (usbDevice != null && !mUsbManager.hasPermission(usbDevice)) { if (usbDevice != null && !mUsbManager.hasPermission(usbDevice)) {
HIDDeviceOpenPending(deviceID); HIDDeviceOpenPending(deviceID);
try { try {
final int FLAG_MUTABLE = 0x02000000; // PendingIntent.FLAG_MUTABLE, but don't require SDK 31 final int FLAG_MUTABLE = 0x02000000; // PendingIntent.FLAG_MUTABLE, but don't require SDK 31
int flags; int flags;
if (Build.VERSION.SDK_INT >= 31) { if (Build.VERSION.SDK_INT >= 31) {
flags = FLAG_MUTABLE; flags = FLAG_MUTABLE;

View file

@ -57,8 +57,8 @@ ANDROIDAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
test_format = SDL_FirstAudioFormat(this->spec.format); test_format = SDL_FirstAudioFormat(this->spec.format);
while (test_format != 0) { /* no "UNKNOWN" constant */ while (test_format != 0) { /* no "UNKNOWN" constant */
if ((test_format == AUDIO_U8) || if ((test_format == AUDIO_U8) ||
(test_format == AUDIO_S16) || (test_format == AUDIO_S16) ||
(test_format == AUDIO_F32)) { (test_format == AUDIO_F32)) {
this->spec.format = test_format; this->spec.format = test_format;
break; break;
} }

View file

@ -695,7 +695,7 @@ WASAPI_ThreadDeinit(_THIS)
void void
WASAPI_BeginLoopIteration(_THIS) WASAPI_BeginLoopIteration(_THIS)
{ {
/* no-op. */ /* no-op. */
} }
static void static void

View file

@ -2513,23 +2513,23 @@ SDL_bool Android_JNI_SetRelativeMouseEnabled(SDL_bool enabled)
SDL_bool Android_JNI_RequestPermission(const char *permission) SDL_bool Android_JNI_RequestPermission(const char *permission)
{ {
JNIEnv *env = Android_JNI_GetEnv(); JNIEnv *env = Android_JNI_GetEnv();
const int requestCode = 1; const int requestCode = 1;
/* Wait for any pending request on another thread */ /* Wait for any pending request on another thread */
while (SDL_AtomicGet(&bPermissionRequestPending) == SDL_TRUE) { while (SDL_AtomicGet(&bPermissionRequestPending) == SDL_TRUE) {
SDL_Delay(10); SDL_Delay(10);
} }
SDL_AtomicSet(&bPermissionRequestPending, SDL_TRUE); SDL_AtomicSet(&bPermissionRequestPending, SDL_TRUE);
jstring jpermission = (*env)->NewStringUTF(env, permission); jstring jpermission = (*env)->NewStringUTF(env, permission);
(*env)->CallStaticVoidMethod(env, mActivityClass, midRequestPermission, jpermission, requestCode); (*env)->CallStaticVoidMethod(env, mActivityClass, midRequestPermission, jpermission, requestCode);
(*env)->DeleteLocalRef(env, jpermission); (*env)->DeleteLocalRef(env, jpermission);
/* Wait for the request to complete */ /* Wait for the request to complete */
while (SDL_AtomicGet(&bPermissionRequestPending) == SDL_TRUE) { while (SDL_AtomicGet(&bPermissionRequestPending) == SDL_TRUE) {
SDL_Delay(10); SDL_Delay(10);
} }
return bPermissionRequestResult; return bPermissionRequestResult;
} }
/* Show toast notification */ /* Show toast notification */

View file

@ -350,14 +350,14 @@ CPU_haveAltiVec(void)
static int static int
CPU_haveARMSIMD(void) CPU_haveARMSIMD(void)
{ {
return 1; return 1;
} }
#elif !defined(__arm__) #elif !defined(__arm__)
static int static int
CPU_haveARMSIMD(void) CPU_haveARMSIMD(void)
{ {
return 0; return 0;
} }
#elif defined(__LINUX__) #elif defined(__LINUX__)
@ -391,20 +391,20 @@ CPU_haveARMSIMD(void)
static int static int
CPU_haveARMSIMD(void) CPU_haveARMSIMD(void)
{ {
_kernel_swi_regs regs; _kernel_swi_regs regs;
regs.r[0] = 0; regs.r[0] = 0;
if (_kernel_swi(OS_PlatformFeatures, &regs, &regs) != NULL) if (_kernel_swi(OS_PlatformFeatures, &regs, &regs) != NULL)
return 0; return 0;
if (!(regs.r[0] & (1<<31))) if (!(regs.r[0] & (1<<31)))
return 0; return 0;
regs.r[0] = 34; regs.r[0] = 34;
regs.r[1] = 29; regs.r[1] = 29;
if (_kernel_swi(OS_PlatformFeatures, &regs, &regs) != NULL) if (_kernel_swi(OS_PlatformFeatures, &regs, &regs) != NULL)
return 0; return 0;
return regs.r[0]; return regs.r[0];
} }
#else #else

View file

@ -653,7 +653,7 @@ SDL_SYS_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick)
return SDL_SYS_HapticOpenFromService(haptic, joystick->hwdata->ffservice); return SDL_SYS_HapticOpenFromService(haptic, joystick->hwdata->ffservice);
#else #else
return -1; return -1;
#endif #endif
} }

View file

@ -151,7 +151,7 @@ static DWORD CALLBACK
SDL_DeviceNotificationFunc(HCMNOTIFICATION hNotify, PVOID context, CM_NOTIFY_ACTION action, PCM_NOTIFY_EVENT_DATA eventData, DWORD event_data_size) SDL_DeviceNotificationFunc(HCMNOTIFICATION hNotify, PVOID context, CM_NOTIFY_ACTION action, PCM_NOTIFY_EVENT_DATA eventData, DWORD event_data_size)
{ {
if (action == CM_NOTIFY_ACTION_DEVICEINTERFACEARRIVAL || if (action == CM_NOTIFY_ACTION_DEVICEINTERFACEARRIVAL ||
action == CM_NOTIFY_ACTION_DEVICEINTERFACEREMOVAL) { action == CM_NOTIFY_ACTION_DEVICEINTERFACEREMOVAL) {
s_bWindowsDeviceChanged = SDL_TRUE; s_bWindowsDeviceChanged = SDL_TRUE;
} }
return ERROR_SUCCESS; return ERROR_SUCCESS;
@ -179,15 +179,15 @@ SDL_CreateDeviceNotificationFunc(void)
CM_Register_Notification = (CM_Register_NotificationFunc)GetProcAddress(cfgmgr32_lib_handle, "CM_Register_Notification"); CM_Register_Notification = (CM_Register_NotificationFunc)GetProcAddress(cfgmgr32_lib_handle, "CM_Register_Notification");
CM_Unregister_Notification = (CM_Unregister_NotificationFunc)GetProcAddress(cfgmgr32_lib_handle, "CM_Unregister_Notification"); CM_Unregister_Notification = (CM_Unregister_NotificationFunc)GetProcAddress(cfgmgr32_lib_handle, "CM_Unregister_Notification");
if (CM_Register_Notification && CM_Unregister_Notification) { if (CM_Register_Notification && CM_Unregister_Notification) {
CM_NOTIFY_FILTER notify_filter; CM_NOTIFY_FILTER notify_filter;
SDL_zero(notify_filter); SDL_zero(notify_filter);
notify_filter.cbSize = sizeof(notify_filter); notify_filter.cbSize = sizeof(notify_filter);
notify_filter.FilterType = CM_NOTIFY_FILTER_TYPE_DEVICEINTERFACE; notify_filter.FilterType = CM_NOTIFY_FILTER_TYPE_DEVICEINTERFACE;
notify_filter.u.DeviceInterface.ClassGuid = GUID_DEVINTERFACE_HID; notify_filter.u.DeviceInterface.ClassGuid = GUID_DEVINTERFACE_HID;
if (CM_Register_Notification(&notify_filter, NULL, SDL_DeviceNotificationFunc, &s_DeviceNotificationFuncHandle) == CR_SUCCESS) { if (CM_Register_Notification(&notify_filter, NULL, SDL_DeviceNotificationFunc, &s_DeviceNotificationFuncHandle) == CR_SUCCESS) {
return SDL_TRUE; return SDL_TRUE;
} }
} }
} }

View file

@ -39,7 +39,7 @@ static SDL_SensorDriver *SDL_sensor_drivers[] = {
&SDL_COREMOTION_SensorDriver, &SDL_COREMOTION_SensorDriver,
#endif #endif
#ifdef SDL_SENSOR_WINDOWS #ifdef SDL_SENSOR_WINDOWS
&SDL_WINDOWS_SensorDriver, &SDL_WINDOWS_SensorDriver,
#endif #endif
#if defined(SDL_SENSOR_DUMMY) || defined(SDL_SENSOR_DISABLED) #if defined(SDL_SENSOR_DUMMY) || defined(SDL_SENSOR_DISABLED)
&SDL_DUMMY_SensorDriver &SDL_DUMMY_SensorDriver

View file

@ -240,7 +240,7 @@ SDLTest_RunTest(SDLTest_TestSuiteReference *testSuite, const SDLTest_TestCaseRef
return TEST_RESULT_SETUP_FAILURE; return TEST_RESULT_SETUP_FAILURE;
} }
if (!testCase->enabled && forceTestRun == SDL_FALSE) if (!testCase->enabled && forceTestRun == SDL_FALSE)
{ {
SDLTest_Log(SDLTEST_FINAL_RESULT_FORMAT, "Test", testCase->name, "Skipped (Disabled)"); SDLTest_Log(SDLTEST_FINAL_RESULT_FORMAT, "Test", testCase->name, "Skipped (Disabled)");
return TEST_RESULT_SKIPPED; return TEST_RESULT_SKIPPED;
@ -391,7 +391,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
char *suiteFilterName = NULL; char *suiteFilterName = NULL;
int testFilter = 0; int testFilter = 0;
char *testFilterName = NULL; char *testFilterName = NULL;
SDL_bool forceTestRun = SDL_FALSE; SDL_bool forceTestRun = SDL_FALSE;
int testResult = 0; int testResult = 0;
int runResult = 0; int runResult = 0;
int totalTestFailedCount = 0; int totalTestFailedCount = 0;
@ -431,7 +431,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
/* Log run with fuzzer parameters */ /* Log run with fuzzer parameters */
SDLTest_Log("::::: Test Run /w seed '%s' started\n", runSeed); SDLTest_Log("::::: Test Run /w seed '%s' started\n", runSeed);
/* Count the total number of tests */ /* Count the total number of tests */
suiteCounter = 0; suiteCounter = 0;
while (testSuites[suiteCounter]) { while (testSuites[suiteCounter]) {
testSuite = testSuites[suiteCounter]; testSuite = testSuites[suiteCounter];
@ -440,17 +440,17 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
while (testSuite->testCases[testCounter]) while (testSuite->testCases[testCounter])
{ {
testCounter++; testCounter++;
totalNumberOfTests++; totalNumberOfTests++;
} }
} }
/* Pre-allocate an array for tracking failed tests (potentially all test cases) */ /* Pre-allocate an array for tracking failed tests (potentially all test cases) */
failedTests = (const SDLTest_TestCaseReference **)SDL_malloc(totalNumberOfTests * sizeof(SDLTest_TestCaseReference *)); failedTests = (const SDLTest_TestCaseReference **)SDL_malloc(totalNumberOfTests * sizeof(SDLTest_TestCaseReference *));
if (failedTests == NULL) { if (failedTests == NULL) {
SDLTest_LogError("Unable to allocate cache for failed tests"); SDLTest_LogError("Unable to allocate cache for failed tests");
SDL_Error(SDL_ENOMEM); SDL_Error(SDL_ENOMEM);
return -1; return -1;
} }
/* Initialize filtering */ /* Initialize filtering */
if (filter != NULL && filter[0] != '\0') { if (filter != NULL && filter[0] != '\0') {
@ -542,7 +542,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
/* Override 'disabled' flag if we specified a test filter (i.e. force run for debugging) */ /* Override 'disabled' flag if we specified a test filter (i.e. force run for debugging) */
if (testFilter == 1 && !testCase->enabled) { if (testFilter == 1 && !testCase->enabled) {
SDLTest_Log("Force run of disabled test since test filter was set"); SDLTest_Log("Force run of disabled test since test filter was set");
forceTestRun = SDL_TRUE; forceTestRun = SDL_TRUE;
} }
/* Take time - test start */ /* Take time - test start */
@ -571,7 +571,7 @@ int SDLTest_RunSuites(SDLTest_TestSuiteReference *testSuites[], const char *user
} }
SDLTest_Log("Test Iteration %i: execKey %" SDL_PRIu64, iterationCounter, execKey); SDLTest_Log("Test Iteration %i: execKey %" SDL_PRIu64, iterationCounter, execKey);
testResult = SDLTest_RunTest(testSuite, testCase, execKey, forceTestRun); testResult = SDLTest_RunTest(testSuite, testCase, execKey, forceTestRun);
if (testResult == TEST_RESULT_PASSED) { if (testResult == TEST_RESULT_PASSED) {
testPassedCount++; testPassedCount++;

View file

@ -397,14 +397,14 @@ void BlitARGBto565PixelAlphaARMSIMDAsm(int32_t w, int32_t h, uint16_t *dst, int3
static void static void
BlitARGBto565PixelAlphaARMSIMD(SDL_BlitInfo * info) BlitARGBto565PixelAlphaARMSIMD(SDL_BlitInfo * info)
{ {
int32_t width = info->dst_w; int32_t width = info->dst_w;
int32_t height = info->dst_h; int32_t height = info->dst_h;
uint16_t *dstp = (uint16_t *)info->dst; uint16_t *dstp = (uint16_t *)info->dst;
int32_t dststride = width + (info->dst_skip >> 1); int32_t dststride = width + (info->dst_skip >> 1);
uint32_t *srcp = (uint32_t *)info->src; uint32_t *srcp = (uint32_t *)info->src;
int32_t srcstride = width + (info->src_skip >> 2); int32_t srcstride = width + (info->src_skip >> 2);
BlitARGBto565PixelAlphaARMSIMDAsm(width, height, dstp, dststride, srcp, srcstride); BlitARGBto565PixelAlphaARMSIMDAsm(width, height, dstp, dststride, srcp, srcstride);
} }
void BlitRGBtoRGBPixelAlphaARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride); void BlitRGBtoRGBPixelAlphaARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint32_t *src, int32_t src_stride);
@ -444,14 +444,14 @@ void BlitRGBtoRGBPixelAlphaARMNEONAsm(int32_t w, int32_t h, uint32_t *dst, int32
static void static void
BlitRGBtoRGBPixelAlphaARMNEON(SDL_BlitInfo * info) BlitRGBtoRGBPixelAlphaARMNEON(SDL_BlitInfo * info)
{ {
int32_t width = info->dst_w; int32_t width = info->dst_w;
int32_t height = info->dst_h; int32_t height = info->dst_h;
uint32_t *dstp = (uint32_t *)info->dst; uint32_t *dstp = (uint32_t *)info->dst;
int32_t dststride = width + (info->dst_skip >> 2); int32_t dststride = width + (info->dst_skip >> 2);
uint32_t *srcp = (uint32_t *)info->src; uint32_t *srcp = (uint32_t *)info->src;
int32_t srcstride = width + (info->src_skip >> 2); int32_t srcstride = width + (info->src_skip >> 2);
BlitRGBtoRGBPixelAlphaARMNEONAsm(width, height, dstp, dststride, srcp, srcstride); BlitRGBtoRGBPixelAlphaARMNEONAsm(width, height, dstp, dststride, srcp, srcstride);
} }
#endif #endif

View file

@ -40,11 +40,11 @@
/* Functions to blit from N-bit surfaces to other surfaces */ /* Functions to blit from N-bit surfaces to other surfaces */
enum blit_features { enum blit_features {
BLIT_FEATURE_NONE = 0, BLIT_FEATURE_NONE = 0,
BLIT_FEATURE_HAS_MMX = 1, BLIT_FEATURE_HAS_MMX = 1,
BLIT_FEATURE_HAS_ALTIVEC = 2, BLIT_FEATURE_HAS_ALTIVEC = 2,
BLIT_FEATURE_ALTIVEC_DONT_USE_PREFETCH = 4, BLIT_FEATURE_ALTIVEC_DONT_USE_PREFETCH = 4,
BLIT_FEATURE_HAS_ARM_SIMD = 8 BLIT_FEATURE_HAS_ARM_SIMD = 8
}; };
#if SDL_ALTIVEC_BLITTERS #if SDL_ALTIVEC_BLITTERS
@ -943,14 +943,14 @@ void Blit_BGR888_RGB888ARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t d
static void static void
Blit_BGR888_RGB888ARMSIMD(SDL_BlitInfo * info) Blit_BGR888_RGB888ARMSIMD(SDL_BlitInfo * info)
{ {
int32_t width = info->dst_w; int32_t width = info->dst_w;
int32_t height = info->dst_h; int32_t height = info->dst_h;
uint32_t *dstp = (uint32_t *)info->dst; uint32_t *dstp = (uint32_t *)info->dst;
int32_t dststride = width + (info->dst_skip >> 2); int32_t dststride = width + (info->dst_skip >> 2);
uint32_t *srcp = (uint32_t *)info->src; uint32_t *srcp = (uint32_t *)info->src;
int32_t srcstride = width + (info->src_skip >> 2); int32_t srcstride = width + (info->src_skip >> 2);
Blit_BGR888_RGB888ARMSIMDAsm(width, height, dstp, dststride, srcp, srcstride); Blit_BGR888_RGB888ARMSIMDAsm(width, height, dstp, dststride, srcp, srcstride);
} }
void Blit_RGB444_RGB888ARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint16_t *src, int32_t src_stride); void Blit_RGB444_RGB888ARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t dst_stride, uint16_t *src, int32_t src_stride);
@ -958,14 +958,14 @@ void Blit_RGB444_RGB888ARMSIMDAsm(int32_t w, int32_t h, uint32_t *dst, int32_t d
static void static void
Blit_RGB444_RGB888ARMSIMD(SDL_BlitInfo * info) Blit_RGB444_RGB888ARMSIMD(SDL_BlitInfo * info)
{ {
int32_t width = info->dst_w; int32_t width = info->dst_w;
int32_t height = info->dst_h; int32_t height = info->dst_h;
uint32_t *dstp = (uint32_t *)info->dst; uint32_t *dstp = (uint32_t *)info->dst;
int32_t dststride = width + (info->dst_skip >> 2); int32_t dststride = width + (info->dst_skip >> 2);
uint16_t *srcp = (uint16_t *)info->src; uint16_t *srcp = (uint16_t *)info->src;
int32_t srcstride = width + (info->src_skip >> 1); int32_t srcstride = width + (info->src_skip >> 1);
Blit_RGB444_RGB888ARMSIMDAsm(width, height, dstp, dststride, srcp, srcstride); Blit_RGB444_RGB888ARMSIMDAsm(width, height, dstp, dststride, srcp, srcstride);
} }
#endif #endif

View file

@ -1839,7 +1839,7 @@ SDL_ConvertPixels_YUV_to_YUV(int width, int height,
return SDL_SetError("SDL_ConvertPixels_YUV_to_YUV: Unsupported YUV conversion: %s -> %s", SDL_GetPixelFormatName(src_format), SDL_GetPixelFormatName(dst_format)); return SDL_SetError("SDL_ConvertPixels_YUV_to_YUV: Unsupported YUV conversion: %s -> %s", SDL_GetPixelFormatName(src_format), SDL_GetPixelFormatName(dst_format));
} }
#else #else
return SDL_SetError("SDL not built with YUV support"); return SDL_SetError("SDL not built with YUV support");
#endif #endif
} }

View file

@ -173,8 +173,8 @@ KMSDRM_DumpCursorToBO(SDL_VideoDisplay *display, SDL_Cursor *cursor)
/* Copy from the cursor buffer to a buffer that we can dump to the GBM BO. */ /* Copy from the cursor buffer to a buffer that we can dump to the GBM BO. */
for (i = 0; i < curdata->h; i++) { for (i = 0; i < curdata->h; i++) {
src_row = &((uint8_t*)curdata->buffer)[i * curdata->w * 4]; src_row = &((uint8_t*)curdata->buffer)[i * curdata->w * 4];
SDL_memcpy(ready_buffer + (i * bo_stride), src_row, 4 * curdata->w); SDL_memcpy(ready_buffer + (i * bo_stride), src_row, 4 * curdata->w);
} }
/* Dump the cursor buffer to our GBM BO. */ /* Dump the cursor buffer to our GBM BO. */

View file

@ -60,9 +60,9 @@ SDL_KMSDRM_SYM(int,drmModeSetCrtc,(int fd, uint32_t crtcId, uint32_t bufferId,
uint32_t x, uint32_t y, uint32_t *connectors, int count, uint32_t x, uint32_t y, uint32_t *connectors, int count,
drmModeModeInfoPtr mode)) drmModeModeInfoPtr mode))
SDL_KMSDRM_SYM(int,drmModeCrtcGetGamma,(int fd, uint32_t crtc_id, uint32_t size, SDL_KMSDRM_SYM(int,drmModeCrtcGetGamma,(int fd, uint32_t crtc_id, uint32_t size,
uint16_t *red, uint16_t *green, uint16_t *blue)) uint16_t *red, uint16_t *green, uint16_t *blue))
SDL_KMSDRM_SYM(int,drmModeCrtcSetGamma,(int fd, uint32_t crtc_id, uint32_t size, SDL_KMSDRM_SYM(int,drmModeCrtcSetGamma,(int fd, uint32_t crtc_id, uint32_t size,
uint16_t *red, uint16_t *green, uint16_t *blue)) uint16_t *red, uint16_t *green, uint16_t *blue))
SDL_KMSDRM_SYM(int,drmModeSetCursor,(int fd, uint32_t crtcId, uint32_t bo_handle, SDL_KMSDRM_SYM(int,drmModeSetCursor,(int fd, uint32_t crtcId, uint32_t bo_handle,
uint32_t width, uint32_t height)) uint32_t width, uint32_t height))
SDL_KMSDRM_SYM(int,drmModeSetCursor2,(int fd, uint32_t crtcId, uint32_t bo_handle, SDL_KMSDRM_SYM(int,drmModeSetCursor2,(int fd, uint32_t crtcId, uint32_t bo_handle,

View file

@ -341,7 +341,7 @@ static HWND _makeDlg(const SDL_MessageBoxData *messageboxdata)
pDlgItem->cx = 147; pDlgItem->cx = 147;
pDlgItem->cy = 62; /* It will be used. */ pDlgItem->cy = 62; /* It will be used. */
pDlgItem->id = IDD_TEXT_MESSAGE; /* an ID value */ pDlgItem->id = IDD_TEXT_MESSAGE; /* an ID value */
if (pSDLColors == NULL) if (pSDLColors == NULL)
pDlgItem->offPresParams = 0; pDlgItem->offPresParams = 0;
else { else {

View file

@ -334,10 +334,10 @@ X11_MessageBoxInitPositions( SDL_MessageBoxDataX11 *data )
/* Location for first button. */ /* Location for first button. */
if ( messageboxdata->flags & SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT ) { if ( messageboxdata->flags & SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT ) {
x = data->dialog_width - ( data->dialog_width - width_of_buttons ) / 2 - ( button_width + button_spacing ); x = data->dialog_width - ( data->dialog_width - width_of_buttons ) / 2 - ( button_width + button_spacing );
} else { } else {
x = ( data->dialog_width - width_of_buttons ) / 2; x = ( data->dialog_width - width_of_buttons ) / 2;
} }
y = ybuttons + ( data->dialog_height - ybuttons - button_height ) / 2; y = ybuttons + ( data->dialog_height - ybuttons - button_height ) / 2;
for ( i = 0; i < data->numbuttons; i++ ) { for ( i = 0; i < data->numbuttons; i++ ) {
@ -352,11 +352,11 @@ X11_MessageBoxInitPositions( SDL_MessageBoxDataX11 *data )
data->buttonpos[ i ].y = y + ( button_height - button_text_height - 1 ) / 2 + button_text_height; data->buttonpos[ i ].y = y + ( button_height - button_text_height - 1 ) / 2 + button_text_height;
/* Scoot over for next button. */ /* Scoot over for next button. */
if ( messageboxdata->flags & SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT ) { if ( messageboxdata->flags & SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT ) {
x -= button_width + button_spacing; x -= button_width + button_spacing;
} else { } else {
x += button_width + button_spacing; x += button_width + button_spacing;
} }
} }
} }