diff src/video/macrom/SDL_romvideo.c @ 1668:4da1ee79c9af SDL-1.3

more tweaking indent options
author Sam Lantinga <slouken@libsdl.org>
date Mon, 29 May 2006 04:04:35 +0000
parents 782fd950bd46
children
line wrap: on
line diff
--- a/src/video/macrom/SDL_romvideo.c	Mon May 29 03:53:21 2006 +0000
+++ b/src/video/macrom/SDL_romvideo.c	Mon May 29 04:04:35 2006 +0000
@@ -53,20 +53,20 @@
 #include "../maccommon/SDL_macevents_c.h"
 
 /* Initialization/Query functions */
-static int ROM_VideoInit (_THIS, SDL_PixelFormat * vformat);
-static SDL_Rect **ROM_ListModes (_THIS, SDL_PixelFormat * format,
-                                 Uint32 flags);
-static SDL_Surface *ROM_SetVideoMode (_THIS, SDL_Surface * current, int width,
-                                      int height, int bpp, Uint32 flags);
-static int ROM_SetColors (_THIS, int firstcolor, int ncolors,
-                          SDL_Color * colors);
-static void ROM_VideoQuit (_THIS);
+static int ROM_VideoInit(_THIS, SDL_PixelFormat * vformat);
+static SDL_Rect **ROM_ListModes(_THIS, SDL_PixelFormat * format,
+                                Uint32 flags);
+static SDL_Surface *ROM_SetVideoMode(_THIS, SDL_Surface * current, int width,
+                                     int height, int bpp, Uint32 flags);
+static int ROM_SetColors(_THIS, int firstcolor, int ncolors,
+                         SDL_Color * colors);
+static void ROM_VideoQuit(_THIS);
 
 /* Hardware surface functions */
-static int ROM_AllocHWSurface (_THIS, SDL_Surface * surface);
-static int ROM_LockHWSurface (_THIS, SDL_Surface * surface);
-static void ROM_UnlockHWSurface (_THIS, SDL_Surface * surface);
-static void ROM_FreeHWSurface (_THIS, SDL_Surface * surface);
+static int ROM_AllocHWSurface(_THIS, SDL_Surface * surface);
+static int ROM_LockHWSurface(_THIS, SDL_Surface * surface);
+static void ROM_UnlockHWSurface(_THIS, SDL_Surface * surface);
+static void ROM_FreeHWSurface(_THIS, SDL_Surface * surface);
 
 #if !TARGET_API_MAC_CARBON      /* This seems not to be available? -sts Aug 2000 */
 /* Saved state for the menu bar */
@@ -90,27 +90,27 @@
 
 /* ControlStrip inline glue for PowerPC */
 static pascal Boolean
-SBIsControlStripVisible (void)
+SBIsControlStripVisible(void)
 {
-    static short procData[] = TWOWORDSTUB (0x7000, 0xAAF2);
+    static short procData[] = TWOWORDSTUB(0x7000, 0xAAF2);
     ProcInfoType procInfo = kD0DispatchedPascalStackBased
-        | RESULT_SIZE (SIZE_CODE (sizeof (Boolean)))
-        | DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE (kFourByteCode);
+        | RESULT_SIZE(SIZE_CODE(sizeof(Boolean)))
+        | DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(kFourByteCode);
 
     return ((Boolean)
-            CallUniversalProc ((UniversalProcPtr) procData, procInfo, 0x00));
+            CallUniversalProc((UniversalProcPtr) procData, procInfo, 0x00));
 }
 
 static pascal void
-SBShowHideControlStrip (Boolean showIt)
+SBShowHideControlStrip(Boolean showIt)
 {
-    static short procData[] = THREEWORDSTUB (0x303C, 0x0101, 0xAAF2);
+    static short procData[] = THREEWORDSTUB(0x303C, 0x0101, 0xAAF2);
     ProcInfoType procInfo = kD0DispatchedPascalStackBased
-        | DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE (kFourByteCode)
-        | DISPATCHED_STACK_ROUTINE_PARAMETER (1,
-                                              SIZE_CODE (sizeof (Boolean)));
+        | DISPATCHED_STACK_ROUTINE_SELECTOR_SIZE(kFourByteCode)
+        | DISPATCHED_STACK_ROUTINE_PARAMETER(1,
+                                             SIZE_CODE(sizeof(Boolean)));
 
-    CallUniversalProc ((UniversalProcPtr) procData, procInfo, 0x01, showIt);
+    CallUniversalProc((UniversalProcPtr) procData, procInfo, 0x01, showIt);
 }
 #endif /* powerc */
 #endif /* !TARGET_API_MAC_CARBON */
@@ -118,38 +118,38 @@
 /* Macintosh toolbox driver bootstrap functions */
 
 static int
-ROM_Available (void)
+ROM_Available(void)
 {
     return (1);
 }
 
 static void
-ROM_DeleteDevice (SDL_VideoDevice * device)
+ROM_DeleteDevice(SDL_VideoDevice * device)
 {
-    SDL_free (device->hidden);
-    SDL_free (device);
+    SDL_free(device->hidden);
+    SDL_free(device);
 }
 
 static SDL_VideoDevice *
-ROM_CreateDevice (int devindex)
+ROM_CreateDevice(int devindex)
 {
     SDL_VideoDevice *device;
 
     /* Initialize all variables that we clean on shutdown */
-    device = (SDL_VideoDevice *) SDL_malloc (sizeof (SDL_VideoDevice));
+    device = (SDL_VideoDevice *) SDL_malloc(sizeof(SDL_VideoDevice));
     if (device) {
-        SDL_memset (device, 0, (sizeof *device));
+        SDL_memset(device, 0, (sizeof *device));
         device->hidden = (struct SDL_PrivateVideoData *)
-            SDL_malloc ((sizeof *device->hidden));
+            SDL_malloc((sizeof *device->hidden));
     }
     if ((device == NULL) || (device->hidden == NULL)) {
-        SDL_OutOfMemory ();
+        SDL_OutOfMemory();
         if (device) {
-            SDL_free (device);
+            SDL_free(device);
         }
         return (0);
     }
-    SDL_memset (device->hidden, 0, (sizeof *device->hidden));
+    SDL_memset(device->hidden, 0, (sizeof *device->hidden));
 
     /* Set the function pointers */
     device->VideoInit = ROM_VideoInit;
@@ -197,22 +197,22 @@
 
 
 static int
-ROM_VideoInit (_THIS, SDL_PixelFormat * vformat)
+ROM_VideoInit(_THIS, SDL_PixelFormat * vformat)
 {
     long info;
 
     /* Check out some things about the system */
-    Gestalt (gestaltQuickdrawVersion, &info);
+    Gestalt(gestaltQuickdrawVersion, &info);
     if (info == gestaltOriginalQD) {
-        SDL_SetError ("Color Quickdraw not available");
+        SDL_SetError("Color Quickdraw not available");
         return (-1);
     }
 
     /* Start ROMintosh events */
-    Mac_InitEvents (this);
+    Mac_InitEvents(this);
 
     /* Get a handle to the main monitor */
-    SDL_Display = GetMainDevice ();
+    SDL_Display = GetMainDevice();
 
     /* Determine the current screen size */
     this->info.current_w = (**SDL_Display).gdRect.right;
@@ -231,21 +231,21 @@
     }
 
     /* Create our palette */
-    SDL_CTab = (CTabHandle) NewHandle (sizeof (ColorSpec) * 256 + 8);
+    SDL_CTab = (CTabHandle) NewHandle(sizeof(ColorSpec) * 256 + 8);
     if (SDL_CTab == nil) {
-        SDL_OutOfMemory ();
+        SDL_OutOfMemory();
         return (-1);
     }
-    (**SDL_CTab).ctSeed = GetCTSeed ();
+    (**SDL_CTab).ctSeed = GetCTSeed();
     (**SDL_CTab).ctFlags = 0;
     (**SDL_CTab).ctSize = 255;
-    CTabChanged (SDL_CTab);
-    SDL_CPal = NewPalette (256, SDL_CTab, pmExplicit + pmTolerant, 0);
+    CTabChanged(SDL_CTab);
+    SDL_CPal = NewPalette(256, SDL_CTab, pmExplicit + pmTolerant, 0);
 
     /* Get a list of available fullscreen modes */
-    SDL_modelist = (SDL_Rect **) SDL_malloc ((1 + 1) * sizeof (SDL_Rect *));
+    SDL_modelist = (SDL_Rect **) SDL_malloc((1 + 1) * sizeof(SDL_Rect *));
     if (SDL_modelist) {
-        SDL_modelist[0] = (SDL_Rect *) SDL_malloc (sizeof (SDL_Rect));
+        SDL_modelist[0] = (SDL_Rect *) SDL_malloc(sizeof(SDL_Rect));
         if (SDL_modelist[0]) {
             SDL_modelist[0]->x = 0;
             SDL_modelist[0]->y = 0;
@@ -263,7 +263,7 @@
 }
 
 static SDL_Rect **
-ROM_ListModes (_THIS, SDL_PixelFormat * format, Uint32 flags)
+ROM_ListModes(_THIS, SDL_PixelFormat * format, Uint32 flags)
 {
     if (this->screen->format->BitsPerPixel == format->BitsPerPixel) {
         if ((flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) {
@@ -277,7 +277,7 @@
 }
 
 static void
-ROM_HideMenuBar (_THIS)
+ROM_HideMenuBar(_THIS)
 {
 #if !TARGET_API_MAC_CARBON      /* This seems not to be available? -sts Aug 2000 */
     RgnHandle drawRgn = nil;
@@ -290,79 +290,79 @@
     short height;
     EventRecord theEvent;
 
-    height = GetMBarHeight ();
+    height = GetMBarHeight();
 
     if (height > 0) {
-        tempRgn = NewRgn ();
-        drawRgn = NewRgn ();
-        gSaveGrayRgn = NewRgn ();
+        tempRgn = NewRgn();
+        drawRgn = NewRgn();
+        gSaveGrayRgn = NewRgn();
         if (!tempRgn || !drawRgn || !gSaveGrayRgn) {
             goto CLEANUP;
         }
-        grayRgn = GetGrayRgn ();        /* No need to check for this */
+        grayRgn = GetGrayRgn(); /* No need to check for this */
 
-        GetPort (&savePort);
+        GetPort(&savePort);
 
         /* Hide the control strip if it's present, and record its 
            previous position into the dirty region for redrawing. 
            This isn't necessary, but may help catch stray bits. */
-        CopyRgn (grayRgn, tempRgn);
-        if (!Gestalt (gestaltControlStripAttr, &response) &&
+        CopyRgn(grayRgn, tempRgn);
+        if (!Gestalt(gestaltControlStripAttr, &response) &&
             (response & (1L << gestaltControlStripExists))) {
-            gSaveCSVis = SBIsControlStripVisible ();
+            gSaveCSVis = SBIsControlStripVisible();
             if (gSaveCSVis)
-                SBShowHideControlStrip (false);
+                SBShowHideControlStrip(false);
         }
-        DiffRgn (grayRgn, tempRgn, drawRgn);
+        DiffRgn(grayRgn, tempRgn, drawRgn);
 
         /* Save the gray region once the control strip is hidden */
-        CopyRgn (grayRgn, gSaveGrayRgn);
+        CopyRgn(grayRgn, gSaveGrayRgn);
 
         /* Change the menu height in lowmem */
         gSaveMenuBar = height;
-        LMSetMBarHeight (0);
+        LMSetMBarHeight(0);
 
         /* Walk the monitor rectangles, and combine any pieces that
            aren't in GrayRgn: menubar, round corners, fake floaters. */
-        for (gd = GetDeviceList (); gd; gd = GetNextDevice (gd)) {
-            if (!TestDeviceAttribute (gd, screenDevice))
+        for (gd = GetDeviceList(); gd; gd = GetNextDevice(gd)) {
+            if (!TestDeviceAttribute(gd, screenDevice))
                 continue;
-            if (!TestDeviceAttribute (gd, screenActive))
+            if (!TestDeviceAttribute(gd, screenActive))
                 continue;
 
-            RectRgn (tempRgn, &(*gd)->gdRect);  /* Get the whole screen */
-            DiffRgn (tempRgn, grayRgn, tempRgn);        /* Subtract out GrayRgn */
-            UnionRgn (tempRgn, drawRgn, drawRgn);       /* Combine all the bits */
+            RectRgn(tempRgn, &(*gd)->gdRect);   /* Get the whole screen */
+            DiffRgn(tempRgn, grayRgn, tempRgn); /* Subtract out GrayRgn */
+            UnionRgn(tempRgn, drawRgn, drawRgn);        /* Combine all the bits */
         }
 
         /* Add the bits into the GrayRgn */
-        UnionRgn (drawRgn, grayRgn, grayRgn);
+        UnionRgn(drawRgn, grayRgn, grayRgn);
 
         /* Modify the vis regions of exposed windows */
-        window = (FrontWindow ())? FrontWindow () : (WindowPtr) - 1L;
-        PaintBehind (window, drawRgn);
-        CalcVisBehind (window, drawRgn);
+        window = (FrontWindow())? FrontWindow() : (WindowPtr) - 1L;
+        PaintBehind(window, drawRgn);
+        CalcVisBehind(window, drawRgn);
 
-        SetPort (savePort);
+        SetPort(savePort);
 
         /* Yield time so that floaters can catch up */
-        EventAvail (0, &theEvent);
-        EventAvail (0, &theEvent);
-        EventAvail (0, &theEvent);
-        EventAvail (0, &theEvent);
+        EventAvail(0, &theEvent);
+        EventAvail(0, &theEvent);
+        EventAvail(0, &theEvent);
+        EventAvail(0, &theEvent);
     }
 
   CLEANUP:
 
     if (tempRgn)
-        DisposeRgn (tempRgn);
+        DisposeRgn(tempRgn);
     if (drawRgn)
-        DisposeRgn (drawRgn);
+        DisposeRgn(drawRgn);
 #endif /* !TARGET_API_MAC_CARBON */
 }
 
 static void
-ROM_ShowMenuBar (_THIS)
+ROM_ShowMenuBar(_THIS)
 {
 #if !TARGET_API_MAC_CARBON      /* This seems not to be available? -sts Aug 2000 */
     RgnHandle drawRgn = nil;
@@ -379,112 +379,112 @@
     RGBColor saveRGB;
     RGBColor blackRGB = { 0, 0, 0 };
 
-    height = GetMBarHeight ();
+    height = GetMBarHeight();
 
     if ((height <= 0) && (gSaveMenuBar > 0)) {
-        drawRgn = NewRgn ();
-        menuRgn = NewRgn ();
-        tempRgn = NewRgn ();
+        drawRgn = NewRgn();
+        menuRgn = NewRgn();
+        tempRgn = NewRgn();
         if (!tempRgn || !drawRgn || !gSaveGrayRgn) {
             goto CLEANUP;
         }
-        grayRgn = GetGrayRgn ();        /* No need to check for this */
+        grayRgn = GetGrayRgn(); /* No need to check for this */
 
-        GetPort (&savePort);
-        GetWMgrPort (&wMgrPort);
+        GetPort(&savePort);
+        GetWMgrPort(&wMgrPort);
 
         /* Set the height properly */
-        LMSetMBarHeight (gSaveMenuBar);
+        LMSetMBarHeight(gSaveMenuBar);
 
         /* Restore the old GrayRgn: rounded corners, etc, but not
            the menubar -- subtract that out first! */
         if (gSaveGrayRgn) {
-            menuRect = (*GetMainDevice ())->gdRect;
+            menuRect = (*GetMainDevice())->gdRect;
             menuRect.bottom = menuRect.top + gSaveMenuBar;
-            RectRgn (menuRgn, &menuRect);
+            RectRgn(menuRgn, &menuRect);
 
-            DiffRgn (grayRgn, gSaveGrayRgn, drawRgn);   /* What do we inval? */
-            DiffRgn (drawRgn, menuRgn, drawRgn);        /* Clip out the menu */
+            DiffRgn(grayRgn, gSaveGrayRgn, drawRgn);    /* What do we inval? */
+            DiffRgn(drawRgn, menuRgn, drawRgn); /* Clip out the menu */
 
             /* Now redraw the corners and other bits black */
-            SetPort (wMgrPort);
-            GetClip (tempRgn);
-            SetClip (drawRgn);
-            GetForeColor (&saveRGB);
-            RGBForeColor (&blackRGB);
-            PaintRgn (drawRgn);
-            RGBForeColor (&saveRGB);
-            SetClip (tempRgn);
-            SetPort (savePort);
+            SetPort(wMgrPort);
+            GetClip(tempRgn);
+            SetClip(drawRgn);
+            GetForeColor(&saveRGB);
+            RGBForeColor(&blackRGB);
+            PaintRgn(drawRgn);
+            RGBForeColor(&saveRGB);
+            SetClip(tempRgn);
+            SetPort(savePort);
 
-            UnionRgn (drawRgn, menuRgn, drawRgn);       /* Put back the menu */
+            UnionRgn(drawRgn, menuRgn, drawRgn);        /* Put back the menu */
 
             /* Now actually restore the GrayRgn */
-            CopyRgn (gSaveGrayRgn, grayRgn);
-            DisposeRgn (gSaveGrayRgn);
+            CopyRgn(gSaveGrayRgn, grayRgn);
+            DisposeRgn(gSaveGrayRgn);
             gSaveGrayRgn = nil;
         }
 
         /* Modify the vis regions of exposed windows and draw menubar */
-        window = (FrontWindow ())? FrontWindow () : (WindowPtr) - 1L;
-        PaintBehind (window, drawRgn);
-        CalcVisBehind (window, drawRgn);
-        DrawMenuBar ();
+        window = (FrontWindow())? FrontWindow() : (WindowPtr) - 1L;
+        PaintBehind(window, drawRgn);
+        CalcVisBehind(window, drawRgn);
+        DrawMenuBar();
 
-        SetPort (savePort);
+        SetPort(savePort);
         gSaveMenuBar = 0;
 
         /* Now show the control strip if it's present */
-        if (!Gestalt (gestaltControlStripAttr, &response) &&
+        if (!Gestalt(gestaltControlStripAttr, &response) &&
             (response & (1L << gestaltControlStripExists))) {
-            if (gSaveCSVis && !SBIsControlStripVisible ())
-                SBShowHideControlStrip (true);
+            if (gSaveCSVis && !SBIsControlStripVisible())
+                SBShowHideControlStrip(true);
             gSaveCSVis = true;
         }
 
         /* Yield time so that floaters can catch up */
-        EventAvail (0, &theEvent);
-        EventAvail (0, &theEvent);
-        EventAvail (0, &theEvent);
-        EventAvail (0, &theEvent);
+        EventAvail(0, &theEvent);
+        EventAvail(0, &theEvent);
+        EventAvail(0, &theEvent);
+        EventAvail(0, &theEvent);
     }
 
   CLEANUP:
 
     if (drawRgn)
-        DisposeRgn (drawRgn);
+        DisposeRgn(drawRgn);
     if (menuRgn)
-        DisposeRgn (menuRgn);
+        DisposeRgn(menuRgn);
     if (tempRgn)
-        DisposeRgn (tempRgn);
+        DisposeRgn(tempRgn);
 #endif /* !TARGET_API_MAC_CARBON */
 }
 
 /* Various screen update functions available */
-static void ROM_DirectUpdate (_THIS, int numrects, SDL_Rect * rects);
-static void ROM_WindowUpdate (_THIS, int numrects, SDL_Rect * rects);
+static void ROM_DirectUpdate(_THIS, int numrects, SDL_Rect * rects);
+static void ROM_WindowUpdate(_THIS, int numrects, SDL_Rect * rects);
 
 static void
-ROM_UnsetVideoMode (_THIS, SDL_Surface * current)
+ROM_UnsetVideoMode(_THIS, SDL_Surface * current)
 {
     /* Free the current window, if any */
     if (SDL_Window != nil) {
         GWorldPtr memworld;
 
         /* Handle OpenGL support */
-        Mac_GL_Quit (this);
+        Mac_GL_Quit(this);
 
-        memworld = (GWorldPtr) GetWRefCon (SDL_Window);
+        memworld = (GWorldPtr) GetWRefCon(SDL_Window);
         if (memworld != nil) {
-            UnlockPixels (GetGWorldPixMap (memworld));
-            DisposeGWorld (memworld);
+            UnlockPixels(GetGWorldPixMap(memworld));
+            DisposeGWorld(memworld);
         }
         if ((current->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN) {
 #if USE_QUICKTIME
-            EndFullScreen (fullscreen_ctx, nil);
+            EndFullScreen(fullscreen_ctx, nil);
             SDL_Window = nil;
 #else
-            ROM_ShowMenuBar (this);
+            ROM_ShowMenuBar(this);
 #endif
         }
     }
@@ -493,8 +493,8 @@
 }
 
 static SDL_Surface *
-ROM_SetVideoMode (_THIS, SDL_Surface * current,
-                  int width, int height, int bpp, Uint32 flags)
+ROM_SetVideoMode(_THIS, SDL_Surface * current,
+                 int width, int height, int bpp, Uint32 flags)
 {
     Rect wrect, orect;
 #if TARGET_API_MAC_CARBON
@@ -502,26 +502,26 @@
 #endif
 
     /* Free any previous video mode */
-    ROM_UnsetVideoMode (this, current);
+    ROM_UnsetVideoMode(this, current);
 
     /* Create the ROM window and SDL video surface */
     current->flags = 0;         /* Clear flags */
     current->w = width;
     current->h = height;
-    SetRect (&wrect, 0, 0, width, height);
+    SetRect(&wrect, 0, 0, width, height);
     if (SDL_Window) {
         /* If we recreate the window, don't move it around */
 #if TARGET_API_MAC_CARBON
-        orect = *GetWindowPortBounds (SDL_Window, &tmprect);
+        orect = *GetWindowPortBounds(SDL_Window, &tmprect);
 #else
         orect = SDL_Window->portRect;
 #endif
-        OffsetRect (&wrect, orect.left, orect.top);
+        OffsetRect(&wrect, orect.left, orect.top);
     } else {
         /* Center the window the first time we show it */
-        OffsetRect (&wrect,
-                    (SDL_modelist[0]->w - width) / 2,
-                    (SDL_modelist[0]->h - height) / 2);
+        OffsetRect(&wrect,
+                   (SDL_modelist[0]->w - width) / 2,
+                   (SDL_modelist[0]->h - height) / 2);
     }
 
 #if defined(__MACOSX__) && !USE_QUICKTIME
@@ -532,14 +532,14 @@
         /* Create the fullscreen window and use screen bits */
         current->flags |= SDL_HWSURFACE | SDL_FULLSCREEN;
         if (SDL_Window) {
-            DisposeWindow (SDL_Window);
+            DisposeWindow(SDL_Window);
         }
 #if USE_QUICKTIME
-        BeginFullScreen (&fullscreen_ctx, nil, 0, 0, &SDL_Window, nil, 0);
+        BeginFullScreen(&fullscreen_ctx, nil, 0, 0, &SDL_Window, nil, 0);
 #else
-        SDL_Window = NewCWindow (nil, &wrect, "\p", true, plainDBox,
-                                 (WindowPtr) - 1, false, 0);
-        ROM_HideMenuBar (this);
+        SDL_Window = NewCWindow(nil, &wrect, "\p", true, plainDBox,
+                                (WindowPtr) - 1, false, 0);
+        ROM_HideMenuBar(this);
 #endif
         current->pitch = (**(**SDL_Display).gdPMap).rowBytes & 0x3FFF;
         current->pixels = (**(**SDL_Display).gdPMap).baseAddr;
@@ -561,51 +561,51 @@
             /* Resize existing window, if necessary */
             if (((orect.right - orect.left) != width) ||
                 ((orect.bottom - orect.top) != height)) {
-                SizeWindow (SDL_Window, width, height, false);
+                SizeWindow(SDL_Window, width, height, false);
             }
         } else {
             /* Recreate the window in the new style */
             if (SDL_Window) {
-                DisposeWindow (SDL_Window);
+                DisposeWindow(SDL_Window);
             }
-            SDL_Window = NewCWindow (nil, &wrect, "\p", true,
-                                     style, (WindowPtr) - 1, true, 0);
+            SDL_Window = NewCWindow(nil, &wrect, "\p", true,
+                                    style, (WindowPtr) - 1, true, 0);
 
             /* Set the window title, if any */
             {
                 char *title;
-                SDL_WM_GetCaption (&title, NULL);
+                SDL_WM_GetCaption(&title, NULL);
                 if (title) {
-                    Mac_SetCaption (this, title, NULL);
+                    Mac_SetCaption(this, title, NULL);
                 }
             }
         }
         current_style = style;
-        SetPalette (SDL_Window, SDL_CPal, false);
-        ActivatePalette (SDL_Window);
-        if (NewGWorld (&memworld, 0,
+        SetPalette(SDL_Window, SDL_CPal, false);
+        ActivatePalette(SDL_Window);
+        if (NewGWorld(&memworld, 0,
 #if TARGET_API_MAC_CARBON
-                       GetWindowPortBounds (SDL_Window, &tmprect),
+                      GetWindowPortBounds(SDL_Window, &tmprect),
 #else
-                       &SDL_Window->portRect,
+                      &SDL_Window->portRect,
 #endif
-                       SDL_CTab, nil, 0) != noErr) {
-            SDL_SetError ("NewGWorld() failed");
+                      SDL_CTab, nil, 0) != noErr) {
+            SDL_SetError("NewGWorld() failed");
             return (NULL);
         }
-        SetWRefCon (SDL_Window, (long) memworld);
-        pixmap = GetGWorldPixMap (memworld);
-        LockPixels (pixmap);
+        SetWRefCon(SDL_Window, (long) memworld);
+        pixmap = GetGWorldPixMap(memworld);
+        LockPixels(pixmap);
         current->pitch = (**pixmap).rowBytes & 0x3FFF;
-        current->pixels = GetPixBaseAddr (pixmap);
+        current->pixels = GetPixBaseAddr(pixmap);
         this->UpdateRects = ROM_WindowUpdate;
     }
-    SetPortWindowPort (SDL_Window);
-    SelectWindow (SDL_Window);
+    SetPortWindowPort(SDL_Window);
+    SelectWindow(SDL_Window);
 
     /* Handle OpenGL support */
     if (flags & SDL_INTERNALOPENGL) {
-        if (Mac_GL_Init (this) == 0) {
+        if (Mac_GL_Init(this) == 0) {
             current->flags |= SDL_INTERNALOPENGL;
         } else {
             current = NULL;
@@ -621,35 +621,35 @@
 
 /* We don't actually allow hardware surfaces other than the main one */
 static int
-ROM_AllocHWSurface (_THIS, SDL_Surface * surface)
+ROM_AllocHWSurface(_THIS, SDL_Surface * surface)
 {
     return (-1);
 }
 static void
-ROM_FreeHWSurface (_THIS, SDL_Surface * surface)
+ROM_FreeHWSurface(_THIS, SDL_Surface * surface)
 {
     return;
 }
 static int
-ROM_LockHWSurface (_THIS, SDL_Surface * surface)
+ROM_LockHWSurface(_THIS, SDL_Surface * surface)
 {
     return (0);
 }
 static void
-ROM_UnlockHWSurface (_THIS, SDL_Surface * surface)
+ROM_UnlockHWSurface(_THIS, SDL_Surface * surface)
 {
     return;
 }
 
 static void
-ROM_DirectUpdate (_THIS, int numrects, SDL_Rect * rects)
+ROM_DirectUpdate(_THIS, int numrects, SDL_Rect * rects)
 {
     /* The application is already updating the visible video memory */
     return;
 }
 
 static void
-ROM_WindowUpdate (_THIS, int numrects, SDL_Rect * rects)
+ROM_WindowUpdate(_THIS, int numrects, SDL_Rect * rects)
 {
     GWorldPtr memworld;
     GrafPtr saveport;
@@ -660,17 +660,17 @@
     Rect update;
 
     /* Copy from the offscreen GWorld to the window port */
-    GetPort (&saveport);
-    SetPortWindowPort (SDL_Window);
-    thePort = GetWindowPort (SDL_Window);
-    memworld = (GWorldPtr) GetWRefCon (SDL_Window);
+    GetPort(&saveport);
+    SetPortWindowPort(SDL_Window);
+    thePort = GetWindowPort(SDL_Window);
+    memworld = (GWorldPtr) GetWRefCon(SDL_Window);
 #if TARGET_API_MAC_CARBON && ACCESSOR_CALLS_ARE_FUNCTIONS
-    memBits = GetPortBitMapForCopyBits ((CGrafPtr) memworld);
+    memBits = GetPortBitMapForCopyBits((CGrafPtr) memworld);
 #else
     memBits = &((GrafPtr) memworld)->portBits;
 #endif
 #if TARGET_API_MAC_CARBON && ACCESSOR_CALLS_ARE_FUNCTIONS
-    winBits = GetPortBitMapForCopyBits (thePort);
+    winBits = GetPortBitMapForCopyBits(thePort);
 #else
     winBits = &SDL_Window->portBits;
 #endif
@@ -679,18 +679,18 @@
         update.right = rects[i].x + rects[i].w;
         update.top = rects[i].y;
         update.bottom = rects[i].y + rects[i].h;
-        CopyBits (memBits, winBits, &update, &update, srcCopy, nil);
+        CopyBits(memBits, winBits, &update, &update, srcCopy, nil);
     }
 #if TARGET_API_MAC_CARBON
-    if (QDIsPortBuffered (thePort)) {
-        QDFlushPortBuffer (thePort, NULL);
+    if (QDIsPortBuffered(thePort)) {
+        QDFlushPortBuffer(thePort, NULL);
     }
 #endif
-    SetPort (saveport);
+    SetPort(saveport);
 }
 
 static int
-ROM_SetColors (_THIS, int firstcolor, int ncolors, SDL_Color * colors)
+ROM_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color * colors)
 {
     CTabHandle cTab;
     int i;
@@ -718,43 +718,43 @@
 //      if ( (this->screen->flags & SDL_FULLSCREEN) == SDL_FULLSCREEN ) 
     {
         GDevice **odisplay;
-        odisplay = GetGDevice ();
-        SetGDevice (SDL_Display);
-        SetEntries (0, (**cTab).ctSize, (ColorSpec *) & (**cTab).ctTable);
-        SetGDevice (odisplay);
+        odisplay = GetGDevice();
+        SetGDevice(SDL_Display);
+        SetEntries(0, (**cTab).ctSize, (ColorSpec *) & (**cTab).ctTable);
+        SetGDevice(odisplay);
     }
     return (1);
 }
 
 void
-ROM_VideoQuit (_THIS)
+ROM_VideoQuit(_THIS)
 {
     int i;
 
     /* Free current video mode */
-    ROM_UnsetVideoMode (this, this->screen);
+    ROM_UnsetVideoMode(this, this->screen);
     if (SDL_Window) {
-        DisposeWindow (SDL_Window);
+        DisposeWindow(SDL_Window);
         SDL_Window = nil;
     }
 
     /* Free palette and restore original one */
     if (SDL_CTab != nil) {
-        DisposeHandle ((Handle) SDL_CTab);
+        DisposeHandle((Handle) SDL_CTab);
         SDL_CTab = nil;
     }
     if (SDL_CPal != nil) {
-        DisposePalette (SDL_CPal);
+        DisposePalette(SDL_CPal);
         SDL_CPal = nil;
     }
-    RestoreDeviceClut (GetMainDevice ());
+    RestoreDeviceClut(GetMainDevice());
 
     /* Free list of video modes */
     if (SDL_modelist != NULL) {
         for (i = 0; SDL_modelist[i]; ++i) {
-            SDL_free (SDL_modelist[i]);
+            SDL_free(SDL_modelist[i]);
         }
-        SDL_free (SDL_modelist);
+        SDL_free(SDL_modelist);
         SDL_modelist = NULL;
     }
 }