src/video/directfb/SDL_DirectFB_render.c
changeset 3011 8f4ed5ec2b06
parent 2930 8acbb14124c5
child 3013 8cc00819c8d6
     1.1 --- a/src/video/directfb/SDL_DirectFB_render.c	Fri Jan 09 20:41:31 2009 +0000
     1.2 +++ b/src/video/directfb/SDL_DirectFB_render.c	Fri Jan 09 20:43:30 2009 +0000
     1.3 @@ -418,12 +418,12 @@
     1.4          int cw, ch;
     1.5          int ret;
     1.6  
     1.7 -        SDL_DFB_CHECKERR(windata->surface->
     1.8 -                         GetSize(windata->surface, &cw, &ch));
     1.9 +        SDL_DFB_CHECKERR(windata->
    1.10 +                         surface->GetSize(windata->surface, &cw, &ch));
    1.11          if (cw != window->w || ch != window->h)
    1.12 -            SDL_DFB_CHECKERR(windata->window->
    1.13 -                             ResizeSurface(windata->window, window->w,
    1.14 -                                           window->h));
    1.15 +            SDL_DFB_CHECKERR(windata->
    1.16 +                             window->ResizeSurface(windata->window, window->w,
    1.17 +                                                   window->h));
    1.18      }
    1.19      return 0;
    1.20    error:
    1.21 @@ -462,22 +462,24 @@
    1.22          layconf.pixelformat = SDLToDFBPixelFormat(data->format);
    1.23          layconf.surface_caps = DSCAPS_VIDEOONLY | DSCAPS_DOUBLE;
    1.24  
    1.25 -        SDL_DFB_CHECKERR(devdata->dfb->
    1.26 -                         GetDisplayLayer(devdata->dfb, dispdata->vidID,
    1.27 -                                         &dispdata->vidlayer));
    1.28 -        SDL_DFB_CHECKERR(dispdata->vidlayer->
    1.29 -                         SetCooperativeLevel(dispdata->vidlayer,
    1.30 -                                             DLSCL_EXCLUSIVE));
    1.31 +        SDL_DFB_CHECKERR(devdata->
    1.32 +                         dfb->GetDisplayLayer(devdata->dfb, dispdata->vidID,
    1.33 +                                              &dispdata->vidlayer));
    1.34 +        SDL_DFB_CHECKERR(dispdata->
    1.35 +                         vidlayer->SetCooperativeLevel(dispdata->vidlayer,
    1.36 +                                                       DLSCL_EXCLUSIVE));
    1.37  
    1.38          if (devdata->use_yuv_underlays) {
    1.39              ret = dispdata->vidlayer->SetLevel(dispdata->vidlayer, -1);
    1.40              if (ret != DFB_OK)
    1.41                  SDL_DFB_DEBUG("Underlay Setlevel not supported\n");
    1.42          }
    1.43 -        SDL_DFB_CHECKERR(dispdata->vidlayer->
    1.44 -                         SetConfiguration(dispdata->vidlayer, &layconf));
    1.45 -        SDL_DFB_CHECKERR(dispdata->vidlayer->
    1.46 -                         GetSurface(dispdata->vidlayer, &data->surface));
    1.47 +        SDL_DFB_CHECKERR(dispdata->
    1.48 +                         vidlayer->SetConfiguration(dispdata->vidlayer,
    1.49 +                                                    &layconf));
    1.50 +        SDL_DFB_CHECKERR(dispdata->
    1.51 +                         vidlayer->GetSurface(dispdata->vidlayer,
    1.52 +                                              &data->surface));
    1.53          dispdata->vidIDinuse = 1;
    1.54          data->display = display;
    1.55          return 0;
    1.56 @@ -486,9 +488,9 @@
    1.57    error:
    1.58      if (dispdata->vidlayer) {
    1.59          SDL_DFB_RELEASE(data->surface);
    1.60 -        SDL_DFB_CHECKERR(dispdata->vidlayer->
    1.61 -                         SetCooperativeLevel(dispdata->vidlayer,
    1.62 -                                             DLSCL_ADMINISTRATIVE));
    1.63 +        SDL_DFB_CHECKERR(dispdata->
    1.64 +                         vidlayer->SetCooperativeLevel(dispdata->vidlayer,
    1.65 +                                                       DLSCL_ADMINISTRATIVE));
    1.66          SDL_DFB_RELEASE(dispdata->vidlayer);
    1.67      }
    1.68      return 1;
    1.69 @@ -540,12 +542,14 @@
    1.70          data->pixels = NULL;
    1.71  
    1.72          /* Create the surface */
    1.73 -        SDL_DFB_CHECKERR(devdata->dfb->
    1.74 -                         CreateSurface(devdata->dfb, &dsc, &data->surface));
    1.75 +        SDL_DFB_CHECKERR(devdata->
    1.76 +                         dfb->CreateSurface(devdata->dfb, &dsc,
    1.77 +                                            &data->surface));
    1.78          if (SDL_ISPIXELFORMAT_INDEXED(data->format)
    1.79              && !SDL_ISPIXELFORMAT_FOURCC(data->format)) {
    1.80 -            SDL_DFB_CHECKERR(data->surface->
    1.81 -                             GetPalette(data->surface, &data->palette));
    1.82 +            SDL_DFB_CHECKERR(data->
    1.83 +                             surface->GetPalette(data->surface,
    1.84 +                                                 &data->palette));
    1.85          }
    1.86  
    1.87      }
    1.88 @@ -602,9 +606,9 @@
    1.89              entries[i].b = colors[i].b;
    1.90              entries[i].a = 0xFF;
    1.91          }
    1.92 -        SDL_DFB_CHECKERR(data->palette->
    1.93 -                         SetEntries(data->palette, entries, ncolors,
    1.94 -                                    firstcolor));
    1.95 +        SDL_DFB_CHECKERR(data->
    1.96 +                         palette->SetEntries(data->palette, entries, ncolors,
    1.97 +                                             firstcolor));
    1.98          return 0;
    1.99      } else {
   1.100          SDL_SetError("YUV textures don't have a palette");
   1.101 @@ -626,9 +630,9 @@
   1.102          DFBColor entries[256];
   1.103          int i;
   1.104  
   1.105 -        SDL_DFB_CHECKERR(data->palette->
   1.106 -                         GetEntries(data->palette, entries, ncolors,
   1.107 -                                    firstcolor));
   1.108 +        SDL_DFB_CHECKERR(data->
   1.109 +                         palette->GetEntries(data->palette, entries, ncolors,
   1.110 +                                             firstcolor));
   1.111  
   1.112          for (i = 0; i < ncolors; ++i) {
   1.113              colors[i].r = entries[i].r;
   1.114 @@ -807,8 +811,9 @@
   1.115      a = renderer->a;
   1.116  
   1.117      SetBlendMode(data, renderer->blendMode, NULL);
   1.118 -    SDL_DFB_CHECKERR(data->surface->
   1.119 -                     SetDrawingFlags(data->surface, data->drawFlags));
   1.120 +    SDL_DFB_CHECKERR(data->
   1.121 +                     surface->SetDrawingFlags(data->surface,
   1.122 +                                              data->drawFlags));
   1.123  
   1.124      switch (renderer->blendMode) {
   1.125      case SDL_BLENDMODE_NONE:
   1.126 @@ -868,9 +873,9 @@
   1.127      DFBResult ret;
   1.128  
   1.129      PrepareDraw(renderer);
   1.130 -    SDL_DFB_CHECKERR(data->surface->
   1.131 -                     FillRectangle(data->surface, rect->x, rect->y, rect->w,
   1.132 -                                   rect->h));
   1.133 +    SDL_DFB_CHECKERR(data->
   1.134 +                     surface->FillRectangle(data->surface, rect->x, rect->y,
   1.135 +                                            rect->w, rect->h));
   1.136  
   1.137      return 0;
   1.138    error:
   1.139 @@ -894,15 +899,18 @@
   1.140          SDL_VideoDisplay *display = texturedata->display;
   1.141          DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
   1.142  
   1.143 -        SDL_DFB_CHECKERR(dispdata->vidlayer->
   1.144 -                         SetSourceRectangle(dispdata->vidlayer, srcrect->x,
   1.145 -                                            srcrect->y, srcrect->w,
   1.146 -                                            srcrect->h));
   1.147 +        SDL_DFB_CHECKERR(dispdata->
   1.148 +                         vidlayer->SetSourceRectangle(dispdata->vidlayer,
   1.149 +                                                      srcrect->x, srcrect->y,
   1.150 +                                                      srcrect->w,
   1.151 +                                                      srcrect->h));
   1.152          windata->window->GetPosition(windata->window, &px, &py);
   1.153 -        SDL_DFB_CHECKERR(dispdata->vidlayer->
   1.154 -                         SetScreenRectangle(dispdata->vidlayer,
   1.155 -                                            px + dstrect->x, py + dstrect->y,
   1.156 -                                            dstrect->w, dstrect->h));
   1.157 +        SDL_DFB_CHECKERR(dispdata->
   1.158 +                         vidlayer->SetScreenRectangle(dispdata->vidlayer,
   1.159 +                                                      px + dstrect->x,
   1.160 +                                                      py + dstrect->y,
   1.161 +                                                      dstrect->w,
   1.162 +                                                      dstrect->h));
   1.163      } else {
   1.164          DFBRectangle sr, dr;
   1.165          DFBSurfaceBlittingFlags flags = 0;
   1.166 @@ -930,9 +938,8 @@
   1.167  
   1.168          SDL_DFB_CHECKERR(data->surface->SetColor(data->surface, 0xFF,
   1.169                                                   0xFF, 0xFF, 0xFF));
   1.170 -        if (texture->
   1.171 -            modMode & (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA))
   1.172 -        {
   1.173 +        if (texture->modMode &
   1.174 +            (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA)) {
   1.175              if (texture->modMode & SDL_TEXTUREMODULATE_ALPHA) {
   1.176                  alpha = texture->a;
   1.177                  SDL_DFB_CHECKERR(data->surface->SetColor(data->surface, 0xFF,
   1.178 @@ -940,9 +947,10 @@
   1.179              }
   1.180              if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) {
   1.181  
   1.182 -                SDL_DFB_CHECKERR(data->surface->
   1.183 -                                 SetColor(data->surface, texture->r,
   1.184 -                                          texture->g, texture->b, alpha));
   1.185 +                SDL_DFB_CHECKERR(data->
   1.186 +                                 surface->SetColor(data->surface, texture->r,
   1.187 +                                                   texture->g, texture->b,
   1.188 +                                                   alpha));
   1.189                  flags |= DSBLIT_COLORIZE;
   1.190              }
   1.191              if (alpha < 0xFF)
   1.192 @@ -953,24 +961,25 @@
   1.193  
   1.194          SetBlendMode(data, texture->blendMode, texturedata);
   1.195  
   1.196 -        SDL_DFB_CHECKERR(data->surface->
   1.197 -                         SetBlittingFlags(data->surface,
   1.198 -                                          data->blitFlags | flags));
   1.199 +        SDL_DFB_CHECKERR(data->surface->SetBlittingFlags(data->surface,
   1.200 +                                                         data->
   1.201 +                                                         blitFlags | flags));
   1.202  
   1.203  #if (DIRECTFB_MAJOR_VERSION == 1) && (DIRECTFB_MINOR_VERSION >= 2)
   1.204          SDL_DFB_CHECKERR(data->surface->SetRenderOptions(data->surface,
   1.205 -                                                         texturedata->
   1.206 -                                                         render_options));
   1.207 +                                                         texturedata->render_options));
   1.208  #endif
   1.209  
   1.210          if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) {
   1.211 -            SDL_DFB_CHECKERR(data->surface->
   1.212 -                             Blit(data->surface, texturedata->surface,
   1.213 -                                  &sr, dr.x, dr.y));
   1.214 +            SDL_DFB_CHECKERR(data->
   1.215 +                             surface->Blit(data->surface,
   1.216 +                                           texturedata->surface, &sr, dr.x,
   1.217 +                                           dr.y));
   1.218          } else {
   1.219 -            SDL_DFB_CHECKERR(data->surface->
   1.220 -                             StretchBlit(data->surface, texturedata->surface,
   1.221 -                                         &sr, &dr));
   1.222 +            SDL_DFB_CHECKERR(data->
   1.223 +                             surface->StretchBlit(data->surface,
   1.224 +                                                  texturedata->surface, &sr,
   1.225 +                                                  &dr));
   1.226          }
   1.227      }
   1.228      return 0;
   1.229 @@ -993,8 +1002,8 @@
   1.230      sr.h = window->h;
   1.231  
   1.232      /* Send the data to the display */
   1.233 -    SDL_DFB_CHECKERR(data->surface->
   1.234 -                     Flip(data->surface, NULL, data->flipflags));
   1.235 +    SDL_DFB_CHECKERR(data->
   1.236 +                     surface->Flip(data->surface, NULL, data->flipflags));
   1.237  
   1.238      return;
   1.239    error: