Commit 9253e0e3 authored by Oliver Stieber's avatar Oliver Stieber Committed by Alexandre Julliard

Tidy up some comments and formatting.

parent 1ed9bac8
...@@ -278,6 +278,7 @@ UINT WINAPI IWineD3DBaseTextureImpl_GetTextureDimensions(IWineD3DBaseTexture *if ...@@ -278,6 +278,7 @@ UINT WINAPI IWineD3DBaseTextureImpl_GetTextureDimensions(IWineD3DBaseTexture *if
static const IWineD3DBaseTextureVtbl IWineD3DBaseTexture_Vtbl = static const IWineD3DBaseTextureVtbl IWineD3DBaseTexture_Vtbl =
{ {
/* IUnknown */
IWineD3DBaseTextureImpl_QueryInterface, IWineD3DBaseTextureImpl_QueryInterface,
IWineD3DBaseTextureImpl_AddRef, IWineD3DBaseTextureImpl_AddRef,
IWineD3DBaseTextureImpl_Release, IWineD3DBaseTextureImpl_Release,
......
...@@ -298,7 +298,7 @@ const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl = ...@@ -298,7 +298,7 @@ const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl =
IWineD3DCubeTextureImpl_GetPriority, IWineD3DCubeTextureImpl_GetPriority,
IWineD3DCubeTextureImpl_PreLoad, IWineD3DCubeTextureImpl_PreLoad,
IWineD3DCubeTextureImpl_GetType, IWineD3DCubeTextureImpl_GetType,
/*base texture */ /* IWineD3DBaseTexture */
IWineD3DCubeTextureImpl_SetLOD, IWineD3DCubeTextureImpl_SetLOD,
IWineD3DCubeTextureImpl_GetLOD, IWineD3DCubeTextureImpl_GetLOD,
IWineD3DCubeTextureImpl_GetLevelCount, IWineD3DCubeTextureImpl_GetLevelCount,
...@@ -310,7 +310,7 @@ const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl = ...@@ -310,7 +310,7 @@ const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl =
IWineD3DCubeTextureImpl_BindTexture, IWineD3DCubeTextureImpl_BindTexture,
IWineD3DCubeTextureImpl_UnBindTexture, IWineD3DCubeTextureImpl_UnBindTexture,
IWineD3DCubeTextureImpl_GetTextureDimensions, IWineD3DCubeTextureImpl_GetTextureDimensions,
/* cube texture */ /* IWineD3DCubeTexture */
IWineD3DCubeTextureImpl_GetLevelDesc, IWineD3DCubeTextureImpl_GetLevelDesc,
IWineD3DCubeTextureImpl_GetCubeMapSurface, IWineD3DCubeTextureImpl_GetCubeMapSurface,
IWineD3DCubeTextureImpl_LockRect, IWineD3DCubeTextureImpl_LockRect,
......
...@@ -782,7 +782,7 @@ HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapter, WINE ...@@ -782,7 +782,7 @@ HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapter, WINE
pMode->Width = 800; pMode->Width = 800;
pMode->Height = 600; pMode->Height = 600;
pMode->RefreshRate = D3DADAPTER_DEFAULT; pMode->RefreshRate = D3DADAPTER_DEFAULT;
pMode->Format = (Format==D3DFMT_UNKNOWN)?D3DFMT_A8R8G8B8:Format; pMode->Format = (Format == D3DFMT_UNKNOWN) ? D3DFMT_A8R8G8B8 : Format;
bpp = 32; bpp = 32;
#endif #endif
TRACE_(d3d_caps)("W %d H %d rr %d fmt (%x - %s) bpp %u\n", pMode->Width, pMode->Height, TRACE_(d3d_caps)("W %d H %d rr %d fmt (%x - %s) bpp %u\n", pMode->Width, pMode->Height,
...@@ -1482,7 +1482,7 @@ HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, D3DDEVT ...@@ -1482,7 +1482,7 @@ HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, D3DDEVT
The following fields apply to d3d9 only The following fields apply to d3d9 only
------------------------------------------------ */ ------------------------------------------------ */
if (This->dxVersion > 8) { if (This->dxVersion > 8) {
GLint max_buffers=1; GLint max_buffers = 1;
FIXME("Caps support for directx9 is nonexistent at the moment!\n"); FIXME("Caps support for directx9 is nonexistent at the moment!\n");
*pCaps->DevCaps2 = 0; *pCaps->DevCaps2 = 0;
/* TODO: D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES */ /* TODO: D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES */
...@@ -1665,9 +1665,11 @@ HRESULT WINAPI IWineD3DImpl_GetParent(IWineD3D *iface, IUnknown **pParent) { ...@@ -1665,9 +1665,11 @@ HRESULT WINAPI IWineD3DImpl_GetParent(IWineD3D *iface, IUnknown **pParent) {
const IWineD3DVtbl IWineD3D_Vtbl = const IWineD3DVtbl IWineD3D_Vtbl =
{ {
/* IUnknown */
IWineD3DImpl_QueryInterface, IWineD3DImpl_QueryInterface,
IWineD3DImpl_AddRef, IWineD3DImpl_AddRef,
IWineD3DImpl_Release, IWineD3DImpl_Release,
/* IWineD3D */
IWineD3DImpl_GetParent, IWineD3DImpl_GetParent,
IWineD3DImpl_GetAdapterCount, IWineD3DImpl_GetAdapterCount,
IWineD3DImpl_RegisterSoftwareDevice, IWineD3DImpl_RegisterSoftwareDevice,
......
...@@ -868,7 +868,6 @@ void drawStridedFast(IWineD3DDevice *iface, Direct3DVertexStridedData *sd, ...@@ -868,7 +868,6 @@ void drawStridedFast(IWineD3DDevice *iface, Direct3DVertexStridedData *sd,
DWORD fvf = (sd->u.s.blendWeights.dwType - D3DDECLTYPE_FLOAT1) + 1; DWORD fvf = (sd->u.s.blendWeights.dwType - D3DDECLTYPE_FLOAT1) + 1;
int numBlends = ((fvf & D3DFVF_POSITION_MASK) >> 1) - 2 + ((FALSE == (fvf & D3DFVF_LASTBETA_UBYTE4)) ? 0 : -1); int numBlends = ((fvf & D3DFVF_POSITION_MASK) >> 1) - 2 + ((FALSE == (fvf & D3DFVF_LASTBETA_UBYTE4)) ? 0 : -1);
/*FIXME("TODO\n");*/
/* Note dwType == float3 or float4 == 2 or 3 */ /* Note dwType == float3 or float4 == 2 or 3 */
VTRACE(("glWeightPointerARB(%ld, GL_FLOAT, %ld, %p)\n", VTRACE(("glWeightPointerARB(%ld, GL_FLOAT, %ld, %p)\n",
numBlends, numBlends,
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Copyright 2002-2004 Jason Edmeades * Copyright 2002-2004 Jason Edmeades
* Copyright 2003-2004 Raphael Junqueira * Copyright 2003-2004 Raphael Junqueira
* Copyright 2004 Christian Costa * Copyright 2004 Christian Costa
* Copyright 2005 Oliver Stieber
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -128,9 +129,11 @@ HRESULT WINAPI IWineD3DIndexBufferImpl_GetDesc(IWineD3DIndexBuffer *ifac ...@@ -128,9 +129,11 @@ HRESULT WINAPI IWineD3DIndexBufferImpl_GetDesc(IWineD3DIndexBuffer *ifac
const IWineD3DIndexBufferVtbl IWineD3DIndexBuffer_Vtbl = const IWineD3DIndexBufferVtbl IWineD3DIndexBuffer_Vtbl =
{ {
/* IUnknown */
IWineD3DIndexBufferImpl_QueryInterface, IWineD3DIndexBufferImpl_QueryInterface,
IWineD3DIndexBufferImpl_AddRef, IWineD3DIndexBufferImpl_AddRef,
IWineD3DIndexBufferImpl_Release, IWineD3DIndexBufferImpl_Release,
/* IWineD3DResource */
IWineD3DIndexBufferImpl_GetParent, IWineD3DIndexBufferImpl_GetParent,
IWineD3DIndexBufferImpl_GetDevice, IWineD3DIndexBufferImpl_GetDevice,
IWineD3DIndexBufferImpl_SetPrivateData, IWineD3DIndexBufferImpl_SetPrivateData,
...@@ -140,6 +143,7 @@ const IWineD3DIndexBufferVtbl IWineD3DIndexBuffer_Vtbl = ...@@ -140,6 +143,7 @@ const IWineD3DIndexBufferVtbl IWineD3DIndexBuffer_Vtbl =
IWineD3DIndexBufferImpl_GetPriority, IWineD3DIndexBufferImpl_GetPriority,
IWineD3DIndexBufferImpl_PreLoad, IWineD3DIndexBufferImpl_PreLoad,
IWineD3DIndexBufferImpl_GetType, IWineD3DIndexBufferImpl_GetType,
/* IWineD3DIndexBuffer */
IWineD3DIndexBufferImpl_Lock, IWineD3DIndexBufferImpl_Lock,
IWineD3DIndexBufferImpl_Unlock, IWineD3DIndexBufferImpl_Unlock,
IWineD3DIndexBufferImpl_GetDesc IWineD3DIndexBufferImpl_GetDesc
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Copyright 2002-2004 Jason Edmeades * Copyright 2002-2004 Jason Edmeades
* Copyright 2003-2004 Raphael Junqueira * Copyright 2003-2004 Raphael Junqueira
* Copyright 2004 Christian Costa * Copyright 2004 Christian Costa
* Copyright 2005 Oliver Stieber
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -26,7 +27,7 @@ ...@@ -26,7 +27,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(d3d); WINE_DEFAULT_DEBUG_CHANNEL(d3d);
#define GLINFO_LOCATION ((IWineD3DImpl *)(((IWineD3DDeviceImpl *)This->resource.wineD3DDevice)->wineD3D))->gl_info #define GLINFO_LOCATION ((IWineD3DImpl *)(((IWineD3DDeviceImpl *)This->resource.wineD3DDevice)->wineD3D))->gl_info
/* IDirect3DResource IUnknown parts follow: */ /* IWineD3DResource IUnknown parts follow: */
HRESULT WINAPI IWineD3DResourceImpl_QueryInterface(IWineD3DResource *iface, REFIID riid, LPVOID *ppobj) HRESULT WINAPI IWineD3DResourceImpl_QueryInterface(IWineD3DResource *iface, REFIID riid, LPVOID *ppobj)
{ {
IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface;
...@@ -71,7 +72,7 @@ void IWineD3DResourceImpl_CleanUp(IWineD3DResource *iface){ ...@@ -71,7 +72,7 @@ void IWineD3DResourceImpl_CleanUp(IWineD3DResource *iface){
This->resource.allocatedMemory = 0; This->resource.allocatedMemory = 0;
} }
/* IDirect3DResource Interface follow: */ /* IWineD3DResource Interface follow: */
HRESULT WINAPI IWineD3DResourceImpl_GetDevice(IWineD3DResource *iface, IWineD3DDevice** ppDevice) { HRESULT WINAPI IWineD3DResourceImpl_GetDevice(IWineD3DResource *iface, IWineD3DDevice** ppDevice) {
IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface; IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface;
TRACE("(%p) : returning %p\n", This, This->resource.wineD3DDevice); TRACE("(%p) : returning %p\n", This, This->resource.wineD3DDevice);
...@@ -128,9 +129,11 @@ HRESULT WINAPI IWineD3DResourceImpl_GetParent(IWineD3DResource *iface, IUnknown ...@@ -128,9 +129,11 @@ HRESULT WINAPI IWineD3DResourceImpl_GetParent(IWineD3DResource *iface, IUnknown
static const IWineD3DResourceVtbl IWineD3DResource_Vtbl = static const IWineD3DResourceVtbl IWineD3DResource_Vtbl =
{ {
/* IUnknown */
IWineD3DResourceImpl_QueryInterface, IWineD3DResourceImpl_QueryInterface,
IWineD3DResourceImpl_AddRef, IWineD3DResourceImpl_AddRef,
IWineD3DResourceImpl_Release, IWineD3DResourceImpl_Release,
/* IWineD3DResource */
IWineD3DResourceImpl_GetParent, IWineD3DResourceImpl_GetParent,
IWineD3DResourceImpl_GetDevice, IWineD3DResourceImpl_GetDevice,
IWineD3DResourceImpl_SetPrivateData, IWineD3DResourceImpl_SetPrivateData,
......
...@@ -714,9 +714,11 @@ HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStateBlock* ...@@ -714,9 +714,11 @@ HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStateBlock*
const IWineD3DStateBlockVtbl IWineD3DStateBlock_Vtbl = const IWineD3DStateBlockVtbl IWineD3DStateBlock_Vtbl =
{ {
/* IUnknown */
IWineD3DStateBlockImpl_QueryInterface, IWineD3DStateBlockImpl_QueryInterface,
IWineD3DStateBlockImpl_AddRef, IWineD3DStateBlockImpl_AddRef,
IWineD3DStateBlockImpl_Release, IWineD3DStateBlockImpl_Release,
/* IWineD3DStateBlock */
IWineD3DStateBlockImpl_GetParent, IWineD3DStateBlockImpl_GetParent,
IWineD3DStateBlockImpl_GetDevice, IWineD3DStateBlockImpl_GetDevice,
IWineD3DStateBlockImpl_Capture, IWineD3DStateBlockImpl_Capture,
......
...@@ -116,7 +116,7 @@ void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface) { ...@@ -116,7 +116,7 @@ void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface) {
TRACE("Passing to conatiner\n"); TRACE("Passing to conatiner\n");
IWineD3DBaseTexture_PreLoad(baseTexture); IWineD3DBaseTexture_PreLoad(baseTexture);
IWineD3DBaseTexture_Release(baseTexture); IWineD3DBaseTexture_Release(baseTexture);
} else{ } else {
TRACE("(%p) : About to load surface\n", This); TRACE("(%p) : About to load surface\n", This);
ENTER_GL(); ENTER_GL();
#if 0 /* TODO: context manager support */ #if 0 /* TODO: context manager support */
...@@ -131,7 +131,7 @@ void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface) { ...@@ -131,7 +131,7 @@ void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface) {
checkGLcall("glBindTexture"); checkGLcall("glBindTexture");
IWineD3DSurface_LoadTexture(iface); IWineD3DSurface_LoadTexture(iface);
/* This is where we should be reducing the amount of GLMemoryUsed */ /* This is where we should be reducing the amount of GLMemoryUsed */
}else { } else {
if (This->glDescription.level == 0) { if (This->glDescription.level == 0) {
glBindTexture(This->glDescription.target, This->glDescription.textureName); glBindTexture(This->glDescription.target, This->glDescription.textureName);
checkGLcall("glBindTexture"); checkGLcall("glBindTexture");
...@@ -158,10 +158,12 @@ void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface) { ...@@ -158,10 +158,12 @@ void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface) {
} }
D3DRESOURCETYPE WINAPI IWineD3DSurfaceImpl_GetType(IWineD3DSurface *iface) { D3DRESOURCETYPE WINAPI IWineD3DSurfaceImpl_GetType(IWineD3DSurface *iface) {
TRACE("(%p) : calling resourceimpl_GetType\n", iface);
return IWineD3DResourceImpl_GetType((IWineD3DResource *)iface); return IWineD3DResourceImpl_GetType((IWineD3DResource *)iface);
} }
HRESULT WINAPI IWineD3DSurfaceImpl_GetParent(IWineD3DSurface *iface, IUnknown **pParent) { HRESULT WINAPI IWineD3DSurfaceImpl_GetParent(IWineD3DSurface *iface, IUnknown **pParent) {
TRACE("(%p) : calling resourceimpl_GetParent\n", iface);
return IWineD3DResourceImpl_GetParent((IWineD3DResource *)iface, pParent); return IWineD3DResourceImpl_GetParent((IWineD3DResource *)iface, pParent);
} }
...@@ -202,7 +204,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetDesc(IWineD3DSurface *iface, WINED3DSURFAC ...@@ -202,7 +204,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetDesc(IWineD3DSurface *iface, WINED3DSURFAC
return D3D_OK; return D3D_OK;
} }
void WINAPI IWineD3DSurfaceImpl_SetGlTextureDesc(IWineD3DSurface *iface, UINT textureName, int target){ void WINAPI IWineD3DSurfaceImpl_SetGlTextureDesc(IWineD3DSurface *iface, UINT textureName, int target) {
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
TRACE("(%p) : setting textureName %u, target %i\n", This, textureName, target); TRACE("(%p) : setting textureName %u, target %i\n", This, textureName, target);
if (This->glDescription.textureName == 0 && textureName != 0) { if (This->glDescription.textureName == 0 && textureName != 0) {
...@@ -213,7 +215,7 @@ void WINAPI IWineD3DSurfaceImpl_SetGlTextureDesc(IWineD3DSurface *iface, UINT te ...@@ -213,7 +215,7 @@ void WINAPI IWineD3DSurfaceImpl_SetGlTextureDesc(IWineD3DSurface *iface, UINT te
This->glDescription.target = target; This->glDescription.target = target;
} }
void WINAPI IWineD3DSurfaceImpl_GetGlDesc(IWineD3DSurface *iface, glDescriptor **glDescription){ void WINAPI IWineD3DSurfaceImpl_GetGlDesc(IWineD3DSurface *iface, glDescriptor **glDescription) {
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
TRACE("(%p) : returning %p\n", This, &This->glDescription); TRACE("(%p) : returning %p\n", This, &This->glDescription);
*glDescription = &This->glDescription; *glDescription = &This->glDescription;
...@@ -250,6 +252,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE ...@@ -250,6 +252,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
/*return D3DERR_INVALIDCALL; */ /*return D3DERR_INVALIDCALL; */
} }
if (This->resource.usage & D3DUSAGE_RENDERTARGET) {
IWineD3DSurface_GetContainer(iface, &IID_IWineD3DSwapChain, (void **)&swapchain); IWineD3DSurface_GetContainer(iface, &IID_IWineD3DSwapChain, (void **)&swapchain);
if (swapchain != NULL || iface == myDevice->renderTarget || iface == myDevice->depthStencilBuffer) { if (swapchain != NULL || iface == myDevice->renderTarget || iface == myDevice->depthStencilBuffer) {
...@@ -267,6 +270,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE ...@@ -267,6 +270,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
IWineD3DSwapChain_Release((IWineD3DSwapChain *)swapchain); IWineD3DSwapChain_Release((IWineD3DSwapChain *)swapchain);
} }
swapchain = NULL; swapchain = NULL;
}
} else { } else {
TRACE("(%p) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, This->resource.allocatedMemory); TRACE("(%p) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, This->resource.allocatedMemory);
} }
...@@ -302,7 +306,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE ...@@ -302,7 +306,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
This->lockedRect.bottom = pRect->bottom; This->lockedRect.bottom = pRect->bottom;
} }
if(This->nonpow2){ if (This->nonpow2) {
TRACE("Locking non-power 2 texture\n"); TRACE("Locking non-power 2 texture\n");
} }
...@@ -407,31 +411,31 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE ...@@ -407,31 +411,31 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
if (iface == myDevice->renderTarget || iface == swapchain->backBuffer) { if (iface == myDevice->renderTarget || iface == swapchain->backBuffer) {
TRACE("locking back buffer\n"); TRACE("locking back buffer\n");
glReadBuffer(GL_BACK); glReadBuffer(GL_BACK);
}else if (iface == swapchain->frontBuffer) { } else if (iface == swapchain->frontBuffer) {
TRACE("locking front\n"); TRACE("locking front\n");
glReadBuffer(GL_FRONT); glReadBuffer(GL_FRONT);
}else if (iface == myDevice->depthStencilBuffer) { } else if (iface == myDevice->depthStencilBuffer) {
FIXME("Stencil Buffer lock unsupported for now\n"); FIXME("Stencil Buffer lock unsupported for now\n");
} else{ } else {
FIXME("(%p) Shouldn't have got here!\n", This); FIXME("(%p) Shouldn't have got here!\n", This);
glReadBuffer(GL_BACK); glReadBuffer(GL_BACK);
} }
}else if (swapchain != NULL) { } else if (swapchain != NULL) {
IWineD3DSwapChainImpl *implSwapChain; IWineD3DSwapChainImpl *implSwapChain;
IWineD3DDevice_GetSwapChain((IWineD3DDevice *)myDevice, 0, (IWineD3DSwapChain **)&implSwapChain); IWineD3DDevice_GetSwapChain((IWineD3DDevice *)myDevice, 0, (IWineD3DSwapChain **)&implSwapChain);
if (swapchain->glCtx == implSwapChain->render_ctx && swapchain->drawable == implSwapChain->win) { if (swapchain->glCtx == implSwapChain->render_ctx && swapchain->drawable == implSwapChain->win) {
/* This will fail for the implicit swapchain, which is why there needs to be a context manager */ /* This will fail for the implicit swapchain, which is why there needs to be a context manager */
if (iface == swapchain->backBuffer) { if (iface == swapchain->backBuffer) {
glReadBuffer(GL_BACK); glReadBuffer(GL_BACK);
}else if (iface == swapchain->frontBuffer) { } else if (iface == swapchain->frontBuffer) {
glReadBuffer(GL_FRONT); glReadBuffer(GL_FRONT);
} else if (iface == myDevice->depthStencilBuffer) { } else if (iface == myDevice->depthStencilBuffer) {
FIXME("Stencil Buffer lock unsupported for now\n"); FIXME("Stencil Buffer lock unsupported for now\n");
} else{ } else {
FIXME("Should have got here!\n"); FIXME("Should have got here!\n");
glReadBuffer(GL_BACK); glReadBuffer(GL_BACK);
} }
}else{ } else {
/* We need to switch contexts to be able to read the buffer!!! */ /* We need to switch contexts to be able to read the buffer!!! */
FIXME("The buffer requested isn't in the current openGL context\n"); FIXME("The buffer requested isn't in the current openGL context\n");
notInContext = TRUE; notInContext = TRUE;
...@@ -468,7 +472,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE ...@@ -468,7 +472,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
BOOL ati_performance_hack = FALSE; BOOL ati_performance_hack = FALSE;
ati_performance_hack = (This->lockedRect.bottom - This->lockedRect.top > 10) || (This->lockedRect.right - This->lockedRect.left > 10)? TRUE: FALSE; ati_performance_hack = (This->lockedRect.bottom - This->lockedRect.top > 10) || (This->lockedRect.right - This->lockedRect.left > 10)? TRUE: FALSE;
#endif #endif
if ((This->lockedRect.left ==0 && This->lockedRect.top ==0 && if ((This->lockedRect.left == 0 && This->lockedRect.top == 0 &&
This->lockedRect.right == This->currentDesc.Width This->lockedRect.right == This->currentDesc.Width
&& This->lockedRect.bottom == This->currentDesc.Height)) { && This->lockedRect.bottom == This->currentDesc.Height)) {
glReadPixels(0, 0, glReadPixels(0, 0,
...@@ -477,7 +481,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE ...@@ -477,7 +481,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
This->glDescription.glFormat, This->glDescription.glFormat,
This->glDescription.glType, This->glDescription.glType,
(char *)pLockedRect->pBits); (char *)pLockedRect->pBits);
}else if (This->lockedRect.left ==0 && This->lockedRect.right == This->currentDesc.Width) { } else if (This->lockedRect.left == 0 && This->lockedRect.right == This->currentDesc.Width) {
glReadPixels(0, glReadPixels(0,
This->lockedRect.top, This->lockedRect.top,
This->currentDesc.Width, This->currentDesc.Width,
...@@ -507,7 +511,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE ...@@ -507,7 +511,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
} else if (D3DUSAGE_DEPTHSTENCIL & This->resource.usage) { /* stencil surfaces */ } else if (D3DUSAGE_DEPTHSTENCIL & This->resource.usage) { /* stencil surfaces */
if(!messages & 1){ if (!messages & 1) {
FIXME("TODO stencil depth surface locking surf%p usage(%lu)\n", This, This->resource.usage); FIXME("TODO stencil depth surface locking surf%p usage(%lu)\n", This, This->resource.usage);
/* /*
...@@ -519,7 +523,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE ...@@ -519,7 +523,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
) )
*/ */
messages |=1; messages |= 1;
} }
} else { } else {
FIXME("unsupported locking to surface surf@%p usage(%lu)\n", This, This->resource.usage); FIXME("unsupported locking to surface surf@%p usage(%lu)\n", This, This->resource.usage);
...@@ -540,7 +544,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE ...@@ -540,7 +544,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
TRACE("Making container dirty\n"); TRACE("Making container dirty\n");
IWineD3DBaseTexture_SetDirty(pBaseTexture, TRUE); IWineD3DBaseTexture_SetDirty(pBaseTexture, TRUE);
IWineD3DBaseTexture_Release(pBaseTexture); IWineD3DBaseTexture_Release(pBaseTexture);
}else{ } else {
TRACE("Surface is standalone, no need to dirty the container\n"); TRACE("Surface is standalone, no need to dirty the container\n");
} }
} }
...@@ -563,6 +567,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) { ...@@ -563,6 +567,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
return D3DERR_INVALIDCALL; return D3DERR_INVALIDCALL;
} }
if (D3DUSAGE_RENDERTARGET & This->resource.usage) {
IWineD3DSurface_GetContainer(iface, &IID_IWineD3DSwapChain, (void **)&swapchain); IWineD3DSurface_GetContainer(iface, &IID_IWineD3DSwapChain, (void **)&swapchain);
if ((swapchain != NULL) && iface == swapchain->backBuffer) { if ((swapchain != NULL) && iface == swapchain->backBuffer) {
...@@ -574,6 +579,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) { ...@@ -574,6 +579,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
} else if (iface == myDevice->renderTarget) { } else if (iface == myDevice->renderTarget) {
buffername = "renderTarget"; buffername = "renderTarget";
} }
}
if (swapchain != NULL) { if (swapchain != NULL) {
IWineD3DSwapChain_Release((IWineD3DSwapChain *)swapchain); IWineD3DSwapChain_Release((IWineD3DSwapChain *)swapchain);
......
...@@ -442,9 +442,11 @@ HRESULT WINAPI IWineD3DSwapChainImpl_GetGammaRamp(IWineD3DSwapChain *iface, D3DG ...@@ -442,9 +442,11 @@ HRESULT WINAPI IWineD3DSwapChainImpl_GetGammaRamp(IWineD3DSwapChain *iface, D3DG
IWineD3DSwapChainVtbl IWineD3DSwapChain_Vtbl = IWineD3DSwapChainVtbl IWineD3DSwapChain_Vtbl =
{ {
/* IUnknown */
IWineD3DSwapChainImpl_QueryInterface, IWineD3DSwapChainImpl_QueryInterface,
IWineD3DSwapChainImpl_AddRef, IWineD3DSwapChainImpl_AddRef,
IWineD3DSwapChainImpl_Release, IWineD3DSwapChainImpl_Release,
/* IWineD3DSwapChain */
IWineD3DSwapChainImpl_GetParent, IWineD3DSwapChainImpl_GetParent,
IWineD3DSwapChainImpl_GetDevice, IWineD3DSwapChainImpl_GetDevice,
IWineD3DSwapChainImpl_Present, IWineD3DSwapChainImpl_Present,
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Copyright 2002-2004 Jason Edmeades * Copyright 2002-2004 Jason Edmeades
* Copyright 2003-2004 Raphael Junqueira * Copyright 2003-2004 Raphael Junqueira
* Copyright 2004 Christian Costa * Copyright 2004 Christian Costa
* Copyright 2005 Oliver Stieber
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
...@@ -233,8 +234,8 @@ const char* debug_d3drenderstate(DWORD state) { ...@@ -233,8 +234,8 @@ const char* debug_d3drenderstate(DWORD state) {
D3DSTATE_TO_STR(WINED3DRS_COLORWRITEENABLE ); D3DSTATE_TO_STR(WINED3DRS_COLORWRITEENABLE );
D3DSTATE_TO_STR(WINED3DRS_TWEENFACTOR ); D3DSTATE_TO_STR(WINED3DRS_TWEENFACTOR );
D3DSTATE_TO_STR(WINED3DRS_BLENDOP ); D3DSTATE_TO_STR(WINED3DRS_BLENDOP );
D3DSTATE_TO_STR(WINED3DRS_POSITIONORDER ); D3DSTATE_TO_STR(WINED3DRS_POSITIONDEGREE );
D3DSTATE_TO_STR(WINED3DRS_NORMALORDER ); D3DSTATE_TO_STR(WINED3DRS_NORMALDEGREE );
#undef D3DSTATE_TO_STR #undef D3DSTATE_TO_STR
default: default:
FIXME("Unrecognized %lu render state!\n", state); FIXME("Unrecognized %lu render state!\n", state);
...@@ -341,7 +342,7 @@ GLenum StencilOp(DWORD op) { ...@@ -341,7 +342,7 @@ GLenum StencilOp(DWORD op) {
#endif #endif
#if !defined(combine_ext) #if !defined(combine_ext)
void set_tex_op(LPDIRECT3DDEVICE8 iface, BOOL isAlpha, int Stage, D3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3) void set_tex_op(IWineD3DDevice *iface, BOOL isAlpha, int Stage, D3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3)
{ {
FIXME("Requires opengl combine extensions to work\n"); FIXME("Requires opengl combine extensions to work\n");
return; return;
...@@ -1855,7 +1856,7 @@ int D3DFmtMakeGlCfg(D3DFORMAT BackBufferFormat, D3DFORMAT StencilBufferFormat, i ...@@ -1855,7 +1856,7 @@ int D3DFmtMakeGlCfg(D3DFORMAT BackBufferFormat, D3DFORMAT StencilBufferFormat, i
break; break;
} }
}else{ /* it the device doesn't support the 'exact' format, try to find something close */ } else { /* it the device doesn't support the 'exact' format, try to find something close */
switch (StencilBufferFormat) { switch (StencilBufferFormat) {
case WINED3DFMT_D16_LOCKABLE: case WINED3DFMT_D16_LOCKABLE:
case WINED3DFMT_D16: case WINED3DFMT_D16:
......
...@@ -130,9 +130,11 @@ HRESULT WINAPI IWineD3DVertexBufferImpl_GetDesc(IWineD3DVertexBuffer *if ...@@ -130,9 +130,11 @@ HRESULT WINAPI IWineD3DVertexBufferImpl_GetDesc(IWineD3DVertexBuffer *if
const IWineD3DVertexBufferVtbl IWineD3DVertexBuffer_Vtbl = const IWineD3DVertexBufferVtbl IWineD3DVertexBuffer_Vtbl =
{ {
/* IUnknown */
IWineD3DVertexBufferImpl_QueryInterface, IWineD3DVertexBufferImpl_QueryInterface,
IWineD3DVertexBufferImpl_AddRef, IWineD3DVertexBufferImpl_AddRef,
IWineD3DVertexBufferImpl_Release, IWineD3DVertexBufferImpl_Release,
/* IWineD3DResource */
IWineD3DVertexBufferImpl_GetParent, IWineD3DVertexBufferImpl_GetParent,
IWineD3DVertexBufferImpl_GetDevice, IWineD3DVertexBufferImpl_GetDevice,
IWineD3DVertexBufferImpl_SetPrivateData, IWineD3DVertexBufferImpl_SetPrivateData,
...@@ -142,6 +144,7 @@ const IWineD3DVertexBufferVtbl IWineD3DVertexBuffer_Vtbl = ...@@ -142,6 +144,7 @@ const IWineD3DVertexBufferVtbl IWineD3DVertexBuffer_Vtbl =
IWineD3DVertexBufferImpl_GetPriority, IWineD3DVertexBufferImpl_GetPriority,
IWineD3DVertexBufferImpl_PreLoad, IWineD3DVertexBufferImpl_PreLoad,
IWineD3DVertexBufferImpl_GetType, IWineD3DVertexBufferImpl_GetType,
/* IWineD3DVertexBuffer */
IWineD3DVertexBufferImpl_Lock, IWineD3DVertexBufferImpl_Lock,
IWineD3DVertexBufferImpl_Unlock, IWineD3DVertexBufferImpl_Unlock,
IWineD3DVertexBufferImpl_GetDesc IWineD3DVertexBufferImpl_GetDesc
......
...@@ -733,7 +733,6 @@ HRESULT WINAPI IDirect3DVertexShaderImpl_ExecuteSW(IDirect3DVertexShaderImpl* vs ...@@ -733,7 +733,6 @@ HRESULT WINAPI IDirect3DVertexShaderImpl_ExecuteSW(IDirect3DVertexShaderImpl* vs
if (pToken[0] & D3DSP_WRITEMASK_2) p[0]->z = d.z; if (pToken[0] & D3DSP_WRITEMASK_2) p[0]->z = d.z;
if (pToken[0] & D3DSP_WRITEMASK_3) p[0]->w = d.w; if (pToken[0] & D3DSP_WRITEMASK_3) p[0]->w = d.w;
} }
#if 0 #if 0
TRACE_VSVECTOR(output->oPos); TRACE_VSVECTOR(output->oPos);
TRACE_VSVECTOR(output->oD[0]); TRACE_VSVECTOR(output->oD[0]);
......
...@@ -61,7 +61,7 @@ ULONG WINAPI IWineD3DVolumeImpl_Release(IWineD3DVolume *iface) { ...@@ -61,7 +61,7 @@ ULONG WINAPI IWineD3DVolumeImpl_Release(IWineD3DVolume *iface) {
} }
/* **************************************************** /* ****************************************************
IWineD3DSurface IWineD3DResource parts follow IWineD3DVolume IWineD3DResource parts follow
**************************************************** */ **************************************************** */
HRESULT WINAPI IWineD3DVolumeImpl_GetParent(IWineD3DVolume *iface, IUnknown **pParent) { HRESULT WINAPI IWineD3DVolumeImpl_GetParent(IWineD3DVolume *iface, IUnknown **pParent) {
return IWineD3DResourceImpl_GetParent((IWineD3DResource *)iface, pParent); return IWineD3DResourceImpl_GetParent((IWineD3DResource *)iface, pParent);
......
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