From effc262f9fb7631a9ae3c2b5052fa305e10b8060 Mon Sep 17 00:00:00 2001 From: Oliver Stieber Date: Thu, 29 Sep 2005 10:31:43 +0000 Subject: [PATCH] Added support for backbuffer with the formats A1R5G5B5 and X1R5G5B5. --- dlls/wined3d/surface.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index eaba9499d99..83936f35e99 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -758,6 +758,25 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) { vcheckGLcall("glDrawPixels"); } break; + case WINED3DFMT_X1R5G5B5: + { + 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 |= 0x8000; + data++; + size--; + } + } + case WINED3DFMT_A1R5G5B5: + { + glDrawPixels(This->lockedRect.right - This->lockedRect.left, (This->lockedRect.bottom - This->lockedRect.top)-1, + GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, This->resource.allocatedMemory); + vcheckGLcall("glDrawPixels"); + } + break; case WINED3DFMT_R8G8B8: { glDrawPixels(This->lockedRect.right - This->lockedRect.left, (This->lockedRect.bottom - This->lockedRect.top)-1,