DXGL r147 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r146‎ | r147 | r148 >
Date:01:13, 8 May 2012
Author:admin
Status:new
Tags:
Comment:
Add addsigned2x and subtract color ops
Fix texture ops caps bits
Modified paths:
  • /ddraw/glDirect3D.cpp (modified) (history)
  • /ddraw/glDirect3DDevice.cpp (modified) (history)
  • /ddraw/shadergen.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirect3D.cpp
@@ -81,8 +81,9 @@
8282 0.0f, //dvExtentsAdjust
8383 0, //dwStencilCaps
8484 8, //dwFVFCaps
85 - D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_SELECTARG2 | D3DTOP_MODULATE |
86 - D3DTOP_MODULATE2X | D3DTOP_MODULATE4X | D3DTOP_ADD, //dwTextureOpCaps
 85+ D3DTEXOPCAPS_SELECTARG1 | D3DTEXOPCAPS_SELECTARG2 | D3DTEXOPCAPS_MODULATE |
 86+ D3DTEXOPCAPS_MODULATE2X | D3DTEXOPCAPS_MODULATE4X | D3DTEXOPCAPS_ADD |
 87+ D3DTEXOPCAPS_ADDSIGNED | D3DTEXOPCAPS_ADDSIGNED2X | D3DTEXOPCAPS_SUBTRACT, //dwTextureOpCaps
8788 8, //wMaxTextureBlendStages
8889 8, //wMaxSimultaneousTextures
8990 8, //dwMaxActiveLights
Index: ddraw/glDirect3DDevice.cpp
@@ -1176,6 +1176,8 @@
11771177 case D3DTOP_MODULATE4X:
11781178 case D3DTOP_ADD:
11791179 case D3DTOP_ADDSIGNED:
 1180+ case D3DTOP_ADDSIGNED2X:
 1181+ case D3DTOP_SUBTRACT:
11801182 break;
11811183 default:
11821184 return D3DERR_UNSUPPORTEDCOLOROPERATION;
Index: ddraw/shadergen.cpp
@@ -632,6 +632,12 @@
633633 case D3DTOP_ADDSIGNED:
634634 fsrc->append("color = " + arg1 + " + " + arg2 + " - .5;\n");
635635 break;
 636+ case D3DTOP_ADDSIGNED2X:
 637+ fsrc->append("color = (" + arg1 + " + " + arg2 + " - .5) * 2.0;\n");
 638+ break;
 639+ case D3DTOP_SUBTRACT:
 640+ fsrc->append("color = " + arg1 + " - " + arg2 + ";\n");
 641+ break;
636642 }
637643 }
638644 fsrc->append(op_colorfragout);