| Index: ddraw/glRenderer.cpp |
| — | — | @@ -1,5 +1,5 @@ |
| 2 | 2 | // DXGL
|
| 3 | | -// Copyright (C) 2012 William Feely
|
| | 3 | +// Copyright (C) 2012-2013 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
|
| — | — | @@ -793,6 +793,7 @@ |
| 794 | 794 | SetFogStart(0);
|
| 795 | 795 | SetFogEnd(1);
|
| 796 | 796 | SetFogDensity(1);
|
| | 797 | + SetPolyMode(D3DFILL_SOLID);
|
| 797 | 798 | if(hWnd)
|
| 798 | 799 | {
|
| 799 | 800 | dib.enabled = true;
|
| — | — | @@ -1570,6 +1571,7 @@ |
| 1571 | 1572 | SetFogStart(*(GLfloat*)(&device->renderstate[D3DRENDERSTATE_FOGSTART]));
|
| 1572 | 1573 | SetFogEnd(*(GLfloat*)(&device->renderstate[D3DRENDERSTATE_FOGEND]));
|
| 1573 | 1574 | SetFogDensity(*(GLfloat*)(&device->renderstate[D3DRENDERSTATE_FOGDENSITY]));
|
| | 1575 | + SetPolyMode((D3DFILLMODE)device->renderstate[D3DRENDERSTATE_FILLMODE]);
|
| 1574 | 1576 | if(indices) glDrawElements(mode,indexcount,GL_UNSIGNED_SHORT,indices);
|
| 1575 | 1577 | else glDrawArrays(mode,0,count);
|
| 1576 | 1578 | if(device->glDDS7->zbuffer) device->glDDS7->zbuffer->dirty |= 2;
|
| Index: ddraw/glutil.cpp |
| — | — | @@ -1,5 +1,5 @@ |
| 2 | 2 | // DXGL
|
| 3 | | -// Copyright (C) 2012 William Feely
|
| | 3 | +// Copyright (C) 2012-2013 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
|
| — | — | @@ -57,6 +57,7 @@ |
| 58 | 58 | bool arrays[42];
|
| 59 | 59 | D3DCULL cullmode = D3DCULL_NONE;
|
| 60 | 60 | bool cullenabled = false;
|
| | 61 | +D3DFILLMODE polymode = D3DFILL_SOLID;
|
| 61 | 62 |
|
| 62 | 63 | void InitFBO()
|
| 63 | 64 | {
|
| — | — | @@ -390,4 +391,24 @@ |
| 391 | 392 | break;
|
| 392 | 393 | }
|
| 393 | 394 | }
|
| | 395 | +}
|
| | 396 | +void SetPolyMode(D3DFILLMODE mode)
|
| | 397 | +{
|
| | 398 | + if(polymode != mode)
|
| | 399 | + {
|
| | 400 | + polymode = mode;
|
| | 401 | + switch(mode)
|
| | 402 | + {
|
| | 403 | + case D3DFILL_POINT:
|
| | 404 | + glPolygonMode(GL_FRONT_AND_BACK,GL_POINT);
|
| | 405 | + break;
|
| | 406 | + case D3DFILL_WIREFRAME:
|
| | 407 | + glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
|
| | 408 | + break;
|
| | 409 | + case D3DFILL_SOLID:
|
| | 410 | + default:
|
| | 411 | + glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
|
| | 412 | + break;
|
| | 413 | + }
|
| | 414 | + }
|
| 394 | 415 | } |
| \ No newline at end of file |
| Index: ddraw/glutil.h |
| — | — | @@ -1,5 +1,5 @@ |
| 2 | 2 | // DXGL
|
| 3 | | -// Copyright (C) 2012 William Feely
|
| | 3 | +// Copyright (C) 2012-2013 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,5 +45,6 @@ |
| 46 | 46 | void BlendEnable(bool enabled);
|
| 47 | 47 | void EnableCull(bool enabled);
|
| 48 | 48 | void SetCull(D3DCULL mode);
|
| | 49 | +void SetPolyMode(D3DFILLMODE mode);
|
| 49 | 50 |
|
| 50 | 51 | #endif //_GLUTIL_H |
| \ No newline at end of file |
| Index: ddraw/shadergen.cpp |
| — | — | @@ -268,7 +268,7 @@ |
| 269 | 269 | static const char var_common[] = "vec4 diffuse;\n\
|
| 270 | 270 | vec4 specular;\n\
|
| 271 | 271 | vec4 ambient;\n\
|
| 272 | | -vec3 N;";
|
| | 272 | +vec3 N;\n";
|
| 273 | 273 | static const char var_color[] = "vec4 color;\n";
|
| 274 | 274 | static const char var_xyzw[] = "vec4 xyzw;\n";
|
| 275 | 275 | static const char var_fogfactorvertex[] = "varying float fogfactor;\n";
|
| — | — | @@ -632,6 +632,7 @@ |
| 633 | 633 | vsrc->append(op_fogexp2);
|
| 634 | 634 | break;
|
| 635 | 635 | }
|
| | 636 | + vsrc->append(op_fogclamp);
|
| 636 | 637 | }
|
| 637 | 638 | vsrc->append(mainend);
|
| 638 | 639 | #ifdef _DEBUG
|