add FMT_A1BGR5
This commit is contained in:
@@ -43,9 +43,12 @@ enum PixelFormat {
|
||||
FMT_RGB5A1,
|
||||
FMT_RGB5,
|
||||
FMT_RGB8,
|
||||
/* This may not be as well-supported as RGBA; it's used to speed up DirectShow. */
|
||||
FMT_BGR8,
|
||||
FMT_PAL,
|
||||
/* The above formats differ between OpenGL and D3D. These are provided as
|
||||
* alternatives for OpenGL that match some format in D3D. Don't use them
|
||||
* directly; they'll be matched automatically by FindPixelFormat. */
|
||||
FMT_BGR8,
|
||||
FMT_A1BGR5,
|
||||
NUM_PIX_FORMATS
|
||||
};
|
||||
|
||||
|
||||
@@ -166,13 +166,16 @@ static const PixelFormatDesc PIXEL_FORMAT_DESC[NUM_PIX_FORMATS] = {
|
||||
0x00FF00,
|
||||
0x0000FF,
|
||||
0x000000 }
|
||||
}, {
|
||||
/* BGRA (N/A; OpenGL only) */
|
||||
0, { 0,0,0,0 }
|
||||
}, {
|
||||
/* Paletted */
|
||||
8,
|
||||
{ 0,0,0,0 } /* N/A */
|
||||
}, {
|
||||
/* BGR (N/A; OpenGL only) */
|
||||
0, { 0,0,0,0 }
|
||||
}, {
|
||||
/* ABGR (N/A; OpenGL only) */
|
||||
0, { 0,0,0,0 }
|
||||
}
|
||||
};
|
||||
|
||||
@@ -187,8 +190,9 @@ static D3DFORMAT D3DFORMATS[NUM_PIX_FORMATS] =
|
||||
#else
|
||||
D3DFMT_A8R8G8B8,
|
||||
#endif
|
||||
D3DFMT_P8,
|
||||
D3DFMT_UNKNOWN, /* no BGR */
|
||||
D3DFMT_P8
|
||||
D3DFMT_UNKNOWN /* no ABGR */
|
||||
};
|
||||
|
||||
const PixelFormatDesc *RageDisplay_D3D::GetPixelFormatDesc(PixelFormat pf) const
|
||||
|
||||
@@ -134,6 +134,10 @@ static PixelFormatDesc PIXEL_FORMAT_DESC[NUM_PIX_FORMATS] = {
|
||||
0x00FF00,
|
||||
0x0000FF,
|
||||
0x000000 }
|
||||
}, {
|
||||
/* Paletted */
|
||||
8,
|
||||
{ 0,0,0,0 } /* N/A */
|
||||
}, {
|
||||
/* B8G8R8A8 */
|
||||
24,
|
||||
@@ -142,9 +146,12 @@ static PixelFormatDesc PIXEL_FORMAT_DESC[NUM_PIX_FORMATS] = {
|
||||
0xFF0000,
|
||||
0x000000 }
|
||||
}, {
|
||||
/* Paletted */
|
||||
8,
|
||||
{ 0,0,0,0 } /* N/A */
|
||||
/* A1B5G5R5 */
|
||||
16,
|
||||
{ 0x7C00,
|
||||
0x03E0,
|
||||
0x001F,
|
||||
0x8000 },
|
||||
}
|
||||
};
|
||||
|
||||
@@ -178,16 +185,21 @@ struct GLPixFmtInfo_t {
|
||||
GL_RGB8,
|
||||
GL_RGB,
|
||||
GL_UNSIGNED_BYTE,
|
||||
}, {
|
||||
/* Paletted */
|
||||
GL_COLOR_INDEX8_EXT,
|
||||
GL_COLOR_INDEX,
|
||||
GL_UNSIGNED_BYTE,
|
||||
}, {
|
||||
/* B8G8R8 */
|
||||
GL_RGB8,
|
||||
GL_BGR,
|
||||
GL_UNSIGNED_BYTE,
|
||||
}, {
|
||||
/* Paletted */
|
||||
GL_COLOR_INDEX8_EXT,
|
||||
GL_COLOR_INDEX,
|
||||
GL_UNSIGNED_BYTE,
|
||||
/* A1R5G5B5 (matches D3DFMT_A1R5G5B5) */
|
||||
GL_RGB5_A1,
|
||||
GL_BGRA,
|
||||
GL_UNSIGNED_SHORT_1_5_5_5_REV,
|
||||
}
|
||||
};
|
||||
|
||||
@@ -528,6 +540,7 @@ bool RageDisplay_OGL::SupportsTextureFormat( PixelFormat pixfmt )
|
||||
case FMT_PAL:
|
||||
return GLExt::glColorTableEXT && GLExt::glGetColorTableParameterivEXT;
|
||||
case FMT_BGR8:
|
||||
case FMT_A1BGR5:
|
||||
return g_bGL_EXT_bgra;
|
||||
default:
|
||||
return true; // No way to query this in OGL. You pass it a format and hope it doesn't have to convert.
|
||||
|
||||
Reference in New Issue
Block a user