Mercurial > sdl-ios-xcode
comparison src/video/directfb/SDL_DirectFB_render.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 | 8acbb14124c5 |
children | 8cc00819c8d6 |
comparison
equal
deleted
inserted
replaced
3010:a6694a812119 | 3011:8f4ed5ec2b06 |
---|---|
416 | 416 |
417 if (renddata->size_changed) { | 417 if (renddata->size_changed) { |
418 int cw, ch; | 418 int cw, ch; |
419 int ret; | 419 int ret; |
420 | 420 |
421 SDL_DFB_CHECKERR(windata->surface-> | 421 SDL_DFB_CHECKERR(windata-> |
422 GetSize(windata->surface, &cw, &ch)); | 422 surface->GetSize(windata->surface, &cw, &ch)); |
423 if (cw != window->w || ch != window->h) | 423 if (cw != window->w || ch != window->h) |
424 SDL_DFB_CHECKERR(windata->window-> | 424 SDL_DFB_CHECKERR(windata-> |
425 ResizeSurface(windata->window, window->w, | 425 window->ResizeSurface(windata->window, window->w, |
426 window->h)); | 426 window->h)); |
427 } | 427 } |
428 return 0; | 428 return 0; |
429 error: | 429 error: |
430 return -1; | 430 return -1; |
431 } | 431 } |
460 layconf.width = texture->w; | 460 layconf.width = texture->w; |
461 layconf.height = texture->h; | 461 layconf.height = texture->h; |
462 layconf.pixelformat = SDLToDFBPixelFormat(data->format); | 462 layconf.pixelformat = SDLToDFBPixelFormat(data->format); |
463 layconf.surface_caps = DSCAPS_VIDEOONLY | DSCAPS_DOUBLE; | 463 layconf.surface_caps = DSCAPS_VIDEOONLY | DSCAPS_DOUBLE; |
464 | 464 |
465 SDL_DFB_CHECKERR(devdata->dfb-> | 465 SDL_DFB_CHECKERR(devdata-> |
466 GetDisplayLayer(devdata->dfb, dispdata->vidID, | 466 dfb->GetDisplayLayer(devdata->dfb, dispdata->vidID, |
467 &dispdata->vidlayer)); | 467 &dispdata->vidlayer)); |
468 SDL_DFB_CHECKERR(dispdata->vidlayer-> | 468 SDL_DFB_CHECKERR(dispdata-> |
469 SetCooperativeLevel(dispdata->vidlayer, | 469 vidlayer->SetCooperativeLevel(dispdata->vidlayer, |
470 DLSCL_EXCLUSIVE)); | 470 DLSCL_EXCLUSIVE)); |
471 | 471 |
472 if (devdata->use_yuv_underlays) { | 472 if (devdata->use_yuv_underlays) { |
473 ret = dispdata->vidlayer->SetLevel(dispdata->vidlayer, -1); | 473 ret = dispdata->vidlayer->SetLevel(dispdata->vidlayer, -1); |
474 if (ret != DFB_OK) | 474 if (ret != DFB_OK) |
475 SDL_DFB_DEBUG("Underlay Setlevel not supported\n"); | 475 SDL_DFB_DEBUG("Underlay Setlevel not supported\n"); |
476 } | 476 } |
477 SDL_DFB_CHECKERR(dispdata->vidlayer-> | 477 SDL_DFB_CHECKERR(dispdata-> |
478 SetConfiguration(dispdata->vidlayer, &layconf)); | 478 vidlayer->SetConfiguration(dispdata->vidlayer, |
479 SDL_DFB_CHECKERR(dispdata->vidlayer-> | 479 &layconf)); |
480 GetSurface(dispdata->vidlayer, &data->surface)); | 480 SDL_DFB_CHECKERR(dispdata-> |
481 vidlayer->GetSurface(dispdata->vidlayer, | |
482 &data->surface)); | |
481 dispdata->vidIDinuse = 1; | 483 dispdata->vidIDinuse = 1; |
482 data->display = display; | 484 data->display = display; |
483 return 0; | 485 return 0; |
484 } | 486 } |
485 return 1; | 487 return 1; |
486 error: | 488 error: |
487 if (dispdata->vidlayer) { | 489 if (dispdata->vidlayer) { |
488 SDL_DFB_RELEASE(data->surface); | 490 SDL_DFB_RELEASE(data->surface); |
489 SDL_DFB_CHECKERR(dispdata->vidlayer-> | 491 SDL_DFB_CHECKERR(dispdata-> |
490 SetCooperativeLevel(dispdata->vidlayer, | 492 vidlayer->SetCooperativeLevel(dispdata->vidlayer, |
491 DLSCL_ADMINISTRATIVE)); | 493 DLSCL_ADMINISTRATIVE)); |
492 SDL_DFB_RELEASE(dispdata->vidlayer); | 494 SDL_DFB_RELEASE(dispdata->vidlayer); |
493 } | 495 } |
494 return 1; | 496 return 1; |
495 } | 497 } |
496 | 498 |
538 } | 540 } |
539 | 541 |
540 data->pixels = NULL; | 542 data->pixels = NULL; |
541 | 543 |
542 /* Create the surface */ | 544 /* Create the surface */ |
543 SDL_DFB_CHECKERR(devdata->dfb-> | 545 SDL_DFB_CHECKERR(devdata-> |
544 CreateSurface(devdata->dfb, &dsc, &data->surface)); | 546 dfb->CreateSurface(devdata->dfb, &dsc, |
547 &data->surface)); | |
545 if (SDL_ISPIXELFORMAT_INDEXED(data->format) | 548 if (SDL_ISPIXELFORMAT_INDEXED(data->format) |
546 && !SDL_ISPIXELFORMAT_FOURCC(data->format)) { | 549 && !SDL_ISPIXELFORMAT_FOURCC(data->format)) { |
547 SDL_DFB_CHECKERR(data->surface-> | 550 SDL_DFB_CHECKERR(data-> |
548 GetPalette(data->surface, &data->palette)); | 551 surface->GetPalette(data->surface, |
552 &data->palette)); | |
549 } | 553 } |
550 | 554 |
551 } | 555 } |
552 #if (DIRECTFB_MAJOR_VERSION == 1) && (DIRECTFB_MINOR_VERSION >= 2) | 556 #if (DIRECTFB_MAJOR_VERSION == 1) && (DIRECTFB_MINOR_VERSION >= 2) |
553 data->render_options = DSRO_NONE; | 557 data->render_options = DSRO_NONE; |
600 entries[i].r = colors[i].r; | 604 entries[i].r = colors[i].r; |
601 entries[i].g = colors[i].g; | 605 entries[i].g = colors[i].g; |
602 entries[i].b = colors[i].b; | 606 entries[i].b = colors[i].b; |
603 entries[i].a = 0xFF; | 607 entries[i].a = 0xFF; |
604 } | 608 } |
605 SDL_DFB_CHECKERR(data->palette-> | 609 SDL_DFB_CHECKERR(data-> |
606 SetEntries(data->palette, entries, ncolors, | 610 palette->SetEntries(data->palette, entries, ncolors, |
607 firstcolor)); | 611 firstcolor)); |
608 return 0; | 612 return 0; |
609 } else { | 613 } else { |
610 SDL_SetError("YUV textures don't have a palette"); | 614 SDL_SetError("YUV textures don't have a palette"); |
611 return -1; | 615 return -1; |
612 } | 616 } |
624 if (SDL_ISPIXELFORMAT_INDEXED(data->format) | 628 if (SDL_ISPIXELFORMAT_INDEXED(data->format) |
625 && !SDL_ISPIXELFORMAT_FOURCC(data->format)) { | 629 && !SDL_ISPIXELFORMAT_FOURCC(data->format)) { |
626 DFBColor entries[256]; | 630 DFBColor entries[256]; |
627 int i; | 631 int i; |
628 | 632 |
629 SDL_DFB_CHECKERR(data->palette-> | 633 SDL_DFB_CHECKERR(data-> |
630 GetEntries(data->palette, entries, ncolors, | 634 palette->GetEntries(data->palette, entries, ncolors, |
631 firstcolor)); | 635 firstcolor)); |
632 | 636 |
633 for (i = 0; i < ncolors; ++i) { | 637 for (i = 0; i < ncolors; ++i) { |
634 colors[i].r = entries[i].r; | 638 colors[i].r = entries[i].r; |
635 colors[i].g = entries[i].g; | 639 colors[i].g = entries[i].g; |
636 colors[i].b = entries[i].b; | 640 colors[i].b = entries[i].b; |
805 g = renderer->g; | 809 g = renderer->g; |
806 b = renderer->b; | 810 b = renderer->b; |
807 a = renderer->a; | 811 a = renderer->a; |
808 | 812 |
809 SetBlendMode(data, renderer->blendMode, NULL); | 813 SetBlendMode(data, renderer->blendMode, NULL); |
810 SDL_DFB_CHECKERR(data->surface-> | 814 SDL_DFB_CHECKERR(data-> |
811 SetDrawingFlags(data->surface, data->drawFlags)); | 815 surface->SetDrawingFlags(data->surface, |
816 data->drawFlags)); | |
812 | 817 |
813 switch (renderer->blendMode) { | 818 switch (renderer->blendMode) { |
814 case SDL_BLENDMODE_NONE: | 819 case SDL_BLENDMODE_NONE: |
815 case SDL_BLENDMODE_MASK: | 820 case SDL_BLENDMODE_MASK: |
816 case SDL_BLENDMODE_BLEND: | 821 case SDL_BLENDMODE_BLEND: |
866 { | 871 { |
867 DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; | 872 DirectFB_RenderData *data = (DirectFB_RenderData *) renderer->driverdata; |
868 DFBResult ret; | 873 DFBResult ret; |
869 | 874 |
870 PrepareDraw(renderer); | 875 PrepareDraw(renderer); |
871 SDL_DFB_CHECKERR(data->surface-> | 876 SDL_DFB_CHECKERR(data-> |
872 FillRectangle(data->surface, rect->x, rect->y, rect->w, | 877 surface->FillRectangle(data->surface, rect->x, rect->y, |
873 rect->h)); | 878 rect->w, rect->h)); |
874 | 879 |
875 return 0; | 880 return 0; |
876 error: | 881 error: |
877 return -1; | 882 return -1; |
878 } | 883 } |
892 SDL_Window *window = SDL_GetWindowFromID(renderer->window); | 897 SDL_Window *window = SDL_GetWindowFromID(renderer->window); |
893 SDL_DFB_WINDOWDATA(window); | 898 SDL_DFB_WINDOWDATA(window); |
894 SDL_VideoDisplay *display = texturedata->display; | 899 SDL_VideoDisplay *display = texturedata->display; |
895 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; | 900 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; |
896 | 901 |
897 SDL_DFB_CHECKERR(dispdata->vidlayer-> | 902 SDL_DFB_CHECKERR(dispdata-> |
898 SetSourceRectangle(dispdata->vidlayer, srcrect->x, | 903 vidlayer->SetSourceRectangle(dispdata->vidlayer, |
899 srcrect->y, srcrect->w, | 904 srcrect->x, srcrect->y, |
900 srcrect->h)); | 905 srcrect->w, |
906 srcrect->h)); | |
901 windata->window->GetPosition(windata->window, &px, &py); | 907 windata->window->GetPosition(windata->window, &px, &py); |
902 SDL_DFB_CHECKERR(dispdata->vidlayer-> | 908 SDL_DFB_CHECKERR(dispdata-> |
903 SetScreenRectangle(dispdata->vidlayer, | 909 vidlayer->SetScreenRectangle(dispdata->vidlayer, |
904 px + dstrect->x, py + dstrect->y, | 910 px + dstrect->x, |
905 dstrect->w, dstrect->h)); | 911 py + dstrect->y, |
912 dstrect->w, | |
913 dstrect->h)); | |
906 } else { | 914 } else { |
907 DFBRectangle sr, dr; | 915 DFBRectangle sr, dr; |
908 DFBSurfaceBlittingFlags flags = 0; | 916 DFBSurfaceBlittingFlags flags = 0; |
909 | 917 |
910 if (texturedata->dirty.list) { | 918 if (texturedata->dirty.list) { |
928 SDLtoDFBRect(srcrect, &sr); | 936 SDLtoDFBRect(srcrect, &sr); |
929 SDLtoDFBRect(dstrect, &dr); | 937 SDLtoDFBRect(dstrect, &dr); |
930 | 938 |
931 SDL_DFB_CHECKERR(data->surface->SetColor(data->surface, 0xFF, | 939 SDL_DFB_CHECKERR(data->surface->SetColor(data->surface, 0xFF, |
932 0xFF, 0xFF, 0xFF)); | 940 0xFF, 0xFF, 0xFF)); |
933 if (texture-> | 941 if (texture->modMode & |
934 modMode & (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA)) | 942 (SDL_TEXTUREMODULATE_COLOR | SDL_TEXTUREMODULATE_ALPHA)) { |
935 { | |
936 if (texture->modMode & SDL_TEXTUREMODULATE_ALPHA) { | 943 if (texture->modMode & SDL_TEXTUREMODULATE_ALPHA) { |
937 alpha = texture->a; | 944 alpha = texture->a; |
938 SDL_DFB_CHECKERR(data->surface->SetColor(data->surface, 0xFF, | 945 SDL_DFB_CHECKERR(data->surface->SetColor(data->surface, 0xFF, |
939 0xFF, 0xFF, alpha)); | 946 0xFF, 0xFF, alpha)); |
940 } | 947 } |
941 if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) { | 948 if (texture->modMode & SDL_TEXTUREMODULATE_COLOR) { |
942 | 949 |
943 SDL_DFB_CHECKERR(data->surface-> | 950 SDL_DFB_CHECKERR(data-> |
944 SetColor(data->surface, texture->r, | 951 surface->SetColor(data->surface, texture->r, |
945 texture->g, texture->b, alpha)); | 952 texture->g, texture->b, |
953 alpha)); | |
946 flags |= DSBLIT_COLORIZE; | 954 flags |= DSBLIT_COLORIZE; |
947 } | 955 } |
948 if (alpha < 0xFF) | 956 if (alpha < 0xFF) |
949 flags |= DSBLIT_SRC_PREMULTCOLOR; | 957 flags |= DSBLIT_SRC_PREMULTCOLOR; |
950 } else | 958 } else |
951 SDL_DFB_CHECKERR(data->surface->SetColor(data->surface, 0xFF, | 959 SDL_DFB_CHECKERR(data->surface->SetColor(data->surface, 0xFF, |
952 0xFF, 0xFF, 0xFF)); | 960 0xFF, 0xFF, 0xFF)); |
953 | 961 |
954 SetBlendMode(data, texture->blendMode, texturedata); | 962 SetBlendMode(data, texture->blendMode, texturedata); |
955 | 963 |
956 SDL_DFB_CHECKERR(data->surface-> | 964 SDL_DFB_CHECKERR(data->surface->SetBlittingFlags(data->surface, |
957 SetBlittingFlags(data->surface, | 965 data-> |
958 data->blitFlags | flags)); | 966 blitFlags | flags)); |
959 | 967 |
960 #if (DIRECTFB_MAJOR_VERSION == 1) && (DIRECTFB_MINOR_VERSION >= 2) | 968 #if (DIRECTFB_MAJOR_VERSION == 1) && (DIRECTFB_MINOR_VERSION >= 2) |
961 SDL_DFB_CHECKERR(data->surface->SetRenderOptions(data->surface, | 969 SDL_DFB_CHECKERR(data->surface->SetRenderOptions(data->surface, |
962 texturedata-> | 970 texturedata->render_options)); |
963 render_options)); | |
964 #endif | 971 #endif |
965 | 972 |
966 if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) { | 973 if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) { |
967 SDL_DFB_CHECKERR(data->surface-> | 974 SDL_DFB_CHECKERR(data-> |
968 Blit(data->surface, texturedata->surface, | 975 surface->Blit(data->surface, |
969 &sr, dr.x, dr.y)); | 976 texturedata->surface, &sr, dr.x, |
977 dr.y)); | |
970 } else { | 978 } else { |
971 SDL_DFB_CHECKERR(data->surface-> | 979 SDL_DFB_CHECKERR(data-> |
972 StretchBlit(data->surface, texturedata->surface, | 980 surface->StretchBlit(data->surface, |
973 &sr, &dr)); | 981 texturedata->surface, &sr, |
982 &dr)); | |
974 } | 983 } |
975 } | 984 } |
976 return 0; | 985 return 0; |
977 error: | 986 error: |
978 return -1; | 987 return -1; |
991 sr.y = 0; | 1000 sr.y = 0; |
992 sr.w = window->w; | 1001 sr.w = window->w; |
993 sr.h = window->h; | 1002 sr.h = window->h; |
994 | 1003 |
995 /* Send the data to the display */ | 1004 /* Send the data to the display */ |
996 SDL_DFB_CHECKERR(data->surface-> | 1005 SDL_DFB_CHECKERR(data-> |
997 Flip(data->surface, NULL, data->flipflags)); | 1006 surface->Flip(data->surface, NULL, data->flipflags)); |
998 | 1007 |
999 return; | 1008 return; |
1000 error: | 1009 error: |
1001 return; | 1010 return; |
1002 } | 1011 } |