[WINED3D 1/7] D3DRENDERSTATETYPE: Consistently use in the WINED3D namespace.

Ivan Gyurdiev ivg231 at gmail.com
Thu Oct 12 01:19:57 CDT 2006


Also annotated d3d7/d3d8 enumerants in the structure.
Stefan D., please see FIXMEs for missing ones.

-------------- next part --------------
---
 dlls/ddraw/device.c              |    5 +++
 dlls/wined3d/device.c            |   12 +++----
 dlls/wined3d/surface.c           |    8 ++---
 include/wine/wined3d_interface.h |    4 +-
 include/wine/wined3d_types.h     |   66 +++++++++++++++++++-------------------
 5 files changed, 50 insertions(+), 45 deletions(-)

diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 26c6897..beded32 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -2090,6 +2090,8 @@ IDirect3DDeviceImpl_7_GetRenderState(IDi
     if(!Value)
         return DDERR_INVALIDPARAMS;
 
+    /* FIXME: Unhandled: D3DRENDERSTATE_STIPPLEPATTERN00 - 31 */
+
     return IWineD3DDevice_GetRenderState(This->wineD3DDevice,
                                          RenderStateType,
                                          Value);
@@ -2288,6 +2290,9 @@ IDirect3DDeviceImpl_7_SetRenderState(IDi
         }
 
         default:
+
+            /* FIXME: Unhandled: D3DRENDERSTATE_STIPPLEPATTERN00 - 31 */
+
             return IWineD3DDevice_SetRenderState(This->wineD3DDevice,
                                                  RenderStateType,
                                                  Value);
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 44a55d8..4640f7d 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3335,7 +3335,7 @@ #endif
             }
 }
 
