Index: ddraw/glDirect3DDevice.cpp |
— | — | @@ -661,6 +661,7 @@ |
662 | 662 | for(int i = 0; i < numtexformats; i++)
|
663 | 663 | {
|
664 | 664 | if(::texformats[i].dwFlags & DDPF_ZBUFFER) continue;
|
| 665 | + if(::texformats[i].dwFlags & DDPF_PALETTEINDEXED8) continue;
|
665 | 666 | memcpy(&fmt,&::texformats[i],sizeof(DDPIXELFORMAT));
|
666 | 667 | result = lpd3dEnumPixelProc(&fmt,lpArg);
|
667 | 668 | if(result != D3DENUMRET_OK) return D3D_OK;
|
— | — | @@ -961,6 +962,114 @@ |
962 | 963 | HRESULT WINAPI glDirect3DDevice7::SetRenderState(D3DRENDERSTATETYPE dwRendStateType, DWORD dwRenderState)
|
963 | 964 | {
|
964 | 965 | if(!this) return DDERR_INVALIDOBJECT;
|
| 966 | + switch(dwRendStateType)
|
| 967 | + {
|
| 968 | + case D3DRENDERSTATE_TEXTUREHANDLE:
|
| 969 | + if(dwRenderState > texturecount-1) return DDERR_INVALIDPARAMS;
|
| 970 | + if(dwRenderState)
|
| 971 | + {
|
| 972 | + if(!textures[dwRenderState]) return DDERR_INVALIDPARAMS;
|
| 973 | + SetTexture(0,textures[dwRenderState]);
|
| 974 | + }
|
| 975 | + else SetTexture(0,NULL);
|
| 976 | + break;
|
| 977 | + case D3DRENDERSTATE_TEXTUREADDRESS:
|
| 978 | + SetRenderState(D3DRENDERSTATE_TEXTUREADDRESSU,dwRenderState);
|
| 979 | + SetRenderState(D3DRENDERSTATE_TEXTUREADDRESSV,dwRenderState);
|
| 980 | + break;
|
| 981 | + case D3DRENDERSTATE_WRAPU:
|
| 982 | + if(dwRenderState) renderstate[D3DRENDERSTATE_WRAP0] |= D3DWRAP_U;
|
| 983 | + else renderstate[D3DRENDERSTATE_WRAP0] &= ~D3DWRAP_U;
|
| 984 | + break;
|
| 985 | + case D3DRENDERSTATE_WRAPV:
|
| 986 | + if(dwRenderState) renderstate[D3DRENDERSTATE_WRAP0] |= D3DWRAP_V;
|
| 987 | + else renderstate[D3DRENDERSTATE_WRAP0] &= ~D3DWRAP_V;
|
| 988 | + break;
|
| 989 | + case D3DRENDERSTATE_TEXTUREMAG:
|
| 990 | + switch(dwRenderState)
|
| 991 | + {
|
| 992 | + case D3DFILTER_NEAREST:
|
| 993 | + default:
|
| 994 | + SetTextureStageState(0,D3DTSS_MAGFILTER,D3DTFG_POINT);
|
| 995 | + break;
|
| 996 | + case D3DFILTER_LINEAR:
|
| 997 | + SetTextureStageState(0,D3DTSS_MINFILTER,D3DTFG_POINT);
|
| 998 | + }
|
| 999 | + break;
|
| 1000 | + case D3DRENDERSTATE_TEXTUREMIN:
|
| 1001 | + switch(dwRenderState)
|
| 1002 | + {
|
| 1003 | + case D3DFILTER_NEAREST:
|
| 1004 | + default:
|
| 1005 | + SetTextureStageState(0,D3DTSS_MINFILTER,D3DTFN_POINT);
|
| 1006 | + SetTextureStageState(0,D3DTSS_MIPFILTER,D3DTFP_NONE);
|
| 1007 | + break;
|
| 1008 | + case D3DFILTER_LINEAR:
|
| 1009 | + SetTextureStageState(0,D3DTSS_MINFILTER,D3DTFN_LINEAR);
|
| 1010 | + SetTextureStageState(0,D3DTSS_MIPFILTER,D3DTFP_NONE);
|
| 1011 | + break;
|
| 1012 | + case D3DFILTER_MIPNEAREST:
|
| 1013 | + SetTextureStageState(0,D3DTSS_MINFILTER,D3DTFN_POINT);
|
| 1014 | + SetTextureStageState(0,D3DTSS_MIPFILTER,D3DTFP_POINT);
|
| 1015 | + break;
|
| 1016 | + case D3DFILTER_MIPLINEAR:
|
| 1017 | + SetTextureStageState(0,D3DTSS_MINFILTER,D3DTFN_LINEAR);
|
| 1018 | + SetTextureStageState(0,D3DTSS_MIPFILTER,D3DTFP_POINT);
|
| 1019 | + break;
|
| 1020 | + case D3DFILTER_LINEARMIPNEAREST:
|
| 1021 | + SetTextureStageState(0,D3DTSS_MINFILTER,D3DTFN_POINT);
|
| 1022 | + SetTextureStageState(0,D3DTSS_MIPFILTER,D3DTFP_LINEAR);
|
| 1023 | + break;
|
| 1024 | + case D3DFILTER_LINEARMIPLINEAR:
|
| 1025 | + SetTextureStageState(0,D3DTSS_MINFILTER,D3DTFN_LINEAR);
|
| 1026 | + SetTextureStageState(0,D3DTSS_MIPFILTER,D3DTFP_LINEAR);
|
| 1027 | + break;
|
| 1028 | + }
|
| 1029 | + break;
|
| 1030 | + case D3DRENDERSTATE_TEXTUREMAPBLEND:
|
| 1031 | + if(!dwRenderState || (dwRenderState > D3DTBLEND_ADD)) return DDERR_INVALIDPARAMS;
|
| 1032 | + switch(dwRenderState)
|
| 1033 | + {
|
| 1034 | + case D3DTBLEND_DECAL:
|
| 1035 | + case D3DTBLEND_COPY:
|
| 1036 | + default:
|
| 1037 | + SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_TEXTURE);
|
| 1038 | + SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_TEXTURE);
|
| 1039 | + SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_SELECTARG1);
|
| 1040 | + SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_SELECTARG1);
|
| 1041 | + break;
|
| 1042 | + case D3DTBLEND_MODULATE:
|
| 1043 | + FIXME("DX5 modulate not yet supported.");
|
| 1044 | + ERR(DDERR_GENERIC);
|
| 1045 | + case D3DTBLEND_DECALALPHA:
|
| 1046 | + SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_TEXTURE);
|
| 1047 | + SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_CURRENT);
|
| 1048 | + SetTextureStageState(0,D3DTSS_ALPHAARG2,D3DTA_CURRENT);
|
| 1049 | + SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_BLENDTEXTUREALPHA);
|
| 1050 | + SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_SELECTARG2);
|
| 1051 | + break;
|
| 1052 | + case D3DTBLEND_MODULATEALPHA:
|
| 1053 | + SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_TEXTURE);
|
| 1054 | + SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_CURRENT);
|
| 1055 | + SetTextureStageState(0,D3DTSS_ALPHAARG1,D3DTA_TEXTURE);
|
| 1056 | + SetTextureStageState(0,D3DTSS_ALPHAARG2,D3DTA_CURRENT);
|
| 1057 | + SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_MODULATE);
|
| 1058 | + SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_MODULATE);
|
| 1059 | + break;
|
| 1060 | + case D3DTBLEND_DECALMASK:
|
| 1061 | + case D3DTBLEND_MODULATEMASK:
|
| 1062 | + FIXME("DX5 masked blend modes not supported.");
|
| 1063 | + return DDERR_UNSUPPORTED;
|
| 1064 | + case D3DTBLEND_ADD:
|
| 1065 | + SetTextureStageState(0,D3DTSS_COLORARG1,D3DTA_TEXTURE);
|
| 1066 | + SetTextureStageState(0,D3DTSS_COLORARG2,D3DTA_CURRENT);
|
| 1067 | + SetTextureStageState(0,D3DTSS_ALPHAARG2,D3DTA_CURRENT);
|
| 1068 | + SetTextureStageState(0,D3DTSS_COLOROP,D3DTOP_ADD);
|
| 1069 | + SetTextureStageState(0,D3DTSS_ALPHAOP,D3DTOP_SELECTARG2);
|
| 1070 | + break;
|
| 1071 | + }
|
| 1072 | + break;
|
| 1073 | + }
|
965 | 1074 | if(dwRendStateType > 152) return DDERR_INVALIDPARAMS;
|
966 | 1075 | if(dwRendStateType < 0) return DDERR_INVALIDPARAMS;
|
967 | 1076 | renderstate[dwRendStateType] = dwRenderState;
|
— | — | @@ -1470,9 +1579,17 @@ |
1471 | 1580 | if(!this) return DDERR_INVALIDOBJECT;
|
1472 | 1581 | if(!lpD3DHWDevDesc && !lpD3DHELDevDesc) return DDERR_INVALIDPARAMS;
|
1473 | 1582 | D3DDEVICEDESC desc = d3ddesc3;
|
1474 | | - if(lpD3DHELDevDesc) *lpD3DHELDevDesc = desc;
|
| 1583 | + if(lpD3DHELDevDesc)
|
| 1584 | + {
|
| 1585 | + if(lpD3DHELDevDesc->dwSize < sizeof(D3DDEVICEDESC)) return DDERR_INVALIDPARAMS;
|
| 1586 | + memcpy(lpD3DHELDevDesc, &desc, sizeof(D3DDEVICEDESC));
|
| 1587 | + }
|
1475 | 1588 | desc.dwDevCaps |= D3DDEVCAPS_HWRASTERIZATION;
|
1476 | | - if(lpD3DHWDevDesc) *lpD3DHWDevDesc = desc;
|
| 1589 | + if(lpD3DHWDevDesc)
|
| 1590 | + {
|
| 1591 | + if(lpD3DHWDevDesc->dwSize < sizeof(D3DDEVICEDESC)) return DDERR_INVALIDPARAMS;
|
| 1592 | + memcpy(lpD3DHWDevDesc, &desc, sizeof(D3DDEVICEDESC));
|
| 1593 | + }
|
1477 | 1594 | return D3D_OK;
|
1478 | 1595 | }
|
1479 | 1596 |
|
— | — | @@ -1559,6 +1676,18 @@ |
1560 | 1677 | return DDERR_GENERIC;
|
1561 | 1678 | }
|
1562 | 1679 |
|
| 1680 | +void glDirect3DDevice7::InitDX5()
|
| 1681 | +{
|
| 1682 | + SetRenderState(D3DRENDERSTATE_TEXTUREHANDLE,0);
|
| 1683 | + SetRenderState(D3DRENDERSTATE_TEXTUREADDRESS,D3DTADDRESS_WRAP);
|
| 1684 | + SetRenderState(D3DRENDERSTATE_WRAPU,FALSE);
|
| 1685 | + SetRenderState(D3DRENDERSTATE_WRAPV,FALSE);
|
| 1686 | + SetRenderState(D3DRENDERSTATE_TEXTUREMAG,D3DFILTER_NEAREST);
|
| 1687 | + SetRenderState(D3DRENDERSTATE_TEXTUREMIN,D3DFILTER_NEAREST);
|
| 1688 | + //SetRenderState(D3DRENDERSTATE_TEXTUREMAPBLEND,D3DTBLEND_MODULATE);
|
| 1689 | + SetRenderState(D3DRENDERSTATE_SPECULARENABLE,TRUE);
|
| 1690 | +}
|
| 1691 | +
|
1563 | 1692 | // IDirect3DDevice3 wrapper
|
1564 | 1693 | glDirect3DDevice3::glDirect3DDevice3(glDirect3DDevice7 *glD3DDev7)
|
1565 | 1694 | {
|
— | — | @@ -1865,6 +1994,7 @@ |
1866 | 1995 | glDirect3DDevice2::glDirect3DDevice2(glDirect3DDevice7 *glD3DDev7)
|
1867 | 1996 | {
|
1868 | 1997 | this->glD3DDev7 = glD3DDev7;
|
| 1998 | + glD3DDev7->InitDX5();
|
1869 | 1999 | refcount = 1;
|
1870 | 2000 | }
|
1871 | 2001 |
|
Index: ddraw/glDirect3DDevice.h |
— | — | @@ -144,6 +144,7 @@ |
145 | 145 | HRESULT SetLightState(D3DLIGHTSTATETYPE dwLightStateType, DWORD dwLightState);
|
146 | 146 | HRESULT GetStats(LPD3DSTATS lpD3DStats);
|
147 | 147 | HRESULT SwapTextureHandles(LPDIRECT3DTEXTURE2 lpD3DTex1, LPDIRECT3DTEXTURE2 lpD3DTex2);
|
| 148 | + void InitDX5();
|
148 | 149 | __int64 SelectShader(GLVERTEX *VertexType);
|
149 | 150 | GLfloat matWorld[16];
|
150 | 151 | GLfloat matView[16];
|
Index: ddraw/glDirectDrawSurface.cpp |
— | — | @@ -335,7 +335,7 @@ |
336 | 336 | }
|
337 | 337 | HRESULT WINAPI glDirectDrawSurface7::QueryInterface(REFIID riid, void** ppvObj)
|
338 | 338 | {
|
339 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 339 | + if(!this) return DDERR_INVALIDOBJECT;
|
340 | 340 | if(!ppvObj) return DDERR_INVALIDPARAMS;
|
341 | 341 | if(riid == IID_IUnknown)
|
342 | 342 | {
|
— | — | @@ -448,7 +448,7 @@ |
449 | 449 | }
|
450 | 450 | HRESULT WINAPI glDirectDrawSurface7::AddAttachedSurface(LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface)
|
451 | 451 | {
|
452 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 452 | + if(!this) return DDERR_INVALIDOBJECT;
|
453 | 453 | if(!lpDDSAttachedSurface) return DDERR_INVALIDPARAMS;
|
454 | 454 | if(zbuffer) ERR(DDERR_SURFACEALREADYATTACHED);
|
455 | 455 | glDirectDrawSurface7 *attached = (glDirectDrawSurface7 *)lpDDSAttachedSurface;
|
— | — | @@ -465,13 +465,13 @@ |
466 | 466 | }
|
467 | 467 | HRESULT WINAPI glDirectDrawSurface7::AddOverlayDirtyRect(LPRECT lpRect)
|
468 | 468 | {
|
469 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 469 | + if(!this) return DDERR_INVALIDOBJECT;
|
470 | 470 | FIXME("glDirectDrawSurface7::AddOverlayDirtyRect: stub\n");
|
471 | 471 | ERR(DDERR_GENERIC);
|
472 | 472 | }
|
473 | 473 | HRESULT WINAPI glDirectDrawSurface7::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
|
474 | 474 | {
|
475 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 475 | + if(!this) return DDERR_INVALIDOBJECT;
|
476 | 476 | if((dwFlags & DDBLT_COLORFILL) && !lpDDBltFx) return DDERR_INVALIDPARAMS;
|
477 | 477 | glDirectDrawSurface7 *src = (glDirectDrawSurface7 *)lpDDSrcSurface;
|
478 | 478 | if(dirty & 1)
|
— | — | @@ -493,13 +493,13 @@ |
494 | 494 | }
|
495 | 495 | HRESULT WINAPI glDirectDrawSurface7::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
|
496 | 496 | {
|
497 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 497 | + if(!this) return DDERR_INVALIDOBJECT;
|
498 | 498 | FIXME("glDirectDrawSurface7::BltBatch: stub\n");
|
499 | 499 | ERR(DDERR_GENERIC);
|
500 | 500 | }
|
501 | 501 | HRESULT WINAPI glDirectDrawSurface7::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
|
502 | 502 | {
|
503 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 503 | + if(!this) return DDERR_INVALIDOBJECT;
|
504 | 504 | DDSURFACEDESC2 ddsd;
|
505 | 505 | ddsd.dwSize = sizeof(DDSURFACEDESC2);
|
506 | 506 | lpDDSrcSurface->GetSurfaceDesc(&ddsd);
|
— | — | @@ -524,7 +524,7 @@ |
525 | 525 | }
|
526 | 526 | HRESULT WINAPI glDirectDrawSurface7::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface)
|
527 | 527 | {
|
528 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 528 | + if(!this) return DDERR_INVALIDOBJECT;
|
529 | 529 | if(lpDDSAttachedSurface == (LPDIRECTDRAWSURFACE7)zbuffer)
|
530 | 530 | {
|
531 | 531 | zbuffer->Release();
|
— | — | @@ -535,19 +535,19 @@ |
536 | 536 | }
|
537 | 537 | HRESULT WINAPI glDirectDrawSurface7::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback)
|
538 | 538 | {
|
539 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 539 | + if(!this) return DDERR_INVALIDOBJECT;
|
540 | 540 | FIXME("glDirectDrawSurface7::EnumAttachedSurfaces: stub\n");
|
541 | 541 | ERR(DDERR_GENERIC);
|
542 | 542 | }
|
543 | 543 | HRESULT WINAPI glDirectDrawSurface7::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpfnCallback)
|
544 | 544 | {
|
545 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 545 | + if(!this) return DDERR_INVALIDOBJECT;
|
546 | 546 | FIXME("glDirectDrawSurface7::EnumOverlayZOrders: stub\n");
|
547 | 547 | ERR(DDERR_GENERIC);
|
548 | 548 | }
|
549 | 549 | HRESULT WINAPI glDirectDrawSurface7::Flip(LPDIRECTDRAWSURFACE7 lpDDSurfaceTargetOverride, DWORD dwFlags)
|
550 | 550 | {
|
551 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 551 | + if(!this) return DDERR_INVALIDOBJECT;
|
552 | 552 | HRESULT ret = Flip2(lpDDSurfaceTargetOverride,dwFlags);
|
553 | 553 | if(ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) RenderScreen(texture,this);
|
554 | 554 | return ret;
|
— | — | @@ -554,7 +554,7 @@ |
555 | 555 | }
|
556 | 556 | HRESULT glDirectDrawSurface7::Flip2(LPDIRECTDRAWSURFACE7 lpDDSurfaceTargetOverride, DWORD dwFlags)
|
557 | 557 | {
|
558 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 558 | + if(!this) return DDERR_INVALIDOBJECT;
|
559 | 559 | DWORD i;
|
560 | 560 | glDirectDrawSurface7 *tmp;
|
561 | 561 | if(dwFlags & DDFLIP_NOVSYNC) swapinterval=0;
|
— | — | @@ -634,7 +634,7 @@ |
635 | 635 | }
|
636 | 636 | HRESULT WINAPI glDirectDrawSurface7::GetAttachedSurface(LPDDSCAPS2 lpDDSCaps, LPDIRECTDRAWSURFACE7 FAR *lplpDDAttachedSurface)
|
637 | 637 | {
|
638 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 638 | + if(!this) return DDERR_INVALIDOBJECT;
|
639 | 639 | DDSCAPS2 ddsComp;
|
640 | 640 | backbuffer->GetCaps(&ddsComp);
|
641 | 641 | unsigned __int64 comp1,comp2;
|
— | — | @@ -662,13 +662,13 @@ |
663 | 663 | }
|
664 | 664 | HRESULT WINAPI glDirectDrawSurface7::GetBltStatus(DWORD dwFlags)
|
665 | 665 | {
|
666 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 666 | + if(!this) return DDERR_INVALIDOBJECT;
|
667 | 667 | FIXME("glDirectDrawSurface7::GetBltStatus: stub\n");
|
668 | 668 | ERR(DDERR_GENERIC);
|
669 | 669 | }
|
670 | 670 | HRESULT WINAPI glDirectDrawSurface7::GetCaps(LPDDSCAPS2 lpDDSCaps)
|
671 | 671 | {
|
672 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 672 | + if(!this) return DDERR_INVALIDOBJECT;
|
673 | 673 | if(!lpDDSCaps) return DDERR_INVALIDPARAMS;
|
674 | 674 | memcpy(lpDDSCaps,&ddsd.ddsCaps,sizeof(DDSCAPS2));
|
675 | 675 | return DD_OK;
|
— | — | @@ -675,13 +675,13 @@ |
676 | 676 | }
|
677 | 677 | HRESULT WINAPI glDirectDrawSurface7::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
|
678 | 678 | {
|
679 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 679 | + if(!this) return DDERR_INVALIDOBJECT;
|
680 | 680 | FIXME("glDirectDrawSurface7::GetClipper: stub\n");
|
681 | 681 | ERR(DDERR_GENERIC);
|
682 | 682 | }
|
683 | 683 | HRESULT WINAPI glDirectDrawSurface7::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
684 | 684 | {
|
685 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 685 | + if(!this) return DDERR_INVALIDOBJECT;
|
686 | 686 | if(!lpDDColorKey) return DDERR_INVALIDPARAMS;
|
687 | 687 | if(dwFlags == DDCKEY_SRCBLT)
|
688 | 688 | {
|
— | — | @@ -723,7 +723,7 @@ |
724 | 724 | }
|
725 | 725 | HRESULT WINAPI glDirectDrawSurface7::GetDC(HDC FAR *lphDC)
|
726 | 726 | {
|
727 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 727 | + if(!this) return DDERR_INVALIDOBJECT;
|
728 | 728 | if(!lphDC) return DDERR_INVALIDPARAMS;
|
729 | 729 | if(hdc) ERR(DDERR_DCALREADYCREATED);
|
730 | 730 | glDirectDrawPalette *pal;
|
— | — | @@ -754,7 +754,7 @@ |
755 | 755 | }
|
756 | 756 | HRESULT WINAPI glDirectDrawSurface7::GetFlipStatus(DWORD dwFlags)
|
757 | 757 | {
|
758 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 758 | + if(!this) return DDERR_INVALIDOBJECT;
|
759 | 759 | return DD_OK;
|
760 | 760 | FIXME("glDirectDrawSurface7::GetFlipStatus: stub\n");
|
761 | 761 | ERR(DDERR_GENERIC);
|
— | — | @@ -761,13 +761,13 @@ |
762 | 762 | }
|
763 | 763 | HRESULT WINAPI glDirectDrawSurface7::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
|
764 | 764 | {
|
765 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 765 | + if(!this) return DDERR_INVALIDOBJECT;
|
766 | 766 | FIXME("glDirectDrawSurface7::GetOverlayPosition: stub\n");
|
767 | 767 | ERR(DDERR_GENERIC);
|
768 | 768 | }
|
769 | 769 | HRESULT WINAPI glDirectDrawSurface7::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
|
770 | 770 | {
|
771 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 771 | + if(!this) return DDERR_INVALIDOBJECT;
|
772 | 772 | HRESULT err;
|
773 | 773 | if(palette)
|
774 | 774 | {
|
— | — | @@ -784,7 +784,7 @@ |
785 | 785 | }
|
786 | 786 | HRESULT WINAPI glDirectDrawSurface7::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
|
787 | 787 | {
|
788 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 788 | + if(!this) return DDERR_INVALIDOBJECT;
|
789 | 789 | if(!lpDDPixelFormat) return DDERR_INVALIDPARAMS;
|
790 | 790 | *lpDDPixelFormat = ddsd.ddpfPixelFormat;
|
791 | 791 | return DD_OK;
|
— | — | @@ -791,7 +791,7 @@ |
792 | 792 | }
|
793 | 793 | HRESULT WINAPI glDirectDrawSurface7::GetSurfaceDesc(LPDDSURFACEDESC2 lpDDSurfaceDesc)
|
794 | 794 | {
|
795 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 795 | + if(!this) return DDERR_INVALIDOBJECT;
|
796 | 796 | if(!lpDDSurfaceDesc) return DDERR_INVALIDPARAMS;
|
797 | 797 | memcpy(lpDDSurfaceDesc,&ddsd,lpDDSurfaceDesc->dwSize);
|
798 | 798 | return DD_OK;
|
— | — | @@ -798,12 +798,12 @@ |
799 | 799 | }
|
800 | 800 | HRESULT WINAPI glDirectDrawSurface7::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC2 lpDDSurfaceDesc)
|
801 | 801 | {
|
802 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 802 | + if(!this) return DDERR_INVALIDOBJECT;
|
803 | 803 | return DDERR_ALREADYINITIALIZED;
|
804 | 804 | }
|
805 | 805 | HRESULT WINAPI glDirectDrawSurface7::IsLost()
|
806 | 806 | {
|
807 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 807 | + if(!this) return DDERR_INVALIDOBJECT;
|
808 | 808 | if(hRC == renderer->hRC) return DD_OK;
|
809 | 809 | else return DDERR_SURFACELOST;
|
810 | 810 | }
|
— | — | @@ -810,7 +810,7 @@ |
811 | 811 |
|
812 | 812 | HRESULT WINAPI glDirectDrawSurface7::Lock(LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
|
813 | 813 | {
|
814 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 814 | + if(!this) return DDERR_INVALIDOBJECT;
|
815 | 815 | if(locked) ERR(DDERR_SURFACEBUSY);
|
816 | 816 | dirty |= 1;
|
817 | 817 | retry:
|
— | — | @@ -854,7 +854,7 @@ |
855 | 855 | }
|
856 | 856 | HRESULT WINAPI glDirectDrawSurface7::ReleaseDC(HDC hDC)
|
857 | 857 | {
|
858 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 858 | + if(!this) return DDERR_INVALIDOBJECT;
|
859 | 859 | if(!hdc) return DDERR_INVALIDOBJECT;
|
860 | 860 | if(hDC != hdc) return DDERR_INVALIDOBJECT;
|
861 | 861 | GetDIBits(hDC,hbitmap,0,ddsd.dwHeight,ddsd.lpSurface,bitmapinfo,DIB_RGB_COLORS);
|
— | — | @@ -901,7 +901,7 @@ |
902 | 902 | }
|
903 | 903 | HRESULT WINAPI glDirectDrawSurface7::Restore()
|
904 | 904 | {
|
905 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 905 | + if(!this) return DDERR_INVALIDOBJECT;
|
906 | 906 | LONG sizes[6];
|
907 | 907 | if(!renderer) return DDERR_INVALIDOBJECT;
|
908 | 908 | if(hRC != renderer->hRC)
|
— | — | @@ -947,7 +947,7 @@ |
948 | 948 | }
|
949 | 949 | HRESULT WINAPI glDirectDrawSurface7::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
|
950 | 950 | {
|
951 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 951 | + if(!this) return DDERR_INVALIDOBJECT;
|
952 | 952 | if(clipper) clipper->Release();
|
953 | 953 | clipper = (glDirectDrawClipper *)lpDDClipper;
|
954 | 954 | if(clipper)clipper->AddRef();
|
— | — | @@ -955,7 +955,7 @@ |
956 | 956 | }
|
957 | 957 | HRESULT WINAPI glDirectDrawSurface7::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
958 | 958 | {
|
959 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 959 | + if(!this) return DDERR_INVALIDOBJECT;
|
960 | 960 | if(!lpDDColorKey) ERR(DDERR_GENERIC);
|
961 | 961 | CKEY key;
|
962 | 962 | key.enabled = true;
|
— | — | @@ -970,13 +970,13 @@ |
971 | 971 | }
|
972 | 972 | HRESULT WINAPI glDirectDrawSurface7::SetOverlayPosition(LONG lX, LONG lY)
|
973 | 973 | {
|
974 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 974 | + if(!this) return DDERR_INVALIDOBJECT;
|
975 | 975 | FIXME("glDirectDrawSurface7::SetOverlayPosition: stub\n");
|
976 | 976 | ERR(DDERR_GENERIC);
|
977 | 977 | }
|
978 | 978 | HRESULT WINAPI glDirectDrawSurface7::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
|
979 | 979 | {
|
980 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 980 | + if(!this) return DDERR_INVALIDOBJECT;
|
981 | 981 | if(palette)
|
982 | 982 | {
|
983 | 983 | palette->Release();
|
— | — | @@ -992,7 +992,7 @@ |
993 | 993 |
|
994 | 994 | HRESULT WINAPI glDirectDrawSurface7::Unlock(LPRECT lpRect)
|
995 | 995 | {
|
996 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 996 | + if(!this) return DDERR_INVALIDOBJECT;
|
997 | 997 | if(!locked) return DDERR_NOTLOCKED;
|
998 | 998 | locked--;
|
999 | 999 | ddsd.lpSurface = NULL;
|
— | — | @@ -1004,19 +1004,19 @@ |
1005 | 1005 | }
|
1006 | 1006 | HRESULT WINAPI glDirectDrawSurface7::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE7 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
|
1007 | 1007 | {
|
1008 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1008 | + if(!this) return DDERR_INVALIDOBJECT;
|
1009 | 1009 | FIXME("glDirectDrawSurface7::UpdateOverlay: stub\n");
|
1010 | 1010 | ERR(DDERR_GENERIC);
|
1011 | 1011 | }
|
1012 | 1012 | HRESULT WINAPI glDirectDrawSurface7::UpdateOverlayDisplay(DWORD dwFlags)
|
1013 | 1013 | {
|
1014 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1014 | + if(!this) return DDERR_INVALIDOBJECT;
|
1015 | 1015 | FIXME("glDirectDrawSurface7::UpdateOverlayDisplay: stub\n");
|
1016 | 1016 | ERR(DDERR_GENERIC);
|
1017 | 1017 | }
|
1018 | 1018 | HRESULT WINAPI glDirectDrawSurface7::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE7 lpDDSReference)
|
1019 | 1019 | {
|
1020 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1020 | + if(!this) return DDERR_INVALIDOBJECT;
|
1021 | 1021 | FIXME("glDirectDrawSurface7::UpdateOverlayZOrder: stub\n");
|
1022 | 1022 | ERR(DDERR_GENERIC);
|
1023 | 1023 | }
|
— | — | @@ -1028,7 +1028,7 @@ |
1029 | 1029 | // ddraw 2+ api
|
1030 | 1030 | HRESULT WINAPI glDirectDrawSurface7::GetDDInterface(LPVOID FAR *lplpDD)
|
1031 | 1031 | {
|
1032 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1032 | + if(!this) return DDERR_INVALIDOBJECT;
|
1033 | 1033 | ddInterface->AddRef();
|
1034 | 1034 | *lplpDD = ddInterface;
|
1035 | 1035 | return DD_OK;
|
— | — | @@ -1035,13 +1035,13 @@ |
1036 | 1036 | }
|
1037 | 1037 | HRESULT WINAPI glDirectDrawSurface7::PageLock(DWORD dwFlags)
|
1038 | 1038 | {
|
1039 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1039 | + if(!this) return DDERR_INVALIDOBJECT;
|
1040 | 1040 | pagelocked++;
|
1041 | 1041 | return DD_OK;
|
1042 | 1042 | }
|
1043 | 1043 | HRESULT WINAPI glDirectDrawSurface7::PageUnlock(DWORD dwFlags)
|
1044 | 1044 | {
|
1045 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1045 | + if(!this) return DDERR_INVALIDOBJECT;
|
1046 | 1046 | if(!pagelocked) ERR(DDERR_NOTPAGELOCKED);
|
1047 | 1047 | pagelocked--;
|
1048 | 1048 | return DD_OK;
|
— | — | @@ -1049,7 +1049,7 @@ |
1050 | 1050 | // ddraw 3+ api
|
1051 | 1051 | HRESULT WINAPI glDirectDrawSurface7::SetSurfaceDesc(LPDDSURFACEDESC2 lpddsd2, DWORD dwFlags)
|
1052 | 1052 | {
|
1053 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1053 | + if(!this) return DDERR_INVALIDOBJECT;
|
1054 | 1054 | FIXME("glDirectDrawSurface7::SetSurfaceDesc: stub\n");
|
1055 | 1055 | ERR(DDERR_GENERIC);
|
1056 | 1056 | }
|
— | — | @@ -1056,31 +1056,31 @@ |
1057 | 1057 | // ddraw 4+ api
|
1058 | 1058 | HRESULT WINAPI glDirectDrawSurface7::SetPrivateData(REFGUID guidTag, LPVOID lpData, DWORD cbSize, DWORD dwFlags)
|
1059 | 1059 | {
|
1060 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1060 | + if(!this) return DDERR_INVALIDOBJECT;
|
1061 | 1061 | FIXME("glDirectDrawSurface7::SetPrivateData: stub\n");
|
1062 | 1062 | ERR(DDERR_GENERIC);
|
1063 | 1063 | }
|
1064 | 1064 | HRESULT WINAPI glDirectDrawSurface7::GetPrivateData(REFGUID guidTag, LPVOID lpBuffer, LPDWORD lpcbBufferSize)
|
1065 | 1065 | {
|
1066 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1066 | + if(!this) return DDERR_INVALIDOBJECT;
|
1067 | 1067 | FIXME("glDirectDrawSurface7::GetPrivateData: stub\n");
|
1068 | 1068 | ERR(DDERR_GENERIC);
|
1069 | 1069 | }
|
1070 | 1070 | HRESULT WINAPI glDirectDrawSurface7::FreePrivateData(REFGUID guidTag)
|
1071 | 1071 | {
|
1072 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1072 | + if(!this) return DDERR_INVALIDOBJECT;
|
1073 | 1073 | FIXME("glDirectDrawSurface7::FreePrivateData: stub\n");
|
1074 | 1074 | ERR(DDERR_GENERIC);
|
1075 | 1075 | }
|
1076 | 1076 | HRESULT WINAPI glDirectDrawSurface7::GetUniquenessValue(LPDWORD lpValue)
|
1077 | 1077 | {
|
1078 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1078 | + if(!this) return DDERR_INVALIDOBJECT;
|
1079 | 1079 | FIXME("glDirectDrawSurface7::GetUniquenessValue: stub\n");
|
1080 | 1080 | ERR(DDERR_GENERIC);
|
1081 | 1081 | }
|
1082 | 1082 | HRESULT WINAPI glDirectDrawSurface7::ChangeUniquenessValue()
|
1083 | 1083 | {
|
1084 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1084 | + if(!this) return DDERR_INVALIDOBJECT;
|
1085 | 1085 | FIXME("glDirectDrawSurface7::ChangeUniquenessValue: stub\n");
|
1086 | 1086 | ERR(DDERR_GENERIC);
|
1087 | 1087 | }
|
— | — | @@ -1087,31 +1087,31 @@ |
1088 | 1088 | // ddraw 7 api
|
1089 | 1089 | HRESULT WINAPI glDirectDrawSurface7::SetPriority(DWORD dwPriority)
|
1090 | 1090 | {
|
1091 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1091 | + if(!this) return DDERR_INVALIDOBJECT;
|
1092 | 1092 | FIXME("glDirectDrawSurface7::SetPriority: stub\n");
|
1093 | 1093 | ERR(DDERR_GENERIC);
|
1094 | 1094 | }
|
1095 | 1095 | HRESULT WINAPI glDirectDrawSurface7::GetPriority(LPDWORD lpdwPriority)
|
1096 | 1096 | {
|
1097 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1097 | + if(!this) return DDERR_INVALIDOBJECT;
|
1098 | 1098 | FIXME("glDirectDrawSurface7::GetPriority: stub\n");
|
1099 | 1099 | ERR(DDERR_GENERIC);
|
1100 | 1100 | }
|
1101 | 1101 | HRESULT WINAPI glDirectDrawSurface7::SetLOD(DWORD dwMaxLOD)
|
1102 | 1102 | {
|
1103 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1103 | + if(!this) return DDERR_INVALIDOBJECT;
|
1104 | 1104 | FIXME("glDirectDrawSurface7::SetLOD: stub\n");
|
1105 | 1105 | ERR(DDERR_GENERIC);
|
1106 | 1106 | }
|
1107 | 1107 | HRESULT WINAPI glDirectDrawSurface7::GetLOD(LPDWORD lpdwMaxLOD)
|
1108 | 1108 | {
|
1109 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1109 | + if(!this) return DDERR_INVALIDOBJECT;
|
1110 | 1110 | FIXME("glDirectDrawSurface7::GetLOD: stub\n");
|
1111 | 1111 | ERR(DDERR_GENERIC);
|
1112 | 1112 | }
|
1113 | 1113 | HRESULT WINAPI glDirectDrawSurface7::Unlock2(LPVOID lpSurfaceData)
|
1114 | 1114 | {
|
1115 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1115 | + if(!this) return DDERR_INVALIDOBJECT;
|
1116 | 1116 | return Unlock((LPRECT)lpSurfaceData);
|
1117 | 1117 | }
|
1118 | 1118 | void glDirectDrawSurface7::SetFilter(int level, GLint mag, GLint min)
|
— | — | @@ -1185,7 +1185,7 @@ |
1186 | 1186 | }
|
1187 | 1187 | HRESULT WINAPI glDirectDrawSurface1::QueryInterface(REFIID riid, void** ppvObj)
|
1188 | 1188 | {
|
1189 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1189 | + if(!this) return DDERR_INVALIDOBJECT;
|
1190 | 1190 | if(riid == IID_IUnknown)
|
1191 | 1191 | {
|
1192 | 1192 | this->AddRef();
|
— | — | @@ -1211,48 +1211,48 @@ |
1212 | 1212 | }
|
1213 | 1213 | HRESULT WINAPI glDirectDrawSurface1::AddAttachedSurface(LPDIRECTDRAWSURFACE lpDDSAttachedSurface)
|
1214 | 1214 | {
|
1215 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1215 | + if(!this) return DDERR_INVALIDOBJECT;
|
1216 | 1216 | return glDDS7->AddAttachedSurface(((glDirectDrawSurface1*)lpDDSAttachedSurface)->GetDDS7());
|
1217 | 1217 | }
|
1218 | 1218 | HRESULT WINAPI glDirectDrawSurface1::AddOverlayDirtyRect(LPRECT lpRect)
|
1219 | 1219 | {
|
1220 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1220 | + if(!this) return DDERR_INVALIDOBJECT;
|
1221 | 1221 | return glDDS7->AddOverlayDirtyRect(lpRect);
|
1222 | 1222 | }
|
1223 | 1223 | HRESULT WINAPI glDirectDrawSurface1::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
|
1224 | 1224 | {
|
1225 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1225 | + if(!this) return DDERR_INVALIDOBJECT;
|
1226 | 1226 | if(lpDDSrcSurface) return glDDS7->Blt(lpDestRect,((glDirectDrawSurface1*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx);
|
1227 | 1227 | else return glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx);
|
1228 | 1228 | }
|
1229 | 1229 | HRESULT WINAPI glDirectDrawSurface1::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
|
1230 | 1230 | {
|
1231 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1231 | + if(!this) return DDERR_INVALIDOBJECT;
|
1232 | 1232 | return glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags);
|
1233 | 1233 | }
|
1234 | 1234 | HRESULT WINAPI glDirectDrawSurface1::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
|
1235 | 1235 | {
|
1236 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1236 | + if(!this) return DDERR_INVALIDOBJECT;
|
1237 | 1237 | return glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface1*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans);
|
1238 | 1238 | }
|
1239 | 1239 | HRESULT WINAPI glDirectDrawSurface1::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSAttachedSurface)
|
1240 | 1240 | {
|
1241 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1241 | + if(!this) return DDERR_INVALIDOBJECT;
|
1242 | 1242 | return glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface);
|
1243 | 1243 | }
|
1244 | 1244 | HRESULT WINAPI glDirectDrawSurface1::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
|
1245 | 1245 | {
|
1246 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1246 | + if(!this) return DDERR_INVALIDOBJECT;
|
1247 | 1247 | return glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback);
|
1248 | 1248 | }
|
1249 | 1249 | HRESULT WINAPI glDirectDrawSurface1::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
|
1250 | 1250 | {
|
1251 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1251 | + if(!this) return DDERR_INVALIDOBJECT;
|
1252 | 1252 | return glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback);
|
1253 | 1253 | }
|
1254 | 1254 | HRESULT WINAPI glDirectDrawSurface1::Flip(LPDIRECTDRAWSURFACE lpDDSurfaceTargetOverride, DWORD dwFlags)
|
1255 | 1255 | {
|
1256 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1256 | + if(!this) return DDERR_INVALIDOBJECT;
|
1257 | 1257 | if(lpDDSurfaceTargetOverride)
|
1258 | 1258 | return glDDS7->Flip(((glDirectDrawSurface1*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags);
|
1259 | 1259 | else return glDDS7->Flip(NULL,dwFlags);
|
— | — | @@ -1259,7 +1259,7 @@ |
1260 | 1260 | }
|
1261 | 1261 | HRESULT WINAPI glDirectDrawSurface1::GetAttachedSurface(LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE FAR *lplpDDAttachedSurface)
|
1262 | 1262 | {
|
1263 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1263 | + if(!this) return DDERR_INVALIDOBJECT;
|
1264 | 1264 | if(!lpDDSCaps) return DDERR_INVALIDPARAMS;
|
1265 | 1265 | HRESULT error;
|
1266 | 1266 | glDirectDrawSurface7 *attachedsurface;
|
— | — | @@ -1278,12 +1278,12 @@ |
1279 | 1279 | }
|
1280 | 1280 | HRESULT WINAPI glDirectDrawSurface1::GetBltStatus(DWORD dwFlags)
|
1281 | 1281 | {
|
1282 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1282 | + if(!this) return DDERR_INVALIDOBJECT;
|
1283 | 1283 | return glDDS7->GetBltStatus(dwFlags);
|
1284 | 1284 | }
|
1285 | 1285 | HRESULT WINAPI glDirectDrawSurface1::GetCaps(LPDDSCAPS lpDDSCaps)
|
1286 | 1286 | {
|
1287 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1287 | + if(!this) return DDERR_INVALIDOBJECT;
|
1288 | 1288 | if(!lpDDSCaps) return DDERR_INVALIDPARAMS;
|
1289 | 1289 | HRESULT error;
|
1290 | 1290 | DDSCAPS2 ddsCaps1;
|
— | — | @@ -1294,107 +1294,107 @@ |
1295 | 1295 | }
|
1296 | 1296 | HRESULT WINAPI glDirectDrawSurface1::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
|
1297 | 1297 | {
|
1298 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1298 | + if(!this) return DDERR_INVALIDOBJECT;
|
1299 | 1299 | return glDDS7->GetClipper(lplpDDClipper);
|
1300 | 1300 | }
|
1301 | 1301 | HRESULT WINAPI glDirectDrawSurface1::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
1302 | 1302 | {
|
1303 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1303 | + if(!this) return DDERR_INVALIDOBJECT;
|
1304 | 1304 | return glDDS7->GetColorKey(dwFlags,lpDDColorKey);
|
1305 | 1305 | }
|
1306 | 1306 | HRESULT WINAPI glDirectDrawSurface1::GetDC(HDC FAR *lphDC)
|
1307 | 1307 | {
|
1308 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1308 | + if(!this) return DDERR_INVALIDOBJECT;
|
1309 | 1309 | return glDDS7->GetDC(lphDC);
|
1310 | 1310 | }
|
1311 | 1311 | HRESULT WINAPI glDirectDrawSurface1::GetFlipStatus(DWORD dwFlags)
|
1312 | 1312 | {
|
1313 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1313 | + if(!this) return DDERR_INVALIDOBJECT;
|
1314 | 1314 | return glDDS7->GetFlipStatus(dwFlags);
|
1315 | 1315 | }
|
1316 | 1316 | HRESULT WINAPI glDirectDrawSurface1::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
|
1317 | 1317 | {
|
1318 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1318 | + if(!this) return DDERR_INVALIDOBJECT;
|
1319 | 1319 | return glDDS7->GetOverlayPosition(lplX,lplY);
|
1320 | 1320 | }
|
1321 | 1321 | HRESULT WINAPI glDirectDrawSurface1::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
|
1322 | 1322 | {
|
1323 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1323 | + if(!this) return DDERR_INVALIDOBJECT;
|
1324 | 1324 | return glDDS7->GetPalette(lplpDDPalette);
|
1325 | 1325 | }
|
1326 | 1326 | HRESULT WINAPI glDirectDrawSurface1::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
|
1327 | 1327 | {
|
1328 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1328 | + if(!this) return DDERR_INVALIDOBJECT;
|
1329 | 1329 | return glDDS7->GetPixelFormat(lpDDPixelFormat);
|
1330 | 1330 | }
|
1331 | 1331 | HRESULT WINAPI glDirectDrawSurface1::GetSurfaceDesc(LPDDSURFACEDESC lpDDSurfaceDesc)
|
1332 | 1332 | {
|
1333 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1333 | + if(!this) return DDERR_INVALIDOBJECT;
|
1334 | 1334 | return glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc);
|
1335 | 1335 | }
|
1336 | 1336 | HRESULT WINAPI glDirectDrawSurface1::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc)
|
1337 | 1337 | {
|
1338 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1338 | + if(!this) return DDERR_INVALIDOBJECT;
|
1339 | 1339 | return DDERR_ALREADYINITIALIZED;
|
1340 | 1340 | }
|
1341 | 1341 | HRESULT WINAPI glDirectDrawSurface1::IsLost()
|
1342 | 1342 | {
|
1343 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1343 | + if(!this) return DDERR_INVALIDOBJECT;
|
1344 | 1344 | return glDDS7->IsLost();
|
1345 | 1345 | }
|
1346 | 1346 | HRESULT WINAPI glDirectDrawSurface1::Lock(LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
|
1347 | 1347 | {
|
1348 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1348 | + if(!this) return DDERR_INVALIDOBJECT;
|
1349 | 1349 | return glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent);
|
1350 | 1350 | }
|
1351 | 1351 | HRESULT WINAPI glDirectDrawSurface1::ReleaseDC(HDC hDC)
|
1352 | 1352 | {
|
1353 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1353 | + if(!this) return DDERR_INVALIDOBJECT;
|
1354 | 1354 | return glDDS7->ReleaseDC(hDC);
|
1355 | 1355 | }
|
1356 | 1356 | HRESULT WINAPI glDirectDrawSurface1::Restore()
|
1357 | 1357 | {
|
1358 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1358 | + if(!this) return DDERR_INVALIDOBJECT;
|
1359 | 1359 | return glDDS7->Restore();
|
1360 | 1360 | }
|
1361 | 1361 | HRESULT WINAPI glDirectDrawSurface1::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
|
1362 | 1362 | {
|
1363 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1363 | + if(!this) return DDERR_INVALIDOBJECT;
|
1364 | 1364 | return glDDS7->SetClipper(lpDDClipper);
|
1365 | 1365 | }
|
1366 | 1366 | HRESULT WINAPI glDirectDrawSurface1::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
1367 | 1367 | {
|
1368 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1368 | + if(!this) return DDERR_INVALIDOBJECT;
|
1369 | 1369 | return glDDS7->SetColorKey(dwFlags,lpDDColorKey);
|
1370 | 1370 | }
|
1371 | 1371 | HRESULT WINAPI glDirectDrawSurface1::SetOverlayPosition(LONG lX, LONG lY)
|
1372 | 1372 | {
|
1373 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1373 | + if(!this) return DDERR_INVALIDOBJECT;
|
1374 | 1374 | return glDDS7->SetOverlayPosition(lX,lY);
|
1375 | 1375 | }
|
1376 | 1376 | HRESULT WINAPI glDirectDrawSurface1::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
|
1377 | 1377 | {
|
1378 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1378 | + if(!this) return DDERR_INVALIDOBJECT;
|
1379 | 1379 | return glDDS7->SetPalette(lpDDPalette);
|
1380 | 1380 | }
|
1381 | 1381 | HRESULT WINAPI glDirectDrawSurface1::Unlock(LPVOID lpSurfaceData)
|
1382 | 1382 | {
|
1383 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1383 | + if(!this) return DDERR_INVALIDOBJECT;
|
1384 | 1384 | return glDDS7->Unlock2(lpSurfaceData);
|
1385 | 1385 | }
|
1386 | 1386 | HRESULT WINAPI glDirectDrawSurface1::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
|
1387 | 1387 | {
|
1388 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1388 | + if(!this) return DDERR_INVALIDOBJECT;
|
1389 | 1389 | return glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx);
|
1390 | 1390 | }
|
1391 | 1391 | HRESULT WINAPI glDirectDrawSurface1::UpdateOverlayDisplay(DWORD dwFlags)
|
1392 | 1392 | {
|
1393 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1393 | + if(!this) return DDERR_INVALIDOBJECT;
|
1394 | 1394 | return glDDS7->UpdateOverlayDisplay(dwFlags);
|
1395 | 1395 | }
|
1396 | 1396 | HRESULT WINAPI glDirectDrawSurface1::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSReference)
|
1397 | 1397 | {
|
1398 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1398 | + if(!this) return DDERR_INVALIDOBJECT;
|
1399 | 1399 | return glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference);
|
1400 | 1400 | }
|
1401 | 1401 |
|
— | — | @@ -1411,7 +1411,7 @@ |
1412 | 1412 | }
|
1413 | 1413 | HRESULT WINAPI glDirectDrawSurface2::QueryInterface(REFIID riid, void** ppvObj)
|
1414 | 1414 | {
|
1415 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1415 | + if(!this) return DDERR_INVALIDOBJECT;
|
1416 | 1416 | if(riid == IID_IUnknown)
|
1417 | 1417 | {
|
1418 | 1418 | this->AddRef();
|
— | — | @@ -1437,48 +1437,48 @@ |
1438 | 1438 | }
|
1439 | 1439 | HRESULT WINAPI glDirectDrawSurface2::AddAttachedSurface(LPDIRECTDRAWSURFACE2 lpDDSAttachedSurface)
|
1440 | 1440 | {
|
1441 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1441 | + if(!this) return DDERR_INVALIDOBJECT;
|
1442 | 1442 | return glDDS7->AddAttachedSurface(((glDirectDrawSurface2*)lpDDSAttachedSurface)->GetDDS7());
|
1443 | 1443 | }
|
1444 | 1444 | HRESULT WINAPI glDirectDrawSurface2::AddOverlayDirtyRect(LPRECT lpRect)
|
1445 | 1445 | {
|
1446 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1446 | + if(!this) return DDERR_INVALIDOBJECT;
|
1447 | 1447 | return glDDS7->AddOverlayDirtyRect(lpRect);
|
1448 | 1448 | }
|
1449 | 1449 | HRESULT WINAPI glDirectDrawSurface2::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
|
1450 | 1450 | {
|
1451 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1451 | + if(!this) return DDERR_INVALIDOBJECT;
|
1452 | 1452 | if(lpDDSrcSurface) return glDDS7->Blt(lpDestRect,((glDirectDrawSurface2*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx);
|
1453 | 1453 | else return glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx);
|
1454 | 1454 | }
|
1455 | 1455 | HRESULT WINAPI glDirectDrawSurface2::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
|
1456 | 1456 | {
|
1457 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1457 | + if(!this) return DDERR_INVALIDOBJECT;
|
1458 | 1458 | return glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags);
|
1459 | 1459 | }
|
1460 | 1460 | HRESULT WINAPI glDirectDrawSurface2::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
|
1461 | 1461 | {
|
1462 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1462 | + if(!this) return DDERR_INVALIDOBJECT;
|
1463 | 1463 | return glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface2*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans);
|
1464 | 1464 | }
|
1465 | 1465 | HRESULT WINAPI glDirectDrawSurface2::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSAttachedSurface)
|
1466 | 1466 | {
|
1467 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1467 | + if(!this) return DDERR_INVALIDOBJECT;
|
1468 | 1468 | return glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface);
|
1469 | 1469 | }
|
1470 | 1470 | HRESULT WINAPI glDirectDrawSurface2::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
|
1471 | 1471 | {
|
1472 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1472 | + if(!this) return DDERR_INVALIDOBJECT;
|
1473 | 1473 | return glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback);
|
1474 | 1474 | }
|
1475 | 1475 | HRESULT WINAPI glDirectDrawSurface2::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
|
1476 | 1476 | {
|
1477 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1477 | + if(!this) return DDERR_INVALIDOBJECT;
|
1478 | 1478 | return glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback);
|
1479 | 1479 | }
|
1480 | 1480 | HRESULT WINAPI glDirectDrawSurface2::Flip(LPDIRECTDRAWSURFACE2 lpDDSurfaceTargetOverride, DWORD dwFlags)
|
1481 | 1481 | {
|
1482 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1482 | + if(!this) return DDERR_INVALIDOBJECT;
|
1483 | 1483 | if(lpDDSurfaceTargetOverride)
|
1484 | 1484 | return glDDS7->Flip(((glDirectDrawSurface2*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags);
|
1485 | 1485 | else return glDDS7->Flip(NULL,dwFlags);
|
— | — | @@ -1485,7 +1485,7 @@ |
1486 | 1486 | }
|
1487 | 1487 | HRESULT WINAPI glDirectDrawSurface2::GetAttachedSurface(LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE2 FAR *lplpDDAttachedSurface)
|
1488 | 1488 | {
|
1489 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1489 | + if(!this) return DDERR_INVALIDOBJECT;
|
1490 | 1490 | HRESULT error;
|
1491 | 1491 | glDirectDrawSurface7 *attachedsurface;
|
1492 | 1492 | glDirectDrawSurface2 *attached1;
|
— | — | @@ -1503,12 +1503,12 @@ |
1504 | 1504 | }
|
1505 | 1505 | HRESULT WINAPI glDirectDrawSurface2::GetBltStatus(DWORD dwFlags)
|
1506 | 1506 | {
|
1507 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1507 | + if(!this) return DDERR_INVALIDOBJECT;
|
1508 | 1508 | return glDDS7->GetBltStatus(dwFlags);
|
1509 | 1509 | }
|
1510 | 1510 | HRESULT WINAPI glDirectDrawSurface2::GetCaps(LPDDSCAPS lpDDSCaps)
|
1511 | 1511 | {
|
1512 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1512 | + if(!this) return DDERR_INVALIDOBJECT;
|
1513 | 1513 | if(!lpDDSCaps) return DDERR_INVALIDPARAMS;
|
1514 | 1514 | HRESULT error;
|
1515 | 1515 | DDSCAPS2 ddsCaps1;
|
— | — | @@ -1519,122 +1519,127 @@ |
1520 | 1520 | }
|
1521 | 1521 | HRESULT WINAPI glDirectDrawSurface2::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
|
1522 | 1522 | {
|
1523 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1523 | + if(!this) return DDERR_INVALIDOBJECT;
|
1524 | 1524 | return glDDS7->GetClipper(lplpDDClipper);
|
1525 | 1525 | }
|
1526 | 1526 | HRESULT WINAPI glDirectDrawSurface2::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
1527 | 1527 | {
|
1528 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1528 | + if(!this) return DDERR_INVALIDOBJECT;
|
1529 | 1529 | return glDDS7->GetColorKey(dwFlags,lpDDColorKey);
|
1530 | 1530 | }
|
1531 | 1531 | HRESULT WINAPI glDirectDrawSurface2::GetDC(HDC FAR *lphDC)
|
1532 | 1532 | {
|
1533 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1533 | + if(!this) return DDERR_INVALIDOBJECT;
|
1534 | 1534 | return glDDS7->GetDC(lphDC);
|
1535 | 1535 | }
|
1536 | 1536 | HRESULT WINAPI glDirectDrawSurface2::GetFlipStatus(DWORD dwFlags)
|
1537 | 1537 | {
|
1538 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1538 | + if(!this) return DDERR_INVALIDOBJECT;
|
1539 | 1539 | return glDDS7->GetFlipStatus(dwFlags);
|
1540 | 1540 | }
|
1541 | 1541 | HRESULT WINAPI glDirectDrawSurface2::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
|
1542 | 1542 | {
|
1543 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1543 | + if(!this) return DDERR_INVALIDOBJECT;
|
1544 | 1544 | return glDDS7->GetOverlayPosition(lplX,lplY);
|
1545 | 1545 | }
|
1546 | 1546 | HRESULT WINAPI glDirectDrawSurface2::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
|
1547 | 1547 | {
|
1548 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1548 | + if(!this) return DDERR_INVALIDOBJECT;
|
1549 | 1549 | return glDDS7->GetPalette(lplpDDPalette);
|
1550 | 1550 | }
|
1551 | 1551 | HRESULT WINAPI glDirectDrawSurface2::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
|
1552 | 1552 | {
|
1553 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1553 | + if(!this) return DDERR_INVALIDOBJECT;
|
1554 | 1554 | return glDDS7->GetPixelFormat(lpDDPixelFormat);
|
1555 | 1555 | }
|
1556 | 1556 | HRESULT WINAPI glDirectDrawSurface2::GetSurfaceDesc(LPDDSURFACEDESC lpDDSurfaceDesc)
|
1557 | 1557 | {
|
1558 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1558 | + if(!this) return DDERR_INVALIDOBJECT;
|
1559 | 1559 | return glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc);
|
1560 | 1560 | }
|
1561 | 1561 | HRESULT WINAPI glDirectDrawSurface2::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc)
|
1562 | 1562 | {
|
1563 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1563 | + if(!this) return DDERR_INVALIDOBJECT;
|
1564 | 1564 | return DDERR_ALREADYINITIALIZED;
|
1565 | 1565 | }
|
1566 | 1566 | HRESULT WINAPI glDirectDrawSurface2::IsLost()
|
1567 | 1567 | {
|
1568 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1568 | + if(!this) return DDERR_INVALIDOBJECT;
|
1569 | 1569 | return glDDS7->IsLost();
|
1570 | 1570 | }
|
1571 | 1571 | HRESULT WINAPI glDirectDrawSurface2::Lock(LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
|
1572 | 1572 | {
|
1573 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1573 | + if(!this) return DDERR_INVALIDOBJECT;
|
1574 | 1574 | return glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent);
|
1575 | 1575 | }
|
1576 | 1576 | HRESULT WINAPI glDirectDrawSurface2::ReleaseDC(HDC hDC)
|
1577 | 1577 | {
|
1578 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1578 | + if(!this) return DDERR_INVALIDOBJECT;
|
1579 | 1579 | return glDDS7->ReleaseDC(hDC);
|
1580 | 1580 | }
|
1581 | 1581 | HRESULT WINAPI glDirectDrawSurface2::Restore()
|
1582 | 1582 | {
|
1583 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1583 | + if(!this) return DDERR_INVALIDOBJECT;
|
1584 | 1584 | return glDDS7->Restore();
|
1585 | 1585 | }
|
1586 | 1586 | HRESULT WINAPI glDirectDrawSurface2::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
|
1587 | 1587 | {
|
1588 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1588 | + if(!this) return DDERR_INVALIDOBJECT;
|
1589 | 1589 | return glDDS7->SetClipper(lpDDClipper);
|
1590 | 1590 | }
|
1591 | 1591 | HRESULT WINAPI glDirectDrawSurface2::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
1592 | 1592 | {
|
1593 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1593 | + if(!this) return DDERR_INVALIDOBJECT;
|
1594 | 1594 | return glDDS7->SetColorKey(dwFlags,lpDDColorKey);
|
1595 | 1595 | }
|
1596 | 1596 | HRESULT WINAPI glDirectDrawSurface2::SetOverlayPosition(LONG lX, LONG lY)
|
1597 | 1597 | {
|
1598 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1598 | + if(!this) return DDERR_INVALIDOBJECT;
|
1599 | 1599 | return glDDS7->SetOverlayPosition(lX,lY);
|
1600 | 1600 | }
|
1601 | 1601 | HRESULT WINAPI glDirectDrawSurface2::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
|
1602 | 1602 | {
|
1603 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1603 | + if(!this) return DDERR_INVALIDOBJECT;
|
1604 | 1604 | return glDDS7->SetPalette(lpDDPalette);
|
1605 | 1605 | }
|
1606 | 1606 | HRESULT WINAPI glDirectDrawSurface2::Unlock(LPVOID lpSurfaceData)
|
1607 | 1607 | {
|
1608 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1608 | + if(!this) return DDERR_INVALIDOBJECT;
|
1609 | 1609 | return glDDS7->Unlock2(lpSurfaceData);
|
1610 | 1610 | }
|
1611 | 1611 | HRESULT WINAPI glDirectDrawSurface2::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE2 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
|
1612 | 1612 | {
|
1613 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1613 | + if(!this) return DDERR_INVALIDOBJECT;
|
1614 | 1614 | return glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx);
|
1615 | 1615 | }
|
1616 | 1616 | HRESULT WINAPI glDirectDrawSurface2::UpdateOverlayDisplay(DWORD dwFlags)
|
1617 | 1617 | {
|
1618 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1618 | + if(!this) return DDERR_INVALIDOBJECT;
|
1619 | 1619 | return glDDS7->UpdateOverlayDisplay(dwFlags);
|
1620 | 1620 | }
|
1621 | 1621 | HRESULT WINAPI glDirectDrawSurface2::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSReference)
|
1622 | 1622 | {
|
1623 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1623 | + if(!this) return DDERR_INVALIDOBJECT;
|
1624 | 1624 | return glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference);
|
1625 | 1625 | }
|
1626 | 1626 | HRESULT WINAPI glDirectDrawSurface2::GetDDInterface(LPVOID FAR *lplpDD)
|
1627 | 1627 | {
|
1628 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1629 | | - return glDDS7->GetDDInterface(lplpDD);
|
| 1628 | + if(!this) return DDERR_INVALIDOBJECT;
|
| 1629 | + glDirectDraw7 *glDD7;
|
| 1630 | + HRESULT ret = glDDS7->GetDDInterface((void**)&glDD7);
|
| 1631 | + if(ret != DD_OK) return ret;
|
| 1632 | + glDD7->QueryInterface(IID_IDirectDraw,lplpDD);
|
| 1633 | + glDD7->Release();
|
| 1634 | + return ret;
|
1630 | 1635 | }
|
1631 | 1636 | HRESULT WINAPI glDirectDrawSurface2::PageLock(DWORD dwFlags)
|
1632 | 1637 | {
|
1633 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1638 | + if(!this) return DDERR_INVALIDOBJECT;
|
1634 | 1639 | return glDDS7->PageLock(dwFlags);
|
1635 | 1640 | }
|
1636 | 1641 | HRESULT WINAPI glDirectDrawSurface2::PageUnlock(DWORD dwFlags)
|
1637 | 1642 | {
|
1638 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1643 | + if(!this) return DDERR_INVALIDOBJECT;
|
1639 | 1644 | return glDDS7->PageUnlock(dwFlags);
|
1640 | 1645 | }
|
1641 | 1646 |
|
— | — | @@ -1651,7 +1656,7 @@ |
1652 | 1657 | }
|
1653 | 1658 | HRESULT WINAPI glDirectDrawSurface3::QueryInterface(REFIID riid, void** ppvObj)
|
1654 | 1659 | {
|
1655 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1660 | + if(!this) return DDERR_INVALIDOBJECT;
|
1656 | 1661 | if(riid == IID_IUnknown)
|
1657 | 1662 | {
|
1658 | 1663 | this->AddRef();
|
— | — | @@ -1677,48 +1682,48 @@ |
1678 | 1683 | }
|
1679 | 1684 | HRESULT WINAPI glDirectDrawSurface3::AddAttachedSurface(LPDIRECTDRAWSURFACE3 lpDDSAttachedSurface)
|
1680 | 1685 | {
|
1681 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1686 | + if(!this) return DDERR_INVALIDOBJECT;
|
1682 | 1687 | return glDDS7->AddAttachedSurface(((glDirectDrawSurface3*)lpDDSAttachedSurface)->GetDDS7());
|
1683 | 1688 | }
|
1684 | 1689 | HRESULT WINAPI glDirectDrawSurface3::AddOverlayDirtyRect(LPRECT lpRect)
|
1685 | 1690 | {
|
1686 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1691 | + if(!this) return DDERR_INVALIDOBJECT;
|
1687 | 1692 | return glDDS7->AddOverlayDirtyRect(lpRect);
|
1688 | 1693 | }
|
1689 | 1694 | HRESULT WINAPI glDirectDrawSurface3::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
|
1690 | 1695 | {
|
1691 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1696 | + if(!this) return DDERR_INVALIDOBJECT;
|
1692 | 1697 | if(lpDDSrcSurface) return glDDS7->Blt(lpDestRect,((glDirectDrawSurface3*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx);
|
1693 | 1698 | else return glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx);
|
1694 | 1699 | }
|
1695 | 1700 | HRESULT WINAPI glDirectDrawSurface3::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
|
1696 | 1701 | {
|
1697 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1702 | + if(!this) return DDERR_INVALIDOBJECT;
|
1698 | 1703 | return glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags);
|
1699 | 1704 | }
|
1700 | 1705 | HRESULT WINAPI glDirectDrawSurface3::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
|
1701 | 1706 | {
|
1702 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1707 | + if(!this) return DDERR_INVALIDOBJECT;
|
1703 | 1708 | return glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface3*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans);
|
1704 | 1709 | }
|
1705 | 1710 | HRESULT WINAPI glDirectDrawSurface3::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSAttachedSurface)
|
1706 | 1711 | {
|
1707 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1712 | + if(!this) return DDERR_INVALIDOBJECT;
|
1708 | 1713 | return glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface);
|
1709 | 1714 | }
|
1710 | 1715 | HRESULT WINAPI glDirectDrawSurface3::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
|
1711 | 1716 | {
|
1712 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1717 | + if(!this) return DDERR_INVALIDOBJECT;
|
1713 | 1718 | return glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback);
|
1714 | 1719 | }
|
1715 | 1720 | HRESULT WINAPI glDirectDrawSurface3::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
|
1716 | 1721 | {
|
1717 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1722 | + if(!this) return DDERR_INVALIDOBJECT;
|
1718 | 1723 | return glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback);
|
1719 | 1724 | }
|
1720 | 1725 | HRESULT WINAPI glDirectDrawSurface3::Flip(LPDIRECTDRAWSURFACE3 lpDDSurfaceTargetOverride, DWORD dwFlags)
|
1721 | 1726 | {
|
1722 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1727 | + if(!this) return DDERR_INVALIDOBJECT;
|
1723 | 1728 | if(lpDDSurfaceTargetOverride)
|
1724 | 1729 | return glDDS7->Flip(((glDirectDrawSurface3*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags);
|
1725 | 1730 | else return glDDS7->Flip(NULL,dwFlags);
|
— | — | @@ -1725,7 +1730,7 @@ |
1726 | 1731 | }
|
1727 | 1732 | HRESULT WINAPI glDirectDrawSurface3::GetAttachedSurface(LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE3 FAR *lplpDDAttachedSurface)
|
1728 | 1733 | {
|
1729 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1734 | + if(!this) return DDERR_INVALIDOBJECT;
|
1730 | 1735 | HRESULT error;
|
1731 | 1736 | glDirectDrawSurface7 *attachedsurface;
|
1732 | 1737 | glDirectDrawSurface3 *attached1;
|
— | — | @@ -1743,12 +1748,12 @@ |
1744 | 1749 | }
|
1745 | 1750 | HRESULT WINAPI glDirectDrawSurface3::GetBltStatus(DWORD dwFlags)
|
1746 | 1751 | {
|
1747 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1752 | + if(!this) return DDERR_INVALIDOBJECT;
|
1748 | 1753 | return glDDS7->GetBltStatus(dwFlags);
|
1749 | 1754 | }
|
1750 | 1755 | HRESULT WINAPI glDirectDrawSurface3::GetCaps(LPDDSCAPS lpDDSCaps)
|
1751 | 1756 | {
|
1752 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1757 | + if(!this) return DDERR_INVALIDOBJECT;
|
1753 | 1758 | if(!lpDDSCaps) return DDERR_INVALIDPARAMS;
|
1754 | 1759 | HRESULT error;
|
1755 | 1760 | DDSCAPS2 ddsCaps1;
|
— | — | @@ -1759,127 +1764,132 @@ |
1760 | 1765 | }
|
1761 | 1766 | HRESULT WINAPI glDirectDrawSurface3::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
|
1762 | 1767 | {
|
1763 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1768 | + if(!this) return DDERR_INVALIDOBJECT;
|
1764 | 1769 | return glDDS7->GetClipper(lplpDDClipper);
|
1765 | 1770 | }
|
1766 | 1771 | HRESULT WINAPI glDirectDrawSurface3::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
1767 | 1772 | {
|
1768 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1773 | + if(!this) return DDERR_INVALIDOBJECT;
|
1769 | 1774 | return glDDS7->GetColorKey(dwFlags,lpDDColorKey);
|
1770 | 1775 | }
|
1771 | 1776 | HRESULT WINAPI glDirectDrawSurface3::GetDC(HDC FAR *lphDC)
|
1772 | 1777 | {
|
1773 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1778 | + if(!this) return DDERR_INVALIDOBJECT;
|
1774 | 1779 | return glDDS7->GetDC(lphDC);
|
1775 | 1780 | }
|
1776 | 1781 | HRESULT WINAPI glDirectDrawSurface3::GetFlipStatus(DWORD dwFlags)
|
1777 | 1782 | {
|
1778 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1783 | + if(!this) return DDERR_INVALIDOBJECT;
|
1779 | 1784 | return glDDS7->GetFlipStatus(dwFlags);
|
1780 | 1785 | }
|
1781 | 1786 | HRESULT WINAPI glDirectDrawSurface3::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
|
1782 | 1787 | {
|
1783 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1788 | + if(!this) return DDERR_INVALIDOBJECT;
|
1784 | 1789 | return glDDS7->GetOverlayPosition(lplX,lplY);
|
1785 | 1790 | }
|
1786 | 1791 | HRESULT WINAPI glDirectDrawSurface3::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
|
1787 | 1792 | {
|
1788 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1793 | + if(!this) return DDERR_INVALIDOBJECT;
|
1789 | 1794 | return glDDS7->GetPalette(lplpDDPalette);
|
1790 | 1795 | }
|
1791 | 1796 | HRESULT WINAPI glDirectDrawSurface3::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
|
1792 | 1797 | {
|
1793 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1798 | + if(!this) return DDERR_INVALIDOBJECT;
|
1794 | 1799 | return glDDS7->GetPixelFormat(lpDDPixelFormat);
|
1795 | 1800 | }
|
1796 | 1801 | HRESULT WINAPI glDirectDrawSurface3::GetSurfaceDesc(LPDDSURFACEDESC lpDDSurfaceDesc)
|
1797 | 1802 | {
|
1798 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1803 | + if(!this) return DDERR_INVALIDOBJECT;
|
1799 | 1804 | return glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc);
|
1800 | 1805 | }
|
1801 | 1806 | HRESULT WINAPI glDirectDrawSurface3::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc)
|
1802 | 1807 | {
|
1803 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1808 | + if(!this) return DDERR_INVALIDOBJECT;
|
1804 | 1809 | return DDERR_ALREADYINITIALIZED;
|
1805 | 1810 | }
|
1806 | 1811 | HRESULT WINAPI glDirectDrawSurface3::IsLost()
|
1807 | 1812 | {
|
1808 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1813 | + if(!this) return DDERR_INVALIDOBJECT;
|
1809 | 1814 | return glDDS7->IsLost();
|
1810 | 1815 | }
|
1811 | 1816 | HRESULT WINAPI glDirectDrawSurface3::Lock(LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
|
1812 | 1817 | {
|
1813 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1818 | + if(!this) return DDERR_INVALIDOBJECT;
|
1814 | 1819 | return glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent);
|
1815 | 1820 | }
|
1816 | 1821 | HRESULT WINAPI glDirectDrawSurface3::ReleaseDC(HDC hDC)
|
1817 | 1822 | {
|
1818 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1823 | + if(!this) return DDERR_INVALIDOBJECT;
|
1819 | 1824 | return glDDS7->ReleaseDC(hDC);
|
1820 | 1825 | }
|
1821 | 1826 | HRESULT WINAPI glDirectDrawSurface3::Restore()
|
1822 | 1827 | {
|
1823 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1828 | + if(!this) return DDERR_INVALIDOBJECT;
|
1824 | 1829 | return glDDS7->Restore();
|
1825 | 1830 | }
|
1826 | 1831 | HRESULT WINAPI glDirectDrawSurface3::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
|
1827 | 1832 | {
|
1828 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1833 | + if(!this) return DDERR_INVALIDOBJECT;
|
1829 | 1834 | return glDDS7->SetClipper(lpDDClipper);
|
1830 | 1835 | }
|
1831 | 1836 | HRESULT WINAPI glDirectDrawSurface3::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
1832 | 1837 | {
|
1833 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1838 | + if(!this) return DDERR_INVALIDOBJECT;
|
1834 | 1839 | return glDDS7->SetColorKey(dwFlags,lpDDColorKey);
|
1835 | 1840 | }
|
1836 | 1841 | HRESULT WINAPI glDirectDrawSurface3::SetOverlayPosition(LONG lX, LONG lY)
|
1837 | 1842 | {
|
1838 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1843 | + if(!this) return DDERR_INVALIDOBJECT;
|
1839 | 1844 | return glDDS7->SetOverlayPosition(lX,lY);
|
1840 | 1845 | }
|
1841 | 1846 | HRESULT WINAPI glDirectDrawSurface3::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
|
1842 | 1847 | {
|
1843 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1848 | + if(!this) return DDERR_INVALIDOBJECT;
|
1844 | 1849 | return glDDS7->SetPalette(lpDDPalette);
|
1845 | 1850 | }
|
1846 | 1851 | HRESULT WINAPI glDirectDrawSurface3::Unlock(LPVOID lpSurfaceData)
|
1847 | 1852 | {
|
1848 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1853 | + if(!this) return DDERR_INVALIDOBJECT;
|
1849 | 1854 | return glDDS7->Unlock2(lpSurfaceData);
|
1850 | 1855 | }
|
1851 | 1856 | HRESULT WINAPI glDirectDrawSurface3::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE3 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
|
1852 | 1857 | {
|
1853 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1858 | + if(!this) return DDERR_INVALIDOBJECT;
|
1854 | 1859 | return glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx);
|
1855 | 1860 | }
|
1856 | 1861 | HRESULT WINAPI glDirectDrawSurface3::UpdateOverlayDisplay(DWORD dwFlags)
|
1857 | 1862 | {
|
1858 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1863 | + if(!this) return DDERR_INVALIDOBJECT;
|
1859 | 1864 | return glDDS7->UpdateOverlayDisplay(dwFlags);
|
1860 | 1865 | }
|
1861 | 1866 | HRESULT WINAPI glDirectDrawSurface3::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSReference)
|
1862 | 1867 | {
|
1863 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1868 | + if(!this) return DDERR_INVALIDOBJECT;
|
1864 | 1869 | return glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference);
|
1865 | 1870 | }
|
1866 | 1871 | HRESULT WINAPI glDirectDrawSurface3::GetDDInterface(LPVOID FAR *lplpDD)
|
1867 | 1872 | {
|
1868 | | - if(!this) return DDERR_INVALIDPARAMS;
|
1869 | | - return glDDS7->GetDDInterface(lplpDD);
|
| 1873 | + if(!this) return DDERR_INVALIDOBJECT;
|
| 1874 | + glDirectDraw7 *glDD7;
|
| 1875 | + HRESULT ret = glDDS7->GetDDInterface((void**)&glDD7);
|
| 1876 | + if(ret != DD_OK) return ret;
|
| 1877 | + glDD7->QueryInterface(IID_IDirectDraw,lplpDD);
|
| 1878 | + glDD7->Release();
|
| 1879 | + return ret;
|
1870 | 1880 | }
|
1871 | 1881 | HRESULT WINAPI glDirectDrawSurface3::PageLock(DWORD dwFlags)
|
1872 | 1882 | {
|
1873 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1883 | + if(!this) return DDERR_INVALIDOBJECT;
|
1874 | 1884 | return glDDS7->PageLock(dwFlags);
|
1875 | 1885 | }
|
1876 | 1886 | HRESULT WINAPI glDirectDrawSurface3::PageUnlock(DWORD dwFlags)
|
1877 | 1887 | {
|
1878 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1888 | + if(!this) return DDERR_INVALIDOBJECT;
|
1879 | 1889 | return glDDS7->PageUnlock(dwFlags);
|
1880 | 1890 | }
|
1881 | 1891 | HRESULT WINAPI glDirectDrawSurface3::SetSurfaceDesc(LPDDSURFACEDESC lpddsd, DWORD dwFlags)
|
1882 | 1892 | {
|
1883 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1893 | + if(!this) return DDERR_INVALIDOBJECT;
|
1884 | 1894 | return glDDS7->SetSurfaceDesc((LPDDSURFACEDESC2)lpddsd,dwFlags);
|
1885 | 1895 | }
|
1886 | 1896 |
|
— | — | @@ -1896,7 +1906,7 @@ |
1897 | 1907 | }
|
1898 | 1908 | HRESULT WINAPI glDirectDrawSurface4::QueryInterface(REFIID riid, void** ppvObj)
|
1899 | 1909 | {
|
1900 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1910 | + if(!this) return DDERR_INVALIDOBJECT;
|
1901 | 1911 | if(riid == IID_IUnknown)
|
1902 | 1912 | {
|
1903 | 1913 | this->AddRef();
|
— | — | @@ -1922,48 +1932,48 @@ |
1923 | 1933 | }
|
1924 | 1934 | HRESULT WINAPI glDirectDrawSurface4::AddAttachedSurface(LPDIRECTDRAWSURFACE4 lpDDSAttachedSurface)
|
1925 | 1935 | {
|
1926 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1936 | + if(!this) return DDERR_INVALIDOBJECT;
|
1927 | 1937 | return glDDS7->AddAttachedSurface(((glDirectDrawSurface4*)lpDDSAttachedSurface)->GetDDS7());
|
1928 | 1938 | }
|
1929 | 1939 | HRESULT WINAPI glDirectDrawSurface4::AddOverlayDirtyRect(LPRECT lpRect)
|
1930 | 1940 | {
|
1931 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1941 | + if(!this) return DDERR_INVALIDOBJECT;
|
1932 | 1942 | return glDDS7->AddOverlayDirtyRect(lpRect);
|
1933 | 1943 | }
|
1934 | 1944 | HRESULT WINAPI glDirectDrawSurface4::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
|
1935 | 1945 | {
|
1936 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1946 | + if(!this) return DDERR_INVALIDOBJECT;
|
1937 | 1947 | if(lpDDSrcSurface) return glDDS7->Blt(lpDestRect,((glDirectDrawSurface4*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx);
|
1938 | 1948 | else return glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx);
|
1939 | 1949 | }
|
1940 | 1950 | HRESULT WINAPI glDirectDrawSurface4::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
|
1941 | 1951 | {
|
1942 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1952 | + if(!this) return DDERR_INVALIDOBJECT;
|
1943 | 1953 | return glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags);
|
1944 | 1954 | }
|
1945 | 1955 | HRESULT WINAPI glDirectDrawSurface4::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
|
1946 | 1956 | {
|
1947 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1957 | + if(!this) return DDERR_INVALIDOBJECT;
|
1948 | 1958 | return glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface4*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans);
|
1949 | 1959 | }
|
1950 | 1960 | HRESULT WINAPI glDirectDrawSurface4::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE4 lpDDSAttachedSurface)
|
1951 | 1961 | {
|
1952 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1962 | + if(!this) return DDERR_INVALIDOBJECT;
|
1953 | 1963 | return glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface);
|
1954 | 1964 | }
|
1955 | 1965 | HRESULT WINAPI glDirectDrawSurface4::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpEnumSurfacesCallback)
|
1956 | 1966 | {
|
1957 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1967 | + if(!this) return DDERR_INVALIDOBJECT;
|
1958 | 1968 | return glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback);
|
1959 | 1969 | }
|
1960 | 1970 | HRESULT WINAPI glDirectDrawSurface4::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpfnCallback)
|
1961 | 1971 | {
|
1962 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1972 | + if(!this) return DDERR_INVALIDOBJECT;
|
1963 | 1973 | return glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback);
|
1964 | 1974 | }
|
1965 | 1975 | HRESULT WINAPI glDirectDrawSurface4::Flip(LPDIRECTDRAWSURFACE4 lpDDSurfaceTargetOverride, DWORD dwFlags)
|
1966 | 1976 | {
|
1967 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1977 | + if(!this) return DDERR_INVALIDOBJECT;
|
1968 | 1978 | if(lpDDSurfaceTargetOverride)
|
1969 | 1979 | return glDDS7->Flip(((glDirectDrawSurface4*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags);
|
1970 | 1980 | else return glDDS7->Flip(NULL,dwFlags);
|
— | — | @@ -1970,7 +1980,7 @@ |
1971 | 1981 | }
|
1972 | 1982 | HRESULT WINAPI glDirectDrawSurface4::GetAttachedSurface(LPDDSCAPS2 lpDDSCaps2, LPDIRECTDRAWSURFACE4 FAR *lplpDDAttachedSurface)
|
1973 | 1983 | {
|
1974 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1984 | + if(!this) return DDERR_INVALIDOBJECT;
|
1975 | 1985 | HRESULT error;
|
1976 | 1986 | glDirectDrawSurface7 *attachedsurface;
|
1977 | 1987 | glDirectDrawSurface4 *attached1;
|
— | — | @@ -1985,161 +1995,161 @@ |
1986 | 1996 | }
|
1987 | 1997 | HRESULT WINAPI glDirectDrawSurface4::GetBltStatus(DWORD dwFlags)
|
1988 | 1998 | {
|
1989 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 1999 | + if(!this) return DDERR_INVALIDOBJECT;
|
1990 | 2000 | return glDDS7->GetBltStatus(dwFlags);
|
1991 | 2001 | }
|
1992 | 2002 | HRESULT WINAPI glDirectDrawSurface4::GetCaps(LPDDSCAPS2 lpDDSCaps)
|
1993 | 2003 | {
|
1994 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2004 | + if(!this) return DDERR_INVALIDOBJECT;
|
1995 | 2005 | return glDDS7->GetCaps(lpDDSCaps);
|
1996 | 2006 | }
|
1997 | 2007 | HRESULT WINAPI glDirectDrawSurface4::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
|
1998 | 2008 | {
|
1999 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2009 | + if(!this) return DDERR_INVALIDOBJECT;
|
2000 | 2010 | return glDDS7->GetClipper(lplpDDClipper);
|
2001 | 2011 | }
|
2002 | 2012 | HRESULT WINAPI glDirectDrawSurface4::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
2003 | 2013 | {
|
2004 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2014 | + if(!this) return DDERR_INVALIDOBJECT;
|
2005 | 2015 | return glDDS7->GetColorKey(dwFlags,lpDDColorKey);
|
2006 | 2016 | }
|
2007 | 2017 | HRESULT WINAPI glDirectDrawSurface4::GetDC(HDC FAR *lphDC)
|
2008 | 2018 | {
|
2009 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2019 | + if(!this) return DDERR_INVALIDOBJECT;
|
2010 | 2020 | return glDDS7->GetDC(lphDC);
|
2011 | 2021 | }
|
2012 | 2022 | HRESULT WINAPI glDirectDrawSurface4::GetFlipStatus(DWORD dwFlags)
|
2013 | 2023 | {
|
2014 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2024 | + if(!this) return DDERR_INVALIDOBJECT;
|
2015 | 2025 | return glDDS7->GetFlipStatus(dwFlags);
|
2016 | 2026 | }
|
2017 | 2027 | HRESULT WINAPI glDirectDrawSurface4::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
|
2018 | 2028 | {
|
2019 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2029 | + if(!this) return DDERR_INVALIDOBJECT;
|
2020 | 2030 | return glDDS7->GetOverlayPosition(lplX,lplY);
|
2021 | 2031 | }
|
2022 | 2032 | HRESULT WINAPI glDirectDrawSurface4::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
|
2023 | 2033 | {
|
2024 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2034 | + if(!this) return DDERR_INVALIDOBJECT;
|
2025 | 2035 | return glDDS7->GetPalette(lplpDDPalette);
|
2026 | 2036 | }
|
2027 | 2037 | HRESULT WINAPI glDirectDrawSurface4::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
|
2028 | 2038 | {
|
2029 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2039 | + if(!this) return DDERR_INVALIDOBJECT;
|
2030 | 2040 | return glDDS7->GetPixelFormat(lpDDPixelFormat);
|
2031 | 2041 | }
|
2032 | 2042 | HRESULT WINAPI glDirectDrawSurface4::GetSurfaceDesc(LPDDSURFACEDESC2 lpDDSurfaceDesc)
|
2033 | 2043 | {
|
2034 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2044 | + if(!this) return DDERR_INVALIDOBJECT;
|
2035 | 2045 | return glDDS7->GetSurfaceDesc(lpDDSurfaceDesc);
|
2036 | 2046 | }
|
2037 | 2047 | HRESULT WINAPI glDirectDrawSurface4::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC2 lpDDSurfaceDesc)
|
2038 | 2048 | {
|
2039 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2049 | + if(!this) return DDERR_INVALIDOBJECT;
|
2040 | 2050 | return DDERR_ALREADYINITIALIZED;
|
2041 | 2051 | }
|
2042 | 2052 | HRESULT WINAPI glDirectDrawSurface4::IsLost()
|
2043 | 2053 | {
|
2044 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2054 | + if(!this) return DDERR_INVALIDOBJECT;
|
2045 | 2055 | return glDDS7->IsLost();
|
2046 | 2056 | }
|
2047 | 2057 | HRESULT WINAPI glDirectDrawSurface4::Lock(LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
|
2048 | 2058 | {
|
2049 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2059 | + if(!this) return DDERR_INVALIDOBJECT;
|
2050 | 2060 | return glDDS7->Lock(lpDestRect,lpDDSurfaceDesc,dwFlags,hEvent);
|
2051 | 2061 | }
|
2052 | 2062 | HRESULT WINAPI glDirectDrawSurface4::ReleaseDC(HDC hDC)
|
2053 | 2063 | {
|
2054 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2064 | + if(!this) return DDERR_INVALIDOBJECT;
|
2055 | 2065 | return glDDS7->ReleaseDC(hDC);
|
2056 | 2066 | }
|
2057 | 2067 | HRESULT WINAPI glDirectDrawSurface4::Restore()
|
2058 | 2068 | {
|
2059 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2069 | + if(!this) return DDERR_INVALIDOBJECT;
|
2060 | 2070 | return glDDS7->Restore();
|
2061 | 2071 | }
|
2062 | 2072 | HRESULT WINAPI glDirectDrawSurface4::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
|
2063 | 2073 | {
|
2064 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2074 | + if(!this) return DDERR_INVALIDOBJECT;
|
2065 | 2075 | return glDDS7->SetClipper(lpDDClipper);
|
2066 | 2076 | }
|
2067 | 2077 | HRESULT WINAPI glDirectDrawSurface4::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
2068 | 2078 | {
|
2069 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2079 | + if(!this) return DDERR_INVALIDOBJECT;
|
2070 | 2080 | return glDDS7->SetColorKey(dwFlags,lpDDColorKey);
|
2071 | 2081 | }
|
2072 | 2082 | HRESULT WINAPI glDirectDrawSurface4::SetOverlayPosition(LONG lX, LONG lY)
|
2073 | 2083 | {
|
2074 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2084 | + if(!this) return DDERR_INVALIDOBJECT;
|
2075 | 2085 | return glDDS7->SetOverlayPosition(lX,lY);
|
2076 | 2086 | }
|
2077 | 2087 | HRESULT WINAPI glDirectDrawSurface4::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
|
2078 | 2088 | {
|
2079 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2089 | + if(!this) return DDERR_INVALIDOBJECT;
|
2080 | 2090 | return glDDS7->SetPalette(lpDDPalette);
|
2081 | 2091 | }
|
2082 | 2092 | HRESULT WINAPI glDirectDrawSurface4::Unlock(LPRECT lpRect)
|
2083 | 2093 | {
|
2084 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2094 | + if(!this) return DDERR_INVALIDOBJECT;
|
2085 | 2095 | return glDDS7->Unlock2(lpRect);
|
2086 | 2096 | }
|
2087 | 2097 | HRESULT WINAPI glDirectDrawSurface4::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE4 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
|
2088 | 2098 | {
|
2089 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2099 | + if(!this) return DDERR_INVALIDOBJECT;
|
2090 | 2100 | return glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx);
|
2091 | 2101 | }
|
2092 | 2102 | HRESULT WINAPI glDirectDrawSurface4::UpdateOverlayDisplay(DWORD dwFlags)
|
2093 | 2103 | {
|
2094 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2104 | + if(!this) return DDERR_INVALIDOBJECT;
|
2095 | 2105 | return glDDS7->UpdateOverlayDisplay(dwFlags);
|
2096 | 2106 | }
|
2097 | 2107 | HRESULT WINAPI glDirectDrawSurface4::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE4 lpDDSReference)
|
2098 | 2108 | {
|
2099 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2109 | + if(!this) return DDERR_INVALIDOBJECT;
|
2100 | 2110 | return glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference);
|
2101 | 2111 | }
|
2102 | 2112 | HRESULT WINAPI glDirectDrawSurface4::GetDDInterface(LPVOID FAR *lplpDD)
|
2103 | 2113 | {
|
2104 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2114 | + if(!this) return DDERR_INVALIDOBJECT;
|
2105 | 2115 | return glDDS7->GetDDInterface(lplpDD);
|
2106 | 2116 | }
|
2107 | 2117 | HRESULT WINAPI glDirectDrawSurface4::PageLock(DWORD dwFlags)
|
2108 | 2118 | {
|
2109 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2119 | + if(!this) return DDERR_INVALIDOBJECT;
|
2110 | 2120 | return glDDS7->PageLock(dwFlags);
|
2111 | 2121 | }
|
2112 | 2122 | HRESULT WINAPI glDirectDrawSurface4::PageUnlock(DWORD dwFlags)
|
2113 | 2123 | {
|
2114 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2124 | + if(!this) return DDERR_INVALIDOBJECT;
|
2115 | 2125 | return glDDS7->PageUnlock(dwFlags);
|
2116 | 2126 | }
|
2117 | 2127 | HRESULT WINAPI glDirectDrawSurface4::SetSurfaceDesc(LPDDSURFACEDESC2 lpddsd, DWORD dwFlags)
|
2118 | 2128 | {
|
2119 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2129 | + if(!this) return DDERR_INVALIDOBJECT;
|
2120 | 2130 | return glDDS7->SetSurfaceDesc(lpddsd,dwFlags);
|
2121 | 2131 | }
|
2122 | 2132 | HRESULT WINAPI glDirectDrawSurface4::SetPrivateData(REFGUID guidTag, LPVOID lpData, DWORD cbSize, DWORD dwFlags)
|
2123 | 2133 | {
|
2124 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2134 | + if(!this) return DDERR_INVALIDOBJECT;
|
2125 | 2135 | return glDDS7->SetPrivateData(guidTag,lpData,cbSize,dwFlags);
|
2126 | 2136 | }
|
2127 | 2137 | HRESULT WINAPI glDirectDrawSurface4::GetPrivateData(REFGUID guidTag, LPVOID lpBuffer, LPDWORD lpcbBufferSize)
|
2128 | 2138 | {
|
2129 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2139 | + if(!this) return DDERR_INVALIDOBJECT;
|
2130 | 2140 | return glDDS7->GetPrivateData(guidTag,lpBuffer,lpcbBufferSize);
|
2131 | 2141 | }
|
2132 | 2142 | HRESULT WINAPI glDirectDrawSurface4::FreePrivateData(REFGUID guidTag)
|
2133 | 2143 | {
|
2134 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2144 | + if(!this) return DDERR_INVALIDOBJECT;
|
2135 | 2145 | return glDDS7->FreePrivateData(guidTag);
|
2136 | 2146 | }
|
2137 | 2147 | HRESULT WINAPI glDirectDrawSurface4::GetUniquenessValue(LPDWORD lpValue)
|
2138 | 2148 | {
|
2139 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2149 | + if(!this) return DDERR_INVALIDOBJECT;
|
2140 | 2150 | return glDDS7->GetUniquenessValue(lpValue);
|
2141 | 2151 | }
|
2142 | 2152 | HRESULT WINAPI glDirectDrawSurface4::ChangeUniquenessValue()
|
2143 | 2153 | {
|
2144 | | - if(!this) return DDERR_INVALIDPARAMS;
|
| 2154 | + if(!this) return DDERR_INVALIDOBJECT;
|
2145 | 2155 | return glDDS7->ChangeUniquenessValue();
|
2146 | 2156 | }
|