Tidy up some comments and formatting.
This commit is contained in:
parent
1ed9bac896
commit
9253e0e39c
|
@ -278,6 +278,7 @@ UINT WINAPI IWineD3DBaseTextureImpl_GetTextureDimensions(IWineD3DBaseTexture *if
|
|||
|
||||
static const IWineD3DBaseTextureVtbl IWineD3DBaseTexture_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IWineD3DBaseTextureImpl_QueryInterface,
|
||||
IWineD3DBaseTextureImpl_AddRef,
|
||||
IWineD3DBaseTextureImpl_Release,
|
||||
|
|
|
@ -298,7 +298,7 @@ const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl =
|
|||
IWineD3DCubeTextureImpl_GetPriority,
|
||||
IWineD3DCubeTextureImpl_PreLoad,
|
||||
IWineD3DCubeTextureImpl_GetType,
|
||||
/*base texture */
|
||||
/* IWineD3DBaseTexture */
|
||||
IWineD3DCubeTextureImpl_SetLOD,
|
||||
IWineD3DCubeTextureImpl_GetLOD,
|
||||
IWineD3DCubeTextureImpl_GetLevelCount,
|
||||
|
@ -310,7 +310,7 @@ const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl =
|
|||
IWineD3DCubeTextureImpl_BindTexture,
|
||||
IWineD3DCubeTextureImpl_UnBindTexture,
|
||||
IWineD3DCubeTextureImpl_GetTextureDimensions,
|
||||
/* cube texture */
|
||||
/* IWineD3DCubeTexture */
|
||||
IWineD3DCubeTextureImpl_GetLevelDesc,
|
||||
IWineD3DCubeTextureImpl_GetCubeMapSurface,
|
||||
IWineD3DCubeTextureImpl_LockRect,
|
||||
|
|
|
@ -54,9 +54,9 @@ inline static Display *get_display( HDC hdc )
|
|||
static unsigned int emulated_textureram = 64*1024*1024;
|
||||
|
||||
/* helper macros */
|
||||
#define D3DMEMCHECK(object, ppResult) if(NULL == object){ *ppResult = NULL; WARN("Out of memory\n"); return D3DERR_OUTOFVIDEOMEMORY;}
|
||||
#define D3DMEMCHECK(object, ppResult) if(NULL == object) { *ppResult = NULL; WARN("Out of memory\n"); return D3DERR_OUTOFVIDEOMEMORY;}
|
||||
|
||||
#define D3DCREATEOBJECTINSTANCE(object, type){ \
|
||||
#define D3DCREATEOBJECTINSTANCE(object, type) { \
|
||||
object=HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IWineD3D##type##Impl)); \
|
||||
D3DMEMCHECK(object, pp##type); \
|
||||
object->lpVtbl = &IWineD3D##type##_Vtbl; \
|
||||
|
@ -325,7 +325,7 @@ ULONG WINAPI IWineD3DDeviceImpl_Release(IWineD3DDevice *iface) {
|
|||
IUnknown* swapChainParent;
|
||||
|
||||
/* Release all of the swapchains, except the implicit swapchain (#0) */
|
||||
for(i = 1; i < This->numberOfSwapChains; i++){
|
||||
for(i = 1; i < This->numberOfSwapChains; i++) {
|
||||
/* TODO: don't access swapchains[x] directly! */
|
||||
IWineD3DSwapChain_Release(This->swapchains[i]);
|
||||
}
|
||||
|
@ -339,7 +339,7 @@ ULONG WINAPI IWineD3DDeviceImpl_Release(IWineD3DDevice *iface) {
|
|||
/* TODO: don't access swapchains[x] directly!, check that there are no-more swapchains left for this device! */
|
||||
IWineD3DSwapChain_GetParent(This->swapchains[0], &swapChainParent);
|
||||
IUnknown_Release(swapChainParent); /* once for the get parent */
|
||||
if (IUnknown_Release(swapChainParent) > 0){ /* the second time for when it was created */
|
||||
if (IUnknown_Release(swapChainParent) > 0) { /* the second time for when it was created */
|
||||
FIXME("(%p) Something's still holding the implicit swapchain\n",This);
|
||||
}
|
||||
}
|
||||
|
@ -423,7 +423,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface, D3DSTA
|
|||
/* Otherwise, might as well set the whole state block to the appropriate values */
|
||||
IWineD3DDevice_AddRef(iface);
|
||||
/* Otherwise, might as well set the whole state block to the appropriate values */
|
||||
if ( This->stateBlock != NULL){
|
||||
if ( This->stateBlock != NULL) {
|
||||
memcpy(object, This->stateBlock, sizeof(IWineD3DStateBlockImpl));
|
||||
} else {
|
||||
memset(object->streamFreq, 1, sizeof(object->streamFreq));
|
||||
|
@ -453,8 +453,8 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface, D3DSTA
|
|||
}
|
||||
}
|
||||
/* Setting sampler block changes states */
|
||||
for (j = 0 ; j < GL_LIMITS(samplers); j++){
|
||||
for (i =0; i < NUM_SAVEDPIXELSTATES_S;i++){
|
||||
for (j = 0 ; j < GL_LIMITS(samplers); j++) {
|
||||
for (i =0; i < NUM_SAVEDPIXELSTATES_S;i++) {
|
||||
|
||||
object->changed.samplerState[j][SavedPixelStates_S[i]] = TRUE;
|
||||
}
|
||||
|
@ -474,8 +474,8 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateStateBlock(IWineD3DDevice* iface, D3DSTA
|
|||
}
|
||||
}
|
||||
/* Setting sampler block changes states */
|
||||
for (j = 0 ; j < GL_LIMITS(samplers); j++){
|
||||
for (i =0; i < NUM_SAVEDVERTEXSTATES_S;i++){
|
||||
for (j = 0 ; j < GL_LIMITS(samplers); j++) {
|
||||
for (i =0; i < NUM_SAVEDVERTEXSTATES_S;i++) {
|
||||
object->changed.samplerState[j][SavedVertexStates_S[i]] = TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -561,7 +561,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Wid
|
|||
return D3DERR_INVALIDCALL; /* TODO: Check that this is the case! */
|
||||
}
|
||||
|
||||
if(MultisampleQuality > 0){
|
||||
if(MultisampleQuality > 0) {
|
||||
FIXME("MultisampleQuality set to %ld, substituting 0 \n" , MultisampleQuality);
|
||||
MultisampleQuality=0;
|
||||
}
|
||||
|
@ -665,7 +665,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateSurface(IWineD3DDevice *iface, UINT Wid
|
|||
break;
|
||||
};
|
||||
|
||||
if (Usage & D3DUSAGE_RENDERTARGET && Pool != D3DPOOL_DEFAULT){
|
||||
if (Usage & D3DUSAGE_RENDERTARGET && Pool != D3DPOOL_DEFAULT) {
|
||||
FIXME("Trying to create a render target that isn't in the default pool\n");
|
||||
}
|
||||
|
||||
|
@ -722,11 +722,11 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface, UINT Wid
|
|||
{
|
||||
/* use the callback to create the texture surface */
|
||||
hr = D3DCB_CreateSurface(This->parent, tmpW, tmpH, Format, Usage, Pool, i, &object->surfaces[i],NULL);
|
||||
if(hr!= D3D_OK){
|
||||
if(hr!= D3D_OK) {
|
||||
int j;
|
||||
FIXME("Failed to create surface %p \n",object);
|
||||
/* clean up */
|
||||
for(j=0;j<i;j++){
|
||||
for(j = 0 ; j < i ; j++) {
|
||||
IWineD3DSurface_Release(object->surfaces[j]);
|
||||
}
|
||||
/* heap free object */
|
||||
|
@ -878,7 +878,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface, UINT
|
|||
hr=D3DCB_CreateSurface(This->parent, tmpW, tmpW, Format, Usage, Pool,
|
||||
i /* Level */, &object->surfaces[j][i],pSharedHandle);
|
||||
|
||||
if(hr!= D3D_OK){
|
||||
if(hr!= D3D_OK) {
|
||||
/* clean up */
|
||||
int k;
|
||||
int l;
|
||||
|
@ -907,15 +907,15 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateCubeTexture(IWineD3DDevice *iface, UINT
|
|||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINED3DQUERYTYPE Type, IWineD3DQuery **ppQuery, IUnknown* parent){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINED3DQUERYTYPE Type, IWineD3DQuery **ppQuery, IUnknown* parent) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
IWineD3DQueryImpl *object; /*NOTE: impl ref allowed since this is a create function */
|
||||
|
||||
if(NULL == ppQuery){
|
||||
if(NULL == ppQuery) {
|
||||
/* Just a check to see if we support this type of query */
|
||||
HRESULT hr = D3DERR_NOTAVAILABLE;
|
||||
/* Lie and say everything is good (we can return ok fake data from a stub) */
|
||||
switch(Type){
|
||||
switch(Type) {
|
||||
case WINED3DQUERYTYPE_VCACHE:
|
||||
case WINED3DQUERYTYPE_RESOURCEMANAGER:
|
||||
case WINED3DQUERYTYPE_VERTEXSTATS:
|
||||
|
@ -950,7 +950,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateQuery(IWineD3DDevice *iface, WINED3DQUER
|
|||
HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevice* iface, WINED3DPRESENT_PARAMETERS* pPresentationParameters, IWineD3DSwapChain** ppSwapChain,
|
||||
IUnknown* parent,
|
||||
D3DCB_CREATERENDERTARGETFN D3DCB_CreateRenderTarget,
|
||||
D3DCB_CREATEDEPTHSTENCILSURFACEFN D3DCB_CreateDepthStencil){
|
||||
D3DCB_CREATEDEPTHSTENCILSURFACEFN D3DCB_CreateDepthStencil) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
|
||||
HDC hDc;
|
||||
|
@ -1026,7 +1026,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevice* ifac
|
|||
TRACE("Using x visual ID : %ld\n", template.visualid);
|
||||
TRACE(" visual info: %p\n", object->visInfo);
|
||||
TRACE(" num items : %d\n", num);
|
||||
for(n = 0;n < num; n++){
|
||||
for(n = 0;n < num; n++) {
|
||||
TRACE("=====item=====: %d\n", n + 1);
|
||||
TRACE(" visualid : %ld\n", object->visInfo[n].visualid);
|
||||
TRACE(" screen : %d\n", object->visInfo[n].screen);
|
||||
|
@ -1244,7 +1244,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevice* ifac
|
|||
object->drawable = object->win;
|
||||
object->render_ctx = object->glCtx;
|
||||
|
||||
if(hr == D3D_OK){
|
||||
if(hr == D3D_OK) {
|
||||
/*********************
|
||||
* Setup some defaults and clear down the buffers
|
||||
*******************/
|
||||
|
@ -1308,14 +1308,14 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevice* ifac
|
|||
if (object->frontBuffer) {
|
||||
IWineD3DSurface_GetParent(object->frontBuffer, &bufferParent);
|
||||
IUnknown_Release(bufferParent); /* once for the get parent */
|
||||
if(IUnknown_Release(bufferParent) > 0){
|
||||
if(IUnknown_Release(bufferParent) > 0) {
|
||||
FIXME("(%p) Something's still holding the front buffer\n",This);
|
||||
}
|
||||
}
|
||||
if (object->backBuffer) {
|
||||
IWineD3DSurface_GetParent(object->backBuffer, &bufferParent);
|
||||
IUnknown_Release(bufferParent); /* once for the get parent */
|
||||
if(IUnknown_Release(bufferParent) > 0){
|
||||
if(IUnknown_Release(bufferParent) > 0) {
|
||||
FIXME("(%p) Something's still holding the back buffer\n",This);
|
||||
}
|
||||
}
|
||||
|
@ -1323,7 +1323,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevice* ifac
|
|||
/* Clean up the context */
|
||||
/* check that we are the current context first (we shouldn't be though!) */
|
||||
if (object->glCtx != 0) {
|
||||
if(glXGetCurrentContext() == object->glCtx){
|
||||
if(glXGetCurrentContext() == object->glCtx) {
|
||||
glXMakeCurrent(object->display, None, NULL);
|
||||
}
|
||||
glXDestroyContext(object->display, object->glCtx);
|
||||
|
@ -1347,7 +1347,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetSwapChain(IWineD3DDevice *iface, UINT iSw
|
|||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) : swapchain %d \n", This, iSwapChain);
|
||||
|
||||
if(iSwapChain >= IWineD3DDeviceImpl_GetNumberOfSwapChains(iface) || iSwapChain < 0){
|
||||
if(iSwapChain >= IWineD3DDeviceImpl_GetNumberOfSwapChains(iface) || iSwapChain < 0) {
|
||||
*pSwapChain = NULL;
|
||||
return D3DERR_INVALIDCALL;
|
||||
}else{
|
||||
|
@ -1362,7 +1362,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetSwapChain(IWineD3DDevice *iface, UINT iSw
|
|||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRESENT_PARAMETERS* pPresentationParameters){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_Reset(IWineD3DDevice* iface, WINED3DPRESENT_PARAMETERS* pPresentationParameters) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
|
||||
FIXME("(%p) : Stub\n",This);
|
||||
|
@ -1387,7 +1387,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexDeclaration(IWineD3DDevice* iface,
|
|||
}
|
||||
|
||||
/* http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/graphics/programmingguide/programmable/vertexshaders/vscreate.asp */
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexShader(IWineD3DDevice* iface, CONST DWORD* pFunction, IWineD3DVertexShader** ppVertexShader, IUnknown *parent){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexShader(IWineD3DDevice* iface, CONST DWORD* pFunction, IWineD3DVertexShader** ppVertexShader, IUnknown *parent) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
IWineD3DVertexShaderImpl *object; /* NOTE: impl usage is ok, this is a create */
|
||||
D3DCREATEOBJECTINSTANCE(object, VertexShader)
|
||||
|
@ -1397,13 +1397,13 @@ HRESULT WINAPI IWineD3DDeviceImpl_CreateVertexShader(IWineD3DDevice* iface, CON
|
|||
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_CreatePixelShader(IWineD3DDevice* iface, CONST DWORD* pFunction, IWineD3DPixelShader** ppPixelShader, IUnknown *parent){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_CreatePixelShader(IWineD3DDevice* iface, CONST DWORD* pFunction, IWineD3DPixelShader** ppPixelShader, IUnknown *parent) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
FIXME("(%p) : Stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetDirect3D(IWineD3DDevice* iface, IWineD3D** ppD3D){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetDirect3D(IWineD3DDevice* iface, IWineD3D** ppD3D) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
*ppD3D= This->wineD3D;
|
||||
TRACE("(%p) : wineD3D returning %p\n", This, *ppD3D);
|
||||
|
@ -1511,19 +1511,18 @@ VertexOffset = StartVertex / Divider * StreamStride +
|
|||
VertexIndex / Divider * StreamStride + StreamOffset
|
||||
|
||||
*/
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetStreamSourceFreq(IWineD3DDevice *iface, UINT StreamNumber, UINT Divider){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetStreamSourceFreq(IWineD3DDevice *iface, UINT StreamNumber, UINT Divider) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
|
||||
FIXME("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
|
||||
}
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetStreamSourceFreq(IWineD3DDevice *iface, UINT StreamNumber, UINT* Divider){
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetStreamSourceFreq(IWineD3DDevice *iface, UINT StreamNumber, UINT* Divider) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
|
||||
FIXME("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
|
||||
}
|
||||
|
||||
/*****
|
||||
|
@ -1605,7 +1604,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetTransform(IWineD3DDevice *iface, D3DTRANS
|
|||
|
||||
PLIGHTINFOEL *lightChain = NULL;
|
||||
This->modelview_valid = FALSE;
|
||||
This->view_ident = !memcmp(lpmatrix, identity, 16*sizeof(float));
|
||||
This->view_ident = !memcmp(lpmatrix, identity, 16 * sizeof(float));
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
checkGLcall("glMatrixMode(GL_MODELVIEW)");
|
||||
|
@ -2330,8 +2329,10 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetViewport(IWineD3DDevice *iface, CONST WINED
|
|||
checkGLcall("glDepthRange");
|
||||
/* Note: GL requires lower left, DirectX supplies upper left */
|
||||
/* TODO: replace usage of renderTarget with context management */
|
||||
glViewport(pViewport->X, (((IWineD3DSurfaceImpl *)This->renderTarget)->currentDesc.Height - (pViewport->Y + pViewport->Height)),
|
||||
pViewport->Width, pViewport->Height);
|
||||
glViewport(pViewport->X,
|
||||
(((IWineD3DSurfaceImpl *)This->renderTarget)->currentDesc.Height - (pViewport->Y + pViewport->Height)),
|
||||
pViewport->Width, pViewport->Height);
|
||||
|
||||
checkGLcall("glViewport");
|
||||
|
||||
LEAVE_GL();
|
||||
|
@ -3233,7 +3234,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetRenderState(IWineD3DDevice *iface, D3DRENDE
|
|||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetSamplerState(IWineD3DDevice *iface, DWORD Sampler, WINED3DSAMPLERSTATETYPE Type, DWORD Value){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetSamplerState(IWineD3DDevice *iface, DWORD Sampler, WINED3DSAMPLERSTATETYPE Type, DWORD Value) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
/**
|
||||
* SetSampler is designed to allow for more than the standard up to 8 textures
|
||||
|
@ -3256,7 +3257,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetSamplerState(IWineD3DDevice *iface, DWORD S
|
|||
|
||||
TRACE("(%p) Sampler(%ld), Type(%d) Value(%ld)\n",This, Sampler ,Type, Value);
|
||||
|
||||
if(Sampler > GL_LIMITS(samplers) || Sampler < 0 || Type > HIGHEST_SAMPLER_STATE || Type < 0){
|
||||
if(Sampler > GL_LIMITS(samplers) || Sampler < 0 || Type > HIGHEST_SAMPLER_STATE || Type < 0) {
|
||||
FIXME("out of range %d %d sampler %ld type %u\n", GL_LIMITS(samplers), HIGHEST_SAMPLER_STATE, Sampler, Type);
|
||||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
@ -3524,7 +3525,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetSamplerState(IWineD3DDevice *iface, DWORD S
|
|||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetSamplerState(IWineD3DDevice *iface, DWORD Sampler, WINED3DSAMPLERSTATETYPE Type, DWORD* Value){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetSamplerState(IWineD3DDevice *iface, DWORD Sampler, WINED3DSAMPLERSTATETYPE Type, DWORD* Value) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
/** TODO: check that sampler is in range **/
|
||||
*Value = This->updateStateBlock->samplerState[Sampler][Type];
|
||||
|
@ -3533,7 +3534,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetSamplerState(IWineD3DDevice *iface, DWORD S
|
|||
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetScissorRect(IWineD3DDevice *iface, CONST RECT* pRect){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetScissorRect(IWineD3DDevice *iface, CONST RECT* pRect) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
ENTER_GL();
|
||||
|
||||
|
@ -3544,7 +3545,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetScissorRect(IWineD3DDevice *iface, CONST RE
|
|||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetScissorRect(IWineD3DDevice *iface, RECT* pRect){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetScissorRect(IWineD3DDevice *iface, RECT* pRect) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
GLint scissorBox[4];
|
||||
|
||||
|
@ -3588,7 +3589,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetVertexDeclaration(IWineD3DDevice* iface, IW
|
|||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShader(IWineD3DDevice *iface, IWineD3DVertexShader* pShader){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShader(IWineD3DDevice *iface, IWineD3DVertexShader* pShader) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
|
||||
static BOOL showFixmes = TRUE;
|
||||
|
@ -3597,11 +3598,11 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShader(IWineD3DDevice *iface, IWineD3
|
|||
This->updateStateBlock->changed.vertexShader = TRUE;
|
||||
This->updateStateBlock->set.vertexShader = TRUE;
|
||||
|
||||
if(pShader == NULL){
|
||||
if(pShader == NULL) {
|
||||
/* clear down the shader */
|
||||
TRACE("Clear down the shader\n");
|
||||
}else{
|
||||
if(showFixmes){
|
||||
if(showFixmes) {
|
||||
FIXME("(%p) : stub pShader(%p)\n", This, pShader);
|
||||
showFixmes = FALSE;
|
||||
}
|
||||
|
@ -3633,7 +3634,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShader(IWineD3DDevice *iface, IWineD3
|
|||
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetVertexShader(IWineD3DDevice *iface, IWineD3DVertexShader** ppShader){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetVertexShader(IWineD3DDevice *iface, IWineD3DVertexShader** ppShader) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
*ppShader = This->stateBlock->vertexShader;
|
||||
if(*ppShader != NULL)
|
||||
|
@ -3642,93 +3643,93 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetVertexShader(IWineD3DDevice *iface, IWineD3
|
|||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShaderConstantB(IWineD3DDevice *iface, UINT StartRegister, CONST BOOL *pConstantData, UINT BoolCount){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShaderConstantB(IWineD3DDevice *iface, UINT StartRegister, CONST BOOL *pConstantData, UINT BoolCount) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
|
||||
TRACE("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetVertexShaderConstantB(IWineD3DDevice *iface, UINT StartRegister, BOOL *pConstantData, UINT BoolCount){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetVertexShaderConstantB(IWineD3DDevice *iface, UINT StartRegister, BOOL *pConstantData, UINT BoolCount) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShaderConstantI(IWineD3DDevice *iface, UINT StartRegister, CONST int *pConstantData, UINT Vector4iCount){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShaderConstantI(IWineD3DDevice *iface, UINT StartRegister, CONST int *pConstantData, UINT Vector4iCount) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetVertexShaderConstantI(IWineD3DDevice *iface, UINT StartRegister, int *pConstantData, UINT Vector4iCount){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetVertexShaderConstantI(IWineD3DDevice *iface, UINT StartRegister, int *pConstantData, UINT Vector4iCount) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShaderConstantF(IWineD3DDevice *iface, UINT StartRegister, CONST float *pConstantData, UINT Vector4fCount){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetVertexShaderConstantF(IWineD3DDevice *iface, UINT StartRegister, CONST float *pConstantData, UINT Vector4fCount) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetVertexShaderConstantF(IWineD3DDevice *iface, UINT StartRegister, float *pConstantData, UINT Vector4fCount){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetVertexShaderConstantF(IWineD3DDevice *iface, UINT StartRegister, float *pConstantData, UINT Vector4fCount) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShader(IWineD3DDevice *iface, IWineD3DPixelShader *pShader){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShader(IWineD3DDevice *iface, IWineD3DPixelShader *pShader) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetPixelShader(IWineD3DDevice *iface, IWineD3DPixelShader **ppShader){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetPixelShader(IWineD3DDevice *iface, IWineD3DPixelShader **ppShader) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShaderConstantB(IWineD3DDevice *iface, UINT StartRegister, CONST BOOL *pConstantData, UINT BoolCount){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShaderConstantB(IWineD3DDevice *iface, UINT StartRegister, CONST BOOL *pConstantData, UINT BoolCount) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetPixelShaderConstantB(IWineD3DDevice *iface, UINT StartRegister, BOOL *pConstantData, UINT BoolCount){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetPixelShaderConstantB(IWineD3DDevice *iface, UINT StartRegister, BOOL *pConstantData, UINT BoolCount) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShaderConstantI(IWineD3DDevice *iface, UINT StartRegister, CONST int *pConstantData, UINT Vector4iCount){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShaderConstantI(IWineD3DDevice *iface, UINT StartRegister, CONST int *pConstantData, UINT Vector4iCount) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetPixelShaderConstantI(IWineD3DDevice *iface, UINT StartRegister, int *pConstantData, UINT Vector4iCount){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetPixelShaderConstantI(IWineD3DDevice *iface, UINT StartRegister, int *pConstantData, UINT Vector4iCount) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShaderConstantF(IWineD3DDevice *iface, UINT StartRegister, CONST float *pConstantData, UINT Vector4fCount){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetPixelShaderConstantF(IWineD3DDevice *iface, UINT StartRegister, CONST float *pConstantData, UINT Vector4fCount) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetPixelShaderConstantF(IWineD3DDevice *iface, UINT StartRegister, float *pConstantData, UINT Vector4fCount){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetPixelShaderConstantF(IWineD3DDevice *iface, UINT StartRegister, float *pConstantData, UINT Vector4fCount) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_ProcessVertices(IWineD3DDevice *iface, UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IWineD3DVertexBuffer* pDestBuffer, IWineD3DVertexBuffer* pVertexDecl, DWORD Flags){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_ProcessVertices(IWineD3DDevice *iface, UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IWineD3DVertexBuffer* pDestBuffer, IWineD3DVertexBuffer* pVertexDecl, DWORD Flags) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
FIXME("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
|
@ -4264,7 +4265,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetBackBuffer(IWineD3DDevice *iface, UINT iSwa
|
|||
TRACE("(%p) : BackBuf %d Type %d SwapChain %d returning %p\n", This, BackBuffer, Type, iSwapChain, *ppBackBuffer);
|
||||
|
||||
hr = IWineD3DDeviceImpl_GetSwapChain(iface, iSwapChain, &swapChain);
|
||||
if(hr == D3D_OK){
|
||||
if(hr == D3D_OK) {
|
||||
hr = IWineD3DSwapChain_GetBackBuffer(swapChain, BackBuffer, Type, ppBackBuffer);
|
||||
IWineD3DSwapChain_Release(swapChain);
|
||||
}else{
|
||||
|
@ -4302,7 +4303,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetDisplayMode(IWineD3DDevice *iface, UINT iSw
|
|||
IWineD3DStateBlockImpl *object;
|
||||
TRACE("(%p)", This);
|
||||
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IWineD3DStateBlockImpl));
|
||||
if(NULL == object ){
|
||||
if(NULL == object ) {
|
||||
FIXME("(%p)Error allocating memory for stateblock\n", This);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
@ -4360,7 +4361,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_EndScene(IWineD3DDevice *iface) {
|
|||
checkGLcall("glFlush");
|
||||
|
||||
TRACE("End Scene\n");
|
||||
if(This->renderTarget != NULL){
|
||||
if(This->renderTarget != NULL) {
|
||||
|
||||
/* If the container of the rendertarget is a texture then we need to save the data from the pbuffer */
|
||||
IUnknown *targetContainer = NULL;
|
||||
|
@ -4376,7 +4377,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_EndScene(IWineD3DDevice *iface) {
|
|||
IWineD3DSurface_SetPBufferState(This->renderTarget, FALSE /* inPBuffer */, FALSE /* inTexture */);
|
||||
IUnknown_Release(targetContainer);
|
||||
} else
|
||||
if (D3D_OK == IWineD3DSurface_GetContainer(This->renderTarget, &IID_IWineD3DDevice, (void **)&targetContainer)){
|
||||
if (D3D_OK == IWineD3DSurface_GetContainer(This->renderTarget, &IID_IWineD3DDevice, (void **)&targetContainer)) {
|
||||
/* The surface is stand-alone, so doesn't currently have a context of it's own */
|
||||
TRACE("(%p) : standalone rendertarget %p\n", This, This->renderTarget);
|
||||
IWineD3DSurface_SetPBufferState(This->renderTarget, TRUE /* inPBuffer */, FALSE /* inTexture */);
|
||||
|
@ -4402,7 +4403,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_Present(IWineD3DDevice *iface,
|
|||
|
||||
TRACE("(%p) Presenting the frame\n", This);
|
||||
|
||||
for(i = 0 ; i < swapchains ; i ++){
|
||||
for(i = 0 ; i < swapchains ; i ++) {
|
||||
|
||||
IWineD3DDeviceImpl_GetSwapChain(iface, i , (IWineD3DSwapChain **)&swapChain);
|
||||
TRACE("presentinng chain %d, %p\n", i, swapChain);
|
||||
|
@ -4695,18 +4696,18 @@ HRESULT WINAPI IWineD3DDeviceImpl_StretchRect(IWineD3DDevice *iface, IWineD3DS
|
|||
TRACE("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetRenderTargetData(IWineD3DDevice *iface, IWineD3DSurface *pRenderTarget, IWineD3DSurface *pSurface){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetRenderTargetData(IWineD3DDevice *iface, IWineD3DSurface *pRenderTarget, IWineD3DSurface *pSurface) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
|
||||
TRACE("(%p) : stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetFrontBufferData(IWineD3DDevice *iface,UINT iSwapChain, IWineD3DSurface *pDestSurface){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetFrontBufferData(IWineD3DDevice *iface,UINT iSwapChain, IWineD3DSurface *pDestSurface) {
|
||||
IWineD3DSwapChain *swapChain;
|
||||
HRESULT hr;
|
||||
hr = IWineD3DDeviceImpl_GetSwapChain(iface, iSwapChain, (IWineD3DSwapChain **)&swapChain);
|
||||
if(hr == D3D_OK){
|
||||
if(hr == D3D_OK) {
|
||||
hr = IWineD3DSwapChain_GetFrontBufferData(swapChain, pDestSurface);
|
||||
IWineD3DSwapChain_Release(swapChain);
|
||||
}
|
||||
|
@ -4772,8 +4773,8 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetRasterStatus(IWineD3DDevice *iface, UINT
|
|||
HRESULT WINAPI IWineD3DDeviceImpl_SetNPatchMode(IWineD3DDevice *iface, float nSegments) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
static BOOL showfixmes = TRUE;
|
||||
if(nSegments != 0.0f){
|
||||
if( showfixmes){
|
||||
if(nSegments != 0.0f) {
|
||||
if( showfixmes) {
|
||||
FIXME("(%p) : stub nSegments(%f)\n", This, nSegments);
|
||||
showfixmes = FALSE;
|
||||
}
|
||||
|
@ -4784,7 +4785,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetNPatchMode(IWineD3DDevice *iface, float n
|
|||
float WINAPI IWineD3DDeviceImpl_GetNPatchMode(IWineD3DDevice *iface) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
static BOOL showfixmes = TRUE;
|
||||
if( showfixmes){
|
||||
if( showfixmes) {
|
||||
FIXME("(%p) : stub returning(%f)\n", This, 0.0f);
|
||||
showfixmes = FALSE;
|
||||
}
|
||||
|
@ -4966,7 +4967,7 @@ OpenGL evaluators or tessellate surfaces within your application.
|
|||
*/
|
||||
|
||||
/* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/d3d/interfaces/idirect3ddevice9/DrawRectPatch.asp */
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_DrawRectPatch(IWineD3DDevice *iface, UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_DrawRectPatch(IWineD3DDevice *iface, UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) Handle(%d) noSegs(%p) rectpatch(%p) \n", This, Handle, pNumSegs, pRectPatchInfo);
|
||||
FIXME("(%p) : Stub\n", This);
|
||||
|
@ -4975,21 +4976,21 @@ HRESULT WINAPI IWineD3DDeviceImpl_DrawRectPatch(IWineD3DDevice *iface, UINT Hand
|
|||
}
|
||||
|
||||
/* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/d3d/interfaces/idirect3ddevice9/DrawTriPatch.asp */
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_DrawTriPatch(IWineD3DDevice *iface, UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_DrawTriPatch(IWineD3DDevice *iface, UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) Handle(%d) noSegs(%p) tripatch(%p) \n", This, Handle, pNumSegs, pTriPatchInfo);
|
||||
FIXME("(%p) : Stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_DeletePatch(IWineD3DDevice *iface, UINT Handle){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_DeletePatch(IWineD3DDevice *iface, UINT Handle) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
TRACE("(%p) Handle(%d)\n", This, Handle);
|
||||
FIXME("(%p) : Stub\n", This);
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface, IWineD3DSurface *pSurface, CONST D3DRECT* pRect, D3DCOLOR color){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface, IWineD3DSurface *pSurface, CONST D3DRECT* pRect, D3DCOLOR color) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
|
||||
|
||||
FIXME("(%p) : stub\n", This);
|
||||
|
@ -4997,7 +4998,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_ColorFill(IWineD3DDevice *iface, IWineD3DSurfa
|
|||
}
|
||||
|
||||
/* rendertarget and deptth stencil functions */
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetRenderTarget(IWineD3DDevice* iface,DWORD RenderTargetIndex, IWineD3DSurface **ppRenderTarget){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetRenderTarget(IWineD3DDevice* iface,DWORD RenderTargetIndex, IWineD3DSurface **ppRenderTarget) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
|
||||
/* FIXME: Implelent RenderTargetIndex >0 */
|
||||
|
@ -5012,12 +5013,12 @@ HRESULT WINAPI IWineD3DDeviceImpl_GetRenderTarget(IWineD3DDevice* iface,DWORD
|
|||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetDepthStencilSurface(IWineD3DDevice* iface, IWineD3DSurface **ppZStencilSurface){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_GetDepthStencilSurface(IWineD3DDevice* iface, IWineD3DSurface **ppZStencilSurface) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
*ppZStencilSurface = (IWineD3DSurface *)This->depthStencilBuffer;
|
||||
TRACE("(%p) : zStencilSurface returning %p\n", This, *ppZStencilSurface);
|
||||
|
||||
if(*ppZStencilSurface != NULL){
|
||||
if(*ppZStencilSurface != NULL) {
|
||||
/* Note inc ref on returned surface */
|
||||
IWineD3DSurface_AddRef(*ppZStencilSurface);
|
||||
}
|
||||
|
@ -5030,7 +5031,7 @@ HRESULT WINAPI static IWineD3DDeviceImpl_ActiveRender(IWineD3DDevice* iface,
|
|||
|
||||
HRESULT WINAPI static IWineD3DDeviceImpl_CleanRender(IWineD3DDevice* iface, IWineD3DSwapChainImpl *swapchain);
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface, DWORD RenderTargetIndex, IWineD3DSurface *pRenderTarget){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface, DWORD RenderTargetIndex, IWineD3DSurface *pRenderTarget) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
HRESULT hr = D3D_OK;
|
||||
WINED3DVIEWPORT viewport;
|
||||
|
@ -5091,7 +5092,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetRenderTarget(IWineD3DDevice *iface, DWORD R
|
|||
return hr;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *iface, IWineD3DSurface *pNewZStencil){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *iface, IWineD3DSurface *pNewZStencil) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
HRESULT hr = D3D_OK;
|
||||
WINED3DVIEWPORT viewport;
|
||||
|
@ -5099,7 +5100,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetDepthStencilSurface(IWineD3DDevice *iface,
|
|||
|
||||
TRACE("(%p) Swapping z-buffer\n",This);
|
||||
|
||||
if (pNewZStencil == This->stencilBufferTarget){
|
||||
if (pNewZStencil == This->stencilBufferTarget) {
|
||||
TRACE("Trying to do a NOP SetRenderTarget operation\n");
|
||||
}else{
|
||||
/** OpenGL doesn't support 'sharing' of the stencilBuffer so we may incure an extra memory overhead
|
||||
|
@ -5226,7 +5227,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_ActiveRender(IWineD3DDevice* iface,
|
|||
/** TODO: remove the reff to Impl (context manager should fix this!) **/
|
||||
IWineD3DSwapChainImpl *impSwapChain;
|
||||
IWineD3DDevice_GetSwapChain(iface, 0, (IWineD3DSwapChain **)&impSwapChain);
|
||||
if (NULL == impSwapChain){ /* NOTE: This should NEVER fail */
|
||||
if (NULL == impSwapChain) { /* NOTE: This should NEVER fail */
|
||||
ERR("(%p) Failed to get a the implicit swapchain\n", iface);
|
||||
}
|
||||
|
||||
|
@ -5245,7 +5246,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_ActiveRender(IWineD3DDevice* iface,
|
|||
cfgs = glXChooseFBConfig(impSwapChain->display, DefaultScreen(impSwapChain->display),
|
||||
attribs, &nCfgs);
|
||||
|
||||
if (!cfgs){ /* OK we didn't find the exact config, so use any reasonable match */
|
||||
if (!cfgs) { /* OK we didn't find the exact config, so use any reasonable match */
|
||||
/* TODO: fill in the 'requested' and 'current' depths, also make sure that's
|
||||
why we failed and only show this message once! */
|
||||
MESSAGE("Failed to find exact match, finding alternative but you may suffer performance issues, try changing xfree's depth to match the requested depth\n"); /**/
|
||||
|
@ -5287,7 +5288,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_ActiveRender(IWineD3DDevice* iface,
|
|||
#endif
|
||||
}
|
||||
|
||||
if (IWineD3DSurface_GetContainer(This->renderTarget, &IID_IWineD3DSwapChain, (void **)¤tSwapchain) != D3D_OK){
|
||||
if (IWineD3DSurface_GetContainer(This->renderTarget, &IID_IWineD3DSwapChain, (void **)¤tSwapchain) != D3D_OK) {
|
||||
/* the selected render target doesn't belong to a swapchain, so use the devices implicit swapchain */
|
||||
IWineD3DDevice_GetSwapChain(iface, 0, ¤tSwapchain);
|
||||
}
|
||||
|
@ -5296,12 +5297,12 @@ HRESULT WINAPI IWineD3DDeviceImpl_ActiveRender(IWineD3DDevice* iface,
|
|||
* TODO: remove the use of IWineD3DSwapChainImpl, a context manager will help since it will replace the
|
||||
* renderTarget = swapchain->backBuffer bit and anything to do with *glContexts
|
||||
**********************************************************************/
|
||||
if (IWineD3DSurface_GetContainer(RenderSurface, &IID_IWineD3DSwapChain, (void **)&swapchain) == D3D_OK){
|
||||
if (IWineD3DSurface_GetContainer(RenderSurface, &IID_IWineD3DSwapChain, (void **)&swapchain) == D3D_OK) {
|
||||
/* We also need to make sure that the lights &co are also in the context of the swapchains */
|
||||
/* FIXME: If the render target gets sent to the frontBuffer should be be presenting it raw? */
|
||||
TRACE("making swapchain active\n");
|
||||
if (RenderSurface != This->renderTarget){
|
||||
if (RenderSurface == swapchain->backBuffer){
|
||||
if (RenderSurface != This->renderTarget) {
|
||||
if (RenderSurface == swapchain->backBuffer) {
|
||||
} else {
|
||||
/* This could be flagged so that some operations work directly with the front buffer */
|
||||
FIXME("Attempting to set the renderTarget to the frontBuffer\n");
|
||||
|
@ -5438,7 +5439,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_ActiveRender(IWineD3DDevice* iface,
|
|||
}
|
||||
#endif
|
||||
/* clean up the current rendertargets swapchain (if it belonged to one) */
|
||||
if (currentSwapchain != NULL){
|
||||
if (currentSwapchain != NULL) {
|
||||
IWineD3DSwapChain_Release((IWineD3DSwapChain *)currentSwapchain);
|
||||
}
|
||||
|
||||
|
@ -5457,7 +5458,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_ActiveRender(IWineD3DDevice* iface,
|
|||
/* Check that the container is not a swapchain member */
|
||||
|
||||
IWineD3DSwapChain *tmpSwapChain;
|
||||
if (D3D_OK != IWineD3DSurface_GetContainer(This->renderTarget, &IID_IWineD3DSwapChain, (void **)&tmpSwapChain)){
|
||||
if (D3D_OK != IWineD3DSurface_GetContainer(This->renderTarget, &IID_IWineD3DSwapChain, (void **)&tmpSwapChain)) {
|
||||
This->renderUpsideDown = TRUE;
|
||||
}else{
|
||||
This->renderUpsideDown = FALSE;
|
||||
|
@ -5475,7 +5476,7 @@ HRESULT WINAPI IWineD3DDeviceImpl_ActiveRender(IWineD3DDevice* iface,
|
|||
|
||||
ret = D3D_OK;
|
||||
|
||||
if (cfgs != NULL){
|
||||
if (cfgs != NULL) {
|
||||
XFree(cfgs);
|
||||
} else {
|
||||
ERR("cannot get valides GLXFBConfig for (%u,%s)/(%u,%s)\n", BackBufferFormat,
|
||||
|
@ -5579,10 +5580,10 @@ HRESULT WINAPI IWineD3DDeviceImpl_Rest(IWineD3DDevice* iface, D3DPRESENT_PARAM
|
|||
return D3D_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetDialogBoxMode(IWineD3DDevice *iface, BOOL bEnableDialogs){
|
||||
HRESULT WINAPI IWineD3DDeviceImpl_SetDialogBoxMode(IWineD3DDevice *iface, BOOL bEnableDialogs) {
|
||||
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
|
||||
/** FIXME: always true at the moment **/
|
||||
if(bEnableDialogs == FALSE){
|
||||
if(bEnableDialogs == FALSE) {
|
||||
FIXME("(%p) Dialogs cannot be disabled yet\n", This);
|
||||
}
|
||||
return D3D_OK;
|
||||
|
@ -5607,7 +5608,7 @@ void WINAPI IWineD3DDeviceImpl_SetGammaRamp(IWineD3DDevice * iface, UINT iSwapCh
|
|||
|
||||
TRACE("Relaying to swapchain\n");
|
||||
|
||||
if ((hrc = IWineD3DDeviceImpl_GetSwapChain(iface, iSwapChain, &swapchain)) == D3D_OK){
|
||||
if ((hrc = IWineD3DDeviceImpl_GetSwapChain(iface, iSwapChain, &swapchain)) == D3D_OK) {
|
||||
IWineD3DSwapChain_SetGammaRamp(swapchain, Flags, (D3DGAMMARAMP *)pRamp);
|
||||
IWineD3DSwapChain_Release(swapchain);
|
||||
}
|
||||
|
@ -5620,7 +5621,7 @@ void WINAPI IWineD3DDeviceImpl_GetGammaRamp(IWineD3DDevice *iface, UINT iSwapCha
|
|||
|
||||
TRACE("Relaying to swapchain\n");
|
||||
|
||||
if ((hrc = IWineD3DDeviceImpl_GetSwapChain(iface, iSwapChain, &swapchain)) == D3D_OK){
|
||||
if ((hrc = IWineD3DDeviceImpl_GetSwapChain(iface, iSwapChain, &swapchain)) == D3D_OK) {
|
||||
hrc =IWineD3DSwapChain_GetGammaRamp(swapchain, pRamp);
|
||||
IWineD3DSwapChain_Release(swapchain);
|
||||
}
|
||||
|
|
|
@ -782,7 +782,7 @@ HRESULT WINAPI IWineD3DImpl_EnumAdapterModes(IWineD3D *iface, UINT Adapter, WINE
|
|||
pMode->Width = 800;
|
||||
pMode->Height = 600;
|
||||
pMode->RefreshRate = D3DADAPTER_DEFAULT;
|
||||
pMode->Format = (Format==D3DFMT_UNKNOWN)?D3DFMT_A8R8G8B8:Format;
|
||||
pMode->Format = (Format == D3DFMT_UNKNOWN) ? D3DFMT_A8R8G8B8 : Format;
|
||||
bpp = 32;
|
||||
#endif
|
||||
TRACE_(d3d_caps)("W %d H %d rr %d fmt (%x - %s) bpp %u\n", pMode->Width, pMode->Height,
|
||||
|
@ -997,9 +997,9 @@ static BOOL IWineD3DImpl_IsGLXFBConfigCompatibleWithDepthFmt(WineD3D_Context* ct
|
|||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DImpl_CheckDepthStencilMatch(IWineD3D *iface, UINT Adapter, D3DDEVTYPE DeviceType,
|
||||
WINED3DFORMAT AdapterFormat,
|
||||
WINED3DFORMAT RenderTargetFormat,
|
||||
WINED3DFORMAT DepthStencilFormat) {
|
||||
WINED3DFORMAT AdapterFormat,
|
||||
WINED3DFORMAT RenderTargetFormat,
|
||||
WINED3DFORMAT DepthStencilFormat) {
|
||||
IWineD3DImpl *This = (IWineD3DImpl *)iface;
|
||||
WARN_(d3d_caps)("(%p)-> (STUB) (Adptr:%d, DevType:(%x,%s), AdptFmt:(%x,%s), RendrTgtFmt:(%x,%s), DepthStencilFmt:(%x,%s))\n",
|
||||
This, Adapter,
|
||||
|
@ -1020,19 +1020,19 @@ HRESULT WINAPI IWineD3DImpl_CheckDepthStencilMatch(IWineD3D *iface, UINT Adapter
|
|||
|
||||
WineD3D_Context* ctx = WineD3D_CreateFakeGLContext();
|
||||
if (NULL != ctx) {
|
||||
cfgs = glXGetFBConfigs(ctx->display, DefaultScreen(ctx->display), &nCfgs);
|
||||
for (it = 0; it < nCfgs; ++it) {
|
||||
if (IWineD3DImpl_IsGLXFBConfigCompatibleWithRenderFmt(ctx, cfgs[it], RenderTargetFormat)) {
|
||||
if (IWineD3DImpl_IsGLXFBConfigCompatibleWithDepthFmt(ctx, cfgs[it], DepthStencilFormat)) {
|
||||
hr = D3D_OK;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
}
|
||||
XFree(cfgs);
|
||||
cfgs = glXGetFBConfigs(ctx->display, DefaultScreen(ctx->display), &nCfgs);
|
||||
for (it = 0; it < nCfgs; ++it) {
|
||||
if (IWineD3DImpl_IsGLXFBConfigCompatibleWithRenderFmt(ctx, cfgs[it], RenderTargetFormat)) {
|
||||
if (IWineD3DImpl_IsGLXFBConfigCompatibleWithDepthFmt(ctx, cfgs[it], DepthStencilFormat)) {
|
||||
hr = D3D_OK;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
}
|
||||
XFree(cfgs);
|
||||
|
||||
WineD3D_ReleaseFakeGLContext(ctx);
|
||||
return hr;
|
||||
WineD3D_ReleaseFakeGLContext(ctx);
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1040,8 +1040,8 @@ HRESULT WINAPI IWineD3DImpl_CheckDepthStencilMatch(IWineD3D *iface, UINT Adapter
|
|||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DImpl_CheckDeviceMultiSampleType(IWineD3D *iface, UINT Adapter, D3DDEVTYPE DeviceType,
|
||||
WINED3DFORMAT SurfaceFormat,
|
||||
BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) {
|
||||
WINED3DFORMAT SurfaceFormat,
|
||||
BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) {
|
||||
|
||||
IWineD3DImpl *This = (IWineD3DImpl *)iface;
|
||||
TRACE_(d3d_caps)("(%p)-> (STUB) (Adptr:%d, DevType:(%x,%s), SurfFmt:(%x,%s), Win?%d, MultiSamp:%x, pQual:%p)\n",
|
||||
|
@ -1058,12 +1058,12 @@ HRESULT WINAPI IWineD3DImpl_CheckDeviceMultiSampleType(IWineD3D *iface, UINT Ada
|
|||
}
|
||||
|
||||
if (pQualityLevels != NULL) {
|
||||
static int s_single_shot = 0;
|
||||
if (!s_single_shot) {
|
||||
FIXME("Quality levels unsupported at present\n");
|
||||
s_single_shot = 1;
|
||||
}
|
||||
*pQualityLevels = 1; /* Guess at a value! */
|
||||
static int s_single_shot = 0;
|
||||
if (!s_single_shot) {
|
||||
FIXME("Quality levels unsupported at present\n");
|
||||
s_single_shot = 1;
|
||||
}
|
||||
*pQualityLevels = 1; /* Guess at a value! */
|
||||
}
|
||||
|
||||
if (D3DMULTISAMPLE_NONE == MultiSampleType) return D3D_OK;
|
||||
|
@ -1071,7 +1071,7 @@ HRESULT WINAPI IWineD3DImpl_CheckDeviceMultiSampleType(IWineD3D *iface, UINT Ada
|
|||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DImpl_CheckDeviceType(IWineD3D *iface, UINT Adapter, D3DDEVTYPE CheckType,
|
||||
WINED3DFORMAT DisplayFormat, WINED3DFORMAT BackBufferFormat, BOOL Windowed) {
|
||||
WINED3DFORMAT DisplayFormat, WINED3DFORMAT BackBufferFormat, BOOL Windowed) {
|
||||
|
||||
IWineD3DImpl *This = (IWineD3DImpl *)iface;
|
||||
TRACE_(d3d_caps)("(%p)-> (STUB) (Adptr:%d, CheckType:(%x,%s), DispFmt:(%x,%s), BackBuf:(%x,%s), Win?%d): stub\n",
|
||||
|
@ -1094,17 +1094,17 @@ HRESULT WINAPI IWineD3DImpl_CheckDeviceType(IWineD3D *iface, UINT Adapter, D3DDE
|
|||
|
||||
WineD3D_Context* ctx = WineD3D_CreateFakeGLContext();
|
||||
if (NULL != ctx) {
|
||||
cfgs = glXGetFBConfigs(ctx->display, DefaultScreen(ctx->display), &nCfgs);
|
||||
for (it = 0; it < nCfgs; ++it) {
|
||||
if (IWineD3DImpl_IsGLXFBConfigCompatibleWithRenderFmt(ctx, cfgs[it], DisplayFormat)) {
|
||||
hr = D3D_OK;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
XFree(cfgs);
|
||||
cfgs = glXGetFBConfigs(ctx->display, DefaultScreen(ctx->display), &nCfgs);
|
||||
for (it = 0; it < nCfgs; ++it) {
|
||||
if (IWineD3DImpl_IsGLXFBConfigCompatibleWithRenderFmt(ctx, cfgs[it], DisplayFormat)) {
|
||||
hr = D3D_OK;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
XFree(cfgs);
|
||||
|
||||
WineD3D_ReleaseFakeGLContext(ctx);
|
||||
return hr;
|
||||
WineD3D_ReleaseFakeGLContext(ctx);
|
||||
return hr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1112,7 +1112,7 @@ HRESULT WINAPI IWineD3DImpl_CheckDeviceType(IWineD3D *iface, UINT Adapter, D3DDE
|
|||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapter, D3DDEVTYPE DeviceType,
|
||||
WINED3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, WINED3DFORMAT CheckFormat) {
|
||||
WINED3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, WINED3DFORMAT CheckFormat) {
|
||||
IWineD3DImpl *This = (IWineD3DImpl *)iface;
|
||||
TRACE_(d3d_caps)("(%p)-> (STUB) (Adptr:%d, DevType:(%u,%s), AdptFmt:(%u,%s), Use:(%lu,%s), ResTyp:(%x,%s), CheckFmt:(%u,%s)) ",
|
||||
This,
|
||||
|
@ -1202,7 +1202,7 @@ HRESULT WINAPI IWineD3DImpl_CheckDeviceFormat(IWineD3D *iface, UINT Adapter, D3D
|
|||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DImpl_CheckDeviceFormatConversion(IWineD3D *iface, UINT Adapter, D3DDEVTYPE DeviceType,
|
||||
WINED3DFORMAT SourceFormat, WINED3DFORMAT TargetFormat) {
|
||||
WINED3DFORMAT SourceFormat, WINED3DFORMAT TargetFormat) {
|
||||
IWineD3DImpl *This = (IWineD3DImpl *)iface;
|
||||
|
||||
FIXME_(d3d_caps)("(%p)-> (STUB) (Adptr:%d, DevType:(%u,%s), SrcFmt:(%u,%s), TgtFmt:(%u,%s))",
|
||||
|
@ -1420,8 +1420,8 @@ HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, D3DDEVT
|
|||
#if 0
|
||||
*pCaps->TextureOpCaps |= D3DTEXOPCAPS_BUMPENVMAP;
|
||||
/* FIXME: Add
|
||||
D3DTEXOPCAPS_BUMPENVMAPLUMINANCE
|
||||
D3DTEXOPCAPS_PREMODULATE */
|
||||
D3DTEXOPCAPS_BUMPENVMAPLUMINANCE
|
||||
D3DTEXOPCAPS_PREMODULATE */
|
||||
#endif
|
||||
|
||||
*pCaps->MaxTextureBlendStages = GL_LIMITS(textures);
|
||||
|
@ -1465,15 +1465,15 @@ HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, D3DDEVT
|
|||
*pCaps->MaxVertexShaderConst = WINED3D_VSHADER_MAX_CONSTANTS;
|
||||
}
|
||||
} else {
|
||||
*pCaps->VertexShaderVersion = 0;
|
||||
*pCaps->VertexShaderVersion = 0;
|
||||
*pCaps->MaxVertexShaderConst = 0;
|
||||
}
|
||||
|
||||
if ((ps_mode == PS_HW) && GL_SUPPORT(ARB_FRAGMENT_PROGRAM) && (DeviceType != D3DDEVTYPE_REF)) {
|
||||
*pCaps->PixelShaderVersion = D3DPS_VERSION(1,4);
|
||||
*pCaps->PixelShaderVersion = D3DPS_VERSION(1,4);
|
||||
*pCaps->PixelShader1xMaxValue = 1.0;
|
||||
} else {
|
||||
*pCaps->PixelShaderVersion = 0;
|
||||
*pCaps->PixelShaderVersion = 0;
|
||||
*pCaps->PixelShader1xMaxValue = 0.0;
|
||||
}
|
||||
/* TODO: ARB_FRAGMENT_PROGRAM_100 */
|
||||
|
@ -1482,7 +1482,7 @@ HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, D3DDEVT
|
|||
The following fields apply to d3d9 only
|
||||
------------------------------------------------ */
|
||||
if (This->dxVersion > 8) {
|
||||
GLint max_buffers=1;
|
||||
GLint max_buffers = 1;
|
||||
FIXME("Caps support for directx9 is nonexistent at the moment!\n");
|
||||
*pCaps->DevCaps2 = 0;
|
||||
/* TODO: D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES */
|
||||
|
@ -1665,9 +1665,11 @@ HRESULT WINAPI IWineD3DImpl_GetParent(IWineD3D *iface, IUnknown **pParent) {
|
|||
|
||||
const IWineD3DVtbl IWineD3D_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IWineD3DImpl_QueryInterface,
|
||||
IWineD3DImpl_AddRef,
|
||||
IWineD3DImpl_Release,
|
||||
/* IWineD3D */
|
||||
IWineD3DImpl_GetParent,
|
||||
IWineD3DImpl_GetAdapterCount,
|
||||
IWineD3DImpl_RegisterSoftwareDevice,
|
||||
|
|
|
@ -865,21 +865,20 @@ void drawStridedFast(IWineD3DDevice *iface, Direct3DVertexStridedData *sd,
|
|||
(sd->u.s.blendMatrixIndices.lpData != NULL)) {
|
||||
#if 1 /* Vertex blend support needs to be added */
|
||||
if (GL_SUPPORT(ARB_VERTEX_BLEND)) {
|
||||
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);
|
||||
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);
|
||||
|
||||
/*FIXME("TODO\n");*/
|
||||
/* Note dwType == float3 or float4 == 2 or 3 */
|
||||
VTRACE(("glWeightPointerARB(%ld, GL_FLOAT, %ld, %p)\n",
|
||||
numBlends,
|
||||
sd->u.s.blendWeights.dwStride,
|
||||
sd->u.s.blendWeights.lpData));
|
||||
GL_EXTCALL(glWeightPointerARB)(numBlends, GL_FLOAT,
|
||||
sd->u.s.blendWeights.dwStride,
|
||||
sd->u.s.blendWeights.lpData);
|
||||
checkGLcall("glWeightPointerARB(...)");
|
||||
glEnableClientState(GL_WEIGHT_ARRAY_ARB);
|
||||
checkGLcall("glEnableClientState(GL_VERTEX_ARRAY)");
|
||||
/* Note dwType == float3 or float4 == 2 or 3 */
|
||||
VTRACE(("glWeightPointerARB(%ld, GL_FLOAT, %ld, %p)\n",
|
||||
numBlends,
|
||||
sd->u.s.blendWeights.dwStride,
|
||||
sd->u.s.blendWeights.lpData));
|
||||
GL_EXTCALL(glWeightPointerARB)(numBlends, GL_FLOAT,
|
||||
sd->u.s.blendWeights.dwStride,
|
||||
sd->u.s.blendWeights.lpData);
|
||||
checkGLcall("glWeightPointerARB(...)");
|
||||
glEnableClientState(GL_WEIGHT_ARRAY_ARB);
|
||||
checkGLcall("glEnableClientState(GL_VERTEX_ARRAY)");
|
||||
} else if (GL_SUPPORT(EXT_VERTEX_WEIGHTING)) {
|
||||
/*FIXME("TODO\n");*/
|
||||
/*
|
||||
|
@ -1029,24 +1028,24 @@ void drawStridedFast(IWineD3DDevice *iface, Direct3DVertexStridedData *sd,
|
|||
GLenum type;
|
||||
|
||||
switch (sd->u.s.texCoords[coordIdx].dwType) {
|
||||
case D3DDECLTYPE_FLOAT1: size = 1, type = GL_FLOAT; break;
|
||||
case D3DDECLTYPE_FLOAT2: size = 2, type = GL_FLOAT; break;
|
||||
case D3DDECLTYPE_FLOAT3: size = 3, type = GL_FLOAT; break;
|
||||
case D3DDECLTYPE_FLOAT4: size = 4, type = GL_FLOAT; break;
|
||||
case D3DDECLTYPE_SHORT2: size = 2, type = GL_SHORT; break;
|
||||
case D3DDECLTYPE_SHORT4: size = 4, type = GL_SHORT; break;
|
||||
case D3DDECLTYPE_UBYTE4: size = 4, type = GL_UNSIGNED_BYTE; break;
|
||||
default: FIXME("Unrecognized data type %ld\n", sd->u.s.texCoords[coordIdx].dwType);
|
||||
case D3DDECLTYPE_FLOAT1: size = 1, type = GL_FLOAT; break;
|
||||
case D3DDECLTYPE_FLOAT2: size = 2, type = GL_FLOAT; break;
|
||||
case D3DDECLTYPE_FLOAT3: size = 3, type = GL_FLOAT; break;
|
||||
case D3DDECLTYPE_FLOAT4: size = 4, type = GL_FLOAT; break;
|
||||
case D3DDECLTYPE_SHORT2: size = 2, type = GL_SHORT; break;
|
||||
case D3DDECLTYPE_SHORT4: size = 4, type = GL_SHORT; break;
|
||||
case D3DDECLTYPE_UBYTE4: size = 4, type = GL_UNSIGNED_BYTE; break;
|
||||
default: FIXME("Unrecognized data type %ld\n", sd->u.s.texCoords[coordIdx].dwType);
|
||||
size = 4; type = GL_UNSIGNED_BYTE;
|
||||
}
|
||||
}
|
||||
|
||||
glTexCoordPointer(size, type, sd->u.s.texCoords[coordIdx].dwStride, sd->u.s.texCoords[coordIdx].lpData);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
} else {
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
GLMULTITEXCOORD4F(textureNo, 0, 0, 0, 1);
|
||||
}
|
||||
glTexCoordPointer(size, type, sd->u.s.texCoords[coordIdx].dwStride, sd->u.s.texCoords[coordIdx].lpData);
|
||||
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
}
|
||||
} else {
|
||||
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
|
||||
GLMULTITEXCOORD4F(textureNo, 0, 0, 0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Ok, Work out which primitive is requested and how many vertexes that
|
||||
|
@ -1332,17 +1331,17 @@ void drawStridedSlow(IWineD3DDevice *iface, Direct3DVertexStridedData *sd,
|
|||
(specularColor >> 8) & 0xFF,
|
||||
(specularColor >> 0) & 0xFF);
|
||||
} else {
|
||||
/* Do not worry if specular colour missing and disable request */
|
||||
VTRACE(("Specular color extensions not supplied\n"));
|
||||
}
|
||||
/* Do not worry if specular colour missing and disable request */
|
||||
VTRACE(("Specular color extensions not supplied\n"));
|
||||
}
|
||||
} else {
|
||||
if (vx_index == 0) {
|
||||
if (GL_SUPPORT(EXT_SECONDARY_COLOR)) {
|
||||
GL_EXTCALL(glSecondaryColor3fEXT)(0, 0, 0);
|
||||
} else {
|
||||
/* Do not worry if specular colour missing and disable request */
|
||||
VTRACE(("Specular color extensions not supplied\n"));
|
||||
}
|
||||
if (GL_SUPPORT(EXT_SECONDARY_COLOR)) {
|
||||
GL_EXTCALL(glSecondaryColor3fEXT)(0, 0, 0);
|
||||
} else {
|
||||
/* Do not worry if specular colour missing and disable request */
|
||||
VTRACE(("Specular color extensions not supplied\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1479,21 +1478,21 @@ void drawStridedSoftwareVS(IWineD3DDevice *iface, Direct3DVertexStridedData *sd,
|
|||
memset(numcoords, 0x00, sizeof(numcoords));
|
||||
for (textureNo = 0; textureNo < GL_LIMITS(textures); ++textureNo) {
|
||||
if (This->stateBlock->textures[textureNo] != NULL) {
|
||||
texcoords[textureNo].x = vertex_shader->output.oT[textureNo].x;
|
||||
texcoords[textureNo].y = vertex_shader->output.oT[textureNo].y;
|
||||
texcoords[textureNo].z = vertex_shader->output.oT[textureNo].z;
|
||||
texcoords[textureNo].w = vertex_shader->output.oT[textureNo].w;
|
||||
texcoords[textureNo].x = vertex_shader->output.oT[textureNo].x;
|
||||
texcoords[textureNo].y = vertex_shader->output.oT[textureNo].y;
|
||||
texcoords[textureNo].z = vertex_shader->output.oT[textureNo].z;
|
||||
texcoords[textureNo].w = vertex_shader->output.oT[textureNo].w;
|
||||
if (This->stateBlock->texture_state[textureNo][D3DTSS_TEXTURETRANSFORMFLAGS] != D3DTTFF_DISABLE) {
|
||||
numcoords[textureNo] = This->stateBlock->texture_state[textureNo][D3DTSS_TEXTURETRANSFORMFLAGS] & ~D3DTTFF_PROJECTED;
|
||||
} else {
|
||||
switch (IDirect3DBaseTexture8Impl_GetType((LPDIRECT3DBASETEXTURE8) This->stateBlock->textures[textureNo])) {
|
||||
case D3DRTYPE_TEXTURE: numcoords[textureNo] = 2; break;
|
||||
case D3DRTYPE_VOLUMETEXTURE: numcoords[textureNo] = 3; break;
|
||||
default: numcoords[textureNo] = 4;
|
||||
case D3DRTYPE_TEXTURE: numcoords[textureNo] = 2; break;
|
||||
case D3DRTYPE_VOLUMETEXTURE: numcoords[textureNo] = 3; break;
|
||||
default: numcoords[textureNo] = 4;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
numcoords[textureNo] = 0;
|
||||
numcoords[textureNo] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1660,10 +1659,10 @@ void drawPrimitive(IWineD3DDevice *iface,
|
|||
vertex_shader = VERTEX_SHADER(This->stateBlock->VertexShader);
|
||||
memset(&vertex_shader->input, 0, sizeof(VSHADERINPUTDATA8));
|
||||
|
||||
useHW = (((vs_mode == VS_HW) && GL_SUPPORT(ARB_VERTEX_PROGRAM)) &&
|
||||
useHW = (((vs_mode == VS_HW) && GL_SUPPORT(ARB_VERTEX_PROGRAM)) &&
|
||||
This->devType != D3DDEVTYPE_REF &&
|
||||
!This->stateBlock->renderState[D3DRS_SOFTWAREVERTEXPROCESSING] &&
|
||||
vertex_shader->usage != D3DUSAGE_SOFTWAREPROCESSING);
|
||||
!This->stateBlock->renderState[D3DRS_SOFTWAREVERTEXPROCESSING] &&
|
||||
vertex_shader->usage != D3DUSAGE_SOFTWAREPROCESSING);
|
||||
|
||||
/** init Constants */
|
||||
if (This->stateBlock->Changed.vertexShaderConstant) {
|
||||
|
@ -1721,8 +1720,8 @@ void drawPrimitive(IWineD3DDevice *iface,
|
|||
|
||||
/* Setup transform matrices and sort out */
|
||||
if (useHW) {
|
||||
/* Lighting is not completely bypassed with ATI drivers although it should be. Mesa is ok from this respect...
|
||||
So make sure lighting is disabled. */
|
||||
/* Lighting is not completely bypassed with ATI drivers although it should be. Mesa is ok from this respect...
|
||||
So make sure lighting is disabled. */
|
||||
isLightingOn = glIsEnabled(GL_LIGHTING);
|
||||
glDisable(GL_LIGHTING);
|
||||
checkGLcall("glDisable(GL_LIGHTING);");
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright 2002-2004 Jason Edmeades
|
||||
* Copyright 2003-2004 Raphael Junqueira
|
||||
* Copyright 2004 Christian Costa
|
||||
* Copyright 2005 Oliver Stieber
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -128,9 +129,11 @@ HRESULT WINAPI IWineD3DIndexBufferImpl_GetDesc(IWineD3DIndexBuffer *ifac
|
|||
|
||||
const IWineD3DIndexBufferVtbl IWineD3DIndexBuffer_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IWineD3DIndexBufferImpl_QueryInterface,
|
||||
IWineD3DIndexBufferImpl_AddRef,
|
||||
IWineD3DIndexBufferImpl_Release,
|
||||
/* IWineD3DResource */
|
||||
IWineD3DIndexBufferImpl_GetParent,
|
||||
IWineD3DIndexBufferImpl_GetDevice,
|
||||
IWineD3DIndexBufferImpl_SetPrivateData,
|
||||
|
@ -140,6 +143,7 @@ const IWineD3DIndexBufferVtbl IWineD3DIndexBuffer_Vtbl =
|
|||
IWineD3DIndexBufferImpl_GetPriority,
|
||||
IWineD3DIndexBufferImpl_PreLoad,
|
||||
IWineD3DIndexBufferImpl_GetType,
|
||||
/* IWineD3DIndexBuffer */
|
||||
IWineD3DIndexBufferImpl_Lock,
|
||||
IWineD3DIndexBufferImpl_Unlock,
|
||||
IWineD3DIndexBufferImpl_GetDesc
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright 2002-2004 Jason Edmeades
|
||||
* Copyright 2003-2004 Raphael Junqueira
|
||||
* Copyright 2004 Christian Costa
|
||||
* Copyright 2005 Oliver Stieber
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -26,7 +27,7 @@
|
|||
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||
#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)
|
||||
{
|
||||
IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface;
|
||||
|
@ -71,7 +72,7 @@ void IWineD3DResourceImpl_CleanUp(IWineD3DResource *iface){
|
|||
This->resource.allocatedMemory = 0;
|
||||
}
|
||||
|
||||
/* IDirect3DResource Interface follow: */
|
||||
/* IWineD3DResource Interface follow: */
|
||||
HRESULT WINAPI IWineD3DResourceImpl_GetDevice(IWineD3DResource *iface, IWineD3DDevice** ppDevice) {
|
||||
IWineD3DResourceImpl *This = (IWineD3DResourceImpl *)iface;
|
||||
TRACE("(%p) : returning %p\n", This, This->resource.wineD3DDevice);
|
||||
|
@ -128,9 +129,11 @@ HRESULT WINAPI IWineD3DResourceImpl_GetParent(IWineD3DResource *iface, IUnknown
|
|||
|
||||
static const IWineD3DResourceVtbl IWineD3DResource_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IWineD3DResourceImpl_QueryInterface,
|
||||
IWineD3DResourceImpl_AddRef,
|
||||
IWineD3DResourceImpl_Release,
|
||||
/* IWineD3DResource */
|
||||
IWineD3DResourceImpl_GetParent,
|
||||
IWineD3DResourceImpl_GetDevice,
|
||||
IWineD3DResourceImpl_SetPrivateData,
|
||||
|
|
|
@ -714,9 +714,11 @@ HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStateBlock*
|
|||
|
||||
const IWineD3DStateBlockVtbl IWineD3DStateBlock_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IWineD3DStateBlockImpl_QueryInterface,
|
||||
IWineD3DStateBlockImpl_AddRef,
|
||||
IWineD3DStateBlockImpl_Release,
|
||||
/* IWineD3DStateBlock */
|
||||
IWineD3DStateBlockImpl_GetParent,
|
||||
IWineD3DStateBlockImpl_GetDevice,
|
||||
IWineD3DStateBlockImpl_Capture,
|
||||
|
|
|
@ -116,7 +116,7 @@ void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface) {
|
|||
TRACE("Passing to conatiner\n");
|
||||
IWineD3DBaseTexture_PreLoad(baseTexture);
|
||||
IWineD3DBaseTexture_Release(baseTexture);
|
||||
} else{
|
||||
} else {
|
||||
TRACE("(%p) : About to load surface\n", This);
|
||||
ENTER_GL();
|
||||
#if 0 /* TODO: context manager support */
|
||||
|
@ -131,7 +131,7 @@ void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface) {
|
|||
checkGLcall("glBindTexture");
|
||||
IWineD3DSurface_LoadTexture(iface);
|
||||
/* This is where we should be reducing the amount of GLMemoryUsed */
|
||||
}else {
|
||||
} else {
|
||||
if (This->glDescription.level == 0) {
|
||||
glBindTexture(This->glDescription.target, This->glDescription.textureName);
|
||||
checkGLcall("glBindTexture");
|
||||
|
@ -158,10 +158,12 @@ void WINAPI IWineD3DSurfaceImpl_PreLoad(IWineD3DSurface *iface) {
|
|||
}
|
||||
|
||||
D3DRESOURCETYPE WINAPI IWineD3DSurfaceImpl_GetType(IWineD3DSurface *iface) {
|
||||
TRACE("(%p) : calling resourceimpl_GetType\n", iface);
|
||||
return IWineD3DResourceImpl_GetType((IWineD3DResource *)iface);
|
||||
}
|
||||
|
||||
HRESULT WINAPI IWineD3DSurfaceImpl_GetParent(IWineD3DSurface *iface, IUnknown **pParent) {
|
||||
TRACE("(%p) : calling resourceimpl_GetParent\n", iface);
|
||||
return IWineD3DResourceImpl_GetParent((IWineD3DResource *)iface, pParent);
|
||||
}
|
||||
|
||||
|
@ -202,7 +204,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_GetDesc(IWineD3DSurface *iface, WINED3DSURFAC
|
|||
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;
|
||||
TRACE("(%p) : setting textureName %u, target %i\n", This, textureName, target);
|
||||
if (This->glDescription.textureName == 0 && textureName != 0) {
|
||||
|
@ -213,7 +215,7 @@ void WINAPI IWineD3DSurfaceImpl_SetGlTextureDesc(IWineD3DSurface *iface, UINT te
|
|||
This->glDescription.target = target;
|
||||
}
|
||||
|
||||
void WINAPI IWineD3DSurfaceImpl_GetGlDesc(IWineD3DSurface *iface, glDescriptor **glDescription){
|
||||
void WINAPI IWineD3DSurfaceImpl_GetGlDesc(IWineD3DSurface *iface, glDescriptor **glDescription) {
|
||||
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface;
|
||||
TRACE("(%p) : returning %p\n", This, &This->glDescription);
|
||||
*glDescription = &This->glDescription;
|
||||
|
@ -250,23 +252,25 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
|
|||
/*return D3DERR_INVALIDCALL; */
|
||||
}
|
||||
|
||||
IWineD3DSurface_GetContainer(iface, &IID_IWineD3DSwapChain, (void **)&swapchain);
|
||||
if (This->resource.usage & D3DUSAGE_RENDERTARGET) {
|
||||
IWineD3DSurface_GetContainer(iface, &IID_IWineD3DSwapChain, (void **)&swapchain);
|
||||
|
||||
if (swapchain != NULL || iface == myDevice->renderTarget || iface == myDevice->depthStencilBuffer) {
|
||||
if (swapchain != NULL && iface == swapchain->backBuffer) {
|
||||
TRACE("(%p, backBuffer) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, This->resource.allocatedMemory);
|
||||
} else if (swapchain != NULL && iface == swapchain->frontBuffer) {
|
||||
TRACE("(%p, frontBuffer) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, This->resource.allocatedMemory);
|
||||
} else if (iface == myDevice->renderTarget) {
|
||||
TRACE("(%p, renderTarget) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, This->resource.allocatedMemory);
|
||||
} else if (iface == myDevice->depthStencilBuffer) {
|
||||
TRACE("(%p, stencilBuffer) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, This->resource.allocatedMemory);
|
||||
}
|
||||
if (swapchain != NULL || iface == myDevice->renderTarget || iface == myDevice->depthStencilBuffer) {
|
||||
if (swapchain != NULL && iface == swapchain->backBuffer) {
|
||||
TRACE("(%p, backBuffer) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, This->resource.allocatedMemory);
|
||||
} else if (swapchain != NULL && iface == swapchain->frontBuffer) {
|
||||
TRACE("(%p, frontBuffer) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, This->resource.allocatedMemory);
|
||||
} else if (iface == myDevice->renderTarget) {
|
||||
TRACE("(%p, renderTarget) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, This->resource.allocatedMemory);
|
||||
} else if (iface == myDevice->depthStencilBuffer) {
|
||||
TRACE("(%p, stencilBuffer) : rect@%p flags(%08lx), output lockedRect@%p, memory@%p\n", This, pRect, Flags, pLockedRect, This->resource.allocatedMemory);
|
||||
}
|
||||
|
||||
if (NULL != swapchain) {
|
||||
IWineD3DSwapChain_Release((IWineD3DSwapChain *)swapchain);
|
||||
if (NULL != swapchain) {
|
||||
IWineD3DSwapChain_Release((IWineD3DSwapChain *)swapchain);
|
||||
}
|
||||
swapchain = NULL;
|
||||
}
|
||||
swapchain = NULL;
|
||||
} else {
|
||||
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
|
|||
This->lockedRect.bottom = pRect->bottom;
|
||||
}
|
||||
|
||||
if(This->nonpow2){
|
||||
if (This->nonpow2) {
|
||||
TRACE("Locking non-power 2 texture\n");
|
||||
}
|
||||
|
||||
|
@ -407,31 +411,31 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
|
|||
if (iface == myDevice->renderTarget || iface == swapchain->backBuffer) {
|
||||
TRACE("locking back buffer\n");
|
||||
glReadBuffer(GL_BACK);
|
||||
}else if (iface == swapchain->frontBuffer) {
|
||||
} else if (iface == swapchain->frontBuffer) {
|
||||
TRACE("locking front\n");
|
||||
glReadBuffer(GL_FRONT);
|
||||
}else if (iface == myDevice->depthStencilBuffer) {
|
||||
} else if (iface == myDevice->depthStencilBuffer) {
|
||||
FIXME("Stencil Buffer lock unsupported for now\n");
|
||||
} else{
|
||||
} else {
|
||||
FIXME("(%p) Shouldn't have got here!\n", This);
|
||||
glReadBuffer(GL_BACK);
|
||||
}
|
||||
}else if (swapchain != NULL) {
|
||||
} else if (swapchain != NULL) {
|
||||
IWineD3DSwapChainImpl *implSwapChain;
|
||||
IWineD3DDevice_GetSwapChain((IWineD3DDevice *)myDevice, 0, (IWineD3DSwapChain **)&implSwapChain);
|
||||
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 */
|
||||
if (iface == swapchain->backBuffer) {
|
||||
glReadBuffer(GL_BACK);
|
||||
}else if (iface == swapchain->frontBuffer) {
|
||||
} else if (iface == swapchain->frontBuffer) {
|
||||
glReadBuffer(GL_FRONT);
|
||||
} else if (iface == myDevice->depthStencilBuffer) {
|
||||
FIXME("Stencil Buffer lock unsupported for now\n");
|
||||
} else{
|
||||
} else {
|
||||
FIXME("Should have got here!\n");
|
||||
glReadBuffer(GL_BACK);
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
/* We need to switch contexts to be able to read the buffer!!! */
|
||||
FIXME("The buffer requested isn't in the current openGL context\n");
|
||||
notInContext = TRUE;
|
||||
|
@ -468,7 +472,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
|
|||
BOOL ati_performance_hack = FALSE;
|
||||
ati_performance_hack = (This->lockedRect.bottom - This->lockedRect.top > 10) || (This->lockedRect.right - This->lockedRect.left > 10)? TRUE: FALSE;
|
||||
#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.bottom == This->currentDesc.Height)) {
|
||||
glReadPixels(0, 0,
|
||||
|
@ -477,7 +481,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
|
|||
This->glDescription.glFormat,
|
||||
This->glDescription.glType,
|
||||
(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,
|
||||
This->lockedRect.top,
|
||||
This->currentDesc.Width,
|
||||
|
@ -507,7 +511,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
|
|||
|
||||
} 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);
|
||||
/*
|
||||
|
||||
|
@ -519,7 +523,7 @@ HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, D3DLOCKED_RE
|
|||
|
||||
)
|
||||
*/
|
||||
messages |=1;
|
||||
messages |= 1;
|
||||
}
|
||||
} else {
|
||||
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
|
|||
TRACE("Making container dirty\n");
|
||||
IWineD3DBaseTexture_SetDirty(pBaseTexture, TRUE);
|
||||
IWineD3DBaseTexture_Release(pBaseTexture);
|
||||
}else{
|
||||
} else {
|
||||
TRACE("Surface is standalone, no need to dirty the container\n");
|
||||
}
|
||||
}
|
||||
|
@ -563,16 +567,18 @@ HRESULT WINAPI IWineD3DSurfaceImpl_UnlockRect(IWineD3DSurface *iface) {
|
|||
return D3DERR_INVALIDCALL;
|
||||
}
|
||||
|
||||
IWineD3DSurface_GetContainer(iface, &IID_IWineD3DSwapChain, (void **)&swapchain);
|
||||
if (D3DUSAGE_RENDERTARGET & This->resource.usage) {
|
||||
IWineD3DSurface_GetContainer(iface, &IID_IWineD3DSwapChain, (void **)&swapchain);
|
||||
|
||||
if ((swapchain != NULL) && iface == swapchain->backBuffer) {
|
||||
buffername = "backBuffer";
|
||||
} else if ((swapchain != NULL) && iface == swapchain->frontBuffer) {
|
||||
buffername = "frontBuffer";
|
||||
} else if (iface == myDevice->depthStencilBuffer) {
|
||||
buffername = "depthStencilBuffer";
|
||||
} else if (iface == myDevice->renderTarget) {
|
||||
buffername = "renderTarget";
|
||||
if ((swapchain != NULL) && iface == swapchain->backBuffer) {
|
||||
buffername = "backBuffer";
|
||||
} else if ((swapchain != NULL) && iface == swapchain->frontBuffer) {
|
||||
buffername = "frontBuffer";
|
||||
} else if (iface == myDevice->depthStencilBuffer) {
|
||||
buffername = "depthStencilBuffer";
|
||||
} else if (iface == myDevice->renderTarget) {
|
||||
buffername = "renderTarget";
|
||||
}
|
||||
}
|
||||
|
||||
if (swapchain != NULL) {
|
||||
|
|
|
@ -442,9 +442,11 @@ HRESULT WINAPI IWineD3DSwapChainImpl_GetGammaRamp(IWineD3DSwapChain *iface, D3DG
|
|||
|
||||
IWineD3DSwapChainVtbl IWineD3DSwapChain_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IWineD3DSwapChainImpl_QueryInterface,
|
||||
IWineD3DSwapChainImpl_AddRef,
|
||||
IWineD3DSwapChainImpl_Release,
|
||||
/* IWineD3DSwapChain */
|
||||
IWineD3DSwapChainImpl_GetParent,
|
||||
IWineD3DSwapChainImpl_GetDevice,
|
||||
IWineD3DSwapChainImpl_Present,
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
* Copyright 2002-2004 Jason Edmeades
|
||||
* Copyright 2003-2004 Raphael Junqueira
|
||||
* Copyright 2004 Christian Costa
|
||||
* Copyright 2005 Oliver Stieber
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -233,8 +234,8 @@ const char* debug_d3drenderstate(DWORD state) {
|
|||
D3DSTATE_TO_STR(WINED3DRS_COLORWRITEENABLE );
|
||||
D3DSTATE_TO_STR(WINED3DRS_TWEENFACTOR );
|
||||
D3DSTATE_TO_STR(WINED3DRS_BLENDOP );
|
||||
D3DSTATE_TO_STR(WINED3DRS_POSITIONORDER );
|
||||
D3DSTATE_TO_STR(WINED3DRS_NORMALORDER );
|
||||
D3DSTATE_TO_STR(WINED3DRS_POSITIONDEGREE );
|
||||
D3DSTATE_TO_STR(WINED3DRS_NORMALDEGREE );
|
||||
#undef D3DSTATE_TO_STR
|
||||
default:
|
||||
FIXME("Unrecognized %lu render state!\n", state);
|
||||
|
@ -341,7 +342,7 @@ GLenum StencilOp(DWORD op) {
|
|||
#endif
|
||||
|
||||
#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");
|
||||
return;
|
||||
|
@ -1574,7 +1575,7 @@ GLint D3DFmt2GLIntFmt(IWineD3DDeviceImpl* This, D3DFORMAT fmt) {
|
|||
|
||||
if (retVal == 0) {
|
||||
switch (fmt) {
|
||||
/* Paletted */
|
||||
/* Paletted */
|
||||
case WINED3DFMT_P8: retVal = GL_COLOR_INDEX8_EXT; break;
|
||||
case WINED3DFMT_A8P8: retVal = GL_COLOR_INDEX8_EXT; break;
|
||||
/* Luminance */
|
||||
|
@ -1855,7 +1856,7 @@ int D3DFmtMakeGlCfg(D3DFORMAT BackBufferFormat, D3DFORMAT StencilBufferFormat, i
|
|||
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) {
|
||||
case WINED3DFMT_D16_LOCKABLE:
|
||||
case WINED3DFMT_D16:
|
||||
|
|
|
@ -130,9 +130,11 @@ HRESULT WINAPI IWineD3DVertexBufferImpl_GetDesc(IWineD3DVertexBuffer *if
|
|||
|
||||
const IWineD3DVertexBufferVtbl IWineD3DVertexBuffer_Vtbl =
|
||||
{
|
||||
/* IUnknown */
|
||||
IWineD3DVertexBufferImpl_QueryInterface,
|
||||
IWineD3DVertexBufferImpl_AddRef,
|
||||
IWineD3DVertexBufferImpl_Release,
|
||||
/* IWineD3DResource */
|
||||
IWineD3DVertexBufferImpl_GetParent,
|
||||
IWineD3DVertexBufferImpl_GetDevice,
|
||||
IWineD3DVertexBufferImpl_SetPrivateData,
|
||||
|
@ -142,6 +144,7 @@ const IWineD3DVertexBufferVtbl IWineD3DVertexBuffer_Vtbl =
|
|||
IWineD3DVertexBufferImpl_GetPriority,
|
||||
IWineD3DVertexBufferImpl_PreLoad,
|
||||
IWineD3DVertexBufferImpl_GetType,
|
||||
/* IWineD3DVertexBuffer */
|
||||
IWineD3DVertexBufferImpl_Lock,
|
||||
IWineD3DVertexBufferImpl_Unlock,
|
||||
IWineD3DVertexBufferImpl_GetDesc
|
||||
|
|
|
@ -215,21 +215,21 @@ static DWORD IWineD3DVertexDeclarationImpl_ParseToken8(const DWORD* pToken) {
|
|||
++pToken;
|
||||
for (i = 0; i < count; ++i) {
|
||||
#if 0
|
||||
TRACE(" c[%lu] = (0x%08lx, 0x%08lx, 0x%08lx, 0x%08lx)\n",
|
||||
constaddress,
|
||||
*pToken,
|
||||
*(pToken + 1),
|
||||
*(pToken + 2),
|
||||
*(pToken + 3));
|
||||
TRACE(" c[%lu] = (0x%08lx, 0x%08lx, 0x%08lx, 0x%08lx)\n",
|
||||
constaddress,
|
||||
*pToken,
|
||||
*(pToken + 1),
|
||||
*(pToken + 2),
|
||||
*(pToken + 3));
|
||||
#endif
|
||||
TRACE(" c[%lu] = (%8f, %8f, %8f, %8f)\n",
|
||||
constaddress,
|
||||
*(const float*) pToken,
|
||||
*(const float*) (pToken + 1),
|
||||
*(const float*) (pToken + 2),
|
||||
*(const float*) (pToken + 3));
|
||||
pToken += 4;
|
||||
++constaddress;
|
||||
TRACE(" c[%lu] = (%8f, %8f, %8f, %8f)\n",
|
||||
constaddress,
|
||||
*(const float*) pToken,
|
||||
*(const float*) (pToken + 1),
|
||||
*(const float*) (pToken + 2),
|
||||
*(const float*) (pToken + 3));
|
||||
pToken += 4;
|
||||
++constaddress;
|
||||
}
|
||||
tokenlen = (4 * count) + 1;
|
||||
}
|
||||
|
|
|
@ -447,15 +447,15 @@ inline static void vshader_program_dump_param(const DWORD param, int input) {
|
|||
*/
|
||||
if ((D3DVS_NOSWIZZLE >> D3DVS_SWIZZLE_SHIFT) != swizzle) { /* ! D3DVS_NOSWIZZLE == 0xE4 << D3DVS_SWIZZLE_SHIFT */
|
||||
if (swizzle_x == swizzle_y &&
|
||||
swizzle_x == swizzle_z &&
|
||||
swizzle_x == swizzle_w) {
|
||||
TRACE(".%c", swizzle_reg_chars[swizzle_x]);
|
||||
} else {
|
||||
TRACE(".%c%c%c%c",
|
||||
swizzle_reg_chars[swizzle_x],
|
||||
swizzle_reg_chars[swizzle_y],
|
||||
swizzle_reg_chars[swizzle_z],
|
||||
swizzle_reg_chars[swizzle_w]);
|
||||
swizzle_x == swizzle_z &&
|
||||
swizzle_x == swizzle_w) {
|
||||
TRACE(".%c", swizzle_reg_chars[swizzle_x]);
|
||||
} else {
|
||||
TRACE(".%c%c%c%c",
|
||||
swizzle_reg_chars[swizzle_x],
|
||||
swizzle_reg_chars[swizzle_y],
|
||||
swizzle_reg_chars[swizzle_z],
|
||||
swizzle_reg_chars[swizzle_w]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -481,44 +481,44 @@ HRESULT WINAPI IDirect3DVertexShaderImpl_ParseProgram(IDirect3DVertexShaderImpl*
|
|||
if (NULL != pToken) {
|
||||
while (D3DVS_END() != *pToken) {
|
||||
if (vshader_is_version_token(*pToken)) { /** version */
|
||||
TRACE("vs.%lu.%lu\n", (*pToken >> 8) & 0x0F, (*pToken & 0x0F));
|
||||
++pToken;
|
||||
++len;
|
||||
continue;
|
||||
TRACE("vs.%lu.%lu\n", (*pToken >> 8) & 0x0F, (*pToken & 0x0F));
|
||||
++pToken;
|
||||
++len;
|
||||
continue;
|
||||
}
|
||||
if (vshader_is_comment_token(*pToken)) { /** comment */
|
||||
DWORD comment_len = (*pToken & D3DSI_COMMENTSIZE_MASK) >> D3DSI_COMMENTSIZE_SHIFT;
|
||||
++pToken;
|
||||
/*TRACE("comment[%ld] ;%s\n", comment_len, (char*)pToken);*/
|
||||
pToken += comment_len;
|
||||
len += comment_len + 1;
|
||||
continue;
|
||||
DWORD comment_len = (*pToken & D3DSI_COMMENTSIZE_MASK) >> D3DSI_COMMENTSIZE_SHIFT;
|
||||
++pToken;
|
||||
/*TRACE("comment[%ld] ;%s\n", comment_len, (char*)pToken);*/
|
||||
pToken += comment_len;
|
||||
len += comment_len + 1;
|
||||
continue;
|
||||
}
|
||||
curOpcode = vshader_program_get_opcode(*pToken);
|
||||
++pToken;
|
||||
++len;
|
||||
if (NULL == curOpcode) {
|
||||
/* unkown current opcode ... */
|
||||
while (*pToken & 0x80000000) {
|
||||
TRACE("unrecognized opcode: %08lx\n", *pToken);
|
||||
++pToken;
|
||||
++len;
|
||||
}
|
||||
} else {
|
||||
TRACE("%s ", curOpcode->name);
|
||||
if (curOpcode->num_params > 0) {
|
||||
vshader_program_dump_param(*pToken, 0);
|
||||
++pToken;
|
||||
++len;
|
||||
for (i = 1; i < curOpcode->num_params; ++i) {
|
||||
TRACE(", ");
|
||||
vshader_program_dump_param(*pToken, 1);
|
||||
++pToken;
|
||||
++len;
|
||||
}
|
||||
}
|
||||
TRACE("\n");
|
||||
}
|
||||
if (NULL == curOpcode) {
|
||||
/* unkown current opcode ... */
|
||||
while (*pToken & 0x80000000) {
|
||||
TRACE("unrecognized opcode: %08lx\n", *pToken);
|
||||
++pToken;
|
||||
++len;
|
||||
}
|
||||
} else {
|
||||
TRACE("%s ", curOpcode->name);
|
||||
if (curOpcode->num_params > 0) {
|
||||
vshader_program_dump_param(*pToken, 0);
|
||||
++pToken;
|
||||
++len;
|
||||
for (i = 1; i < curOpcode->num_params; ++i) {
|
||||
TRACE(", ");
|
||||
vshader_program_dump_param(*pToken, 1);
|
||||
++pToken;
|
||||
++len;
|
||||
}
|
||||
}
|
||||
TRACE("\n");
|
||||
}
|
||||
}
|
||||
vshader->functionLength = (len + 1) * sizeof(DWORD);
|
||||
} else {
|
||||
|
@ -607,149 +607,148 @@ HRESULT WINAPI IDirect3DVertexShaderImpl_ExecuteSW(IDirect3DVertexShaderImpl* vs
|
|||
i = 0;
|
||||
/* unkown current opcode ... */
|
||||
while (*pToken & 0x80000000) {
|
||||
if (i == 0) {
|
||||
TRACE("unrecognized opcode: pos=%d token=%08lX\n", (pToken - 1) - vshader->function, *(pToken - 1));
|
||||
}
|
||||
TRACE("unrecognized opcode param: pos=%d token=%08lX what=", pToken - vshader->function, *pToken);
|
||||
vshader_program_dump_param(*pToken, i);
|
||||
TRACE("\n");
|
||||
++i;
|
||||
++pToken;
|
||||
if (i == 0) {
|
||||
TRACE("unrecognized opcode: pos=%d token=%08lX\n", (pToken - 1) - vshader->function, *(pToken - 1));
|
||||
}
|
||||
TRACE("unrecognized opcode param: pos=%d token=%08lX what=", pToken - vshader->function, *pToken);
|
||||
vshader_program_dump_param(*pToken, i);
|
||||
TRACE("\n");
|
||||
++i;
|
||||
++pToken;
|
||||
}
|
||||
/*return FALSE;*/
|
||||
} else {
|
||||
if (curOpcode->num_params > 0) {
|
||||
/*TRACE(">> execting opcode: pos=%d opcode_name=%s token=%08lX\n", pToken - vshader->function, curOpcode->name, *pToken);*/
|
||||
for (i = 0; i < curOpcode->num_params; ++i) {
|
||||
DWORD reg = pToken[i] & 0x00001FFF;
|
||||
DWORD regtype = ((pToken[i] & D3DSP_REGTYPE_MASK) >> D3DSP_REGTYPE_SHIFT);
|
||||
/*TRACE(">> execting opcode: pos=%d opcode_name=%s token=%08lX\n", pToken - vshader->function, curOpcode->name, *pToken);*/
|
||||
for (i = 0; i < curOpcode->num_params; ++i) {
|
||||
DWORD reg = pToken[i] & 0x00001FFF;
|
||||
DWORD regtype = ((pToken[i] & D3DSP_REGTYPE_MASK) >> D3DSP_REGTYPE_SHIFT);
|
||||
|
||||
switch (regtype << D3DSP_REGTYPE_SHIFT) {
|
||||
case D3DSPR_TEMP:
|
||||
/*TRACE("p[%d]=R[%d]\n", i, reg);*/
|
||||
p[i] = &R[reg];
|
||||
break;
|
||||
case D3DSPR_INPUT:
|
||||
/*TRACE("p[%d]=V[%s]\n", i, VertexShaderDeclRegister[reg]);*/
|
||||
p[i] = &input->V[reg];
|
||||
break;
|
||||
case D3DSPR_CONST:
|
||||
if (pToken[i] & D3DVS_ADDRMODE_RELATIVE) {
|
||||
p[i] = &vshader->data->C[(DWORD) A[0].x + reg];
|
||||
} else {
|
||||
p[i] = &vshader->data->C[reg];
|
||||
}
|
||||
break;
|
||||
case D3DSPR_ADDR: /*case D3DSPR_TEXTURE:*/
|
||||
if (0 != reg) {
|
||||
ERR("cannot handle address registers != a0, forcing use of a0\n");
|
||||
reg = 0;
|
||||
}
|
||||
/*TRACE("p[%d]=A[%d]\n", i, reg);*/
|
||||
p[i] = &A[reg];
|
||||
break;
|
||||
case D3DSPR_RASTOUT:
|
||||
switch (reg) {
|
||||
case D3DSRO_POSITION:
|
||||
p[i] = &output->oPos;
|
||||
break;
|
||||
case D3DSRO_FOG:
|
||||
p[i] = &output->oFog;
|
||||
break;
|
||||
case D3DSRO_POINT_SIZE:
|
||||
p[i] = &output->oPts;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case D3DSPR_ATTROUT:
|
||||
/*TRACE("p[%d]=oD[%d]\n", i, reg);*/
|
||||
p[i] = &output->oD[reg];
|
||||
break;
|
||||
case D3DSPR_TEXCRDOUT:
|
||||
/*TRACE("p[%d]=oT[%d]\n", i, reg);*/
|
||||
p[i] = &output->oT[reg];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
switch (regtype << D3DSP_REGTYPE_SHIFT) {
|
||||
case D3DSPR_TEMP:
|
||||
/*TRACE("p[%d]=R[%d]\n", i, reg);*/
|
||||
p[i] = &R[reg];
|
||||
break;
|
||||
case D3DSPR_INPUT:
|
||||
/*TRACE("p[%d]=V[%s]\n", i, VertexShaderDeclRegister[reg]);*/
|
||||
p[i] = &input->V[reg];
|
||||
break;
|
||||
case D3DSPR_CONST:
|
||||
if (pToken[i] & D3DVS_ADDRMODE_RELATIVE) {
|
||||
p[i] = &vshader->data->C[(DWORD) A[0].x + reg];
|
||||
} else {
|
||||
p[i] = &vshader->data->C[reg];
|
||||
}
|
||||
break;
|
||||
case D3DSPR_ADDR: /*case D3DSPR_TEXTURE:*/
|
||||
if (0 != reg) {
|
||||
ERR("cannot handle address registers != a0, forcing use of a0\n");
|
||||
reg = 0;
|
||||
}
|
||||
/*TRACE("p[%d]=A[%d]\n", i, reg);*/
|
||||
p[i] = &A[reg];
|
||||
break;
|
||||
case D3DSPR_RASTOUT:
|
||||
switch (reg) {
|
||||
case D3DSRO_POSITION:
|
||||
p[i] = &output->oPos;
|
||||
break;
|
||||
case D3DSRO_FOG:
|
||||
p[i] = &output->oFog;
|
||||
break;
|
||||
case D3DSRO_POINT_SIZE:
|
||||
p[i] = &output->oPts;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case D3DSPR_ATTROUT:
|
||||
/*TRACE("p[%d]=oD[%d]\n", i, reg);*/
|
||||
p[i] = &output->oD[reg];
|
||||
break;
|
||||
case D3DSPR_TEXCRDOUT:
|
||||
/*TRACE("p[%d]=oT[%d]\n", i, reg);*/
|
||||
p[i] = &output->oT[reg];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (i > 0) { /* input reg */
|
||||
DWORD swizzle = (pToken[i] & D3DVS_SWIZZLE_MASK) >> D3DVS_SWIZZLE_SHIFT;
|
||||
UINT isNegative = ((pToken[i] & D3DSP_SRCMOD_MASK) == D3DSPSM_NEG);
|
||||
if (i > 0) { /* input reg */
|
||||
DWORD swizzle = (pToken[i] & D3DVS_SWIZZLE_MASK) >> D3DVS_SWIZZLE_SHIFT;
|
||||
UINT isNegative = ((pToken[i] & D3DSP_SRCMOD_MASK) == D3DSPSM_NEG);
|
||||
|
||||
if (!isNegative && (D3DVS_NOSWIZZLE >> D3DVS_SWIZZLE_SHIFT) == swizzle) {
|
||||
/*TRACE("p[%d] not swizzled\n", i);*/
|
||||
p_send[i] = p[i];
|
||||
} else {
|
||||
DWORD swizzle_x = swizzle & 0x03;
|
||||
DWORD swizzle_y = (swizzle >> 2) & 0x03;
|
||||
DWORD swizzle_z = (swizzle >> 4) & 0x03;
|
||||
DWORD swizzle_w = (swizzle >> 6) & 0x03;
|
||||
/*TRACE("p[%d] swizzled\n", i);*/
|
||||
float* tt = (float*) p[i];
|
||||
s[i].x = (isNegative) ? -tt[swizzle_x] : tt[swizzle_x];
|
||||
s[i].y = (isNegative) ? -tt[swizzle_y] : tt[swizzle_y];
|
||||
s[i].z = (isNegative) ? -tt[swizzle_z] : tt[swizzle_z];
|
||||
s[i].w = (isNegative) ? -tt[swizzle_w] : tt[swizzle_w];
|
||||
p_send[i] = &s[i];
|
||||
}
|
||||
} else { /* output reg */
|
||||
if ((pToken[i] & D3DSP_WRITEMASK_ALL) == D3DSP_WRITEMASK_ALL) {
|
||||
p_send[i] = p[i];
|
||||
} else {
|
||||
p_send[i] = &d; /* to be post-processed for modifiers management */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isNegative && (D3DVS_NOSWIZZLE >> D3DVS_SWIZZLE_SHIFT) == swizzle) {
|
||||
/*TRACE("p[%d] not swizzled\n", i);*/
|
||||
p_send[i] = p[i];
|
||||
} else {
|
||||
DWORD swizzle_x = swizzle & 0x03;
|
||||
DWORD swizzle_y = (swizzle >> 2) & 0x03;
|
||||
DWORD swizzle_z = (swizzle >> 4) & 0x03;
|
||||
DWORD swizzle_w = (swizzle >> 6) & 0x03;
|
||||
/*TRACE("p[%d] swizzled\n", i);*/
|
||||
float* tt = (float*) p[i];
|
||||
s[i].x = (isNegative) ? -tt[swizzle_x] : tt[swizzle_x];
|
||||
s[i].y = (isNegative) ? -tt[swizzle_y] : tt[swizzle_y];
|
||||
s[i].z = (isNegative) ? -tt[swizzle_z] : tt[swizzle_z];
|
||||
s[i].w = (isNegative) ? -tt[swizzle_w] : tt[swizzle_w];
|
||||
p_send[i] = &s[i];
|
||||
}
|
||||
} else { /* output reg */
|
||||
if ((pToken[i] & D3DSP_WRITEMASK_ALL) == D3DSP_WRITEMASK_ALL) {
|
||||
p_send[i] = p[i];
|
||||
} else {
|
||||
p_send[i] = &d; /* to be post-processed for modifiers management */
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (curOpcode->num_params) {
|
||||
case 0:
|
||||
curOpcode->soft_fct();
|
||||
break;
|
||||
case 1:
|
||||
curOpcode->soft_fct(p_send[0]);
|
||||
break;
|
||||
case 2:
|
||||
curOpcode->soft_fct(p_send[0], p_send[1]);
|
||||
break;
|
||||
case 3:
|
||||
curOpcode->soft_fct(p_send[0], p_send[1], p_send[2]);
|
||||
break;
|
||||
case 4:
|
||||
curOpcode->soft_fct(p_send[0], p_send[1], p_send[2], p_send[3]);
|
||||
break;
|
||||
case 5:
|
||||
curOpcode->soft_fct(p_send[0], p_send[1], p_send[2], p_send[3], p_send[4]);
|
||||
break;
|
||||
default:
|
||||
ERR("%s too many params: %u\n", curOpcode->name, curOpcode->num_params);
|
||||
}
|
||||
|
||||
/* check if output reg modifier post-process */
|
||||
if (curOpcode->num_params > 0 && (pToken[0] & D3DSP_WRITEMASK_ALL) != D3DSP_WRITEMASK_ALL) {
|
||||
if (pToken[0] & D3DSP_WRITEMASK_0) p[0]->x = d.x;
|
||||
if (pToken[0] & D3DSP_WRITEMASK_1) p[0]->y = d.y;
|
||||
if (pToken[0] & D3DSP_WRITEMASK_2) p[0]->z = d.z;
|
||||
if (pToken[0] & D3DSP_WRITEMASK_3) p[0]->w = d.w;
|
||||
}
|
||||
switch (curOpcode->num_params) {
|
||||
case 0:
|
||||
curOpcode->soft_fct();
|
||||
break;
|
||||
case 1:
|
||||
curOpcode->soft_fct(p_send[0]);
|
||||
break;
|
||||
case 2:
|
||||
curOpcode->soft_fct(p_send[0], p_send[1]);
|
||||
break;
|
||||
case 3:
|
||||
curOpcode->soft_fct(p_send[0], p_send[1], p_send[2]);
|
||||
break;
|
||||
case 4:
|
||||
curOpcode->soft_fct(p_send[0], p_send[1], p_send[2], p_send[3]);
|
||||
break;
|
||||
case 5:
|
||||
curOpcode->soft_fct(p_send[0], p_send[1], p_send[2], p_send[3], p_send[4]);
|
||||
break;
|
||||
default:
|
||||
ERR("%s too many params: %u\n", curOpcode->name, curOpcode->num_params);
|
||||
}
|
||||
|
||||
/* check if output reg modifier post-process */
|
||||
if (curOpcode->num_params > 0 && (pToken[0] & D3DSP_WRITEMASK_ALL) != D3DSP_WRITEMASK_ALL) {
|
||||
if (pToken[0] & D3DSP_WRITEMASK_0) p[0]->x = d.x;
|
||||
if (pToken[0] & D3DSP_WRITEMASK_1) p[0]->y = d.y;
|
||||
if (pToken[0] & D3DSP_WRITEMASK_2) p[0]->z = d.z;
|
||||
if (pToken[0] & D3DSP_WRITEMASK_3) p[0]->w = d.w;
|
||||
}
|
||||
#if 0
|
||||
TRACE_VSVECTOR(output->oPos);
|
||||
TRACE_VSVECTOR(output->oD[0]);
|
||||
TRACE_VSVECTOR(output->oD[1]);
|
||||
TRACE_VSVECTOR(output->oT[0]);
|
||||
TRACE_VSVECTOR(output->oT[1]);
|
||||
TRACE_VSVECTOR(R[0]);
|
||||
TRACE_VSVECTOR(R[1]);
|
||||
TRACE_VSVECTOR(R[2]);
|
||||
TRACE_VSVECTOR(R[3]);
|
||||
TRACE_VSVECTOR(R[4]);
|
||||
TRACE_VSVECTOR(R[5]);
|
||||
TRACE_VSVECTOR(output->oPos);
|
||||
TRACE_VSVECTOR(output->oD[0]);
|
||||
TRACE_VSVECTOR(output->oD[1]);
|
||||
TRACE_VSVECTOR(output->oT[0]);
|
||||
TRACE_VSVECTOR(output->oT[1]);
|
||||
TRACE_VSVECTOR(R[0]);
|
||||
TRACE_VSVECTOR(R[1]);
|
||||
TRACE_VSVECTOR(R[2]);
|
||||
TRACE_VSVECTOR(R[3]);
|
||||
TRACE_VSVECTOR(R[4]);
|
||||
TRACE_VSVECTOR(R[5]);
|
||||
#endif
|
||||
|
||||
/* to next opcode token */
|
||||
pToken += curOpcode->num_params;
|
||||
/* to next opcode token */
|
||||
pToken += curOpcode->num_params;
|
||||
}
|
||||
#if 0
|
||||
TRACE("End of current instruction:\n");
|
||||
|
|
|
@ -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) {
|
||||
return IWineD3DResourceImpl_GetParent((IWineD3DResource *)iface, pParent);
|
||||
|
|
|
@ -97,24 +97,24 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
|
|||
{
|
||||
if ( !RegQueryValueExA( hkey, "VertexShaderMode", 0, NULL, buffer, &size) )
|
||||
{
|
||||
if (!strcmp(buffer,"none"))
|
||||
{
|
||||
TRACE("Disable vertex shaders\n");
|
||||
vs_mode = VS_NONE;
|
||||
}
|
||||
else if (!strcmp(buffer,"emulation"))
|
||||
{
|
||||
TRACE("Force SW vertex shaders\n");
|
||||
vs_mode = VS_SW;
|
||||
}
|
||||
if (!strcmp(buffer,"none"))
|
||||
{
|
||||
TRACE("Disable vertex shaders\n");
|
||||
vs_mode = VS_NONE;
|
||||
}
|
||||
else if (!strcmp(buffer,"emulation"))
|
||||
{
|
||||
TRACE("Force SW vertex shaders\n");
|
||||
vs_mode = VS_SW;
|
||||
}
|
||||
}
|
||||
if ( !RegQueryValueExA( hkey, "PixelShaderMode", 0, NULL, buffer, &size) )
|
||||
{
|
||||
if (!strcmp(buffer,"enabled"))
|
||||
{
|
||||
TRACE("Allow pixel shaders\n");
|
||||
ps_mode = PS_HW;
|
||||
}
|
||||
if (!strcmp(buffer,"enabled"))
|
||||
{
|
||||
TRACE("Allow pixel shaders\n");
|
||||
ps_mode = PS_HW;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (vs_mode == VS_HW)
|
||||
|
|
Loading…
Reference in New Issue