[Commits] SDL: Fixed whitespace

libsdl.org revision control commits-owner at libsdl.org
Mon Sep 24 11:50:55 PDT 2018


details:   https://hg.libsdl.org/SDL/rev/8bdc4d340419
changeset: 12201:8bdc4d340419
user:      Sam Lantinga <slouken at libsdl.org>
date:      Mon Sep 24 11:49:25 2018 -0700
description:
Fixed whitespace

diffstat:

 src/SDL.c                                  |   14 +-
 src/audio/alsa/SDL_alsa_audio.c            |    2 +-
 src/audio/arts/SDL_artsaudio.c             |    2 +-
 src/audio/directsound/SDL_directsound.c    |    6 +-
 src/audio/pulseaudio/SDL_pulseaudio.c      |    2 +-
 src/audio/winmm/SDL_winmm.c                |    5 +-
 src/core/android/SDL_android.c             |    4 +-
 src/core/linux/SDL_dbus.h                  |    9 +-
 src/core/linux/SDL_udev.h                  |    4 +-
 src/core/winrt/SDL_winrtapp_xaml.cpp       |    2 +-
 src/joystick/SDL_gamecontroller.c          |    2 +-
 src/joystick/SDL_joystick.c                |   14 +-
 src/joystick/controller_type.h             |   77 +-
 src/joystick/haiku/SDL_haikujoystick.cc    |    2 +-
 src/joystick/windows/SDL_windowsjoystick.c |    2 +-
 src/main/haiku/SDL_BApp.h                  |    2 +-
 src/main/haiku/SDL_BeApp.cc                |   48 +-
 src/stdlib/SDL_iconv.c                     |   16 +-
 src/video/SDL_blit_1.c                     |  220 +++---
 src/video/SDL_blit_A.c                     |  998 ++++++++++++++--------------
 src/video/SDL_egl.c                        |    4 +-
 src/video/SDL_pixels.c                     |    2 +-
 src/video/SDL_shape_internals.h            |   12 +-
 src/video/SDL_video.c                      |    9 +-
 src/video/SDL_vulkan_utils.c               |    8 +-
 src/video/SDL_yuv.c                        |   26 +-
 src/video/android/SDL_androidvideo.c       |    8 +-
 src/video/cocoa/SDL_cocoaevents.m          |    4 +-
 src/video/cocoa/SDL_cocoametalview.m       |    6 +-
 src/video/cocoa/SDL_cocoamousetap.m        |    2 +-
 src/video/cocoa/SDL_cocoawindow.m          |    4 +-
 src/video/directfb/SDL_DirectFB_video.c    |    2 +-
 src/video/haiku/SDL_BWin.h                 |    2 +-
 src/video/haiku/SDL_bclipboard.cc          |   84 +-
 src/video/haiku/SDL_bevents.cc             |    2 +-
 src/video/haiku/SDL_bframebuffer.cc        |  302 ++++----
 src/video/haiku/SDL_bkeyboard.cc           |  252 +++---
 src/video/haiku/SDL_bmodes.cc              |  392 +++++-----
 src/video/haiku/SDL_bvideo.cc              |   33 +-
 src/video/haiku/SDL_bwindow.cc             |  156 ++--
 src/video/kmsdrm/SDL_kmsdrmmouse.c         |   10 +-
 src/video/kmsdrm/SDL_kmsdrmopengles.c      |   18 +-
 src/video/raspberry/SDL_rpivideo.c         |   18 +-
 src/video/uikit/SDL_uikitappdelegate.m     |    2 +-
 src/video/uikit/SDL_uikitmodes.m           |    2 +-
 src/video/uikit/SDL_uikitview.m            |   36 +-
 src/video/wayland/SDL_waylandevents.c      |    8 +-
 src/video/wayland/SDL_waylandtouch.c       |    6 +-
 src/video/wayland/SDL_waylandvideo.c       |    8 +-
 src/video/wayland/SDL_waylandwindow.c      |   16 +-
 src/video/windows/SDL_windowsopengl.h      |   48 +-
 src/video/windows/SDL_windowsvulkan.c      |    2 +-
 src/video/x11/SDL_x11opengl.h              |   16 +-
 src/video/x11/SDL_x11sym.h                 |    4 +-
 54 files changed, 1452 insertions(+), 1483 deletions(-)

diffs (4242 lines):

diff -r c0b17b32b95e -r 8bdc4d340419 src/SDL.c
--- a/src/SDL.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/SDL.c	Mon Sep 24 11:49:25 2018 -0700
@@ -124,11 +124,11 @@
     }
 
 #if SDL_VIDEO_DRIVER_WINDOWS
-	if ((flags & (SDL_INIT_HAPTIC|SDL_INIT_JOYSTICK))) {
-		if (SDL_HelperWindowCreate() < 0) {
-			return -1;
-		}
-	}
+    if ((flags & (SDL_INIT_HAPTIC|SDL_INIT_JOYSTICK))) {
+        if (SDL_HelperWindowCreate() < 0) {
+            return -1;
+        }
+    }
 #endif
 
 #if !SDL_TIMERS_DISABLED
@@ -263,8 +263,8 @@
 #if !SDL_SENSOR_DISABLED
     if ((flags & SDL_INIT_SENSOR)) {
         if (SDL_PrivateShouldQuitSubsystem(SDL_INIT_SENSOR)) {
-			SDL_SensorQuit();
-		}
+            SDL_SensorQuit();
+        }
         SDL_PrivateSubsystemRefCountDecr(SDL_INIT_SENSOR);
     }
 #endif
diff -r c0b17b32b95e -r 8bdc4d340419 src/audio/alsa/SDL_alsa_audio.c
--- a/src/audio/alsa/SDL_alsa_audio.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/audio/alsa/SDL_alsa_audio.c	Mon Sep 24 11:49:25 2018 -0700
@@ -445,7 +445,7 @@
 ALSA_CloseDevice(_THIS)
 {
     if (this->hidden->pcm_handle) {
-	/* Wait for the submitted audio to drain
+        /* Wait for the submitted audio to drain
            ALSA_snd_pcm_drop() can hang, so don't use that.
          */
         Uint32 delay = ((this->spec.samples * 1000) / this->spec.freq) * 2;
diff -r c0b17b32b95e -r 8bdc4d340419 src/audio/arts/SDL_artsaudio.c
--- a/src/audio/arts/SDL_artsaudio.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/audio/arts/SDL_artsaudio.c	Mon Sep 24 11:49:25 2018 -0700
@@ -39,7 +39,7 @@
 #include "SDL_name.h"
 #include "SDL_loadso.h"
 #else
-#define SDL_NAME(X)	X
+#define SDL_NAME(X) X
 #endif
 
 #ifdef SDL_AUDIO_DRIVER_ARTS_DYNAMIC
diff -r c0b17b32b95e -r 8bdc4d340419 src/audio/directsound/SDL_directsound.c
--- a/src/audio/directsound/SDL_directsound.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/audio/directsound/SDL_directsound.c	Mon Sep 24 11:49:25 2018 -0700
@@ -477,8 +477,8 @@
     SDL_bool tried_format = SDL_FALSE;
     SDL_AudioFormat test_format = SDL_FirstAudioFormat(this->spec.format);
     LPGUID guid = (LPGUID) handle;
-	DWORD bufsize;
-	
+    DWORD bufsize;
+
     /* Initialize all variables that we clean on shutdown */
     this->hidden = (struct SDL_PrivateAudioData *)
         SDL_malloc((sizeof *this->hidden));
@@ -526,7 +526,7 @@
                              (int) (DSBSIZE_MAX / numchunks));
             } else {
                 int rc;
-				WAVEFORMATEX wfmt;
+                WAVEFORMATEX wfmt;
                 SDL_zero(wfmt);
                 if (SDL_AUDIO_ISFLOAT(this->spec.format)) {
                     wfmt.wFormatTag = WAVE_FORMAT_IEEE_FLOAT;
diff -r c0b17b32b95e -r 8bdc4d340419 src/audio/pulseaudio/SDL_pulseaudio.c
--- a/src/audio/pulseaudio/SDL_pulseaudio.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/audio/pulseaudio/SDL_pulseaudio.c	Mon Sep 24 11:49:25 2018 -0700
@@ -109,7 +109,7 @@
     pa_stream_success_cb_t, void *);
 static int (*PULSEAUDIO_pa_stream_peek) (pa_stream *, const void **, size_t *);
 static int (*PULSEAUDIO_pa_stream_drop) (pa_stream *);
-static pa_operation * (*PULSEAUDIO_pa_stream_flush)	(pa_stream *,
+static pa_operation * (*PULSEAUDIO_pa_stream_flush) (pa_stream *,
     pa_stream_success_cb_t, void *);
 static int (*PULSEAUDIO_pa_stream_disconnect) (pa_stream *);
 static void (*PULSEAUDIO_pa_stream_unref) (pa_stream *);
diff -r c0b17b32b95e -r 8bdc4d340419 src/audio/winmm/SDL_winmm.c
--- a/src/audio/winmm/SDL_winmm.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/audio/winmm/SDL_winmm.c	Mon Sep 24 11:49:25 2018 -0700
@@ -78,7 +78,7 @@
     capstyp##2W caps; \
     UINT i; \
     for (i = 0; i < devcount; i++) { \
-	if (wave##typ##GetDevCaps(i,(LP##capstyp##W)&caps,sizeof(caps))==MMSYSERR_NOERROR) { \
+        if (wave##typ##GetDevCaps(i,(LP##capstyp##W)&caps,sizeof(caps))==MMSYSERR_NOERROR) { \
             char *name = WIN_LookupAudioDeviceName(caps.szPname,&caps.NameGuid); \
             if (name != NULL) { \
                 SDL_AddAudioDevice((int) iscapture, name, (void *) ((size_t) i+1)); \
@@ -375,8 +375,7 @@
 #endif
 
     /* Create the audio buffer semaphore */
-    this->hidden->audio_sem =
-		CreateSemaphore(NULL, iscapture ? 0 : NUM_BUFFERS - 1, NUM_BUFFERS, NULL);
+    this->hidden->audio_sem = CreateSemaphore(NULL, iscapture ? 0 : NUM_BUFFERS - 1, NUM_BUFFERS, NULL);
     if (this->hidden->audio_sem == NULL) {
         return SDL_SetError("Couldn't create semaphore");
     }
diff -r c0b17b32b95e -r 8bdc4d340419 src/core/android/SDL_android.c
--- a/src/core/android/SDL_android.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/core/android/SDL_android.c	Mon Sep 24 11:49:25 2018 -0700
@@ -77,7 +77,7 @@
 JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeResize)(
         JNIEnv* env, jclass jcls,
         jint surfaceWidth, jint surfaceHeight,
-		jint deviceWidth, jint deviceHeight, jint format, jfloat rate);
+        jint deviceWidth, jint deviceHeight, jint format, jfloat rate);
 
 JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeSurfaceChanged)(
         JNIEnv* env, jclass jcls);
@@ -537,7 +537,7 @@
 JNIEXPORT void JNICALL SDL_JAVA_INTERFACE(onNativeResize)(
                                     JNIEnv* env, jclass jcls,
                                     jint surfaceWidth, jint surfaceHeight,
-									jint deviceWidth, jint deviceHeight, jint format, jfloat rate)
+                                    jint deviceWidth, jint deviceHeight, jint format, jfloat rate)
 {
     Android_SetScreenResolution(surfaceWidth, surfaceHeight, deviceWidth, deviceHeight, format, rate);
 }
diff -r c0b17b32b95e -r 8bdc4d340419 src/core/linux/SDL_dbus.h
--- a/src/core/linux/SDL_dbus.h	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/core/linux/SDL_dbus.h	Mon Sep 24 11:49:25 2018 -0700
@@ -39,9 +39,8 @@
     void (*bus_add_match)(DBusConnection *, const char *, DBusError *);
     DBusConnection * (*connection_open_private)(const char *, DBusError *);
     void (*connection_set_exit_on_disconnect)(DBusConnection *, dbus_bool_t);
-    dbus_bool_t (*connection_get_is_connected)(DBusConnection *); 	
-    dbus_bool_t (*connection_add_filter)(DBusConnection *, DBusHandleMessageFunction,
-	    void *, DBusFreeFunction);
+    dbus_bool_t (*connection_get_is_connected)(DBusConnection *);
+    dbus_bool_t (*connection_add_filter)(DBusConnection *, DBusHandleMessageFunction, void *, DBusFreeFunction);
     dbus_bool_t (*connection_try_register_object_path)(DBusConnection *, const char *,
         const DBusObjectPathVTable *, void *, DBusError *);
     dbus_bool_t (*connection_send)(DBusConnection *, DBusMessage *, dbus_uint32_t *);
@@ -51,7 +50,7 @@
     void (*connection_flush)(DBusConnection *);
     dbus_bool_t (*connection_read_write)(DBusConnection *, int);
     DBusDispatchStatus (*connection_dispatch)(DBusConnection *);
-    dbus_bool_t (*message_is_signal)(DBusMessage *, const char *, const char *); 	
+    dbus_bool_t (*message_is_signal)(DBusMessage *, const char *, const char *); 
     DBusMessage *(*message_new_method_call)(const char *, const char *, const char *, const char *);
     dbus_bool_t (*message_append_args)(DBusMessage *, int, ...);
     dbus_bool_t (*message_append_args_valist)(DBusMessage *, int, va_list);
@@ -61,7 +60,7 @@
     dbus_bool_t (*message_iter_next)(DBusMessageIter *);
     void (*message_iter_get_basic)(DBusMessageIter *, void *);
     int (*message_iter_get_arg_type)(DBusMessageIter *);
-    void (*message_iter_recurse)(DBusMessageIter *, DBusMessageIter *); 	 	
+    void (*message_iter_recurse)(DBusMessageIter *, DBusMessageIter *); 
     void (*message_unref)(DBusMessage *);
     void (*error_init)(DBusError *);
     dbus_bool_t (*error_is_set)(const DBusError *);
diff -r c0b17b32b95e -r 8bdc4d340419 src/core/linux/SDL_udev.h
--- a/src/core/linux/SDL_udev.h	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/core/linux/SDL_udev.h	Mon Sep 24 11:49:25 2018 -0700
@@ -77,9 +77,9 @@
     const char *(*udev_device_get_action)(struct udev_device *);
     const char *(*udev_device_get_devnode)(struct udev_device *);
     const char *(*udev_device_get_subsystem)(struct udev_device *);
-	struct udev_device *(*udev_device_get_parent_with_subsystem_devtype)(struct udev_device *udev_device, const char *subsystem, const char *devtype);
+    struct udev_device *(*udev_device_get_parent_with_subsystem_devtype)(struct udev_device *udev_device, const char *subsystem, const char *devtype);
     const char *(*udev_device_get_property_value)(struct udev_device *, const char *);
-	const char *(*udev_device_get_sysattr_value)(struct udev_device *udev_device, const char *sysattr);
+    const char *(*udev_device_get_sysattr_value)(struct udev_device *udev_device, const char *sysattr);
     struct udev_device *(*udev_device_new_from_syspath)(struct udev *, const char *);
     void (*udev_device_unref)(struct udev_device *);
     int (*udev_enumerate_add_match_property)(struct udev_enumerate *, const char *, const char *);
diff -r c0b17b32b95e -r 8bdc4d340419 src/core/winrt/SDL_winrtapp_xaml.cpp
--- a/src/core/winrt/SDL_winrtapp_xaml.cpp	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/core/winrt/SDL_winrtapp_xaml.cpp	Mon Sep 24 11:49:25 2018 -0700
@@ -44,7 +44,7 @@
 #if WINAPI_FAMILY == WINAPI_FAMILY_APP
 extern "C"
 ISwapChainBackgroundPanelNative * WINRT_GlobalSwapChainBackgroundPanelNative = NULL;
-static Windows::Foundation::EventRegistrationToken	WINRT_XAMLAppEventToken;
+static Windows::Foundation::EventRegistrationToken  WINRT_XAMLAppEventToken;
 #endif
 
 
diff -r c0b17b32b95e -r 8bdc4d340419 src/joystick/SDL_gamecontroller.c
--- a/src/joystick/SDL_gamecontroller.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/joystick/SDL_gamecontroller.c	Mon Sep 24 11:49:25 2018 -0700
@@ -1027,7 +1027,7 @@
     }
 #ifdef __ANDROID__
     if (!mapping && name && !SDL_IsJoystickHIDAPI(guid)) {
-		mapping = SDL_CreateMappingForAndroidController(name, guid);
+        mapping = SDL_CreateMappingForAndroidController(name, guid);
     }
 #endif
     if (!mapping) {
diff -r c0b17b32b95e -r 8bdc4d340419 src/joystick/SDL_joystick.c
--- a/src/joystick/SDL_joystick.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/joystick/SDL_joystick.c	Mon Sep 24 11:49:25 2018 -0700
@@ -1141,13 +1141,13 @@
 SDL_bool
 SDL_IsJoystickXbox360(Uint16 vendor, Uint16 product)
 {
-	/* Filter out some bogus values here */
-	if (vendor == 0x0000 && product == 0x0000) {
-		return SDL_FALSE;
-	}
-	if (vendor == 0x0001 && product == 0x0001) {
-		return SDL_FALSE;
-	}
+    /* Filter out some bogus values here */
+    if (vendor == 0x0000 && product == 0x0000) {
+        return SDL_FALSE;
+    }
+    if (vendor == 0x0001 && product == 0x0001) {
+        return SDL_FALSE;
+    }
     return (GuessControllerType(vendor, product) == k_eControllerType_XBox360Controller);
 }
 
diff -r c0b17b32b95e -r 8bdc4d340419 src/joystick/controller_type.h
--- a/src/joystick/controller_type.h	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/joystick/controller_type.h	Mon Sep 24 11:49:25 2018 -0700
@@ -43,9 +43,6 @@
 	k_eControllerType_SteamController = 2,
 	k_eControllerType_SteamControllerV2 = 3,
 
-	// IR Remote controls on Steambox
-	k_eControllerType_FrontPanelBoard = 20,
-
 	// Other Controllers
 	k_eControllerType_UnknownNonSteamController = 30,
 	k_eControllerType_XBox360Controller = 31,
@@ -73,49 +70,6 @@
 	return ( eType == k_eControllerType_SteamController || eType == k_eControllerType_SteamControllerV2 );
 }
 
-#if 0  /* these are currently unused, so #if 0'd out to prevent compiler warnings for now */
-static inline bool BIsSteamHardwareDevice( EControllerType eType )
-{
-	return ( eType == k_eControllerType_SteamController || eType == k_eControllerType_SteamControllerV2 || eType == k_eControllerType_FrontPanelBoard );
-}
-
-static inline bool BIsXInputController( EControllerType eType )
-{
-	return ( eType == k_eControllerType_XBox360Controller || eType == k_eControllerType_XBoxOneController || eType == k_eControllerType_UnknownNonSteamController );
-}
-
-static inline bool BIsSwitchController( EControllerType eType )
-{
-    return ( eType == k_eControllerType_SwitchJoyConLeft || eType == k_eControllerType_SwitchJoyConRight ||
-             eType == k_eControllerType_SwitchJoyConPair || eType == k_eControllerType_SwitchProController ||
-             eType == k_eControllerType_SwitchInputOnlyController );
-}
-
-/* XXX: this should be updated when we ship nintentdo switch controller support */
-static inline bool BIsRawHIDDevice( EControllerType eType )
-{
-	return BIsSteamHardwareDevice( eType) || eType == k_eControllerType_PS4Controller || BIsSwitchController( eType );
-}
-
-// 'Full' here means that the controller has a full complement of buttons, joysticks, etc, as compared to
-// the single Joy-Con's that only have around half of the controls that a normal controller has
-static inline bool BIsFullSwitchController( EControllerType eType )
-{
-    return ( eType == k_eControllerType_SwitchJoyConPair || eType == k_eControllerType_SwitchProController );
-}
-
-static inline bool BIsCompatibleType( EControllerType eTypeA, EControllerType eTypeB )
-{
-	if ( BIsSteamController( eTypeA ) && BIsSteamController( eTypeB ) )
-		return true;
-	if ( BIsXInputController( eTypeA ) && BIsXInputController( eTypeB ) )
-		return true;
-	if ( eTypeA == eTypeB )
-		return true;
-	return false;
-}
-#endif
-
 #define MAKE_CONTROLLER_ID( nVID, nPID )	(unsigned int)( nVID << 16 | nPID )
 typedef struct
 {
@@ -168,7 +122,6 @@
 	{ MAKE_CONTROLLER_ID( 0x146b, 0x0603 ), k_eControllerType_PS3Controller },		// From SDL
 	{ MAKE_CONTROLLER_ID( 0x044f, 0xb315 ), k_eControllerType_PS3Controller },		// Firestorm Dual Analog 3
 	{ MAKE_CONTROLLER_ID( 0x0925, 0x8888 ), k_eControllerType_PS3Controller },		// Actually ps2 -maybe break out later Lakeview Research WiseGroup Ltd, MP-8866 Dual Joypad
-	{ MAKE_CONTROLLER_ID( 0x146b, 0x0602 ), k_eControllerType_PS3Controller },		// From SDL
 	{ MAKE_CONTROLLER_ID( 0x0f0d, 0x004d ), k_eControllerType_PS3Controller },		// Horipad 3
 	{ MAKE_CONTROLLER_ID( 0x0f0d, 0x0009 ), k_eControllerType_PS3Controller },		// HORI BDA GP1
 	{ MAKE_CONTROLLER_ID( 0x0e8f, 0x0008 ), k_eControllerType_PS3Controller },		// Green Asia
@@ -214,8 +167,8 @@
 	{ MAKE_CONTROLLER_ID( 0x1532, 0x1000 ), k_eControllerType_PS4Controller },		// Razer Raiju PS4 Controller
 	{ MAKE_CONTROLLER_ID( 0x1532, 0X0401 ), k_eControllerType_PS4Controller },		// Razer Panthera PS4 Controller
 	{ MAKE_CONTROLLER_ID( 0x054c, 0x05c5 ), k_eControllerType_PS4Controller },		// STRIKEPAD PS4 Grip Add-on
-	{ MAKE_CONTROLLER_ID( 0x146b, 0x0d01 ), k_eControllerType_PS4Controller },		// Nacon Revolution Pro Controller
-	{ MAKE_CONTROLLER_ID( 0x146b, 0x0d02 ), k_eControllerType_PS4Controller },		// Nacon Revolution Pro Controller v2
+	{ MAKE_CONTROLLER_ID( 0x146b, 0x0d01 ), k_eControllerType_PS4Controller },		// Nacon Revolution Pro Controller - has gyro
+	{ MAKE_CONTROLLER_ID( 0x146b, 0x0d02 ), k_eControllerType_PS4Controller },		// Nacon Revolution Pro Controller v2 - has gyro
 	{ MAKE_CONTROLLER_ID( 0x0f0d, 0x00a0 ), k_eControllerType_PS4Controller },		// HORI TAC4 mousething
 	{ MAKE_CONTROLLER_ID( 0x0f0d, 0x009c ), k_eControllerType_PS4Controller },		// HORI TAC PRO mousething
 	{ MAKE_CONTROLLER_ID( 0x0c12, 0x0ef6 ), k_eControllerType_PS4Controller },		// Hitbox Arcade Stick
@@ -224,7 +177,15 @@
 	{ MAKE_CONTROLLER_ID( 0x0f0d, 0x00ee ), k_eControllerType_PS4Controller },		// Hori mini wired https://www.playstation.com/en-us/explore/accessories/gaming-controllers/mini-wired-gamepad/
 	{ MAKE_CONTROLLER_ID( 0x0738, 0x8481 ), k_eControllerType_PS4Controller },		// Mad Catz FightStick TE 2+ PS4
 	{ MAKE_CONTROLLER_ID( 0x0738, 0x8480 ), k_eControllerType_PS4Controller },		// Mad Catz FightStick TE 2 PS4
-	{ MAKE_CONTROLLER_ID( 0x7545, 0x0104 ), k_eControllerType_PS4Controller },		// Armor 3 or Level Up Cobra
+	{ MAKE_CONTROLLER_ID( 0x7545, 0x0104 ), k_eControllerType_PS4Controller },		// Armor 3 or Level Up Cobra - At least one variant has gyro
+	{ MAKE_CONTROLLER_ID( 0x0c12, 0x0e15 ), k_eControllerType_PS4Controller },		// Game:Pad 4
+	{ MAKE_CONTROLLER_ID( 0x11c0, 0x4001 ), k_eControllerType_PS4Controller },		// "PS4 Fun Controller" added from user log
+
+	{ MAKE_CONTROLLER_ID( 0x1532, 0x1007 ), k_eControllerType_PS4Controller },		// Razer Raiju 2 Tournament edition USB- untested and added for razer
+	{ MAKE_CONTROLLER_ID( 0x1532, 0x100A ), k_eControllerType_PS4Controller },		// Razer Raiju 2 Tournament edition BT - untested and added for razer
+	{ MAKE_CONTROLLER_ID( 0x1532, 0x1004 ), k_eControllerType_PS4Controller },		// Razer Raiju 2 Ultimate USB - untested and added for razer
+	{ MAKE_CONTROLLER_ID( 0x1532, 0x1009 ), k_eControllerType_PS4Controller },		// Razer Raiju 2 Ultimate BT - untested and added for razer
+	{ MAKE_CONTROLLER_ID( 0x1532, 0x1008 ), k_eControllerType_PS4Controller },		// Razer Panthera Evo Fightstick - untested and added for razer
 
 	{ MAKE_CONTROLLER_ID( 0x056e, 0x2004 ), k_eControllerType_XBox360Controller },	// Elecom JC-U3613M
 	{ MAKE_CONTROLLER_ID( 0x06a3, 0xf51a ), k_eControllerType_XBox360Controller },	// Saitek P3600
@@ -400,32 +361,42 @@
 	{ MAKE_CONTROLLER_ID( 0x0079, 0x187c ), k_eControllerType_XBox360Controller },	// Unknown Controller
 	{ MAKE_CONTROLLER_ID( 0x0079, 0x189c ), k_eControllerType_XBox360Controller },	// Unknown Controller
 	{ MAKE_CONTROLLER_ID( 0x0079, 0x1874 ), k_eControllerType_XBox360Controller },	// Unknown Controller
+
+	{ MAKE_CONTROLLER_ID( 0x1038, 0xb360 ), k_eControllerType_XBox360Controller },	// SteelSeries Nimbus/Stratus XL
+
 																					
 	//{ MAKE_CONTROLLER_ID( 0x1949, 0x0402 ), /*android*/ },	// Unknown Controller
 
 	{ MAKE_CONTROLLER_ID( 0x05ac, 0x0001 ), k_eControllerType_AppleController },	// MFI Extended Gamepad (generic entry for iOS/tvOS)
 	{ MAKE_CONTROLLER_ID( 0x05ac, 0x0002 ), k_eControllerType_AppleController },	// MFI Standard Gamepad (generic entry for iOS/tvOS)
-	{ MAKE_CONTROLLER_ID( 0x1038, 0xb360 ), k_eControllerType_AppleController },	// SteelSeries Nimbus
 
     // We currently don't support using a pair of Switch Joy-Con's as a single
     // controller and we don't want to support using them individually for the
     // time being, so these should be disabled until one of the above is true
     // { MAKE_CONTROLLER_ID( 0x057e, 0x2006 ), k_eControllerType_SwitchJoyConLeft },    // Nintendo Switch Joy-Con (Left)
     // { MAKE_CONTROLLER_ID( 0x057e, 0x2007 ), k_eControllerType_SwitchJoyConRight },   // Nintendo Switch Joy-Con (Right)
+
+    // This same controller ID is spoofed by many 3rd-party Switch controllers.
+    // The ones we currently know of are:
+    // * Any 8bitdo controller with Switch support
+    // * ORTZ Gaming Wireless Pro Controller
+    // * ZhiXu Gamepad Wireless
+    // * Sunwaytek Wireless Motion Controller for Nintendo Switch
 	{ MAKE_CONTROLLER_ID( 0x057e, 0x2009 ), k_eControllerType_SwitchProController },        // Nintendo Switch Pro Controller
+    
     { MAKE_CONTROLLER_ID( 0x0f0d, 0x00c1 ), k_eControllerType_SwitchInputOnlyController },  // HORIPAD for Nintendo Switch
     { MAKE_CONTROLLER_ID( 0x20d6, 0xa711 ), k_eControllerType_SwitchInputOnlyController },  // PowerA Wired Controller Plus
+    { MAKE_CONTROLLER_ID( 0x0f0d, 0x0092 ), k_eControllerType_SwitchInputOnlyController },  // HORI Pokken Tournament DX Pro Pad
 
 
 	// Valve products - don't add to public list
-    { MAKE_CONTROLLER_ID( 0x0000, 0x11fa ), k_eControllerType_MobileTouch },		// Streaming mobile touch virtual controls
+    { MAKE_CONTROLLER_ID( 0x0000, 0x11fb ), k_eControllerType_MobileTouch },		// Streaming mobile touch virtual controls
 	{ MAKE_CONTROLLER_ID( 0x28de, 0x1101 ), k_eControllerType_SteamController },	// Valve Legacy Steam Controller (CHELL)
 	{ MAKE_CONTROLLER_ID( 0x28de, 0x1102 ), k_eControllerType_SteamController },	// Valve wired Steam Controller (D0G)
 	{ MAKE_CONTROLLER_ID( 0x28de, 0x1105 ), k_eControllerType_SteamControllerV2 },	// Valve Bluetooth Steam Controller (D0G)
 	{ MAKE_CONTROLLER_ID( 0x28de, 0x1106 ), k_eControllerType_SteamControllerV2 },	// Valve Bluetooth Steam Controller (D0G)
 	{ MAKE_CONTROLLER_ID( 0x28de, 0x1142 ), k_eControllerType_SteamController },	// Valve wireless Steam Controller
 	{ MAKE_CONTROLLER_ID( 0x28de, 0x1201 ), k_eControllerType_SteamController },	// Valve wired Steam Controller (HEADCRAB)
-	{ MAKE_CONTROLLER_ID( 0x28de, 0x1202 ), k_eControllerType_SteamControllerV2 },	// Valve Bluetooth Steam Controller (HEADCRAB)
 };
 
 
diff -r c0b17b32b95e -r 8bdc4d340419 src/joystick/haiku/SDL_haikujoystick.cc
--- a/src/joystick/haiku/SDL_haikujoystick.cc	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/joystick/haiku/SDL_haikujoystick.cc	Mon Sep 24 11:49:25 2018 -0700
@@ -36,7 +36,7 @@
 
 
 /* The maximum number of joysticks we'll detect */
-#define MAX_JOYSTICKS	16
+#define MAX_JOYSTICKS   16
 
 /* A list of available joysticks */
     static char *SDL_joyport[MAX_JOYSTICKS];
diff -r c0b17b32b95e -r 8bdc4d340419 src/joystick/windows/SDL_windowsjoystick.c
--- a/src/joystick/windows/SDL_windowsjoystick.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/joystick/windows/SDL_windowsjoystick.c	Mon Sep 24 11:49:25 2018 -0700
@@ -255,7 +255,7 @@
             /* WM_DEVICECHANGE not working, no XINPUT, no point in keeping thread alive */
             break;
 #endif /* SDL_JOYSTICK_XINPUT */
-		}
+        }
 
         if (s_bWindowsDeviceChanged || bXInputChanged) {
             s_bDeviceRemoved = SDL_TRUE;
diff -r c0b17b32b95e -r 8bdc4d340419 src/main/haiku/SDL_BApp.h
--- a/src/main/haiku/SDL_BApp.h	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/main/haiku/SDL_BApp.h	Mon Sep 24 11:49:25 2018 -0700
@@ -198,7 +198,7 @@
             _current_context->UnlockGL();
         _current_context = newContext;
         if (_current_context)
-	        _current_context->LockGL();
+            _current_context->LockGL();
     }
 #endif
 
