Commit ee5d72b1 authored by Raphael Junqueira's avatar Raphael Junqueira Committed by Alexandre Julliard

wined3d: Added support for WINED3DFMT_X4R4G4B4.

parent 3275450c
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment