void DDGetSurfaceDescription ( LPDIRECTDRAWSURFACE2 pSurface, DDSURFACEDESC *pSurfaceDesc ) { Assert ( pSurface != NULL ); Assert ( pSurfaceDesc != NULL ); ZEROMEM ( *pSurfaceDesc ); pSurfaceDesc->dwSize = sizeof ( DDSURFACEDESC ); ATTEMPT ( IDirectDrawSurface2_GetSurfaceDesc ( pSurface, pSurfaceDesc ) ); }
void BinkSetupVideo(void) { DDSURFACEDESC SurfaceDescription; HRESULT ReturnCode; UINT16 usRed, usGreen, usBlue; HVSURFACE hVSurface; GetVideoSurface( &hVSurface, FRAME_BUFFER ); lpBinkVideoPlayback2 = GetVideoSurfaceDDSurface( hVSurface ); ZEROMEM(SurfaceDescription); SurfaceDescription.dwSize = sizeof (DDSURFACEDESC); ReturnCode = IDirectDrawSurface2_GetSurfaceDesc ( lpBinkVideoPlayback2, &SurfaceDescription ); if (ReturnCode != DD_OK) { DirectXAttempt ( ReturnCode, __LINE__, __FILE__ ); return; } /* usRed = (UINT16) SurfaceDescription.ddpfPixelFormat.dwRBitMask; usGreen = (UINT16) SurfaceDescription.ddpfPixelFormat.dwGBitMask; usBlue = (UINT16) SurfaceDescription.ddpfPixelFormat.dwBBitMask; // SurfaceDescription.ddpfPixelFormat if((usRed==0xf800) && (usGreen==0x07e0) && (usBlue==0x001f)) guiBinkPixelFormat = BINKSURFACE565; else guiBinkPixelFormat = BINKSURFACE555; */ // // Get bit count for the RGB // usRed = GetNumberOfBits( SurfaceDescription.ddpfPixelFormat.dwRBitMask ); usGreen = GetNumberOfBits( SurfaceDescription.ddpfPixelFormat.dwGBitMask ); usBlue = GetNumberOfBits( SurfaceDescription.ddpfPixelFormat.dwBBitMask ); // 555 if( usRed == 5 && usGreen == 5 && usBlue == 5 ) { guiBinkPixelFormat = BINKSURFACE555; } //565 else if( usRed == 5 && usGreen == 6 && usBlue == 5 ) { guiBinkPixelFormat = BINKSURFACE565; } //655 else if( usRed == 6 && usGreen == 5 && usBlue == 5 ) { guiBinkPixelFormat = BINKSURFACE655; } //dont know the format, wont get video else { guiBinkPixelFormat = 0; } }