diff -r c0b17b32b95e -r 8bdc4d340419 src/main/haiku/SDL_BeApp.cc
--- a/src/main/haiku/SDL_BeApp.cc	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/main/haiku/SDL_BeApp.cc	Mon Sep 24 11:49:25 2018 -0700
@@ -31,7 +31,7 @@
 #include <storage/File.h>
 #include <unistd.h>
 
-#include "SDL_BApp.h"	/* SDL_BApp class definition */
+#include "SDL_BApp.h"   /* SDL_BApp class definition */
 #include "SDL_BeApp.h"
 #include "SDL_timer.h"
 #include "SDL_error.h"
@@ -53,24 +53,24 @@
 {
     BApplication *App;
 
-	// default application signature
-	const char *signature = "application/x-SDL-executable";
-	// dig resources for correct signature
-	image_info info;
-	int32 cookie = 0;
-	if (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) {
-		BFile f(info.name, O_RDONLY);
-		if (f.InitCheck() == B_OK) {
-			BAppFileInfo app_info(&f);
-			if (app_info.InitCheck() == B_OK) {
-				char sig[B_MIME_TYPE_LENGTH];
-				if (app_info.GetSignature(sig) == B_OK)
-					signature = strndup(sig, B_MIME_TYPE_LENGTH);
-			}
-		}
-	}
+    // default application signature
+    const char *signature = "application/x-SDL-executable";
+    // dig resources for correct signature
+    image_info info;
+    int32 cookie = 0;
+    if (get_next_image_info(B_CURRENT_TEAM, &cookie, &info) == B_OK) {
+        BFile f(info.name, O_RDONLY);
+        if (f.InitCheck() == B_OK) {
+            BAppFileInfo app_info(&f);
+            if (app_info.InitCheck() == B_OK) {
+                char sig[B_MIME_TYPE_LENGTH];
+                if (app_info.GetSignature(sig) == B_OK)
+                    signature = strndup(sig, B_MIME_TYPE_LENGTH);
+            }
+        }
+    }
 
-	App = new SDL_BApp(signature);
+    App = new SDL_BApp(signature);
 
     App->Run();
     delete App;
@@ -144,12 +144,12 @@
 
 /* SDL_BApp functions */
 void SDL_BApp::ClearID(SDL_BWin *bwin) {
-	_SetSDLWindow(NULL, bwin->GetID());
-	int32 i = _GetNumWindowSlots() - 1;
-	while(i >= 0 && GetSDLWindow(i) == NULL) {
-		_PopBackWindow();
-		--i;
-	}
+    _SetSDLWindow(NULL, bwin->GetID());
+    int32 i = _GetNumWindowSlots() - 1;
+    while(i >= 0 && GetSDLWindow(i) == NULL) {
+        _PopBackWindow();
+        --i;
+    }
 }
 
 #endif /* __HAIKU__ */
diff -r c0b17b32b95e -r 8bdc4d340419 src/stdlib/SDL_iconv.c
--- a/src/stdlib/SDL_iconv.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/stdlib/SDL_iconv.c	Mon Sep 24 11:49:25 2018 -0700
@@ -89,13 +89,13 @@
 #else
 
 /* Lots of useful information on Unicode at:
-	http://www.cl.cam.ac.uk/~mgk25/unicode.html
+    http://www.cl.cam.ac.uk/~mgk25/unicode.html
 */
 
-#define UNICODE_BOM	0xFEFF
+#define UNICODE_BOM    0xFEFF
 
-#define UNKNOWN_ASCII	'?'
-#define UNKNOWN_UNICODE	0xFFFD
+#define UNKNOWN_ASCII    '?'
+#define UNKNOWN_UNICODE    0xFFFD
 
 enum
 {
@@ -115,13 +115,13 @@
     ENCODING_UCS4LE,
 };
 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
-#define ENCODING_UTF16NATIVE	ENCODING_UTF16BE
-#define ENCODING_UTF32NATIVE	ENCODING_UTF32BE
+#define ENCODING_UTF16NATIVE    ENCODING_UTF16BE
+#define ENCODING_UTF32NATIVE    ENCODING_UTF32BE
 #define ENCODING_UCS2NATIVE     ENCODING_UCS2BE
 #define ENCODING_UCS4NATIVE     ENCODING_UCS4BE
 #else
-#define ENCODING_UTF16NATIVE	ENCODING_UTF16LE
-#define ENCODING_UTF32NATIVE	ENCODING_UTF32LE
+#define ENCODING_UTF16NATIVE    ENCODING_UTF16LE
+#define ENCODING_UTF32NATIVE    ENCODING_UTF32LE
 #define ENCODING_UCS2NATIVE     ENCODING_UCS2LE
 #define ENCODING_UCS4NATIVE     ENCODING_UCS4LE
 #endif
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/SDL_blit_1.c
--- a/src/video/SDL_blit_1.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/SDL_blit_1.c	Mon Sep 24 11:49:25 2018 -0700
@@ -49,13 +49,13 @@
     while (height--) {
 #ifdef USE_DUFFS_LOOP
         /* *INDENT-OFF* */
-		DUFFS_LOOP(
-			{
-			  *dst = map[*src];
-			}
-			dst++;
-			src++;
-		, width);
+        DUFFS_LOOP(
+            {
+              *dst = map[*src];
+            }
+            dst++;
+            src++;
+        , width);
         /* *INDENT-ON* */
 #else
         for (c = width; c; --c) {
@@ -72,11 +72,11 @@
 /* This is now endian dependent */
 #ifndef USE_DUFFS_LOOP
 # if ( SDL_BYTEORDER == SDL_LIL_ENDIAN )
-#  define HI	1
-#  define LO	0
+#  define HI    1
+#  define LO    0
 # else /* ( SDL_BYTEORDER == SDL_BIG_ENDIAN ) */
-#  define HI	0
-#  define LO	1
+#  define HI    0
+#  define LO    1
 # endif
 #endif
 static void
@@ -101,14 +101,14 @@
 
 #ifdef USE_DUFFS_LOOP
     while (height--) {
-		/* *INDENT-OFF* */
-		DUFFS_LOOP(
-		{
-			*(Uint16 *)dst = map[*src++];
-			dst += 2;
-		},
-		width);
-		/* *INDENT-ON* */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP(
+        {
+            *(Uint16 *)dst = map[*src++];
+            dst += 2;
+        },
+        width);
+        /* *INDENT-ON* */
         src += srcskip;
         dst += dstskip;
     }
@@ -208,18 +208,18 @@
 
     while (height--) {
 #ifdef USE_DUFFS_LOOP
-		/* *INDENT-OFF* */
-		DUFFS_LOOP(
-			{
-				o = *src * 4;
-				dst[0] = map[o++];
-				dst[1] = map[o++];
-				dst[2] = map[o++];
-			}
-			src++;
-			dst += 3;
-		, width);
-		/* *INDENT-ON* */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP(
+            {
+                o = *src * 4;
+                dst[0] = map[o++];
+                dst[1] = map[o++];
+                dst[2] = map[o++];
+            }
+            src++;
+            dst += 3;
+        , width);
+        /* *INDENT-ON* */
 #else
         for (c = width; c; --c) {
             o = *src * 4;
@@ -257,11 +257,11 @@
 
     while (height--) {
 #ifdef USE_DUFFS_LOOP
-		/* *INDENT-OFF* */
-		DUFFS_LOOP(
-			*dst++ = map[*src++];
-		, width);
-		/* *INDENT-ON* */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP(
+            *dst++ = map[*src++];
+        , width);
+        /* *INDENT-ON* */
 #else
         for (c = width / 4; c; --c) {
             *dst++ = map[*src++];
@@ -297,33 +297,33 @@
 
     if (palmap) {
         while (height--) {
-			/* *INDENT-OFF* */
-			DUFFS_LOOP(
-			{
-				if ( *src != ckey ) {
-				  *dst = palmap[*src];
-				}
-				dst++;
-				src++;
-			},
-			width);
-			/* *INDENT-ON* */
+            /* *INDENT-OFF* */
+            DUFFS_LOOP(
+            {
+                if ( *src != ckey ) {
+                  *dst = palmap[*src];
+                }
+                dst++;
+                src++;
+            },
+            width);
+            /* *INDENT-ON* */
             src += srcskip;
             dst += dstskip;
         }
     } else {
         while (height--) {
-			/* *INDENT-OFF* */
-			DUFFS_LOOP(
-			{
-				if ( *src != ckey ) {
-				  *dst = *src;
-				}
-				dst++;
-				src++;
-			},
-			width);
-			/* *INDENT-ON* */
+            /* *INDENT-OFF* */
+            DUFFS_LOOP(
+            {
+                if ( *src != ckey ) {
+                  *dst = *src;
+                }
+                dst++;
+                src++;
+            },
+            width);
+            /* *INDENT-ON* */
             src += srcskip;
             dst += dstskip;
         }
@@ -346,17 +346,17 @@
     dstskip /= 2;
 
     while (height--) {
-		/* *INDENT-OFF* */
-		DUFFS_LOOP(
-		{
-			if ( *src != ckey ) {
-				*dstp=palmap[*src];
-			}
-			src++;
-			dstp++;
-		},
-		width);
-		/* *INDENT-ON* */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP(
+        {
+            if ( *src != ckey ) {
+                *dstp=palmap[*src];
+            }
+            src++;
+            dstp++;
+        },
+        width);
+        /* *INDENT-ON* */
         src += srcskip;
         dstp += dstskip;
     }
@@ -376,20 +376,20 @@
     int o;
 
     while (height--) {
-		/* *INDENT-OFF* */
-		DUFFS_LOOP(
-		{
-			if ( *src != ckey ) {
-				o = *src * 4;
-				dst[0] = palmap[o++];
-				dst[1] = palmap[o++];
-				dst[2] = palmap[o++];
-			}
-			src++;
-			dst += 3;
-		},
-		width);
-		/* *INDENT-ON* */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP(
+        {
+            if ( *src != ckey ) {
+                o = *src * 4;
+                dst[0] = palmap[o++];
+                dst[1] = palmap[o++];
+                dst[2] = palmap[o++];
+            }
+            src++;
+            dst += 3;
+        },
+        width);
+        /* *INDENT-ON* */
         src += srcskip;
         dst += dstskip;
     }
@@ -411,17 +411,17 @@
     dstskip /= 4;
 
     while (height--) {
-		/* *INDENT-OFF* */
-		DUFFS_LOOP(
-		{
-			if ( *src != ckey ) {
-				*dstp = palmap[*src];
-			}
-			src++;
-			dstp++;
-		},
-		width);
-		/* *INDENT-ON* */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP(
+        {
+            if ( *src != ckey ) {
+                *dstp = palmap[*src];
+            }
+            src++;
+            dstp++;
+        },
+        width);
+        /* *INDENT-ON* */
         src += srcskip;
         dstp += dstskip;
     }
@@ -489,22 +489,22 @@
     dstbpp = dstfmt->BytesPerPixel;
 
     while (height--) {
-		/* *INDENT-OFF* */
-		DUFFS_LOOP(
-		{
-			if ( *src != ckey ) {
-				sR = srcpal[*src].r;
-				sG = srcpal[*src].g;
-				sB = srcpal[*src].b;
-				DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA);
-				ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA);
-			  	ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
-			}
-			src++;
-			dst += dstbpp;
-		},
-		width);
-		/* *INDENT-ON* */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP(
+        {
+            if ( *src != ckey ) {
+                sR = srcpal[*src].r;
+                sG = srcpal[*src].g;
+                sB = srcpal[*src].b;
+                DISEMBLE_RGBA(dst, dstbpp, dstfmt, pixel, dR, dG, dB, dA);
+                ALPHA_BLEND_RGBA(sR, sG, sB, A, dR, dG, dB, dA);
+                  ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
+            }
+            src++;
+            dst += dstbpp;
+        },
+        width);
+        /* *INDENT-ON* */
         src += srcskip;
         dst += dstskip;
     }
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/SDL_blit_A.c
--- a/src/video/SDL_blit_A.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/SDL_blit_A.c	Mon Sep 24 11:49:25 2018 -0700
@@ -45,28 +45,28 @@
     const unsigned A = info->a;
 
     while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4(
-	    {
-		DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
-		dR = dstfmt->palette->colors[*dst].r;
-		dG = dstfmt->palette->colors[*dst].g;
-		dB = dstfmt->palette->colors[*dst].b;
-		ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB);
-		dR &= 0xff;
-		dG &= 0xff;
-		dB &= 0xff;
-		/* Pack RGB into 8bit pixel */
-		if ( palmap == NULL ) {
-		    *dst =((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0));
-		} else {
-		    *dst = palmap[((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0))];
-		}
-		dst++;
-		src += srcbpp;
-	    },
-	    width);
-	    /* *INDENT-ON* */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP4(
+        {
+        DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
+        dR = dstfmt->palette->colors[*dst].r;
+        dG = dstfmt->palette->colors[*dst].g;
+        dB = dstfmt->palette->colors[*dst].b;
+        ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB);
+        dR &= 0xff;
+        dG &= 0xff;
+        dB &= 0xff;
+        /* Pack RGB into 8bit pixel */
+        if ( palmap == NULL ) {
+            *dst =((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0));
+        } else {
+            *dst = palmap[((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0))];
+        }
+        dst++;
+        src += srcbpp;
+        },
+        width);
+        /* *INDENT-ON* */
         src += srcskip;
         dst += dstskip;
     }
@@ -91,28 +91,28 @@
     unsigned dR, dG, dB;
 
     while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4(
-	    {
-		DISEMBLE_RGBA(src,srcbpp,srcfmt,Pixel,sR,sG,sB,sA);
-		dR = dstfmt->palette->colors[*dst].r;
-		dG = dstfmt->palette->colors[*dst].g;
-		dB = dstfmt->palette->colors[*dst].b;
-		ALPHA_BLEND_RGB(sR, sG, sB, sA, dR, dG, dB);
-		dR &= 0xff;
-		dG &= 0xff;
-		dB &= 0xff;
-		/* Pack RGB into 8bit pixel */
-		if ( palmap == NULL ) {
-		    *dst =((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0));
-		} else {
-		    *dst = palmap[((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0))];
-		}
-		dst++;
-		src += srcbpp;
-	    },
-	    width);
-	    /* *INDENT-ON* */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP4(
+        {
+        DISEMBLE_RGBA(src,srcbpp,srcfmt,Pixel,sR,sG,sB,sA);
+        dR = dstfmt->palette->colors[*dst].r;
+        dG = dstfmt->palette->colors[*dst].g;
+        dB = dstfmt->palette->colors[*dst].b;
+        ALPHA_BLEND_RGB(sR, sG, sB, sA, dR, dG, dB);
+        dR &= 0xff;
+        dG &= 0xff;
+        dB &= 0xff;
+        /* Pack RGB into 8bit pixel */
+        if ( palmap == NULL ) {
+            *dst =((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0));
+        } else {
+            *dst = palmap[((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0))];
+        }
+        dst++;
+        src += srcbpp;
+        },
+        width);
+        /* *INDENT-ON* */
         src += srcskip;
         dst += dstskip;
     }
@@ -139,30 +139,30 @@
     const unsigned A = info->a;
 
     while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP(
-	    {
-		DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
-		if ( Pixel != ckey ) {
-		    dR = dstfmt->palette->colors[*dst].r;
-		    dG = dstfmt->palette->colors[*dst].g;
-		    dB = dstfmt->palette->colors[*dst].b;
-		    ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB);
-		    dR &= 0xff;
-		    dG &= 0xff;
-		    dB &= 0xff;
-		    /* Pack RGB into 8bit pixel */
-		    if ( palmap == NULL ) {
+        /* *INDENT-OFF* */
+        DUFFS_LOOP(
+        {
+        DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
+        if ( Pixel != ckey ) {
+            dR = dstfmt->palette->colors[*dst].r;
+            dG = dstfmt->palette->colors[*dst].g;
+            dB = dstfmt->palette->colors[*dst].b;
+            ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB);
+            dR &= 0xff;
+            dG &= 0xff;
+            dB &= 0xff;
+            /* Pack RGB into 8bit pixel */
+            if ( palmap == NULL ) {
                 *dst =((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0));
-		    } else {
+            } else {
                 *dst = palmap[((dR>>5)<<(3+2))|((dG>>5)<<(2))|((dB>>6)<<(0))];
-		    }
-		}
-		dst++;
-		src += srcbpp;
-	    },
-	    width);
-	    /* *INDENT-ON* */
+            }
+        }
+        dst++;
+        src += srcbpp;
+        },
+        width);
+        /* *INDENT-ON* */
         src += srcskip;
         dst += dstskip;
     }
