Index: ddraw/glDirect3D.cpp |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | #include "glDirect3DMaterial.h"
|
31 | 31 | #include "glDirect3DLight.h"
|
32 | 32 |
|
33 | | -const D3DDEVICEDESC7 d3ddesc =
|
| 33 | +const D3DDEVICEDESC7 d3ddesc_default =
|
34 | 34 | {
|
35 | 35 | D3DDEVCAPS_CANBLTSYSTONONLOCAL | D3DDEVCAPS_CANRENDERAFTERFLIP | D3DDEVCAPS_DRAWPRIMTLVERTEX |
|
36 | 36 | D3DDEVCAPS_FLOATTLVERTEX | D3DDEVCAPS_TEXTURENONLOCALVIDMEM | D3DDEVCAPS_TEXTURESYSTEMMEMORY |
|
— | — | @@ -127,7 +127,7 @@ |
128 | 128 | 0,0,0,0 //dwReserved1 through dwReserved4
|
129 | 129 | };
|
130 | 130 |
|
131 | | -const D3DDEVICEDESC d3ddesc3 =
|
| 131 | +const D3DDEVICEDESC d3ddesc3_default =
|
132 | 132 | {
|
133 | 133 | sizeof(D3DDEVICEDESC), // dwSize
|
134 | 134 | D3DDD_BCLIPPING|D3DDD_COLORMODEL|D3DDD_DEVCAPS|D3DDD_DEVICERENDERBITDEPTH|
|
— | — | @@ -134,7 +134,7 @@ |
135 | 135 | D3DDD_DEVICEZBUFFERBITDEPTH|D3DDD_LIGHTINGCAPS|D3DDD_LINECAPS|D3DDD_MAXBUFFERSIZE|
|
136 | 136 | D3DDD_MAXVERTEXCOUNT|D3DDD_TRANSFORMCAPS|D3DDD_TRICAPS, // dwFlags
|
137 | 137 | D3DCOLOR_RGB, // dcmColorModel
|
138 | | - d3ddesc.dwDevCaps,
|
| 138 | + d3ddesc_default.dwDevCaps,
|
139 | 139 | { //dtcTransformCaps
|
140 | 140 | sizeof(D3DTRANSFORMCAPS), //dwSize
|
141 | 141 | 0 // dwCaps
|
— | — | @@ -146,33 +146,33 @@ |
147 | 147 | D3DLIGHTINGMODEL_RGB, // dwLightingModel
|
148 | 148 | 8 //dwNumLights
|
149 | 149 | },
|
150 | | - d3ddesc.dpcLineCaps,
|
151 | | - d3ddesc.dpcTriCaps,
|
152 | | - d3ddesc.dwDeviceRenderBitDepth,
|
153 | | - d3ddesc.dwDeviceZBufferBitDepth,
|
| 150 | + d3ddesc_default.dpcLineCaps,
|
| 151 | + d3ddesc_default.dpcTriCaps,
|
| 152 | + d3ddesc_default.dwDeviceRenderBitDepth,
|
| 153 | + d3ddesc_default.dwDeviceZBufferBitDepth,
|
154 | 154 | 0, // dwMaxBufferSize
|
155 | 155 | 65536, // dwMaxVertexCount
|
156 | | - d3ddesc.dwMinTextureWidth,
|
157 | | - d3ddesc.dwMinTextureHeight,
|
158 | | - d3ddesc.dwMaxTextureWidth,
|
159 | | - d3ddesc.dwMaxTextureHeight,
|
| 156 | + d3ddesc_default.dwMinTextureWidth,
|
| 157 | + d3ddesc_default.dwMinTextureHeight,
|
| 158 | + d3ddesc_default.dwMaxTextureWidth,
|
| 159 | + d3ddesc_default.dwMaxTextureHeight,
|
160 | 160 | 0, // dwMinStippleWidth
|
161 | 161 | 32, // dwMaxStippleWidth
|
162 | 162 | 0, // dwMinStippleHeight
|
163 | 163 | 32, // dwMaxStippleHeight
|
164 | | - d3ddesc.dwMaxTextureRepeat,
|
165 | | - d3ddesc.dwMaxTextureAspectRatio,
|
166 | | - d3ddesc.dwMaxAnisotropy,
|
167 | | - d3ddesc.dvGuardBandLeft,
|
168 | | - d3ddesc.dvGuardBandTop,
|
169 | | - d3ddesc.dvGuardBandRight,
|
170 | | - d3ddesc.dvGuardBandBottom,
|
171 | | - d3ddesc.dvExtentsAdjust,
|
172 | | - d3ddesc.dwStencilCaps,
|
173 | | - d3ddesc.dwFVFCaps,
|
174 | | - d3ddesc.dwTextureOpCaps,
|
175 | | - d3ddesc.wMaxTextureBlendStages,
|
176 | | - d3ddesc.wMaxSimultaneousTextures
|
| 164 | + d3ddesc_default.dwMaxTextureRepeat,
|
| 165 | + d3ddesc_default.dwMaxTextureAspectRatio,
|
| 166 | + d3ddesc_default.dwMaxAnisotropy,
|
| 167 | + d3ddesc_default.dvGuardBandLeft,
|
| 168 | + d3ddesc_default.dvGuardBandTop,
|
| 169 | + d3ddesc_default.dvGuardBandRight,
|
| 170 | + d3ddesc_default.dvGuardBandBottom,
|
| 171 | + d3ddesc_default.dvExtentsAdjust,
|
| 172 | + d3ddesc_default.dwStencilCaps,
|
| 173 | + d3ddesc_default.dwFVFCaps,
|
| 174 | + d3ddesc_default.dwTextureOpCaps,
|
| 175 | + d3ddesc_default.wMaxTextureBlendStages,
|
| 176 | + d3ddesc_default.wMaxSimultaneousTextures
|
177 | 177 | };
|
178 | 178 |
|
179 | 179 | struct D3DDevice
|
— | — | @@ -198,6 +198,8 @@ |
199 | 199 | glDirect3D7::glDirect3D7()
|
200 | 200 | {
|
201 | 201 | TRACE_ENTER(1,14,this);
|
| 202 | + d3ddesc = d3ddesc_default;
|
| 203 | + d3ddesc3 = d3ddesc3_default;
|
202 | 204 | refcount=1;
|
203 | 205 | glD3D3 = NULL;
|
204 | 206 | glD3D2 = NULL;
|
Index: ddraw/glDirect3D.h |
— | — | @@ -19,8 +19,8 @@ |
20 | 20 | #ifndef __GLDIRECT3D_H
|
21 | 21 | #define __GLDIRECT3D_H
|
22 | 22 |
|
23 | | -extern const D3DDEVICEDESC7 d3ddesc;
|
24 | | -extern const D3DDEVICEDESC d3ddesc3;
|
| 23 | +extern const D3DDEVICEDESC7 d3ddesc_default;
|
| 24 | +extern const D3DDEVICEDESC d3ddesc3_default;
|
25 | 25 | class glDirectDraw7;
|
26 | 26 |
|
27 | 27 | class glDirect3D3;
|
— | — | @@ -49,6 +49,8 @@ |
50 | 50 | glDirect3D1 *glD3D1;
|
51 | 51 | private:
|
52 | 52 | ULONG refcount;
|
| 53 | + D3DDEVICEDESC7 d3ddesc;
|
| 54 | + D3DDEVICEDESC d3ddesc3;
|
53 | 55 | };
|
54 | 56 |
|
55 | 57 | class glDirect3D3 : public IDirect3D3
|
Index: ddraw/glDirect3DDevice.cpp |
— | — | @@ -74,8 +74,6 @@ |
75 | 75 | DWORD dwMinStippleHeight,dwMaxStippleHeight;
|
76 | 76 | } D3DDEVICEDESC2,*LPD3DDEVICEDESC2;
|
77 | 77 |
|
78 | | -extern const D3DDEVICEDESC7 d3ddesc;
|
79 | | -
|
80 | 78 | const DWORD renderstate_default[153] = {0, // 0
|
81 | 79 | NULL, //texturehandle
|
82 | 80 | D3DANTIALIAS_NONE, //antialias
|
— | — | @@ -276,8 +274,8 @@ |
277 | 275 | glDirect3DDevice7::glDirect3DDevice7(REFCLSID rclsid, glDirect3D7 *glD3D7, glDirectDrawSurface7 *glDDS7)
|
278 | 276 | {
|
279 | 277 | TRACE_ENTER(4,14,this,24,&rclsid,14,glD3D7,14,glDDS7);
|
280 | | - memcpy(&d3ddesc, &::d3ddesc, sizeof(D3DDEVICEDESC));
|
281 | | - memcpy(&d3ddesc3, &::d3ddesc3, sizeof(D3DDEVICEDESC));
|
| 278 | + d3ddesc = d3ddesc_default;
|
| 279 | + d3ddesc3 = d3ddesc3_default;
|
282 | 280 | int zbuffer = 0;
|
283 | 281 | glD3DDev3 = NULL;
|
284 | 282 | glD3DDev2 = NULL;
|
Index: ddraw/glDirectDraw.cpp |
— | — | @@ -33,7 +33,7 @@ |
34 | 34 | #include "glRenderer.h"
|
35 | 35 | #include "../common/version.h"
|
36 | 36 |
|
37 | | -DDDEVICEIDENTIFIER2 devid = {
|
| 37 | +const DDDEVICEIDENTIFIER2 devid_default = {
|
38 | 38 | "ddraw.dll",
|
39 | 39 | "DXGL DDraw Wrapper",
|
40 | 40 | 0,
|
— | — | @@ -1132,6 +1132,7 @@ |
1133 | 1133 | TRACE_ENTER(2,14,this,24,lpGUID);
|
1134 | 1134 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
1135 | 1135 | if(initialized) TRACE_RET(HRESULT,23,DDERR_ALREADYINITIALIZED);
|
| 1136 | + devid = devid_default;
|
1136 | 1137 | primarylost = true;
|
1137 | 1138 | glD3D7 = NULL;
|
1138 | 1139 | glDD1 = NULL;
|
— | — | @@ -2309,8 +2310,8 @@ |
2310 | 2311 | TRACE_ENTER(3,14,this,14,lpdddi,9,dwFlags);
|
2311 | 2312 | if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
|
2312 | 2313 | if(!lpdddi) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
|
2313 | | - devid.guidDeviceIdentifier = device_template;
|
2314 | | - memcpy(lpdddi,&devid,sizeof(DDDEVICEIDENTIFIER));
|
| 2314 | + glDD7->devid.guidDeviceIdentifier = device_template;
|
| 2315 | + memcpy(lpdddi,&glDD7->devid,sizeof(DDDEVICEIDENTIFIER));
|
2315 | 2316 | TRACE_EXIT(23,DD_OK);
|
2316 | 2317 | return DD_OK;
|
2317 | 2318 | } |
\ No newline at end of file |
Index: ddraw/glDirectDraw.h |
— | — | @@ -89,6 +89,7 @@ |
90 | 90 | glDirectDraw1 *glDD1;
|
91 | 91 | glDirectDraw2 *glDD2;
|
92 | 92 | glDirectDraw4 *glDD4;
|
| 93 | + DDDEVICEIDENTIFIER2 devid;
|
93 | 94 | private:
|
94 | 95 | HRESULT error;
|
95 | 96 | ULONG refcount;
|