[PATCH 5/5] wined3d: Remove some code that doesn't make sense.

Henri Verbeet hverbeet at codeweavers.com
Tue Oct 13 03:38:04 CDT 2009


This was introduced by abb11f30cd418c6337a93a26981763b20c059172, but I don't
see how it could ever do something useful. Perhaps that's a lack of
imagination on my part, but the only situation in which device->stateBlock
should be NULL is while creating the initial stateblock, and in that case we
just returned in the line above. Setting the stream frequency of all streams
to 0x01010101 doesn't make sense either.
---
 dlls/wined3d/stateblock.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index e574d3a..6e6dac7 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1658,16 +1658,7 @@ HRESULT stateblock_init(IWineD3DStateBlockImpl *stateblock, IWineD3DDeviceImpl *
      * state block. */
     if (type == WINED3DSBT_INIT || type == WINED3DSBT_RECORDED) return WINED3D_OK;
 
-    /* Otherwise, might as well set the whole state block to the appropriate values  */
-    if (device->stateBlock)
-    {
-        /* Saved values */
-        stateblock_copy_values(stateblock, device->stateBlock, gl_info);
-    }
-    else
-    {
-        memset(stateblock->streamFreq, 1, sizeof(stateblock->streamFreq));
-    }
+    stateblock_copy_values(stateblock, device->stateBlock, gl_info);
 
     TRACE("Updating changed flags appropriate for type %#x.\n", type);
 
-- 
1.6.4.4




More information about the wine-patches mailing list