@@ -342,45 +342,45 @@
 
     mm_zero = _mm_setzero_si64();       /* 0 -> mm_zero */
     multmask = 0x00FF;
-	multmask <<= (ashift * 2);
-	multmask2 = 0x00FF00FF00FF00FFULL;
+    multmask <<= (ashift * 2);
+    multmask2 = 0x00FF00FF00FF00FFULL;
 
     while (height--) {
-		/* *INDENT-OFF* */
-		DUFFS_LOOP4({
-		Uint32 alpha = *srcp & amask;
-		if (alpha == 0) {
-			/* do nothing */
-		} else if (alpha == amask) {
-			*dstp = *srcp;
-		} else {
-			src1 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src1 (0000ARGB) */
-			src1 = _mm_unpacklo_pi8(src1, mm_zero); /* 0A0R0G0B -> src1 */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP4({
+        Uint32 alpha = *srcp & amask;
+        if (alpha == 0) {
+            /* do nothing */
+        } else if (alpha == amask) {
+            *dstp = *srcp;
+        } else {
+            src1 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src1 (0000ARGB) */
+            src1 = _mm_unpacklo_pi8(src1, mm_zero); /* 0A0R0G0B -> src1 */
 
-			dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB) */
-			dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
+            dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB) */
+            dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
 
-			mm_alpha = _mm_cvtsi32_si64(alpha); /* alpha -> mm_alpha (0000000A) */
-			mm_alpha = _mm_srli_si64(mm_alpha, ashift); /* mm_alpha >> ashift -> mm_alpha(0000000A) */
-			mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
-			mm_alpha2 = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha2 */
-			mm_alpha = _mm_or_si64(mm_alpha2, *(__m64 *) & multmask);	/* 0F0A0A0A -> mm_alpha */
-			mm_alpha2 = _mm_xor_si64(mm_alpha2, *(__m64 *) & multmask2);	/* 255 - mm_alpha -> mm_alpha */
+            mm_alpha = _mm_cvtsi32_si64(alpha); /* alpha -> mm_alpha (0000000A) */
+            mm_alpha = _mm_srli_si64(mm_alpha, ashift); /* mm_alpha >> ashift -> mm_alpha(0000000A) */
+            mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
+            mm_alpha2 = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha2 */
+            mm_alpha = _mm_or_si64(mm_alpha2, *(__m64 *) & multmask);    /* 0F0A0A0A -> mm_alpha */
+            mm_alpha2 = _mm_xor_si64(mm_alpha2, *(__m64 *) & multmask2);    /* 255 - mm_alpha -> mm_alpha */
 
-			/* blend */		    
-			src1 = _mm_mullo_pi16(src1, mm_alpha);
-			src1 = _mm_srli_pi16(src1, 8);
-			dst1 = _mm_mullo_pi16(dst1, mm_alpha2);
-			dst1 = _mm_srli_pi16(dst1, 8);
-			dst1 = _mm_add_pi16(src1, dst1);
-			dst1 = _mm_packs_pu16(dst1, mm_zero);
-			
-			*dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
-		}
-		++srcp;
-		++dstp;
-	    }, width);
-		/* *INDENT-ON* */
+            /* blend */            
+            src1 = _mm_mullo_pi16(src1, mm_alpha);
+            src1 = _mm_srli_pi16(src1, 8);
+            dst1 = _mm_mullo_pi16(dst1, mm_alpha2);
+            dst1 = _mm_srli_pi16(dst1, 8);
+            dst1 = _mm_add_pi16(src1, dst1);
+            dst1 = _mm_packs_pu16(dst1, mm_zero);
+            
+            *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
+        }
+        ++srcp;
+        ++dstp;
+        }, width);
+        /* *INDENT-ON* */
         srcp += srcskip;
         dstp += dstskip;
     }
@@ -401,14 +401,14 @@
     int dstskip = info->dst_skip >> 2;
 
     while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4({
-		    Uint32 s = *srcp++;
-		    Uint32 d = *dstp;
-		    *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1)
-			       + (s & d & 0x00010101)) | 0xff000000;
-	    }, width);
-	    /* *INDENT-ON* */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP4({
+            Uint32 s = *srcp++;
+            Uint32 d = *dstp;
+            *dstp++ = ((((s & 0x00fefefe) + (d & 0x00fefefe)) >> 1)
+                   + (s & d & 0x00010101)) | 0xff000000;
+        }, width);
+        /* *INDENT-ON* */
         srcp += srcskip;
         dstp += dstskip;
     }
@@ -434,22 +434,22 @@
         Uint32 d1;
 
         while (height--) {
-			/* *INDENT-OFF* */
-			DUFFS_LOOP4({
-				s = *srcp;
-				d = *dstp;
-				s1 = s & 0xff00ff;
-				d1 = d & 0xff00ff;
-				d1 = (d1 + ((s1 - d1) * alpha >> 8))
-				     & 0xff00ff;
-				s &= 0xff00;
-				d &= 0xff00;
-				d = (d + ((s - d) * alpha >> 8)) & 0xff00;
-				*dstp = d1 | d | 0xff000000;
-				++srcp;
-				++dstp;
-			}, width);
-			/* *INDENT-ON* */
+            /* *INDENT-OFF* */
+            DUFFS_LOOP4({
+                s = *srcp;
+                d = *dstp;
+                s1 = s & 0xff00ff;
+                d1 = d & 0xff00ff;
+                d1 = (d1 + ((s1 - d1) * alpha >> 8))
+                     & 0xff00ff;
+                s &= 0xff00;
+                d &= 0xff00;
+                d = (d + ((s - d) * alpha >> 8)) & 0xff00;
+                *dstp = d1 | d | 0xff000000;
+                ++srcp;
+                ++dstp;
+            }, width);
+            /* *INDENT-ON* */
             srcp += srcskip;
             dstp += dstskip;
         }
@@ -468,42 +468,42 @@
     int dstskip = info->dst_skip >> 2;
 
     while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4({
-		Uint32 dalpha;
-		Uint32 d;
-		Uint32 s1;
-		Uint32 d1;
-		Uint32 s = *srcp;
-		Uint32 alpha = s >> 24;
-		/* FIXME: Here we special-case opaque alpha since the
-		   compositioning used (>>8 instead of /255) doesn't handle
-		   it correctly. Also special-case alpha=0 for speed?
-		   Benchmark this! */
-		if (alpha) {
-		  if (alpha == SDL_ALPHA_OPAQUE) {
-			  *dstp = *srcp;
-		  } else {
-		    /*
-		     * take out the middle component (green), and process
-		     * the other two in parallel. One multiply less.
-		     */
-		    d = *dstp;
-			dalpha = d >> 24;
-		    s1 = s & 0xff00ff;
-		    d1 = d & 0xff00ff;
-		    d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff;
-		    s &= 0xff00;
-		    d &= 0xff00;
-		    d = (d + ((s - d) * alpha >> 8)) & 0xff00;
-			dalpha = alpha + (dalpha * (alpha ^ 0xFF) >> 8);
-		    *dstp = d1 | d | (dalpha << 24);
-		  }
-		}
-		++srcp;
-		++dstp;
-	    }, width);
-	    /* *INDENT-ON* */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP4({
+        Uint32 dalpha;
+        Uint32 d;
+        Uint32 s1;
+        Uint32 d1;
+        Uint32 s = *srcp;
+        Uint32 alpha = s >> 24;
+        /* FIXME: Here we special-case opaque alpha since the
+           compositioning used (>>8 instead of /255) doesn't handle
+           it correctly. Also special-case alpha=0 for speed?
+           Benchmark this! */
+        if (alpha) {
+          if (alpha == SDL_ALPHA_OPAQUE) {
+              *dstp = *srcp;
+          } else {
+            /*
+             * take out the middle component (green), and process
+             * the other two in parallel. One multiply less.
+             */
+            d = *dstp;
+            dalpha = d >> 24;
+            s1 = s & 0xff00ff;
+            d1 = d & 0xff00ff;
+            d1 = (d1 + ((s1 - d1) * alpha >> 8)) & 0xff00ff;
+            s &= 0xff00;
+            d &= 0xff00;
+            d = (d + ((s - d) * alpha >> 8)) & 0xff00;
+            dalpha = alpha + (dalpha * (alpha ^ 0xFF) >> 8);
+            *dstp = d1 | d | (dalpha << 24);
+          }
+        }
+        ++srcp;
+        ++dstp;
+        }, width);
+        /* *INDENT-ON* */
         srcp += srcskip;
         dstp += dstskip;
     }
@@ -533,47 +533,47 @@
     multmask2 = 0x00FF00FF00FF00FFULL;
 
     while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4({
-		Uint32 alpha;
+        /* *INDENT-OFF* */
+        DUFFS_LOOP4({
+        Uint32 alpha;
 
-		_m_prefetch(srcp + 16);
-		_m_prefetch(dstp + 16);
+        _m_prefetch(srcp + 16);
+        _m_prefetch(dstp + 16);
 
-		alpha = *srcp & amask;
-		if (alpha == 0) {
-			/* do nothing */
-		} else if (alpha == amask) {
-			*dstp = *srcp;
-		} else {
-			src1 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src1 (0000ARGB) */
-			src1 = _mm_unpacklo_pi8(src1, mm_zero); /* 0A0R0G0B -> src1 */
+        alpha = *srcp & amask;
+        if (alpha == 0) {
+            /* do nothing */
+        } else if (alpha == amask) {
+            *dstp = *srcp;
+        } else {
+            src1 = _mm_cvtsi32_si64(*srcp); /* src(ARGB) -> src1 (0000ARGB) */
+            src1 = _mm_unpacklo_pi8(src1, mm_zero); /* 0A0R0G0B -> src1 */
 
-			dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB) */
-			dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
+            dst1 = _mm_cvtsi32_si64(*dstp); /* dst(ARGB) -> dst1 (0000ARGB) */
+            dst1 = _mm_unpacklo_pi8(dst1, mm_zero); /* 0A0R0G0B -> dst1 */
 
-			mm_alpha = _mm_cvtsi32_si64(alpha); /* alpha -> mm_alpha (0000000A) */
-			mm_alpha = _mm_srli_si64(mm_alpha, ashift); /* mm_alpha >> ashift -> mm_alpha(0000000A) */
-			mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
-			mm_alpha2 = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha2 */
-			mm_alpha = _mm_or_si64(mm_alpha2, *(__m64 *) & multmask);	/* 0F0A0A0A -> mm_alpha */
-			mm_alpha2 = _mm_xor_si64(mm_alpha2, *(__m64 *) & multmask2);	/* 255 - mm_alpha -> mm_alpha */
+            mm_alpha = _mm_cvtsi32_si64(alpha); /* alpha -> mm_alpha (0000000A) */
+            mm_alpha = _mm_srli_si64(mm_alpha, ashift); /* mm_alpha >> ashift -> mm_alpha(0000000A) */
+            mm_alpha = _mm_unpacklo_pi16(mm_alpha, mm_alpha); /* 00000A0A -> mm_alpha */
+            mm_alpha2 = _mm_unpacklo_pi32(mm_alpha, mm_alpha); /* 0A0A0A0A -> mm_alpha2 */
+            mm_alpha = _mm_or_si64(mm_alpha2, *(__m64 *) & multmask);    /* 0F0A0A0A -> mm_alpha */
+            mm_alpha2 = _mm_xor_si64(mm_alpha2, *(__m64 *) & multmask2);    /* 255 - mm_alpha -> mm_alpha */
 
 
-			/* blend */		    
-			src1 = _mm_mullo_pi16(src1, mm_alpha);
-			src1 = _mm_srli_pi16(src1, 8);
-			dst1 = _mm_mullo_pi16(dst1, mm_alpha2);
-			dst1 = _mm_srli_pi16(dst1, 8);
-			dst1 = _mm_add_pi16(src1, dst1);
-			dst1 = _mm_packs_pu16(dst1, mm_zero);
-			
-			*dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
-		}
-		++srcp;
-		++dstp;
-	    }, width);
-	    /* *INDENT-ON* */
+            /* blend */            
+            src1 = _mm_mullo_pi16(src1, mm_alpha);
+            src1 = _mm_srli_pi16(src1, 8);
+            dst1 = _mm_mullo_pi16(dst1, mm_alpha2);
+            dst1 = _mm_srli_pi16(dst1, 8);
+            dst1 = _mm_add_pi16(src1, dst1);
+            dst1 = _mm_packs_pu16(dst1, mm_zero);
+            
+            *dstp = _mm_cvtsi64_si32(dst1); /* dst1 -> pixel */
+        }
+        ++srcp;
+        ++dstp;
+        }, width);
+        /* *INDENT-ON* */
         srcp += srcskip;
         dstp += dstskip;
     }
@@ -585,13 +585,13 @@
 /* 16bpp special case for per-surface alpha=50%: blend 2 pixels in parallel */
 
 /* blend a single 16 bit pixel at 50% */
-#define BLEND16_50(d, s, mask)						\
-	((((s & mask) + (d & mask)) >> 1) + (s & d & (~mask & 0xffff)))
+#define BLEND16_50(d, s, mask)                        \
+    ((((s & mask) + (d & mask)) >> 1) + (s & d & (~mask & 0xffff)))
 
 /* blend two 16 bit pixels at 50% */
-#define BLEND2x16_50(d, s, mask)					     \
-	(((s & (mask | mask << 16)) >> 1) + ((d & (mask | mask << 16)) >> 1) \
-	 + (s & d & (~(mask | mask << 16))))
+#define BLEND2x16_50(d, s, mask)                         \
+    (((s & (mask | mask << 16)) >> 1) + ((d & (mask | mask << 16)) >> 1) \
+     + (s & d & (~(mask | mask << 16))))
 
 static void
 Blit16to16SurfaceAlpha128(SDL_BlitInfo * info, Uint16 mask)
@@ -727,103 +727,103 @@
         bmask = _mm_set_pi32(0x001F001F, 0x001F001F);   /* MASKBLUE -> bmask */
 
         while (height--) {
-			/* *INDENT-OFF* */
-			DUFFS_LOOP_124(
-			{
-				s = *srcp++;
-				d = *dstp;
-				/*
-				 * shift out the middle component (green) to
-				 * the high 16 bits, and process all three RGB
-				 * components at the same time.
-				 */
-				s = (s | s << 16) & 0x07e0f81f;
-				d = (d | d << 16) & 0x07e0f81f;
-				d += (s - d) * alpha >> 5;
-				d &= 0x07e0f81f;
-				*dstp++ = (Uint16)(d | d >> 16);
-			},{
-				s = *srcp++;
-				d = *dstp;
-				/*
-				 * shift out the middle component (green) to
-				 * the high 16 bits, and process all three RGB
-				 * components at the same time.
-				 */
-				s = (s | s << 16) & 0x07e0f81f;
-				d = (d | d << 16) & 0x07e0f81f;
-				d += (s - d) * alpha >> 5;
-				d &= 0x07e0f81f;
-				*dstp++ = (Uint16)(d | d >> 16);
-				s = *srcp++;
-				d = *dstp;
-				/*
-				 * shift out the middle component (green) to
-				 * the high 16 bits, and process all three RGB
-				 * components at the same time.
-				 */
-				s = (s | s << 16) & 0x07e0f81f;
-				d = (d | d << 16) & 0x07e0f81f;
-				d += (s - d) * alpha >> 5;
-				d &= 0x07e0f81f;
-				*dstp++ = (Uint16)(d | d >> 16);
-			},{
-				src1 = *(__m64*)srcp; /* 4 src pixels -> src1 */
-				dst1 = *(__m64*)dstp; /* 4 dst pixels -> dst1 */
+            /* *INDENT-OFF* */
+            DUFFS_LOOP_124(
+            {
+                s = *srcp++;
+                d = *dstp;
+                /*
+                 * shift out the middle component (green) to
+                 * the high 16 bits, and process all three RGB
+                 * components at the same time.
+                 */
+                s = (s | s << 16) & 0x07e0f81f;
+                d = (d | d << 16) & 0x07e0f81f;
+                d += (s - d) * alpha >> 5;
+                d &= 0x07e0f81f;
+                *dstp++ = (Uint16)(d | d >> 16);
+            },{
+                s = *srcp++;
+                d = *dstp;
+                /*
+                 * shift out the middle component (green) to
+                 * the high 16 bits, and process all three RGB
+                 * components at the same time.
+                 */
+                s = (s | s << 16) & 0x07e0f81f;
+                d = (d | d << 16) & 0x07e0f81f;
+                d += (s - d) * alpha >> 5;
+                d &= 0x07e0f81f;
+                *dstp++ = (Uint16)(d | d >> 16);
+                s = *srcp++;
+                d = *dstp;
+                /*
+                 * shift out the middle component (green) to
+                 * the high 16 bits, and process all three RGB
+                 * components at the same time.
+                 */
+                s = (s | s << 16) & 0x07e0f81f;
+                d = (d | d << 16) & 0x07e0f81f;
+                d += (s - d) * alpha >> 5;
+                d &= 0x07e0f81f;
+                *dstp++ = (Uint16)(d | d >> 16);
+            },{
+                src1 = *(__m64*)srcp; /* 4 src pixels -> src1 */
+                dst1 = *(__m64*)dstp; /* 4 dst pixels -> dst1 */
 
-				/* red */
-				src2 = src1;
-				src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 [000r 000r 000r 000r] */
+                /* red */
+                src2 = src1;
+                src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 [000r 000r 000r 000r] */
 
-				dst2 = dst1;
-				dst2 = _mm_srli_pi16(dst2, 11); /* dst2 >> 11 -> dst2 [000r 000r 000r 000r] */
+                dst2 = dst1;
+                dst2 = _mm_srli_pi16(dst2, 11); /* dst2 >> 11 -> dst2 [000r 000r 000r 000r] */
 
-				/* blend */
-				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
-				src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
-				src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
-				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
-				dst2 = _mm_slli_pi16(dst2, 11); /* dst2 << 11 -> dst2 */
+                /* blend */
+                src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
+                src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
+                src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
+                dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
+                dst2 = _mm_slli_pi16(dst2, 11); /* dst2 << 11 -> dst2 */
 
-				mm_res = dst2; /* RED -> mm_res */
+                mm_res = dst2; /* RED -> mm_res */
 
-				/* green -- process the bits in place */
-				src2 = src1;
-				src2 = _mm_and_si64(src2, gmask); /* src & MASKGREEN -> src2 */
+                /* green -- process the bits in place */
+                src2 = src1;
+                src2 = _mm_and_si64(src2, gmask); /* src & MASKGREEN -> src2 */
 
-				dst2 = dst1;
-				dst2 = _mm_and_si64(dst2, gmask); /* dst & MASKGREEN -> dst2 */
+                dst2 = dst1;
+                dst2 = _mm_and_si64(dst2, gmask); /* dst & MASKGREEN -> dst2 */
 
-				/* blend */
-				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
-				src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
-				src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
-				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
+                /* blend */
+                src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
+                src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
+                src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
+                dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
 
-				mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN -> mm_res */
+                mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN -> mm_res */
 
-				/* blue */
-				src2 = src1;
-				src2 = _mm_and_si64(src2, bmask); /* src & MASKBLUE -> src2[000b 000b 000b 000b] */
+                /* blue */
+                src2 = src1;
+                src2 = _mm_and_si64(src2, bmask); /* src & MASKBLUE -> src2[000b 000b 000b 000b] */
 
-				dst2 = dst1;
-				dst2 = _mm_and_si64(dst2, bmask); /* dst & MASKBLUE -> dst2[000b 000b 000b 000b] */
+                dst2 = dst1;
+                dst2 = _mm_and_si64(dst2, bmask); /* dst & MASKBLUE -> dst2[000b 000b 000b 000b] */
 
-				/* blend */
-				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
-				src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
-				src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
-				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
-				dst2 = _mm_and_si64(dst2, bmask); /* dst2 & MASKBLUE -> dst2 */
+                /* blend */
+                src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
+                src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
+                src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
+                dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
+                dst2 = _mm_and_si64(dst2, bmask); /* dst2 & MASKBLUE -> dst2 */
 
-				mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN | BLUE -> mm_res */
+                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;
-			}, width);
-			/* *INDENT-ON* */
+                srcp += 4;
+                dstp += 4;
+            }, width);
+            /* *INDENT-ON* */
             srcp += srcskip;
             dstp += dstskip;
         }
