Commit 4c3dfa1b authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Get rid of the WineDirect3DStridedData typedef.

parent 5c5216e6
......@@ -3865,8 +3865,8 @@ IDirect3DDeviceImpl_7_DrawPrimitiveStrided(IDirect3DDevice7 *iface,
if(VertexType & D3DFVF_POSITION_MASK)
{
WineD3DStrided.position.format = WINED3DFMT_R32G32B32_FLOAT;
WineD3DStrided.position.lpData = D3DDrawPrimStrideData->position.lpvData;
WineD3DStrided.position.dwStride = D3DDrawPrimStrideData->position.dwStride;
WineD3DStrided.position.data = D3DDrawPrimStrideData->position.lpvData;
WineD3DStrided.position.stride = D3DDrawPrimStrideData->position.dwStride;
if (VertexType & D3DFVF_XYZRHW)
{
WineD3DStrided.position.format = WINED3DFMT_R32G32B32A32_FLOAT;
......@@ -3878,22 +3878,22 @@ IDirect3DDeviceImpl_7_DrawPrimitiveStrided(IDirect3DDevice7 *iface,
if(VertexType & D3DFVF_NORMAL)
{
WineD3DStrided.normal.format = WINED3DFMT_R32G32B32_FLOAT;
WineD3DStrided.normal.lpData = D3DDrawPrimStrideData->normal.lpvData;
WineD3DStrided.normal.dwStride = D3DDrawPrimStrideData->normal.dwStride;
WineD3DStrided.normal.data = D3DDrawPrimStrideData->normal.lpvData;
WineD3DStrided.normal.stride = D3DDrawPrimStrideData->normal.dwStride;
}
if(VertexType & D3DFVF_DIFFUSE)
{
WineD3DStrided.diffuse.format = WINED3DFMT_B8G8R8A8_UNORM;
WineD3DStrided.diffuse.lpData = D3DDrawPrimStrideData->diffuse.lpvData;
WineD3DStrided.diffuse.dwStride = D3DDrawPrimStrideData->diffuse.dwStride;
WineD3DStrided.diffuse.data = D3DDrawPrimStrideData->diffuse.lpvData;
WineD3DStrided.diffuse.stride = D3DDrawPrimStrideData->diffuse.dwStride;
}
if(VertexType & D3DFVF_SPECULAR)
{
WineD3DStrided.specular.format = WINED3DFMT_B8G8R8A8_UNORM;
WineD3DStrided.specular.lpData = D3DDrawPrimStrideData->specular.lpvData;
WineD3DStrided.specular.dwStride = D3DDrawPrimStrideData->specular.dwStride;
WineD3DStrided.specular.data = D3DDrawPrimStrideData->specular.lpvData;
WineD3DStrided.specular.stride = D3DDrawPrimStrideData->specular.dwStride;
}
for( i = 0; i < GET_TEXCOUNT_FROM_FVF(VertexType); i++)
......@@ -3907,8 +3907,8 @@ IDirect3DDeviceImpl_7_DrawPrimitiveStrided(IDirect3DDevice7 *iface,
default: ERR("Unexpected texture coordinate size %d\n",
GET_TEXCOORD_SIZE_FROM_FVF(VertexType, i));
}
WineD3DStrided.texCoords[i].lpData = D3DDrawPrimStrideData->textureCoords[i].lpvData;
WineD3DStrided.texCoords[i].dwStride = D3DDrawPrimStrideData->textureCoords[i].dwStride;
WineD3DStrided.texCoords[i].data = D3DDrawPrimStrideData->textureCoords[i].lpvData;
WineD3DStrided.texCoords[i].stride = D3DDrawPrimStrideData->textureCoords[i].dwStride;
}
/* WineD3D doesn't need the FVF here */
......@@ -4007,8 +4007,8 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface,
if(VertexType & D3DFVF_POSITION_MASK)
{
WineD3DStrided.position.format = WINED3DFMT_R32G32B32_FLOAT;
WineD3DStrided.position.lpData = D3DDrawPrimStrideData->position.lpvData;
WineD3DStrided.position.dwStride = D3DDrawPrimStrideData->position.dwStride;
WineD3DStrided.position.data = D3DDrawPrimStrideData->position.lpvData;
WineD3DStrided.position.stride = D3DDrawPrimStrideData->position.dwStride;
if (VertexType & D3DFVF_XYZRHW)
{
WineD3DStrided.position.format = WINED3DFMT_R32G32B32A32_FLOAT;
......@@ -4020,22 +4020,22 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface,
if(VertexType & D3DFVF_NORMAL)
{
WineD3DStrided.normal.format = WINED3DFMT_R32G32B32_FLOAT;
WineD3DStrided.normal.lpData = D3DDrawPrimStrideData->normal.lpvData;
WineD3DStrided.normal.dwStride = D3DDrawPrimStrideData->normal.dwStride;
WineD3DStrided.normal.data = D3DDrawPrimStrideData->normal.lpvData;
WineD3DStrided.normal.stride = D3DDrawPrimStrideData->normal.dwStride;
}
if(VertexType & D3DFVF_DIFFUSE)
{
WineD3DStrided.diffuse.format = WINED3DFMT_B8G8R8A8_UNORM;
WineD3DStrided.diffuse.lpData = D3DDrawPrimStrideData->diffuse.lpvData;
WineD3DStrided.diffuse.dwStride = D3DDrawPrimStrideData->diffuse.dwStride;
WineD3DStrided.diffuse.data = D3DDrawPrimStrideData->diffuse.lpvData;
WineD3DStrided.diffuse.stride = D3DDrawPrimStrideData->diffuse.dwStride;
}
if(VertexType & D3DFVF_SPECULAR)
{
WineD3DStrided.specular.format = WINED3DFMT_B8G8R8A8_UNORM;
WineD3DStrided.specular.lpData = D3DDrawPrimStrideData->specular.lpvData;
WineD3DStrided.specular.dwStride = D3DDrawPrimStrideData->specular.dwStride;
WineD3DStrided.specular.data = D3DDrawPrimStrideData->specular.lpvData;
WineD3DStrided.specular.stride = D3DDrawPrimStrideData->specular.dwStride;
}
for( i = 0; i < GET_TEXCOUNT_FROM_FVF(VertexType); i++)
......@@ -4049,8 +4049,8 @@ IDirect3DDeviceImpl_7_DrawIndexedPrimitiveStrided(IDirect3DDevice7 *iface,
default: ERR("Unexpected texture coordinate size %d\n",
GET_TEXCOORD_SIZE_FROM_FVF(VertexType, i));
}
WineD3DStrided.texCoords[i].lpData = D3DDrawPrimStrideData->textureCoords[i].lpvData;
WineD3DStrided.texCoords[i].dwStride = D3DDrawPrimStrideData->textureCoords[i].dwStride;
WineD3DStrided.texCoords[i].data = D3DDrawPrimStrideData->textureCoords[i].lpvData;
WineD3DStrided.texCoords[i].stride = D3DDrawPrimStrideData->textureCoords[i].dwStride;
}
/* WineD3D doesn't need the FVF here */
......
......@@ -343,12 +343,12 @@ void device_stream_info_from_declaration(struct wined3d_device *device,
}
static void stream_info_element_from_strided(const struct wined3d_gl_info *gl_info,
const struct WineDirect3DStridedData *strided, struct wined3d_stream_info_element *e)
const struct wined3d_strided_element *strided, struct wined3d_stream_info_element *e)
{
e->data.addr = strided->lpData;
e->data.addr = strided->data;
e->data.buffer_object = 0;
e->format = wined3d_get_format(gl_info, strided->format);
e->stride = strided->dwStride;
e->stride = strided->stride;
e->stream_idx = 0;
}
......@@ -359,18 +359,18 @@ static void device_stream_info_from_strided(const struct wined3d_gl_info *gl_inf
memset(stream_info, 0, sizeof(*stream_info));
if (strided->position.lpData)
if (strided->position.data)
stream_info_element_from_strided(gl_info, &strided->position, &stream_info->elements[WINED3D_FFP_POSITION]);
if (strided->normal.lpData)
if (strided->normal.data)
stream_info_element_from_strided(gl_info, &strided->normal, &stream_info->elements[WINED3D_FFP_NORMAL]);
if (strided->diffuse.lpData)
if (strided->diffuse.data)
stream_info_element_from_strided(gl_info, &strided->diffuse, &stream_info->elements[WINED3D_FFP_DIFFUSE]);
if (strided->specular.lpData)
if (strided->specular.data)
stream_info_element_from_strided(gl_info, &strided->specular, &stream_info->elements[WINED3D_FFP_SPECULAR]);
for (i = 0; i < WINED3DDP_MAXTEXCOORD; ++i)
{
if (strided->texCoords[i].lpData)
if (strided->texCoords[i].data)
stream_info_element_from_strided(gl_info, &strided->texCoords[i],
&stream_info->elements[WINED3D_FFP_TEXCOORD0 + i]);
}
......
......@@ -1125,21 +1125,22 @@ HRESULT tesselate_rectpatch(struct wined3d_device *This, struct WineD3DRectPatch
}
memset(&patch->strided, 0, sizeof(patch->strided));
patch->strided.position.format = WINED3DFMT_R32G32B32_FLOAT;
patch->strided.position.lpData = (BYTE *) patch->mem;
patch->strided.position.dwStride = vtxStride;
patch->strided.position.data = (BYTE *)patch->mem;
patch->strided.position.stride = vtxStride;
if(patch->has_normals) {
if (patch->has_normals)
{
patch->strided.normal.format = WINED3DFMT_R32G32B32_FLOAT;
patch->strided.normal.lpData = (BYTE *) patch->mem + 3 * sizeof(float) /* pos */;
patch->strided.normal.dwStride = vtxStride;
patch->strided.normal.data = (BYTE *)patch->mem + 3 * sizeof(float) /* pos */;
patch->strided.normal.stride = vtxStride;
}
if(patch->has_texcoords) {
if (patch->has_texcoords)
{
patch->strided.texCoords[0].format = WINED3DFMT_R32G32B32A32_FLOAT;
patch->strided.texCoords[0].lpData = (BYTE *) patch->mem + 3 * sizeof(float) /* pos */;
if(patch->has_normals) {
patch->strided.texCoords[0].lpData += 3 * sizeof(float);
}
patch->strided.texCoords[0].dwStride = vtxStride;
patch->strided.texCoords[0].data = (BYTE *)patch->mem + 3 * sizeof(float) /* pos */;
if (patch->has_normals)
patch->strided.texCoords[0].data += 3 * sizeof(float);
patch->strided.texCoords[0].stride = vtxStride;
}
return WINED3D_OK;
......
......@@ -1725,20 +1725,20 @@ struct wined3d_box
UINT back;
};
typedef struct WineDirect3DStridedData
struct wined3d_strided_element
{
enum wined3d_format_id format; /* Format of the data */
const BYTE *lpData; /* Pointer to start of data */
DWORD dwStride; /* Stride between occurrences of this data */
} WineDirect3DStridedData;
enum wined3d_format_id format; /* Format of the data */
const BYTE *data; /* Pointer to start of data */
UINT stride; /* Stride between occurrences of this data */
};
typedef struct WineDirect3DVertexStridedData
{
WineDirect3DStridedData position;
WineDirect3DStridedData normal;
WineDirect3DStridedData diffuse;
WineDirect3DStridedData specular;
WineDirect3DStridedData texCoords[WINED3DDP_MAXTEXCOORD];
struct wined3d_strided_element position;
struct wined3d_strided_element normal;
struct wined3d_strided_element diffuse;
struct wined3d_strided_element specular;
struct wined3d_strided_element texCoords[WINED3DDP_MAXTEXCOORD];
BOOL position_transformed;
} WineDirect3DVertexStridedData;
......
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