| Index: ReadMe.md |
| — | — | @@ -1,4 +1,4 @@ |
| 2 | | -# DXGL 0.5.7
|
| | 2 | +# DXGL 0.5.8
|
| 3 | 3 | https://www.williamfeely.info/wiki/DXGL
|
| 4 | 4 |
|
| 5 | 5 | ## Introduction
|
| Index: ddraw/glDirect3DViewport.cpp |
| — | — | @@ -1,5 +1,5 @@ |
| 2 | 2 | // DXGL
|
| 3 | | -// Copyright (C) 2011-2014 William Feely
|
| | 3 | +// Copyright (C) 2011-2016 William Feely
|
| 4 | 4 |
|
| 5 | 5 | // This library is free software; you can redistribute it and/or
|
| 6 | 6 | // modify it under the terms of the GNU Lesser General Public
|
| — | — | @@ -101,6 +101,7 @@ |
| 102 | 102 | TRACE_EXIT(23,D3D_OK);
|
| 103 | 103 | return D3D_OK;
|
| 104 | 104 | }
|
| | 105 | + *ppvObj = NULL;
|
| 105 | 106 | TRACE_EXIT(23,E_NOINTERFACE);
|
| 106 | 107 | return E_NOINTERFACE;
|
| 107 | 108 | }
|
| Index: ddraw/glDirectDraw.cpp |
| — | — | @@ -581,7 +581,6 @@ |
| 582 | 582 | glD3D3 = new glDirect3D3(glD3D7);
|
| 583 | 583 | glD3D2 = new glDirect3D2(glD3D7);
|
| 584 | 584 | glD3D1 = new glDirect3D1(glD3D7);
|
| 585 | | - clippers = NULL;
|
| 586 | 585 | surfaces = NULL;
|
| 587 | 586 | initialized = false;
|
| 588 | 587 | devid.liDriverVersion.QuadPart = DXGLVERQWORD;
|
| — | — | @@ -645,15 +644,6 @@ |
| 646 | 645 | {
|
| 647 | 646 | if (fullscreen) UninstallDXGLFullscreenHook(hWnd);
|
| 648 | 647 | RestoreDisplayMode();
|
| 649 | | - if(clippers)
|
| 650 | | - {
|
| 651 | | - for(int i = 0; i < clippercount; i++)
|
| 652 | | - {
|
| 653 | | - if(clippers[i]) glDirectDrawClipper_Release(clippers[i]);
|
| 654 | | - clippers[i] = NULL;
|
| 655 | | - }
|
| 656 | | - free(clippers);
|
| 657 | | - }
|
| 658 | 648 | if(surfaces)
|
| 659 | 649 | {
|
| 660 | 650 | for(int i = 0; i < surfacecount; i++)
|
| — | — | @@ -753,6 +743,7 @@ |
| 754 | 744 | {
|
| 755 | 745 | ERR(DDERR_GENERIC);
|
| 756 | 746 | }*/
|
| | 747 | + *ppvObj = NULL;
|
| 757 | 748 | TRACE_EXIT(23,E_NOINTERFACE);
|
| 758 | 749 | return E_NOINTERFACE;
|
| 759 | 750 | }
|
| — | — | @@ -857,11 +848,6 @@ |
| 858 | 849 | TRACE_ENTER(4, 14, this, 9, dwFlags, 14, lplpDDClipper, 14, pUnkOuter);
|
| 859 | 850 | if (!this) TRACE_RET(HRESULT, 23, DDERR_INVALIDOBJECT);
|
| 860 | 851 | HRESULT ret = CreateClipper2(dwFlags, lplpDDClipper, pUnkOuter);
|
| 861 | | - if (ret == DD_OK)
|
| 862 | | - {
|
| 863 | | - this->AddRef();
|
| 864 | | - ((glDirectDrawClipper*)*lplpDDClipper)->creator = this;
|
| 865 | | - }
|
| 866 | 852 | TRACE_EXIT(23, ret);
|
| 867 | 853 | return ret;
|
| 868 | 854 | }
|
| — | — | @@ -871,16 +857,6 @@ |
| 872 | 858 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 873 | 859 | if(!lplpDDClipper) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
| 874 | 860 | if(pUnkOuter) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
| 875 | | - clippercount++;
|
| 876 | | - if(clippercount > clippercountmax)
|
| 877 | | - {
|
| 878 | | - glDirectDrawClipper **clippers2;
|
| 879 | | - clippers2 = (glDirectDrawClipper **)realloc(clippers,(clippercountmax+1024)*sizeof(glDirectDrawClipper *));
|
| 880 | | - if(!clippers2) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
|
| 881 | | - clippers = clippers2;
|
| 882 | | - ZeroMemory(&clippers[clippercountmax],1024*sizeof(glDirectDrawClipper *));
|
| 883 | | - clippercountmax += 1024;
|
| 884 | | - }
|
| 885 | 861 | TRACE_RET(HRESULT,23,glDirectDrawClipper_Create(dwFlags, this, lplpDDClipper));
|
| 886 | 862 | }
|
| 887 | 863 | HRESULT WINAPI glDirectDraw7::CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR *lplpDDPalette, IUnknown FAR *pUnkOuter)
|
| — | — | @@ -1383,11 +1359,6 @@ |
| 1384 | 1360 | surfacecount = 0;
|
| 1385 | 1361 | surfacecountmax = 1024;
|
| 1386 | 1362 | tmpsurface = NULL;
|
| 1387 | | - clippers = (glDirectDrawClipper **)malloc(1024*sizeof(glDirectDrawClipper *));
|
| 1388 | | - if(!clippers) TRACE_RET(HRESULT,23,DDERR_OUTOFMEMORY);
|
| 1389 | | - ZeroMemory(clippers,1024*sizeof(glDirectDrawClipper *));
|
| 1390 | | - clippercount = 0;
|
| 1391 | | - clippercountmax = 1024;
|
| 1392 | 1363 | bool useguid = false;
|
| 1393 | 1364 | switch((INT_PTR)lpGUID)
|
| 1394 | 1365 | {
|
| — | — | @@ -2054,14 +2025,6 @@ |
| 2055 | 2026 | TRACE_EXIT(0,0);
|
| 2056 | 2027 | }
|
| 2057 | 2028 |
|
| 2058 | | -void glDirectDraw7::DeleteClipper(glDirectDrawClipper *clipper)
|
| 2059 | | -{
|
| 2060 | | - TRACE_ENTER(2,14,this,clipper);
|
| 2061 | | - for(int i = 0; i < clippercount; i++)
|
| 2062 | | - if(clippers[i] == clipper) clippers[i] = NULL;
|
| 2063 | | - TRACE_EXIT(0,0);
|
| 2064 | | -}
|
| 2065 | | -
|
| 2066 | 2029 | HRESULT glDirectDraw7::SetupTempSurface(DWORD width, DWORD height)
|
| 2067 | 2030 | {
|
| 2068 | 2031 | DDSURFACEDESC2 ddsd;
|
| — | — | @@ -2162,11 +2125,6 @@ |
| 2163 | 2126 | TRACE_ENTER(4,14,this,9,dwFlags,14,lplpDDClipper,14,pUnkOuter);
|
| 2164 | 2127 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 2165 | 2128 | HRESULT ret = glDD7->CreateClipper2(dwFlags, lplpDDClipper, pUnkOuter);
|
| 2166 | | - if (ret == DD_OK)
|
| 2167 | | - {
|
| 2168 | | - this->AddRef();
|
| 2169 | | - ((glDirectDrawClipper*)*lplpDDClipper)->creator = this;
|
| 2170 | | - }
|
| 2171 | 2129 | TRACE_EXIT(23, ret);
|
| 2172 | 2130 | return ret;
|
| 2173 | 2131 | }
|
| — | — | @@ -2367,11 +2325,6 @@ |
| 2368 | 2326 | TRACE_ENTER(4,14,this,9,dwFlags,14,lplpDDClipper,14,pUnkOuter);
|
| 2369 | 2327 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 2370 | 2328 | HRESULT ret = glDD7->CreateClipper2(dwFlags, lplpDDClipper, pUnkOuter);
|
| 2371 | | - if (ret == DD_OK)
|
| 2372 | | - {
|
| 2373 | | - this->AddRef();
|
| 2374 | | - ((glDirectDrawClipper*)*lplpDDClipper)->creator = this;
|
| 2375 | | - }
|
| 2376 | 2329 | TRACE_EXIT(23, ret);
|
| 2377 | 2330 | return ret;
|
| 2378 | 2331 | }
|
| — | — | @@ -2596,11 +2549,6 @@ |
| 2597 | 2550 | TRACE_ENTER(4,14,this,9,dwFlags,14,lplpDDClipper,14,pUnkOuter);
|
| 2598 | 2551 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
| 2599 | 2552 | HRESULT ret = glDD7->CreateClipper2(dwFlags, lplpDDClipper, pUnkOuter);
|
| 2600 | | - if (ret == DD_OK)
|
| 2601 | | - {
|
| 2602 | | - this->AddRef();
|
| 2603 | | - ((glDirectDrawClipper*)*lplpDDClipper)->creator = this;
|
| 2604 | | - }
|
| 2605 | 2553 | TRACE_EXIT(23, ret);
|
| 2606 | 2554 | return ret;
|
| 2607 | 2555 | }
|
| Index: ddraw/glDirectDraw.h |
| — | — | @@ -1,5 +1,5 @@ |
| 2 | 2 | // DXGL
|
| 3 | | -// Copyright (C) 2011-2015 William Feely
|
| | 3 | +// Copyright (C) 2011-2016 William Feely
|
| 4 | 4 |
|
| 5 | 5 | // This library is free software; you can redistribute it and/or
|
| 6 | 6 | // modify it under the terms of the GNU Lesser General Public
|
| — | — | @@ -100,7 +100,6 @@ |
| 101 | 101 | DWORD primaryx,primaryy,primaryrefresh,primarybpp;
|
| 102 | 102 | bool GetFullscreen(){return fullscreen;};
|
| 103 | 103 | void DeleteSurface(glDirectDrawSurface7 *surface);
|
| 104 | | - void DeleteClipper(glDirectDrawClipper *clipper);
|
| 105 | 104 | HRESULT SetupTempSurface(DWORD width, DWORD height);
|
| 106 | 105 | void DeleteTempSurface();
|
| 107 | 106 | glDirectDrawSurface7 *primary;
|
| — | — | @@ -128,8 +127,6 @@ |
| 129 | 128 | LONG_PTR winstyle,winstyleex;
|
| 130 | 129 | glDirectDrawSurface7 **surfaces;
|
| 131 | 130 | int surfacecount, surfacecountmax;
|
| 132 | | - glDirectDrawClipper **clippers;
|
| 133 | | - int clippercount, clippercountmax;
|
| 134 | 131 | DEVMODE oldmode;
|
| 135 | 132 | bool initialized;
|
| 136 | 133 | glDirect3D7 *glD3D7;
|
| Index: ddraw/glDirectDrawClipper.cpp |
| — | — | @@ -1,5 +1,5 @@ |
| 2 | 2 | // DXGL
|
| 3 | | -// Copyright (C) 2011-2014 William Feely
|
| | 3 | +// Copyright (C) 2011-2016 William Feely
|
| 4 | 4 |
|
| 5 | 5 | // This library is free software; you can redistribute it and/or
|
| 6 | 6 | // modify it under the terms of the GNU Lesser General Public
|
| — | — | @@ -45,7 +45,6 @@ |
| 46 | 46 | newclipper->refcount = 1;
|
| 47 | 47 | newclipper->initialized = false;
|
| 48 | 48 | newclipper->lpVtbl = &glDirectDrawClipper_iface;
|
| 49 | | - newclipper->creator = NULL;
|
| 50 | 49 | if (lplpDDClipper) *lplpDDClipper = (LPDIRECTDRAWCLIPPER)newclipper;
|
| 51 | 50 | TRACE_EXIT(23, DD_OK);
|
| 52 | 51 | return DD_OK;
|
| — | — | @@ -62,7 +61,6 @@ |
| 63 | 62 | newclipper->refcount = 1;
|
| 64 | 63 | newclipper->initialized = false;
|
| 65 | 64 | newclipper->lpVtbl = &glDirectDrawClipper_iface;
|
| 66 | | - newclipper->creator = NULL;
|
| 67 | 65 | glDirectDrawClipper_Initialize(newclipper, (LPDIRECTDRAW)parent, dwFlags);
|
| 68 | 66 | if (lplpDDClipper) *lplpDDClipper = (LPDIRECTDRAWCLIPPER)newclipper;
|
| 69 | 67 | TRACE_EXIT(23, DD_OK);
|
| — | — | @@ -113,8 +111,6 @@ |
| 114 | 112 | if (This->cliplist) free(This->cliplist);
|
| 115 | 113 | if (This->vertices) free(This->vertices);
|
| 116 | 114 | if (This->indices) free(This->indices);
|
| 117 | | - if (This->glDD7) This->glDD7->DeleteClipper(This);
|
| 118 | | - if (This->creator) This->creator->Release();
|
| 119 | 115 | free(This);
|
| 120 | 116 | };
|
| 121 | 117 | TRACE_EXIT(8,ret);
|
| Index: ddraw/glDirectDrawClipper.h |
| — | — | @@ -1,5 +1,5 @@ |
| 2 | 2 | // DXGL
|
| 3 | | -// Copyright (C) 2011 William Feely
|
| | 3 | +// Copyright (C) 2011-2016 William Feely
|
| 4 | 4 |
|
| 5 | 5 | // This library is free software; you can redistribute it and/or
|
| 6 | 6 | // modify it under the terms of the GNU Lesser General Public
|
| — | — | @@ -38,7 +38,6 @@ |
| 39 | 39 | int maxsize;
|
| 40 | 40 | bool hascliplist;
|
| 41 | 41 | bool dirty;
|
| 42 | | - IUnknown *creator;
|
| 43 | 42 | } glDirectDrawClipper;
|
| 44 | 43 |
|
| 45 | 44 | typedef struct glDirectDrawClipperVtbl
|