@@ -865,103 +865,103 @@
         bmask = _mm_set_pi32(0x001F001F, 0x001F001F);   /* MASKBLUE -> bmask */
 
         while (height--) {
-			/* *INDENT-OFF* */
-			DUFFS_LOOP_124(
-			{
-				s = *srcp++;
-				d = *dstp;
-				/*
-				 * shift out the middle component (green) to
-				 * the high 16 bits, and process all three RGB
-				 * components at the same time.
-				 */
-				s = (s | s << 16) & 0x03e07c1f;
-				d = (d | d << 16) & 0x03e07c1f;
-				d += (s - d) * alpha >> 5;
-				d &= 0x03e07c1f;
-				*dstp++ = (Uint16)(d | d >> 16);
-			},{
-				s = *srcp++;
-				d = *dstp;
-				/*
-				 * shift out the middle component (green) to
-				 * the high 16 bits, and process all three RGB
-				 * components at the same time.
-				 */
-				s = (s | s << 16) & 0x03e07c1f;
-				d = (d | d << 16) & 0x03e07c1f;
-				d += (s - d) * alpha >> 5;
-				d &= 0x03e07c1f;
-				*dstp++ = (Uint16)(d | d >> 16);
-			        s = *srcp++;
-				d = *dstp;
-				/*
-				 * shift out the middle component (green) to
-				 * the high 16 bits, and process all three RGB
-				 * components at the same time.
-				 */
-				s = (s | s << 16) & 0x03e07c1f;
-				d = (d | d << 16) & 0x03e07c1f;
-				d += (s - d) * alpha >> 5;
-				d &= 0x03e07c1f;
-				*dstp++ = (Uint16)(d | d >> 16);
-			},{
-				src1 = *(__m64*)srcp; /* 4 src pixels -> src1 */
-				dst1 = *(__m64*)dstp; /* 4 dst pixels -> dst1 */
+            /* *INDENT-OFF* */
+            DUFFS_LOOP_124(
+            {
+                s = *srcp++;
+                d = *dstp;
+                /*
+                 * shift out the middle component (green) to
+                 * the high 16 bits, and process all three RGB
+                 * components at the same time.
+                 */
+                s = (s | s << 16) & 0x03e07c1f;
+                d = (d | d << 16) & 0x03e07c1f;
+                d += (s - d) * alpha >> 5;
+                d &= 0x03e07c1f;
+                *dstp++ = (Uint16)(d | d >> 16);
+            },{
+                s = *srcp++;
+                d = *dstp;
+                /*
+                 * shift out the middle component (green) to
+                 * the high 16 bits, and process all three RGB
+                 * components at the same time.
+                 */
+                s = (s | s << 16) & 0x03e07c1f;
+                d = (d | d << 16) & 0x03e07c1f;
+                d += (s - d) * alpha >> 5;
+                d &= 0x03e07c1f;
+                *dstp++ = (Uint16)(d | d >> 16);
+                    s = *srcp++;
+                d = *dstp;
+                /*
+                 * shift out the middle component (green) to
+                 * the high 16 bits, and process all three RGB
+                 * components at the same time.
+                 */
+                s = (s | s << 16) & 0x03e07c1f;
+                d = (d | d << 16) & 0x03e07c1f;
+                d += (s - d) * alpha >> 5;
+                d &= 0x03e07c1f;
+                *dstp++ = (Uint16)(d | d >> 16);
+            },{
+                src1 = *(__m64*)srcp; /* 4 src pixels -> src1 */
+                dst1 = *(__m64*)dstp; /* 4 dst pixels -> dst1 */
 
-				/* red -- process the bits in place */
-				src2 = src1;
-				src2 = _mm_and_si64(src2, rmask); /* src & MASKRED -> src2 */
+                /* red -- process the bits in place */
+                src2 = src1;
+                src2 = _mm_and_si64(src2, rmask); /* src & MASKRED -> src2 */
 
-				dst2 = dst1;
-				dst2 = _mm_and_si64(dst2, rmask); /* dst & MASKRED -> dst2 */
+                dst2 = dst1;
+                dst2 = _mm_and_si64(dst2, rmask); /* dst & MASKRED -> dst2 */
 
-				/* blend */
-				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
-				src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
-				src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
-				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
-				dst2 = _mm_and_si64(dst2, rmask); /* dst2 & MASKRED -> dst2 */
+                /* blend */
+                src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
+                src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
+                src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
+                dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
+                dst2 = _mm_and_si64(dst2, rmask); /* dst2 & MASKRED -> dst2 */
 
-				mm_res = dst2; /* RED -> mm_res */
-				
-				/* green -- process the bits in place */
-				src2 = src1;
-				src2 = _mm_and_si64(src2, gmask); /* src & MASKGREEN -> src2 */
+                mm_res = dst2; /* RED -> mm_res */
+                
+                /* green -- process the bits in place */
+                src2 = src1;
+                src2 = _mm_and_si64(src2, gmask); /* src & MASKGREEN -> src2 */
 
-				dst2 = dst1;
-				dst2 = _mm_and_si64(dst2, gmask); /* dst & MASKGREEN -> dst2 */
+                dst2 = dst1;
+                dst2 = _mm_and_si64(dst2, gmask); /* dst & MASKGREEN -> dst2 */
 
-				/* blend */
-				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
-				src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
-				src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
-				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
+                /* blend */
+                src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
+                src2 = _mm_mulhi_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
+                src2 = _mm_slli_pi16(src2, 5); /* src2 << 5 -> src2 */
+                dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
 
-				mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN -> mm_res */
+                mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN -> mm_res */
 
-				/* blue */
-				src2 = src1; /* src -> src2 */
-				src2 = _mm_and_si64(src2, bmask); /* src & MASKBLUE -> src2[000b 000b 000b 000b] */
+                /* blue */
+                src2 = src1; /* src -> src2 */
+                src2 = _mm_and_si64(src2, bmask); /* src & MASKBLUE -> src2[000b 000b 000b 000b] */
 
-				dst2 = dst1; /* dst -> dst2 */
-				dst2 = _mm_and_si64(dst2, bmask); /* dst & MASKBLUE -> dst2[000b 000b 000b 000b] */
+                dst2 = dst1; /* dst -> dst2 */
+                dst2 = _mm_and_si64(dst2, bmask); /* dst & MASKBLUE -> dst2[000b 000b 000b 000b] */
 
-				/* blend */
-				src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
-				src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
-				src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
-				dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
-				dst2 = _mm_and_si64(dst2, bmask); /* dst2 & MASKBLUE -> dst2 */
+                /* blend */
+                src2 = _mm_sub_pi16(src2, dst2);/* src - dst -> src2 */
+                src2 = _mm_mullo_pi16(src2, mm_alpha); /* src2 * alpha -> src2 */
+                src2 = _mm_srli_pi16(src2, 11); /* src2 >> 11 -> src2 */
+                dst2 = _mm_add_pi16(src2, dst2); /* src2 + dst2 -> dst2 */
+                dst2 = _mm_and_si64(dst2, bmask); /* dst2 & MASKBLUE -> dst2 */
 
-				mm_res = _mm_or_si64(mm_res, dst2); /* RED | GREEN | BLUE -> mm_res */
+                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;
-			}, width);
-			/* *INDENT-ON* */
+                srcp += 4;
+                dstp += 4;
+            }, width);
+            /* *INDENT-ON* */
             srcp += srcskip;
             dstp += dstskip;
         }
@@ -988,22 +988,22 @@
         alpha >>= 3;            /* downscale alpha to 5 bits */
 
         while (height--) {
-			/* *INDENT-OFF* */
-			DUFFS_LOOP4({
-				Uint32 s = *srcp++;
-				Uint32 d = *dstp;
-				/*
-				 * shift out the middle component (green) to
-				 * the high 16 bits, and process all three RGB
-				 * components at the same time.
-				 */
-				s = (s | s << 16) & 0x07e0f81f;
-				d = (d | d << 16) & 0x07e0f81f;
-				d += (s - d) * alpha >> 5;
-				d &= 0x07e0f81f;
-				*dstp++ = (Uint16)(d | d >> 16);
-			}, width);
-			/* *INDENT-ON* */
+            /* *INDENT-OFF* */
+            DUFFS_LOOP4({
+                Uint32 s = *srcp++;
+                Uint32 d = *dstp;
+                /*
+                 * shift out the middle component (green) to
+                 * the high 16 bits, and process all three RGB
+                 * components at the same time.
+                 */
+                s = (s | s << 16) & 0x07e0f81f;
+                d = (d | d << 16) & 0x07e0f81f;
+                d += (s - d) * alpha >> 5;
+                d &= 0x07e0f81f;
+                *dstp++ = (Uint16)(d | d >> 16);
+            }, width);
+            /* *INDENT-ON* */
             srcp += srcskip;
             dstp += dstskip;
         }
@@ -1027,22 +1027,22 @@
         alpha >>= 3;            /* downscale alpha to 5 bits */
 
         while (height--) {
-			/* *INDENT-OFF* */
-			DUFFS_LOOP4({
-				Uint32 s = *srcp++;
-				Uint32 d = *dstp;
-				/*
-				 * shift out the middle component (green) to
-				 * the high 16 bits, and process all three RGB
-				 * components at the same time.
-				 */
-				s = (s | s << 16) & 0x03e07c1f;
-				d = (d | d << 16) & 0x03e07c1f;
-				d += (s - d) * alpha >> 5;
-				d &= 0x03e07c1f;
-				*dstp++ = (Uint16)(d | d >> 16);
-			}, width);
-			/* *INDENT-ON* */
+            /* *INDENT-OFF* */
+            DUFFS_LOOP4({
+                Uint32 s = *srcp++;
+                Uint32 d = *dstp;
+                /*
+                 * shift out the middle component (green) to
+                 * the high 16 bits, and process all three RGB
+                 * components at the same time.
+                 */
+                s = (s | s << 16) & 0x03e07c1f;
+                d = (d | d << 16) & 0x03e07c1f;
+                d += (s - d) * alpha >> 5;
+                d &= 0x03e07c1f;
+                *dstp++ = (Uint16)(d | d >> 16);
+            }, width);
+            /* *INDENT-ON* */
             srcp += srcskip;
             dstp += dstskip;
         }
@@ -1061,35 +1061,35 @@
     int dstskip = info->dst_skip >> 1;
 
     while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4({
-		Uint32 s = *srcp;
-		unsigned alpha = s >> 27; /* downscale alpha to 5 bits */
-		/* FIXME: Here we special-case opaque alpha since the
-		   compositioning used (>>8 instead of /255) doesn't handle
-		   it correctly. Also special-case alpha=0 for speed?
-		   Benchmark this! */
-		if(alpha) {   
-		  if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
-		    *dstp = (Uint16)((s >> 8 & 0xf800) + (s >> 5 & 0x7e0) + (s >> 3  & 0x1f));
-		  } else {
-		    Uint32 d = *dstp;
-		    /*
-		     * convert source and destination to G0RAB65565
-		     * and blend all components at the same time
-		     */
-		    s = ((s & 0xfc00) << 11) + (s >> 8 & 0xf800)
-		      + (s >> 3 & 0x1f);
-		    d = (d | d << 16) & 0x07e0f81f;
-		    d += (s - d) * alpha >> 5;
-		    d &= 0x07e0f81f;
-		    *dstp = (Uint16)(d | d >> 16);
-		  }
-		}
-		srcp++;
-		dstp++;
-	    }, width);
-	    /* *INDENT-ON* */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP4({
+        Uint32 s = *srcp;
+        unsigned alpha = s >> 27; /* downscale alpha to 5 bits */
+        /* FIXME: Here we special-case opaque alpha since the
+           compositioning used (>>8 instead of /255) doesn't handle
+           it correctly. Also special-case alpha=0 for speed?
+           Benchmark this! */
+        if(alpha) {   
+          if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
+            *dstp = (Uint16)((s >> 8 & 0xf800) + (s >> 5 & 0x7e0) + (s >> 3  & 0x1f));
+          } else {
+            Uint32 d = *dstp;
+            /*
+             * convert source and destination to G0RAB65565
+             * and blend all components at the same time
+             */
+            s = ((s & 0xfc00) << 11) + (s >> 8 & 0xf800)
+              + (s >> 3 & 0x1f);
+            d = (d | d << 16) & 0x07e0f81f;
+            d += (s - d) * alpha >> 5;
+            d &= 0x07e0f81f;
+            *dstp = (Uint16)(d | d >> 16);
+          }
+        }
+        srcp++;
+        dstp++;
+        }, width);
+        /* *INDENT-ON* */
         srcp += srcskip;
         dstp += dstskip;
     }
@@ -1107,36 +1107,36 @@
     int dstskip = info->dst_skip >> 1;
 
     while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4({
-		unsigned alpha;
-		Uint32 s = *srcp;
-		alpha = s >> 27; /* downscale alpha to 5 bits */
-		/* FIXME: Here we special-case opaque alpha since the
-		   compositioning used (>>8 instead of /255) doesn't handle
-		   it correctly. Also special-case alpha=0 for speed?
-		   Benchmark this! */
-		if(alpha) {   
-		  if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
-		    *dstp = (Uint16)((s >> 9 & 0x7c00) + (s >> 6 & 0x3e0) + (s >> 3  & 0x1f));
-		  } else {
-		    Uint32 d = *dstp;
-		    /*
-		     * convert source and destination to G0RAB65565
-		     * and blend all components at the same time
-		     */
-		    s = ((s & 0xf800) << 10) + (s >> 9 & 0x7c00)
-		      + (s >> 3 & 0x1f);
-		    d = (d | d << 16) & 0x03e07c1f;
-		    d += (s - d) * alpha >> 5;
-		    d &= 0x03e07c1f;
-		    *dstp = (Uint16)(d | d >> 16);
-		  }
-		}
-		srcp++;
-		dstp++;
-	    }, width);
-	    /* *INDENT-ON* */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP4({
+        unsigned alpha;
+        Uint32 s = *srcp;
+        alpha = s >> 27; /* downscale alpha to 5 bits */
+        /* FIXME: Here we special-case opaque alpha since the
+           compositioning used (>>8 instead of /255) doesn't handle
+           it correctly. Also special-case alpha=0 for speed?
+           Benchmark this! */
+        if(alpha) {   
+          if(alpha == (SDL_ALPHA_OPAQUE >> 3)) {
+            *dstp = (Uint16)((s >> 9 & 0x7c00) + (s >> 6 & 0x3e0) + (s >> 3  & 0x1f));
+          } else {
+            Uint32 d = *dstp;
+            /*
+             * convert source and destination to G0RAB65565
+             * and blend all components at the same time
+             */
+            s = ((s & 0xf800) << 10) + (s >> 9 & 0x7c00)
+              + (s >> 3 & 0x1f);
+            d = (d | d << 16) & 0x03e07c1f;
+            d += (s - d) * alpha >> 5;
+            d &= 0x03e07c1f;
+            *dstp = (Uint16)(d | d >> 16);
+          }
+        }
+        srcp++;
+        dstp++;
+        }, width);
+        /* *INDENT-ON* */
         srcp += srcskip;
         dstp += dstskip;
     }
@@ -1163,18 +1163,18 @@
 
     if (sA) {
         while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4(
-	    {
-		DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
-		DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA);
-		ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA);
-		ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
-		src += srcbpp;
-		dst += dstbpp;
-	    },
-	    width);
-	    /* *INDENT-ON* */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP4(
+        {
+        DISEMBLE_RGB(src, srcbpp, srcfmt, Pixel, sR, sG, sB);
+        DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA);
+        ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA);
+        ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
+        src += srcbpp;
+        dst += dstbpp;
+        },
+        width);
+        /* *INDENT-ON* */
             src += srcskip;
             dst += dstskip;
         }
@@ -1202,21 +1202,21 @@
     const unsigned sA = info->a;
 
     while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4(
-	    {
-		RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel);
-		if(sA && Pixel != ckey) {
-		    RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB);
-		    DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA);
-		    ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA);
-		    ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
-		}
-		src += srcbpp;
-		dst += dstbpp;
-	    },
-	    width);
-	    /* *INDENT-ON* */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP4(
+        {
+        RETRIEVE_RGB_PIXEL(src, srcbpp, Pixel);
+        if(sA && Pixel != ckey) {
+            RGB_FROM_PIXEL(Pixel, srcfmt, sR, sG, sB);
+            DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA);
+            ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA);
+            ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
+        }
+        src += srcbpp;
+        dst += dstbpp;
+        },
+        width);
+        /* *INDENT-ON* */
         src += srcskip;
         dst += dstskip;
     }
@@ -1245,20 +1245,20 @@
     dstbpp = dstfmt->BytesPerPixel;
 
     while (height--) {
-	    /* *INDENT-OFF* */
-	    DUFFS_LOOP4(
-	    {
-		DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
-		if(sA) {
-		    DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA);
-		    ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA);
-		    ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
-		}
-		src += srcbpp;
-		dst += dstbpp;
-	    },
-	    width);
-	    /* *INDENT-ON* */
+        /* *INDENT-OFF* */
+        DUFFS_LOOP4(
+        {
+        DISEMBLE_RGBA(src, srcbpp, srcfmt, Pixel, sR, sG, sB, sA);
+        if(sA) {
+            DISEMBLE_RGBA(dst, dstbpp, dstfmt, Pixel, dR, dG, dB, dA);
+            ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA);
+            ASSEMBLE_RGBA(dst, dstbpp, dstfmt, dR, dG, dB, dA);
+        }
+        src += srcbpp;
+        dst += dstbpp;
+        },
+        width);
+        /* *INDENT-ON* */
         src += srcskip;
         dst += dstskip;
     }
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/SDL_egl.c
--- a/src/video/SDL_egl.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/SDL_egl.c	Mon Sep 24 11:49:25 2018 -0700
@@ -836,7 +836,7 @@
     /* max 2 values plus terminator. */
     EGLint attribs[3];
     int attr = 0;
-	
+
     EGLSurface * surface;
 
     if (SDL_EGL_ChooseConfig(_this) != 0) {
@@ -868,7 +868,7 @@
             return EGL_NO_SURFACE;
         }
     }
