src/video/directfb/SDL_DirectFB_window.c
changeset 5246 58265e606e4e
parent 5199 164f20ba08eb
child 5262 b530ef003506
     1.1 --- a/src/video/directfb/SDL_DirectFB_window.c	Thu Feb 10 14:36:09 2011 -0800
     1.2 +++ b/src/video/directfb/SDL_DirectFB_window.c	Thu Feb 10 14:44:25 2011 -0800
     1.3 @@ -62,17 +62,17 @@
     1.4  		bshaped = 1;
     1.5  	
     1.6      /* Fill the window description. */
     1.7 -    if (window->x == SDL_WINDOWPOS_CENTERED) {
     1.8 +    if (SDL_WINDOWPOS_ISCENTERED(window->x)) {
     1.9          x = (dispdata->cw - window->w) / 2;
    1.10 -    } else if (window->x == SDL_WINDOWPOS_UNDEFINED) {
    1.11 +    } else if (SDL_WINDOWPOS_ISUNDEFINED(window->x)) {
    1.12          x = 0;
    1.13      } else {
    1.14          x = window->x;
    1.15      }
    1.16      
    1.17 -    if (window->y == SDL_WINDOWPOS_CENTERED) {
    1.18 +    if (SDL_WINDOWPOS_ISCENTERED(window->y)) {
    1.19          y = (dispdata->ch - window->h) / 2;
    1.20 -    } else if (window->y == SDL_WINDOWPOS_UNDEFINED) {
    1.21 +    } else if (SDL_WINDOWPOS_ISUNDEFINED(window->y)) {
    1.22          y = 0;
    1.23      } else {
    1.24          y = window->y;
    1.25 @@ -264,17 +264,17 @@
    1.26      SDL_DFB_DISPLAYDATA(window);
    1.27      int x, y;
    1.28  
    1.29 -    if (window->x == SDL_WINDOWPOS_CENTERED) {
    1.30 +    if (SDL_WINDOWPOS_ISCENTERED(window->x)) {
    1.31          x = (dispdata->cw - window->w) / 2;
    1.32 -    } else if (window->x == SDL_WINDOWPOS_UNDEFINED) {
    1.33 +    } else if (SDL_WINDOWPOS_ISUNDEFINED(window->x)) {
    1.34          x = 0;
    1.35      } else {
    1.36          x = window->x;
    1.37      }
    1.38      
    1.39 -    if (window->y == SDL_WINDOWPOS_CENTERED) {
    1.40 +    if (SDL_WINDOWPOS_ISCENTERED(window->y)) {
    1.41          y = (dispdata->ch - window->h) / 2;
    1.42 -    } else if (window->y == SDL_WINDOWPOS_UNDEFINED) {
    1.43 +    } else if (SDL_WINDOWPOS_ISUNDEFINED(window->y)) {
    1.44          y = 0;
    1.45      } else {
    1.46          y = window->y;
    1.47 @@ -358,7 +358,7 @@
    1.48  DirectFB_MaximizeWindow(_THIS, SDL_Window * window)
    1.49  {
    1.50      SDL_DFB_WINDOWDATA(window);
    1.51 -    SDL_VideoDisplay *display = window->display;
    1.52 +    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
    1.53      DFBWindowOptions wopts;
    1.54  
    1.55      SDL_DFB_CHECK(windata->dfbwin->GetPosition(windata->dfbwin,
    1.56 @@ -526,7 +526,7 @@
    1.57  
    1.58      if (adjust) {
    1.59  #if SDL_DIRECTFB_OPENGL
    1.60 -		DirectFB_GL_FreeWindowContexts(window->display->device, window);
    1.61 +		DirectFB_GL_FreeWindowContexts(SDL_GetVideoDevice(), window);
    1.62  #endif
    1.63  
    1.64  #if (DFB_VERSION_ATLEAST(1,2,1))
    1.65 @@ -552,10 +552,10 @@
    1.66                           GetSubSurface(windata->window_surface,
    1.67                                         &windata->client, &windata->surface));
    1.68  #endif
    1.69 -        DirectFB_WM_RedrawLayout(window->display->device, window);
    1.70 +        DirectFB_WM_RedrawLayout(SDL_GetVideoDevice(), window);
    1.71          
    1.72  #if SDL_DIRECTFB_OPENGL
    1.73 -		DirectFB_GL_ReAllocWindowContexts(window->display->device, window);
    1.74 +		DirectFB_GL_ReAllocWindowContexts(SDL_GetVideoDevice(), window);
    1.75  #endif
    1.76     }
    1.77    error: