@@ -2057,7 +2057,6 @@ HRESULT m_IDirect3DDeviceX::SetRenderState(D3DRENDERSTATETYPE dwRenderStateType,
20572057 return SetTextureHandle (dwRenderState);
20582058 case D3DRENDERSTATE_ANTIALIAS: // 2
20592059 {
2060- DeviceStates.RenderState [dwRenderStateType].State = dwRenderState;
20612060 BOOL AntiAliasEnabled = (
20622061 (D3DANTIALIASMODE)dwRenderState == D3DANTIALIAS_SORTDEPENDENT ||
20632062 (D3DANTIALIASMODE)dwRenderState == D3DANTIALIAS_SORTINDEPENDENT) ? TRUE : FALSE ;
@@ -2068,7 +2067,6 @@ HRESULT m_IDirect3DDeviceX::SetRenderState(D3DRENDERSTATETYPE dwRenderStateType,
20682067 SetD9SamplerState (0 , D3DSAMP_ADDRESSU, dwRenderState);
20692068 return SetD9SamplerState (0 , D3DSAMP_ADDRESSV, dwRenderState);
20702069 case D3DRENDERSTATE_TEXTUREPERSPECTIVE: // 4
2071- DeviceStates.RenderState [dwRenderStateType].State = dwRenderState;
20722070 if (dwRenderState != FALSE )
20732071 {
20742072 LOG_LIMIT (100 , __FUNCTION__ << " Warning: 'D3DRENDERSTATE_TEXTUREPERSPECTIVE' not implemented: " << dwRenderState);
@@ -2079,7 +2077,6 @@ HRESULT m_IDirect3DDeviceX::SetRenderState(D3DRENDERSTATETYPE dwRenderStateType,
20792077 case D3DRENDERSTATE_WRAPV: // 6
20802078 return SetD9RenderState (D3DRS_WRAP0, (DeviceStates.RenderState [D3DRS_WRAP0].State & D3DWRAP_U) | (dwRenderState ? D3DWRAP_V : 0 ));
20812079 case D3DRENDERSTATE_LINEPATTERN: // 10
2082- DeviceStates.RenderState [dwRenderStateType].State = dwRenderState;
20832080 if (dwRenderState != 0 )
20842081 {
20852082 LOG_LIMIT (100 , __FUNCTION__ << " Warning: 'D3DRENDERSTATE_LINEPATTERN' not implemented: " << dwRenderState);
@@ -2243,7 +2240,6 @@ HRESULT m_IDirect3DDeviceX::SetRenderState(D3DRENDERSTATETYPE dwRenderStateType,
22432240 }
22442241 break ;
22452242 case D3DRENDERSTATE_ZVISIBLE: // 30
2246- DeviceStates.RenderState [dwRenderStateType].State = dwRenderState;
22472243 if (dwRenderState != FALSE )
22482244 {
22492245 LOG_LIMIT (100 , __FUNCTION__ << " Warning: 'D3DRENDERSTATE_ZVISIBLE' not implemented: " << dwRenderState);
@@ -2264,7 +2260,6 @@ HRESULT m_IDirect3DDeviceX::SetRenderState(D3DRENDERSTATETYPE dwRenderStateType,
22642260 }
22652261 return D3D_OK;
22662262 case D3DRENDERSTATE_STIPPLEDALPHA: // 33
2267- DeviceStates.RenderState [dwRenderStateType].State = dwRenderState;
22682263 if (dwRenderState != FALSE )
22692264 {
22702265 LOG_LIMIT (100 , __FUNCTION__ << " Warning: 'D3DRENDERSTATE_STIPPLEDALPHA' not implemented! " << dwRenderState);
@@ -2285,7 +2280,6 @@ HRESULT m_IDirect3DDeviceX::SetRenderState(D3DRENDERSTATETYPE dwRenderStateType,
22852280 }
22862281 return D3D_OK;
22872282 case D3DRENDERSTATE_COLORKEYENABLE: // 41
2288- DeviceStates.RenderState [dwRenderStateType].State = dwRenderState;
22892283 return SetStateBlockRenderState (dwRenderStateType, dwRenderState);
22902284 case D3DRENDERSTATE_OLDALPHABLENDENABLE:// 42
22912285 DeviceStates.RenderState [dwRenderStateType].State = dwRenderState;
@@ -2303,7 +2297,6 @@ HRESULT m_IDirect3DDeviceX::SetRenderState(D3DRENDERSTATETYPE dwRenderStateType,
23032297 {
23042298 SetD9RenderState (D3DRS_DEPTHBIAS, GetDepthBias (dwRenderState, DepthBitCount));
23052299 }
2306- DeviceStates.RenderState [dwRenderStateType].State = dwRenderState;
23072300 return SetStateBlockRenderState (dwRenderStateType, dwRenderState);
23082301 case D3DRENDERSTATE_ANISOTROPY: // 49
23092302 return SetD9SamplerState (0 , D3DSAMP_MAXANISOTROPY, dwRenderState);
@@ -2364,14 +2357,12 @@ HRESULT m_IDirect3DDeviceX::SetRenderState(D3DRENDERSTATETYPE dwRenderStateType,
23642357 return D3D_OK;
23652358 case D3DRENDERSTATE_EXTENTS: // 138
23662359 // ToDo: use this to enable/disable clip plane extents set by SetClipStatus()
2367- DeviceStates.RenderState [dwRenderStateType].State = dwRenderState;
23682360 if (dwRenderState != FALSE )
23692361 {
23702362 LOG_LIMIT (100 , __FUNCTION__ << " Warning: 'D3DRENDERSTATE_EXTENTS' not implemented! " << dwRenderState);
23712363 }
23722364 return SetStateBlockRenderState (dwRenderStateType, dwRenderState);
23732365 case D3DRENDERSTATE_COLORKEYBLENDENABLE:// 144
2374- DeviceStates.RenderState [dwRenderStateType].State = dwRenderState;
23752366 return SetStateBlockRenderState (dwRenderStateType, dwRenderState);
23762367 }
23772368
@@ -5543,8 +5534,11 @@ HRESULT m_IDirect3DDeviceX::SetStateBlockRenderState(D3DRENDERSTATETYPE State, D
55435534 if (StateBlock.IsRecording && StateBlock.Data [StateBlock.RecordingToken ].RecordState .has_value ())
55445535 {
55455536 StateBlock.Data [StateBlock.RecordingToken ].RecordState .value ().UnmappedRenderState [State] = Value;
5537+ return D3D_OK;
55465538 }
55475539
5540+ DeviceStates.RenderState [State].State = Value;
5541+
55485542 return D3D_OK;
55495543}
55505544
@@ -5582,6 +5576,7 @@ HRESULT m_IDirect3DDeviceX::SetD9RenderState(D3DRENDERSTATETYPE State, DWORD Val
55825576 if (StateBlock.IsRecording && StateBlock.Data [StateBlock.RecordingToken ].RecordState .has_value ())
55835577 {
55845578 StateBlock.Data [StateBlock.RecordingToken ].RecordState .value ().RenderState [State] = Value;
5579+ return D3D_OK;
55855580 }
55865581
55875582 BatchStates.RenderState [State] = Value;
@@ -5626,6 +5621,7 @@ HRESULT m_IDirect3DDeviceX::SetD9TextureStageState(DWORD Stage, D3DTEXTURESTAGES
56265621 if (StateBlock.IsRecording && StateBlock.Data [StateBlock.RecordingToken ].RecordState .has_value ())
56275622 {
56285623 StateBlock.Data [StateBlock.RecordingToken ].RecordState .value ().TextureStageState [Stage][Type] = Value;
5624+ return D3D_OK;
56295625 }
56305626
56315627 BatchStates.TextureStageState [Stage][Type] = Value;
@@ -5670,6 +5666,7 @@ HRESULT m_IDirect3DDeviceX::SetD9SamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE
56705666 if (StateBlock.IsRecording && StateBlock.Data [StateBlock.RecordingToken ].RecordState .has_value ())
56715667 {
56725668 StateBlock.Data [StateBlock.RecordingToken ].RecordState .value ().SamplerState [Sampler][Type] = Value;
5669+ return D3D_OK;
56735670 }
56745671
56755672 BatchStates.SamplerState [Sampler][Type] = FixSamplerState (Type, Value);
@@ -5707,6 +5704,7 @@ HRESULT m_IDirect3DDeviceX::SetD9Light(DWORD Index, const D3DLIGHT9* lpLight)
57075704 if (StateBlock.IsRecording && StateBlock.Data [StateBlock.RecordingToken ].RecordState .has_value ())
57085705 {
57095706 StateBlock.Data [StateBlock.RecordingToken ].RecordState .value ().Light [Index] = *lpLight;
5707+ return D3D_OK;
57105708 }
57115709
57125710 BatchStates.Light [Index] = FixLight (*lpLight);
@@ -5741,6 +5739,7 @@ HRESULT m_IDirect3DDeviceX::D9LightEnable(DWORD Index, BOOL Enable)
57415739 if (StateBlock.IsRecording && StateBlock.Data [StateBlock.RecordingToken ].RecordState .has_value ())
57425740 {
57435741 StateBlock.Data [StateBlock.RecordingToken ].RecordState .value ().LightEnable [Index] = Enable;
5742+ return D3D_OK;
57445743 }
57455744
57465745 BatchStates.LightEnable [Index] = Enable;
@@ -5784,6 +5783,7 @@ HRESULT m_IDirect3DDeviceX::SetD9ClipPlane(DWORD Index, const float* lpPlane)
57845783 if (StateBlock.IsRecording && StateBlock.Data [StateBlock.RecordingToken ].RecordState .has_value ())
57855784 {
57865785 StateBlock.Data [StateBlock.RecordingToken ].RecordState .value ().ClipPlane [Index] = *(FLOAT4*)lpPlane;
5786+ return D3D_OK;
57875787 }
57885788
57895789 BatchStates.ClipPlane [Index] = *(FLOAT4*)lpPlane;
@@ -5823,6 +5823,7 @@ HRESULT m_IDirect3DDeviceX::SetD9Viewport(const D3DVIEWPORT9* lpViewport)
58235823 if (StateBlock.IsRecording && StateBlock.Data [StateBlock.RecordingToken ].RecordState .has_value ())
58245824 {
58255825 StateBlock.Data [StateBlock.RecordingToken ].RecordState .value ().Viewport [0 ] = *lpViewport;
5826+ return D3D_OK;
58265827 }
58275828
58285829 DeviceStates.Viewport .Set = true ;
@@ -5860,6 +5861,7 @@ HRESULT m_IDirect3DDeviceX::SetD9Material(const D3DMATERIAL9* lpMaterial)
58605861 if (StateBlock.IsRecording && StateBlock.Data [StateBlock.RecordingToken ].RecordState .has_value ())
58615862 {
58625863 StateBlock.Data [StateBlock.RecordingToken ].RecordState .value ().Material [0 ] = *lpMaterial;
5864+ return D3D_OK;
58635865 }
58645866
58655867 BatchStates.Material .Set = true ;
@@ -5905,6 +5907,7 @@ HRESULT m_IDirect3DDeviceX::SetD9Transform(D3DTRANSFORMSTATETYPE State, const D3
59055907 if (StateBlock.IsRecording && StateBlock.Data [StateBlock.RecordingToken ].RecordState .has_value ())
59065908 {
59075909 StateBlock.Data [StateBlock.RecordingToken ].RecordState .value ().Matrix [State] = *lpMatrix;
5910+ return D3D_OK;
59085911 }
59095912
59105913 BatchStates.Matrix [State] = FixMatrix (*lpMatrix, State, DeviceStates.Viewport .ViewportScale , DeviceStates.Viewport .UseViewportScale );
@@ -5932,6 +5935,7 @@ HRESULT m_IDirect3DDeviceX::D9MultiplyTransform(D3DTRANSFORMSTATETYPE State, con
59325935 if (StateBlock.IsRecording && StateBlock.Data [StateBlock.RecordingToken ].RecordState .has_value ())
59335936 {
59345937 StateBlock.Data [StateBlock.RecordingToken ].RecordState .value ().Matrix [State] = result;
5938+ return D3D_OK;
59355939 }
59365940
59375941 BatchStates.Matrix [State] = FixMatrix (result, State, DeviceStates.Viewport .ViewportScale , DeviceStates.Viewport .UseViewportScale );
0 commit comments