-	
+
     attribs[attr++] = EGL_NONE;
     
     surface = _this->egl_data->eglCreateWindowSurface(
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/SDL_pixels.c
--- a/src/video/SDL_pixels.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/SDL_pixels.c	Mon Sep 24 11:49:25 2018 -0700
@@ -326,7 +326,7 @@
         if (Rmask == 0) {
             return SDL_PIXELFORMAT_RGB555;
         }
-	/* fallthrough */
+    /* fallthrough */
     case 16:
         if (Rmask == 0) {
             return SDL_PIXELFORMAT_RGB565;
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/SDL_shape_internals.h
--- a/src/video/SDL_shape_internals.h	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/SDL_shape_internals.h	Mon Sep 24 11:49:25 2018 -0700
@@ -36,21 +36,21 @@
 #endif
 
 typedef struct {
-	struct SDL_ShapeTree *upleft,*upright,*downleft,*downright;
+    struct SDL_ShapeTree *upleft,*upright,*downleft,*downright;
 } SDL_QuadTreeChildren;
 
 typedef union {
-	SDL_QuadTreeChildren children;
-	SDL_Rect shape;
+    SDL_QuadTreeChildren children;
+    SDL_Rect shape;
 } SDL_ShapeUnion;
 
 typedef enum { QuadShape,TransparentShape,OpaqueShape } SDL_ShapeKind;
 
 typedef struct {
-	SDL_ShapeKind kind;
-	SDL_ShapeUnion data;
+    SDL_ShapeKind kind;
+    SDL_ShapeUnion data;
 } SDL_ShapeTree;
-	
+
 typedef void(*SDL_TraversalFunction)(SDL_ShapeTree*,void*);
 
 extern void SDL_CalculateShapeBitmap(SDL_WindowShapeMode mode,SDL_Surface *shape,Uint8* bitmap,Uint8 ppb);
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/SDL_video.c
--- a/src/video/SDL_video.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/SDL_video.c	Mon Sep 24 11:49:25 2018 -0700
@@ -1540,11 +1540,12 @@
         return NULL;
     }
 
-	// Clear minimized if not on windows, only windows handles it at create rather than FinishWindowCreation,
-	// but it's important or window focus will get broken on windows!
+    /* Clear minimized if not on windows, only windows handles it at create rather than FinishWindowCreation,
+     * but it's important or window focus will get broken on windows!
+     */
 #if !defined(__WIN32__)
-	if (window->flags & SDL_WINDOW_MINIMIZED) {
-		window->flags &= ~SDL_WINDOW_MINIMIZED;
+    if (window->flags & SDL_WINDOW_MINIMIZED) {
+        window->flags &= ~SDL_WINDOW_MINIMIZED;
     }
 #endif
 
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/SDL_vulkan_utils.c
--- a/src/video/SDL_vulkan_utils.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/SDL_vulkan_utils.c	Mon Sep 24 11:49:25 2018 -0700
@@ -123,10 +123,10 @@
     {
         retval = SDL_calloc(1, sizeof(VkExtensionProperties)); // so we can return non-null
     }
-	else
-	{
-		retval = SDL_calloc(count, sizeof(VkExtensionProperties));
-	}
+    else
+    {
+        retval = SDL_calloc(count, sizeof(VkExtensionProperties));
+    }
     if(!retval)
     {
         SDL_OutOfMemory();
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/SDL_yuv.c
--- a/src/video/SDL_yuv.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/SDL_yuv.c	Mon Sep 24 11:49:25 2018 -0700
@@ -89,10 +89,10 @@
 }
 
 static int GetYUVPlanes(int width, int height, Uint32 format, const void *yuv, int yuv_pitch,
-	                    const Uint8 **y, const Uint8 **u, const Uint8 **v, Uint32 *y_stride, Uint32 *uv_stride)
+                        const Uint8 **y, const Uint8 **u, const Uint8 **v, Uint32 *y_stride, Uint32 *uv_stride)
 {
-	const Uint8 *planes[3] = { NULL, NULL, NULL };
-	int pitches[3] = { 0, 0, 0 };
+    const Uint8 *planes[3] = { NULL, NULL, NULL };
+    int pitches[3] = { 0, 0, 0 };
 
     switch (format) {
     case SDL_PIXELFORMAT_YV12:
@@ -180,10 +180,10 @@
 
 static SDL_bool yuv_rgb_sse(
     Uint32 src_format, Uint32 dst_format,
-	Uint32 width, Uint32 height, 
-	const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, 
-	Uint8 *rgb, Uint32 rgb_stride, 
-	YCbCrType yuv_type)
+    Uint32 width, Uint32 height, 
+    const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, 
+    Uint8 *rgb, Uint32 rgb_stride, 
+    YCbCrType yuv_type)
 {
 #ifdef __SSE2__
     if (!SDL_HasSSE2()) {
@@ -289,10 +289,10 @@
 
 static SDL_bool yuv_rgb_std(
     Uint32 src_format, Uint32 dst_format,
-	Uint32 width, Uint32 height, 
-	const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, 
-	Uint8 *rgb, Uint32 rgb_stride, 
-	YCbCrType yuv_type)
+    Uint32 width, Uint32 height, 
+    const Uint8 *y, const Uint8 *u, const Uint8 *v, Uint32 y_stride, Uint32 uv_stride, 
+    Uint8 *rgb, Uint32 rgb_stride, 
+    YCbCrType yuv_type)
 {
     if (src_format == SDL_PIXELFORMAT_YV12 ||
         src_format == SDL_PIXELFORMAT_IYUV) {
@@ -395,7 +395,7 @@
          Uint32 src_format, const void *src, int src_pitch,
          Uint32 dst_format, void *dst, int dst_pitch)
 {
-	const Uint8 *y = NULL;
+    const Uint8 *y = NULL;
     const Uint8 *u = NULL;
     const Uint8 *v = NULL;
     Uint32 y_stride = 0;
@@ -553,7 +553,7 @@
             Uint32 y_stride, uv_stride, y_skip, uv_skip;
 
             GetYUVPlanes(width, height, dst_format, dst, dst_pitch,
-	                     (const Uint8 **)&plane_y, (const Uint8 **)&plane_u, (const Uint8 **)&plane_v,
+                         (const Uint8 **)&plane_y, (const Uint8 **)&plane_u, (const Uint8 **)&plane_v,
                          &y_stride, &uv_stride);
             plane_interleaved_uv = (plane_y + height * y_stride);
             y_skip = (y_stride - width);
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/android/SDL_androidvideo.c
--- a/src/video/android/SDL_androidvideo.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/android/SDL_androidvideo.c	Mon Sep 24 11:49:25 2018 -0700
@@ -214,12 +214,12 @@
 void
 Android_SetScreenResolution(int surfaceWidth, int surfaceHeight, int deviceWidth, int deviceHeight, Uint32 format, float rate)
 {
-	SDL_VideoDevice* device;
-	SDL_VideoDisplay *display;
+    SDL_VideoDevice* device;
+    SDL_VideoDisplay *display;
     Android_SurfaceWidth = surfaceWidth;
     Android_SurfaceHeight = surfaceHeight;
-	Android_DeviceWidth = deviceWidth;
-	Android_DeviceHeight = deviceHeight;
+    Android_DeviceWidth = deviceWidth;
+    Android_DeviceHeight = deviceHeight;
     Android_ScreenFormat = format;
     Android_ScreenRate = rate;
 
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/cocoa/SDL_cocoaevents.m
--- a/src/video/cocoa/SDL_cocoaevents.m	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/cocoa/SDL_cocoaevents.m	Mon Sep 24 11:49:25 2018 -0700
@@ -390,8 +390,8 @@
 
         if (!SDL_GetHintBoolean(SDL_HINT_MAC_BACKGROUND_APP, SDL_FALSE)) {
             [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
-		}
-		
+        }
+
         if ([NSApp mainMenu] == nil) {
             CreateApplicationMenus();
         }
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/cocoa/SDL_cocoametalview.m
--- a/src/video/cocoa/SDL_cocoametalview.m	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/cocoa/SDL_cocoametalview.m	Mon Sep 24 11:49:25 2018 -0700
@@ -39,7 +39,7 @@
 /* Return a Metal-compatible layer. */
 + (Class)layerClass
 {
-	return NSClassFromString(@"CAMetalLayer");
+    return NSClassFromString(@"CAMetalLayer");
 }
 
 /* Indicate the view wants to draw using a backing layer instead of drawRect. */
@@ -59,7 +59,7 @@
 - (instancetype)initWithFrame:(NSRect)frame
                         scale:(CGFloat)scale
 {
-	if ((self = [super initWithFrame:frame])) {
+    if ((self = [super initWithFrame:frame])) {
         _tag = METALVIEW_TAG;
         self.wantsLayer = YES;
 
@@ -71,7 +71,7 @@
         self.layer.contentsScale = scale;
     }
   
-	return self;
+    return self;
 }
 
 /* Set the size of the metal drawables when the view is resized. */
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/cocoa/SDL_cocoamousetap.m
--- a/src/video/cocoa/SDL_cocoamousetap.m	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/cocoa/SDL_cocoamousetap.m	Mon Sep 24 11:49:25 2018 -0700
@@ -211,7 +211,7 @@
             tapdata->thread = SDL_CreateThreadInternal(&Cocoa_MouseTapThread, "Event Tap Loop", 512 * 1024, tapdata);
             if (tapdata->thread) {
                 /* Success - early out. Ownership transferred to thread. */
-            	return;
+                return;
             }
             CFRelease(tapdata->tap);
         }
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/cocoa/SDL_cocoawindow.m
--- a/src/video/cocoa/SDL_cocoawindow.m	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/cocoa/SDL_cocoawindow.m	Mon Sep 24 11:49:25 2018 -0700
@@ -241,7 +241,7 @@
 static int
 GetHintCtrlClickEmulateRightClick()
 {
-	return SDL_GetHintBoolean(SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, SDL_FALSE);
+    return SDL_GetHintBoolean(SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, SDL_FALSE);
 }
 
 static NSUInteger
@@ -908,7 +908,7 @@
     switch ([theEvent buttonNumber]) {
     case 0:
         if (([theEvent modifierFlags] & NSEventModifierFlagControl) &&
-		    GetHintCtrlClickEmulateRightClick()) {
+            GetHintCtrlClickEmulateRightClick()) {
             wasCtrlLeft = YES;
             button = SDL_BUTTON_RIGHT;
         } else {
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/directfb/SDL_DirectFB_video.c
--- a/src/video/directfb/SDL_DirectFB_video.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/directfb/SDL_DirectFB_video.c	Mon Sep 24 11:49:25 2018 -0700
@@ -324,7 +324,7 @@
     { DSPF_YUY2, SDL_PIXELFORMAT_YUY2 },                /* 16 bit YUV (4 byte/ 2 pixel, macropixel contains CbYCrY [31:0]) */
     { DSPF_UYVY, SDL_PIXELFORMAT_UYVY },                /* 16 bit YUV (4 byte/ 2 pixel, macropixel contains YCbYCr [31:0]) */
     { DSPF_RGB555, SDL_PIXELFORMAT_RGB555 },            /* 16 bit RGB (2 byte, nothing @15, red 5 at 10, green 5 at 5, blue 5 at 0) */
-    { DSPF_ABGR, SDL_PIXELFORMAT_ABGR8888 },		/* 32 bit ABGR (4  byte, alpha 8 at 24, blue 8 at 16, green 8 at 8, red 8 at 0) */
+    { DSPF_ABGR, SDL_PIXELFORMAT_ABGR8888 },            /* 32 bit ABGR (4  byte, alpha 8 at 24, blue 8 at 16, green 8 at 8, red 8 at 0) */
 #if (ENABLE_LUT8)
     { DSPF_LUT8, SDL_PIXELFORMAT_INDEX8 },              /* 8 bit LUT (8 bit color and alpha lookup from palette) */
 #endif
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/haiku/SDL_BWin.h
--- a/src/video/haiku/SDL_BWin.h	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/haiku/SDL_BWin.h	Mon Sep 24 11:49:25 2018 -0700
@@ -538,7 +538,7 @@
         msg.AddInt32("key-state", keyState);
         msg.AddInt32("key-scancode", keyCode);
         if (keyUtf8 != NULL) {
-        	msg.AddData("key-utf8", B_INT8_TYPE, (const void*)keyUtf8, len);
+            msg.AddData("key-utf8", B_INT8_TYPE, (const void*)keyUtf8, len);
         }
         be_app->PostMessage(&msg);
     }
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/haiku/SDL_bclipboard.cc
--- a/src/video/haiku/SDL_bclipboard.cc	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/haiku/SDL_bclipboard.cc	Mon Sep 24 11:49:25 2018 -0700
@@ -36,54 +36,54 @@
 #endif
 
 int HAIKU_SetClipboardText(_THIS, const char *text) {
-	BMessage *clip = NULL;
-	if(be_clipboard->Lock()) {
-		be_clipboard->Clear();
-		if((clip = be_clipboard->Data())) {
-			/* Presumably the string of characters is ascii-format */
-			ssize_t asciiLength = 0;
-			for(; text[asciiLength] != 0; ++asciiLength) {}
-			clip->AddData("text/plain", B_MIME_TYPE, text, asciiLength);
-			be_clipboard->Commit();
-		}
-		be_clipboard->Unlock();
-	}
-	return 0;
+    BMessage *clip = NULL;
+    if(be_clipboard->Lock()) {
+        be_clipboard->Clear();
+        if((clip = be_clipboard->Data())) {
+            /* Presumably the string of characters is ascii-format */
+            ssize_t asciiLength = 0;
+            for(; text[asciiLength] != 0; ++asciiLength) {}
+            clip->AddData("text/plain", B_MIME_TYPE, text, asciiLength);
+            be_clipboard->Commit();
+        }
+        be_clipboard->Unlock();
+    }
+    return 0;
 }
 
 char *HAIKU_GetClipboardText(_THIS) {
-	BMessage *clip = NULL;
-	const char *text = NULL;	
-	ssize_t length;
-	char *result;
-	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,
-				&length);
-		}
-		be_clipboard->Unlock();
-	} 
-	
-	if (!text) {
-		result = SDL_strdup("");
-	} else {
-		/* Copy the data and pass on to SDL */
-		result = (char *)SDL_malloc((length + 1) * sizeof(char));
-		SDL_strlcpy(result, text, length + 1);
-	}
-	
-	return result;
+    BMessage *clip = NULL;
+    const char *text = NULL;    
+    ssize_t length;
+    char *result;
+    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,
+                &length);
+        }
+        be_clipboard->Unlock();
+    } 
+    
+    if (!text) {
+        result = SDL_strdup("");
+    } else {
+        /* Copy the data and pass on to SDL */
+        result = (char *)SDL_malloc((length + 1) * sizeof(char));
+        SDL_strlcpy(result, text, length + 1);
+    }
+    
+    return result;
 }
 
 SDL_bool HAIKU_HasClipboardText(_THIS) {
-	SDL_bool result = SDL_FALSE;
-	char *text = HAIKU_GetClipboardText(_this);
-	if (text) {
-		result = text[0] != '\0' ? SDL_TRUE : SDL_FALSE;
-		SDL_free(text);
-	} 
-	return result;
+    SDL_bool result = SDL_FALSE;
+    char *text = HAIKU_GetClipboardText(_this);
+    if (text) {
+        result = text[0] != '\0' ? SDL_TRUE : SDL_FALSE;
+        SDL_free(text);
+    } 
+    return result;
 }
 
 #ifdef __cplusplus
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/haiku/SDL_bevents.cc
--- a/src/video/haiku/SDL_bevents.cc	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/haiku/SDL_bevents.cc	Mon Sep 24 11:49:25 2018 -0700
@@ -29,7 +29,7 @@
 #endif
 
 void HAIKU_PumpEvents(_THIS) {
-	/* Since the event thread is its own thread, this isn't really necessary */
+    /* Since the event thread is its own thread, this isn't really necessary */
 }
 
 #ifdef __cplusplus
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/haiku/SDL_bframebuffer.cc
--- a/src/video/haiku/SDL_bframebuffer.cc	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/haiku/SDL_bframebuffer.cc	Mon Sep 24 11:49:25 2018 -0700
@@ -40,158 +40,158 @@
 #endif
 
 static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
-	return ((SDL_BWin*)(window->driverdata));
+    return ((SDL_BWin*)(window->driverdata));
 }
 
 static SDL_INLINE SDL_BApp *_GetBeApp() {
-	return ((SDL_BApp*)be_app);
+    return ((SDL_BApp*)be_app);
 }
 
 int HAIKU_CreateWindowFramebuffer(_THIS, SDL_Window * window,
                                        Uint32 * format,
                                        void ** pixels, int *pitch) {
-	SDL_BWin *bwin = _ToBeWin(window);
-	BScreen bscreen;
-	if(!bscreen.IsValid()) {
-		return -1;
-	}
+    SDL_BWin *bwin = _ToBeWin(window);
+    BScreen bscreen;
+    if(!bscreen.IsValid()) {
+        return -1;
+    }
 
-	while(!bwin->Connected()) { snooze(100); }
-	
-	/* Make sure we have exclusive access to frame buffer data */
-	bwin->LockBuffer();
+    while(!bwin->Connected()) { snooze(100); }
+    
+    /* Make sure we have exclusive access to frame buffer data */
+    bwin->LockBuffer();
 
-	/* format */
-	display_mode bmode;
-	bscreen.GetMode(&bmode);
-	int32 bpp = HAIKU_ColorSpaceToBitsPerPixel(bmode.space);
-	*format = HAIKU_BPPToSDLPxFormat(bpp);
+    /* format */
+    display_mode bmode;
+    bscreen.GetMode(&bmode);
+    int32 bpp = HAIKU_ColorSpaceToBitsPerPixel(bmode.space);
+    *format = HAIKU_BPPToSDLPxFormat(bpp);
 
-	/* Create the new bitmap object */
-	BBitmap *bitmap = bwin->GetBitmap();
+    /* Create the new bitmap object */
+    BBitmap *bitmap = bwin->GetBitmap();
 
-	if(bitmap) {
-		delete bitmap;
-	}
-	bitmap = new BBitmap(bwin->Bounds(), (color_space)bmode.space,
-			false,	/* Views not accepted */
-			true);	/* Contiguous memory required */
-			
-	if(bitmap->InitCheck() != B_OK) {
-		delete bitmap;
-		return SDL_SetError("Could not initialize back buffer!");
-	}
+    if(bitmap) {
+        delete bitmap;
+    }
+    bitmap = new BBitmap(bwin->Bounds(), (color_space)bmode.space,
+            false,    /* Views not accepted */
+            true);    /* Contiguous memory required */
+            
+    if(bitmap->InitCheck() != B_OK) {
+        delete bitmap;
+        return SDL_SetError("Could not initialize back buffer!");
+    }
 
 
-	bwin->SetBitmap(bitmap);
-	
-	/* Set the pixel pointer */
-	*pixels = bitmap->Bits();
+    bwin->SetBitmap(bitmap);
+    
+    /* Set the pixel pointer */
+    *pixels = bitmap->Bits();
 
-	/* pitch = width of window, in bytes */
-	*pitch = bitmap->BytesPerRow();
+    /* pitch = width of window, in bytes */
+    *pitch = bitmap->BytesPerRow();
 
-	bwin->SetBufferExists(true);
-	bwin->SetTrashBuffer(false);
-	bwin->UnlockBuffer();
-	return 0;
+    bwin->SetBufferExists(true);
+    bwin->SetTrashBuffer(false);
+    bwin->UnlockBuffer();
+    return 0;
 }
 
 
 
 int HAIKU_UpdateWindowFramebuffer(_THIS, SDL_Window * window,
                                       const SDL_Rect * rects, int numrects) {
-	if(!window)
-		return 0;
+    if(!window)
+        return 0;
 
-	SDL_BWin *bwin = _ToBeWin(window);
+    SDL_BWin *bwin = _ToBeWin(window);
 
-#ifdef DRAWTHREAD	
-	bwin->LockBuffer();
-	bwin->SetBufferDirty(true);
-	bwin->UnlockBuffer();
+#ifdef DRAWTHREAD    
+    bwin->LockBuffer();
+    bwin->SetBufferDirty(true);
+    bwin->UnlockBuffer();
 #else
-	bwin->SetBufferDirty(true);
-	HAIKU_UpdateOnce(window);
+    bwin->SetBufferDirty(true);
+    HAIKU_UpdateOnce(window);
 #endif
 
-	return 0;
+    return 0;
 }
 
 int32 HAIKU_DrawThread(void *data) {
-	SDL_BWin *bwin = (SDL_BWin*)data;
-	
-	BScreen bscreen;
-	if(!bscreen.IsValid()) {
-		return -1;
-	}
+    SDL_BWin *bwin = (SDL_BWin*)data;
+    
+    BScreen bscreen;
+    if(!bscreen.IsValid()) {
+        return -1;
+    }
 
-	while(bwin->ConnectionEnabled()) {
-		if( bwin->Connected() && bwin->BufferExists() && bwin->BufferIsDirty() ) {
-			bwin->LockBuffer();
-			BBitmap *bitmap = NULL;
-			bitmap = bwin->GetBitmap();
-			int32 windowPitch = bitmap->BytesPerRow();
-			int32 bufferPitch = bwin->GetRowBytes();
-			uint8 *windowpx;
-			uint8 *bufferpx;
+    while(bwin->ConnectionEnabled()) {
+        if( bwin->Connected() && bwin->BufferExists() && bwin->BufferIsDirty() ) {
+            bwin->LockBuffer();
+            BBitmap *bitmap = NULL;
+            bitmap = bwin->GetBitmap();
+            int32 windowPitch = bitmap->BytesPerRow();
+            int32 bufferPitch = bwin->GetRowBytes();
+            uint8 *windowpx;
+            uint8 *bufferpx;
 
-			int32 BPP = bwin->GetBytesPerPx();
-			int32 windowSub = bwin->GetFbX() * BPP +
-						  bwin->GetFbY() * windowPitch;
-			clipping_rect *clips = bwin->GetClips();
-			int32 numClips = bwin->GetNumClips();
-			int i, y;
+            int32 BPP = bwin->GetBytesPerPx();
+            int32 windowSub = bwin->GetFbX() * BPP +
+                          bwin->GetFbY() * windowPitch;
+            clipping_rect *clips = bwin->GetClips();
+            int32 numClips = bwin->GetNumClips();
+            int i, y;
 
-			/* Blit each clipping rectangle */
-			bscreen.WaitForRetrace();
-			for(i = 0; i < numClips; ++i) {
-				/* Get addresses of the start of each clipping rectangle */
-				int32 width = clips[i].right - clips[i].left + 1;
-				int32 height = clips[i].bottom - clips[i].top + 1;
-				bufferpx = bwin->GetBufferPx() + 
-					clips[i].top * bufferPitch + clips[i].left * BPP;
-				windowpx = (uint8*)bitmap->Bits() + 
-					clips[i].top * windowPitch + clips[i].left * BPP -
-					windowSub;
+            /* Blit each clipping rectangle */
+            bscreen.WaitForRetrace();
+            for(i = 0; i < numClips; ++i) {
+                /* Get addresses of the start of each clipping rectangle */
+                int32 width = clips[i].right - clips[i].left + 1;
+                int32 height = clips[i].bottom - clips[i].top + 1;
+                bufferpx = bwin->GetBufferPx() + 
+                    clips[i].top * bufferPitch + clips[i].left * BPP;
+                windowpx = (uint8*)bitmap->Bits() + 
+                    clips[i].top * windowPitch + clips[i].left * BPP -
+                    windowSub;
 
-				/* Copy each row of pixels from the window buffer into the frame
-				   buffer */
-				for(y = 0; y < height; ++y)
-				{
+                /* Copy each row of pixels from the window buffer into the frame
+                   buffer */
+                for(y = 0; y < height; ++y)
+                {
 
-					if(bwin->CanTrashWindowBuffer()) {
-						goto escape;	/* Break out before the buffer is killed */
-					}
+                    if(bwin->CanTrashWindowBuffer()) {
+                        goto escape;    /* Break out before the buffer is killed */
+                    }
 
-					memcpy(bufferpx, windowpx, width * BPP);
-					bufferpx += bufferPitch;
-					windowpx += windowPitch;
-				}
-			}
+                    memcpy(bufferpx, windowpx, width * BPP);
+                    bufferpx += bufferPitch;
+                    windowpx += windowPitch;
+                }
+            }
 
-			bwin->SetBufferDirty(false);
+            bwin->SetBufferDirty(false);
 escape:
-			bwin->UnlockBuffer();
-		} else {
-			snooze(16000);
-		}
-	}
-	
-	return B_OK;
+            bwin->UnlockBuffer();
+        } else {
+            snooze(16000);
+        }
+    }
+    
+    return B_OK;
 }
 
 void HAIKU_DestroyWindowFramebuffer(_THIS, SDL_Window * window) {
-	SDL_BWin *bwin = _ToBeWin(window);
-	
-	bwin->LockBuffer();
-	
-	/* Free and clear the window buffer */
-	BBitmap *bitmap = bwin->GetBitmap();
-	delete bitmap;
-	bwin->SetBitmap(NULL);
-	bwin->SetBufferExists(false);
-	bwin->UnlockBuffer();
+    SDL_BWin *bwin = _ToBeWin(window);
+    
+    bwin->LockBuffer();
+    
+    /* Free and clear the window buffer */
+    BBitmap *bitmap = bwin->GetBitmap();
+    delete bitmap;
+    bwin->SetBitmap(NULL);
+    bwin->SetBufferExists(false);
+    bwin->UnlockBuffer();
 }
 
 
