Mercurial > mplayer.hg
comparison libvo/vo_directx.c @ 33818:fc9fbb0b31fa
Simplify some more struct initializations.
author | reimar |
---|---|
date | Sun, 24 Jul 2011 19:40:45 +0000 |
parents | a3d73bc21e55 |
children | 6451d20ff7c1 |
comparison
equal
deleted
inserted
replaced
33817:a3d73bc21e55 | 33818:fc9fbb0b31fa |
---|---|
712 //find out the Pixelformat of the Primary Surface | 712 //find out the Pixelformat of the Primary Surface |
713 static uint32_t Directx_CheckPrimaryPixelformat(void) | 713 static uint32_t Directx_CheckPrimaryPixelformat(void) |
714 { | 714 { |
715 int i; | 715 int i; |
716 uint32_t formatcount = 0; | 716 uint32_t formatcount = 0; |
717 DDPIXELFORMAT ddpf; | 717 DDPIXELFORMAT ddpf = { .dwSize = sizeof(ddpf) }; |
718 DDSURFACEDESC2 ddsd; | 718 DDSURFACEDESC2 ddsd; |
719 HDC hdc; | 719 HDC hdc; |
720 HRESULT hres; | 720 HRESULT hres; |
721 COLORREF rgbT = RGB(0, 0, 0); | 721 COLORREF rgbT = RGB(0, 0, 0); |
722 mp_msg(MSGT_VO, MSGL_V, "<vo_directx><INFO>checking primary surface\n"); | 722 mp_msg(MSGT_VO, MSGL_V, "<vo_directx><INFO>checking primary surface\n"); |
723 memset(&ddpf, 0, sizeof(DDPIXELFORMAT)); | |
724 ddpf.dwSize = sizeof(DDPIXELFORMAT); | |
725 //we have to create a primary surface first | 723 //we have to create a primary surface first |
726 if (Directx_CreatePrimarySurface() != 0) | 724 if (Directx_CreatePrimarySurface() != 0) |
727 return 1; | 725 return 1; |
728 if (g_lpddsPrimary->lpVtbl->GetPixelFormat(g_lpddsPrimary, &ddpf) != DD_OK) { | 726 if (g_lpddsPrimary->lpVtbl->GetPixelFormat(g_lpddsPrimary, &ddpf) != DD_OK) { |
729 mp_msg(MSGT_VO, MSGL_FATAL, "<vo_directx><FATAL ERROR>can't get pixelformat\n"); | 727 mp_msg(MSGT_VO, MSGL_FATAL, "<vo_directx><FATAL ERROR>can't get pixelformat\n"); |
856 } | 854 } |
857 if (dxresult != DD_OK) | 855 if (dxresult != DD_OK) |
858 mp_msg(MSGT_VO, MSGL_ERR, "<vo_directx><ERROR>can't flip page\n"); | 856 mp_msg(MSGT_VO, MSGL_ERR, "<vo_directx><ERROR>can't flip page\n"); |
859 } | 857 } |
860 if (nooverlay) { | 858 if (nooverlay) { |
861 DDBLTFX ddbltfx; | |
862 // ask for the "NOTEARING" option | 859 // ask for the "NOTEARING" option |
863 memset(&ddbltfx, 0, sizeof(DDBLTFX)); | 860 DDBLTFX ddbltfx = { |
864 ddbltfx.dwSize = sizeof(DDBLTFX); | 861 .dwSize = sizeof(ddbltfx), |
865 ddbltfx.dwDDFX = DDBLTFX_NOTEARING; | 862 .dwDDFX = DDBLTFX_NOTEARING, |
863 }; | |
866 g_lpddsPrimary->lpVtbl->Blt(g_lpddsPrimary, &rd, g_lpddsBack, NULL, DDBLT_WAIT, &ddbltfx); | 864 g_lpddsPrimary->lpVtbl->Blt(g_lpddsPrimary, &rd, g_lpddsBack, NULL, DDBLT_WAIT, &ddbltfx); |
867 } | 865 } |
868 if (g_lpddsBack->lpVtbl->Lock(g_lpddsBack, NULL, &ddsdsf, DDLOCK_NOSYSLOCK | DDLOCK_WAIT, NULL) == DD_OK) { | 866 if (g_lpddsBack->lpVtbl->Lock(g_lpddsBack, NULL, &ddsdsf, DDLOCK_NOSYSLOCK | DDLOCK_WAIT, NULL) == DD_OK) { |
869 if (vo_directrendering && (dstride != ddsdsf.lPitch)) { | 867 if (vo_directrendering && (dstride != ddsdsf.lPitch)) { |
870 mp_msg(MSGT_VO, MSGL_WARN, "<vo_directx><WARN>stride changed !!!! disabling direct rendering\n"); | 868 mp_msg(MSGT_VO, MSGL_WARN, "<vo_directx><WARN>stride changed !!!! disabling direct rendering\n"); |