fix ffmpeg 1.1 builds... another way
This commit is contained in:
@@ -64,20 +64,20 @@ void LowLevelWindow_Win32::GetDisplayResolutions( DisplayResolutions &out ) cons
|
||||
GraphicsWindow::GetDisplayResolutions( out );
|
||||
}
|
||||
|
||||
int ChooseWindowPixelFormat( const VideoModeParams &p, PIXELFORMATDESCRIPTOR *PixelFormat )
|
||||
int ChooseWindowPixelFormat( const VideoModeParams &p, PIXELFORMATDESCRIPTOR *pixfmt )
|
||||
{
|
||||
ASSERT( GraphicsWindow::GetHwnd() != NULL );
|
||||
ASSERT( GraphicsWindow::GetHDC() != NULL );
|
||||
|
||||
ZERO( *PixelFormat );
|
||||
PixelFormat->nSize = sizeof(PIXELFORMATDESCRIPTOR);
|
||||
PixelFormat->nVersion = 1;
|
||||
PixelFormat->dwFlags = PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER | PFD_SUPPORT_OPENGL;
|
||||
PixelFormat->iPixelType = PFD_TYPE_RGBA;
|
||||
PixelFormat->cColorBits = p.bpp == 16? 16:24;
|
||||
PixelFormat->cDepthBits = 16;
|
||||
ZERO( *pixfmt );
|
||||
pixfmt->nSize = sizeof(PIXELFORMATDESCRIPTOR);
|
||||
pixfmt->nVersion = 1;
|
||||
pixfmt->dwFlags = PFD_DRAW_TO_WINDOW | PFD_DOUBLEBUFFER | PFD_SUPPORT_OPENGL;
|
||||
pixfmt->iPixelType = PFD_TYPE_RGBA;
|
||||
pixfmt->cColorBits = p.bpp == 16? 16:24;
|
||||
pixfmt->cDepthBits = 16;
|
||||
|
||||
return ChoosePixelFormat( GraphicsWindow::GetHDC(), PixelFormat );
|
||||
return ChoosePixelFormat( GraphicsWindow::GetHDC(), pixfmt );
|
||||
}
|
||||
|
||||
void DumpPixelFormat( const PIXELFORMATDESCRIPTOR &pfd )
|
||||
@@ -148,8 +148,8 @@ RString LowLevelWindow_Win32::TryVideoMode( const VideoModeParams &p, bool &bNew
|
||||
if( !sErr.empty() )
|
||||
return sErr;
|
||||
|
||||
PIXELFORMATDESCRIPTOR PixelFormat;
|
||||
int iPixelFormat = ChooseWindowPixelFormat( p, &PixelFormat );
|
||||
PIXELFORMATDESCRIPTOR pixfmt;
|
||||
int iPixelFormat = ChooseWindowPixelFormat( p, &pixfmt );
|
||||
if( iPixelFormat == 0 )
|
||||
{
|
||||
/* Destroy the window. */
|
||||
@@ -201,7 +201,7 @@ RString LowLevelWindow_Win32::TryVideoMode( const VideoModeParams &p, bool &bNew
|
||||
if( bNeedToSetPixelFormat )
|
||||
{
|
||||
/* Set the pixel format. */
|
||||
if( !SetPixelFormat(GraphicsWindow::GetHDC(), iPixelFormat, &PixelFormat) )
|
||||
if( !SetPixelFormat(GraphicsWindow::GetHDC(), iPixelFormat, &pixfmt) )
|
||||
{
|
||||
/* Destroy the window. */
|
||||
DestroyGraphicsWindowAndOpenGLContext();
|
||||
|
||||
@@ -451,32 +451,32 @@ void MovieTexture_DShow::CreateTexture()
|
||||
if( m_uTexHandle )
|
||||
return;
|
||||
|
||||
PixelFormat pixfmt;
|
||||
RagePixelFormat pixfmt;
|
||||
int depth = TEXTUREMAN->GetPrefs().m_iMovieColorDepth;
|
||||
switch( depth )
|
||||
{
|
||||
default:
|
||||
FAIL_M(ssprintf("Unsupported movie color depth: %i", depth));
|
||||
case 16:
|
||||
if( DISPLAY->SupportsTextureFormat(PixelFormat_RGB5) )
|
||||
pixfmt = PixelFormat_RGB5;
|
||||
if( DISPLAY->SupportsTextureFormat(RagePixelFormat_RGB5) )
|
||||
pixfmt = RagePixelFormat_RGB5;
|
||||
else
|
||||
pixfmt = PixelFormat_RGBA4; // everything supports RGBA4
|
||||
pixfmt = RagePixelFormat_RGBA4; // everything supports RGBA4
|
||||
break;
|
||||
case 32:
|
||||
if( DISPLAY->SupportsTextureFormat(PixelFormat_RGB8) )
|
||||
pixfmt = PixelFormat_RGB8;
|
||||
else if( DISPLAY->SupportsTextureFormat(PixelFormat_RGBA8) )
|
||||
pixfmt = PixelFormat_RGBA8;
|
||||
else if( DISPLAY->SupportsTextureFormat(PixelFormat_RGB5) )
|
||||
pixfmt = PixelFormat_RGB5;
|
||||
if( DISPLAY->SupportsTextureFormat(RagePixelFormat_RGB8) )
|
||||
pixfmt = RagePixelFormat_RGB8;
|
||||
else if( DISPLAY->SupportsTextureFormat(RagePixelFormat_RGBA8) )
|
||||
pixfmt = RagePixelFormat_RGBA8;
|
||||
else if( DISPLAY->SupportsTextureFormat(RagePixelFormat_RGB5) )
|
||||
pixfmt = RagePixelFormat_RGB5;
|
||||
else
|
||||
pixfmt = PixelFormat_RGBA4; // everything supports RGBA4
|
||||
pixfmt = RagePixelFormat_RGBA4; // everything supports RGBA4
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
const RageDisplay::PixelFormatDesc *pfd = DISPLAY->GetPixelFormatDesc(pixfmt);
|
||||
const RageDisplay::RagePixelFormatDesc *pfd = DISPLAY->GetPixelFormatDesc(pixfmt);
|
||||
RageSurface *img = CreateSurface( m_iTextureWidth, m_iTextureHeight,
|
||||
pfd->bpp, pfd->masks[0], pfd->masks[1], pfd->masks[2], pfd->masks[3] );
|
||||
|
||||
|
||||
@@ -179,7 +179,7 @@ static int FindCompatibleAVFormat( bool bHighColor )
|
||||
continue;
|
||||
}
|
||||
|
||||
PixelFormat pixfmt = DISPLAY->FindPixelFormat( fmt.bpp,
|
||||
RagePixelFormat pixfmt = DISPLAY->FindPixelFormat( fmt.bpp,
|
||||
fmt.masks[0],
|
||||
fmt.masks[1],
|
||||
fmt.masks[2],
|
||||
@@ -187,7 +187,7 @@ static int FindCompatibleAVFormat( bool bHighColor )
|
||||
true /* realtime */
|
||||
);
|
||||
|
||||
if( pixfmt == PixelFormat_Invalid )
|
||||
if( pixfmt == RagePixelFormat_Invalid )
|
||||
continue;
|
||||
|
||||
return i;
|
||||
|
||||
@@ -110,7 +110,7 @@ class RageMovieTexture_Generic_Intermediate : public RageTexture
|
||||
public:
|
||||
RageMovieTexture_Generic_Intermediate( RageTextureID ID, int iWidth, int iHeight,
|
||||
int iImageWidth, int iImageHeight, int iTextureWidth, int iTextureHeight,
|
||||
RageSurfaceFormat SurfaceFormat, PixelFormat pixfmt ):
|
||||
RageSurfaceFormat SurfaceFormat, RagePixelFormat pixfmt ):
|
||||
RageTexture(ID),
|
||||
m_SurfaceFormat( SurfaceFormat )
|
||||
{
|
||||
@@ -170,7 +170,7 @@ private:
|
||||
|
||||
unsigned m_uTexHandle;
|
||||
RageSurfaceFormat m_SurfaceFormat;
|
||||
PixelFormat m_PixFmt;
|
||||
RagePixelFormat m_PixFmt;
|
||||
};
|
||||
|
||||
void MovieTexture_Generic::Invalidate()
|
||||
@@ -222,13 +222,13 @@ void MovieTexture_Generic::CreateTexture()
|
||||
|
||||
}
|
||||
|
||||
PixelFormat pixfmt = DISPLAY->FindPixelFormat( m_pSurface->format->BitsPerPixel,
|
||||
RagePixelFormat pixfmt = DISPLAY->FindPixelFormat( m_pSurface->format->BitsPerPixel,
|
||||
m_pSurface->format->Mask[0],
|
||||
m_pSurface->format->Mask[1],
|
||||
m_pSurface->format->Mask[2],
|
||||
m_pSurface->format->Mask[3] );
|
||||
|
||||
if( pixfmt == PixelFormat_Invalid )
|
||||
if( pixfmt == RagePixelFormat_Invalid )
|
||||
{
|
||||
/* We weren't given a natively-supported pixel format. Pick a supported
|
||||
* one. This is a fallback case, and implies a second conversion. */
|
||||
@@ -238,22 +238,22 @@ void MovieTexture_Generic::CreateTexture()
|
||||
default:
|
||||
FAIL_M(ssprintf("Unsupported movie color depth: %i", depth));
|
||||
case 16:
|
||||
if( DISPLAY->SupportsTextureFormat(PixelFormat_RGB5) )
|
||||
pixfmt = PixelFormat_RGB5;
|
||||
if( DISPLAY->SupportsTextureFormat(RagePixelFormat_RGB5) )
|
||||
pixfmt = RagePixelFormat_RGB5;
|
||||
else
|
||||
pixfmt = PixelFormat_RGBA4;
|
||||
pixfmt = RagePixelFormat_RGBA4;
|
||||
|
||||
break;
|
||||
|
||||
case 32:
|
||||
if( DISPLAY->SupportsTextureFormat(PixelFormat_RGB8) )
|
||||
pixfmt = PixelFormat_RGB8;
|
||||
else if( DISPLAY->SupportsTextureFormat(PixelFormat_RGBA8) )
|
||||
pixfmt = PixelFormat_RGBA8;
|
||||
else if( DISPLAY->SupportsTextureFormat(PixelFormat_RGB5) )
|
||||
pixfmt = PixelFormat_RGB5;
|
||||
if( DISPLAY->SupportsTextureFormat(RagePixelFormat_RGB8) )
|
||||
pixfmt = RagePixelFormat_RGB8;
|
||||
else if( DISPLAY->SupportsTextureFormat(RagePixelFormat_RGBA8) )
|
||||
pixfmt = RagePixelFormat_RGBA8;
|
||||
else if( DISPLAY->SupportsTextureFormat(RagePixelFormat_RGB5) )
|
||||
pixfmt = RagePixelFormat_RGB5;
|
||||
else
|
||||
pixfmt = PixelFormat_RGBA4;
|
||||
pixfmt = RagePixelFormat_RGBA4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,12 +44,12 @@ MovieTexture_Null::MovieTexture_Null(RageTextureID ID) : RageMovieTexture(ID)
|
||||
|
||||
CreateFrameRects();
|
||||
|
||||
PixelFormat pixfmt = PixelFormat_RGBA4;
|
||||
RagePixelFormat pixfmt = RagePixelFormat_RGBA4;
|
||||
if( !DISPLAY->SupportsTextureFormat(pixfmt) )
|
||||
pixfmt = PixelFormat_RGBA8;
|
||||
pixfmt = RagePixelFormat_RGBA8;
|
||||
ASSERT( DISPLAY->SupportsTextureFormat(pixfmt) );
|
||||
|
||||
const RageDisplay::PixelFormatDesc *pfd = DISPLAY->GetPixelFormatDesc( pixfmt );
|
||||
const RageDisplay::RagePixelFormatDesc *pfd = DISPLAY->GetPixelFormatDesc( pixfmt );
|
||||
RageSurface *img = CreateSurface( size, size, pfd->bpp,
|
||||
pfd->masks[0], pfd->masks[1], pfd->masks[2], pfd->masks[3] );
|
||||
memset( img->pixels, 0, img->pitch*img->h );
|
||||
|
||||
Reference in New Issue
Block a user