@@ -203,50 +203,50 @@
  */
 #ifndef DRAWTHREAD
 static int32 HAIKU_UpdateOnce(SDL_Window *window) {
-	SDL_BWin *bwin = _ToBeWin(window);
-	BScreen bscreen;
-	if(!bscreen.IsValid()) {
-		return -1;
-	}
+    SDL_BWin *bwin = _ToBeWin(window);
+    BScreen bscreen;
+    if(!bscreen.IsValid()) {
+        return -1;
+    }
 
-	if(bwin->ConnectionEnabled() && bwin->Connected()) {
-		bwin->LockBuffer();
-		int32 windowPitch = window->surface->pitch;
-		int32 bufferPitch = bwin->GetRowBytes();
-		uint8 *windowpx;
-		uint8 *bufferpx;
+    if(bwin->ConnectionEnabled() && bwin->Connected()) {
+        bwin->LockBuffer();
+        int32 windowPitch = window->surface->pitch;
+        int32 bufferPitch = bwin->GetRowBytes();
+        uint8 *windowpx;
+        uint8 *bufferpx;
 
-		int32 BPP = bwin->GetBytesPerPx();
-		uint8 *windowBaseAddress = (uint8*)window->surface->pixels;
-		int32 windowSub = bwin->GetFbX() * BPP +
-						  bwin->GetFbY() * windowPitch;
-		clipping_rect *clips = bwin->GetClips();
-		int32 numClips = bwin->GetNumClips();
-		int i, y;
+        int32 BPP = bwin->GetBytesPerPx();
+        uint8 *windowBaseAddress = (uint8*)window->surface->pixels;
+        int32 windowSub = bwin->GetFbX() * BPP +
+                          bwin->GetFbY() * windowPitch;
+        clipping_rect *clips = bwin->GetClips();
+        int32 numClips = bwin->GetNumClips();
+        int i, y;
 
-		/* Blit each clipping rectangle */
-		bscreen.WaitForRetrace();
-		for(i = 0; i < numClips; ++i) {
-			/* Get addresses of the start of each clipping rectangle */
-			int32 width = clips[i].right - clips[i].left + 1;
-			int32 height = clips[i].bottom - clips[i].top + 1;
-			bufferpx = bwin->GetBufferPx() + 
-				clips[i].top * bufferPitch + clips[i].left * BPP;
-			windowpx = windowBaseAddress + 
-				clips[i].top * windowPitch + clips[i].left * BPP - windowSub;
+        /* Blit each clipping rectangle */
+        bscreen.WaitForRetrace();
+        for(i = 0; i < numClips; ++i) {
+            /* Get addresses of the start of each clipping rectangle */
+            int32 width = clips[i].right - clips[i].left + 1;
+            int32 height = clips[i].bottom - clips[i].top + 1;
+            bufferpx = bwin->GetBufferPx() + 
+                clips[i].top * bufferPitch + clips[i].left * BPP;
+            windowpx = windowBaseAddress + 
+                clips[i].top * windowPitch + clips[i].left * BPP - windowSub;
 
-			/* Copy each row of pixels from the window buffer into the frame
-			   buffer */
-			for(y = 0; y < height; ++y)
-			{
-				memcpy(bufferpx, windowpx, width * BPP);
-				bufferpx += bufferPitch;
-				windowpx += windowPitch;
-			}
-		}
-		bwin->UnlockBuffer();
-	}
-	return 0;
+            /* Copy each row of pixels from the window buffer into the frame
+               buffer */
+            for(y = 0; y < height; ++y)
+            {
+                memcpy(bufferpx, windowpx, width * BPP);
+                bufferpx += bufferPitch;
+                windowpx += windowPitch;
+            }
+        }
+        bwin->UnlockBuffer();
+    }
+    return 0;
 }
 #endif
 
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/haiku/SDL_bkeyboard.cc
--- a/src/video/haiku/SDL_bkeyboard.cc	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/haiku/SDL_bkeyboard.cc	Mon Sep 24 11:49:25 2018 -0700
@@ -42,143 +42,143 @@
 static int8 keystate[KEYMAP_SIZE];
 
 void HAIKU_InitOSKeymap(void) {
-		for( uint i = 0; i < SDL_TABLESIZE(keymap); ++i ) {
-			keymap[i] = SDL_SCANCODE_UNKNOWN;
-		}
+        for( uint i = 0; i < SDL_TABLESIZE(keymap); ++i ) {
+            keymap[i] = SDL_SCANCODE_UNKNOWN;
+        }
 
-		for( uint i = 0; i < KEYMAP_SIZE; ++i ) {
-			keystate[i] = SDL_RELEASED;
-		}
+        for( uint i = 0; i < KEYMAP_SIZE; ++i ) {
+            keystate[i] = SDL_RELEASED;
+        }
 
-		keymap[0x01]		= SDL_GetScancodeFromKey(SDLK_ESCAPE);
-		keymap[B_F1_KEY]	= SDL_GetScancodeFromKey(SDLK_F1);
-		keymap[B_F2_KEY]	= SDL_GetScancodeFromKey(SDLK_F2);
-		keymap[B_F3_KEY]	= SDL_GetScancodeFromKey(SDLK_F3);
-		keymap[B_F4_KEY]	= SDL_GetScancodeFromKey(SDLK_F4);
-		keymap[B_F5_KEY]	= SDL_GetScancodeFromKey(SDLK_F5);
-		keymap[B_F6_KEY]	= SDL_GetScancodeFromKey(SDLK_F6);
-		keymap[B_F7_KEY]	= SDL_GetScancodeFromKey(SDLK_F7);
-		keymap[B_F8_KEY]	= SDL_GetScancodeFromKey(SDLK_F8);
-		keymap[B_F9_KEY]	= SDL_GetScancodeFromKey(SDLK_F9);
-		keymap[B_F10_KEY]	= SDL_GetScancodeFromKey(SDLK_F10);
-		keymap[B_F11_KEY]	= SDL_GetScancodeFromKey(SDLK_F11);
-		keymap[B_F12_KEY]	= SDL_GetScancodeFromKey(SDLK_F12);
-		keymap[B_PRINT_KEY]	= SDL_GetScancodeFromKey(SDLK_PRINTSCREEN);
-		keymap[B_SCROLL_KEY]	= SDL_GetScancodeFromKey(SDLK_SCROLLLOCK);
-		keymap[B_PAUSE_KEY]	= SDL_GetScancodeFromKey(SDLK_PAUSE);
-		keymap[0x11]		= SDL_GetScancodeFromKey(SDLK_BACKQUOTE);
-		keymap[0x12]		= SDL_GetScancodeFromKey(SDLK_1);
-		keymap[0x13]		= SDL_GetScancodeFromKey(SDLK_2);
-		keymap[0x14]		= SDL_GetScancodeFromKey(SDLK_3);
-		keymap[0x15]		= SDL_GetScancodeFromKey(SDLK_4);
-		keymap[0x16]		= SDL_GetScancodeFromKey(SDLK_5);
-		keymap[0x17]		= SDL_GetScancodeFromKey(SDLK_6);
-		keymap[0x18]		= SDL_GetScancodeFromKey(SDLK_7);
-		keymap[0x19]		= SDL_GetScancodeFromKey(SDLK_8);
-		keymap[0x1a]		= SDL_GetScancodeFromKey(SDLK_9);
-		keymap[0x1b]		= SDL_GetScancodeFromKey(SDLK_0);
-		keymap[0x1c]		= SDL_GetScancodeFromKey(SDLK_MINUS);
-		keymap[0x1d]		= SDL_GetScancodeFromKey(SDLK_EQUALS);
-		keymap[0x1e]		= SDL_GetScancodeFromKey(SDLK_BACKSPACE);
-		keymap[0x1f]		= SDL_GetScancodeFromKey(SDLK_INSERT);
-		keymap[0x20]		= SDL_GetScancodeFromKey(SDLK_HOME);
-		keymap[0x21]		= SDL_GetScancodeFromKey(SDLK_PAGEUP);
-		keymap[0x22]		= SDL_GetScancodeFromKey(SDLK_NUMLOCKCLEAR);
-		keymap[0x23]		= SDL_GetScancodeFromKey(SDLK_KP_DIVIDE);
-		keymap[0x24]		= SDL_GetScancodeFromKey(SDLK_KP_MULTIPLY);
-		keymap[0x25]		= SDL_GetScancodeFromKey(SDLK_KP_MINUS);
-		keymap[0x26]		= SDL_GetScancodeFromKey(SDLK_TAB);
-		keymap[0x27]		= SDL_GetScancodeFromKey(SDLK_q);
-		keymap[0x28]		= SDL_GetScancodeFromKey(SDLK_w);
-		keymap[0x29]		= SDL_GetScancodeFromKey(SDLK_e);
-		keymap[0x2a]		= SDL_GetScancodeFromKey(SDLK_r);
-		keymap[0x2b]		= SDL_GetScancodeFromKey(SDLK_t);
-		keymap[0x2c]		= SDL_GetScancodeFromKey(SDLK_y);
-		keymap[0x2d]		= SDL_GetScancodeFromKey(SDLK_u);
-		keymap[0x2e]		= SDL_GetScancodeFromKey(SDLK_i);
-		keymap[0x2f]		= SDL_GetScancodeFromKey(SDLK_o);
-		keymap[0x30]		= SDL_GetScancodeFromKey(SDLK_p);
-		keymap[0x31]		= SDL_GetScancodeFromKey(SDLK_LEFTBRACKET);
-		keymap[0x32]		= SDL_GetScancodeFromKey(SDLK_RIGHTBRACKET);
-		keymap[0x33]		= SDL_GetScancodeFromKey(SDLK_BACKSLASH);
-		keymap[0x34]		= SDL_GetScancodeFromKey(SDLK_DELETE);
-		keymap[0x35]		= SDL_GetScancodeFromKey(SDLK_END);
-		keymap[0x36]		= SDL_GetScancodeFromKey(SDLK_PAGEDOWN);
-		keymap[0x37]		= SDL_GetScancodeFromKey(SDLK_KP_7);
-		keymap[0x38]		= SDL_GetScancodeFromKey(SDLK_KP_8);
-		keymap[0x39]		= SDL_GetScancodeFromKey(SDLK_KP_9);
-		keymap[0x3a]		= SDL_GetScancodeFromKey(SDLK_KP_PLUS);
-		keymap[0x3b]		= SDL_GetScancodeFromKey(SDLK_CAPSLOCK);
-		keymap[0x3c]		= SDL_GetScancodeFromKey(SDLK_a);
-		keymap[0x3d]		= SDL_GetScancodeFromKey(SDLK_s);
-		keymap[0x3e]		= SDL_GetScancodeFromKey(SDLK_d);
-		keymap[0x3f]		= SDL_GetScancodeFromKey(SDLK_f);
-		keymap[0x40]		= SDL_GetScancodeFromKey(SDLK_g);
-		keymap[0x41]		= SDL_GetScancodeFromKey(SDLK_h);
-		keymap[0x42]		= SDL_GetScancodeFromKey(SDLK_j);
-		keymap[0x43]		= SDL_GetScancodeFromKey(SDLK_k);
-		keymap[0x44]		= SDL_GetScancodeFromKey(SDLK_l);
-		keymap[0x45]		= SDL_GetScancodeFromKey(SDLK_SEMICOLON);
-		keymap[0x46]		= SDL_GetScancodeFromKey(SDLK_QUOTE);
-		keymap[0x47]		= SDL_GetScancodeFromKey(SDLK_RETURN);
-		keymap[0x48]		= SDL_GetScancodeFromKey(SDLK_KP_4);
-		keymap[0x49]		= SDL_GetScancodeFromKey(SDLK_KP_5);
-		keymap[0x4a]		= SDL_GetScancodeFromKey(SDLK_KP_6);
-		keymap[0x4b]		= SDL_GetScancodeFromKey(SDLK_LSHIFT);
-		keymap[0x4c]		= SDL_GetScancodeFromKey(SDLK_z);
-		keymap[0x4d]		= SDL_GetScancodeFromKey(SDLK_x);
-		keymap[0x4e]		= SDL_GetScancodeFromKey(SDLK_c);
-		keymap[0x4f]		= SDL_GetScancodeFromKey(SDLK_v);
-		keymap[0x50]		= SDL_GetScancodeFromKey(SDLK_b);
-		keymap[0x51]		= SDL_GetScancodeFromKey(SDLK_n);
-		keymap[0x52]		= SDL_GetScancodeFromKey(SDLK_m);
-		keymap[0x53]		= SDL_GetScancodeFromKey(SDLK_COMMA);
-		keymap[0x54]		= SDL_GetScancodeFromKey(SDLK_PERIOD);
-		keymap[0x55]		= SDL_GetScancodeFromKey(SDLK_SLASH);
-		keymap[0x56]		= SDL_GetScancodeFromKey(SDLK_RSHIFT);
-		keymap[0x57]		= SDL_GetScancodeFromKey(SDLK_UP);
-		keymap[0x58]		= SDL_GetScancodeFromKey(SDLK_KP_1);
-		keymap[0x59]		= SDL_GetScancodeFromKey(SDLK_KP_2);
-		keymap[0x5a]		= SDL_GetScancodeFromKey(SDLK_KP_3);
-		keymap[0x5b]		= SDL_GetScancodeFromKey(SDLK_KP_ENTER);
-		keymap[0x5c]		= SDL_GetScancodeFromKey(SDLK_LCTRL);
-		keymap[0x5d]		= SDL_GetScancodeFromKey(SDLK_LALT);
-		keymap[0x5e]		= SDL_GetScancodeFromKey(SDLK_SPACE);
-		keymap[0x5f]		= SDL_GetScancodeFromKey(SDLK_RALT);
-		keymap[0x60]		= SDL_GetScancodeFromKey(SDLK_RCTRL);
-		keymap[0x61]		= SDL_GetScancodeFromKey(SDLK_LEFT);
-		keymap[0x62]		= SDL_GetScancodeFromKey(SDLK_DOWN);
-		keymap[0x63]		= SDL_GetScancodeFromKey(SDLK_RIGHT);
-		keymap[0x64]		= SDL_GetScancodeFromKey(SDLK_KP_0);
-		keymap[0x65]		= SDL_GetScancodeFromKey(SDLK_KP_PERIOD);
-		keymap[0x66]		= SDL_GetScancodeFromKey(SDLK_LGUI);
-		keymap[0x67]		= SDL_GetScancodeFromKey(SDLK_RGUI);
-		keymap[0x68]		= SDL_GetScancodeFromKey(SDLK_MENU);
-		keymap[0x69]		= SDL_GetScancodeFromKey(SDLK_2); /* SDLK_EURO */
-		keymap[0x6a]		= SDL_GetScancodeFromKey(SDLK_KP_EQUALS);
-		keymap[0x6b]		= SDL_GetScancodeFromKey(SDLK_POWER);
+        keymap[0x01]        = SDL_GetScancodeFromKey(SDLK_ESCAPE);
+        keymap[B_F1_KEY]    = SDL_GetScancodeFromKey(SDLK_F1);
+        keymap[B_F2_KEY]    = SDL_GetScancodeFromKey(SDLK_F2);
+        keymap[B_F3_KEY]    = SDL_GetScancodeFromKey(SDLK_F3);
+        keymap[B_F4_KEY]    = SDL_GetScancodeFromKey(SDLK_F4);
+        keymap[B_F5_KEY]    = SDL_GetScancodeFromKey(SDLK_F5);
+        keymap[B_F6_KEY]    = SDL_GetScancodeFromKey(SDLK_F6);
+        keymap[B_F7_KEY]    = SDL_GetScancodeFromKey(SDLK_F7);
+        keymap[B_F8_KEY]    = SDL_GetScancodeFromKey(SDLK_F8);
+        keymap[B_F9_KEY]    = SDL_GetScancodeFromKey(SDLK_F9);
+        keymap[B_F10_KEY]    = SDL_GetScancodeFromKey(SDLK_F10);
+        keymap[B_F11_KEY]    = SDL_GetScancodeFromKey(SDLK_F11);
+        keymap[B_F12_KEY]    = SDL_GetScancodeFromKey(SDLK_F12);
+        keymap[B_PRINT_KEY]    = SDL_GetScancodeFromKey(SDLK_PRINTSCREEN);
+        keymap[B_SCROLL_KEY]    = SDL_GetScancodeFromKey(SDLK_SCROLLLOCK);
+        keymap[B_PAUSE_KEY]    = SDL_GetScancodeFromKey(SDLK_PAUSE);
+        keymap[0x11]        = SDL_GetScancodeFromKey(SDLK_BACKQUOTE);
+        keymap[0x12]        = SDL_GetScancodeFromKey(SDLK_1);
+        keymap[0x13]        = SDL_GetScancodeFromKey(SDLK_2);
+        keymap[0x14]        = SDL_GetScancodeFromKey(SDLK_3);
+        keymap[0x15]        = SDL_GetScancodeFromKey(SDLK_4);
+        keymap[0x16]        = SDL_GetScancodeFromKey(SDLK_5);
+        keymap[0x17]        = SDL_GetScancodeFromKey(SDLK_6);
+        keymap[0x18]        = SDL_GetScancodeFromKey(SDLK_7);
+        keymap[0x19]        = SDL_GetScancodeFromKey(SDLK_8);
+        keymap[0x1a]        = SDL_GetScancodeFromKey(SDLK_9);
+        keymap[0x1b]        = SDL_GetScancodeFromKey(SDLK_0);
+        keymap[0x1c]        = SDL_GetScancodeFromKey(SDLK_MINUS);
+        keymap[0x1d]        = SDL_GetScancodeFromKey(SDLK_EQUALS);
+        keymap[0x1e]        = SDL_GetScancodeFromKey(SDLK_BACKSPACE);
+        keymap[0x1f]        = SDL_GetScancodeFromKey(SDLK_INSERT);
+        keymap[0x20]        = SDL_GetScancodeFromKey(SDLK_HOME);
+        keymap[0x21]        = SDL_GetScancodeFromKey(SDLK_PAGEUP);
+        keymap[0x22]        = SDL_GetScancodeFromKey(SDLK_NUMLOCKCLEAR);
+        keymap[0x23]        = SDL_GetScancodeFromKey(SDLK_KP_DIVIDE);
+        keymap[0x24]        = SDL_GetScancodeFromKey(SDLK_KP_MULTIPLY);
+        keymap[0x25]        = SDL_GetScancodeFromKey(SDLK_KP_MINUS);
+        keymap[0x26]        = SDL_GetScancodeFromKey(SDLK_TAB);
+        keymap[0x27]        = SDL_GetScancodeFromKey(SDLK_q);
+        keymap[0x28]        = SDL_GetScancodeFromKey(SDLK_w);
+        keymap[0x29]        = SDL_GetScancodeFromKey(SDLK_e);
+        keymap[0x2a]        = SDL_GetScancodeFromKey(SDLK_r);
+        keymap[0x2b]        = SDL_GetScancodeFromKey(SDLK_t);
+        keymap[0x2c]        = SDL_GetScancodeFromKey(SDLK_y);
+        keymap[0x2d]        = SDL_GetScancodeFromKey(SDLK_u);
+        keymap[0x2e]        = SDL_GetScancodeFromKey(SDLK_i);
+        keymap[0x2f]        = SDL_GetScancodeFromKey(SDLK_o);
+        keymap[0x30]        = SDL_GetScancodeFromKey(SDLK_p);
+        keymap[0x31]        = SDL_GetScancodeFromKey(SDLK_LEFTBRACKET);
+        keymap[0x32]        = SDL_GetScancodeFromKey(SDLK_RIGHTBRACKET);
+        keymap[0x33]        = SDL_GetScancodeFromKey(SDLK_BACKSLASH);
+        keymap[0x34]        = SDL_GetScancodeFromKey(SDLK_DELETE);
+        keymap[0x35]        = SDL_GetScancodeFromKey(SDLK_END);
+        keymap[0x36]        = SDL_GetScancodeFromKey(SDLK_PAGEDOWN);
+        keymap[0x37]        = SDL_GetScancodeFromKey(SDLK_KP_7);
+        keymap[0x38]        = SDL_GetScancodeFromKey(SDLK_KP_8);
+        keymap[0x39]        = SDL_GetScancodeFromKey(SDLK_KP_9);
+        keymap[0x3a]        = SDL_GetScancodeFromKey(SDLK_KP_PLUS);
+        keymap[0x3b]        = SDL_GetScancodeFromKey(SDLK_CAPSLOCK);
+        keymap[0x3c]        = SDL_GetScancodeFromKey(SDLK_a);
+        keymap[0x3d]        = SDL_GetScancodeFromKey(SDLK_s);
+        keymap[0x3e]        = SDL_GetScancodeFromKey(SDLK_d);
+        keymap[0x3f]        = SDL_GetScancodeFromKey(SDLK_f);
+        keymap[0x40]        = SDL_GetScancodeFromKey(SDLK_g);
+        keymap[0x41]        = SDL_GetScancodeFromKey(SDLK_h);
+        keymap[0x42]        = SDL_GetScancodeFromKey(SDLK_j);
+        keymap[0x43]        = SDL_GetScancodeFromKey(SDLK_k);
+        keymap[0x44]        = SDL_GetScancodeFromKey(SDLK_l);
+        keymap[0x45]        = SDL_GetScancodeFromKey(SDLK_SEMICOLON);
+        keymap[0x46]        = SDL_GetScancodeFromKey(SDLK_QUOTE);
+        keymap[0x47]        = SDL_GetScancodeFromKey(SDLK_RETURN);
+        keymap[0x48]        = SDL_GetScancodeFromKey(SDLK_KP_4);
+        keymap[0x49]        = SDL_GetScancodeFromKey(SDLK_KP_5);
+        keymap[0x4a]        = SDL_GetScancodeFromKey(SDLK_KP_6);
+        keymap[0x4b]        = SDL_GetScancodeFromKey(SDLK_LSHIFT);
+        keymap[0x4c]        = SDL_GetScancodeFromKey(SDLK_z);
+        keymap[0x4d]        = SDL_GetScancodeFromKey(SDLK_x);
+        keymap[0x4e]        = SDL_GetScancodeFromKey(SDLK_c);
+        keymap[0x4f]        = SDL_GetScancodeFromKey(SDLK_v);
+        keymap[0x50]        = SDL_GetScancodeFromKey(SDLK_b);
+        keymap[0x51]        = SDL_GetScancodeFromKey(SDLK_n);
+        keymap[0x52]        = SDL_GetScancodeFromKey(SDLK_m);
+        keymap[0x53]        = SDL_GetScancodeFromKey(SDLK_COMMA);
+        keymap[0x54]        = SDL_GetScancodeFromKey(SDLK_PERIOD);
+        keymap[0x55]        = SDL_GetScancodeFromKey(SDLK_SLASH);
+        keymap[0x56]        = SDL_GetScancodeFromKey(SDLK_RSHIFT);
+        keymap[0x57]        = SDL_GetScancodeFromKey(SDLK_UP);
+        keymap[0x58]        = SDL_GetScancodeFromKey(SDLK_KP_1);
+        keymap[0x59]        = SDL_GetScancodeFromKey(SDLK_KP_2);
+        keymap[0x5a]        = SDL_GetScancodeFromKey(SDLK_KP_3);
+        keymap[0x5b]        = SDL_GetScancodeFromKey(SDLK_KP_ENTER);
+        keymap[0x5c]        = SDL_GetScancodeFromKey(SDLK_LCTRL);
+        keymap[0x5d]        = SDL_GetScancodeFromKey(SDLK_LALT);
+        keymap[0x5e]        = SDL_GetScancodeFromKey(SDLK_SPACE);
+        keymap[0x5f]        = SDL_GetScancodeFromKey(SDLK_RALT);
+        keymap[0x60]        = SDL_GetScancodeFromKey(SDLK_RCTRL);
+        keymap[0x61]        = SDL_GetScancodeFromKey(SDLK_LEFT);
+        keymap[0x62]        = SDL_GetScancodeFromKey(SDLK_DOWN);
+        keymap[0x63]        = SDL_GetScancodeFromKey(SDLK_RIGHT);
+        keymap[0x64]        = SDL_GetScancodeFromKey(SDLK_KP_0);
+        keymap[0x65]        = SDL_GetScancodeFromKey(SDLK_KP_PERIOD);
+        keymap[0x66]        = SDL_GetScancodeFromKey(SDLK_LGUI);
+        keymap[0x67]        = SDL_GetScancodeFromKey(SDLK_RGUI);
+        keymap[0x68]        = SDL_GetScancodeFromKey(SDLK_MENU);
+        keymap[0x69]        = SDL_GetScancodeFromKey(SDLK_2); /* SDLK_EURO */
+        keymap[0x6a]        = SDL_GetScancodeFromKey(SDLK_KP_EQUALS);
+        keymap[0x6b]        = SDL_GetScancodeFromKey(SDLK_POWER);
 }
 
 SDL_Scancode HAIKU_GetScancodeFromBeKey(int32 bkey) {
-	if(bkey > 0 && bkey < (int32)SDL_TABLESIZE(keymap)) {
-		return keymap[bkey];
-	} else {
-		return SDL_SCANCODE_UNKNOWN;
-	}
+    if(bkey > 0 && bkey < (int32)SDL_TABLESIZE(keymap)) {
+        return keymap[bkey];
+    } else {
+        return SDL_SCANCODE_UNKNOWN;
+    }
 }
 
 int8 HAIKU_GetKeyState(int32 bkey) {
-	if(bkey > 0 && bkey < KEYMAP_SIZE) {
-		return keystate[bkey];
-	} else {
-		return SDL_RELEASED;
-	}
+    if(bkey > 0 && bkey < KEYMAP_SIZE) {
+        return keystate[bkey];
+    } else {
+        return SDL_RELEASED;
+    }
 }
 
 void HAIKU_SetKeyState(int32 bkey, int8 state) {
-	if(bkey > 0 && bkey < KEYMAP_SIZE) {
-		keystate[bkey] = state;
-	}
+    if(bkey > 0 && bkey < KEYMAP_SIZE) {
+        keystate[bkey] = state;
+    }
 }
 
 #ifdef __cplusplus
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/haiku/SDL_bmodes.cc
--- a/src/video/haiku/SDL_bmodes.cc	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/haiku/SDL_bmodes.cc	Mon Sep 24 11:49:25 2018 -0700
@@ -44,30 +44,30 @@
 /* This wrapper is here so that the driverdata can be freed without freeing
    the display_mode structure */
 struct SDL_DisplayModeData {
-	display_mode *bmode;
+    display_mode *bmode;
 };
 #endif
 
 static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
-	return ((SDL_BWin*)(window->driverdata));
+    return ((SDL_BWin*)(window->driverdata));
 }
 
 static SDL_INLINE SDL_BApp *_GetBeApp() {
-	return ((SDL_BApp*)be_app);
+    return ((SDL_BApp*)be_app);
 }
 
 static SDL_INLINE display_mode * _ExtractBMode(SDL_DisplayMode *mode) {
 #if WRAP_BMODE
-	return ((SDL_DisplayModeData*)mode->driverdata)->bmode;
+    return ((SDL_DisplayModeData*)mode->driverdata)->bmode;
 #else
-	return (display_mode*)(mode->driverdata);
+    return (display_mode*)(mode->driverdata);
 #endif
 }
 
 /* Copied from haiku/trunk/src/preferences/screen/ScreenMode.cpp */
 static float get_refresh_rate(display_mode &mode) {
-	return float(mode.timing.pixel_clock * 1000)
-		/ float(mode.timing.h_total * mode.timing.v_total);
+    return float(mode.timing.pixel_clock * 1000)
+        / float(mode.timing.h_total * mode.timing.v_total);
 }
 
 
