wined3d: Added support for WINED3DFMT_X4R4G4B4.
This commit is contained in:
parent
3275450c3d
commit
ee5d72b136
|
@ -1073,6 +1073,9 @@ static BOOL IWineD3DImpl_IsGLXFBConfigCompatibleWithRenderFmt(WineD3D_Context* c
|
|||
case WINED3DFMT_A1R5G5B5:
|
||||
if (5 == rb && 5 == gb && 5 == bb && 1 == ab) return TRUE;
|
||||
break;
|
||||
case WINED3DFMT_X4R4G4B4:
|
||||
if (16 == buf_sz && 4 == rb && 4 == gb && 4 == bb) return TRUE;
|
||||
break;
|
||||
case WINED3DFMT_R5G6B5:
|
||||
if (5 == rb && 6 == gb && 5 == bb) return TRUE;
|
||||
break;
|
||||
|
|
|
@ -752,6 +752,25 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
|
|||
glRasterPos3i(This->lockedRect.left, This->lockedRect.top, 1);
|
||||
vcheckGLcall("glRasterPos2f");
|
||||
switch (This->resource.format) {
|
||||
case WINED3DFMT_X4R4G4B4:
|
||||
{
|
||||
int size;
|
||||
unsigned short *data;
|
||||
data = (unsigned short *)This->resource.allocatedMemory;
|
||||
size = (This->lockedRect.bottom - This->lockedRect.top) * (This->lockedRect.right - This->lockedRect.left);
|
||||
while(size > 0) {
|
||||
*data |= 0xF000;
|
||||
data++;
|
||||
size--;
|
||||
}
|
||||
}
|
||||
case WINED3DFMT_A4R4G4B4:
|
||||
{
|
||||
glDrawPixels(This->lockedRect.right - This->lockedRect.left, (This->lockedRect.bottom - This->lockedRect.top)-1,
|
||||
GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4_REV, This->resource.allocatedMemory);
|
||||
vcheckGLcall("glDrawPixels");
|
||||
}
|
||||
break;
|
||||
case WINED3DFMT_R5G6B5:
|
||||
{
|
||||
glDrawPixels(This->lockedRect.right - This->lockedRect.left, (This->lockedRect.bottom - This->lockedRect.top)-1,
|
||||
|
|
Loading…
Reference in New Issue