Index: ddraw/ShaderGen3D.cpp |
— | — | @@ -345,8 +345,8 @@ |
346 | 346 | gl_Position = vec4(pos.x,-pos.y,pos.z,pos.w);\n";
|
347 | 347 | static const char op_normalize[] = "N = normalize(gl_NormalMatrix*nxyz);\n";
|
348 | 348 | static const char op_normalpassthru[] = "N = gl_NormalMatrix*nxyz;\n";
|
349 | | -static const char op_tlvertex[] = "gl_Position = vec4(((((xyz.x-xoffset)+.5)/(width/2.0))-1.0)/rhw,\
|
350 | | -((((xyz.y-yoffset)+.5)/(height/2.0))-1.0)/rhw,xyz.z/rhw,1.0/rhw);\n";
|
| 349 | +static const char op_tlvertex[] = "gl_Position = vec4(((xyz.x-xoffset)/(width/2.0)-1.0)/rhw,\
|
| 350 | +((xyz.y-yoffset)/(height/2.0)-1.0)/rhw,xyz.z/rhw,1.0/rhw);\n";
|
351 | 351 | static const char op_resetcolor[] = "diffuse = specular = vec4(0.0);\n\
|
352 | 352 | ambient = ambientcolor / 255.0;\n";
|
353 | 353 | static const char op_dirlight[] = "DirLight(lightX);\n";
|
Index: ddraw/ddraw.vcxproj |
— | — | @@ -143,7 +143,7 @@ |
144 | 144 | <SubSystem>Windows</SubSystem>
|
145 | 145 | <GenerateDebugInformation>true</GenerateDebugInformation>
|
146 | 146 | <ModuleDefinitionFile>ddraw.def</ModuleDefinitionFile>
|
147 | | - <AdditionalDependencies>$(OutDir)libMinHook.x86.lib;$(OutDir)..\Debug\cfgmgr.lib;glu32.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
| 147 | + <AdditionalDependencies>$(OutDir)..\Debug\libMinHook.x86.lib;$(OutDir)..\Debug\cfgmgr.lib;glu32.lib;opengl32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
148 | 148 | </Link>
|
149 | 149 | <PreBuildEvent>
|
150 | 150 | <Command>"$(OutDir)..\Debug\buildtool.exe" makeheader $(SolutionDir)common</Command>
|
Index: ddraw/glDirect3D.cpp |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | D3DPMISCCAPS_CULLCCW | D3DPMISCCAPS_CULLCW | D3DPMISCCAPS_CULLNONE, // dwMiscCaps
|
73 | 73 | D3DPRASTERCAPS_SUBPIXEL | D3DPRASTERCAPS_ZTEST | D3DPRASTERCAPS_FOGRANGE | D3DPRASTERCAPS_FOGTABLE |
|
74 | 74 | D3DPRASTERCAPS_FOGVERTEX | D3DPRASTERCAPS_WFOG, //dwRasterCaps
|
75 | | - D3DPCMPCAPS_LESSEQUAL, //dwZCmpCaps
|
| 75 | + D3DPCMPCAPS_ALWAYS | D3DPCMPCAPS_LESSEQUAL, //dwZCmpCaps
|
76 | 76 | D3DPBLENDCAPS_ZERO | D3DPBLENDCAPS_ONE | D3DPBLENDCAPS_SRCCOLOR | D3DPBLENDCAPS_INVSRCCOLOR |
|
77 | 77 | D3DPBLENDCAPS_SRCALPHA | D3DPBLENDCAPS_INVSRCALPHA | D3DPBLENDCAPS_DESTALPHA |
|
78 | 78 | D3DPBLENDCAPS_INVDESTALPHA | D3DPBLENDCAPS_DESTCOLOR | D3DPBLENDCAPS_INVDESTCOLOR |
|
Index: ddraw/glDirect3DDevice.cpp |
— | — | @@ -275,6 +275,7 @@ |
276 | 276 | {
|
277 | 277 | TRACE_ENTER(4,14,this,24,&rclsid,14,glD3D7,14,glDDS7);
|
278 | 278 | this->version = version;
|
| 279 | + dx2init = dx5init = FALSE;
|
279 | 280 | d3ddesc = d3ddesc_default;
|
280 | 281 | d3ddesc3 = d3ddesc3_default;
|
281 | 282 | int zbuffer = 0;
|
— | — | @@ -467,6 +468,11 @@ |
468 | 469 | {
|
469 | 470 | *ppvObj = glD3DDev2;
|
470 | 471 | glD3DDev2->AddRef();
|
| 472 | + if (!dx5init)
|
| 473 | + {
|
| 474 | + InitDX5();
|
| 475 | + dx5init = TRUE;
|
| 476 | + }
|
471 | 477 | TRACE_VAR("*ppvObj", 14, *ppvObj);
|
472 | 478 | TRACE_EXIT(23, D3D_OK);
|
473 | 479 | return D3D_OK;
|
— | — | @@ -475,6 +481,16 @@ |
476 | 482 | {
|
477 | 483 | *ppvObj = glD3DDev1;
|
478 | 484 | glD3DDev1->AddRef();
|
| 485 | + if (!dx5init)
|
| 486 | + {
|
| 487 | + InitDX5();
|
| 488 | + dx5init = TRUE;
|
| 489 | + }
|
| 490 | + if (!dx2init)
|
| 491 | + {
|
| 492 | + InitDX2();
|
| 493 | + dx5init = TRUE;
|
| 494 | + }
|
479 | 495 | TRACE_VAR("*ppvObj", 14, *ppvObj);
|
480 | 496 | TRACE_EXIT(23, D3D_OK);
|
481 | 497 | return D3D_OK;
|
— | — | @@ -2161,6 +2177,13 @@ |
2162 | 2178 | return DDERR_GENERIC;
|
2163 | 2179 | }
|
2164 | 2180 |
|
| 2181 | +void glDirect3DDevice7::InitDX2()
|
| 2182 | +{
|
| 2183 | + TRACE_ENTER(1, 14, this);
|
| 2184 | + SetRenderState(D3DRENDERSTATE_COLORKEYENABLE, TRUE);
|
| 2185 | + TRACE_EXIT(0, 0);
|
| 2186 | +}
|
| 2187 | +
|
2165 | 2188 | void glDirect3DDevice7::InitDX5()
|
2166 | 2189 | {
|
2167 | 2190 | TRACE_ENTER(1,14,this);
|
— | — | @@ -3251,7 +3274,6 @@ |
3252 | 3275 | {
|
3253 | 3276 | TRACE_ENTER(2,14,this,14,glD3DDev7);
|
3254 | 3277 | this->glD3DDev7 = glD3DDev7;
|
3255 | | - glD3DDev7->InitDX5();
|
3256 | 3278 | TRACE_EXIT(-1,0);
|
3257 | 3279 | }
|
3258 | 3280 |
|
— | — | @@ -3586,7 +3608,6 @@ |
3587 | 3609 | {
|
3588 | 3610 | TRACE_ENTER(2,14,this,14,glD3DDev7);
|
3589 | 3611 | this->glD3DDev7 = glD3DDev7;
|
3590 | | - glD3DDev7->InitDX5();
|
3591 | 3612 | TRACE_EXIT(-1,0);
|
3592 | 3613 | }
|
3593 | 3614 |
|
Index: ddraw/glDirect3DDevice.h |
— | — | @@ -167,6 +167,7 @@ |
168 | 168 | INT TransformOnly(D3DTLVERTEX **output, DWORD *outsize, D3DLVERTEX *input, WORD start, WORD dest, DWORD count, D3DRECT *extents);
|
169 | 169 | INT CopyVertices(D3DTLVERTEX **output, DWORD *outsize, D3DTLVERTEX *input, WORD start, WORD dest, DWORD count, D3DRECT *extents);
|
170 | 170 | void UpdateTransform();
|
| 171 | + void InitDX2();
|
171 | 172 | void InitDX5();
|
172 | 173 | __int64 SelectShader(GLVERTEX *VertexType);
|
173 | 174 | void SetScale(D3DVALUE x, D3DVALUE y){scalex = x; scaley = y;}
|
— | — | @@ -236,6 +237,8 @@ |
237 | 238 | glRenderer *renderer;
|
238 | 239 | IUnknown *creator;
|
239 | 240 | int version;
|
| 241 | + BOOL dx5init;
|
| 242 | + BOOL dx2init;
|
240 | 243 | };
|
241 | 244 |
|
242 | 245 | class glDirect3DDevice3 : public IDirect3DDevice3
|
Index: ddraw/glDirectDrawSurface.cpp |
— | — | @@ -533,6 +533,8 @@ |
534 | 534 | }
|
535 | 535 | *ppvObj = device1->glD3DDev1;
|
536 | 536 | device1->glD3DDev1->AddRef();
|
| 537 | + device1->InitDX5();
|
| 538 | + device1->InitDX2();
|
537 | 539 | tmpd3d->Release();
|
538 | 540 | TRACE_VAR("*ppvObj",14,*ppvObj);
|
539 | 541 | TRACE_EXIT(23,DD_OK);
|