@@ -76,57 +76,57 @@
  * This is a useful debugging tool.  Uncomment and insert into code as needed.
  */
 void _SpoutModeData(display_mode *bmode) {
-	printf("BMode:\n");
-	printf("\tw,h = (%i,%i)\n", bmode->virtual_width, bmode->virtual_height);
-	printf("\th,v = (%i,%i)\n", bmode->h_display_start, 
-			bmode->v_display_start);
-	if(bmode->flags) {
-		printf("\tFlags:\n");
-		if(bmode->flags & B_SCROLL) {
-			printf("\t\tB_SCROLL\n");
-		}
-		if(bmode->flags & B_8_BIT_DAC) {
-			printf("\t\tB_8_BIT_DAC\n");
-		}
-		if(bmode->flags & B_HARDWARE_CURSOR) {
-			printf("\t\tB_HARDWARE_CURSOR\n");
-		}
-		if(bmode->flags & B_PARALLEL_ACCESS) {
-			printf("\t\tB_PARALLEL_ACCESS\n");
-		}
-		if(bmode->flags & B_DPMS) {
-			printf("\t\tB_DPMS\n");
-		}
-		if(bmode->flags & B_IO_FB_NA) {
-			printf("\t\tB_IO_FB_NA\n");
-		}
-	}
-	printf("\tTiming:\n");
-	printf("\t\tpx clock: %i\n", bmode->timing.pixel_clock);
-	printf("\t\th - display: %i sync start: %i sync end: %i total: %i\n",
-		bmode->timing.h_display, bmode->timing.h_sync_start,
-		bmode->timing.h_sync_end, bmode->timing.h_total);
-	printf("\t\tv - display: %i sync start: %i sync end: %i total: %i\n",
-		bmode->timing.v_display, bmode->timing.v_sync_start,
-		bmode->timing.v_sync_end, bmode->timing.v_total);
-	if(bmode->timing.flags) {
-		printf("\t\tFlags:\n");
-		if(bmode->timing.flags & B_BLANK_PEDESTAL) {
-			printf("\t\t\tB_BLANK_PEDESTAL\n");
-		}
-		if(bmode->timing.flags & B_TIMING_INTERLACED) {
-			printf("\t\t\tB_TIMING_INTERLACED\n");
-		}
-		if(bmode->timing.flags & B_POSITIVE_HSYNC) {
-			printf("\t\t\tB_POSITIVE_HSYNC\n");
-		}
-		if(bmode->timing.flags & B_POSITIVE_VSYNC) {
-			printf("\t\t\tB_POSITIVE_VSYNC\n");
-		}
-		if(bmode->timing.flags & B_SYNC_ON_GREEN) {
-			printf("\t\t\tB_SYNC_ON_GREEN\n");
-		}
-	}
+    printf("BMode:\n");
+    printf("\tw,h = (%i,%i)\n", bmode->virtual_width, bmode->virtual_height);
+    printf("\th,v = (%i,%i)\n", bmode->h_display_start, 
+            bmode->v_display_start);
+    if(bmode->flags) {
+        printf("\tFlags:\n");
+        if(bmode->flags & B_SCROLL) {
+            printf("\t\tB_SCROLL\n");
+        }
+        if(bmode->flags & B_8_BIT_DAC) {
+            printf("\t\tB_8_BIT_DAC\n");
+        }
+        if(bmode->flags & B_HARDWARE_CURSOR) {
+            printf("\t\tB_HARDWARE_CURSOR\n");
+        }
+        if(bmode->flags & B_PARALLEL_ACCESS) {
+            printf("\t\tB_PARALLEL_ACCESS\n");
+        }
+        if(bmode->flags & B_DPMS) {
+            printf("\t\tB_DPMS\n");
+        }
+        if(bmode->flags & B_IO_FB_NA) {
+            printf("\t\tB_IO_FB_NA\n");
+        }
+    }
+    printf("\tTiming:\n");
+    printf("\t\tpx clock: %i\n", bmode->timing.pixel_clock);
+    printf("\t\th - display: %i sync start: %i sync end: %i total: %i\n",
+        bmode->timing.h_display, bmode->timing.h_sync_start,
+        bmode->timing.h_sync_end, bmode->timing.h_total);
+    printf("\t\tv - display: %i sync start: %i sync end: %i total: %i\n",
+        bmode->timing.v_display, bmode->timing.v_sync_start,
+        bmode->timing.v_sync_end, bmode->timing.v_total);
+    if(bmode->timing.flags) {
+        printf("\t\tFlags:\n");
+        if(bmode->timing.flags & B_BLANK_PEDESTAL) {
+            printf("\t\t\tB_BLANK_PEDESTAL\n");
+        }
+        if(bmode->timing.flags & B_TIMING_INTERLACED) {
+            printf("\t\t\tB_TIMING_INTERLACED\n");
+        }
+        if(bmode->timing.flags & B_POSITIVE_HSYNC) {
+            printf("\t\t\tB_POSITIVE_HSYNC\n");
+        }
+        if(bmode->timing.flags & B_POSITIVE_VSYNC) {
+            printf("\t\t\tB_POSITIVE_VSYNC\n");
+        }
+        if(bmode->timing.flags & B_SYNC_ON_GREEN) {
+            printf("\t\t\tB_SYNC_ON_GREEN\n");
+        }
+    }
 }
 #endif
 
@@ -134,101 +134,101 @@
 
 int32 HAIKU_ColorSpaceToBitsPerPixel(uint32 colorspace)
 {
-	int bitsperpixel;
+    int bitsperpixel;
 
-	bitsperpixel = 0;
-	switch (colorspace) {
-	    case B_CMAP8:
-		bitsperpixel = 8;
-		break;
-	    case B_RGB15:
-	    case B_RGBA15:
-	    case B_RGB15_BIG:
-	    case B_RGBA15_BIG:
-		bitsperpixel = 15;
-		break;
-	    case B_RGB16:
-	    case B_RGB16_BIG:
-		bitsperpixel = 16;
-		break;
-	    case B_RGB32:
-	    case B_RGBA32:
-	    case B_RGB32_BIG:
-	    case B_RGBA32_BIG:
-		bitsperpixel = 32;
-		break;
-	    default:
-		break;
-	}
-	return(bitsperpixel);
+    bitsperpixel = 0;
+    switch (colorspace) {
+        case B_CMAP8:
+        bitsperpixel = 8;
+        break;
+        case B_RGB15:
+        case B_RGBA15:
+        case B_RGB15_BIG:
+        case B_RGBA15_BIG:
+        bitsperpixel = 15;
+        break;
+        case B_RGB16:
+        case B_RGB16_BIG:
+        bitsperpixel = 16;
+        break;
+        case B_RGB32:
+        case B_RGBA32:
+        case B_RGB32_BIG:
+        case B_RGBA32_BIG:
+        bitsperpixel = 32;
+        break;
+        default:
+        break;
+    }
+    return(bitsperpixel);
 }
 
 int32 HAIKU_BPPToSDLPxFormat(int32 bpp) {
-	/* Translation taken from SDL_windowsmodes.c */
-	switch (bpp) {
-	case 32:
-		return SDL_PIXELFORMAT_RGB888;
-		break;
-	case 24:	/* May not be supported by Haiku */
-		return SDL_PIXELFORMAT_RGB24;
-		break;
-	case 16:
-		return SDL_PIXELFORMAT_RGB565;
-		break;
-	case 15:
-		return SDL_PIXELFORMAT_RGB555;
-		break;
-	case 8:
-		return SDL_PIXELFORMAT_INDEX8;
-		break;
-	case 4:		/* May not be supported by Haiku */
-		return SDL_PIXELFORMAT_INDEX4LSB;
-		break;
-	}
+    /* Translation taken from SDL_windowsmodes.c */
+    switch (bpp) {
+    case 32:
+        return SDL_PIXELFORMAT_RGB888;
+        break;
+    case 24:    /* May not be supported by Haiku */
+        return SDL_PIXELFORMAT_RGB24;
+        break;
+    case 16:
+        return SDL_PIXELFORMAT_RGB565;
+        break;
+    case 15:
+        return SDL_PIXELFORMAT_RGB555;
+        break;
+    case 8:
+        return SDL_PIXELFORMAT_INDEX8;
+        break;
+    case 4:        /* May not be supported by Haiku */
+        return SDL_PIXELFORMAT_INDEX4LSB;
+        break;
+    }
 
-	/* May never get here, but safer and needed to shut up compiler */
-	SDL_SetError("Invalid bpp value");
-	return 0;       
+    /* May never get here, but safer and needed to shut up compiler */
+    SDL_SetError("Invalid bpp value");
+    return 0;       
 }
 
 static void _BDisplayModeToSdlDisplayMode(display_mode *bmode,
-		SDL_DisplayMode *mode) {
-	mode->w = bmode->virtual_width;
-	mode->h = bmode->virtual_height;
-	mode->refresh_rate = (int)get_refresh_rate(*bmode);
+        SDL_DisplayMode *mode) {
+    mode->w = bmode->virtual_width;
+    mode->h = bmode->virtual_height;
+    mode->refresh_rate = (int)get_refresh_rate(*bmode);
 
 #if WRAP_BMODE
-	SDL_DisplayModeData *data = (SDL_DisplayModeData*)SDL_calloc(1,
-		sizeof(SDL_DisplayModeData));
-	data->bmode = bmode;
-	
-	mode->driverdata = data;
+    SDL_DisplayModeData *data = (SDL_DisplayModeData*)SDL_calloc(1,
+        sizeof(SDL_DisplayModeData));
+    data->bmode = bmode;
+    
+    mode->driverdata = data;
 
 #else
 
-	mode->driverdata = bmode;
+    mode->driverdata = bmode;
 #endif
 
-	/* Set the format */
-	int32 bpp = HAIKU_ColorSpaceToBitsPerPixel(bmode->space);
-	mode->format = HAIKU_BPPToSDLPxFormat(bpp);
+    /* Set the format */
+    int32 bpp = HAIKU_ColorSpaceToBitsPerPixel(bmode->space);
+    mode->format = HAIKU_BPPToSDLPxFormat(bpp);
 }
 
 /* Later, there may be more than one monitor available */
 static void _AddDisplay(BScreen *screen) {
-	SDL_VideoDisplay display;
-	SDL_DisplayMode *mode = (SDL_DisplayMode*)SDL_calloc(1,
-		sizeof(SDL_DisplayMode));
-	display_mode *bmode = (display_mode*)SDL_calloc(1, sizeof(display_mode));
-	screen->GetMode(bmode);
+    SDL_VideoDisplay display;
+    SDL_DisplayMode *mode = (SDL_DisplayMode*)SDL_calloc(1,
+        sizeof(SDL_DisplayMode));
+    display_mode *bmode = (display_mode*)SDL_calloc(1, sizeof(display_mode));
+    screen->GetMode(bmode);
 
-	_BDisplayModeToSdlDisplayMode(bmode, mode);
-	
-	SDL_zero(display);
-	display.desktop_mode = *mode;
-	display.current_mode = *mode;
-	
-	SDL_AddVideoDisplay(&display);
+    _BDisplayModeToSdlDisplayMode(bmode, mode);
+    
+    SDL_zero(display);
+    display.desktop_mode = *mode;
+    display.current_mode = *mode;
+    
+    SDL_AddVideoDisplay(&display);
 }
 
 /*
@@ -236,92 +236,92 @@
  */
 
 int HAIKU_InitModes(_THIS) {
-	BScreen screen;
+    BScreen screen;
 
-	/* TODO: When Haiku supports multiple display screens, call
-	   _AddDisplayScreen() for each of them. */
-	_AddDisplay(&screen);
-	return 0;
+    /* TODO: When Haiku supports multiple display screens, call
+       _AddDisplayScreen() for each of them. */
+    _AddDisplay(&screen);
+    return 0;
 }
 
 int HAIKU_QuitModes(_THIS) {
-	/* FIXME: Nothing really needs to be done here at the moment? */
-	return 0;
+    /* FIXME: Nothing really needs to be done here at the moment? */
+    return 0;
 }
 
 
 int HAIKU_GetDisplayBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect) {
-	BScreen bscreen;
-	BRect rc = bscreen.Frame();
-	rect->x = (int)rc.left;
-	rect->y = (int)rc.top;
-	rect->w = (int)rc.Width() + 1;
-	rect->h = (int)rc.Height() + 1;
-	return 0;
+    BScreen bscreen;
+    BRect rc = bscreen.Frame();
+    rect->x = (int)rc.left;
+    rect->y = (int)rc.top;
+    rect->w = (int)rc.Width() + 1;
+    rect->h = (int)rc.Height() + 1;
+    return 0;
 }
 
 void HAIKU_GetDisplayModes(_THIS, SDL_VideoDisplay *display) {
-	/* Get the current screen */
-	BScreen bscreen;
+    /* Get the current screen */
+    BScreen bscreen;
 
-	/* Iterate through all of the modes */
-	SDL_DisplayMode mode;
-	display_mode this_bmode;
-	display_mode *bmodes;
-	uint32 count, i;
-	
-	/* Get graphics-hardware supported modes */
-	bscreen.GetModeList(&bmodes, &count);
-	bscreen.GetMode(&this_bmode);
-	
-	for(i = 0; i < count; ++i) {
-		// FIXME: Apparently there are errors with colorspace changes
-		if (bmodes[i].space == this_bmode.space) {
-			_BDisplayModeToSdlDisplayMode(&bmodes[i], &mode);
-			SDL_AddDisplayMode(display, &mode);
-		}
-	}
-	free(bmodes);
+    /* Iterate through all of the modes */
+    SDL_DisplayMode mode;
+    display_mode this_bmode;
+    display_mode *bmodes;
+    uint32 count, i;
+    
+    /* Get graphics-hardware supported modes */
+    bscreen.GetModeList(&bmodes, &count);
+    bscreen.GetMode(&this_bmode);
+    
+    for(i = 0; i < count; ++i) {
+        // FIXME: Apparently there are errors with colorspace changes
+        if (bmodes[i].space == this_bmode.space) {
+            _BDisplayModeToSdlDisplayMode(&bmodes[i], &mode);
+            SDL_AddDisplayMode(display, &mode);
+        }
+    }
+    free(bmodes);
 }
 
 
 int HAIKU_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode){
-	/* Get the current screen */
-	BScreen bscreen;
-	if(!bscreen.IsValid()) {
-		printf(__FILE__": %d - ERROR: BAD SCREEN\n", __LINE__);
-	}
+    /* Get the current screen */
+    BScreen bscreen;
+    if(!bscreen.IsValid()) {
+        printf(__FILE__": %d - ERROR: BAD SCREEN\n", __LINE__);
+    }
 
-	/* Set the mode using the driver data */
-	display_mode *bmode = _ExtractBMode(mode);
+    /* Set the mode using the driver data */
+    display_mode *bmode = _ExtractBMode(mode);
 
 
-	/* FIXME: Is the first option always going to be the right one? */
-	uint32 c = 0, i;
-	display_mode *bmode_list;
-	bscreen.GetModeList(&bmode_list, &c);
-	for(i = 0; i < c; ++i) {
-		if(	bmode_list[i].space == bmode->space &&
-			bmode_list[i].virtual_width == bmode->virtual_width &&
-			bmode_list[i].virtual_height == bmode->virtual_height ) {
-				bmode = &bmode_list[i];
-				break;
-		}
-	}
+    /* FIXME: Is the first option always going to be the right one? */
+    uint32 c = 0, i;
+    display_mode *bmode_list;
+    bscreen.GetModeList(&bmode_list, &c);
+    for(i = 0; i < c; ++i) {
+        if(    bmode_list[i].space == bmode->space &&
+            bmode_list[i].virtual_width == bmode->virtual_width &&
+            bmode_list[i].virtual_height == bmode->virtual_height ) {
+                bmode = &bmode_list[i];
+                break;
+        }
+    }
 
-	if(bscreen.SetMode(bmode) != B_OK) {
-		return SDL_SetError("Bad video mode");
-	}
-	
-	free(bmode_list);
-	
+    if(bscreen.SetMode(bmode) != B_OK) {
+        return SDL_SetError("Bad video mode");
+    }
+    
+    free(bmode_list);
+    
 #if SDL_VIDEO_OPENGL
-	/* FIXME: Is there some way to reboot the OpenGL context?  This doesn't
-	   help */
-//	HAIKU_GL_RebootContexts(_this);
+    /* FIXME: Is there some way to reboot the OpenGL context?  This doesn't
+       help */
+//    HAIKU_GL_RebootContexts(_this);
 #endif
 
-	return 0;
+    return 0;
 }
 
 #ifdef __cplusplus
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/haiku/SDL_bvideo.cc
--- a/src/video/haiku/SDL_bvideo.cc	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/haiku/SDL_bvideo.cc	Mon Sep 24 11:49:25 2018 -0700
@@ -56,7 +56,7 @@
     device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
 
     device->driverdata = NULL; /* FIXME: Is this the cause of some of the
-    							  SDL_Quit() errors? */
+                                  SDL_Quit() errors? */
 
 /* TODO: Figure out if any initialization needs to go here */
 
@@ -122,37 +122,36 @@
 }
 
 VideoBootStrap HAIKU_bootstrap = {
-	"haiku", "Haiku graphics",
-	HAIKU_Available, HAIKU_CreateDevice
+    "haiku", "Haiku graphics",
+    HAIKU_Available, HAIKU_CreateDevice
 };
 
 void HAIKU_DeleteDevice(SDL_VideoDevice * device)
 {
-	SDL_free(device->driverdata);
-	SDL_free(device);
+    SDL_free(device->driverdata);
+    SDL_free(device);
 }
 
 int HAIKU_VideoInit(_THIS)
 {
-	/* Initialize the Be Application for appserver interaction */
-	if (SDL_InitBeApp() < 0) {
-		return -1;
-	}
-	
-	/* Initialize video modes */
-	HAIKU_InitModes(_this);
+    /* Initialize the Be Application for appserver interaction */
+    if (SDL_InitBeApp() < 0) {
+        return -1;
+    }
+    
+    /* Initialize video modes */
+    HAIKU_InitModes(_this);
 
-	/* Init the keymap */
-	HAIKU_InitOSKeymap();
-	
-	
+    /* Init the keymap */
+    HAIKU_InitOSKeymap();
+
 #if SDL_VIDEO_OPENGL
         /* testgl application doesn't load library, just tries to load symbols */
         /* is it correct? if so we have to load library here */
     HAIKU_GL_LoadLibrary(_this, NULL);
 #endif
 
-        /* We're done! */
+    /* We're done! */
     return (0);
 }
 
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/haiku/SDL_bwindow.cc
--- a/src/video/haiku/SDL_bwindow.cc	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/haiku/SDL_bwindow.cc	Mon Sep 24 11:49:25 2018 -0700
@@ -32,36 +32,36 @@
 #endif
 
 static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
-	return ((SDL_BWin*)(window->driverdata));
+    return ((SDL_BWin*)(window->driverdata));
 }
 
 static SDL_INLINE SDL_BApp *_GetBeApp() {
-	return ((SDL_BApp*)be_app);
+    return ((SDL_BApp*)be_app);
 }
 
 static int _InitWindow(_THIS, SDL_Window *window) {
-	uint32 flags = 0;
-	window_look look = B_TITLED_WINDOW_LOOK;
+    uint32 flags = 0;
+    window_look look = B_TITLED_WINDOW_LOOK;
 
-	BRect bounds(
+    BRect bounds(
         window->x,
         window->y,
-        window->x + window->w - 1,	//BeWindows have an off-by-one px w/h thing
+        window->x + window->w - 1,    //BeWindows have an off-by-one px w/h thing
         window->y + window->h - 1
     );
     
     if(window->flags & SDL_WINDOW_FULLSCREEN) {
-    	/* TODO: Add support for this flag */
-    	printf(__FILE__": %d!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n",__LINE__);
+        /* TODO: Add support for this flag */
+        printf(__FILE__": %d!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n",__LINE__);
     }
     if(window->flags & SDL_WINDOW_OPENGL) {
-    	/* TODO: Add support for this flag */
+        /* TODO: Add support for this flag */
     }
     if(!(window->flags & SDL_WINDOW_RESIZABLE)) {
-    	flags |= B_NOT_RESIZABLE | B_NOT_ZOOMABLE;
+        flags |= B_NOT_RESIZABLE | B_NOT_ZOOMABLE;
     }
     if(window->flags & SDL_WINDOW_BORDERLESS) {
-    	look = B_NO_BORDER_WINDOW_LOOK;
+        look = B_NO_BORDER_WINDOW_LOOK;
     }
 
     SDL_BWin *bwin = new(std::nothrow) SDL_BWin(bounds, look, flags);
@@ -79,35 +79,35 @@
     if (_InitWindow(_this, window) < 0) {
         return -1;
     }
-	
-	/* Start window loop */
+    
+    /* Start window loop */
     _ToBeWin(window)->Show();
     return 0;
 }
 
 int HAIKU_CreateWindowFrom(_THIS, SDL_Window * window, const void *data) {
 
-	SDL_BWin *otherBWin = (SDL_BWin*)data;
-	if(!otherBWin->LockLooper())
-		return -1;
-	
-	/* Create the new window and initialize its members */
-	window->x = (int)otherBWin->Frame().left;
-	window->y = (int)otherBWin->Frame().top;
-	window->w = (int)otherBWin->Frame().Width();
-	window->h = (int)otherBWin->Frame().Height();
-	
-	/* Set SDL flags */
-	if(!(otherBWin->Flags() & B_NOT_RESIZABLE)) {
-		window->flags |= SDL_WINDOW_RESIZABLE;
-	}
-	
-	/* If we are out of memory, return the error code */
+    SDL_BWin *otherBWin = (SDL_BWin*)data;
+    if(!otherBWin->LockLooper())
+        return -1;
+    
+    /* Create the new window and initialize its members */
+    window->x = (int)otherBWin->Frame().left;
+    window->y = (int)otherBWin->Frame().top;
+    window->w = (int)otherBWin->Frame().Width();
+    window->h = (int)otherBWin->Frame().Height();
+    
+    /* Set SDL flags */
+    if(!(otherBWin->Flags() & B_NOT_RESIZABLE)) {
+        window->flags |= SDL_WINDOW_RESIZABLE;
+    }
+    
+    /* If we are out of memory, return the error code */
     if (_InitWindow(_this, window) < 0) {
         return -1;
     }
-	
-	/* TODO: Add any other SDL-supported window attributes here */
+    
+    /* TODO: Add any other SDL-supported window attributes here */
     _ToBeWin(window)->SetTitle(otherBWin->Title());
     
     /* Start window loop and unlock the other window */
@@ -118,106 +118,106 @@
 }
 
 void HAIKU_SetWindowTitle(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_SET_TITLE);
-	msg.AddString("window-title", window->title);
-	_ToBeWin(window)->PostMessage(&msg);
+    BMessage msg(BWIN_SET_TITLE);
+    msg.AddString("window-title", window->title);
+    _ToBeWin(window)->PostMessage(&msg);
 }
 
 void HAIKU_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) {
-	/* FIXME: Icons not supported by Haiku */
+    /* FIXME: Icons not supported by Haiku */
 }
 
 void HAIKU_SetWindowPosition(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_MOVE_WINDOW);
-	msg.AddInt32("window-x", window->x);
-	msg.AddInt32("window-y", window->y);
-	_ToBeWin(window)->PostMessage(&msg);
+    BMessage msg(BWIN_MOVE_WINDOW);
+    msg.AddInt32("window-x", window->x);
+    msg.AddInt32("window-y", window->y);
+    _ToBeWin(window)->PostMessage(&msg);
 }
 
 void HAIKU_SetWindowSize(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_RESIZE_WINDOW);
-	msg.AddInt32("window-w", window->w - 1);
-	msg.AddInt32("window-h", window->h - 1);
-	_ToBeWin(window)->PostMessage(&msg);
+    BMessage msg(BWIN_RESIZE_WINDOW);
+    msg.AddInt32("window-w", window->w - 1);
+    msg.AddInt32("window-h", window->h - 1);
+    _ToBeWin(window)->PostMessage(&msg);
 }
 
 void HAIKU_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered) {
-	BMessage msg(BWIN_SET_BORDERED);
-	msg.AddBool("window-border", bordered != SDL_FALSE);
-	_ToBeWin(window)->PostMessage(&msg);
+    BMessage msg(BWIN_SET_BORDERED);
+    msg.AddBool("window-border", bordered != SDL_FALSE);
+    _ToBeWin(window)->PostMessage(&msg);
 }
 
 void HAIKU_SetWindowResizable(_THIS, SDL_Window * window, SDL_bool resizable) {
-	BMessage msg(BWIN_SET_RESIZABLE);
-	msg.AddBool("window-resizable", resizable != SDL_FALSE);
-	_ToBeWin(window)->PostMessage(&msg);
+    BMessage msg(BWIN_SET_RESIZABLE);
+    msg.AddBool("window-resizable", resizable != SDL_FALSE);
+    _ToBeWin(window)->PostMessage(&msg);
 }
 
 void HAIKU_ShowWindow(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_SHOW_WINDOW);
-	_ToBeWin(window)->PostMessage(&msg);
+    BMessage msg(BWIN_SHOW_WINDOW);
+    _ToBeWin(window)->PostMessage(&msg);
 }
 
 void HAIKU_HideWindow(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_HIDE_WINDOW);
-	_ToBeWin(window)->PostMessage(&msg);
+    BMessage msg(BWIN_HIDE_WINDOW);
+    _ToBeWin(window)->PostMessage(&msg);
 }
 
 void HAIKU_RaiseWindow(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_SHOW_WINDOW);	/* Activate this window and move to front */
-	_ToBeWin(window)->PostMessage(&msg);
+    BMessage msg(BWIN_SHOW_WINDOW);    /* Activate this window and move to front */
+    _ToBeWin(window)->PostMessage(&msg);
 }
 
 void HAIKU_MaximizeWindow(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_MAXIMIZE_WINDOW);
