src/video/SDL_video.c
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1667 1fddae038bc8
child 1669 9857d21967bb
     1.1 --- a/src/video/SDL_video.c	Mon May 29 03:53:21 2006 +0000
     1.2 +++ b/src/video/SDL_video.c	Mon May 29 04:04:35 2006 +0000
     1.3 @@ -132,11 +132,11 @@
     1.4  static SDL_VideoDevice *_this = NULL;
     1.5  
     1.6  /* Various local functions */
     1.7 -int SDL_VideoInit (const char *driver_name, Uint32 flags);
     1.8 -void SDL_VideoQuit (void);
     1.9 +int SDL_VideoInit(const char *driver_name, Uint32 flags);
    1.10 +void SDL_VideoQuit(void);
    1.11  
    1.12  static int
    1.13 -cmpmodes (const void *A, const void *B)
    1.14 +cmpmodes(const void *A, const void *B)
    1.15  {
    1.16      SDL_DisplayMode a = *(const SDL_DisplayMode *) A;
    1.17      SDL_DisplayMode b = *(const SDL_DisplayMode *) B;
    1.18 @@ -147,8 +147,8 @@
    1.19      if (a.h != b.h) {
    1.20          return b.h - a.h;
    1.21      }
    1.22 -    if (SDL_BITSPERPIXEL (a.format) != SDL_BITSPERPIXEL (b.format)) {
    1.23 -        return SDL_BITSPERPIXEL (b.format) - SDL_BITSPERPIXEL (a.format);
    1.24 +    if (SDL_BITSPERPIXEL(a.format) != SDL_BITSPERPIXEL(b.format)) {
    1.25 +        return SDL_BITSPERPIXEL(b.format) - SDL_BITSPERPIXEL(a.format);
    1.26      }
    1.27      if (a.refresh_rate != b.refresh_rate) {
    1.28          return b.refresh_rate - a.refresh_rate;
    1.29 @@ -157,15 +157,15 @@
    1.30  }
    1.31  
    1.32  int
    1.33 -SDL_GetNumVideoDrivers (void)
    1.34 +SDL_GetNumVideoDrivers(void)
    1.35  {
    1.36 -    return SDL_arraysize (bootstrap) - 1;
    1.37 +    return SDL_arraysize(bootstrap) - 1;
    1.38  }
    1.39  
    1.40  const char *
    1.41 -SDL_GetVideoDriver (int index)
    1.42 +SDL_GetVideoDriver(int index)
    1.43  {
    1.44 -    if (index >= 0 && index < SDL_GetNumVideoDrivers ()) {
    1.45 +    if (index >= 0 && index < SDL_GetNumVideoDrivers()) {
    1.46          return bootstrap[index]->name;
    1.47      }
    1.48      return NULL;
    1.49 @@ -175,7 +175,7 @@
    1.50   * Initialize the video and event subsystems -- determine native pixel format
    1.51   */
    1.52  int
    1.53 -SDL_VideoInit (const char *driver_name, Uint32 flags)
    1.54 +SDL_VideoInit(const char *driver_name, Uint32 flags)
    1.55  {
    1.56      SDL_VideoDevice *video;
    1.57      int index;
    1.58 @@ -188,14 +188,14 @@
    1.59      flags |= SDL_INIT_EVENTTHREAD;
    1.60  #elif defined(CANT_THREAD_EVENTS)
    1.61      if ((flags & SDL_INIT_EVENTTHREAD) == SDL_INIT_EVENTTHREAD) {
    1.62 -        SDL_SetError ("OS doesn't support threaded events");
    1.63 +        SDL_SetError("OS doesn't support threaded events");
    1.64          return -1;
    1.65      }
    1.66  #endif
    1.67  
    1.68      /* Check to make sure we don't overwrite '_this' */
    1.69      if (_this != NULL) {
    1.70 -        SDL_VideoQuit ();
    1.71 +        SDL_VideoQuit();
    1.72      }
    1.73  
    1.74      /* Select the proper video driver */
    1.75 @@ -203,18 +203,18 @@
    1.76      video = NULL;
    1.77      if (driver_name != NULL) {
    1.78          for (i = 0; bootstrap[i]; ++i) {
    1.79 -            if (SDL_strncmp (bootstrap[i]->name, driver_name,
    1.80 -                             SDL_strlen (bootstrap[i]->name)) == 0) {
    1.81 -                if (bootstrap[i]->available ()) {
    1.82 -                    video = bootstrap[i]->create (index);
    1.83 +            if (SDL_strncmp(bootstrap[i]->name, driver_name,
    1.84 +                            SDL_strlen(bootstrap[i]->name)) == 0) {
    1.85 +                if (bootstrap[i]->available()) {
    1.86 +                    video = bootstrap[i]->create(index);
    1.87                  }
    1.88                  break;
    1.89              }
    1.90          }
    1.91      } else {
    1.92          for (i = 0; bootstrap[i]; ++i) {
    1.93 -            if (bootstrap[i]->available ()) {
    1.94 -                video = bootstrap[i]->create (index);
    1.95 +            if (bootstrap[i]->available()) {
    1.96 +                video = bootstrap[i]->create(index);
    1.97                  if (video != NULL) {
    1.98                      break;
    1.99                  }
   1.100 @@ -223,9 +223,9 @@
   1.101      }
   1.102      if (video == NULL) {
   1.103          if (driver_name) {
   1.104 -            SDL_SetError ("%s not available", driver_name);
   1.105 +            SDL_SetError("%s not available", driver_name);
   1.106          } else {
   1.107 -            SDL_SetError ("No available video device");
   1.108 +            SDL_SetError("No available video device");
   1.109          }
   1.110          return -1;
   1.111      }
   1.112 @@ -255,38 +255,38 @@
   1.113      _this->gl_config.swap_control = -1; /* not known, don't set */
   1.114  
   1.115      /* Initialize the video subsystem */
   1.116 -    if (_this->VideoInit (_this) < 0) {
   1.117 -        SDL_VideoQuit ();
   1.118 +    if (_this->VideoInit(_this) < 0) {
   1.119 +        SDL_VideoQuit();
   1.120          return -1;
   1.121      }
   1.122  
   1.123      /* Make sure some displays were added */
   1.124      if (_this->num_displays == 0) {
   1.125 -        SDL_SetError ("The video driver did not add any displays");
   1.126 -        SDL_VideoQuit ();
   1.127 +        SDL_SetError("The video driver did not add any displays");
   1.128 +        SDL_VideoQuit();
   1.129          return (-1);
   1.130      }
   1.131  
   1.132      /* Sort the video modes */
   1.133      for (i = 0; i < _this->num_displays; ++i) {
   1.134 -        SDL_qsort (_this->displays[i].display_modes,
   1.135 -                   _this->displays[i].num_display_modes,
   1.136 -                   sizeof (SDL_DisplayMode), cmpmodes);
   1.137 +        SDL_qsort(_this->displays[i].display_modes,
   1.138 +                  _this->displays[i].num_display_modes,
   1.139 +                  sizeof(SDL_DisplayMode), cmpmodes);
   1.140      }
   1.141  
   1.142      /* Start the event loop */
   1.143 -    if (SDL_StartEventLoop (flags) < 0) {
   1.144 -        SDL_VideoQuit ();
   1.145 +    if (SDL_StartEventLoop(flags) < 0) {
   1.146 +        SDL_VideoQuit();
   1.147          return -1;
   1.148      }
   1.149 -    SDL_CursorInit (flags & SDL_INIT_EVENTTHREAD);
   1.150 +    SDL_CursorInit(flags & SDL_INIT_EVENTTHREAD);
   1.151  
   1.152      /* We're ready to go! */
   1.153      return 0;
   1.154  }
   1.155  
   1.156  const char *
   1.157 -SDL_GetCurrentVideoDriver ()
   1.158 +SDL_GetCurrentVideoDriver()
   1.159  {
   1.160      if (!_this) {
   1.161          return NULL;
   1.162 @@ -295,13 +295,13 @@
   1.163  }
   1.164  
   1.165  SDL_VideoDevice *
   1.166 -SDL_GetVideoDevice ()
   1.167 +SDL_GetVideoDevice()
   1.168  {
   1.169      return _this;
   1.170  }
   1.171  
   1.172  const SDL_VideoInfo *
   1.173 -SDL_GetVideoInfo (void)
   1.174 +SDL_GetVideoInfo(void)
   1.175  {
   1.176      if (!_this) {
   1.177          return NULL;
   1.178 @@ -310,28 +310,28 @@
   1.179  }
   1.180  
   1.181  void
   1.182 -SDL_AddBasicVideoDisplay (const SDL_DisplayMode * desktop_mode)
   1.183 +SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode)
   1.184  {
   1.185      SDL_VideoDisplay display;
   1.186  
   1.187 -    SDL_zero (display);
   1.188 +    SDL_zero(display);
   1.189      if (desktop_mode) {
   1.190          display.desktop_mode = *desktop_mode;
   1.191      }
   1.192      display.current_mode = display.desktop_mode;
   1.193      display.max_windows = 1;
   1.194  
   1.195 -    SDL_AddVideoDisplay (&display);
   1.196 +    SDL_AddVideoDisplay(&display);
   1.197  }
   1.198  
   1.199  void
   1.200 -SDL_AddVideoDisplay (SDL_VideoDisplay * display)
   1.201 +SDL_AddVideoDisplay(SDL_VideoDisplay * display)
   1.202  {
   1.203      SDL_VideoDisplay *displays;
   1.204  
   1.205      displays =
   1.206 -        SDL_realloc (_this->displays,
   1.207 -                     (_this->num_displays + 1) * sizeof (*displays));
   1.208 +        SDL_realloc(_this->displays,
   1.209 +                    (_this->num_displays + 1) * sizeof(*displays));
   1.210      if (displays) {
   1.211          displays[_this->num_displays] = *display;
   1.212          _this->displays = displays;
   1.213 @@ -340,7 +340,7 @@
   1.214  }
   1.215  
   1.216  int
   1.217 -SDL_GetNumVideoDisplays (void)
   1.218 +SDL_GetNumVideoDisplays(void)
   1.219  {
   1.220      if (!_this) {
   1.221          return 0;
   1.222 @@ -349,16 +349,16 @@
   1.223  }
   1.224  
   1.225  int
   1.226 -SDL_SelectVideoDisplay (int index)
   1.227 +SDL_SelectVideoDisplay(int index)
   1.228  {
   1.229      if (!_this) {
   1.230 -        SDL_SetError ("Video subsystem has not been initialized");
   1.231 +        SDL_SetError("Video subsystem has not been initialized");
   1.232          return (-1);
   1.233      }
   1.234      if (index >= 0) {
   1.235          if (index >= _this->num_displays) {
   1.236 -            SDL_SetError ("index must be in the range 0 - %d",
   1.237 -                          _this->num_displays - 1);
   1.238 +            SDL_SetError("index must be in the range 0 - %d",
   1.239 +                         _this->num_displays - 1);
   1.240              return -1;
   1.241          }
   1.242          _this->current_display = index;
   1.243 @@ -367,7 +367,7 @@
   1.244  }
   1.245  
   1.246  void
   1.247 -SDL_AddDisplayMode (int display, const SDL_DisplayMode * mode)
   1.248 +SDL_AddDisplayMode(int display, const SDL_DisplayMode * mode)
   1.249  {
   1.250      SDL_DisplayMode *modes;
   1.251      int i, nmodes;
   1.252 @@ -376,13 +376,13 @@
   1.253      modes = SDL_CurrentDisplay.display_modes;
   1.254      nmodes = SDL_CurrentDisplay.num_display_modes;
   1.255      for (i = 0; i < nmodes; ++i) {
   1.256 -        if (SDL_memcmp (mode, &modes[i], sizeof (*mode)) == 0) {
   1.257 +        if (SDL_memcmp(mode, &modes[i], sizeof(*mode)) == 0) {
   1.258              return;
   1.259          }
   1.260      }
   1.261  
   1.262      /* Go ahead and add the new mode */
   1.263 -    modes = SDL_realloc (modes, (nmodes + 1) * sizeof (*mode));
   1.264 +    modes = SDL_realloc(modes, (nmodes + 1) * sizeof(*mode));
   1.265      if (modes) {
   1.266          SDL_CurrentDisplay.display_modes = modes;
   1.267          modes[nmodes] = *mode;
   1.268 @@ -391,7 +391,7 @@
   1.269  }
   1.270  
   1.271  int
   1.272 -SDL_GetNumDisplayModes ()
   1.273 +SDL_GetNumDisplayModes()
   1.274  {
   1.275      if (_this) {
   1.276          return SDL_CurrentDisplay.num_display_modes;
   1.277 @@ -400,18 +400,18 @@
   1.278  }
   1.279  
   1.280  const SDL_DisplayMode *
   1.281 -SDL_GetDisplayMode (int index)
   1.282 +SDL_GetDisplayMode(int index)
   1.283  {
   1.284 -    if (index < 0 || index >= SDL_GetNumDisplayModes ()) {
   1.285 -        SDL_SetError ("index must be in the range of 0 - %d",
   1.286 -                      SDL_GetNumDisplayModes ());
   1.287 +    if (index < 0 || index >= SDL_GetNumDisplayModes()) {
   1.288 +        SDL_SetError("index must be in the range of 0 - %d",
   1.289 +                     SDL_GetNumDisplayModes());
   1.290          return NULL;
   1.291      }
   1.292      return &SDL_CurrentDisplay.display_modes[index];
   1.293  }
   1.294  
   1.295  const SDL_DisplayMode *
   1.296 -SDL_GetDesktopDisplayMode (void)
   1.297 +SDL_GetDesktopDisplayMode(void)
   1.298  {
   1.299      if (_this) {
   1.300          return &SDL_CurrentDisplay.desktop_mode;
   1.301 @@ -420,7 +420,7 @@
   1.302  }
   1.303  
   1.304  const SDL_DisplayMode *
   1.305 -SDL_GetCurrentDisplayMode (void)
   1.306 +SDL_GetCurrentDisplayMode(void)
   1.307  {
   1.308      if (_this) {
   1.309          return &SDL_CurrentDisplay.current_mode;
   1.310 @@ -429,8 +429,8 @@
   1.311  }
   1.312  
   1.313  SDL_DisplayMode *
   1.314 -SDL_GetClosestDisplayMode (const SDL_DisplayMode * mode,
   1.315 -                           SDL_DisplayMode * closest)
   1.316 +SDL_GetClosestDisplayMode(const SDL_DisplayMode * mode,
   1.317 +                          SDL_DisplayMode * closest)
   1.318  {
   1.319      Uint32 target_format;
   1.320      int target_refresh_rate;
   1.321 @@ -471,10 +471,10 @@
   1.322          if (current->format != match->format) {
   1.323              /* Sorted highest depth to lowest */
   1.324              if (current->format == target_format ||
   1.325 -                (SDL_BITSPERPIXEL (current->format) >=
   1.326 -                 SDL_BITSPERPIXEL (target_format)
   1.327 -                 && SDL_PIXELTYPE (current->format) ==
   1.328 -                 SDL_PIXELTYPE (target_format))) {
   1.329 +                (SDL_BITSPERPIXEL(current->format) >=
   1.330 +                 SDL_BITSPERPIXEL(target_format)
   1.331 +                 && SDL_PIXELTYPE(current->format) ==
   1.332 +                 SDL_PIXELTYPE(target_format))) {
   1.333                  match = current;
   1.334              }
   1.335              continue;
   1.336 @@ -510,20 +510,20 @@
   1.337  }
   1.338  
   1.339  int
   1.340 -SDL_SetDisplayMode (const SDL_DisplayMode * mode)
   1.341 +SDL_SetDisplayMode(const SDL_DisplayMode * mode)
   1.342  {
   1.343      SDL_VideoDisplay *display;
   1.344      SDL_DisplayMode display_mode;
   1.345      int i;
   1.346  
   1.347      if (!_this) {
   1.348 -        SDL_SetError ("Video subsystem has not been initialized");
   1.349 +        SDL_SetError("Video subsystem has not been initialized");
   1.350          return -1;
   1.351      }
   1.352  
   1.353      /* Make sure there's an actual display mode to set */
   1.354      if (!mode) {
   1.355 -        SDL_SetError ("No mode passed to SDL_SetDisplayMode");
   1.356 +        SDL_SetError("No mode passed to SDL_SetDisplayMode");
   1.357          return -1;
   1.358      }
   1.359      display = &SDL_CurrentDisplay;
   1.360 @@ -544,16 +544,16 @@
   1.361      }
   1.362  
   1.363      /* Get a good video mode, the closest one possible */
   1.364 -    if (!SDL_GetClosestDisplayMode (&display_mode, &display_mode)) {
   1.365 -        SDL_SetError ("No video mode large enough for %dx%d",
   1.366 -                      display_mode.w, display_mode.h);
   1.367 +    if (!SDL_GetClosestDisplayMode(&display_mode, &display_mode)) {
   1.368 +        SDL_SetError("No video mode large enough for %dx%d",
   1.369 +                     display_mode.w, display_mode.h);
   1.370          return -1;
   1.371      }
   1.372  
   1.373      /* See if there's anything left to do */
   1.374      if (SDL_memcmp
   1.375 -        (&display_mode, SDL_GetCurrentDisplayMode (),
   1.376 -         sizeof (display_mode)) == 0) {
   1.377 +        (&display_mode, SDL_GetCurrentDisplayMode(),
   1.378 +         sizeof(display_mode)) == 0) {
   1.379          return 0;
   1.380      }
   1.381  
   1.382 @@ -561,20 +561,20 @@
   1.383      for (i = 0; i < display->num_windows; ++i) {
   1.384          SDL_Window *window = &display->windows[i];
   1.385          if (window->shadow) {
   1.386 -            SDL_FreeSurface (window->shadow);
   1.387 +            SDL_FreeSurface(window->shadow);
   1.388              window->shadow = NULL;
   1.389          }
   1.390          if (window->surface) {
   1.391 -            SDL_FreeSurface (window->surface);
   1.392 +            SDL_FreeSurface(window->surface);
   1.393              window->surface = NULL;
   1.394          }
   1.395      }
   1.396  
   1.397 -    return _this->SetDisplayMode (_this, &display_mode);
   1.398 +    return _this->SetDisplayMode(_this, &display_mode);
   1.399  }
   1.400  
   1.401  SDL_WindowID
   1.402 -SDL_CreateWindow (const char *title, int x, int y, int w, int h, Uint32 flags)
   1.403 +SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
   1.404  {
   1.405      const Uint32 allowed_flags = (SDL_WINDOW_FULLSCREEN |
   1.406                                    SDL_WINDOW_BORDERLESS |
   1.407 @@ -589,36 +589,36 @@
   1.408      SDL_Window *windows;
   1.409  
   1.410      if (!_this) {
   1.411 -        SDL_SetError ("Video subsystem has not been initialized");
   1.412 +        SDL_SetError("Video subsystem has not been initialized");
   1.413          return 0;
   1.414      }
   1.415  
   1.416 -    SDL_zero (window);
   1.417 +    SDL_zero(window);
   1.418      window.id = _this->next_window_id++;
   1.419 -    window.title = title ? SDL_strdup (title) : NULL;
   1.420 +    window.title = title ? SDL_strdup(title) : NULL;
   1.421      window.x = x;
   1.422      window.y = y;
   1.423      window.w = w;
   1.424      window.h = h;
   1.425      window.flags = (flags & allowed_flags);
   1.426  
   1.427 -    if (_this->CreateWindow && _this->CreateWindow (_this, &window) < 0) {
   1.428 +    if (_this->CreateWindow && _this->CreateWindow(_this, &window) < 0) {
   1.429          if (window.title) {
   1.430 -            SDL_free (window.title);
   1.431 +            SDL_free(window.title);
   1.432          }
   1.433          return 0;
   1.434      }
   1.435  
   1.436      num_windows = SDL_CurrentDisplay.num_windows;
   1.437      windows =
   1.438 -        SDL_realloc (SDL_CurrentDisplay.windows,
   1.439 -                     (num_windows + 1) * sizeof (*windows));
   1.440 +        SDL_realloc(SDL_CurrentDisplay.windows,
   1.441 +                    (num_windows + 1) * sizeof(*windows));
   1.442      if (!windows) {
   1.443          if (_this->DestroyWindow) {
   1.444 -            _this->DestroyWindow (_this, &window);
   1.445 +            _this->DestroyWindow(_this, &window);
   1.446          }
   1.447          if (window.title) {
   1.448 -            SDL_free (window.title);
   1.449 +            SDL_free(window.title);
   1.450          }
   1.451          return 0;
   1.452      }
   1.453 @@ -630,35 +630,35 @@
   1.454  }
   1.455  
   1.456  SDL_WindowID
   1.457 -SDL_CreateWindowFrom (void *data)
   1.458 +SDL_CreateWindowFrom(void *data)
   1.459  {
   1.460      SDL_Window window;
   1.461      int num_windows;
   1.462      SDL_Window *windows;
   1.463  
   1.464      if (!_this) {
   1.465 -        SDL_SetError ("Video subsystem has not been initialized");
   1.466 +        SDL_SetError("Video subsystem has not been initialized");
   1.467          return (0);
   1.468      }
   1.469  
   1.470 -    SDL_zero (window);
   1.471 +    SDL_zero(window);
   1.472      window.id = _this->next_window_id++;
   1.473  
   1.474      if (!_this->CreateWindowFrom ||
   1.475 -        _this->CreateWindowFrom (_this, &window, data) < 0) {
   1.476 +        _this->CreateWindowFrom(_this, &window, data) < 0) {
   1.477          return 0;
   1.478      }
   1.479  
   1.480      num_windows = SDL_CurrentDisplay.num_windows;
   1.481      windows =
   1.482 -        SDL_realloc (SDL_CurrentDisplay.windows,
   1.483 -                     (num_windows + 1) * sizeof (*windows));
   1.484 +        SDL_realloc(SDL_CurrentDisplay.windows,
   1.485 +                    (num_windows + 1) * sizeof(*windows));
   1.486      if (!windows) {
   1.487          if (_this->DestroyWindow) {
   1.488 -            _this->DestroyWindow (_this, &window);
   1.489 +            _this->DestroyWindow(_this, &window);
   1.490          }
   1.491          if (window.title) {
   1.492 -            SDL_free (window.title);
   1.493 +            SDL_free(window.title);
   1.494          }
   1.495          return 0;
   1.496      }
   1.497 @@ -670,7 +670,7 @@
   1.498  }
   1.499  
   1.500  static __inline__ SDL_Window *
   1.501 -SDL_GetWindowFromID (SDL_WindowID windowID)
   1.502 +SDL_GetWindowFromID(SDL_WindowID windowID)
   1.503  {
   1.504      int i, j;
   1.505  
   1.506 @@ -691,7 +691,7 @@
   1.507  }
   1.508  
   1.509  SDL_Window *
   1.510 -SDL_GetWindowFromSurface (SDL_Surface * surface)
   1.511 +SDL_GetWindowFromSurface(SDL_Surface * surface)
   1.512  {
   1.513      int i, j;
   1.514  
   1.515 @@ -713,9 +713,9 @@
   1.516  
   1.517  
   1.518  Uint32
   1.519 -SDL_GetWindowFlags (SDL_WindowID windowID)
   1.520 +SDL_GetWindowFlags(SDL_WindowID windowID)
   1.521  {
   1.522 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.523 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.524  
   1.525      if (!window) {
   1.526          return 0;
   1.527 @@ -724,27 +724,27 @@
   1.528  }
   1.529  
   1.530  void
   1.531 -SDL_SetWindowTitle (SDL_WindowID windowID, const char *title)
   1.532 +SDL_SetWindowTitle(SDL_WindowID windowID, const char *title)
   1.533  {
   1.534 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.535 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.536  
   1.537      if (!window) {
   1.538          return;
   1.539      }
   1.540      if (window->title) {
   1.541 -        SDL_free (window->title);
   1.542 +        SDL_free(window->title);
   1.543      }
   1.544 -    window->title = SDL_strdup (title);
   1.545 +    window->title = SDL_strdup(title);
   1.546  
   1.547      if (_this->SetWindowTitle) {
   1.548 -        _this->SetWindowTitle (_this, window);
   1.549 +        _this->SetWindowTitle(_this, window);
   1.550      }
   1.551  }
   1.552  
   1.553  const char *
   1.554 -SDL_GetWindowTitle (SDL_WindowID windowID)
   1.555 +SDL_GetWindowTitle(SDL_WindowID windowID)
   1.556  {
   1.557 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.558 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.559  
   1.560      if (!window) {
   1.561          return NULL;
   1.562 @@ -753,9 +753,9 @@
   1.563  }
   1.564  
   1.565  void
   1.566 -SDL_SetWindowData (SDL_WindowID windowID, void *userdata)
   1.567 +SDL_SetWindowData(SDL_WindowID windowID, void *userdata)
   1.568  {
   1.569 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.570 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.571  
   1.572      if (!window) {
   1.573          return;
   1.574 @@ -764,9 +764,9 @@
   1.575  }
   1.576  
   1.577  void *
   1.578 -SDL_GetWindowData (SDL_WindowID windowID)
   1.579 +SDL_GetWindowData(SDL_WindowID windowID)
   1.580  {
   1.581 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.582 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.583  
   1.584      if (!window) {
   1.585          return NULL;
   1.586 @@ -775,9 +775,9 @@
   1.587  }
   1.588  
   1.589  void
   1.590 -SDL_SetWindowPosition (SDL_WindowID windowID, int x, int y)
   1.591 +SDL_SetWindowPosition(SDL_WindowID windowID, int x, int y)
   1.592  {
   1.593 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.594 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.595  
   1.596      if (!window) {
   1.597          return;
   1.598 @@ -787,14 +787,14 @@
   1.599      window->y = y;
   1.600  
   1.601      if (_this->SetWindowPosition) {
   1.602 -        _this->SetWindowPosition (_this, window);
   1.603 +        _this->SetWindowPosition(_this, window);
   1.604      }
   1.605  }
   1.606  
   1.607  void
   1.608 -SDL_GetWindowPosition (SDL_WindowID windowID, int *x, int *y)
   1.609 +SDL_GetWindowPosition(SDL_WindowID windowID, int *x, int *y)
   1.610  {
   1.611 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.612 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.613  
   1.614      if (!window) {
   1.615          return;
   1.616 @@ -808,9 +808,9 @@
   1.617  }
   1.618  
   1.619  void
   1.620 -SDL_SetWindowSize (SDL_WindowID windowID, int w, int h)
   1.621 +SDL_SetWindowSize(SDL_WindowID windowID, int w, int h)
   1.622  {
   1.623 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.624 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.625  
   1.626      if (!window) {
   1.627          return;
   1.628 @@ -820,14 +820,14 @@
   1.629      window->h = h;
   1.630  
   1.631      if (_this->SetWindowSize) {
   1.632 -        _this->SetWindowSize (_this, window);
   1.633 +        _this->SetWindowSize(_this, window);
   1.634      }
   1.635  }
   1.636  
   1.637  void
   1.638 -SDL_GetWindowSize (SDL_WindowID windowID, int *w, int *h)
   1.639 +SDL_GetWindowSize(SDL_WindowID windowID, int *w, int *h)
   1.640  {
   1.641 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.642 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.643  
   1.644      if (!window) {
   1.645          return;
   1.646 @@ -841,9 +841,9 @@
   1.647  }
   1.648  
   1.649  void
   1.650 -SDL_ShowWindow (SDL_WindowID windowID)
   1.651 +SDL_ShowWindow(SDL_WindowID windowID)
   1.652  {
   1.653 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.654 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.655  
   1.656      if (!window || (window->flags & SDL_WINDOW_SHOWN)) {
   1.657          return;
   1.658 @@ -852,14 +852,14 @@
   1.659      window->flags |= SDL_WINDOW_SHOWN;
   1.660  
   1.661      if (_this->ShowWindow) {
   1.662 -        _this->ShowWindow (_this, window);
   1.663 +        _this->ShowWindow(_this, window);
   1.664      }
   1.665  }
   1.666  
   1.667  void
   1.668 -SDL_HideWindow (SDL_WindowID windowID)
   1.669 +SDL_HideWindow(SDL_WindowID windowID)
   1.670  {
   1.671 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.672 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.673  
   1.674      if (!window || !(window->flags & SDL_WINDOW_SHOWN)) {
   1.675          return;
   1.676 @@ -868,28 +868,28 @@
   1.677      window->flags &= ~SDL_WINDOW_SHOWN;
   1.678  
   1.679      if (_this->HideWindow) {
   1.680 -        _this->HideWindow (_this, window);
   1.681 +        _this->HideWindow(_this, window);
   1.682      }
   1.683  }
   1.684  
   1.685  void
   1.686 -SDL_RaiseWindow (SDL_WindowID windowID)
   1.687 +SDL_RaiseWindow(SDL_WindowID windowID)
   1.688  {
   1.689 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.690 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.691  
   1.692      if (!window) {
   1.693          return;
   1.694      }
   1.695  
   1.696      if (_this->RaiseWindow) {
   1.697 -        _this->RaiseWindow (_this, window);
   1.698 +        _this->RaiseWindow(_this, window);
   1.699      }
   1.700  }
   1.701  
   1.702  void
   1.703 -SDL_MaximizeWindow (SDL_WindowID windowID)
   1.704 +SDL_MaximizeWindow(SDL_WindowID windowID)
   1.705  {
   1.706 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.707 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.708  
   1.709      if (!window || (window->flags & SDL_WINDOW_MAXIMIZED)) {
   1.710          return;
   1.711 @@ -898,14 +898,14 @@
   1.712      window->flags |= SDL_WINDOW_MAXIMIZED;
   1.713  
   1.714      if (_this->MaximizeWindow) {
   1.715 -        _this->MaximizeWindow (_this, window);
   1.716 +        _this->MaximizeWindow(_this, window);
   1.717      }
   1.718  }
   1.719  
   1.720  void
   1.721 -SDL_MinimizeWindow (SDL_WindowID windowID)
   1.722 +SDL_MinimizeWindow(SDL_WindowID windowID)
   1.723  {
   1.724 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.725 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.726  
   1.727      if (!window || (window->flags & SDL_WINDOW_MINIMIZED)) {
   1.728          return;
   1.729 @@ -914,14 +914,14 @@
   1.730      window->flags |= SDL_WINDOW_MINIMIZED;
   1.731  
   1.732      if (_this->MinimizeWindow) {
   1.733 -        _this->MinimizeWindow (_this, window);
   1.734 +        _this->MinimizeWindow(_this, window);
   1.735      }
   1.736  }
   1.737  
   1.738  void
   1.739 -SDL_RestoreWindow (SDL_WindowID windowID)
   1.740 +SDL_RestoreWindow(SDL_WindowID windowID)
   1.741  {
   1.742 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.743 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.744  
   1.745      if (!window
   1.746          || (window->flags & (SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED))) {
   1.747 @@ -931,14 +931,14 @@
   1.748      window->flags &= ~(SDL_WINDOW_MAXIMIZED | SDL_WINDOW_MINIMIZED);
   1.749  
   1.750      if (_this->RestoreWindow) {
   1.751 -        _this->RestoreWindow (_this, window);
   1.752 +        _this->RestoreWindow(_this, window);
   1.753      }
   1.754  }
   1.755  
   1.756  void
   1.757 -SDL_SetWindowGrab (SDL_WindowID windowID, int mode)
   1.758 +SDL_SetWindowGrab(SDL_WindowID windowID, int mode)
   1.759  {
   1.760 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.761 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.762  
   1.763      if (!window || (!!mode == !!(window->flags & SDL_WINDOW_INPUT_GRABBED))) {
   1.764          return;
   1.765 @@ -951,14 +951,14 @@
   1.766      }
   1.767  
   1.768      if (_this->SetWindowGrab) {
   1.769 -        _this->SetWindowGrab (_this, window);
   1.770 +        _this->SetWindowGrab(_this, window);
   1.771      }
   1.772  }
   1.773  
   1.774  int
   1.775 -SDL_GetWindowGrab (SDL_WindowID windowID)
   1.776 +SDL_GetWindowGrab(SDL_WindowID windowID)
   1.777  {
   1.778 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.779 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.780  
   1.781      if (!window) {
   1.782          return 0;
   1.783 @@ -968,7 +968,7 @@
   1.784  }
   1.785  
   1.786  void
   1.787 -SDL_DestroyWindow (SDL_WindowID windowID)
   1.788 +SDL_DestroyWindow(SDL_WindowID windowID)
   1.789  {
   1.790      int i, j;
   1.791  
   1.792 @@ -985,28 +985,27 @@
   1.793              }
   1.794              if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
   1.795                  window->flags &= ~SDL_WINDOW_INPUT_GRABBED;
   1.796 -                _this->SetWindowGrab (_this, window);
   1.797 +                _this->SetWindowGrab(_this, window);
   1.798              }
   1.799              if (window->shadow) {
   1.800 -                SDL_FreeSurface (window->shadow);
   1.801 +                SDL_FreeSurface(window->shadow);
   1.802              }
   1.803              if (window->surface) {
   1.804 -                SDL_FreeSurface (window->surface);
   1.805 +                SDL_FreeSurface(window->surface);
   1.806              }
   1.807              if (_this->DestroyWindow) {
   1.808 -                _this->DestroyWindow (_this, window);
   1.809 +                _this->DestroyWindow(_this, window);
   1.810              }
   1.811              if (window->title) {
   1.812 -                SDL_free (window->title);
   1.813 +                SDL_free(window->title);
   1.814              }
   1.815              if (window->gamma) {
   1.816 -                SDL_free (window->gamma);
   1.817 +                SDL_free(window->gamma);
   1.818              }
   1.819              if (j != display->num_windows - 1) {
   1.820 -                SDL_memcpy (&display->windows[i],
   1.821 -                            &display->windows[i + 1],
   1.822 -                            (display->num_windows - i -
   1.823 -                             1) * sizeof (*window));
   1.824 +                SDL_memcpy(&display->windows[i],
   1.825 +                           &display->windows[i + 1],
   1.826 +                           (display->num_windows - i - 1) * sizeof(*window));
   1.827              }
   1.828              --display->num_windows;
   1.829              return;
   1.830 @@ -1015,9 +1014,9 @@
   1.831  }
   1.832  
   1.833  SDL_Surface *
   1.834 -SDL_CreateWindowSurface (SDL_WindowID windowID, Uint32 format, Uint32 flags)
   1.835 +SDL_CreateWindowSurface(SDL_WindowID windowID, Uint32 format, Uint32 flags)
   1.836  {
   1.837 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
   1.838 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
   1.839      Uint32 black;
   1.840      SDL_Surface *surface;
   1.841  
   1.842 @@ -1030,7 +1029,7 @@
   1.843      }
   1.844  
   1.845      if (!window->surface) {
   1.846 -        _this->CreateWindowSurface (_this, window, flags);
   1.847 +        _this->CreateWindowSurface(_this, window, flags);
   1.848          if (!window->surface) {
   1.849              return NULL;
   1.850          }
   1.851 @@ -1039,23 +1038,23 @@
   1.852      surface = window->surface;
   1.853  
   1.854      if (window->shadow) {
   1.855 -        SDL_FreeSurface (window->shadow);
   1.856 +        SDL_FreeSurface(window->shadow);
   1.857          window->shadow = NULL;
   1.858      }
   1.859  
   1.860      /* Create a shadow surface if necessary */
   1.861      if ((!(flags & SDL_ANYFORMAT)
   1.862 -         && (format != SDL_GetCurrentDisplayMode ()->format))
   1.863 +         && (format != SDL_GetCurrentDisplayMode()->format))
   1.864          || ((flags & SDL_HWPALETTE)
   1.865              && !(window->surface->flags & SDL_HWPALETTE))) {
   1.866          int bpp;
   1.867          Uint32 Rmask, Gmask, Bmask, Amask;
   1.868  
   1.869 -        SDL_PixelFormatEnumToMasks (format, &bpp, &Amask, &Gmask, &Bmask,
   1.870 -                                    &Amask);
   1.871 +        SDL_PixelFormatEnumToMasks(format, &bpp, &Amask, &Gmask, &Bmask,
   1.872 +                                   &Amask);
   1.873          window->shadow =
   1.874 -            SDL_CreateRGBSurface (SDL_SWSURFACE, surface->w, surface->h, bpp,
   1.875 -                                  Rmask, Gmask, Bmask, Amask);
   1.876 +            SDL_CreateRGBSurface(SDL_SWSURFACE, surface->w, surface->h, bpp,
   1.877 +                                 Rmask, Gmask, Bmask, Amask);
   1.878          if (window->shadow == NULL) {
   1.879              return NULL;
   1.880          }
   1.881 @@ -1065,26 +1064,26 @@
   1.882          /* 8-bit shadow surfaces report that they have exclusive palette */
   1.883          if (surface->format->palette) {
   1.884              surface->flags |= SDL_HWPALETTE;
   1.885 -            if (format == SDL_GetCurrentDisplayMode ()->format) {
   1.886 -                SDL_memcpy (surface->format->palette->colors,
   1.887 -                            window->surface->format->palette->colors,
   1.888 -                            window->surface->format->palette->ncolors *
   1.889 -                            sizeof (SDL_Color));
   1.890 +            if (format == SDL_GetCurrentDisplayMode()->format) {
   1.891 +                SDL_memcpy(surface->format->palette->colors,
   1.892 +                           window->surface->format->palette->colors,
   1.893 +                           window->surface->format->palette->ncolors *
   1.894 +                           sizeof(SDL_Color));
   1.895              } else {
   1.896 -                SDL_DitherColors (surface->format->palette->colors, bpp);
   1.897 +                SDL_DitherColors(surface->format->palette->colors, bpp);
   1.898              }
   1.899          }
   1.900      }
   1.901  
   1.902      /* Clear the surface for display */
   1.903      {
   1.904 -        Uint32 black = SDL_MapRGB (surface->format, 0, 0, 0);
   1.905 -        SDL_FillRect (surface, NULL, black);
   1.906 +        Uint32 black = SDL_MapRGB(surface->format, 0, 0, 0);
   1.907 +        SDL_FillRect(surface, NULL, black);
   1.908          if (surface->flags & SDL_DOUBLEBUF) {
   1.909 -            SDL_Flip (surface);
   1.910 -            SDL_FillRect (surface, NULL, black);
   1.911 +            SDL_Flip(surface);
   1.912 +            SDL_FillRect(surface, NULL, black);
   1.913          }
   1.914 -        SDL_Flip (surface);
   1.915 +        SDL_Flip(surface);
   1.916      }
   1.917  
   1.918      return surface;
   1.919 @@ -1094,12 +1093,12 @@
   1.920   * Convert a surface into the video pixel format.
   1.921   */
   1.922  SDL_Surface *
   1.923 -SDL_DisplayFormat (SDL_Surface * surface)
   1.924 +SDL_DisplayFormat(SDL_Surface * surface)
   1.925  {
   1.926      Uint32 flags;
   1.927  
   1.928      if (!SDL_PublicSurface) {
   1.929 -        SDL_SetError ("No video mode has been set");
   1.930 +        SDL_SetError("No video mode has been set");
   1.931          return (NULL);
   1.932      }
   1.933      /* Set the flags appropriate for copying to display surface */
   1.934 @@ -1115,7 +1114,7 @@
   1.935      flags |=
   1.936          surface->flags & (SDL_SRCCOLORKEY | SDL_SRCALPHA | SDL_RLEACCELOK);
   1.937  #endif
   1.938 -    return (SDL_ConvertSurface (surface, SDL_PublicSurface->format, flags));
   1.939 +    return (SDL_ConvertSurface(surface, SDL_PublicSurface->format, flags));
   1.940  }
   1.941  
   1.942  /*
   1.943 @@ -1123,7 +1122,7 @@
   1.944   * the screen, but including an alpha channel.
   1.945   */
   1.946  SDL_Surface *
   1.947 -SDL_DisplayFormatAlpha (SDL_Surface * surface)
   1.948 +SDL_DisplayFormatAlpha(SDL_Surface * surface)
   1.949  {
   1.950      SDL_PixelFormat *vf;
   1.951      SDL_PixelFormat *format;
   1.952 @@ -1136,7 +1135,7 @@
   1.953      Uint32 bmask = 0x000000ff;
   1.954  
   1.955      if (!SDL_PublicSurface) {
   1.956 -        SDL_SetError ("No video mode has been set");
   1.957 +        SDL_SetError("No video mode has been set");
   1.958          return (NULL);
   1.959      }
   1.960      vf = SDL_PublicSurface->format;
   1.961 @@ -1168,11 +1167,11 @@
   1.962             optimised alpha format is written, add the converter here */
   1.963          break;
   1.964      }
   1.965 -    format = SDL_AllocFormat (32, rmask, gmask, bmask, amask);
   1.966 +    format = SDL_AllocFormat(32, rmask, gmask, bmask, amask);
   1.967      flags = SDL_PublicSurface->flags & SDL_HWSURFACE;
   1.968      flags |= surface->flags & (SDL_SRCALPHA | SDL_RLEACCELOK);
   1.969 -    converted = SDL_ConvertSurface (surface, format, flags);
   1.970 -    SDL_FreeFormat (format);
   1.971 +    converted = SDL_ConvertSurface(surface, format, flags);
   1.972 +    SDL_FreeFormat(format);
   1.973      return (converted);
   1.974  }
   1.975  
   1.976 @@ -1180,7 +1179,7 @@
   1.977   * Update a specific portion of the physical screen
   1.978   */
   1.979  void
   1.980 -SDL_UpdateRect (SDL_Surface * screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h)
   1.981 +SDL_UpdateRect(SDL_Surface * screen, Sint32 x, Sint32 y, Uint32 w, Uint32 h)
   1.982  {
   1.983      if (screen) {
   1.984          SDL_Rect rect;
   1.985 @@ -1200,34 +1199,34 @@
   1.986          rect.y = (Sint16) y;
   1.987          rect.w = (Uint16) w;
   1.988          rect.h = (Uint16) h;
   1.989 -        SDL_UpdateRects (screen, 1, &rect);
   1.990 +        SDL_UpdateRects(screen, 1, &rect);
   1.991      }
   1.992  }
   1.993  void
   1.994 -SDL_UpdateRects (SDL_Surface * screen, int numrects, SDL_Rect * rects)
   1.995 +SDL_UpdateRects(SDL_Surface * screen, int numrects, SDL_Rect * rects)
   1.996  {
   1.997      int i;
   1.998      SDL_Window *window;
   1.999  
  1.1000      /* Find the window corresponding to this surface */
  1.1001 -    window = SDL_GetWindowFromSurface (screen);
  1.1002 +    window = SDL_GetWindowFromSurface(screen);
  1.1003      if (!window) {
  1.1004 -        SDL_SetError ("Couldn't find window associated with surface");
  1.1005 +        SDL_SetError("Couldn't find window associated with surface");
  1.1006          return;
  1.1007      }
  1.1008  
  1.1009      if (screen->flags & SDL_SHADOW_SURFACE) {
  1.1010 -        if (SHOULD_DRAWCURSOR (SDL_cursorstate)) {
  1.1011 -            SDL_LockCursor ();
  1.1012 -            SDL_DrawCursor (screen);
  1.1013 +        if (SHOULD_DRAWCURSOR(SDL_cursorstate)) {
  1.1014 +            SDL_LockCursor();
  1.1015 +            SDL_DrawCursor(screen);
  1.1016              for (i = 0; i < numrects; ++i) {
  1.1017 -                SDL_LowerBlit (screen, &rects[i], window->surface, &rects[i]);
  1.1018 +                SDL_LowerBlit(screen, &rects[i], window->surface, &rects[i]);
  1.1019              }
  1.1020 -            SDL_EraseCursor (screen);
  1.1021 -            SDL_UnlockCursor ();
  1.1022 +            SDL_EraseCursor(screen);
  1.1023 +            SDL_UnlockCursor();
  1.1024          } else {
  1.1025              for (i = 0; i < numrects; ++i) {
  1.1026 -                SDL_LowerBlit (screen, &rects[i], window->surface, &rects[i]);
  1.1027 +                SDL_LowerBlit(screen, &rects[i], window->surface, &rects[i]);
  1.1028              }
  1.1029          }
  1.1030  
  1.1031 @@ -1243,13 +1242,13 @@
  1.1032                  rects[i].x += offset_x;
  1.1033                  rects[i].y += offset_y;
  1.1034              }
  1.1035 -            _this->UpdateWindowSurface (_this, window, numrects, rects);
  1.1036 +            _this->UpdateWindowSurface(_this, window, numrects, rects);
  1.1037              for (i = 0; i < numrects; ++i) {
  1.1038                  rects[i].x -= offset_x;
  1.1039                  rects[i].y -= offset_y;
  1.1040              }
  1.1041          } else {
  1.1042 -            _this->UpdateWindowSurface (_this, window, numrects, rects);
  1.1043 +            _this->UpdateWindowSurface(_this, window, numrects, rects);
  1.1044          }
  1.1045      }
  1.1046  }
  1.1047 @@ -1258,14 +1257,14 @@
  1.1048   * Performs hardware double buffering, if possible, or a full update if not.
  1.1049   */
  1.1050  int
  1.1051 -SDL_Flip (SDL_Surface * screen)
  1.1052 +SDL_Flip(SDL_Surface * screen)
  1.1053  {
  1.1054      SDL_Window *window;
  1.1055  
  1.1056      /* Find the window corresponding to this surface */
  1.1057 -    window = SDL_GetWindowFromSurface (screen);
  1.1058 +    window = SDL_GetWindowFromSurface(screen);
  1.1059      if (!window) {
  1.1060 -        SDL_SetError ("Couldn't find window associated with surface");
  1.1061 +        SDL_SetError("Couldn't find window associated with surface");
  1.1062          return;
  1.1063      }
  1.1064  
  1.1065 @@ -1277,30 +1276,30 @@
  1.1066          rect.y = 0;
  1.1067          rect.w = screen->w;
  1.1068          rect.h = screen->h;
  1.1069 -        if (SHOULD_DRAWCURSOR (SDL_cursorstate)) {
  1.1070 -            SDL_LockCursor ();
  1.1071 -            SDL_DrawCursor (screen);
  1.1072 -            SDL_LowerBlit (screen, &rect, window->surface, &rect);
  1.1073 -            SDL_EraseCursor (screen);
  1.1074 -            SDL_UnlockCursor ();
  1.1075 +        if (SHOULD_DRAWCURSOR(SDL_cursorstate)) {
  1.1076 +            SDL_LockCursor();
  1.1077 +            SDL_DrawCursor(screen);
  1.1078 +            SDL_LowerBlit(screen, &rect, window->surface, &rect);
  1.1079 +            SDL_EraseCursor(screen);
  1.1080 +            SDL_UnlockCursor();
  1.1081          } else {
  1.1082 -            SDL_LowerBlit (screen, &rect, window->surface, &rect);
  1.1083 +            SDL_LowerBlit(screen, &rect, window->surface, &rect);
  1.1084          }
  1.1085  
  1.1086          /* Fall through to video surface update */
  1.1087          screen = window->surface;
  1.1088      }
  1.1089      if (screen->flags & SDL_DOUBLEBUF) {
  1.1090 -        _this->FlipWindowSurface (_this, window);
  1.1091 +        _this->FlipWindowSurface(_this, window);
  1.1092      } else {
  1.1093 -        SDL_UpdateRect (screen, 0, 0, 0, 0);
  1.1094 +        SDL_UpdateRect(screen, 0, 0, 0, 0);
  1.1095      }
  1.1096      return (0);
  1.1097  }
  1.1098  
  1.1099  int
  1.1100 -SDL_SetColors (SDL_Surface * screen, SDL_Color * colors, int firstcolor,
  1.1101 -               int ncolors)
  1.1102 +SDL_SetColors(SDL_Surface * screen, SDL_Color * colors, int firstcolor,
  1.1103 +              int ncolors)
  1.1104  {
  1.1105      SDL_Window *window = NULL;
  1.1106      SDL_Palette *pal;
  1.1107 @@ -1320,13 +1319,13 @@
  1.1108      }
  1.1109  
  1.1110      if (colors != (pal->colors + firstcolor)) {
  1.1111 -        SDL_memcpy (pal->colors + firstcolor, colors,
  1.1112 -                    ncolors * sizeof (*colors));
  1.1113 +        SDL_memcpy(pal->colors + firstcolor, colors,
  1.1114 +                   ncolors * sizeof(*colors));
  1.1115      }
  1.1116 -    SDL_FormatChanged (screen);
  1.1117 +    SDL_FormatChanged(screen);
  1.1118  
  1.1119      if (screen->flags & (SDL_SHADOW_SURFACE | SDL_SCREEN_SURFACE)) {
  1.1120 -        window = SDL_GetWindowFromSurface (screen);
  1.1121 +        window = SDL_GetWindowFromSurface(screen);
  1.1122          if (!window) {
  1.1123              return 0;
  1.1124          }
  1.1125 @@ -1342,22 +1341,22 @@
  1.1126               * changes to its logical palette so that
  1.1127               * updates are always identity blits
  1.1128               */
  1.1129 -            SDL_memcpy (vidpal->colors + firstcolor, colors,
  1.1130 -                        ncolors * sizeof (*colors));
  1.1131 +            SDL_memcpy(vidpal->colors + firstcolor, colors,
  1.1132 +                       ncolors * sizeof(*colors));
  1.1133          }
  1.1134          if (window->surface->flags & SDL_HWPALETTE) {
  1.1135              /* Set the physical palette */
  1.1136              screen = window->surface;
  1.1137          } else {
  1.1138 -            SDL_UpdateRect (screen, 0, 0, 0, 0);
  1.1139 +            SDL_UpdateRect(screen, 0, 0, 0, 0);
  1.1140          }
  1.1141      }
  1.1142  
  1.1143      if (screen->flags & SDL_SCREEN_SURFACE) {
  1.1144          if (_this->SetWindowColors) {
  1.1145              gotall =
  1.1146 -                _this->SetWindowColors (_this, window, firstcolor, ncolors,
  1.1147 -                                        colors);
  1.1148 +                _this->SetWindowColors(_this, window, firstcolor, ncolors,
  1.1149 +                                       colors);
  1.1150              if (!gotall) {
  1.1151                  /* The video flags shouldn't have SDL_HWPALETTE, and
  1.1152                     the video driver is responsible for copying back the
  1.1153 @@ -1366,14 +1365,14 @@
  1.1154                  ;
  1.1155              }
  1.1156          }
  1.1157 -        SDL_CursorPaletteChanged ();
  1.1158 +        SDL_CursorPaletteChanged();
  1.1159      }
  1.1160  
  1.1161      return gotall;
  1.1162  }
  1.1163  
  1.1164  void
  1.1165 -SDL_VideoQuit (void)
  1.1166 +SDL_VideoQuit(void)
  1.1167  {
  1.1168      int i, j;
  1.1169  
  1.1170 @@ -1382,70 +1381,70 @@
  1.1171      }
  1.1172  
  1.1173      /* Halt event processing before doing anything else */
  1.1174 -    SDL_StopEventLoop ();
  1.1175 +    SDL_StopEventLoop();
  1.1176  
  1.1177      /* Clean up allocated window manager items */
  1.1178 -    SDL_CursorQuit ();
  1.1179 +    SDL_CursorQuit();
  1.1180  
  1.1181      /* Clean up the system video */
  1.1182      for (i = _this->num_displays; i--;) {
  1.1183          SDL_VideoDisplay *display = &_this->displays[i];
  1.1184          for (j = display->num_windows; j--;) {
  1.1185 -            SDL_DestroyWindow (display->windows[i].id);
  1.1186 +            SDL_DestroyWindow(display->windows[i].id);
  1.1187          }
  1.1188          if (display->windows) {
  1.1189 -            SDL_free (display->windows);
  1.1190 +            SDL_free(display->windows);
  1.1191              display->windows = NULL;
  1.1192          }
  1.1193      }
  1.1194 -    _this->VideoQuit (_this);
  1.1195 +    _this->VideoQuit(_this);
  1.1196      if (_this->displays) {
  1.1197 -        SDL_free (_this->displays);
  1.1198 +        SDL_free(_this->displays);
  1.1199      }
  1.1200 -    _this->free (_this);
  1.1201 +    _this->free(_this);
  1.1202      _this = NULL;
  1.1203  }
  1.1204  
  1.1205  /* Load the GL driver library */
  1.1206  int
  1.1207 -SDL_GL_LoadLibrary (const char *path)
  1.1208 +SDL_GL_LoadLibrary(const char *path)
  1.1209  {
  1.1210      int retval;
  1.1211  
  1.1212      retval = -1;
  1.1213      if (_this == NULL) {
  1.1214 -        SDL_SetError ("Video subsystem has not been initialized");
  1.1215 +        SDL_SetError("Video subsystem has not been initialized");
  1.1216      } else {
  1.1217          if (_this->GL_LoadLibrary) {
  1.1218 -            retval = _this->GL_LoadLibrary (_this, path);
  1.1219 +            retval = _this->GL_LoadLibrary(_this, path);
  1.1220          } else {
  1.1221 -            SDL_SetError ("No dynamic GL support in video driver");
  1.1222 +            SDL_SetError("No dynamic GL support in video driver");
  1.1223          }
  1.1224      }
  1.1225      return (retval);
  1.1226  }
  1.1227  
  1.1228  void *
  1.1229 -SDL_GL_GetProcAddress (const char *proc)
  1.1230 +SDL_GL_GetProcAddress(const char *proc)
  1.1231  {
  1.1232      void *func;
  1.1233  
  1.1234      func = NULL;
  1.1235      if (_this->GL_GetProcAddress) {
  1.1236          if (_this->gl_config.driver_loaded) {
  1.1237 -            func = _this->GL_GetProcAddress (_this, proc);
  1.1238 +            func = _this->GL_GetProcAddress(_this, proc);
  1.1239          } else {
  1.1240 -            SDL_SetError ("No GL driver has been loaded");
  1.1241 +            SDL_SetError("No GL driver has been loaded");
  1.1242          }
  1.1243      } else {
  1.1244 -        SDL_SetError ("No dynamic GL support in video driver");
  1.1245 +        SDL_SetError("No dynamic GL support in video driver");
  1.1246      }
  1.1247      return func;
  1.1248  }
  1.1249  
  1.1250  /* Set the specified GL attribute for setting up a GL video mode */
  1.1251  int
  1.1252 -SDL_GL_SetAttribute (SDL_GLattr attr, int value)
  1.1253 +SDL_GL_SetAttribute(SDL_GLattr attr, int value)
  1.1254  {
  1.1255      int retval;
  1.1256  
  1.1257 @@ -1503,7 +1502,7 @@
  1.1258          _this->gl_config.swap_control = value;
  1.1259          break;
  1.1260      default:
  1.1261 -        SDL_SetError ("Unknown OpenGL attribute");
  1.1262 +        SDL_SetError("Unknown OpenGL attribute");
  1.1263          retval = -1;
  1.1264          break;
  1.1265      }
  1.1266 @@ -1512,27 +1511,27 @@
  1.1267  
  1.1268  /* Retrieve an attribute value from the windowing system. */
  1.1269  int
  1.1270 -SDL_GL_GetAttribute (SDL_GLattr attr, int *value)
  1.1271 +SDL_GL_GetAttribute(SDL_GLattr attr, int *value)
  1.1272  {
  1.1273      int retval = -1;
  1.1274  
  1.1275      if (_this->GL_GetAttribute) {
  1.1276 -        retval = _this->GL_GetAttribute (_this, attr, value);
  1.1277 +        retval = _this->GL_GetAttribute(_this, attr, value);
  1.1278      } else {
  1.1279          *value = 0;
  1.1280 -        SDL_SetError ("GL_GetAttribute not supported");
  1.1281 +        SDL_SetError("GL_GetAttribute not supported");
  1.1282      }
  1.1283      return retval;
  1.1284  }
  1.1285  
  1.1286  /* Perform a GL buffer swap on the current GL context */
  1.1287  void
  1.1288 -SDL_GL_SwapBuffers (void)
  1.1289 +SDL_GL_SwapBuffers(void)
  1.1290  {
  1.1291      if (SDL_VideoSurface->flags & SDL_INTERNALOPENGL) {
  1.1292 -        _this->GL_SwapBuffers (_this);
  1.1293 +        _this->GL_SwapBuffers(_this);
  1.1294      } else {
  1.1295 -        SDL_SetError ("OpenGL video mode has not been set");
  1.1296 +        SDL_SetError("OpenGL video mode has not been set");
  1.1297      }
  1.1298  }
  1.1299  
  1.1300 @@ -1540,7 +1539,7 @@
  1.1301  /* Utility function used by SDL_WM_SetIcon();
  1.1302   * flags & 1 for color key, flags & 2 for alpha channel. */
  1.1303  static void
  1.1304 -CreateMaskFromColorKeyOrAlpha (SDL_Surface * icon, Uint8 * mask, int flags)
  1.1305 +CreateMaskFromColorKeyOrAlpha(SDL_Surface * icon, Uint8 * mask, int flags)
  1.1306  {
  1.1307      int x, y;
  1.1308      Uint32 colorkey;
  1.1309 @@ -1556,7 +1555,7 @@
  1.1310                  pixels = (Uint8 *) icon->pixels + y * icon->pitch;
  1.1311                  for (x = 0; x < icon->w; ++x) {
  1.1312                      if (*pixels++ == colorkey) {
  1.1313 -                        SET_MASKBIT (icon, x, y, mask);
  1.1314 +                        SET_MASKBIT(icon, x, y, mask);
  1.1315                      }
  1.1316                  }
  1.1317              }
  1.1318 @@ -1570,10 +1569,10 @@
  1.1319                  pixels = (Uint16 *) icon->pixels + y * icon->pitch / 2;
  1.1320                  for (x = 0; x < icon->w; ++x) {
  1.1321                      if ((flags & 1) && *pixels == colorkey) {
  1.1322 -                        SET_MASKBIT (icon, x, y, mask);
  1.1323 +                        SET_MASKBIT(icon, x, y, mask);
  1.1324                      } else if ((flags & 2)
  1.1325                                 && (*pixels & icon->format->Amask) == 0) {
  1.1326 -                        SET_MASKBIT (icon, x, y, mask);
  1.1327 +                        SET_MASKBIT(icon, x, y, mask);
  1.1328                      }
  1.1329                      pixels++;
  1.1330                  }
  1.1331 @@ -1588,10 +1587,10 @@
  1.1332                  pixels = (Uint32 *) icon->pixels + y * icon->pitch / 4;
  1.1333                  for (x = 0; x < icon->w; ++x) {
  1.1334                      if ((flags & 1) && *pixels == colorkey) {
  1.1335 -                        SET_MASKBIT (icon, x, y, mask);
  1.1336 +                        SET_MASKBIT(icon, x, y, mask);
  1.1337                      } else if ((flags & 2)
  1.1338                                 && (*pixels & icon->format->Amask) == 0) {
  1.1339 -                        SET_MASKBIT (icon, x, y, mask);
  1.1340 +                        SET_MASKBIT(icon, x, y, mask);
  1.1341                      }
  1.1342                      pixels++;
  1.1343                  }
  1.1344 @@ -1605,43 +1604,43 @@
  1.1345   * Sets the window manager icon for the display window.
  1.1346   */
  1.1347  void
  1.1348 -SDL_WM_SetIcon (SDL_Surface * icon, Uint8 * mask)
  1.1349 +SDL_WM_SetIcon(SDL_Surface * icon, Uint8 * mask)
  1.1350  {
  1.1351      if (icon && _this->SetIcon) {
  1.1352          /* Generate a mask if necessary, and create the icon! */
  1.1353          if (mask == NULL) {
  1.1354              int mask_len = icon->h * (icon->w + 7) / 8;
  1.1355              int flags = 0;
  1.1356 -            mask = (Uint8 *) SDL_malloc (mask_len);
  1.1357 +            mask = (Uint8 *) SDL_malloc(mask_len);
  1.1358              if (mask == NULL) {
  1.1359                  return;
  1.1360              }
  1.1361 -            SDL_memset (mask, ~0, mask_len);
  1.1362 +            SDL_memset(mask, ~0, mask_len);
  1.1363              if (icon->flags & SDL_SRCCOLORKEY)
  1.1364                  flags |= 1;
  1.1365              if (icon->flags & SDL_SRCALPHA)
  1.1366                  flags |= 2;
  1.1367              if (flags) {
  1.1368 -                CreateMaskFromColorKeyOrAlpha (icon, mask, flags);
  1.1369 +                CreateMaskFromColorKeyOrAlpha(icon, mask, flags);
  1.1370              }
  1.1371 -            _this->SetIcon (_this, icon, mask);
  1.1372 -            SDL_free (mask);
  1.1373 +            _this->SetIcon(_this, icon, mask);
  1.1374 +            SDL_free(mask);
  1.1375          } else {
  1.1376 -            _this->SetIcon (_this, icon, mask);
  1.1377 +            _this->SetIcon(_this, icon, mask);
  1.1378          }
  1.1379      }
  1.1380  }
  1.1381  #endif
  1.1382  
  1.1383  SDL_bool
  1.1384 -SDL_GetWindowWMInfo (SDL_WindowID windowID, SDL_SysWMinfo * info)
  1.1385 +SDL_GetWindowWMInfo(SDL_WindowID windowID, SDL_SysWMinfo * info)
  1.1386  {
  1.1387 -    SDL_Window *window = SDL_GetWindowFromID (windowID);
  1.1388 +    SDL_Window *window = SDL_GetWindowFromID(windowID);
  1.1389  
  1.1390      if (!window || !_this->GetWindowWMInfo) {
  1.1391          return SDL_FALSE;
  1.1392      }
  1.1393 -    return (_this->GetWindowWMInfo (_this, window, info));
  1.1394 +    return (_this->GetWindowWMInfo(_this, window, info));
  1.1395  }
  1.1396  
  1.1397  /* vi: set ts=4 sw=4 expandtab: */