-static void renderstate_stencil(IWineD3DDeviceImpl *This, D3DRENDERSTATETYPE State, DWORD Value) {
+static void renderstate_stencil(IWineD3DDeviceImpl *This, WINED3DRENDERSTATETYPE State, DWORD Value) {
     DWORD onesided_enable = FALSE;
     DWORD twosided_enable = FALSE;
     GLint func = GL_ALWAYS;
@@ -3405,7 +3405,7 @@ static void renderstate_stencil(IWineD3D
  * Get / Set Render States
  * TODO: Verify against dx9 definitions
  *****/
-static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D3DRENDERSTATETYPE State, DWORD Value) {
+static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, WINED3DRENDERSTATETYPE State, DWORD Value) {
 
     IWineD3DDeviceImpl  *This     = (IWineD3DDeviceImpl *)iface;
     DWORD                OldValue = This->stateBlock->renderState[State];
@@ -3748,7 +3748,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
             if (!GL_SUPPORT(NV_REGISTER_COMBINERS)) {
                 /* And now the default texture color as well */
                 for (i = 0; i < GL_LIMITS(texture_stages); i++) {
-                    /* Note the D3DRS value applies to all textures, but GL has one
+                    /* Note the WINED3DRS value applies to all textures, but GL has one
                        per texture, so apply it now ready to be used!               */
                     if (GL_SUPPORT(ARB_MULTITEXTURE)) {
                         GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB + i));
@@ -4585,7 +4585,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
     return WINED3D_OK;
 }
 
-static HRESULT WINAPI IWineD3DDeviceImpl_GetRenderState(IWineD3DDevice *iface, D3DRENDERSTATETYPE State, DWORD *pValue) {
+static HRESULT WINAPI IWineD3DDeviceImpl_GetRenderState(IWineD3DDevice *iface, WINED3DRENDERSTATETYPE State, DWORD *pValue) {
     IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
     TRACE("(%p) for State %d = %d\n", This, State, This->stateBlock->renderState[State]);
     *pValue = This->stateBlock->renderState[State];
@@ -5140,7 +5140,7 @@ process_vertices_strided(IWineD3DDeviceI
     }
 
     /* Should I clip?
-     * a) D3DRS_CLIPPING is enabled
+     * a) WINED3DRS_CLIPPING is enabled
      * b) WINED3DVOP_CLIP is passed
      */
     if(This->stateBlock->renderState[WINED3DRS_CLIPPING]) {
@@ -5529,7 +5529,7 @@ #endif
                   eg. SetTextureStageState( 0, WINED3DTSS_TEXCOORDINDEX, D3DTSS_TCI_CAMERASPACEPOSITION | 1 );
                   means use the vertex position (camera-space) as the input texture coordinates
                   for this texture stage, and the wrap mode set in the WINED3DRS_WRAP1 render
-                  state. We do not (yet) support the D3DRENDERSTATE_WRAPx values, nor tie them up
+                  state. We do not (yet) support the WINED3DRENDERSTATE_WRAPx values, nor tie them up
                   to the TEXCOORDINDEX value */
 
             /**
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 2873348..0377ddd 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1224,10 +1224,10 @@ static HRESULT WINAPI IWineD3DSurfaceImp
                 glDrawBuffer(GL_BACK);
                 vcheckGLcall("glDrawBuffer");
             }
-            if(myDevice->stateBlock->renderState[D3DRS_ZENABLE] == D3DZB_TRUE ||
-               myDevice->stateBlock->renderState[D3DRS_ZENABLE] == D3DZB_USEW) glEnable(GL_DEPTH_TEST);
-            if (myDevice->stateBlock->renderState[D3DRS_ALPHABLENDENABLE]) glEnable(GL_BLEND);
-            if (myDevice->stateBlock->renderState[D3DRS_FOGENABLE]) glEnable(GL_FOG);
+            if(myDevice->stateBlock->renderState[WINED3DRS_ZENABLE] == D3DZB_TRUE ||
+               myDevice->stateBlock->renderState[WINED3DRS_ZENABLE] == D3DZB_USEW) glEnable(GL_DEPTH_TEST);
+            if (myDevice->stateBlock->renderState[WINED3DRS_ALPHABLENDENABLE]) glEnable(GL_BLEND);
+            if (myDevice->stateBlock->renderState[WINED3DRS_FOGENABLE]) glEnable(GL_FOG);
 
             LEAVE_GL();
 
diff --git a/include/wine/wined3d_interface.h b/include/wine/wined3d_interface.h
index 79dfe2d..86f5dec 100644
--- a/include/wine/wined3d_interface.h
+++ b/include/wine/wined3d_interface.h
@@ -406,8 +406,8 @@ DECLARE_INTERFACE_(IWineD3DDevice,IWineD
     STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister, int* pConstantData, UINT Vector4iCount) PURE;
     STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) PURE;
     STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister, float* pConstantData, UINT Vector4fCount) PURE;
-    STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE  State,DWORD  Value) PURE;
-    STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE  State,DWORD * pValue) PURE;
+    STDMETHOD(SetRenderState)(THIS_ WINED3DRENDERSTATETYPE  State, DWORD  Value) PURE;
+    STDMETHOD(GetRenderState)(THIS_ WINED3DRENDERSTATETYPE  State, DWORD * pValue) PURE;
     STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex, struct IWineD3DSurface* pRenderTarget) PURE;
     STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex, struct IWineD3DSurface** ppRenderTarget) PURE;
     STDMETHOD(SetFrontBackBuffers)(THIS_ struct IWineD3DSurface *Front, struct IWineD3DSurface *Back) PURE;
diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h
index 76bd905..90bdcf9 100644
--- a/include/wine/wined3d_types.h
+++ b/include/wine/wined3d_types.h
@@ -271,27 +271,27 @@ typedef enum _WINED3DFORMAT {
 } WINED3DFORMAT;
 
 typedef enum _WINED3DRENDERSTATETYPE {
-    WINED3DRS_TEXTUREHANDLE             =   1,
-    WINED3DRS_ANTIALIAS                 =   2,
-    WINED3DRS_TEXTUREADDRESS            =   3,
-    WINED3DRS_TEXTUREPERSPECTIVE        =   4,
-    WINED3DRS_WRAPU                     =   5,
-    WINED3DRS_WRAPV                     =   6,
+    WINED3DRS_TEXTUREHANDLE             =   1, /* d3d7 */
+    WINED3DRS_ANTIALIAS                 =   2, /* d3d7 */
+    WINED3DRS_TEXTUREADDRESS            =   3, /* d3d7 */
+    WINED3DRS_TEXTUREPERSPECTIVE        =   4, /* d3d7 */
+    WINED3DRS_WRAPU                     =   5, /* d3d7 */
+    WINED3DRS_WRAPV                     =   6, /* d3d7 */
     WINED3DRS_ZENABLE                   =   7,
     WINED3DRS_FILLMODE                  =   8,
     WINED3DRS_SHADEMODE                 =   9,
-    WINED3DRS_LINEPATTERN               =  10,
-    WINED3DRS_MONOENABLE                =  11,
-    WINED3DRS_ROP2                      =  12,
-    WINED3DRS_PLANEMASK                 =  13,
+    WINED3DRS_LINEPATTERN               =  10, /* d3d7, d3d8 */
+    WINED3DRS_MONOENABLE                =  11, /* d3d7 */
+    WINED3DRS_ROP2                      =  12, /* d3d7 */
+    WINED3DRS_PLANEMASK                 =  13, /* d3d7 */
     WINED3DRS_ZWRITEENABLE              =  14,
     WINED3DRS_ALPHATESTENABLE           =  15,
     WINED3DRS_LASTPIXEL                 =  16,
-    WINED3DRS_TEXTUREMAG                =  17,
-    WINED3DRS_TEXTUREMIN                =  18,
+    WINED3DRS_TEXTUREMAG                =  17, /* d3d7 */
+    WINED3DRS_TEXTUREMIN                =  18, /* d3d7 */
     WINED3DRS_SRCBLEND                  =  19,
     WINED3DRS_DESTBLEND                 =  20,
-    WINED3DRS_TEXTUREMAPBLEND           =  21,
+    WINED3DRS_TEXTUREMAPBLEND           =  21, /* d3d7 */
     WINED3DRS_CULLMODE                  =  22,
     WINED3DRS_ZFUNC                     =  23,
     WINED3DRS_ALPHAREF                  =  24,
@@ -300,27 +300,27 @@ typedef enum _WINED3DRENDERSTATETYPE {
     WINED3DRS_ALPHABLENDENABLE          =  27,
     WINED3DRS_FOGENABLE                 =  28,
     WINED3DRS_SPECULARENABLE            =  29,
-    WINED3DRS_ZVISIBLE                  =  30,
-    WINED3DRS_SUBPIXEL                  =  31,
-    WINED3DRS_SUBPIXELX                 =  32,
-    WINED3DRS_STIPPLEDALPHA             =  33,
+    WINED3DRS_ZVISIBLE                  =  30, /* d3d7, d3d8 */
+    WINED3DRS_SUBPIXEL                  =  31, /* d3d7 */
+    WINED3DRS_SUBPIXELX                 =  32, /* d3d7 */
+    WINED3DRS_STIPPLEDALPHA             =  33, /* d3d7 */
     WINED3DRS_FOGCOLOR                  =  34,
     WINED3DRS_FOGTABLEMODE              =  35,
     WINED3DRS_FOGSTART                  =  36,
     WINED3DRS_FOGEND                    =  37,
     WINED3DRS_FOGDENSITY                =  38,
-    WINED3DRS_STIPPLEENABLE             =  39,
-    WINED3DRS_EDGEANTIALIAS             =  40,
-    WINED3DRS_COLORKEYENABLE            =  41,
-    WINED3DRS_BORDERCOLOR               =  43,
-    WINED3DRS_TEXTUREADDRESSU           =  44,
-    WINED3DRS_TEXTUREADDRESSV           =  45,
-    WINED3DRS_MIPMAPLODBIAS             =  46,
-    WINED3DRS_ZBIAS                     =  47,
+    WINED3DRS_STIPPLEENABLE             =  39, /* d3d7 */
+    WINED3DRS_EDGEANTIALIAS             =  40, /* d3d7, d3d8 */
+    WINED3DRS_COLORKEYENABLE            =  41, /* d3d7 */
+    WINED3DRS_BORDERCOLOR               =  43, /* d3d7 */
+    WINED3DRS_TEXTUREADDRESSU           =  44, /* d3d7 */
+    WINED3DRS_TEXTUREADDRESSV           =  45, /* d3d7 */
+    WINED3DRS_MIPMAPLODBIAS             =  46, /* d3d7 */
+    WINED3DRS_ZBIAS                     =  47, /* d3d7, d3d8 */
     WINED3DRS_RANGEFOGENABLE            =  48,
-    WINED3DRS_ANISOTROPY                =  49,
-    WINED3DRS_FLUSHBATCH                =  50,
-    WINED3DRS_TRANSLUCENTSORTINDEPENDENT = 51,
+    WINED3DRS_ANISOTROPY                =  49, /* d3d7 */
+    WINED3DRS_FLUSHBATCH                =  50, /* d3d7 */
+    WINED3DRS_TRANSLUCENTSORTINDEPENDENT = 51, /* d3d7 */
     WINED3DRS_STENCILENABLE             =  52,
     WINED3DRS_STENCILFAIL               =  53,
     WINED3DRS_STENCILZFAIL              =  54,
@@ -340,20 +340,20 @@ typedef enum _WINED3DRENDERSTATETYPE {
     WINED3DRS_WRAP7                     = 135,
     WINED3DRS_CLIPPING                  = 136,
     WINED3DRS_LIGHTING                  = 137,
-    WINED3DRS_EXTENTS                   = 138,
+    WINED3DRS_EXTENTS                   = 138, /* d3d7 */
     WINED3DRS_AMBIENT                   = 139,
     WINED3DRS_FOGVERTEXMODE             = 140,
     WINED3DRS_COLORVERTEX               = 141,
     WINED3DRS_LOCALVIEWER               = 142,
     WINED3DRS_NORMALIZENORMALS          = 143,
-    WINED3DRS_COLORKEYBLENDENABLE       = 144,
+    WINED3DRS_COLORKEYBLENDENABLE       = 144, /* d3d7 */
     WINED3DRS_DIFFUSEMATERIALSOURCE     = 145,
     WINED3DRS_SPECULARMATERIALSOURCE    = 146,
     WINED3DRS_AMBIENTMATERIALSOURCE     = 147,
     WINED3DRS_EMISSIVEMATERIALSOURCE    = 148,
     WINED3DRS_VERTEXBLEND               = 151,
     WINED3DRS_CLIPPLANEENABLE           = 152,  
-    WINED3DRS_SOFTWAREVERTEXPROCESSING  = 153,
+    WINED3DRS_SOFTWAREVERTEXPROCESSING  = 153, /* d3d8 */
     WINED3DRS_POINTSIZE                 = 154,
     WINED3DRS_POINTSIZE_MIN             = 155,
     WINED3DRS_POINTSPRITEENABLE         = 156,
@@ -364,7 +364,7 @@ typedef enum _WINED3DRENDERSTATETYPE {
     WINED3DRS_MULTISAMPLEANTIALIAS      = 161,
     WINED3DRS_MULTISAMPLEMASK           = 162,
     WINED3DRS_PATCHEDGESTYLE            = 163,
-    WINED3DRS_PATCHSEGMENTS             = 164,
+    WINED3DRS_PATCHSEGMENTS             = 164, /* d3d8 */
     WINED3DRS_DEBUGMONITORTOKEN         = 165,
     WINED3DRS_POINTSIZE_MAX             = 166,
     WINED3DRS_INDEXEDVERTEXBLENDENABLE  = 167,
@@ -413,7 +413,7 @@ typedef enum _WINED3DRENDERSTATETYPE {
 } WINED3DRENDERSTATETYPE;
 
 #define WINEHIGHEST_RENDER_STATE   WINED3DRS_BLENDOPALPHA
-        /* Highest D3DRS_ value   */
+        /* Highest WINED3DRS_ value   */
 
 
 typedef struct _WINED3DDISPLAYMODE {
-- 
1.4.2.1



More information about the wine-patches mailing list