-	_ToBeWin(window)->PostMessage(&msg);
+    BMessage msg(BWIN_MAXIMIZE_WINDOW);
+    _ToBeWin(window)->PostMessage(&msg);
 }
 
 void HAIKU_MinimizeWindow(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_MINIMIZE_WINDOW);
-	_ToBeWin(window)->PostMessage(&msg);
+    BMessage msg(BWIN_MINIMIZE_WINDOW);
+    _ToBeWin(window)->PostMessage(&msg);
 }
 
 void HAIKU_RestoreWindow(_THIS, SDL_Window * window) {
-	BMessage msg(BWIN_RESTORE_WINDOW);
-	_ToBeWin(window)->PostMessage(&msg);
+    BMessage msg(BWIN_RESTORE_WINDOW);
+    _ToBeWin(window)->PostMessage(&msg);
 }
 
 void HAIKU_SetWindowFullscreen(_THIS, SDL_Window * window,
-		SDL_VideoDisplay * display, SDL_bool fullscreen) {
-	/* Haiku tracks all video display information */
-	BMessage msg(BWIN_FULLSCREEN);
-	msg.AddBool("fullscreen", fullscreen);
-	_ToBeWin(window)->PostMessage(&msg);
-	
+        SDL_VideoDisplay * display, SDL_bool fullscreen) {
+    /* Haiku tracks all video display information */
+    BMessage msg(BWIN_FULLSCREEN);
+    msg.AddBool("fullscreen", fullscreen);
+    _ToBeWin(window)->PostMessage(&msg);
+    
 }
 
 int HAIKU_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp) {
-	/* FIXME: Not Haiku supported */
-	return -1;
+    /* FIXME: Not Haiku supported */
+    return -1;
 }
 
 int HAIKU_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp) {
-	/* FIXME: Not Haiku supported */
-	return -1;
+    /* FIXME: Not Haiku supported */
+    return -1;
 }
 
 
 void HAIKU_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed) {
-	/* TODO: Implement this! */
+    /* TODO: Implement this! */
 }
 
 void HAIKU_DestroyWindow(_THIS, SDL_Window * window) {
-	_ToBeWin(window)->LockLooper();	/* This MUST be locked */
-	_GetBeApp()->ClearID(_ToBeWin(window));
-	_ToBeWin(window)->Quit();
-	window->driverdata = NULL;
+    _ToBeWin(window)->LockLooper();    /* This MUST be locked */
+    _GetBeApp()->ClearID(_ToBeWin(window));
+    _ToBeWin(window)->Quit();
+    window->driverdata = NULL;
 }
 
 SDL_bool HAIKU_GetWindowWMInfo(_THIS, SDL_Window * window,
                                     struct SDL_SysWMinfo *info) {
-	/* FIXME: What is the point of this? What information should be included? */
-	return SDL_FALSE;
+    /* FIXME: What is the point of this? What information should be included? */
+    return SDL_FALSE;
 }
 
 
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/kmsdrm/SDL_kmsdrmmouse.c
--- a/src/video/kmsdrm/SDL_kmsdrmmouse.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/kmsdrm/SDL_kmsdrmmouse.c	Mon Sep 24 11:49:25 2018 -0700
@@ -487,12 +487,12 @@
        That's why we move the cursor graphic ONLY. */
     if (mouse != NULL && mouse->cur_cursor != NULL && mouse->cur_cursor->driverdata != NULL) {
         curdata = (KMSDRM_CursorData *) mouse->cur_cursor->driverdata;
-	drm_fd = KMSDRM_gbm_device_get_fd(KMSDRM_gbm_bo_get_device(curdata->bo));
-	ret = KMSDRM_drmModeMoveCursor(drm_fd, curdata->crtc_id, mouse->x, mouse->y);
+        drm_fd = KMSDRM_gbm_device_get_fd(KMSDRM_gbm_bo_get_device(curdata->bo));
+        ret = KMSDRM_drmModeMoveCursor(drm_fd, curdata->crtc_id, mouse->x, mouse->y);
 
-	if (ret) {
-	    SDL_SetError("drmModeMoveCursor() failed.");
-	}
+        if (ret) {
+            SDL_SetError("drmModeMoveCursor() failed.");
+        }
     }
 }
 
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/kmsdrm/SDL_kmsdrmopengles.c
--- a/src/video/kmsdrm/SDL_kmsdrmopengles.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/kmsdrm/SDL_kmsdrmopengles.c	Mon Sep 24 11:49:25 2018 -0700
@@ -50,23 +50,23 @@
     KMSDRM_FBInfo *fb_info;
 
     if (!(_this->egl_data->eglSwapBuffers(_this->egl_data->egl_display, wdata->egl_surface))) {
-	SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "eglSwapBuffers failed on CRTC setup");
-	return SDL_FALSE;
+        SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "eglSwapBuffers failed on CRTC setup");
+        return SDL_FALSE;
     }
 
     wdata->next_bo = KMSDRM_gbm_surface_lock_front_buffer(wdata->gs);
     if (wdata->next_bo == NULL) {
-	SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Could not lock GBM surface front buffer on CRTC setup");
-	return SDL_FALSE;
+        SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Could not lock GBM surface front buffer on CRTC setup");
+        return SDL_FALSE;
     }
 
     fb_info = KMSDRM_FBFromBO(_this, wdata->next_bo);
     if (fb_info == NULL) {
-	return SDL_FALSE;
+        return SDL_FALSE;
     }
 
     if(KMSDRM_drmModeSetCrtc(vdata->drm_fd, displaydata->crtc_id, fb_info->fb_id,
-			    0, 0, &vdata->saved_conn_id, 1, &displaydata->cur_mode) != 0) {
+                            0, 0, &vdata->saved_conn_id, 1, &displaydata->cur_mode) != 0) {
        SDL_LogWarn(SDL_LOG_CATEGORY_VIDEO, "Could not set up CRTC to a GBM buffer");
        return SDL_FALSE;
 
@@ -153,14 +153,14 @@
     } else {
         /* Queue page flip at vsync */
 
-	/* Have we already setup the CRTC to one of the GBM buffers? Do so if we have not,
+        /* Have we already setup the CRTC to one of the GBM buffers? Do so if we have not,
            or FlipPage won't work in some cases. */
-	if (!wdata->crtc_ready) {
+        if (!wdata->crtc_ready) {
             if(!KMSDRM_GLES_SetupCrtc(_this, window)) {
                 SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "Could not set up CRTC for doing vsync-ed pageflips");
                 return 0;
             }
-	}
+        }
 
         /* SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "drmModePageFlip(%d, %u, %u, DRM_MODE_PAGE_FLIP_EVENT, &wdata->waiting_for_flip)",
             vdata->drm_fd, displaydata->crtc_id, fb_info->fb_id); */
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/raspberry/SDL_rpivideo.c
--- a/src/video/raspberry/SDL_rpivideo.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/raspberry/SDL_rpivideo.c	Mon Sep 24 11:49:25 2018 -0700
@@ -343,17 +343,17 @@
     SDL_DisplayData *displaydata = (SDL_DisplayData *) display->driverdata;
 
     if(data) {
-	if (data->double_buffer) {
-	    /* Wait for vsync, and then stop vsync callbacks and destroy related stuff, if needed */
-	    SDL_LockMutex(data->vsync_cond_mutex);
-	    SDL_CondWait(data->vsync_cond, data->vsync_cond_mutex);
-	    SDL_UnlockMutex(data->vsync_cond_mutex);
+        if (data->double_buffer) {
+            /* Wait for vsync, and then stop vsync callbacks and destroy related stuff, if needed */
+            SDL_LockMutex(data->vsync_cond_mutex);
+            SDL_CondWait(data->vsync_cond, data->vsync_cond_mutex);
+            SDL_UnlockMutex(data->vsync_cond_mutex);
 
-	    vc_dispmanx_vsync_callback(displaydata->dispman_display, NULL, NULL);
+            vc_dispmanx_vsync_callback(displaydata->dispman_display, NULL, NULL);
 
-	    SDL_DestroyCond(data->vsync_cond);
-	    SDL_DestroyMutex(data->vsync_cond_mutex);
-	}
+            SDL_DestroyCond(data->vsync_cond);
+            SDL_DestroyMutex(data->vsync_cond_mutex);
+        }
 
 #if SDL_VIDEO_OPENGL_EGL
         if (data->egl_surface != EGL_NO_SURFACE) {
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/uikit/SDL_uikitappdelegate.m
--- a/src/video/uikit/SDL_uikitappdelegate.m	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/uikit/SDL_uikitappdelegate.m	Mon Sep 24 11:49:25 2018 -0700
@@ -445,7 +445,7 @@
 #if !TARGET_OS_TV
 - (void)application:(UIApplication *)application didChangeStatusBarOrientation:(UIInterfaceOrientation)oldStatusBarOrientation
 {
-	SDL_OnApplicationDidChangeStatusBarOrientation();
+    SDL_OnApplicationDidChangeStatusBarOrientation();
 }
 #endif
 
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/uikit/SDL_uikitmodes.m
--- a/src/video/uikit/SDL_uikitmodes.m	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/uikit/SDL_uikitmodes.m	Mon Sep 24 11:49:25 2018 -0700
@@ -191,7 +191,7 @@
             }
         }
 #if !TARGET_OS_TV
-		SDL_OnApplicationDidChangeStatusBarOrientation();
+        SDL_OnApplicationDidChangeStatusBarOrientation();
 #endif
     }
 
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/uikit/SDL_uikitview.m
--- a/src/video/uikit/SDL_uikitview.m	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/uikit/SDL_uikitview.m	Mon Sep 24 11:49:25 2018 -0700
@@ -252,34 +252,34 @@
 
 - (void)pressesBegan:(NSSet<UIPress *> *)presses withEvent:(UIPressesEvent *)event
 {
-	if (!SDL_AppleTVRemoteOpenedAsJoystick) {
-    	for (UIPress *press in presses) {
-        	SDL_Scancode scancode = [self scancodeFromPressType:press.type];
-        	SDL_SendKeyboardKey(SDL_PRESSED, scancode);
-    	}
-	}
+    if (!SDL_AppleTVRemoteOpenedAsJoystick) {
+        for (UIPress *press in presses) {
+            SDL_Scancode scancode = [self scancodeFromPressType:press.type];
+            SDL_SendKeyboardKey(SDL_PRESSED, scancode);
+        }
+    }
     [super pressesBegan:presses withEvent:event];
 }
 
 - (void)pressesEnded:(NSSet<UIPress *> *)presses withEvent:(UIPressesEvent *)event
 {
-	if (!SDL_AppleTVRemoteOpenedAsJoystick) {
-		for (UIPress *press in presses) {
-			SDL_Scancode scancode = [self scancodeFromPressType:press.type];
-			SDL_SendKeyboardKey(SDL_RELEASED, scancode);
-		}
-	}
+    if (!SDL_AppleTVRemoteOpenedAsJoystick) {
+        for (UIPress *press in presses) {
+            SDL_Scancode scancode = [self scancodeFromPressType:press.type];
+            SDL_SendKeyboardKey(SDL_RELEASED, scancode);
+        }
+    }
     [super pressesEnded:presses withEvent:event];
 }
 
 - (void)pressesCancelled:(NSSet<UIPress *> *)presses withEvent:(UIPressesEvent *)event
 {
-	if (!SDL_AppleTVRemoteOpenedAsJoystick) {
-		for (UIPress *press in presses) {
-			SDL_Scancode scancode = [self scancodeFromPressType:press.type];
-			SDL_SendKeyboardKey(SDL_RELEASED, scancode);
-		}
-	}
+    if (!SDL_AppleTVRemoteOpenedAsJoystick) {
+        for (UIPress *press in presses) {
+            SDL_Scancode scancode = [self scancodeFromPressType:press.type];
+            SDL_SendKeyboardKey(SDL_RELEASED, scancode);
+        }
+    }
     [super pressesCancelled:presses withEvent:event];
 }
 
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/wayland/SDL_waylandevents.c
--- a/src/video/wayland/SDL_waylandevents.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/wayland/SDL_waylandevents.c	Mon Sep 24 11:49:25 2018 -0700
@@ -747,7 +747,7 @@
 
 static void
 data_device_handle_data_offer(void *data, struct wl_data_device *wl_data_device,
-			                  struct wl_data_offer *id)
+                              struct wl_data_offer *id)
 {
     SDL_WaylandDataOffer *data_offer = NULL;
 
@@ -765,7 +765,7 @@
 
 static void
 data_device_handle_enter(void *data, struct wl_data_device *wl_data_device,
-		                 uint32_t serial, struct wl_surface *surface,
+                         uint32_t serial, struct wl_surface *surface,
                          wl_fixed_t x, wl_fixed_t y, struct wl_data_offer *id)
 {
     SDL_WaylandDataDevice *data_device = data;
@@ -808,7 +808,7 @@
 
 static void
 data_device_handle_motion(void *data, struct wl_data_device *wl_data_device,
-		                  uint32_t time, wl_fixed_t x, wl_fixed_t y)
+                          uint32_t time, wl_fixed_t x, wl_fixed_t y)
 {
 }
 
@@ -847,7 +847,7 @@
 
 static void
 data_device_handle_selection(void *data, struct wl_data_device *wl_data_device,
-			                 struct wl_data_offer *id)
+                             struct wl_data_offer *id)
 {    
     SDL_WaylandDataDevice *data_device = data;
     SDL_WaylandDataOffer *offer = NULL;
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/wayland/SDL_waylandtouch.c
--- a/src/video/wayland/SDL_waylandtouch.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/wayland/SDL_waylandtouch.c	Mon Sep 24 11:49:25 2018 -0700
@@ -89,9 +89,9 @@
     */
 
     SDL_TouchID deviceId = 1;
-	if (SDL_AddTouch(deviceId, "qt_touch_extension") < 0) {
-		 SDL_Log("error: can't add touch %s, %d", __FILE__, __LINE__);
-	}
+    if (SDL_AddTouch(deviceId, "qt_touch_extension") < 0) {
+         SDL_Log("error: can't add touch %s, %d", __FILE__, __LINE__);
+    }
 
     switch (touchState) {
         case QtWaylandTouchPointPressed:
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/wayland/SDL_waylandvideo.c
--- a/src/video/wayland/SDL_waylandvideo.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/wayland/SDL_waylandvideo.c	Mon Sep 24 11:49:25 2018 -0700
@@ -68,10 +68,10 @@
 get_classname()
 {
 /* !!! FIXME: this is probably wrong, albeit harmless in many common cases. From protocol spec:
-	"The surface class identifies the general class of applications
-	to which the surface belongs. A common convention is to use the
-	file name (or the full path if it is a non-standard location) of
-	the application's .desktop file as the class." */
+    "The surface class identifies the general class of applications
+    to which the surface belongs. A common convention is to use the
+    file name (or the full path if it is a non-standard location) of
+    the application's .desktop file as the class." */
 
     char *spot;
 #if defined(__LINUX__) || defined(__FREEBSD__)
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/wayland/SDL_waylandwindow.c
--- a/src/video/wayland/SDL_waylandwindow.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/wayland/SDL_waylandwindow.c	Mon Sep 24 11:49:25 2018 -0700
@@ -134,10 +134,10 @@
 
 static void
 handle_configure_zxdg_toplevel(void *data,
-			  struct zxdg_toplevel_v6 *zxdg_toplevel_v6,
-			  int32_t width,
-			  int32_t height,
-			  struct wl_array *states)
+              struct zxdg_toplevel_v6 *zxdg_toplevel_v6,
+              int32_t width,
+              int32_t height,
+              struct wl_array *states)
 {
     SDL_WindowData *wind = (SDL_WindowData *)data;
     SDL_Window *window = wind->sdlwindow;
@@ -213,10 +213,10 @@
 
 static void
 handle_configure_xdg_toplevel(void *data,
-			  struct xdg_toplevel *xdg_toplevel,
-			  int32_t width,
-			  int32_t height,
-			  struct wl_array *states)
+              struct xdg_toplevel *xdg_toplevel,
+              int32_t width,
+              int32_t height,
+              struct wl_array *states)
 {
     SDL_WindowData *wind = (SDL_WindowData *)data;
     SDL_Window *window = wind->sdlwindow;
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/windows/SDL_windowsopengl.h
--- a/src/video/windows/SDL_windowsopengl.h	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/windows/SDL_windowsopengl.h	Mon Sep 24 11:49:25 2018 -0700
@@ -33,31 +33,31 @@
     SDL_bool HAS_WGL_ARB_create_context_robustness;
     SDL_bool HAS_WGL_ARB_create_context_no_error;
 
-	/* Max version of OpenGL ES context that can be created if the
-	   implementation supports WGL_EXT_create_context_es2_profile.
-	   major = minor = 0 when unsupported.
-	 */
-	struct {
-		int major;
-		int minor;
-	} es_profile_max_supported_version;
+    /* Max version of OpenGL ES context that can be created if the
+       implementation supports WGL_EXT_create_context_es2_profile.
+       major = minor = 0 when unsupported.
+     */
+    struct {
+        int major;
+        int minor;
+    } es_profile_max_supported_version;
 
-	void *(WINAPI * wglGetProcAddress) (const char *proc);
-      HGLRC(WINAPI * wglCreateContext) (HDC hdc);
-      BOOL(WINAPI * wglDeleteContext) (HGLRC hglrc);
-      BOOL(WINAPI * wglMakeCurrent) (HDC hdc, HGLRC hglrc);
-      BOOL(WINAPI * wglShareLists) (HGLRC hglrc1, HGLRC hglrc2);
-      BOOL(WINAPI * wglChoosePixelFormatARB) (HDC hdc,
-                                              const int *piAttribIList,
-                                              const FLOAT * pfAttribFList,
-                                              UINT nMaxFormats,
-                                              int *piFormats,
-                                              UINT * nNumFormats);
-      BOOL(WINAPI * wglGetPixelFormatAttribivARB) (HDC hdc, int iPixelFormat,
-                                                   int iLayerPlane,
-                                                   UINT nAttributes,
-                                                   const int *piAttributes,
-                                                   int *piValues);
+    void *(WINAPI * wglGetProcAddress) (const char *proc);
+    HGLRC(WINAPI * wglCreateContext) (HDC hdc);
+    BOOL(WINAPI * wglDeleteContext) (HGLRC hglrc);
+    BOOL(WINAPI * wglMakeCurrent) (HDC hdc, HGLRC hglrc);
+    BOOL(WINAPI * wglShareLists) (HGLRC hglrc1, HGLRC hglrc2);
+    BOOL(WINAPI * wglChoosePixelFormatARB) (HDC hdc,
+                                            const int *piAttribIList,
+                                            const FLOAT * pfAttribFList,
+                                            UINT nMaxFormats,
+                                            int *piFormats,
+                                            UINT * nNumFormats);
+    BOOL(WINAPI * wglGetPixelFormatAttribivARB) (HDC hdc, int iPixelFormat,
+                                                 int iLayerPlane,
+                                                 UINT nAttributes,
+                                                 const int *piAttributes,
+                                                 int *piValues);
     BOOL (WINAPI * wglSwapIntervalEXT) (int interval);
     int (WINAPI * wglGetSwapIntervalEXT) (void);
 };
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/windows/SDL_windowsvulkan.c
--- a/src/video/windows/SDL_windowsvulkan.c	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/windows/SDL_windowsvulkan.c	Mon Sep 24 11:49:25 2018 -0700
@@ -40,7 +40,7 @@
 {
     VkExtensionProperties *extensions = NULL;
     Uint32 extensionCount = 0;
-	Uint32 i;
+    Uint32 i;
     SDL_bool hasSurfaceExtension = SDL_FALSE;
     SDL_bool hasWin32SurfaceExtension = SDL_FALSE;
     PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = NULL;
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/x11/SDL_x11opengl.h
--- a/src/video/x11/SDL_x11opengl.h	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/x11/SDL_x11opengl.h	Mon Sep 24 11:49:25 2018 -0700
@@ -38,14 +38,14 @@
     SDL_bool HAS_GLX_ARB_create_context_robustness;
     SDL_bool HAS_GLX_ARB_create_context_no_error;
 
-	/* Max version of OpenGL ES context that can be created if the
-	   implementation supports GLX_EXT_create_context_es2_profile.
-	   major = minor = 0 when unsupported.
-	 */
-	struct {
-		int major;
-		int minor;
-	} es_profile_max_supported_version;
+    /* Max version of OpenGL ES context that can be created if the
+       implementation supports GLX_EXT_create_context_es2_profile.
+       major = minor = 0 when unsupported.
+     */
+    struct {
+        int major;
+        int minor;
+    } es_profile_max_supported_version;
 
     Bool (*glXQueryExtension) (Display*,int*,int*);
     void *(*glXGetProcAddress) (const GLubyte*);
diff -r c0b17b32b95e -r 8bdc4d340419 src/video/x11/SDL_x11sym.h
--- a/src/video/x11/SDL_x11sym.h	Sat Aug 18 17:23:40 2018 -0400
+++ b/src/video/x11/SDL_x11sym.h	Mon Sep 24 11:49:25 2018 -0700
@@ -45,7 +45,7 @@
 SDL_X11_SYM(Colormap,XCreateColormap,(Display* a,Window b,Visual* c,int d),(a,b,c,d),return)
 SDL_X11_SYM(Cursor,XCreatePixmapCursor,(Display* a,Pixmap b,Pixmap c,XColor* d,XColor* e,unsigned int f,unsigned int g),(a,b,c,d,e,f,g),return)
 SDL_X11_SYM(Cursor,XCreateFontCursor,(Display* a,unsigned int b),(a,b),return)
-SDL_X11_SYM(XFontSet,XCreateFontSet,(Display* a, _Xconst char* b, char*** c, int* d, char**	e),(a,b,c,d,e),return)
+SDL_X11_SYM(XFontSet,XCreateFontSet,(Display* a, _Xconst char* b, char*** c, int* d, char** e),(a,b,c,d,e),return)
 SDL_X11_SYM(GC,XCreateGC,(Display* a,Drawable b,unsigned long c,XGCValues* d),(a,b,c,d),return)
 SDL_X11_SYM(XImage*,XCreateImage,(Display* a,Visual* b,unsigned int c,int d,int e,char* f,unsigned int g,unsigned int h,int i,int j),(a,b,c,d,e,f,g,h,i,j),return)
 SDL_X11_SYM(Window,XCreateWindow,(Display* a,Window b,int c,int d,unsigned int e,unsigned int f,unsigned int g,int h,unsigned int i,Visual* j,unsigned long k,XSetWindowAttributes* l),(a,b,c,d,e,f,g,h,i,j,k,l),return)
@@ -201,7 +201,7 @@
 SDL_X11_SYM(XIM,XOpenIM,(Display* a,struct _XrmHashBucketRec* b,char* c,char* d),(a,b,c,d),return)
 SDL_X11_SYM(Status,XCloseIM,(XIM a),(a),return)
 SDL_X11_SYM(void,Xutf8DrawString,(Display *a, Drawable b, XFontSet c, GC d, int e, int f, _Xconst char *g, int h),(a,b,c,d,e,f,g,h),)
-SDL_X11_SYM(int,Xutf8TextExtents,(XFontSet a, _Xconst char*	b, int c, XRectangle* d, XRectangle* e),(a,b,c,d,e),return)
+SDL_X11_SYM(int,Xutf8TextExtents,(XFontSet a, _Xconst char* b, int c, XRectangle* d, XRectangle* e),(a,b,c,d,e),return)
 SDL_X11_SYM(char*,XSetLocaleModifiers,(const char *a),(a),return)
 SDL_X11_SYM(char*,Xutf8ResetIC,(XIC a),(a),return)
 #endif


More information about the commits mailing list