Commit 979e3744 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Remove state management methods from the IWineD3DDevice interface.

parent ddad22d0
...@@ -129,7 +129,7 @@ static void STDMETHODCALLTYPE d3d10_device_PSSetShader(ID3D10Device *iface, ID3D ...@@ -129,7 +129,7 @@ static void STDMETHODCALLTYPE d3d10_device_PSSetShader(ID3D10Device *iface, ID3D
TRACE("iface %p, shader %p\n", iface, shader); TRACE("iface %p, shader %p\n", iface, shader);
IWineD3DDevice_SetPixelShader(This->wined3d_device, ps ? ps->wined3d_shader : NULL); wined3d_device_set_pixel_shader(This->wined3d_device, ps ? ps->wined3d_shader : NULL);
} }
static void STDMETHODCALLTYPE d3d10_device_PSSetSamplers(ID3D10Device *iface, static void STDMETHODCALLTYPE d3d10_device_PSSetSamplers(ID3D10Device *iface,
...@@ -146,7 +146,7 @@ static void STDMETHODCALLTYPE d3d10_device_VSSetShader(ID3D10Device *iface, ID3D ...@@ -146,7 +146,7 @@ static void STDMETHODCALLTYPE d3d10_device_VSSetShader(ID3D10Device *iface, ID3D
TRACE("iface %p, shader %p\n", iface, shader); TRACE("iface %p, shader %p\n", iface, shader);
IWineD3DDevice_SetVertexShader(This->wined3d_device, vs ? vs->wined3d_shader : NULL); wined3d_device_set_vertex_shader(This->wined3d_device, vs ? vs->wined3d_shader : NULL);
} }
static void STDMETHODCALLTYPE d3d10_device_DrawIndexed(ID3D10Device *iface, static void STDMETHODCALLTYPE d3d10_device_DrawIndexed(ID3D10Device *iface,
...@@ -157,7 +157,7 @@ static void STDMETHODCALLTYPE d3d10_device_DrawIndexed(ID3D10Device *iface, ...@@ -157,7 +157,7 @@ static void STDMETHODCALLTYPE d3d10_device_DrawIndexed(ID3D10Device *iface,
TRACE("iface %p, index_count %u, start_index_location %u, base_vertex_location %d.\n", TRACE("iface %p, index_count %u, start_index_location %u, base_vertex_location %d.\n",
iface, index_count, start_index_location, base_vertex_location); iface, index_count, start_index_location, base_vertex_location);
IWineD3DDevice_SetBaseVertexIndex(This->wined3d_device, base_vertex_location); wined3d_device_set_base_vertex_index(This->wined3d_device, base_vertex_location);
IWineD3DDevice_DrawIndexedPrimitive(This->wined3d_device, start_index_location, index_count); IWineD3DDevice_DrawIndexedPrimitive(This->wined3d_device, start_index_location, index_count);
} }
...@@ -185,7 +185,7 @@ static void STDMETHODCALLTYPE d3d10_device_IASetInputLayout(ID3D10Device *iface, ...@@ -185,7 +185,7 @@ static void STDMETHODCALLTYPE d3d10_device_IASetInputLayout(ID3D10Device *iface,
TRACE("iface %p, input_layout %p\n", iface, input_layout); TRACE("iface %p, input_layout %p\n", iface, input_layout);
IWineD3DDevice_SetVertexDeclaration(This->wined3d_device, wined3d_device_set_vertex_declaration(This->wined3d_device,
input_layout ? ((struct d3d10_input_layout *)input_layout)->wined3d_decl : NULL); input_layout ? ((struct d3d10_input_layout *)input_layout)->wined3d_decl : NULL);
} }
...@@ -201,7 +201,7 @@ static void STDMETHODCALLTYPE d3d10_device_IASetVertexBuffers(ID3D10Device *ifac ...@@ -201,7 +201,7 @@ static void STDMETHODCALLTYPE d3d10_device_IASetVertexBuffers(ID3D10Device *ifac
for (i = 0; i < buffer_count; ++i) for (i = 0; i < buffer_count; ++i)
{ {
IWineD3DDevice_SetStreamSource(This->wined3d_device, start_slot, wined3d_device_set_stream_source(This->wined3d_device, start_slot,
buffers[i] ? ((struct d3d10_buffer *)buffers[i])->wined3d_buffer : NULL, buffers[i] ? ((struct d3d10_buffer *)buffers[i])->wined3d_buffer : NULL,
offsets[i], strides[i]); offsets[i], strides[i]);
} }
...@@ -215,7 +215,8 @@ static void STDMETHODCALLTYPE d3d10_device_IASetIndexBuffer(ID3D10Device *iface, ...@@ -215,7 +215,8 @@ static void STDMETHODCALLTYPE d3d10_device_IASetIndexBuffer(ID3D10Device *iface,
TRACE("iface %p, buffer %p, format %s, offset %u.\n", TRACE("iface %p, buffer %p, format %s, offset %u.\n",
iface, buffer, debug_dxgi_format(format), offset); iface, buffer, debug_dxgi_format(format), offset);
IWineD3DDevice_SetIndexBuffer(This->wined3d_device, buffer ? ((struct d3d10_buffer *)buffer)->wined3d_buffer : NULL, wined3d_device_set_index_buffer(This->wined3d_device,
buffer ? ((struct d3d10_buffer *)buffer)->wined3d_buffer : NULL,
wined3dformat_from_dxgi_format(format)); wined3dformat_from_dxgi_format(format));
if (offset) FIXME("offset %u not supported.\n", offset); if (offset) FIXME("offset %u not supported.\n", offset);
} }
......
...@@ -155,11 +155,8 @@ HRESULT d3d_execute_buffer_execute(IDirect3DExecuteBufferImpl *This, ...@@ -155,11 +155,8 @@ HRESULT d3d_execute_buffer_execute(IDirect3DExecuteBufferImpl *This,
} }
/* IDirect3DDevices have color keying always enabled - /* IDirect3DDevices have color keying always enabled -
* enable it before drawing. This overwrites any ALPHA* * enable it before drawing. This overwrites any ALPHA*
* render state * render state. */
*/ wined3d_device_set_render_state(lpDevice->wineD3DDevice, WINED3DRS_COLORKEYENABLE, 1);
IWineD3DDevice_SetRenderState(lpDevice->wineD3DDevice,
WINED3DRS_COLORKEYENABLE,
1);
IDirect3DDevice7_DrawIndexedPrimitive((IDirect3DDevice7 *)lpDevice, IDirect3DDevice7_DrawIndexedPrimitive((IDirect3DDevice7 *)lpDevice,
D3DPT_TRIANGLELIST, D3DFVF_TLVERTEX, tl_vx, 0, This->indices, count * 3, 0); D3DPT_TRIANGLELIST, D3DFVF_TLVERTEX, tl_vx, 0, This->indices, count * 3, 0);
} break; } break;
...@@ -318,18 +315,12 @@ HRESULT d3d_execute_buffer_execute(IDirect3DExecuteBufferImpl *This, ...@@ -318,18 +315,12 @@ HRESULT d3d_execute_buffer_execute(IDirect3DExecuteBufferImpl *This,
/* Get the transform and world matrix */ /* Get the transform and world matrix */
/* Note: D3DMATRIX is compatible with WINED3DMATRIX */ /* Note: D3DMATRIX is compatible with WINED3DMATRIX */
wined3d_device_get_transform(lpDevice->wineD3DDevice,
IWineD3DDevice_GetTransform(lpDevice->wineD3DDevice, D3DTRANSFORMSTATE_VIEW, (WINED3DMATRIX *)&view_mat);
D3DTRANSFORMSTATE_VIEW, wined3d_device_get_transform(lpDevice->wineD3DDevice,
(WINED3DMATRIX*) &view_mat); D3DTRANSFORMSTATE_PROJECTION, (WINED3DMATRIX *)&proj_mat);
wined3d_device_get_transform(lpDevice->wineD3DDevice,
IWineD3DDevice_GetTransform(lpDevice->wineD3DDevice, WINED3DTS_WORLDMATRIX(0), (WINED3DMATRIX *)&world_mat);
D3DTRANSFORMSTATE_PROJECTION,
(WINED3DMATRIX*) &proj_mat);
IWineD3DDevice_GetTransform(lpDevice->wineD3DDevice,
WINED3DTS_WORLDMATRIX(0),
(WINED3DMATRIX*) &world_mat);
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
LPD3DPROCESSVERTICES ci = (LPD3DPROCESSVERTICES) instr; LPD3DPROCESSVERTICES ci = (LPD3DPROCESSVERTICES) instr;
......
...@@ -2923,7 +2923,7 @@ static HRESULT WINAPI ddraw_gamma_control_GetGammaRamp(IDirectDrawGammaControl * ...@@ -2923,7 +2923,7 @@ static HRESULT WINAPI ddraw_gamma_control_GetGammaRamp(IDirectDrawGammaControl *
if (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) if (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
{ {
/* Note: DDGAMMARAMP is compatible with WINED3DGAMMARAMP. */ /* Note: DDGAMMARAMP is compatible with WINED3DGAMMARAMP. */
IWineD3DDevice_GetGammaRamp(surface->ddraw->wineD3DDevice, 0, (WINED3DGAMMARAMP *)gamma_ramp); wined3d_device_get_gamma_ramp(surface->ddraw->wineD3DDevice, 0, (WINED3DGAMMARAMP *)gamma_ramp);
} }
else else
{ {
...@@ -2965,7 +2965,7 @@ static HRESULT WINAPI ddraw_gamma_control_SetGammaRamp(IDirectDrawGammaControl * ...@@ -2965,7 +2965,7 @@ static HRESULT WINAPI ddraw_gamma_control_SetGammaRamp(IDirectDrawGammaControl *
if (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) if (surface->surface_desc.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE)
{ {
/* Note: DDGAMMARAMP is compatible with WINED3DGAMMARAMP */ /* Note: DDGAMMARAMP is compatible with WINED3DGAMMARAMP */
IWineD3DDevice_SetGammaRamp(surface->ddraw->wineD3DDevice, 0, flags, (WINED3DGAMMARAMP *)gamma_ramp); wined3d_device_set_gamma_ramp(surface->ddraw->wineD3DDevice, 0, flags, (WINED3DGAMMARAMP *)gamma_ramp);
} }
else else
{ {
......
...@@ -141,23 +141,14 @@ IDirect3DVertexBufferImpl_Release(IDirect3DVertexBuffer7 *iface) ...@@ -141,23 +141,14 @@ IDirect3DVertexBufferImpl_Release(IDirect3DVertexBuffer7 *iface)
UINT offset, stride; UINT offset, stride;
EnterCriticalSection(&ddraw_cs); EnterCriticalSection(&ddraw_cs);
/* D3D7 Vertex buffers don't stay bound in the device, they are passed as a parameter /* D3D7 Vertex buffers don't stay bound in the device, they are passed
* to drawPrimitiveVB. DrawPrimitiveVB sets them as the stream source in wined3d, * as a parameter to drawPrimitiveVB. DrawPrimitiveVB sets them as the
* and they should get unset there before they are destroyed * stream source in wined3d, and they should get unset there before
*/ * they are destroyed. */
IWineD3DDevice_GetStreamSource(This->ddraw->wineD3DDevice, wined3d_device_get_stream_source(This->ddraw->wineD3DDevice,
0 /* Stream number */, 0, &curVB, &offset, &stride);
&curVB, if (curVB == This->wineD3DVertexBuffer)
&offset, wined3d_device_set_stream_source(This->ddraw->wineD3DDevice, 0, NULL, 0, 0);
&stride);
if(curVB == This->wineD3DVertexBuffer)
{
IWineD3DDevice_SetStreamSource(This->ddraw->wineD3DDevice,
0 /* Steam number */,
NULL /* stream data */,
0 /* Offset */,
0 /* stride */);
}
if (curVB) if (curVB)
wined3d_buffer_decref(curVB); /* For the GetStreamSource */ wined3d_buffer_decref(curVB); /* For the GetStreamSource */
...@@ -335,23 +326,13 @@ IDirect3DVertexBufferImpl_ProcessVertices(IDirect3DVertexBuffer7 *iface, ...@@ -335,23 +326,13 @@ IDirect3DVertexBufferImpl_ProcessVertices(IDirect3DVertexBuffer7 *iface,
* the vertex ops * the vertex ops
*/ */
doClip = VertexOp & D3DVOP_CLIP ? TRUE : FALSE; doClip = VertexOp & D3DVOP_CLIP ? TRUE : FALSE;
IWineD3DDevice_GetRenderState(D3D->wineD3DDevice, wined3d_device_get_render_state(D3D->wineD3DDevice, WINED3DRS_CLIPPING, (DWORD *)&oldClip);
WINED3DRS_CLIPPING, if (doClip != oldClip)
(DWORD *) &oldClip); wined3d_device_set_render_state(D3D->wineD3DDevice, WINED3DRS_CLIPPING, doClip);
if(doClip != oldClip)
{
IWineD3DDevice_SetRenderState(D3D->wineD3DDevice,
WINED3DRS_CLIPPING,
doClip);
}
IWineD3DDevice_SetStreamSource(D3D->wineD3DDevice, wined3d_device_set_stream_source(D3D->wineD3DDevice,
0, /* Stream No */ 0, Src->wineD3DVertexBuffer, 0, get_flexible_vertex_size(Src->fvf));
Src->wineD3DVertexBuffer, wined3d_device_set_vertex_declaration(D3D->wineD3DDevice, Src->wineD3DVertexDeclaration);
0, /* Offset */
get_flexible_vertex_size(Src->fvf));
IWineD3DDevice_SetVertexDeclaration(D3D->wineD3DDevice,
Src->wineD3DVertexDeclaration);
hr = IWineD3DDevice_ProcessVertices(D3D->wineD3DDevice, hr = IWineD3DDevice_ProcessVertices(D3D->wineD3DDevice,
SrcIndex, SrcIndex,
DestIndex, DestIndex,
...@@ -362,10 +343,8 @@ IDirect3DVertexBufferImpl_ProcessVertices(IDirect3DVertexBuffer7 *iface, ...@@ -362,10 +343,8 @@ IDirect3DVertexBufferImpl_ProcessVertices(IDirect3DVertexBuffer7 *iface,
This->fvf); This->fvf);
/* Restore the states if needed */ /* Restore the states if needed */
if(doClip != oldClip) if (doClip != oldClip)
IWineD3DDevice_SetRenderState(D3D->wineD3DDevice, wined3d_device_set_render_state(D3D->wineD3DDevice, WINED3DRS_CLIPPING, oldClip);
WINED3DRS_CLIPPING,
oldClip);
LeaveCriticalSection(&ddraw_cs); LeaveCriticalSection(&ddraw_cs);
return hr; return hr;
} }
......
...@@ -387,17 +387,12 @@ IDirect3DViewportImpl_TransformVertices(IDirect3DViewport3 *iface, ...@@ -387,17 +387,12 @@ IDirect3DViewportImpl_TransformVertices(IDirect3DViewport3 *iface,
EnterCriticalSection(&ddraw_cs); EnterCriticalSection(&ddraw_cs);
IWineD3DDevice_GetTransform(This->active_device->wineD3DDevice, wined3d_device_get_transform(This->active_device->wineD3DDevice,
D3DTRANSFORMSTATE_VIEW, D3DTRANSFORMSTATE_VIEW, (WINED3DMATRIX *)&view_mat);
(WINED3DMATRIX*) &view_mat); wined3d_device_get_transform(This->active_device->wineD3DDevice,
D3DTRANSFORMSTATE_PROJECTION, (WINED3DMATRIX *)&proj_mat);
IWineD3DDevice_GetTransform(This->active_device->wineD3DDevice, wined3d_device_get_transform(This->active_device->wineD3DDevice,
D3DTRANSFORMSTATE_PROJECTION, WINED3DTS_WORLDMATRIX(0), (WINED3DMATRIX *)&world_mat);
(WINED3DMATRIX*) &proj_mat);
IWineD3DDevice_GetTransform(This->active_device->wineD3DDevice,
WINED3DTS_WORLDMATRIX(0),
(WINED3DMATRIX*) &world_mat);
multiply_matrix(&mat,&view_mat,&world_mat); multiply_matrix(&mat,&view_mat,&world_mat);
multiply_matrix(&mat,&proj_mat,&mat); multiply_matrix(&mat,&proj_mat,&mat);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -897,8 +897,8 @@ static void apply_lights(IWineD3DDevice *device, const struct wined3d_state *sta ...@@ -897,8 +897,8 @@ static void apply_lights(IWineD3DDevice *device, const struct wined3d_state *sta
{ {
const struct wined3d_light_info *light = LIST_ENTRY(e, struct wined3d_light_info, entry); const struct wined3d_light_info *light = LIST_ENTRY(e, struct wined3d_light_info, entry);
IWineD3DDevice_SetLight(device, light->OriginalIndex, &light->OriginalParms); wined3d_device_set_light(device, light->OriginalIndex, &light->OriginalParms);
IWineD3DDevice_SetLightEnable(device, light->OriginalIndex, light->glIndex != -1); wined3d_device_set_light_enable(device, light->OriginalIndex, light->glIndex != -1);
} }
} }
} }
...@@ -913,51 +913,51 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo ...@@ -913,51 +913,51 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo
TRACE("Blocktype: %#x.\n", stateblock->blockType); TRACE("Blocktype: %#x.\n", stateblock->blockType);
if (stateblock->changed.vertexShader) if (stateblock->changed.vertexShader)
IWineD3DDevice_SetVertexShader(device, stateblock->state.vertex_shader); wined3d_device_set_vertex_shader(device, stateblock->state.vertex_shader);
/* Vertex Shader Constants. */ /* Vertex Shader Constants. */
for (i = 0; i < stateblock->num_contained_vs_consts_f; ++i) for (i = 0; i < stateblock->num_contained_vs_consts_f; ++i)
{ {
IWineD3DDevice_SetVertexShaderConstantF(device, stateblock->contained_vs_consts_f[i], wined3d_device_set_vs_consts_f(device, stateblock->contained_vs_consts_f[i],
stateblock->state.vs_consts_f + stateblock->contained_vs_consts_f[i] * 4, 1); stateblock->state.vs_consts_f + stateblock->contained_vs_consts_f[i] * 4, 1);
} }
for (i = 0; i < stateblock->num_contained_vs_consts_i; ++i) for (i = 0; i < stateblock->num_contained_vs_consts_i; ++i)
{ {
IWineD3DDevice_SetVertexShaderConstantI(device, stateblock->contained_vs_consts_i[i], wined3d_device_set_vs_consts_i(device, stateblock->contained_vs_consts_i[i],
stateblock->state.vs_consts_i + stateblock->contained_vs_consts_i[i] * 4, 1); stateblock->state.vs_consts_i + stateblock->contained_vs_consts_i[i] * 4, 1);
} }
for (i = 0; i < stateblock->num_contained_vs_consts_b; ++i) for (i = 0; i < stateblock->num_contained_vs_consts_b; ++i)
{ {
IWineD3DDevice_SetVertexShaderConstantB(device, stateblock->contained_vs_consts_b[i], wined3d_device_set_vs_consts_b(device, stateblock->contained_vs_consts_b[i],
stateblock->state.vs_consts_b + stateblock->contained_vs_consts_b[i], 1); stateblock->state.vs_consts_b + stateblock->contained_vs_consts_b[i], 1);
} }
apply_lights(device, &stateblock->state); apply_lights(device, &stateblock->state);
if (stateblock->changed.pixelShader) if (stateblock->changed.pixelShader)
IWineD3DDevice_SetPixelShader(device, stateblock->state.pixel_shader); wined3d_device_set_pixel_shader(device, stateblock->state.pixel_shader);
/* Pixel Shader Constants. */ /* Pixel Shader Constants. */
for (i = 0; i < stateblock->num_contained_ps_consts_f; ++i) for (i = 0; i < stateblock->num_contained_ps_consts_f; ++i)
{ {
IWineD3DDevice_SetPixelShaderConstantF(device, stateblock->contained_ps_consts_f[i], wined3d_device_set_ps_consts_f(device, stateblock->contained_ps_consts_f[i],
stateblock->state.ps_consts_f + stateblock->contained_ps_consts_f[i] * 4, 1); stateblock->state.ps_consts_f + stateblock->contained_ps_consts_f[i] * 4, 1);
} }
for (i = 0; i < stateblock->num_contained_ps_consts_i; ++i) for (i = 0; i < stateblock->num_contained_ps_consts_i; ++i)
{ {
IWineD3DDevice_SetPixelShaderConstantI(device, stateblock->contained_ps_consts_i[i], wined3d_device_set_ps_consts_i(device, stateblock->contained_ps_consts_i[i],
stateblock->state.ps_consts_i + stateblock->contained_ps_consts_i[i] * 4, 1); stateblock->state.ps_consts_i + stateblock->contained_ps_consts_i[i] * 4, 1);
} }
for (i = 0; i < stateblock->num_contained_ps_consts_b; ++i) for (i = 0; i < stateblock->num_contained_ps_consts_b; ++i)
{ {
IWineD3DDevice_SetPixelShaderConstantB(device, stateblock->contained_ps_consts_b[i], wined3d_device_set_ps_consts_b(device, stateblock->contained_ps_consts_b[i],
stateblock->state.ps_consts_b + stateblock->contained_ps_consts_b[i], 1); stateblock->state.ps_consts_b + stateblock->contained_ps_consts_b[i], 1);
} }
/* Render states. */ /* Render states. */
for (i = 0; i < stateblock->num_contained_render_states; ++i) for (i = 0; i < stateblock->num_contained_render_states; ++i)
{ {
IWineD3DDevice_SetRenderState(device, stateblock->contained_render_states[i], wined3d_device_set_render_state(device, stateblock->contained_render_states[i],
stateblock->state.render_states[stateblock->contained_render_states[i]]); stateblock->state.render_states[stateblock->contained_render_states[i]]);
} }
...@@ -967,7 +967,7 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo ...@@ -967,7 +967,7 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo
DWORD stage = stateblock->contained_tss_states[i].stage; DWORD stage = stateblock->contained_tss_states[i].stage;
DWORD state = stateblock->contained_tss_states[i].state; DWORD state = stateblock->contained_tss_states[i].state;
IWineD3DDevice_SetTextureStageState(device, stage, state, stateblock->state.texture_states[stage][state]); wined3d_device_set_texture_stage_state(device, stage, state, stateblock->state.texture_states[stage][state]);
} }
/* Sampler states. */ /* Sampler states. */
...@@ -978,13 +978,13 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo ...@@ -978,13 +978,13 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo
DWORD value = stateblock->state.sampler_states[stage][state]; DWORD value = stateblock->state.sampler_states[stage][state];
if (stage >= MAX_FRAGMENT_SAMPLERS) stage += WINED3DVERTEXTEXTURESAMPLER0 - MAX_FRAGMENT_SAMPLERS; if (stage >= MAX_FRAGMENT_SAMPLERS) stage += WINED3DVERTEXTEXTURESAMPLER0 - MAX_FRAGMENT_SAMPLERS;
IWineD3DDevice_SetSamplerState(device, stage, state, value); wined3d_device_set_sampler_state(device, stage, state, value);
} }
/* Transform states. */ /* Transform states. */
for (i = 0; i < stateblock->num_contained_transform_states; ++i) for (i = 0; i < stateblock->num_contained_transform_states; ++i)
{ {
IWineD3DDevice_SetTransform(device, stateblock->contained_transform_states[i], wined3d_device_set_transform(device, stateblock->contained_transform_states[i],
&stateblock->state.transforms[stateblock->contained_transform_states[i]]); &stateblock->state.transforms[stateblock->contained_transform_states[i]]);
} }
...@@ -996,35 +996,27 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo ...@@ -996,35 +996,27 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo
if (stateblock->changed.indices) if (stateblock->changed.indices)
{ {
IWineD3DDevice_SetIndexBuffer(device, stateblock->state.index_buffer, stateblock->state.index_format); wined3d_device_set_index_buffer(device, stateblock->state.index_buffer, stateblock->state.index_format);
IWineD3DDevice_SetBaseVertexIndex(device, stateblock->state.base_vertex_index); wined3d_device_set_base_vertex_index(device, stateblock->state.base_vertex_index);
} }
if (stateblock->changed.vertexDecl && stateblock->state.vertex_declaration) if (stateblock->changed.vertexDecl && stateblock->state.vertex_declaration)
{ wined3d_device_set_vertex_declaration(device, stateblock->state.vertex_declaration);
IWineD3DDevice_SetVertexDeclaration(device, stateblock->state.vertex_declaration);
}
if (stateblock->changed.material) if (stateblock->changed.material)
{ wined3d_device_set_material(device, &stateblock->state.material);
IWineD3DDevice_SetMaterial(device, &stateblock->state.material);
}
if (stateblock->changed.viewport) if (stateblock->changed.viewport)
{ wined3d_device_set_viewport(device, &stateblock->state.viewport);
IWineD3DDevice_SetViewport(device, &stateblock->state.viewport);
}
if (stateblock->changed.scissorRect) if (stateblock->changed.scissorRect)
{ wined3d_device_set_scissor_rect(device, &stateblock->state.scissor_rect);
IWineD3DDevice_SetScissorRect(device, &stateblock->state.scissor_rect);
}
map = stateblock->changed.streamSource; map = stateblock->changed.streamSource;
for (i = 0; map; map >>= 1, ++i) for (i = 0; map; map >>= 1, ++i)
{ {
if (map & 1) if (map & 1)
IWineD3DDevice_SetStreamSource(device, i, wined3d_device_set_stream_source(device, i,
stateblock->state.streams[i].buffer, stateblock->state.streams[i].buffer,
0, stateblock->state.streams[i].stride); 0, stateblock->state.streams[i].stride);
} }
...@@ -1033,7 +1025,7 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo ...@@ -1033,7 +1025,7 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo
for (i = 0; map; map >>= 1, ++i) for (i = 0; map; map >>= 1, ++i)
{ {
if (map & 1) if (map & 1)
IWineD3DDevice_SetStreamSourceFreq(device, i, wined3d_device_set_stream_source_freq(device, i,
stateblock->state.streams[i].frequency | stateblock->state.streams[i].flags); stateblock->state.streams[i].frequency | stateblock->state.streams[i].flags);
} }
...@@ -1045,7 +1037,7 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo ...@@ -1045,7 +1037,7 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo
if (!(map & 1)) continue; if (!(map & 1)) continue;
stage = i < MAX_FRAGMENT_SAMPLERS ? i : WINED3DVERTEXTEXTURESAMPLER0 + i - MAX_FRAGMENT_SAMPLERS; stage = i < MAX_FRAGMENT_SAMPLERS ? i : WINED3DVERTEXTEXTURESAMPLER0 + i - MAX_FRAGMENT_SAMPLERS;
IWineD3DDevice_SetTexture(device, stage, stateblock->state.textures[i]); wined3d_device_set_texture(device, stage, stateblock->state.textures[i]);
} }
map = stateblock->changed.clipplane; map = stateblock->changed.clipplane;
...@@ -1059,7 +1051,7 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo ...@@ -1059,7 +1051,7 @@ HRESULT CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblo
clip[1] = (float) stateblock->state.clip_planes[i][1]; clip[1] = (float) stateblock->state.clip_planes[i][1];
clip[2] = (float) stateblock->state.clip_planes[i][2]; clip[2] = (float) stateblock->state.clip_planes[i][2];
clip[3] = (float) stateblock->state.clip_planes[i][3]; clip[3] = (float) stateblock->state.clip_planes[i][3];
IWineD3DDevice_SetClipPlane(device, i, clip); wined3d_device_set_clip_plane(device, i, clip);
} }
stateblock->device->stateBlock->state.lowest_disabled_stage = MAX_TEXTURES - 1; stateblock->device->stateBlock->state.lowest_disabled_stage = MAX_TEXTURES - 1;
......
...@@ -45,6 +45,70 @@ ...@@ -45,6 +45,70 @@
@ cdecl wined3d_clipper_set_window(ptr long ptr) @ cdecl wined3d_clipper_set_window(ptr long ptr)
@ cdecl wined3d_device_create(ptr long long ptr long ptr ptr) @ cdecl wined3d_device_create(ptr long long ptr long ptr ptr)
@ cdecl wined3d_device_get_base_vertex_index(ptr)
@ cdecl wined3d_device_get_clip_plane(ptr long ptr)
@ cdecl wined3d_device_get_clip_status(ptr ptr)
@ cdecl wined3d_device_get_current_texture_palette(ptr ptr)
@ cdecl wined3d_device_get_depth_stencil(ptr ptr)
@ cdecl wined3d_device_get_gamma_ramp(ptr long ptr)
@ cdecl wined3d_device_get_index_buffer(ptr ptr)
@ cdecl wined3d_device_get_light(ptr long ptr)
@ cdecl wined3d_device_get_light_enable(ptr long ptr)
@ cdecl wined3d_device_get_material(ptr ptr)
@ cdecl wined3d_device_get_npatch_mode(ptr)
@ cdecl wined3d_device_get_palette_entries(ptr long ptr)
@ cdecl wined3d_device_get_pixel_shader(ptr)
@ cdecl wined3d_device_get_ps_consts_b(ptr long ptr long)
@ cdecl wined3d_device_get_ps_consts_f(ptr long ptr long)
@ cdecl wined3d_device_get_ps_consts_i(ptr long ptr long)
@ cdecl wined3d_device_get_render_state(ptr long ptr)
@ cdecl wined3d_device_get_render_target(ptr long ptr)
@ cdecl wined3d_device_get_sampler_state(ptr long long ptr)
@ cdecl wined3d_device_get_scissor_rect(ptr ptr)
@ cdecl wined3d_device_get_software_vertex_processing(ptr)
@ cdecl wined3d_device_get_stream_source(ptr long ptr ptr ptr)
@ cdecl wined3d_device_get_stream_source_freq(ptr long ptr)
@ cdecl wined3d_device_get_texture(ptr long ptr)
@ cdecl wined3d_device_get_texture_stage_state(ptr long long ptr)
@ cdecl wined3d_device_get_transform(ptr long ptr)
@ cdecl wined3d_device_get_vertex_declaration(ptr ptr)
@ cdecl wined3d_device_get_vertex_shader(ptr)
@ cdecl wined3d_device_get_viewport(ptr ptr)
@ cdecl wined3d_device_get_vs_consts_b(ptr long ptr long)
@ cdecl wined3d_device_get_vs_consts_f(ptr long ptr long)
@ cdecl wined3d_device_get_vs_consts_i(ptr long ptr long)
@ cdecl wined3d_device_set_base_vertex_index(ptr long)
@ cdecl wined3d_device_set_clip_plane(ptr long ptr)
@ cdecl wined3d_device_set_clip_status(ptr ptr)
@ cdecl wined3d_device_set_current_texture_palette(ptr long)
@ cdecl wined3d_device_set_depth_stencil(ptr ptr)
@ cdecl wined3d_device_set_gamma_ramp(ptr long long ptr)
@ cdecl wined3d_device_set_index_buffer(ptr ptr long)
@ cdecl wined3d_device_set_light(ptr long ptr)
@ cdecl wined3d_device_set_light_enable(ptr long long)
@ cdecl wined3d_device_set_material(ptr ptr)
@ cdecl wined3d_device_set_npatch_mode(ptr float)
@ cdecl wined3d_device_set_palette_entries(ptr long ptr)
@ cdecl wined3d_device_set_pixel_shader(ptr ptr)
@ cdecl wined3d_device_set_ps_consts_b(ptr long ptr long)
@ cdecl wined3d_device_set_ps_consts_f(ptr long ptr long)
@ cdecl wined3d_device_set_ps_consts_i(ptr long ptr long)
@ cdecl wined3d_device_set_render_state(ptr long long)
@ cdecl wined3d_device_set_render_target(ptr long ptr long)
@ cdecl wined3d_device_set_sampler_state(ptr long long long)
@ cdecl wined3d_device_set_scissor_rect(ptr ptr)
@ cdecl wined3d_device_set_software_vertex_processing(ptr long)
@ cdecl wined3d_device_set_stream_source(ptr long ptr long long)
@ cdecl wined3d_device_set_stream_source_freq(ptr long long)
@ cdecl wined3d_device_set_texture(ptr long ptr)
@ cdecl wined3d_device_set_texture_stage_state(ptr long long long)
@ cdecl wined3d_device_set_transform(ptr long ptr)
@ cdecl wined3d_device_set_vertex_declaration(ptr ptr)
@ cdecl wined3d_device_set_vertex_shader(ptr ptr)
@ cdecl wined3d_device_set_viewport(ptr ptr)
@ cdecl wined3d_device_set_vs_consts_b(ptr long ptr long)
@ cdecl wined3d_device_set_vs_consts_f(ptr long ptr long)
@ cdecl wined3d_device_set_vs_consts_i(ptr long ptr long)
@ cdecl wined3d_palette_create(ptr long ptr ptr ptr) @ cdecl wined3d_palette_create(ptr long ptr ptr ptr)
@ cdecl wined3d_palette_decref(ptr) @ cdecl wined3d_palette_decref(ptr)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment