Commit d2b782f4 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Rename "wineD3DVertexBuffer" to "wined3d_buffer".

parent db42c500
......@@ -552,7 +552,7 @@ struct d3d_vertex_buffer
LONG ref;
/*** WineD3D and ddraw links ***/
struct wined3d_buffer *wineD3DVertexBuffer;
struct wined3d_buffer *wined3d_buffer;
struct wined3d_vertex_declaration *wineD3DVertexDeclaration;
struct ddraw *ddraw;
......
......@@ -4277,8 +4277,8 @@ static HRESULT d3d_device7_DrawPrimitiveVB(IDirect3DDevice7 *iface, D3DPRIMITIVE
wined3d_mutex_lock();
wined3d_device_set_vertex_declaration(device->wined3d_device, vb_impl->wineD3DVertexDeclaration);
hr = wined3d_device_set_stream_source(device->wined3d_device, 0, vb_impl->wineD3DVertexBuffer, 0, stride);
if (FAILED(hr))
if (FAILED(hr = wined3d_device_set_stream_source(device->wined3d_device,
0, vb_impl->wined3d_buffer, 0, stride)))
{
WARN("Failed to set stream source, hr %#x.\n", hr);
wined3d_mutex_unlock();
......@@ -4409,8 +4409,8 @@ static HRESULT d3d_device7_DrawIndexedPrimitiveVB(IDirect3DDevice7 *iface,
wined3d_device_set_index_buffer(device->wined3d_device, device->index_buffer, WINED3DFMT_R16_UINT, 0);
/* Set the vertex stream source */
hr = wined3d_device_set_stream_source(device->wined3d_device, 0, vb_impl->wineD3DVertexBuffer, 0, stride);
if (FAILED(hr))
if (FAILED(hr = wined3d_device_set_stream_source(device->wined3d_device,
0, vb_impl->wined3d_buffer, 0, stride)))
{
ERR("(%p) IDirect3DDevice::SetStreamSource failed with hr = %08x\n", device, hr);
wined3d_mutex_unlock();
......
......@@ -155,11 +155,11 @@ static ULONG WINAPI d3d_vertex_buffer7_Release(IDirect3DVertexBuffer7 *iface)
wined3d_mutex_lock();
wined3d_device_get_stream_source(buffer->ddraw->wined3d_device,
0, &curVB, &offset, &stride);
if (curVB == buffer->wineD3DVertexBuffer)
if (curVB == buffer->wined3d_buffer)
wined3d_device_set_stream_source(buffer->ddraw->wined3d_device, 0, NULL, 0, 0);
wined3d_vertex_declaration_decref(buffer->wineD3DVertexDeclaration);
wined3d_buffer_decref(buffer->wineD3DVertexBuffer);
wined3d_buffer_decref(buffer->wined3d_buffer);
wined3d_mutex_unlock();
HeapFree(GetProcessHeap(), 0, buffer);
......@@ -253,8 +253,8 @@ static HRESULT WINAPI d3d_vertex_buffer7_Lock(IDirect3DVertexBuffer7 *iface,
if (SUCCEEDED(hr))
{
buffer->dynamic = TRUE;
wined3d_buffer_decref(buffer->wineD3DVertexBuffer);
buffer->wineD3DVertexBuffer = new_buffer;
wined3d_buffer_decref(buffer->wined3d_buffer);
buffer->wined3d_buffer = new_buffer;
}
else
{
......@@ -268,12 +268,12 @@ static HRESULT WINAPI d3d_vertex_buffer7_Lock(IDirect3DVertexBuffer7 *iface,
if (data_size)
{
/* Get the size, for returning it, and for locking */
wined3d_resource = wined3d_buffer_get_resource(buffer->wineD3DVertexBuffer);
wined3d_resource = wined3d_buffer_get_resource(buffer->wined3d_buffer);
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
*data_size = wined3d_desc.size;
}
hr = wined3d_buffer_map(buffer->wineD3DVertexBuffer, 0, 0, (BYTE **)data, wined3d_flags);
hr = wined3d_buffer_map(buffer->wined3d_buffer, 0, 0, (BYTE **)data, wined3d_flags);
wined3d_mutex_unlock();
......@@ -306,7 +306,7 @@ static HRESULT WINAPI d3d_vertex_buffer7_Unlock(IDirect3DVertexBuffer7 *iface)
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
wined3d_buffer_unmap(buffer->wineD3DVertexBuffer);
wined3d_buffer_unmap(buffer->wined3d_buffer);
wined3d_mutex_unlock();
return D3D_OK;
......@@ -382,10 +382,10 @@ static HRESULT WINAPI d3d_vertex_buffer7_ProcessVertices(IDirect3DVertexBuffer7
wined3d_device_set_render_state(device_impl->wined3d_device, WINED3D_RS_CLIPPING, doClip);
wined3d_device_set_stream_source(device_impl->wined3d_device,
0, src_buffer_impl->wineD3DVertexBuffer, 0, get_flexible_vertex_size(src_buffer_impl->fvf));
0, src_buffer_impl->wined3d_buffer, 0, get_flexible_vertex_size(src_buffer_impl->fvf));
wined3d_device_set_vertex_declaration(device_impl->wined3d_device, src_buffer_impl->wineD3DVertexDeclaration);
hr = wined3d_device_process_vertices(device_impl->wined3d_device, src_idx, dst_idx,
count, dst_buffer_impl->wineD3DVertexBuffer, NULL, flags, dst_buffer_impl->fvf);
count, dst_buffer_impl->wined3d_buffer, NULL, flags, dst_buffer_impl->fvf);
/* Restore the states if needed */
if (doClip != oldClip)
......@@ -436,7 +436,7 @@ static HRESULT WINAPI d3d_vertex_buffer7_GetVertexBufferDesc(IDirect3DVertexBuff
if (!desc) return DDERR_INVALIDPARAMS;
wined3d_mutex_lock();
wined3d_resource = wined3d_buffer_get_resource(buffer->wineD3DVertexBuffer);
wined3d_resource = wined3d_buffer_get_resource(buffer->wined3d_buffer);
wined3d_resource_get_desc(wined3d_resource, &wined3d_desc);
wined3d_mutex_unlock();
......@@ -595,8 +595,7 @@ HRESULT d3d_vertex_buffer_create(struct d3d_vertex_buffer **vertex_buf,
wined3d_mutex_lock();
hr = d3d_vertex_buffer_create_wined3d_buffer(buffer, FALSE, &buffer->wineD3DVertexBuffer);
if (FAILED(hr))
if (FAILED(hr = d3d_vertex_buffer_create_wined3d_buffer(buffer, FALSE, &buffer->wined3d_buffer)))
{
WARN("Failed to create wined3d vertex buffer, hr %#x.\n", hr);
if (hr == WINED3DERR_INVALIDCALL)
......@@ -608,7 +607,7 @@ HRESULT d3d_vertex_buffer_create(struct d3d_vertex_buffer **vertex_buf,
if (!buffer->wineD3DVertexDeclaration)
{
ERR("Failed to find vertex declaration for fvf %#x.\n", desc->dwFVF);
wined3d_buffer_decref(buffer->wineD3DVertexBuffer);
wined3d_buffer_decref(buffer->wined3d_buffer);
hr = DDERR_INVALIDPARAMS;
goto end;
}
......
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