comparison src/video/directfb/SDL_DirectFB_modes.c @ 3011:8f4ed5ec2b06

I ran a global "make indent" it modified the following files.
author Bob Pendleton <bob@pendleton.com>
date Fri, 09 Jan 2009 20:43:30 +0000
parents 99210400e8b9
children 8cc00819c8d6
comparison
equal deleted inserted replaced
3010:a6694a812119 3011:8f4ed5ec2b06
202 SDL_DFB_DEVICEDATA(_this); 202 SDL_DFB_DEVICEDATA(_this);
203 DFBDisplayLayerConfig config; 203 DFBDisplayLayerConfig config;
204 DFBDisplayLayerConfigFlags failed; 204 DFBDisplayLayerConfigFlags failed;
205 int ret; 205 int ret;
206 206
207 SDL_DFB_CHECKERR(data->layer-> 207 SDL_DFB_CHECKERR(data->
208 SetCooperativeLevel(data->layer, DLSCL_ADMINISTRATIVE)); 208 layer->SetCooperativeLevel(data->layer,
209 DLSCL_ADMINISTRATIVE));
209 config.width = mode->w; 210 config.width = mode->w;
210 config.height = mode->h; 211 config.height = mode->h;
211 config.pixelformat = SDLToDFBPixelFormat(mode->format); 212 config.pixelformat = SDLToDFBPixelFormat(mode->format);
212 config.flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT; 213 config.flags = DLCONF_WIDTH | DLCONF_HEIGHT | DLCONF_PIXELFORMAT;
213 if (devdata->use_yuv_underlays) { 214 if (devdata->use_yuv_underlays) {
214 config.flags |= DLCONF_OPTIONS; 215 config.flags |= DLCONF_OPTIONS;
215 config.options = DLOP_ALPHACHANNEL; 216 config.options = DLOP_ALPHACHANNEL;
216 } 217 }
217 failed = 0; 218 failed = 0;
218 data->layer->TestConfiguration(data->layer, &config, &failed); 219 data->layer->TestConfiguration(data->layer, &config, &failed);
219 SDL_DFB_CHECKERR(data->layer-> 220 SDL_DFB_CHECKERR(data->
220 SetCooperativeLevel(data->layer, DLSCL_SHARED)); 221 layer->SetCooperativeLevel(data->layer, DLSCL_SHARED));
221 if (failed == 0) 222 if (failed == 0)
222 SDL_AddDisplayMode(_this->current_display, mode); 223 SDL_AddDisplayMode(_this->current_display, mode);
223 else 224 else
224 SDL_DFB_DEBUG("Mode %d x %d not available: %x\n", mode->w, mode->h, 225 SDL_DFB_DEBUG("Mode %d x %d not available: %x\n", mode->w, mode->h,
225 failed); 226 failed);
257 for (i = 0; i < DFB_MAX_SCREENS; i++) { 258 for (i = 0; i < DFB_MAX_SCREENS; i++) {
258 screencbdata->gralayer[i] = -1; 259 screencbdata->gralayer[i] = -1;
259 screencbdata->vidlayer[i] = -1; 260 screencbdata->vidlayer[i] = -1;
260 } 261 }
261 262
262 SDL_DFB_CHECKERR(devdata->dfb-> 263 SDL_DFB_CHECKERR(devdata->
263 EnumScreens(devdata->dfb, &cbScreens, screencbdata)); 264 dfb->EnumScreens(devdata->dfb, &cbScreens,
265 screencbdata));
264 266
265 for (i = 0; i < screencbdata->numscreens; i++) { 267 for (i = 0; i < screencbdata->numscreens; i++) {
266 IDirectFBScreen *screen; 268 IDirectFBScreen *screen;
267 269
268 SDL_DFB_CHECKERR(devdata->dfb-> 270 SDL_DFB_CHECKERR(devdata->
269 GetScreen(devdata->dfb, screencbdata->screenid[i], 271 dfb->GetScreen(devdata->dfb,
270 &screen)); 272 screencbdata->screenid[i], &screen));
271 273
272 screencbdata->aux = i; 274 screencbdata->aux = i;
273 SDL_DFB_CHECKERR(screen-> 275 SDL_DFB_CHECKERR(screen->EnumDisplayLayers
274 EnumDisplayLayers(screen, &cbLayers, screencbdata)); 276 (screen, &cbLayers, screencbdata));
275 #if (DIRECTFB_MAJOR_VERSION >= 1) 277 #if (DIRECTFB_MAJOR_VERSION >= 1)
276 screen->GetSize(screen, &tcw[i], &tch[i]); 278 screen->GetSize(screen, &tcw[i], &tch[i]);
277 #else 279 #else
278 /* FIXME: this is only used to center windows 280 /* FIXME: this is only used to center windows
279 * Should be done otherwise, e.g. get surface from layer 281 * Should be done otherwise, e.g. get surface from layer
291 SDL_DFB_DEBUG("SDL directfb video driver - %s %s\n", __DATE__, __TIME__); 293 SDL_DFB_DEBUG("SDL directfb video driver - %s %s\n", __DATE__, __TIME__);
292 SDL_DFB_DEBUG("Using %s (%s) driver.\n", caps.name, caps.vendor); 294 SDL_DFB_DEBUG("Using %s (%s) driver.\n", caps.name, caps.vendor);
293 SDL_DFB_DEBUG("Found %d screens\n", screencbdata->numscreens); 295 SDL_DFB_DEBUG("Found %d screens\n", screencbdata->numscreens);
294 296
295 for (i = 0; i < screencbdata->numscreens; i++) { 297 for (i = 0; i < screencbdata->numscreens; i++) {
296 SDL_DFB_CHECKERR(devdata->dfb-> 298 SDL_DFB_CHECKERR(devdata->dfb->GetDisplayLayer(devdata->dfb,
297 GetDisplayLayer(devdata->dfb, 299 screencbdata->
298 screencbdata->gralayer[i], &layer)); 300 gralayer[i], &layer));
299 301
300 SDL_DFB_CHECKERR(layer-> 302 SDL_DFB_CHECKERR(layer->SetCooperativeLevel
301 SetCooperativeLevel(layer, DLSCL_ADMINISTRATIVE)); 303 (layer, DLSCL_ADMINISTRATIVE));
302 layer->EnableCursor(layer, 1); 304 layer->EnableCursor(layer, 1);
303 SDL_DFB_CHECKERR(layer->SetCursorOpacity(layer, 0xC0)); 305 SDL_DFB_CHECKERR(layer->SetCursorOpacity(layer, 0xC0));
304 306
305 if (devdata->use_yuv_underlays) { 307 if (devdata->use_yuv_underlays) {
306 dlc.flags = DLCONF_PIXELFORMAT | DLCONF_OPTIONS; 308 dlc.flags = DLCONF_PIXELFORMAT | DLCONF_OPTIONS;
379 int ret; 381 int ret;
380 382
381 data.nummodes = 0; 383 data.nummodes = 0;
382 /* Enumerate the available fullscreen modes */ 384 /* Enumerate the available fullscreen modes */
383 SDL_DFB_CALLOC(data.modelist, DFB_MAX_MODES, sizeof(SDL_DisplayMode)); 385 SDL_DFB_CALLOC(data.modelist, DFB_MAX_MODES, sizeof(SDL_DisplayMode));
384 SDL_DFB_CHECKERR(devdata->dfb-> 386 SDL_DFB_CHECKERR(devdata->
385 EnumVideoModes(devdata->dfb, EnumModesCallback, &data)); 387 dfb->EnumVideoModes(devdata->dfb, EnumModesCallback,
388 &data));
386 389
387 for (i = 0; i < data.nummodes; ++i) { 390 for (i = 0; i < data.nummodes; ++i) {
388 mode = data.modelist[i]; 391 mode = data.modelist[i];
389 392
390 mode.format = SDL_PIXELFORMAT_ARGB8888; 393 mode.format = SDL_PIXELFORMAT_ARGB8888;
417 DFB_DisplayData *data = (DFB_DisplayData *) SDL_CurrentDisplay.driverdata; 420 DFB_DisplayData *data = (DFB_DisplayData *) SDL_CurrentDisplay.driverdata;
418 DFBDisplayLayerConfig config, rconfig; 421 DFBDisplayLayerConfig config, rconfig;
419 DFBDisplayLayerConfigFlags fail = 0; 422 DFBDisplayLayerConfigFlags fail = 0;
420 DFBResult ret; 423 DFBResult ret;
421 424
422 SDL_DFB_CHECKERR(data->layer-> 425 SDL_DFB_CHECKERR(data->
423 SetCooperativeLevel(data->layer, DLSCL_ADMINISTRATIVE)); 426 layer->SetCooperativeLevel(data->layer,
427 DLSCL_ADMINISTRATIVE));
424 428
425 SDL_DFB_CHECKERR(data->layer->GetConfiguration(data->layer, &config)); 429 SDL_DFB_CHECKERR(data->layer->GetConfiguration(data->layer, &config));
426 config.flags = DLCONF_WIDTH | DLCONF_HEIGHT; 430 config.flags = DLCONF_WIDTH | DLCONF_HEIGHT;
427 if (mode->format != SDL_PIXELFORMAT_UNKNOWN) { 431 if (mode->format != SDL_PIXELFORMAT_UNKNOWN) {
428 config.flags |= DLCONF_PIXELFORMAT; 432 config.flags |= DLCONF_PIXELFORMAT;
456 //SDL_DFB_CHECKERR(data->layer->SetSourceRectangle(data->layer, 0, 0, config.width, config.height)); 460 //SDL_DFB_CHECKERR(data->layer->SetSourceRectangle(data->layer, 0, 0, config.width, config.height));
457 #endif 461 #endif
458 462
459 /* Double check */ 463 /* Double check */
460 SDL_DFB_CHECKERR(data->layer->GetConfiguration(data->layer, &rconfig)); 464 SDL_DFB_CHECKERR(data->layer->GetConfiguration(data->layer, &rconfig));
461 SDL_DFB_CHECKERR(data->layer-> 465 SDL_DFB_CHECKERR(data->
462 SetCooperativeLevel(data->layer, DLSCL_SHARED)); 466 layer->SetCooperativeLevel(data->layer, DLSCL_SHARED));
463 467
464 if ((config.width != rconfig.width) || 468 if ((config.width != rconfig.width) ||
465 (config.height != rconfig.height) || 469 (config.height != rconfig.height) ||
466 ((mode->format != SDL_PIXELFORMAT_UNKNOWN) 470 ((mode->format != SDL_PIXELFORMAT_UNKNOWN)
467 && (config.pixelformat != rconfig.pixelformat))) { 471 && (config.pixelformat != rconfig.pixelformat))) {
500 for (i = 0; i < SDL_GetNumVideoDisplays(); i++) { 504 for (i = 0; i < SDL_GetNumVideoDisplays(); i++) {
501 DFB_DisplayData *dispdata = 505 DFB_DisplayData *dispdata =
502 (DFB_DisplayData *) _this->displays[i].driverdata; 506 (DFB_DisplayData *) _this->displays[i].driverdata;
503 507
504 if (dispdata->layer) { 508 if (dispdata->layer) {
505 SDL_DFB_CHECK(dispdata->layer-> 509 SDL_DFB_CHECK(dispdata->
506 SetCooperativeLevel(dispdata->layer, 510 layer->SetCooperativeLevel(dispdata->layer,
507 DLSCL_ADMINISTRATIVE)); 511 DLSCL_ADMINISTRATIVE));
508 SDL_DFB_CHECK(dispdata->layer-> 512 SDL_DFB_CHECK(dispdata->
509 SetCursorOpacity(dispdata->layer, 0x00)); 513 layer->SetCursorOpacity(dispdata->layer, 0x00));
510 SDL_DFB_CHECK(dispdata->layer-> 514 SDL_DFB_CHECK(dispdata->
511 SetCooperativeLevel(dispdata->layer, DLSCL_SHARED)); 515 layer->SetCooperativeLevel(dispdata->layer,
516 DLSCL_SHARED));
512 } 517 }
513 518
514 SDL_DFB_RELEASE(dispdata->layer); 519 SDL_DFB_RELEASE(dispdata->layer);
515 SDL_DFB_RELEASE(dispdata->vidlayer); 520 SDL_DFB_RELEASE(dispdata->vidlayer);
516 521