101 iface->lpVtbl->AddRef(iface);
116 TRACE(
"%p increasing refcount to %u.\n",
mesh, refcount);
126 TRACE(
"%p decreasing refcount to %u.\n",
mesh, refcount);
132 if (
mesh->vertex_declaration)
151 TRACE(
"iface %p, attrib_id %u.\n", iface, attrib_id);
153 if (!
This->vertex_declaration)
155 WARN(
"Can't draw a mesh with an invalid vertex declaration.\n");
159 vertex_size = iface->lpVtbl->GetNumBytesPerVertex(iface);
170 for (face_start = face_end; face_start <
This->numfaces; face_start++)
172 if (
This->attrib_buffer[face_start] == attrib_id)
175 if (face_start >=
This->numfaces)
177 for (face_end = face_start + 1; face_end <
This->numfaces; face_end++)
179 if (
This->attrib_buffer[face_end] != attrib_id)
184 0, 0,
This->numvertices, face_start * 3, face_end - face_start);
195 TRACE(
"iface %p.\n", iface);
197 return mesh->numfaces;
204 TRACE(
"iface %p.\n", iface);
206 return mesh->numvertices;
213 TRACE(
"iface %p.\n", iface);
241 TRACE(
"iface %p.\n", iface);
243 return mesh->vertex_declaration_size;
250 TRACE(
"iface %p.\n", iface);
252 return mesh->options;
270 struct IDirect3DDevice9 *
device,
struct ID3DXMesh **clone_mesh)
275 TRACE(
"iface %p, options %#x, fvf %#x, device %p, clone_mesh %p.\n",
464 FIXME(
"Conversion from D3DDECLTYPE_FLOAT4 to %d not implemented.\n", type_dst);
478 D3DXVECTOR4 src_float4 = {*src_ptr, 0.0f, 0.0f, 1.0f};
485 D3DXVECTOR4 src_float4 = {src_ptr->
x, src_ptr->
y, 0.0f, 1.0f};
492 D3DXVECTOR4 src_float4 = {src_ptr->
x, src_ptr->
y, src_ptr->
z, 1.0f};
499 D3DXVECTOR4 src_float4 = {src_ptr->
x, src_ptr->
y, src_ptr->
z, src_ptr->
w};
524 D3DXVECTOR4 src_float4 = {src_ptr[0], src_ptr[1], 0.0f, 1.0f};
531 D3DXVECTOR4 src_float4 = {src_ptr[0], src_ptr[1], src_ptr[2], src_ptr[3]};
583 FIXME(
"Conversion of D3DDECLTYPE %d to %d not implemented.\n", type_src, type_dst);
612 UINT num_vertices = mesh_src->lpVtbl->GetNumVertices(mesh_src);
613 UINT dst_vertex_size = mesh_dst->lpVtbl->GetNumBytesPerVertex(mesh_dst);
614 UINT src_vertex_size = mesh_src->lpVtbl->GetNumBytesPerVertex(mesh_src);
616 hr = mesh_src->lpVtbl->GetDeclaration(mesh_src, orig_declaration);
618 hr = mesh_dst->lpVtbl->GetDeclaration(mesh_dst,
declaration);
623 hr = mesh_dst->lpVtbl->LockVertexBuffer(mesh_dst, 0, (
void**)&vb_dst);
627 memset(vb_dst, 0, num_vertices * dst_vertex_size);
629 for (
i = 0; orig_declaration[
i].
Stream != 0xff;
i++)
636 for (
j = 0;
j < num_vertices;
j++)
639 UINT idx_src = src_vertex_size *
j + orig_declaration[
i].
Offset;
643 memcpy(&vb_dst[idx_dst], &vb_src[idx_src], type_size);
652 if (vb_dst) mesh_dst->lpVtbl->UnlockVertexBuffer(mesh_dst);
653 if (vb_src) mesh_src->lpVtbl->UnlockVertexBuffer(mesh_src);
660 UINT size1 = 0, size2 = 0;
663 while (declaration1[size1].
Stream != 0xff) size1++;
664 while (declaration2[size2].
Stream != 0xff) size2++;
671 if (
memcmp(declaration1, declaration2, size1*
sizeof(*declaration1)) == 0)
682 ID3DXMesh *clone_mesh;
684 void *data_in, *data_out;
687 BOOL same_declaration;
689 TRACE(
"iface %p, options %#x, declaration %p, device %p, clone_mesh_out %p.\n",
695 hr = iface->lpVtbl->GetDeclaration(iface, orig_declaration);
703 vertex_size = clone_mesh->lpVtbl->GetNumBytesPerVertex(clone_mesh);
707 if (!same_declaration) {
715 }
else if (same_declaration) {
718 hr = clone_mesh->lpVtbl->LockVertexBuffer(clone_mesh, 0, &data_out);
720 iface->lpVtbl->UnlockVertexBuffer(iface);
723 memcpy(data_out, data_in,
This->numvertices * vertex_size);
724 clone_mesh->lpVtbl->UnlockVertexBuffer(clone_mesh);
725 iface->lpVtbl->UnlockVertexBuffer(iface);
733 hr = clone_mesh->lpVtbl->LockIndexBuffer(clone_mesh, 0, &data_out);
735 iface->lpVtbl->UnlockIndexBuffer(iface);
741 for (
i = 0;
i <
This->numfaces * 3;
i++)
744 for (
i = 0;
i <
This->numfaces * 3;
i++)
750 clone_mesh->lpVtbl->UnlockIndexBuffer(clone_mesh);
751 iface->lpVtbl->UnlockIndexBuffer(iface);
755 if (
This->attrib_table_size)
766 *clone_mesh_out = clone_mesh;
770 IUnknown_Release(clone_mesh);
817 TRACE(
"iface %p.\n", iface);
835 TRACE(
"iface %p.\n", iface);
847 TRACE(
"iface %p, attrib_table %p, attrib_table_size %p.\n",
896 for (
i = 0;
i < 3 * num_faces;
i++)
903 for (edge = 0; edge < 3; edge++)
929 if (edge_face_ptr->
v2 == vertex1)
930 return edge_face_ptr->
face;
938 DWORD *id_point_reps;
945 for (
i = 0;
i < num_vertices;
i++)
947 id_point_reps[
i] =
i;
950 return id_point_reps;
957 DWORD num_faces = iface->lpVtbl->GetNumFaces(iface);
958 DWORD num_vertices = iface->lpVtbl->GetNumVertices(iface);
969 TRACE(
"iface %p, point_reps %p, adjacency %p.\n", iface, point_reps, adjacency);
982 point_reps_ptr = id_point_reps;
986 point_reps_ptr = point_reps;
992 if (indices_are_16_bit)
996 WORD *ib_16bit = ib_ptr;
1003 for (
i = 0;
i < 3 * num_faces;
i++)
1005 ib[
i] = ib_16bit[
i];
1019 for (edge = 0; edge < 3; edge++)
1023 DWORD new_v1 = point_reps_ptr[
v1];
1024 DWORD new_v2 = point_reps_ptr[
v2];
1028 adjacency[3*
face + edge] = adj_face;
1038 if(ib_ptr) iface->lpVtbl->UnlockIndexBuffer(iface);
1057 const unsigned int VERTS_PER_FACE = 3;
1058 DWORD edge, opp_edge;
1059 DWORD face_base = VERTS_PER_FACE *
face;
1061 for (edge = 0; edge < VERTS_PER_FACE; edge++)
1063 DWORD adj_face = adjacency[face_base + edge];
1064 DWORD adj_face_base;
1068 else if (adj_face >= numfaces)
1071 WARN(
"Index out of bounds. Got %d expected less than %d.\n",
1072 adj_face, numfaces);
1075 adj_face_base = 3 * adj_face;
1078 for (opp_edge = 0; opp_edge < VERTS_PER_FACE; opp_edge++)
1080 DWORD opp_edge_index = adj_face_base + opp_edge;
1081 if (adjacency[opp_edge_index] ==
face)
1086 for (
i = 0;
i < 2;
i++)
1088 DWORD from = face_base + (edge + (1 -
i)) % VERTS_PER_FACE;
1089 DWORD to = adj_face_base + (opp_edge +
i) % VERTS_PER_FACE;
1092 if (new_indices[to] > new_indices[
from])
1094 new_indices[to] = new_indices[
from];
1113 const unsigned int VERTS_PER_FACE = 3;
1115 TRACE(
"iface %p, adjacency %p, point_reps %p.\n", iface, adjacency, point_reps);
1119 WARN(
"NULL adjacency.\n");
1126 WARN(
"NULL point_reps.\n");
1132 if (
This->numfaces == 0)
1134 ERR(
"Number of faces was zero.\n");
1156 hr = iface->lpVtbl->LockIndexBuffer(iface,
D3DLOCK_READONLY, (
void**)&indices_16bit);
1164 for (
i = 0;
i < VERTS_PER_FACE *
This->numfaces;
i++)
1166 new_indices[
i] = indices_16bit[
i];
1172 for (
i = 0;
i <
This->numvertices;
i++)
1198 if (
indices) iface->lpVtbl->UnlockIndexBuffer(iface);
1202 if (indices_16bit) iface->lpVtbl->UnlockIndexBuffer(iface);
1237 const FLOAT epsilon_sq = epsilon * epsilon;
1240 TRACE(
"iface %p, epsilon %.8e, adjacency %p.\n", iface, epsilon, adjacency);
1245 buffer_size =
This->numfaces * 3 *
sizeof(*shared_indices) +
This->numvertices *
sizeof(*sorted_vertices);
1249 if (!shared_indices)
1260 DWORD *dword_indices = (
DWORD*)(sorted_vertices +
This->numvertices);
1262 for (
i = 0;
i <
This->numfaces * 3;
i++)
1263 *dword_indices++ = *word_indices++;
1266 vertex_size = iface->lpVtbl->GetNumBytesPerVertex(iface);
1267 for (
i = 0;
i <
This->numvertices;
i++) {
1273 for (
i = 0;
i <
This->numfaces * 3;
i++) {
1281 for (
i = 0;
i <
This->numvertices;
i++) {
1286 while (shared_index_a != -1) {
1288 DWORD shared_index_b = shared_indices[shared_index_a];
1292 while (shared_index_b != -1) {
1294 DWORD base_a = (shared_index_a / 3) * 3;
1295 DWORD base_b = (shared_index_b / 3) * 3;
1299 for (
k = 0;
k < 3;
k++) {
1300 if (adjacency[base_b +
k] == shared_index_a / 3) {
1306 for (
k = 1;
k <= 2;
k++) {
1307 DWORD vertex_index_a = base_a + (shared_index_a +
k) % 3;
1308 DWORD vertex_index_b = base_b + (shared_index_b + (3 -
k)) % 3;
1310 if (!adjacent && epsilon >= 0.0f) {
1314 D3DXVec3Subtract(&delta,
1317 length_sq = D3DXVec3LengthSq(&delta);
1318 adjacent = epsilon == 0.0f ? length_sq == 0.0f : length_sq < epsilon_sq;
1321 DWORD adj_a = base_a + 2 - (vertex_index_a + shared_index_a + 1) % 3;
1322 DWORD adj_b = base_b + 2 - (vertex_index_b + shared_index_b + 1) % 3;
1323 if (adjacency[adj_a] == -1 && adjacency[adj_b] == -1) {
1324 adjacency[adj_a] = base_b / 3;
1325 adjacency[adj_b] = base_a / 3;
1332 shared_index_b = shared_indices[shared_index_b];
1334 while (++j < This->numvertices) {
1338 if (sorted_vertex_b->
key - sorted_vertex_a->
key > epsilon * 3.0f) {
1340 j =
This->numvertices;
1345 if (
fabsf(vertex_a->
x - vertex_b->
x) <= epsilon &&
1346 fabsf(vertex_a->
y - vertex_b->
y) <= epsilon &&
1347 fabsf(vertex_a->
z - vertex_b->
z) <= epsilon)
1352 if (
j >=
This->numvertices)
1364 if (
indices) iface->lpVtbl->UnlockIndexBuffer(iface);
1365 if (vertices) iface->lpVtbl->UnlockVertexBuffer(iface);
1381 WARN(
"Invalid declaration. Can't use NULL declaration.\n");
1389 WARN(
"Invalid declaration. New vertex size does not match the original vertex size.\n");
1398 WARN(
"Invalid declaration. New declaration contains non-zero Stream value.\n");
1403 This->num_elem =
i + 1;
1406 if (
This->vertex_declaration)
1419 &
This->vertex_declaration);
1422 WARN(
"Using invalid declaration. Calls to DrawSubset will fail.\n");
1440 mesh->attrib_table_size = 0;
1455 TRACE(
"iface %p.\n", iface);
1473 ID3DXMesh *optimized_mesh;
1475 TRACE(
"iface %p, flags %#x, adjacency_in %p, adjacency_out %p, face_remap %p, vertex_remap %p, opt_mesh %p.\n",
1476 iface,
flags, adjacency_in, adjacency_out, face_remap, vertex_remap, opt_mesh);
1487 hr = optimized_mesh->lpVtbl->OptimizeInplace(optimized_mesh,
flags, adjacency_in, adjacency_out, face_remap, vertex_remap);
1489 *opt_mesh = optimized_mesh;
1491 IUnknown_Release(optimized_mesh);
1501 DWORD *vertex_remap_ptr;
1502 DWORD num_used_vertices;
1509 for (
i = 0;
i <
This->numfaces * 3;
i++)
1513 num_used_vertices = 0;
1514 for (
i = 0;
i <
This->numvertices;
i++) {
1515 if (vertex_remap_ptr[
i])
1516 vertex_remap_ptr[
i] = num_used_vertices++;
1518 vertex_remap_ptr[
i] = -1;
1521 for (
i = 0;
i <
This->numfaces * 3;
i++)
1525 num_used_vertices = 0;
1526 for (
i = 0;
i <
This->numvertices;
i++) {
1527 if (vertex_remap_ptr[
i] != -1)
1528 vertex_remap_ptr[num_used_vertices++] =
i;
1530 for (
i = num_used_vertices;
i <
This->numvertices;
i++)
1531 vertex_remap_ptr[
i] = -1;
1533 *new_num_vertices = num_used_vertices;
1558 DWORD min_vertex, max_vertex;
1563 min_vertex = (
DWORD)-1;
1576 min_vertex = (
DWORD)-1;
1579 for (
j = 0;
j < 3;
j++) {
1597 int delta = *ptr_a - *ptr_b;
1602 delta = ptr_a - ptr_b;
1610 DWORD **sorted_attrib_ptr_buffer =
NULL;
1614 if (!sorted_attrib_ptr_buffer)
1624 for (
i = 0;
i <
This->numfaces;
i++)
1628 for (
i = 0;
i <
This->numfaces;
i++)
1631 (*face_remap)[old_face] =
i;
1635 *sorted_attrib_buffer = (
DWORD*)sorted_attrib_ptr_buffer;
1636 for (
i = 0;
i <
This->numfaces;
i++)
1652 DWORD new_num_vertices = 0;
1653 DWORD new_num_alloc_vertices = 0;
1658 TRACE(
"iface %p, flags %#x, adjacency_in %p, adjacency_out %p, face_remap_out %p, vertex_remap_out %p.\n",
1659 iface,
flags, adjacency_in, adjacency_out, face_remap_out, vertex_remap_out);
1671 FIXME(
"D3DXMESHOPT_VERTEXCACHE not implemented.\n");
1673 FIXME(
"D3DXMESHOPT_STRIPREORDER not implemented.\n");
1677 hr = iface->lpVtbl->LockIndexBuffer(iface, 0, &
indices);
1686 for (
i = 0;
i <
This->numfaces * 3;
i++)
1687 dword_indices[
i] = *word_indices++;
1692 new_num_alloc_vertices =
This->numvertices;
1697 FIXME(
"D3DXMESHOPT_ATTRSORT vertex reordering not implemented.\n");
1711 DWORD vertex_size = iface->lpVtbl->GetNumBytesPerVertex(iface);
1712 BYTE *orig_vertices;
1731 for (
i = 0;
i < new_num_vertices;
i++)
1732 memcpy(new_vertices +
i * vertex_size, orig_vertices + vertex_remap_ptr[
i] * vertex_size, vertex_size);
1736 }
else if (vertex_remap_out) {
1737 DWORD *vertex_remap_ptr;
1742 for (
i = 0;
i <
This->numvertices;
i++)
1743 *vertex_remap_ptr++ =
i;
1762 for (
i = 0;
i <
This->numfaces;
i++)
1766 for (
i = 0;
i <
This->numfaces;
i++) {
1767 DWORD new_pos = face_remap[
i] * 3;
1769 word_indices[new_pos++] = dword_indices[old_pos++];
1770 word_indices[new_pos++] = dword_indices[old_pos++];
1771 word_indices[new_pos] = dword_indices[old_pos];
1786 for (
i = 0;
i <
This->numfaces * 3;
i++)
1787 *word_indices++ = dword_indices[
i];
1791 if (adjacency_out) {
1793 for (
i = 0;
i <
This->numfaces;
i++) {
1795 DWORD new_pos = face_remap[
i] * 3;
1796 adjacency_out[new_pos++] = face_remap[adjacency_in[old_pos++]];
1797 adjacency_out[new_pos++] = face_remap[adjacency_in[old_pos++]];
1798 adjacency_out[new_pos++] = face_remap[adjacency_in[old_pos++]];
1801 memcpy(adjacency_out, adjacency_in,
This->numfaces * 3 *
sizeof(*adjacency_out));
1804 if (face_remap_out) {
1806 for (
i = 0;
i <
This->numfaces;
i++)
1807 face_remap_out[face_remap[
i]] =
i;
1809 for (
i = 0;
i <
This->numfaces;
i++)
1810 face_remap_out[
i] =
i;
1813 if (vertex_remap_out)
1814 *vertex_remap_out = vertex_remap;
1815 vertex_remap =
NULL;
1821 This->numvertices = new_num_vertices;
1831 if (
attrib_buffer) iface->lpVtbl->UnlockAttributeBuffer(iface);
1832 if (
indices) iface->lpVtbl->UnlockIndexBuffer(iface);
1856 mesh->attrib_table = new_table;
1914 FLOAT div, tmin, tmax, tymin, tymax, tzmin, tzmax;
1916 div = 1.0f / praydirection->
x;
1919 tmin = ( pmin->
x - prayposition->
x ) *
div;
1920 tmax = ( pmax->
x - prayposition->
x ) *
div;
1924 tmin = ( pmax->
x - prayposition->
x ) *
div;
1925 tmax = ( pmin->
x - prayposition->
x ) *
div;
1928 if ( tmax < 0.0f )
return FALSE;
1930 div = 1.0f / praydirection->
y;
1933 tymin = ( pmin->
y - prayposition->
y ) *
div;
1934 tymax = ( pmax->
y - prayposition->
y ) *
div;
1938 tymin = ( pmax->
y - prayposition->
y ) *
div;
1939 tymax = ( pmin->
y - prayposition->
y ) *
div;
1942 if ( ( tymax < 0.0f ) || ( tmin > tymax ) || ( tymin > tmax ) )
return FALSE;
1944 if ( tymin > tmin ) tmin = tymin;
1945 if ( tymax < tmax ) tmax = tymax;
1947 div = 1.0f / praydirection->
z;
1950 tzmin = ( pmin->
z - prayposition->
z ) *
div;
1951 tzmax = ( pmax->
z - prayposition->
z ) *
div;
1955 tzmin = ( pmax->
z - prayposition->
z ) *
div;
1956 tzmax = ( pmin->
z - prayposition->
z ) *
div;
1959 if ( (tzmax < 0.0f ) || ( tmin > tzmax ) || ( tzmin > tmax ) )
return FALSE;
1972 *pmin = *pfirstposition;
1975 for(
i=0;
i<numvertices;
i++)
1977 vec = *( (
const D3DXVECTOR3*)((
const char*)pfirstposition + dwstride *
i) );
1985 if (
vec.z < pmin->
z ) pmin->
z =
vec.z;
1986 if (
vec.z > pmax->
z ) pmax->
z =
vec.z;
2006 for(
i=0;
i<numvertices;
i++)
2009 D3DXVec3Scale(pcenter, &
temp, 1.0f / numvertices);
2011 for(
i=0;
i<numvertices;
i++)
2013 d = D3DXVec3Length(D3DXVec3Subtract(&
temp, (
const D3DXVECTOR3*)((
const char*)pfirstposition + dwstride *
i), pcenter));
2014 if (
d > *pradius ) *pradius =
d;
2041 unsigned int idx = 0;
2054 if (has_blend_idx) --blend_count;
2057 || (has_blend && blend_count > 4))
2067 switch (blend_count)
2084 ERR(
"Invalid blend count %u.\n", blend_count);
2107 for (
i = 0;
i < tex_count; ++
i)
2109 switch ((fvf >> (16 + 2 *
i)) & 0x03)
2286 return (((((FVF) >> (16 + (2 * (tex_num)))) + 1) & 0x03) + 1);
2312 for (
i = 0;
i < numTextures;
i++)
2328 TRACE(
"decl %p, stream_idx %u\n", decl, stream_idx);
2330 if (!decl)
return 0;
2336 if (
element->Stream != stream_idx)
continue;
2340 FIXME(
"Unhandled element type %#x, size will be incorrect.\n",
element->Type);
2358 TRACE(
"decl %p\n", decl);
2373 TRACE(
"p0 %p, p1 %p, p2 %p, praypos %p, praydir %p, pu %p, pv %p, pdist %p.\n",
2374 p0, p1, p2, praypos, praydir, pu, pv, pdist);
2376 m.u.m[0][0] = p1->
x - p0->
x;
2377 m.u.m[1][0] = p2->
x - p0->
x;
2378 m.u.m[2][0] = -praydir->
x;
2380 m.u.m[0][1] = p1->
y - p0->
y;
2381 m.u.m[1][1] = p2->
y - p0->
y;
2382 m.u.m[2][1] = -praydir->
y;
2384 m.u.m[0][2] = p1->
z - p0->
z;
2385 m.u.m[1][2] = p2->
z - p0->
z;
2386 m.u.m[2][2] = -praydir->
z;
2393 vec.
x = praypos->
x - p0->
x;
2394 vec.
y = praypos->
y - p0->
y;
2395 vec.z = praypos->
z - p0->
z;
2403 if (pu) *pu =
vec.
x;
2404 if (pv) *pv =
vec.
y;
2405 if (pdist) *pdist =
fabsf(
vec.z );
2419 D3DXVec3Subtract(&difference, ray_position, center);
2420 c = D3DXVec3LengthSq(&difference) - radius * radius;
2423 a = D3DXVec3LengthSq(ray_direction);
2424 b = D3DXVec3Dot(&difference, ray_direction);
2427 return d >= 0.0f && (
b <= 0.0f ||
d >
b *
b);
2438 IDirect3DVertexDeclaration9 *vertex_declaration;
2439 UINT vertex_declaration_size;
2442 IDirect3DIndexBuffer9 *index_buffer;
2443 DWORD *attrib_buffer;
2445 DWORD index_usage = 0;
2448 DWORD vertex_usage = 0;
2452 TRACE(
"numfaces %u, numvertices %u, options %#x, declaration %p, device %p, mesh %p.\n",
2522 WARN(
"Unexpected return value %x from IDirect3DDevice9_CreateVertexDeclaration.\n",
hr);
2537 WARN(
"Unexpected return value %x from IDirect3DDevice9_CreateVertexBuffer.\n",
hr);
2552 WARN(
"Unexpected return value %x from IDirect3DDevice9_CreateVertexBuffer.\n",
hr);
2588 *
mesh = &
object->ID3DXMesh_iface;
2602 TRACE(
"(%u, %u, %u, %u, %p, %p)\n",
numfaces,
numvertices,
options,
fvf,
device,
mesh);
2653 *filename_out =
NULL;
2655 hr = filedata->lpVtbl->Lock(filedata, &data_size, (
const void**)&
data);
2659 if (data_size <
sizeof(filename_in))
2661 WARN(
"truncated data (%lu bytes)\n", data_size);
2662 filedata->lpVtbl->Unlock(filedata);
2665 filename_in = *(
char **)
data;
2669 filedata->lpVtbl->Unlock(filedata);
2676 filedata->lpVtbl->Unlock(filedata);
2687 ID3DXFileData *
child;
2692 hr = filedata->lpVtbl->Lock(filedata, &data_size, (
const void**)&
data);
2715 if (data_size !=
sizeof(
FLOAT) * 11) {
2716 WARN(
"incorrect data size (%ld bytes)\n", data_size);
2717 filedata->lpVtbl->Unlock(filedata);
2735 filedata->lpVtbl->Unlock(filedata);
2737 hr = filedata->lpVtbl->GetChildren(filedata, &nb_children);
2741 for (
i = 0;
i < nb_children;
i++)
2743 hr = filedata->lpVtbl->GetChild(filedata,
i, &
child);
2755 IUnknown_Release(
child);
2760 IUnknown_Release(
child);
2767 for (
i = 0;
i <
mesh->num_materials;
i++)
2771 mesh->num_materials = 0;
2783 DWORD num_materials;
2789 hr = filedata->lpVtbl->Lock(filedata, &data_size, (
const void**)&
data);
2803 if (data_size <
sizeof(
DWORD)) {
2804 WARN(
"truncated data (%ld bytes)\n", data_size);
2807 num_materials = *in_ptr++;
2808 if (!num_materials) {
2813 if (data_size < 2 *
sizeof(
DWORD)) {
2814 WARN(
"truncated data (%ld bytes)\n", data_size);
2817 if (*in_ptr++ !=
mesh->num_poly_faces) {
2818 WARN(
"number of material face indices (%u) doesn't match number of faces (%u)\n",
2819 *(in_ptr - 1),
mesh->num_poly_faces);
2822 if (data_size < 2 *
sizeof(
DWORD) +
mesh->num_poly_faces *
sizeof(
DWORD)) {
2823 WARN(
"truncated data (%ld bytes)\n", data_size);
2826 for (
i = 0;
i <
mesh->num_poly_faces;
i++) {
2827 if (*in_ptr++ >= num_materials) {
2828 WARN(
"face %u: reference to undefined material %u (only %u materials)\n",
2829 i, *(in_ptr - 1), num_materials);
2836 if (!
mesh->materials || !
mesh->material_indices) {
2842 hr = filedata->lpVtbl->GetChildren(filedata, &nb_children);
2846 for (
i = 0;
i < nb_children;
i++)
2848 hr = filedata->lpVtbl->GetChild(filedata,
i, &
child);
2856 if (
mesh->num_materials >= num_materials) {
2857 WARN(
"more materials defined than declared\n");
2866 IUnknown_Release(
child);
2869 if (num_materials !=
mesh->num_materials) {
2870 WARN(
"only %u of %u materials defined\n", num_materials,
mesh->num_materials);
2876 IUnknown_Release(
child);
2877 filedata->lpVtbl->Unlock(filedata);
2890 hr = filedata->lpVtbl->Lock(filedata, &data_size, (
const void**)&
data);
2905 if (data_size <
sizeof(
DWORD)) {
2906 WARN(
"truncated data (%ld bytes)\n", data_size);
2910 WARN(
"number of texture coordinates (%u) doesn't match number of vertices (%u)\n",
2915 if (data_size <
sizeof(
DWORD) +
mesh->num_vertices *
sizeof(*
mesh->tex_coords)) {
2916 WARN(
"truncated data (%ld bytes)\n", data_size);
2921 if (!
mesh->tex_coords) {
2932 filedata->lpVtbl->Unlock(filedata);
2947 hr = filedata->lpVtbl->Lock(filedata, &data_size, (
const void**)&
data);
2962 if (data_size <
sizeof(
DWORD)) {
2963 WARN(
"truncated data (%ld bytes)\n", data_size);
2969 WARN(
"truncated data (%ld bytes)\n", data_size);
2974 if (!
mesh->vertex_colors) {
2979 for (
i = 0;
i <
mesh->num_vertices;
i++)
2981 for (
i = 0;
i < num_colors;
i++)
2987 WARN(
"vertex color %u references undefined vertex %u (only %u vertices)\n",
3008 filedata->lpVtbl->Unlock(filedata);
3017 DWORD *index_out_ptr;
3019 DWORD num_face_indices =
mesh->num_poly_faces * 2 +
mesh->num_tri_faces;
3022 mesh->num_normals = 0;
3027 hr = filedata->lpVtbl->Lock(filedata, &data_size, (
const void**)&
data);
3049 if (data_size <
sizeof(
DWORD) * 2) {
3050 WARN(
"truncated data (%ld bytes)\n", data_size);
3056 num_face_indices *
sizeof(
DWORD)) {
3057 WARN(
"truncated data (%ld bytes)\n", data_size);
3063 if (!
mesh->normals || !
mesh->normal_indices) {
3070 for (
i = 0;
i <
mesh->num_normals;
i++)
3074 WARN(
"number of face normals (%u) doesn't match number of faces (%u)\n",
3079 index_out_ptr =
mesh->normal_indices;
3080 for (
i = 0;
i <
mesh->num_poly_faces;
i++)
3084 if (
count !=
mesh->num_tri_per_face[
i] + 2) {
3085 WARN(
"face %u: number of normals (%u) doesn't match number of vertices (%u)\n",
3093 if (normal_index >=
mesh->num_normals) {
3094 WARN(
"face %u, normal index %u: reference to undefined normal %u (only %u normals)\n",
3095 i,
j, normal_index,
mesh->num_normals);
3098 *index_out_ptr++ = normal_index;
3106 filedata->lpVtbl->Unlock(filedata);
3118 hr = filedata->lpVtbl->Lock(filedata, &data_size, (
const void**)&
data);
3124 if (data_size <
sizeof(
WORD) * 3) {
3125 WARN(
"truncated data (%ld bytes)\n", data_size);
3134 DWORD nb_influences;
3138 data +=
sizeof(
char*);
3143 if (data_size < (
sizeof(
char*) +
sizeof(
DWORD) + nb_influences * (
sizeof(
DWORD) +
sizeof(
FLOAT)) + 16 *
sizeof(
FLOAT))) {
3144 WARN(
"truncated data (%ld bytes)\n", data_size);
3158 filedata->lpVtbl->Unlock(filedata);
3163#define PROVIDE_MATERIALS 0x1
3164#define PROVIDE_SKININFO 0x2
3165#define PROVIDE_ADJACENCY 0x4
3172 DWORD *index_out_ptr;
3177 DWORD nb_skin_weights_info = 0;
3189 hr = filedata->lpVtbl->Lock(filedata, &data_size, (
const void**)&
data);
3195 if (data_size <
sizeof(
DWORD) * 2) {
3196 WARN(
"truncated data (%ld bytes)\n", data_size);
3201 WARN(
"truncated data (%ld bytes)\n", data_size);
3207 in_ptr +=
sizeof(
DWORD);
3212 DWORD num_poly_vertices;
3215 if (data_size - (in_ptr -
data) <
sizeof(
DWORD)) {
3216 WARN(
"truncated data (%ld bytes)\n", data_size);
3219 num_poly_vertices = *(
DWORD*)in_ptr;
3220 in_ptr +=
sizeof(
DWORD);
3221 if (data_size - (in_ptr -
data) < num_poly_vertices *
sizeof(
DWORD)) {
3222 WARN(
"truncated data (%ld bytes)\n", data_size);
3225 if (num_poly_vertices < 3) {
3226 WARN(
"face %u has only %u vertices\n",
i, num_poly_vertices);
3229 for (
j = 0;
j < num_poly_vertices;
j++) {
3231 WARN(
"face %u, index %u: undefined vertex %u (only %u vertices)\n",
3235 in_ptr +=
sizeof(
DWORD);
3263 in_ptr +=
sizeof(
DWORD);
3267 *index_out_ptr++ = *(
DWORD*)in_ptr;
3268 in_ptr +=
sizeof(
DWORD);
3272 hr = filedata->lpVtbl->GetChildren(filedata, &nb_children);
3276 for (
i = 0;
i < nb_children;
i++)
3278 hr = filedata->lpVtbl->GetChild(filedata,
i, &
child);
3298 WARN(
"Skin mesh header already encountered\n");
3307 WARN(
"Skin weights found but skin mesh header not encountered yet\n");
3314 nb_skin_weights_info++;
3320 IUnknown_Release(
child);
3325 WARN(
"Mismatch between nb skin weights info %u encountered and nb bones %u from skin mesh header\n",
3342 IUnknown_Release(
child);
3343 filedata->lpVtbl->Unlock(filedata);
3354 static const struct {
3355 const char *param_name;
3359 } material_effects[] = {
3360#define EFFECT_TABLE_ENTRY(str, field) \
3361 {str, sizeof(str), sizeof(material_ptr->MatD3D.field), offsetof(D3DXMATERIAL, MatD3D.field)}
3367#undef EFFECT_TABLE_ENTRY
3369 static const char texture_paramname[] =
"Texture0@Name";
3393 for (
i = 0;
i < num_materials;
i++) {
3394 if (material_ptr[
i].pTextureFilename) {
3404 out_ptr = (
BYTE*)(effect_ptr + num_materials);
3406 for (
i = 0;
i < num_materials;
i++)
3417 defaults->pParamName = (
char *)out_ptr;
3421 defaults->NumBytes = material_effects[
j].num_bytes;
3429 defaults->pParamName = (
char *)out_ptr;
3447 struct ID3DXBuffer **effects_out,
DWORD *num_materials_out,
struct ID3DXSkinInfo **skin_info_out,
3448 struct ID3DXMesh **mesh_out)
3451 DWORD *index_in_ptr;
3453 DWORD total_vertices;
3454 ID3DXMesh *d3dxmesh =
NULL;
3458 struct vertex_duplication {
3461 } *duplications =
NULL;
3463 void *vertices =
NULL;
3466 DWORD provide_flags = 0;
3468 TRACE(
"(%p, %x, %p, %p, %p, %p, %p, %p, %p)\n", filedata,
options,
device, adjacency_out, materials_out,
3469 effects_out, num_materials_out, skin_info_out, mesh_out);
3473 if (num_materials_out || materials_out || effects_out)
3486 if (!duplications) {
3490 for (
i = 0;
i < total_vertices;
i++)
3492 duplications[
i].normal_index = -1;
3495 for (
i = 0;
i < num_face_indices;
i++) {
3498 struct vertex_duplication *dup_ptr = &duplications[
vertex_index];
3500 if (dup_ptr->normal_index == -1) {
3501 dup_ptr->normal_index = normal_index;
3504 struct list *dup_list = &dup_ptr->entry;
3507 if (new_normal->
x == cur_normal->
x &&
3508 new_normal->
y == cur_normal->
y &&
3509 new_normal->
z == cur_normal->
z)
3513 }
else if (!
list_next(dup_list, &dup_ptr->entry)) {
3514 dup_ptr = &duplications[total_vertices++];
3515 dup_ptr->normal_index = normal_index;
3521 struct vertex_duplication,
entry);
3531 hr = d3dxmesh->lpVtbl->LockVertexBuffer(d3dxmesh, 0, &vertices);
3539 if (duplications[
i].normal_index == -1)
3547 out_ptr +=
sizeof(
DWORD);
3558 struct vertex_duplication *dup_ptr;
3561 int j = dup_ptr - duplications;
3562 BYTE *dest_vertex = (
BYTE*)vertices +
j * vertex_size;
3564 memcpy(dest_vertex, out_ptr, vertex_size);
3568 out_ptr += vertex_size;
3571 d3dxmesh->lpVtbl->UnlockVertexBuffer(d3dxmesh);
3573 hr = d3dxmesh->lpVtbl->LockIndexBuffer(d3dxmesh, 0, &
indices);
3577#define FILL_INDEX_BUFFER(indices_var) \
3578 for (i = 0; i < mesh_data.num_poly_faces; i++) \
3580 DWORD count = mesh_data.num_tri_per_face[i]; \
3581 WORD first_index = *index_in_ptr++; \
3583 *indices_var++ = first_index; \
3584 *indices_var++ = *index_in_ptr; \
3586 *indices_var++ = *index_in_ptr; \
3597#undef FILL_INDEX_BUFFER
3598 d3dxmesh->lpVtbl->UnlockIndexBuffer(d3dxmesh);
3602 hr = d3dxmesh->lpVtbl->LockAttributeBuffer(d3dxmesh, 0, &attrib_buffer);
3610 d3dxmesh->lpVtbl->UnlockAttributeBuffer(d3dxmesh);
3612 hr = d3dxmesh->lpVtbl->OptimizeInplace(d3dxmesh,
3620 char *strings_out_ptr;
3635 if (materials_ptr[
i].pTextureFilename) {
3647 if (!materials_out) {
3653 if (adjacency_out) {
3660 *mesh_out = d3dxmesh;
3661 if (adjacency_out) *adjacency_out = adjacency;
3663 if (materials_out) *materials_out = materials;
3664 if (effects_out) *effects_out = effects;
3670 if (d3dxmesh) IUnknown_Release(d3dxmesh);
3675 if (skin_info_out) *skin_info_out =
NULL;
3690 struct ID3DXAllocateHierarchy *
alloc_hier,
struct ID3DXLoadUserData *load_user_data,
3691 D3DXFRAME **frame_hierarchy,
struct ID3DXAnimationController **anim_controller)
3697 TRACE(
"filename %s, options %#x, device %p, alloc_hier %p, "
3698 "load_user_data %p, frame_hierarchy %p, anim_controller %p.\n",
3700 load_user_data, frame_hierarchy, anim_controller);
3711 alloc_hier, load_user_data, frame_hierarchy, anim_controller);
3718 struct ID3DXAllocateHierarchy *
alloc_hier,
struct ID3DXLoadUserData *load_user_data,
3719 D3DXFRAME **frame_hierarchy,
struct ID3DXAnimationController **anim_controller)
3725 TRACE(
"filename %s, options %#x, device %p, alloc_hier %p, "
3726 "load_user_data %p, frame_hierarchy %p, anim_controller %p.\n",
3728 load_user_data, frame_hierarchy, anim_controller);
3738 alloc_hier, load_user_data, frame_hierarchy, anim_controller);
3750 hr = filedata->lpVtbl->GetName(filedata,
NULL, &name_len);
3758 hr = filedata->lpVtbl->GetName(filedata, *
name, &name_len);
3774 ID3DXSkinInfo *skin_info =
NULL;
3776 DWORD num_materials = 0;
3783 &adjacency, &materials, &effects, &num_materials,
3801 if (skin_info) IUnknown_Release(skin_info);
3821 hr = filedata->lpVtbl->Lock(filedata, &data_size, (
const void**)&
data);
3825 WARN(
"incorrect data size (%ld bytes)\n", data_size);
3826 filedata->lpVtbl->Unlock(filedata);
3832 filedata->lpVtbl->Unlock(filedata);
3841 ID3DXFileData *
child;
3860 hr = filedata->lpVtbl->GetChildren(filedata, &nb_children);
3864 for (
i = 0;
i < nb_children;
i++)
3866 hr = filedata->lpVtbl->GetChild(filedata,
i, &
child);
3887 IUnknown_Release(
child);
3892 IUnknown_Release(
child);
3897 struct IDirect3DDevice9 *
device,
struct ID3DXAllocateHierarchy *
alloc_hier,
3898 struct ID3DXLoadUserData *load_user_data,
D3DXFRAME **frame_hierarchy,
3899 struct ID3DXAnimationController **anim_controller)
3902 ID3DXFile *d3dxfile =
NULL;
3903 ID3DXFileEnumObject *enumobj =
NULL;
3904 ID3DXFileData *filedata =
NULL;
3911 TRACE(
"(%p, %u, %x, %p, %p, %p, %p, %p)\n",
memory, memory_size,
options,
3918 FIXME(
"Loading user data not implemented.\n");
3929 source.dSize = memory_size;
3933 hr = enumobj->lpVtbl->GetChildren(enumobj, &nb_children);
3937 for (
i = 0;
i < nb_children;
i++)
3939 hr = enumobj->lpVtbl->GetChild(enumobj,
i, &filedata);
3943 hr = filedata->lpVtbl->GetType(filedata, &
guid);
3952 D3DXMatrixIdentity(&(*next_frame)->TransformationMatrix);
3964 filedata->lpVtbl->Release(filedata);
3981 *frame_hierarchy = root_frame;
3984 *frame_hierarchy = first_frame;
3988 if (anim_controller)
3990 *anim_controller =
NULL;
3991 FIXME(
"Animation controller creation not implemented.\n");
3996 if (filedata) filedata->lpVtbl->Release(filedata);
3997 if (enumobj) enumobj->lpVtbl->Release(enumobj);
3998 if (d3dxfile) d3dxfile->lpVtbl->Release(d3dxfile);
4003 ID3DXMesh **mesh_out,
DWORD *adjacency_out,
ID3DXBuffer **errors_and_warnings)
4005 FIXME(
"(%u, %p, %p, %p, %p, %p)\n", clean_type, mesh_in, adjacency_in, mesh_out, adjacency_out, errors_and_warnings);
4029 current_frame = frame;
4054 DWORD *num_materials,
struct ID3DXMesh **
mesh)
4060 TRACE(
"filename %s, options %#x, device %p, adjacency %p, materials %p, "
4061 "effect_instances %p, num_materials %p, mesh %p.\n",
4063 effect_instances, num_materials,
mesh);
4074 effect_instances, num_materials,
mesh);
4082 DWORD *num_materials,
struct ID3DXMesh **
mesh)
4088 TRACE(
"filename %s, options %#x, device %p, adjacency %p, materials %p, "
4089 "effect_instances %p, num_materials %p, mesh %p.\n",
4091 effect_instances, num_materials,
mesh);
4101 materials, effect_instances, num_materials,
mesh);
4117 TRACE(
"module %p, name %s, type %s, options %#x, device %p, adjacency %p, "
4118 "materials %p, effect_instances %p, num_materials %p, mesh %p.\n",
4120 materials, effect_instances, num_materials,
mesh);
4129 materials, effect_instances, num_materials,
mesh);
4148 ID3DXFileData *
child;
4152 hr = filedata->lpVtbl->GetChildren(filedata, &nb_children);
4156 for (
i = 0;
i < nb_children;
i++)
4158 hr = filedata->lpVtbl->GetChild(filedata,
i, &
child);
4189 IUnknown_Release(
child);
4194 IUnknown_Release(
child);
4200 struct ID3DXBuffer **effects_out,
DWORD *num_materials_out,
struct ID3DXMesh **mesh_out)
4203 ID3DXFile *d3dxfile =
NULL;
4204 ID3DXFileEnumObject *enumobj =
NULL;
4205 ID3DXFileData *filedata =
NULL;
4213 DWORD num_faces, num_vertices;
4215 DWORD provide_flags = 0;
4217 ID3DXMesh *concat_mesh =
NULL;
4220 void *concat_indices =
NULL;
4222 DWORD concat_vertex_size;
4226 TRACE(
"(%p, %u, %x, %p, %p, %p, %p, %p, %p)\n",
memory, memory_size,
options,
4227 device, adjacency_out, materials_out, effects_out, num_materials_out, mesh_out);
4239 source.dSize = memory_size;
4247 hr = enumobj->lpVtbl->GetChildren(enumobj, &nb_children);
4251 for (
i = 0;
i < nb_children;
i++)
4253 hr = enumobj->lpVtbl->GetChild(enumobj,
i, &filedata);
4257 hr = filedata->lpVtbl->GetType(filedata, &
guid);
4261 if (!container_ptr) {
4266 D3DXMatrixIdentity(&container_ptr->
transform);
4277 filedata->lpVtbl->
Release(filedata);
4283 enumobj->lpVtbl->
Release(enumobj);
4285 d3dxfile->lpVtbl->Release(d3dxfile);
4299 ID3DXMesh *
mesh = container_ptr->
mesh;
4301 num_faces +=
mesh->lpVtbl->GetNumFaces(
mesh);
4302 num_vertices +=
mesh->lpVtbl->GetNumVertices(
mesh);
4309 hr = concat_mesh->lpVtbl->GetDeclaration(concat_mesh, concat_decl);
4314 hr = concat_mesh->lpVtbl->LockVertexBuffer(concat_mesh, 0, (
void**)&concat_vertices);
4320 ID3DXMesh *
mesh = container_ptr->
mesh;
4321 DWORD num_mesh_vertices =
mesh->lpVtbl->GetNumVertices(
mesh);
4322 DWORD mesh_vertex_size;
4323 const BYTE *mesh_vertices;
4326 hr =
mesh->lpVtbl->GetDeclaration(
mesh, mesh_decl);
4334 for (
i = 0;
i < num_mesh_vertices;
i++) {
4341 for (
j = 1; concat_decl[
j].
Stream != 0xff;
j++)
4344 concat_decl[
j].UsageIndex == mesh_decl[
k].UsageIndex)
4352 mesh_vertices + mesh_decl[
k].
Offset,
4358 mesh_vertices += mesh_vertex_size;
4359 concat_vertices += concat_vertex_size;
4362 mesh->lpVtbl->UnlockVertexBuffer(
mesh);
4365 concat_mesh->lpVtbl->UnlockVertexBuffer(concat_mesh);
4366 concat_vertices =
NULL;
4368 hr = concat_mesh->lpVtbl->LockIndexBuffer(concat_mesh, 0, &concat_indices);
4374 ID3DXMesh *
mesh = container_ptr->
mesh;
4375 const void *mesh_indices;
4385 for (
i = 0;
i < num_mesh_faces * 3;
i++)
4386 *
dest++ = index_offset + *
src++;
4387 concat_indices =
dest;
4390 const WORD *
src = mesh_indices;
4391 for (
i = 0;
i < num_mesh_faces * 3;
i++)
4392 *
dest++ = index_offset + *
src++;
4393 concat_indices =
dest;
4395 mesh->lpVtbl->UnlockIndexBuffer(
mesh);
4397 index_offset += num_mesh_faces * 3;
4400 concat_mesh->lpVtbl->UnlockIndexBuffer(concat_mesh);
4401 concat_indices =
NULL;
4407 hr = concat_mesh->lpVtbl->LockAttributeBuffer(concat_mesh, 0, &concat_attrib_buffer);
4412 ID3DXMesh *
mesh = container_ptr->
mesh;
4418 concat_mesh->lpVtbl->UnlockAttributeBuffer(concat_mesh);
4423 *concat_attrib_buffer++ =
offset + *mesh_attrib_buffer++;
4425 mesh->lpVtbl->UnlockAttributeBuffer(
mesh);
4428 concat_mesh->lpVtbl->UnlockAttributeBuffer(concat_mesh);
4431 if (materials_out || effects_out) {
4448 char *strings_out_ptr;
4494 if (!materials_out) {
4500 if (adjacency_out) {
4520 *out_ptr++ =
offset + *in_ptr++;
4527 *mesh_out = concat_mesh;
4528 if (adjacency_out) *adjacency_out =
adjacency;
4529 if (materials_out) *materials_out =
materials;
4530 if (effects_out) *effects_out =
effects;
4535 if (concat_indices) concat_mesh->lpVtbl->UnlockIndexBuffer(concat_mesh);
4536 if (concat_vertices) concat_mesh->lpVtbl->UnlockVertexBuffer(concat_mesh);
4537 if (filedata) filedata->lpVtbl->
Release(filedata);
4538 if (enumobj) enumobj->lpVtbl->Release(enumobj);
4539 if (d3dxfile) d3dxfile->lpVtbl->Release(d3dxfile);
4541 if (concat_mesh) IUnknown_Release(concat_mesh);
4548 if (container_ptr->
mesh) IUnknown_Release(container_ptr->
mesh);
4570 DWORD (*adjacency_buf)[3];
4574 TRACE(
"device %p, length %f, sides %u, mesh %p, adjacency %p.\n",
4586 if (
FAILED(
hr = polygon->lpVtbl->LockVertexBuffer(polygon, 0, (
void **)&vertices)))
4588 polygon->lpVtbl->
Release(polygon);
4592 if (
FAILED(
hr = polygon->lpVtbl->LockIndexBuffer(polygon, 0, (
void **)&faces)))
4594 polygon->lpVtbl->UnlockVertexBuffer(polygon);
4595 polygon->lpVtbl->
Release(polygon);
4610 for (
i = 0;
i < sides; ++
i)
4620 faces[
i][1] =
i + 1;
4621 faces[
i][2] =
i + 2;
4624 faces[sides - 1][2] = 1;
4626 polygon->lpVtbl->UnlockVertexBuffer(polygon);
4627 polygon->lpVtbl->UnlockIndexBuffer(polygon);
4633 polygon->lpVtbl->
Release(polygon);
4638 for (
i = 0;
i < sides; ++
i)
4640 adjacency_buf[
i][0] =
i - 1;
4641 adjacency_buf[
i][1] = ~0
U;
4642 adjacency_buf[
i][2] =
i + 1;
4644 adjacency_buf[0][0] = sides - 1;
4645 adjacency_buf[sides - 1][2] = 0;
4660 DWORD *adjacency_buf;
4661 unsigned int i,
face;
4664 {-0.5f, -0.5f, -0.5f}, {-0.5f, -0.5f, 0.5f}, {-0.5f, 0.5f, 0.5f}, {-0.5f, 0.5f, -0.5f},
4665 {-0.5f, 0.5f, -0.5f}, {-0.5f, 0.5f, 0.5f}, { 0.5f, 0.5f, 0.5f}, { 0.5f, 0.5f, -0.5f},
4666 { 0.5f, 0.5f, -0.5f}, { 0.5f, 0.5f, 0.5f}, { 0.5f, -0.5f, 0.5f}, { 0.5f, -0.5f, -0.5f},
4667 {-0.5f, -0.5f, 0.5f}, {-0.5f, -0.5f, -0.5f}, { 0.5f, -0.5f, -0.5f}, { 0.5f, -0.5f, 0.5f},
4668 {-0.5f, -0.5f, 0.5f}, { 0.5f, -0.5f, 0.5f}, { 0.5f, 0.5f, 0.5f}, {-0.5f, 0.5f, 0.5f},
4669 {-0.5f, -0.5f, -0.5f}, {-0.5f, 0.5f, -0.5f}, { 0.5f, 0.5f, -0.5f}, { 0.5f, -0.5f, -0.5f}
4673 {-1.0f, 0.0f, 0.0f}, { 0.0f, 1.0f, 0.0f}, { 1.0f, 0.0f, 0.0f},
4674 { 0.0f, -1.0f, 0.0f}, { 0.0f, 0.0f, 1.0f}, { 0.0f, 0.0f, -1.0f}
4676 static const DWORD adjacency_table[] =
4678 6, 9, 1, 2, 10, 0, 1, 9, 3, 4, 10, 2,
4679 3, 8, 5, 7, 11, 4, 0, 11, 7, 5, 8, 6,
4680 7, 4, 9, 2, 0, 8, 1, 3, 11, 5, 6, 10
4683 TRACE(
"device %p, width %f, height %f, depth %f, mesh %p, adjacency %p\n",
4696 if (
FAILED(
hr =
box->lpVtbl->LockVertexBuffer(
box, 0, (
void **)&vertices)))
4698 box->lpVtbl->Release(
box);
4702 if (
FAILED(
hr =
box->lpVtbl->LockIndexBuffer(
box, 0, (
void **)&faces)))
4704 box->lpVtbl->UnlockVertexBuffer(
box);
4705 box->lpVtbl->Release(
box);
4709 for (
i = 0;
i < 24;
i++)
4720 for (
i = 0;
i < 12;
i++)
4722 faces[
i][0] =
face++;
4723 faces[
i][1] =
face++;
4727 box->lpVtbl->UnlockIndexBuffer(
box);
4728 box->lpVtbl->UnlockVertexBuffer(
box);
4734 box->lpVtbl->Release(
box);
4739 memcpy(adjacency_buf, adjacency_table,
sizeof(adjacency_table));
4779 angle = angle_start;
4780 for (
i = 0;
i <
n;
i++)
4784 angle += angle_step;
4798 DWORD number_of_vertices, number_of_faces;
4803 float phi_step, phi_start;
4805 float theta_step, theta, sin_theta, cos_theta;
4808 TRACE(
"(%p, %f, %u, %u, %p, %p)\n",
device, radius, slices, stacks,
mesh, adjacency);
4810 if (!
device || radius < 0.0f || slices < 2 || stacks < 2 || !
mesh)
4815 number_of_vertices = 2 + slices * (stacks-1);
4816 number_of_faces = 2 * slices + (stacks - 2) * (2 * slices);
4825 if (
FAILED(
hr = sphere->lpVtbl->LockVertexBuffer(sphere, 0, (
void **)&vertices)))
4827 sphere->lpVtbl->
Release(sphere);
4831 if (
FAILED(
hr = sphere->lpVtbl->LockIndexBuffer(sphere, 0, (
void **)&faces)))
4833 sphere->lpVtbl->UnlockVertexBuffer(sphere);
4834 sphere->lpVtbl->
Release(sphere);
4839 phi_step = -2.0f *
D3DX_PI / slices;
4844 sphere->lpVtbl->UnlockIndexBuffer(sphere);
4845 sphere->lpVtbl->UnlockVertexBuffer(sphere);
4846 sphere->lpVtbl->Release(sphere);
4851 theta_step =
D3DX_PI / stacks;
4867 sin_theta =
sinf(theta);
4868 cos_theta =
cosf(theta);
4906 theta += theta_step;
4950 sphere->lpVtbl->UnlockIndexBuffer(sphere);
4951 sphere->lpVtbl->UnlockVertexBuffer(sphere);
4958 sphere->lpVtbl->Release(sphere);
4962 if (
FAILED(
hr = sphere->lpVtbl->GenerateAdjacency(sphere, 0.0f, (*adjacency)->lpVtbl->GetBufferPointer(*adjacency))))
4964 (*adjacency)->lpVtbl->
Release(*adjacency);
4965 sphere->lpVtbl->Release(sphere);
4978 DWORD number_of_vertices, number_of_faces;
4983 float theta_step, theta_start;
4985 float delta_radius, radius, radius_step;
4986 float z, z_step, z_normal;
4989 TRACE(
"(%p, %f, %f, %f, %u, %u, %p, %p)\n",
device, radius1, radius2,
length, slices, stacks,
mesh, adjacency);
4991 if (
device ==
NULL || radius1 < 0.0f || radius2 < 0.0f ||
length < 0.0f || slices < 2 || stacks < 1 ||
mesh ==
NULL)
4996 number_of_vertices = 2 + (slices * (3 + stacks));
4997 number_of_faces = 2 * slices + stacks * (2 * slices);
5020 theta_step = -2.0f *
D3DX_PI / slices;
5034 delta_radius = radius1 - radius2;
5036 radius_step = delta_radius / stacks;
5039 z_step =
length / stacks;
5040 z_normal = delta_radius /
length;
5041 if (
isnan(z_normal))
5072 faces[
face++][2] = 1;
5109 if (
stack < stacks + 1)
5112 radius -= radius_step;
5128 faces[
face][1] = number_of_vertices - 1;
5141 faces[
face][1] = number_of_vertices - 1;
5156 if (
FAILED(
hr =
cylinder->lpVtbl->GenerateAdjacency(
cylinder, 0.0f, (*adjacency)->lpVtbl->GetBufferPointer(*adjacency))))
5158 (*adjacency)->lpVtbl->
Release(*adjacency);
5172 FIXME(
"device %p, mesh %p, adjacency %p semi-stub.\n",
device,
mesh, adjacency);
5184 TRACE(
"device %p, hdc %p, text %s, deviation %.8e, extrusion %.8e, mesh %p, adjacency %p, glyphmetrics %p.\n",
5195 mesh, adjacency, glyphmetrics);
5202 float innerradius,
float outerradius,
UINT sides,
UINT rings,
struct ID3DXMesh **
mesh,
ID3DXBuffer **adjacency)
5208 float phi, phi_step, sin_phi, cos_phi;
5209 float theta, theta_step, sin_theta, cos_theta;
5210 unsigned int i,
j, numvert, numfaces;
5212 TRACE(
"device %p, innerradius %.8e, outerradius %.8e, sides %u, rings %u, mesh %p, adjacency %p.\n",
5213 device, innerradius, outerradius, sides, rings,
mesh, adjacency);
5215 numvert = sides * rings;
5216 numfaces = numvert * 2;
5218 if (!
device || innerradius < 0.0f || outerradius < 0.0f || sides < 3 || rings < 3 || !
mesh)
5220 WARN(
"Invalid arguments.\n");
5227 if (
FAILED(
hr = torus->lpVtbl->LockVertexBuffer(torus, 0, (
void **)&vertices)))
5229 torus->lpVtbl->
Release(torus);
5233 if (
FAILED(
hr = torus->lpVtbl->LockIndexBuffer(torus, 0, (
void **)&faces)))
5235 torus->lpVtbl->UnlockVertexBuffer(torus);
5236 torus->lpVtbl->
Release(torus);
5240 phi_step =
D3DX_PI / sides * 2.0f;
5241 theta_step =
D3DX_PI / rings * -2.0f;
5245 for (
i = 0;
i < rings; ++
i)
5249 sin_theta =
sinf(theta);
5250 cos_theta =
cosf(theta);
5252 for (
j = 0;
j < sides; ++
j)
5254 sin_phi =
sinf(phi);
5255 cos_phi =
cosf(phi);
5257 vertices[
i * sides +
j].
position.
x = (innerradius * cos_phi + outerradius) * cos_theta;
5258 vertices[
i * sides +
j].
position.
y = (innerradius * cos_phi + outerradius) * sin_theta;
5259 vertices[
i * sides +
j].
position.
z = innerradius * sin_phi;
5260 vertices[
i * sides +
j].
normal.
x = cos_phi * cos_theta;
5261 vertices[
i * sides +
j].
normal.
y = cos_phi * sin_theta;
5262 vertices[
i * sides +
j].
normal.
z = sin_phi;
5267 theta += theta_step;
5270 for (
i = 0;
i < numfaces - sides * 2; ++
i)
5272 faces[
i][0] =
i % 2 ?
i / 2 + sides :
i / 2;
5273 faces[
i][1] = (
i / 2 + 1) % sides ?
i / 2 + 1 :
i / 2 + 1 - sides;
5274 faces[
i][2] = (
i + 1) % (sides * 2) ? (
i + 1) / 2 + sides : (
i + 1) / 2;
5277 for (
j = 0;
i < numfaces; ++
i, ++
j)
5279 faces[
i][0] =
i % 2 ?
j / 2 :
i / 2;
5280 faces[
i][1] = (
i / 2 + 1) % sides ?
i / 2 + 1 :
i / 2 + 1 - sides;
5281 faces[
i][2] =
i == numfaces - 1 ? 0 : (
j + 1) / 2;
5284 torus->lpVtbl->UnlockIndexBuffer(torus);
5285 torus->lpVtbl->UnlockVertexBuffer(torus);
5291 torus->lpVtbl->
Release(torus);
5295 if (
FAILED(
hr = torus->lpVtbl->GenerateAdjacency(torus, 0.0f, (*adjacency)->lpVtbl->GetBufferPointer(*adjacency))))
5297 (*adjacency)->lpVtbl->
Release(*adjacency);
5298 torus->lpVtbl->Release(torus);
5406 array->items = new_buffer;
5407 array->capacity = new_capacity;
5480 float max_deviation_sq)
5485 D3DXVec2Scale(&split1, D3DXVec2Add(&split1, p1, p2), 0.5f);
5486 D3DXVec2Scale(&split2, D3DXVec2Add(&split2, p2, p3), 0.5f);
5487 D3DXVec2Scale(&middle, D3DXVec2Add(&middle, &split1, &split2), 0.5f);
5489 deviation_sq = D3DXVec2LengthSq(D3DXVec2Subtract(&
vec, &middle, p2));
5490 if (deviation_sq < max_deviation_sq) {
5511 return D3DXVec2Dot(dir1, dir2) > cos_theta;
5571 float max_deviation_sq,
unsigned int emsquare,
5596 FIXME(
"Unknown header type %d\n",
header->dwType);
5602 unsigned int j2 = 0;
5622 D3DXVec2Scale(&bezier_end, D3DXVec2Add(&bezier_end, &pt_flt[j2], &pt_flt[j2+1]), 0.5f);
5626 bezier_start = bezier_end;
5638 pt->pos = pt_flt[j2];
5644 for (j2 = 0; j2 < curve->
cpfx; j2++)
5646 pt->pos = pt_flt[j2];
5661 if (
pt->pos.x == lastpt->
pos.
x &&
pt->pos.y == lastpt->
pos.
y) {
5727 D3DXVec2Subtract(&line_vec, line_pt2, line_pt1);
5728 line_pt_dx =
point->
x - line_pt1->
x;
5729 line_y = line_pt1->
y + (line_vec.
y * line_pt_dx) / line_vec.
x;
5730 return point->
y - line_y;
5761 if (
t->last_on_top) {
5769 if (
t->last_on_top != to_top &&
t->vertex_stack.count > 1) {
5771 WORD last_pt =
t->vertex_stack.items[0];
5773 for (
i = 1;
i <
t->vertex_stack.count;
i++)
5777 (*face)[0] = vtx_idx;
5778 (*face)[
f1] = last_pt;
5779 (*face)[
f2] = last_pt =
t->vertex_stack.items[
i];
5781 t->vertex_stack.items[0] = last_pt;
5782 t->vertex_stack.count = 1;
5783 }
else if (
t->vertex_stack.count > 1) {
5784 int i =
t->vertex_stack.count - 1;
5786 WORD top_idx =
t->vertex_stack.items[
i--];
5791 WORD prev_idx =
t->vertex_stack.items[
i--];
5794 if (prev_pt->
x != top_pt->
x &&
5801 (*face)[0] = vtx_idx;
5802 (*face)[
f1] = prev_idx;
5803 (*face)[
f2] = top_idx;
5807 t->vertex_stack.count--;
5810 t->last_on_top = to_top;
5814 if (
hr ==
S_OK &&
t->merging) {
5817 t2 = to_top ?
t - 1 :
t + 1;
5832 int i =
t->last_on_top == on_top ?
t->vertex_stack.count - 1 : 0;
5849 const D3DXVECTOR2 *p2 = &idx2->outline->items[idx2->vertex].pos;
5850 float diff = p1->
x - p2->
x;
5853 diff = p1->
y - p2->
y;
5855 return diff == 0.0f ? 0 : (diff > 0.0f ? -1 : 1);
5863 int nb_vertices = 0;
5872 nb_vertices += glyph->
outlines.items[
i].count;
5914 ccw = D3DXVec2CCW(&
v1, &
v2);
5924 if (!glyph->
faces.items)
5928 for (
i = 0;
i < glyph->
faces.count;
i++)
5930 glyph->
faces.items[
i][0] = 0;
5931 glyph->
faces.items[
i][1] =
i + 1;
5932 glyph->
faces.items[
i][2] =
i + 2;
5949 (nb_vertices + glyph->
outlines.count * 2 - 4) *
sizeof(glyph->
faces.items[0]));
5950 if (!glyph->
faces.items)
5955 for (sweep_idx = 0; sweep_idx < glyph->
ordered_vertices.count; sweep_idx++)
5967 WORD top_idx, bottom_idx;
5969 if (
t->merging &&
t->last_on_top)
5973 if (sweep_vtx == top_next)
5975 if (
t->merging &&
t->last_on_top)
5980 if (
t + 1 < &triangulations->
items[triangulations->
count] &&
5991 on_top_outline =
TRUE;
5994 if (
t->merging && !
t->last_on_top)
5998 if (sweep_vtx == bottom_next)
6000 if (
t->merging && !
t->last_on_top)
6002 if (on_top_outline) {
6011 if (
t > triangulations->
items &&
6028 if (
t->last_on_top) {
6029 top_idx =
t->vertex_stack.items[
t->vertex_stack.count - 1];
6030 bottom_idx =
t->vertex_stack.items[0];
6032 top_idx =
t->vertex_stack.items[0];
6033 bottom_idx =
t->vertex_stack.items[
t->vertex_stack.count - 1];
6038 top_next, sweep_vtx) > 0)
6042 bottom_next, sweep_vtx) < 0)
6045 }
else if (
t->merging) {
6060 if (
t->last_on_top) {
6099 DWORD nb_vertices, nb_faces;
6100 DWORD nb_front_faces, nb_corners, nb_outline_points;
6108 const MAT2 identity = {{0, 1}, {0, 0}, {0, 0}, {0, 1}};
6109 void *raw_outline =
NULL;
6115 struct vertex *vertex_ptr;
6117 float max_deviation_sq;
6125 TRACE(
"(%p, %p, %s, %f, %f, %p, %p, %p)\n",
device,
hdc,
6126 debugstr_w(
text), deviation, extrusion, mesh_ptr, adjacency, glyphmetrics);
6128 if (!
device || !
hdc || !
text || !*
text || deviation < 0.0f || extrusion < 0.0f || !mesh_ptr)
6133 FIXME(
"Case of adjacency != NULL not implemented.\n");
6143 if (deviation == 0.0f)
6145 max_deviation_sq = deviation * deviation;
6157 for (
i = 0;
i < textlen;
i++)
6172 if (!
glyphs || !raw_outline) {
6178 for (
i = 0;
i < textlen;
i++)
6183 glyphs[
i].offset_x = offset_x;
6193 if (triangulations.
count) {
6194 ERR(
"%d incomplete triangulations of glyph (%u).\n", triangulations.
count,
text[
i]);
6195 triangulations.
count = 0;
6212 nb_outline_points = 0;
6214 for (
i = 0;
i < textlen;
i++)
6217 nb_outline_points +=
glyphs[
i].ordered_vertices.count;
6218 nb_front_faces +=
glyphs[
i].faces.count;
6219 for (
j = 0;
j <
glyphs[
i].outlines.count;
j++)
6230 nb_vertices = (nb_outline_points + nb_corners) * 2 + nb_outline_points * 2;
6231 nb_faces = nb_outline_points * 2 + nb_front_faces * 2;
6239 if (
FAILED(
hr =
mesh->lpVtbl->LockVertexBuffer(
mesh, 0, (
void **)&vertices)))
6246 vertex_ptr = vertices;
6248 if (extrusion == 0.0f) {
6255 for (
i = 0;
i < textlen;
i++)
6259 struct vertex *back_vertices;
6263 for (
j = 0;
j <
glyphs[
i].outlines.count;
j++)
6265 struct vertex *outline_vertices = vertex_ptr;
6275 WORD vtx_idx = vertex_ptr - vertices;
6279 D3DXVec2Subtract(&
vec, &
pt->pos, &prevpt->
pos);
6280 else if (
pt->corner)
6281 D3DXVec2Subtract(&
vec, &nextpt->
pos, &
pt->pos);
6283 D3DXVec2Subtract(&
vec, &nextpt->
pos, &prevpt->
pos);
6292 *vertex_ptr++ = vtx;
6295 *vertex_ptr++ = vtx;
6301 *vertex_ptr++ = vtx;
6303 *vertex_ptr++ = vtx;
6305 (*face_ptr)[0] = vtx_idx;
6306 (*face_ptr)[1] = vtx_idx + 2;
6307 (*face_ptr)[2] = vtx_idx + 1;
6310 (*face_ptr)[0] = vtx_idx;
6311 (*face_ptr)[1] = vtx_idx + 3;
6312 (*face_ptr)[2] = vtx_idx + 2;
6318 D3DXVec2Subtract(&
vec, nextpt2, &nextpt->
pos);
6320 D3DXVec2Subtract(&
vec, &nextpt->
pos, &
pt->pos);
6327 *vertex_ptr++ = vtx;
6329 *vertex_ptr++ = vtx;
6332 (*face_ptr)[0] = vtx_idx;
6333 (*face_ptr)[1] = vtx_idx + 3;
6334 (*face_ptr)[2] = vtx_idx + 1;
6337 (*face_ptr)[0] = vtx_idx;
6338 (*face_ptr)[1] = vtx_idx + 2;
6339 (*face_ptr)[2] = vtx_idx + 3;
6347 *vertex_ptr++ = *outline_vertices++;
6348 *vertex_ptr++ = *outline_vertices++;
6353 back_faces = face_ptr;
6354 back_vertices = vertex_ptr;
6355 for (
j = 0;
j <
glyphs[
i].ordered_vertices.count;
j++)
6366 count = back_vertices - vertices;
6370 (*face_ptr)[0] = (*f)[0] +
count;
6371 (*face_ptr)[1] = (*f)[1] +
count;
6372 (*face_ptr)[2] = (*f)[2] +
count;
6377 j =
count = vertex_ptr - back_vertices;
6385 vertex_ptr->
normal.
z = extrusion == 0.0f ? 1.0f : -1.0f;
6389 j = face_ptr - back_faces;
6392 (*face_ptr)[0] = (*back_faces)[0] +
count;
6393 (*face_ptr)[1] = (*back_faces)[
f1] +
count;
6394 (*face_ptr)[2] = (*back_faces)[
f2] +
count;
6404 if (faces)
mesh->lpVtbl->UnlockIndexBuffer(
mesh);
6405 if (vertices)
mesh->lpVtbl->UnlockVertexBuffer(
mesh);
6409 for (
i = 0;
i < textlen;
i++)
6412 for (
j = 0;
j <
glyphs[
i].outlines.count;
j++)
6420 if (triangulations.
items) {
6422 for (
i = 0;
i < triangulations.
count;
i++)
6435 FIXME(
"(%p, %p, %p): stub\n",
mesh, adjacency, *errors_and_warnings);
6461 FLOAT max_abs_diff =
max(diff_x, diff_y);
6463 if (max_abs_diff <= epsilon)
6480 FLOAT max_abs_diff =
max(diff_x, diff_y);
6481 max_abs_diff =
max(diff_z, max_abs_diff);
6483 if (max_abs_diff <= epsilon)
6501 FLOAT max_abs_diff =
max(diff_x, diff_y);
6502 max_abs_diff =
max(diff_z, max_abs_diff);
6503 max_abs_diff =
max(diff_w, max_abs_diff);
6505 if (max_abs_diff <= epsilon)
6519 BYTE truncated_epsilon = (
BYTE)epsilon;
6524 BYTE max_diff =
max(diff_x, diff_y);
6525 max_diff =
max(diff_z, max_diff);
6526 max_diff =
max(diff_w, max_diff);
6528 if (max_diff <= truncated_epsilon)
6555 SHORT max_abs_diff =
max(diff_x, diff_y);
6557 if (max_abs_diff <= truncated_epsilon)
6581 SHORT max_abs_diff =
max(diff_x, diff_y);
6582 max_abs_diff =
max(diff_z, max_abs_diff);
6583 max_abs_diff =
max(diff_w, max_abs_diff);
6585 if (max_abs_diff <= truncated_epsilon)
6609 if (max_diff <= scaled_epsilon)
6629 max_diff =
max(diff_z, max_diff);
6630 max_diff =
max(diff_w, max_diff);
6632 if (max_diff <= scaled_epsilon)
6655 v.y = (
d & 0xffc00) >> 10;
6656 v.z = (
d & 0x3ff00000) >> 20;
6657 v.w = (
d & 0xc0000000) >> 30;
6668 UINT truncated_epsilon = (
UINT)epsilon;
6673 UINT max_diff =
max(diff_x, diff_y);
6674 max_diff =
max(diff_z, max_diff);
6675 max_diff =
max(diff_w, max_diff);
6677 if (max_diff <= truncated_epsilon)
6700 v.y = (
d & 0xffc00) >> 10;
6701 v.z = (
d & 0x3ff00000) >> 20;
6702 v.w = (
d & 0xc0000000) >> 30;
6709 const UINT MAX_DEC3N = 511;
6714 INT scaled_epsilon = (
INT)(epsilon * MAX_DEC3N);
6719 INT max_abs_diff =
max(diff_x, diff_y);
6720 max_abs_diff =
max(diff_z, max_abs_diff);
6721 max_abs_diff =
max(diff_w, max_abs_diff);
6723 if (max_abs_diff <= scaled_epsilon)
6749 max_abs_diff =
max(diff_x, diff_y);
6751 if (max_abs_diff <= epsilon)
6782 max_abs_diff =
max(diff_x, diff_y);
6783 max_abs_diff =
max(diff_z, max_abs_diff);
6784 max_abs_diff =
max(diff_w, max_abs_diff);
6786 if (max_abs_diff <= epsilon)
6858 if (!fixme_once_unused++)
6859 FIXME(
"D3DDECLTYPE_UNUSED welding not implemented.\n");
6863 if (!fixme_once_unknown++)
6864 FIXME(
"Welding of unknown declaration type %d is not implemented.\n",
type);
6873 FLOAT epsilon = 0.0f;
6875 static BOOL fixme_once_blendindices =
FALSE;
6876 static BOOL fixme_once_positiont =
FALSE;
6882 switch (decl_ptr->
Usage)
6894 epsilon = epsilons->
PSize;
6899 if (usage_index > 7)
6901 epsilon = epsilons->
Texcoords[usage_index];
6922 if (!fixme_once_blendindices++)
6923 FIXME(
"D3DDECLUSAGE_BLENDINDICES welding not implemented.\n");
6926 if (!fixme_once_positiont++)
6927 FIXME(
"D3DDECLUSAGE_POSITIONT welding not implemented.\n");
6930 if (!fixme_once_fog++)
6931 FIXME(
"D3DDECLUSAGE_FOG welding not implemented.\n");
6934 if (!fixme_once_depth++)
6935 FIXME(
"D3DDECLUSAGE_DEPTH welding not implemented.\n");
6938 if (!fixme_once_sample++)
6939 FIXME(
"D3DDECLUSAGE_SAMPLE welding not implemented.\n");
6942 if (!fixme_once_unknown++)
6943 FIXME(
"Unknown usage %x\n", decl_ptr->
Usage);
6954 if (indices_are_32bit)
6970 if (indices_are_32bit)
7010 const DWORD *adjacency_ptr;
7012 const FLOAT DEFAULT_EPSILON = 1.0e-6f;
7017 DWORD optimize_flags;
7023 TRACE(
"mesh %p, flags %#x, epsilons %p, adjacency %p, adjacency_out %p, face_remap_out %p, vertex_remap_out %p.\n",
7024 mesh,
flags, epsilons, adjacency, adjacency_out, face_remap_out, vertex_remap_out);
7028 WARN(
"No flags are undefined. Using D3DXWELDEPSILONS_WELDPARTIALMATCHES instead.\n");
7034 adjacency_ptr = adjacency;
7039 if (!adjacency_generated)
7041 ERR(
"Couldn't allocate memory for adjacency_generated.\n");
7045 hr =
mesh->lpVtbl->GenerateAdjacency(
mesh, DEFAULT_EPSILON, adjacency_generated);
7048 ERR(
"Couldn't generate adjacency.\n");
7051 adjacency_ptr = adjacency_generated;
7059 ERR(
"Couldn't allocate memory for point_reps.\n");
7062 hr =
mesh->lpVtbl->ConvertAdjacencyToPointReps(
mesh, adjacency_ptr, point_reps);
7065 ERR(
"ConvertAdjacencyToPointReps failed.\n");
7072 ERR(
"Couldn't lock index buffer.\n");
7076 hr =
mesh->lpVtbl->LockAttributeBuffer(
mesh, 0, &attributes);
7079 ERR(
"Couldn't lock attribute buffer.\n");
7083 if (!vertex_face_map)
7086 ERR(
"Couldn't allocate memory for vertex_face_map.\n");
7090 for (
i = 0;
i <
This->numfaces;
i++)
7093 for (
j = 0;
j < 3;
j++)
7096 vertex_face_map[
index] =
i;
7102 hr =
mesh->lpVtbl->LockVertexBuffer(
mesh, 0, (
void**)&vertices);
7105 ERR(
"Couldn't lock vertex buffer.\n");
7115 for (
i = 0;
i < 3 *
This->numfaces;
i++)
7118 DWORD vertex_size =
mesh->lpVtbl->GetNumBytesPerVertex(
mesh);
7119 DWORD num_vertex_components;
7124 for (decl_ptr =
This->cached_declaration, num_vertex_components = 0; decl_ptr->
Stream != 0xFF; decl_ptr++, num_vertex_components++)
7141 all_match = (num_vertex_components ==
matches);
7145 DWORD from_face = vertex_face_map[point_reps[
index]];
7151 mesh->lpVtbl->UnlockVertexBuffer(
mesh);
7156 for (
i = 0;
i < 3 *
This->numfaces;
i++)
7160 DWORD from_face = vertex_face_map[point_reps[
index]];
7166 mesh->lpVtbl->UnlockAttributeBuffer(
mesh);
7168 mesh->lpVtbl->UnlockIndexBuffer(
mesh);
7173 hr =
mesh->lpVtbl->OptimizeInplace(
mesh, optimize_flags, adjacency_ptr, adjacency_out, face_remap_out, vertex_remap_out);
7176 ERR(
"Couldn't compact mesh.\n");
7185 if (attributes)
mesh->lpVtbl->UnlockAttributeBuffer(
mesh);
7187 if (vertices)
mesh->lpVtbl->UnlockVertexBuffer(
mesh);
7197 UINT num_vertices,
BOOL indices_are_32bit,
DWORD *vertex_remap)
7201 FIXME(
"indices %p, num_faces %u, num_vertices %u, indices_are_32bit %#x, vertex_remap %p semi-stub.\n",
7202 indices, num_faces, num_vertices, indices_are_32bit, vertex_remap);
7206 WARN(
"vertex remap pointer is NULL.\n");
7210 for (
i = 0;
i < num_vertices;
i++)
7212 vertex_remap[
i] =
i;
7240 UINT num_vertices,
BOOL indices_are_32bit,
DWORD *face_remap)
7243 UINT j = num_faces - 1;
7244 UINT limit_16_bit = 2 << 15;
7247 FIXME(
"indices %p, num_faces %u, num_vertices %u, indices_are_32bit %#x, face_remap %p semi-stub. "
7248 "Face order will not be optimal.\n",
7249 indices, num_faces, num_vertices, indices_are_32bit, face_remap);
7251 if (!indices_are_32bit && num_faces >= limit_16_bit)
7253 WARN(
"Number of faces must be less than %d when using 16-bit indices.\n",
7261 WARN(
"Face remap pointer is NULL.\n");
7273 for (
i = 0;
i < num_faces;
i++)
7275 face_remap[
i] =
j--;
7310 ERR(
"Cannot read vec3\n");
7321 DWORD u_partial_out_semantic,
DWORD u_partial_out_index,
DWORD v_partial_out_semantic,
7323 const DWORD *adjacency,
float partial_edge_threshold,
float singular_point_threshold,
7324 float normal_edge_threshold, ID3DXMesh **mesh_out,
ID3DXBuffer **vertex_mapping)
7331 BOOL indices_are_32bit;
7332 DWORD i,
j, num_faces, num_vertices, vertex_stride;
7337 TRACE(
"mesh %p, texture_in_semantic %u, texture_in_index %u, u_partial_out_semantic %u, u_partial_out_index %u, "
7338 "v_partial_out_semantic %u, v_partial_out_index %u, normal_out_semantic %u, normal_out_index %u, "
7339 "options %#x, adjacency %p, partial_edge_threshold %f, singular_point_threshold %f, "
7340 "normal_edge_threshold %f, mesh_out %p, vertex_mapping %p\n",
7341 mesh, texture_in_semantic, texture_in_index, u_partial_out_semantic, u_partial_out_index,
7342 v_partial_out_semantic, v_partial_out_index, normal_out_semantic, normal_out_index,
options, adjacency,
7343 partial_edge_threshold, singular_point_threshold, normal_edge_threshold, mesh_out, vertex_mapping);
7347 WARN(
"mesh is NULL\n");
7353 WARN(
"D3DXTANGENT_WEIGHT_BY_AREA and D3DXTANGENT_WEIGHT_EQUAL are mutally exclusive\n");
7359 FIXME(
"tangent vectors computation is not supported\n");
7365 FIXME(
"binormal vectors computation is not supported\n");
7377 FIXME(
"only normals computation is supported\n");
7383 FIXME(
"only D3DXTANGENT_GENERATE_IN_PLACE is supported\n");
7398 if (!position_declaration || !normal_declaration)
7411 WARN(
"unsupported normals type %u\n", normal_declaration->Type);
7415 num_faces =
mesh->lpVtbl->GetNumFaces(
mesh);
7416 num_vertices =
mesh->lpVtbl->GetNumVertices(
mesh);
7417 vertex_stride =
mesh->lpVtbl->GetNumBytesPerVertex(
mesh);
7429 if (
FAILED(
hr =
mesh->lpVtbl->ConvertAdjacencyToPointReps(
mesh, adjacency, point_reps)))
7434 for (
i = 0;
i < num_vertices;
i++)
7441 if (
FAILED(
hr =
mesh->lpVtbl->LockVertexBuffer(
mesh, 0, (
void **)&vertices)))
7444 for (
i = 0;
i < num_vertices;
i++)
7446 static const D3DXVECTOR4 default_vector = {0.0f, 0.0f, 0.0f, 1.0f};
7447 void *
normal = vertices + normal_declaration->Offset +
i * vertex_stride;
7452 for (
i = 0;
i < num_faces;
i++)
7454 float denominator,
weights[3];
7456 const DWORD face_indices[3] =
7466 D3DXVec3Cross(&
cross, D3DXVec3Subtract(&
a, &
v0, &
v1), D3DXVec3Subtract(&
b, &
v0, &
v2));
7468 switch (weighting_method)
7478 denominator = D3DXVec3Length(&
a) * D3DXVec3Length(&
b);
7484 D3DXVec3Subtract(&
a, &
v1, &
v0);
7485 D3DXVec3Subtract(&
b, &
v1, &
v2);
7486 denominator = D3DXVec3Length(&
a) * D3DXVec3Length(&
b);
7492 D3DXVec3Subtract(&
a, &
v2, &
v0);
7493 D3DXVec3Subtract(&
b, &
v2, &
v1);
7494 denominator = D3DXVec3Length(&
a) * D3DXVec3Length(&
b);
7505 for (
j = 0;
j < 3;
j++)
7508 DWORD rep_index = point_reps[face_indices[
j]];
7512 D3DXVec3Add(rep_normal, rep_normal, &
normal);
7516 for (
i = 0;
i < num_vertices;
i++)
7518 DWORD rep_index = point_reps[
i];
7532 mesh->lpVtbl->UnlockVertexBuffer(
mesh);
7535 mesh->lpVtbl->UnlockIndexBuffer(
mesh);
7548 TRACE(
"mesh %p, stage_idx %d, tangent_idx %d, binorm_idx %d, wrap %d, adjacency %p.\n",
7549 mesh, stage_idx, tangent_idx, binorm_idx,
wrap, adjacency);
7557 adjacency, -1.01f, -0.01f, -1.01f,
NULL,
NULL);
7565 TRACE(
"mesh %p, adjacency %p\n",
mesh, adjacency);
7569 ERR(
"Invalid virtual table\n");
7576 adjacency, -1.01f, -0.01f, -1.01f,
NULL,
NULL);
7585 FIXME(
"mesh %p, ray_pos %p, ray_dir %p, hit %p, face_index %p, u %p, v %p, distance %p, all_hits %p, "
7586 "count_of_hits %p stub!\n",
mesh, ray_pos, ray_dir, hit, face_index,
u,
v,
distance, all_hits, count_of_hits);
7592 BOOL quadratic_normals, ID3DXMesh **mesh_out,
ID3DXBuffer **adjacency_out)
7594 FIXME(
"mesh %p, adjacency_in %p, num_segs %f, quadratic_normals %d, mesh_out %p, adjacency_out %p stub.\n",
7595 mesh, adjacency_in, num_segs, quadratic_normals, mesh_out, adjacency_out);
7603 FIXME(
"mesh_in %p, attribute_id %u, ib_flags %u, index_buffer %p, index_count %p stub.\n",
7604 mesh_in, attribute_id, ib_flags,
index_buffer, index_count);
_STLP_VENDOR_CSTD::ldiv_t div(long __x, long __y)
int strcmp(const char *String1, const char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void list_remove(struct list_entry *entry)
static int list_empty(struct list_entry *head)
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
static void list_init(struct list_entry *head)
#define D3DXERR_INVALIDDATA
void __cdecl qsort(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ int(__cdecl *_PtFuncCompare)(const void *, const void *))
#define D3DFVF_TEXCOUNT_SHIFT
#define D3DFVF_LASTBETA_UBYTE4
#define D3DUSAGE_NPATCHES
#define D3DDP_MAXTEXCOORD
#define D3DUSAGE_DONOTCLIP
#define D3DCOLOR_ARGB(a, r, g, b)
#define D3DFVF_TEXTUREFORMAT4
#define D3DFVF_TEXTUREFORMAT3
#define D3DFVF_TEXCOUNT_MASK
#define D3DUSAGE_WRITEONLY
#define D3DFVF_TEXCOORDSIZE4(CoordIndex)
#define D3DFVF_TEXCOORDSIZE3(CoordIndex)
struct _D3DCOLORVALUE D3DCOLORVALUE
#define D3DFVF_TEXTUREFORMAT1
#define D3DFVF_TEXTUREFORMAT2
#define D3DFVF_TEXCOORDSIZE2(CoordIndex)
#define D3DFVF_TEXCOORDSIZE1(CoordIndex)
enum _D3DFORMAT D3DFORMAT
#define D3DUSAGE_SOFTWAREPROCESSING
#define D3DUSAGE_RTPATCHES
#define D3DFVF_POSITION_MASK
#define IDirect3DIndexBuffer9_Unlock(p)
#define IDirect3DVertexBuffer9_Unlock(p)
#define IDirect3DDevice9_CreateIndexBuffer(p, a, b, c, d, e, f)
#define IDirect3DDevice9_SetIndices(p, a)
#define IDirect3DDevice9_DrawIndexedPrimitive(p, a, b, c, d, e, f)
#define IDirect3DDevice9_CreateVertexDeclaration(p, a, b)
#define IDirect3DVertexBuffer9_Release(p)
#define IDirect3DIndexBuffer9_AddRef(p)
#define IDirect3DVertexBuffer9_Lock(p, a, b, c, d)
#define IDirect3DVertexBuffer9_GetDesc(p, a)
#define IDirect3DVertexDeclaration9_Release(p)
#define IDirect3DVertexBuffer9_AddRef(p)
#define IDirect3DDevice9_SetStreamSource(p, a, b, c, d)
#define IDirect3DDevice9_Release(p)
#define IDirect3DIndexBuffer9_Lock(p, a, b, c, d)
#define IDirect3DDevice9_CreateVertexBuffer(p, a, b, c, d, e, f)
#define IDirect3DIndexBuffer9_Release(p)
#define IDirect3DDevice9_AddRef(p)
#define IDirect3DDevice9_SetVertexDeclaration(p, a)
@ D3DDECLUSAGE_BLENDWEIGHT
@ D3DDECLUSAGE_BLENDINDICES
@ D3DDECLUSAGE_TESSFACTOR
#define D3DFVF_LASTBETA_D3DCOLOR
enum _D3DDECLTYPE D3DDECLTYPE
enum _D3DDECLUSAGE D3DDECLUSAGE
#define D3DERR_INVALIDCALL
struct ID3DXBuffer ID3DXBuffer
HRESULT map_view_of_file(const WCHAR *filename, void **buffer, DWORD *length) DECLSPEC_HIDDEN
HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, void **buffer, DWORD *length) DECLSPEC_HIDDEN
#define ID3DXBuffer_GetBufferPointer(p)
#define ID3DXBuffer_Release(p)
struct _D3DVECTOR D3DXVECTOR3
#define D3DXToRadian(degree)
@ D3DXTANGENT_WEIGHT_BY_AREA
@ D3DXTANGENT_CALCULATE_NORMALS
@ D3DXTANGENT_WEIGHT_EQUAL
@ D3DXTANGENT_GENERATE_IN_PLACE
@ D3DXTANGENT_ORTHOGONALIZE_FROM_U
struct _D3DXEFFECTDEFAULT D3DXEFFECTDEFAULT
@ D3DXMESHOPT_STRIPREORDER
@ D3DXMESHOPT_IGNOREVERTS
@ D3DXMESHOPT_VERTEXCACHE
@ D3DXWELDEPSILONS_DONOTREMOVEVERTICES
@ D3DXWELDEPSILONS_DONOTSPLIT
@ D3DXWELDEPSILONS_WELDALL
@ D3DXWELDEPSILONS_WELDPARTIALMATCHES
struct _D3DXMATERIAL D3DXMATERIAL
@ D3DXMESH_VB_SOFTWAREPROCESSING
@ D3DXMESH_IB_SOFTWAREPROCESSING
struct _D3DXEFFECTINSTANCE D3DXEFFECTINSTANCE
#define D3DXF_FILELOAD_FROMMEMORY
HRESULT WINAPI D3DXCreateBuffer(DWORD size, ID3DXBuffer **buffer)
D3DXVECTOR4 *WINAPI D3DXVec4Transform(D3DXVECTOR4 *pout, const D3DXVECTOR4 *pv, const D3DXMATRIX *pm)
FLOAT *WINAPI D3DXFloat16To32Array(FLOAT *pout, const D3DXFLOAT16 *pin, UINT n)
D3DXVECTOR3 *WINAPI D3DXVec3TransformCoord(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv, const D3DXMATRIX *pm)
D3DXMATRIX *WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, const D3DXMATRIX *pm1, const D3DXMATRIX *pm2)
D3DXMATRIX *WINAPI D3DXMatrixInverse(D3DXMATRIX *pout, FLOAT *pdeterminant, const D3DXMATRIX *pm)
D3DXVECTOR2 *WINAPI D3DXVec2Normalize(D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv)
D3DXVECTOR3 *WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv)
D3DXFLOAT16 *WINAPI D3DXFloat32To16Array(D3DXFLOAT16 *pout, const FLOAT *pin, UINT n)
static void write_ib(void *index_buffer, BOOL indices_are_32bit, DWORD index, DWORD value)
BOOL WINAPI D3DXIntersectTri(const D3DXVECTOR3 *p0, const D3DXVECTOR3 *p1, const D3DXVECTOR3 *p2, const D3DXVECTOR3 *praypos, const D3DXVECTOR3 *praydir, float *pu, float *pv, float *pdist)
HRESULT WINAPI D3DXCreateBox(struct IDirect3DDevice9 *device, float width, float height, float depth, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency)
static DWORD find_adjacent_face(struct edge_face_map *edge_face_map, DWORD vertex1, DWORD vertex2, DWORD num_faces)
static DWORD WINAPI d3dx9_mesh_GetNumFaces(ID3DXMesh *iface)
static FLOAT scale_clamp_ushortn(FLOAT value)
static HRESULT init_edge_face_map(struct edge_face_map *edge_face_map, const DWORD *index_buffer, const DWORD *point_reps, DWORD num_faces)
static HRESULT WINAPI d3dx9_mesh_GetDeclaration(ID3DXMesh *iface, D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE])
static FLOAT scale_clamp_shortn(FLOAT value)
HRESULT WINAPI D3DXLoadMeshFromXResource(HMODULE module, const char *name, const char *type, DWORD options, struct IDirect3DDevice9 *device, struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances, DWORD *num_materials, struct ID3DXMesh **mesh)
static BOOL is_direction_similar(D3DXVECTOR2 *dir1, D3DXVECTOR2 *dir2, float cos_theta)
static HRESULT WINAPI d3dx9_mesh_DrawSubset(ID3DXMesh *iface, DWORD attrib_id)
static FLOAT scale_clamp_ubyten(FLOAT value)
UINT WINAPI D3DXGetDeclLength(const D3DVERTEXELEMENT9 *decl)
HRESULT WINAPI D3DXCreatePolygon(struct IDirect3DDevice9 *device, float length, UINT sides, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency)
UINT WINAPI D3DXGetFVFVertexSize(DWORD FVF)
static HRESULT create_outline(struct glyphinfo *glyph, void *raw_outline, int datasize, float max_deviation_sq, unsigned int emsquare, const struct cos_table *cos_table)
static HRESULT triangulation_add_point(struct triangulation **t_ptr, struct triangulation_array *triangulations, WORD vtx_idx, BOOL to_top)
static HRESULT convert_vertex_buffer(ID3DXMesh *mesh_dst, ID3DXMesh *mesh_src)
static HRESULT WINAPI d3dx9_mesh_CloneMesh(struct ID3DXMesh *iface, DWORD options, const D3DVERTEXELEMENT9 *declaration, struct IDirect3DDevice9 *device, struct ID3DXMesh **clone_mesh_out)
static HRESULT triangulate(struct triangulation_array *triangulations)
static HRESULT WINAPI d3dx9_mesh_UnlockVertexBuffer(ID3DXMesh *iface)
static void copy_declaration(D3DVERTEXELEMENT9 *dst, const D3DVERTEXELEMENT9 *src, UINT num_elem)
HRESULT WINAPI D3DXDeclaratorFromFVF(DWORD fvf, D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE])
static HRESULT WINAPI d3dx9_mesh_GetVertexBuffer(struct ID3DXMesh *iface, struct IDirect3DVertexBuffer9 **vertex_buffer)
static face * add_face(struct face_array *array)
static HRESULT WINAPI d3dx9_mesh_UpdateSemantics(ID3DXMesh *iface, D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE])
HRESULT WINAPI D3DXCreateCylinder(struct IDirect3DDevice9 *device, float radius1, float radius2, float length, UINT slices, UINT stacks, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency)
static HRESULT WINAPI d3dx9_mesh_GetIndexBuffer(struct ID3DXMesh *iface, struct IDirect3DIndexBuffer9 **index_buffer)
static D3DXVECTOR2 * convert_fixed_to_float(POINTFX *pt, int count, unsigned int emsquare)
HRESULT WINAPI D3DXComputeTangentFrameEx(ID3DXMesh *mesh, DWORD texture_in_semantic, DWORD texture_in_index, DWORD u_partial_out_semantic, DWORD u_partial_out_index, DWORD v_partial_out_semantic, DWORD v_partial_out_index, DWORD normal_out_semantic, DWORD normal_out_index, DWORD options, const DWORD *adjacency, float partial_edge_threshold, float singular_point_threshold, float normal_edge_threshold, ID3DXMesh **mesh_out, ID3DXBuffer **vertex_mapping)
HRESULT WINAPI D3DXOptimizeVertices(const void *indices, UINT num_faces, UINT num_vertices, BOOL indices_are_32bit, DWORD *vertex_remap)
static struct point2d * add_points(struct outline *array, int num)
static HRESULT add_bezier_points(struct outline *outline, const D3DXVECTOR2 *p1, const D3DXVECTOR2 *p2, const D3DXVECTOR2 *p3, float max_deviation_sq)
#define EFFECT_TABLE_ENTRY(str, field)
HRESULT WINAPI D3DXLoadMeshHierarchyFromXInMemory(const void *memory, DWORD memory_size, DWORD options, struct IDirect3DDevice9 *device, struct ID3DXAllocateHierarchy *alloc_hier, struct ID3DXLoadUserData *load_user_data, D3DXFRAME **frame_hierarchy, struct ID3DXAnimationController **anim_controller)
static HRESULT parse_normals(ID3DXFileData *filedata, struct mesh_data *mesh)
static FLOAT get_component_epsilon(const D3DVERTEXELEMENT9 *decl_ptr, const D3DXWELDEPSILONS *epsilons)
static BOOL weld_float2(void *to, void *from, FLOAT epsilon)
static HRESULT WINAPI d3dx9_mesh_SetAttributeTable(ID3DXMesh *iface, const D3DXATTRIBUTERANGE *attrib_table, DWORD attrib_table_size)
static HRESULT parse_material_list(ID3DXFileData *filedata, struct mesh_data *mesh)
static BOOL weld_d3dcolor(void *to, void *from, FLOAT epsilon)
static void free_sincos_table(struct sincos_table *sincos_table)
static DWORD WINAPI d3dx9_mesh_GetNumVertices(ID3DXMesh *iface)
static UINT Get_TexCoord_Size_From_FVF(DWORD FVF, int tex_num)
static HRESULT parse_material(ID3DXFileData *filedata, D3DXMATERIAL *material)
static void remove_triangulation(struct triangulation_array *array, struct triangulation *item)
static D3DXVECTOR3 read_vec3(BYTE *vertices, const D3DVERTEXELEMENT9 *declaration, DWORD vertex_stride, DWORD index)
static HRESULT WINAPI d3dx9_mesh_ConvertPointRepsToAdjacency(ID3DXMesh *iface, const DWORD *point_reps, DWORD *adjacency)
static BOOL weld_float1(void *to, void *from, FLOAT epsilon)
static HRESULT WINAPI d3dx9_mesh_ConvertAdjacencyToPointReps(ID3DXMesh *iface, const DWORD *adjacency, DWORD *point_reps)
HRESULT WINAPI D3DXCreateTextA(struct IDirect3DDevice9 *device, HDC hdc, const char *text, float deviation, float extrusion, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency, GLYPHMETRICSFLOAT *glyphmetrics)
static void empty_frame_queue(struct list *queue)
HRESULT WINAPI D3DXFVFFromDeclarator(const D3DVERTEXELEMENT9 *declaration, DWORD *fvf)
static BOOL weld_float3(void *to, void *from, FLOAT epsilon)
HRESULT WINAPI D3DXCreateMesh(DWORD numfaces, DWORD numvertices, DWORD options, const D3DVERTEXELEMENT9 *declaration, struct IDirect3DDevice9 *device, struct ID3DXMesh **mesh)
static struct triangulation * add_triangulation(struct triangulation_array *array)
static BOOL weld_short2(void *to, void *from, FLOAT epsilon)
static BOOL weld_dec3n(void *to, void *from, FLOAT epsilon)
HRESULT WINAPI D3DXComputeBoundingBox(const D3DXVECTOR3 *pfirstposition, DWORD numvertices, DWORD dwstride, D3DXVECTOR3 *pmin, D3DXVECTOR3 *pmax)
static HRESULT parse_vertex_colors(ID3DXFileData *filedata, struct mesh_data *mesh)
HRESULT WINAPI D3DXCreateTeapot(struct IDirect3DDevice9 *device, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency)
HRESULT WINAPI D3DXCleanMesh(D3DXCLEANTYPE clean_type, ID3DXMesh *mesh_in, const DWORD *adjacency_in, ID3DXMesh **mesh_out, DWORD *adjacency_out, ID3DXBuffer **errors_and_warnings)
static BOOL weld_ubyte4(void *to, void *from, FLOAT epsilon)
static HRESULT WINAPI d3dx9_mesh_OptimizeInplace(ID3DXMesh *iface, DWORD flags, const DWORD *adjacency_in, DWORD *adjacency_out, DWORD *face_remap_out, ID3DXBuffer **vertex_remap_out)
static HRESULT WINAPI d3dx9_mesh_LockAttributeBuffer(ID3DXMesh *iface, DWORD flags, DWORD **data)
HRESULT WINAPI D3DXTessellateNPatches(ID3DXMesh *mesh, const DWORD *adjacency_in, float num_segs, BOOL quadratic_normals, ID3DXMesh **mesh_out, ID3DXBuffer **adjacency_out)
static D3DXVECTOR2 * get_ordered_vertex(struct glyphinfo *glyph, WORD index)
HRESULT WINAPI D3DXIntersect(ID3DXBaseMesh *mesh, const D3DXVECTOR3 *ray_pos, const D3DXVECTOR3 *ray_dir, BOOL *hit, DWORD *face_index, float *u, float *v, float *distance, ID3DXBuffer **all_hits, DWORD *count_of_hits)
HRESULT WINAPI D3DXLoadMeshHierarchyFromXW(const WCHAR *filename, DWORD options, struct IDirect3DDevice9 *device, struct ID3DXAllocateHierarchy *alloc_hier, struct ID3DXLoadUserData *load_user_data, D3DXFRAME **frame_hierarchy, struct ID3DXAnimationController **anim_controller)
static HRESULT WINAPI d3dx9_mesh_GenerateAdjacency(ID3DXMesh *iface, float epsilon, DWORD *adjacency)
static BOOL weld_ushort4n(void *to, void *from, FLOAT epsilon)
HRESULT WINAPI D3DXOptimizeFaces(const void *indices, UINT num_faces, UINT num_vertices, BOOL indices_are_32bit, DWORD *face_remap)
#define PROVIDE_MATERIALS
HRESULT WINAPI D3DXComputeBoundingSphere(const D3DXVECTOR3 *pfirstposition, DWORD numvertices, DWORD dwstride, D3DXVECTOR3 *pcenter, float *pradius)
static HRESULT WINAPI d3dx9_mesh_GetAttributeTable(ID3DXMesh *iface, D3DXATTRIBUTERANGE *attrib_table, DWORD *attrib_table_size)
HRESULT WINAPI D3DXLoadSkinMeshFromXof(struct ID3DXFileData *filedata, DWORD options, struct IDirect3DDevice9 *device, struct ID3DXBuffer **adjacency_out, struct ID3DXBuffer **materials_out, struct ID3DXBuffer **effects_out, DWORD *num_materials_out, struct ID3DXSkinInfo **skin_info_out, struct ID3DXMesh **mesh_out)
static HRESULT propagate_face_vertices(const DWORD *adjacency, DWORD *point_reps, const DWORD *indices, DWORD *new_indices, DWORD face, DWORD numfaces)
static BOOL weld_short2n(void *to, void *from, FLOAT epsilon)
static int __cdecl attrib_entry_compare(const void *a, const void *b)
BOOL WINAPI D3DXSphereBoundProbe(const D3DXVECTOR3 *center, float radius, const D3DXVECTOR3 *ray_position, const D3DXVECTOR3 *ray_direction)
static BOOL queue_frame_node(struct list *queue, D3DXFRAME *frame)
static BOOL weld_float16_2(void *to, void *from, FLOAT epsilon)
static HRESULT load_frame(struct ID3DXFileData *filedata, DWORD options, struct IDirect3DDevice9 *device, struct ID3DXAllocateHierarchy *alloc_hier, D3DXFRAME **frame_out)
static void convert_component(BYTE *dst, BYTE *src, D3DDECLTYPE type_dst, D3DDECLTYPE type_src)
static void append_decl_element(D3DVERTEXELEMENT9 *declaration, UINT *idx, UINT *offset, D3DDECLTYPE type, D3DDECLUSAGE usage, UINT usage_idx)
static HRESULT WINAPI d3dx9_mesh_LockIndexBuffer(ID3DXMesh *iface, DWORD flags, void **data)
static HRESULT WINAPI d3dx9_mesh_GetDevice(struct ID3DXMesh *iface, struct IDirect3DDevice9 **device)
static HRESULT WINAPI d3dx9_mesh_Optimize(ID3DXMesh *iface, DWORD flags, const DWORD *adjacency_in, DWORD *adjacency_out, DWORD *face_remap, ID3DXBuffer **vertex_remap, ID3DXMesh **opt_mesh)
static HRESULT parse_transform_matrix(ID3DXFileData *filedata, D3DXMATRIX *transform)
static INT simple_round(FLOAT value)
static BOOL weld_float4(void *to, void *from, FLOAT epsilon)
static D3DXVECTOR2 * get_indexed_point(struct point2d_index *pt_idx)
static BOOL weld_float16_4(void *to, void *from, FLOAT epsilon)
static BOOL compute_sincos_table(struct sincos_table *sincos_table, float angle_start, float angle_step, int n)
static struct udec3 dword_to_udec3(DWORD d)
static void fill_attribute_table(DWORD *attrib_buffer, DWORD numfaces, void *indices, BOOL is_32bit_indices, D3DXATTRIBUTERANGE *attrib_table)
static HRESULT parse_mesh(ID3DXFileData *filedata, struct mesh_data *mesh_data, DWORD provide_flags)
HRESULT WINAPI D3DXCreateSphere(struct IDirect3DDevice9 *device, float radius, UINT slices, UINT stacks, struct ID3DXMesh **mesh, struct ID3DXBuffer **adjacency)
D3DXFRAME *WINAPI D3DXFrameFind(const D3DXFRAME *root, const char *name)
static BOOL weld_component(void *to, void *from, D3DDECLTYPE type, FLOAT epsilon)
HRESULT WINAPI D3DXLoadMeshFromXW(const WCHAR *filename, DWORD options, struct IDirect3DDevice9 *device, struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances, DWORD *num_materials, struct ID3DXMesh **mesh)
static INT get_equivalent_declaration_index(D3DVERTEXELEMENT9 orig_declaration, D3DVERTEXELEMENT9 *declaration)
static HRESULT parse_skin_mesh_info(ID3DXFileData *filedata, struct mesh_data *mesh_data, DWORD index)
static struct outline * add_outline(struct outline_array *array)
static BOOL declaration_equals(const D3DVERTEXELEMENT9 *declaration1, const D3DVERTEXELEMENT9 *declaration2)
static ULONG WINAPI d3dx9_mesh_Release(ID3DXMesh *iface)
static BOOL reserve(struct dynamic_array *array, int count, int itemsize)
static HRESULT load_mesh_container(struct ID3DXFileData *filedata, DWORD options, struct IDirect3DDevice9 *device, struct ID3DXAllocateHierarchy *alloc_hier, D3DXMESHCONTAINER **mesh_container)
UINT WINAPI D3DXGetDeclVertexSize(const D3DVERTEXELEMENT9 *decl, DWORD stream_idx)
static HRESULT compact_mesh(struct d3dx9_mesh *This, DWORD *indices, DWORD *new_num_vertices, ID3DXBuffer **vertex_remap)
static HRESULT WINAPI d3dx9_mesh_LockVertexBuffer(ID3DXMesh *iface, DWORD flags, void **data)
static BOOL weld_ushort2n(void *to, void *from, FLOAT epsilon)
static HRESULT filedata_get_name(ID3DXFileData *filedata, char **name)
static DWORD * generate_identity_point_reps(DWORD num_vertices)
static const struct ID3DXMeshVtbl D3DXMesh_Vtbl
HRESULT WINAPI D3DXValidMesh(ID3DXMesh *mesh, const DWORD *adjacency, ID3DXBuffer **errors_and_warnings)
#define FILL_INDEX_BUFFER(indices_var)
HRESULT WINAPI D3DXLoadMeshFromXA(const char *filename, DWORD options, struct IDirect3DDevice9 *device, struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances, DWORD *num_materials, struct ID3DXMesh **mesh)
static BOOL attempt_line_merge(struct outline *outline, int pt_index, const D3DXVECTOR2 *nextpt, BOOL to_curve, const struct cos_table *table)
static ULONG WINAPI d3dx9_mesh_AddRef(ID3DXMesh *iface)
static HRESULT WINAPI d3dx9_mesh_UnlockAttributeBuffer(ID3DXMesh *iface)
HRESULT WINAPI D3DXCreateTorus(struct IDirect3DDevice9 *device, float innerradius, float outerradius, UINT sides, UINT rings, struct ID3DXMesh **mesh, ID3DXBuffer **adjacency)
static DWORD read_ib(void *index_buffer, BOOL indices_are_32bit, DWORD index)
static HRESULT remap_faces_for_attrsort(struct d3dx9_mesh *This, const DWORD *indices, DWORD *attrib_buffer, DWORD **sorted_attrib_buffer, DWORD **face_remap)
static const UINT d3dx_decltype_size[]
#define PROVIDE_ADJACENCY
static struct dec3n dword_to_dec3n(DWORD d)
HRESULT WINAPI D3DXComputeTangent(ID3DXMesh *mesh, DWORD stage_idx, DWORD tangent_idx, DWORD binorm_idx, DWORD wrap, const DWORD *adjacency)
static D3DXVECTOR3 * vertex_element_vec3(BYTE *vertices, const D3DVERTEXELEMENT9 *declaration, DWORD vertex_stride, DWORD index)
static BOOL weld_ubyte4n(void *to, void *from, FLOAT epsilon)
HRESULT WINAPI D3DXConvertMeshSubsetToSingleStrip(struct ID3DXBaseMesh *mesh_in, DWORD attribute_id, DWORD ib_flags, struct IDirect3DIndexBuffer9 **index_buffer, DWORD *index_count)
static DWORD WINAPI d3dx9_mesh_GetFVF(ID3DXMesh *iface)
static HRESULT parse_frame(struct ID3DXFileData *filedata, DWORD options, struct IDirect3DDevice9 *device, const D3DXMATRIX *parent_transform, struct list *container_list, DWORD provide_flags)
HRESULT WINAPI D3DXCreateTextW(struct IDirect3DDevice9 *device, HDC hdc, const WCHAR *text, float deviation, float extrusion, struct ID3DXMesh **mesh_ptr, struct ID3DXBuffer **adjacency, GLYPHMETRICSFLOAT *glyphmetrics)
static struct d3dx9_mesh * impl_from_ID3DXMesh(ID3DXMesh *iface)
static DWORD count_attributes(const DWORD *attrib_buffer, DWORD numfaces)
HRESULT WINAPI D3DXComputeNormals(struct ID3DXBaseMesh *mesh, const DWORD *adjacency)
HRESULT WINAPI D3DXLoadMeshFromXInMemory(const void *memory, DWORD memory_size, DWORD options, struct IDirect3DDevice9 *device, struct ID3DXBuffer **adjacency_out, struct ID3DXBuffer **materials_out, struct ID3DXBuffer **effects_out, DWORD *num_materials_out, struct ID3DXMesh **mesh_out)
static D3DXVECTOR2 * unit_vec2(D3DXVECTOR2 *dir, const D3DXVECTOR2 *pt1, const D3DXVECTOR2 *pt2)
HRESULT WINAPI D3DXWeldVertices(ID3DXMesh *mesh, DWORD flags, const D3DXWELDEPSILONS *epsilons, const DWORD *adjacency, DWORD *adjacency_out, DWORD *face_remap_out, ID3DXBuffer **vertex_remap_out)
static BOOL weld_short4(void *to, void *from, FLOAT epsilon)
static int __cdecl compare_vertex_keys(const void *a, const void *b)
static HRESULT WINAPI d3dx9_mesh_CloneMeshFVF(struct ID3DXMesh *iface, DWORD options, DWORD fvf, struct IDirect3DDevice9 *device, struct ID3DXMesh **clone_mesh)
static HRESULT add_vertex_index(struct word_array *array, WORD vertex_index)
HRESULT WINAPI D3DXCreateMeshFVF(DWORD numfaces, DWORD numvertices, DWORD options, DWORD fvf, struct IDirect3DDevice9 *device, struct ID3DXMesh **mesh)
HRESULT WINAPI D3DXLoadMeshHierarchyFromXA(const char *filename, DWORD options, struct IDirect3DDevice9 *device, struct ID3DXAllocateHierarchy *alloc_hier, struct ID3DXLoadUserData *load_user_data, D3DXFRAME **frame_hierarchy, struct ID3DXAnimationController **anim_controller)
static HRESULT parse_texture_coords(ID3DXFileData *filedata, struct mesh_data *mesh)
static D3DXVECTOR2 * triangulation_get_next_point(struct triangulation *t, struct glyphinfo *glyph, BOOL on_top)
static int __cdecl compare_vertex_indices(const void *a, const void *b)
static DWORD WINAPI d3dx9_mesh_GetNumBytesPerVertex(ID3DXMesh *iface)
static BOOL weld_udec3(void *to, void *from, FLOAT epsilon)
HRESULT WINAPI D3DXFrameDestroy(D3DXFRAME *frame, ID3DXAllocateHierarchy *alloc_hier)
static float get_line_to_point_y_distance(D3DXVECTOR2 *line_pt1, D3DXVECTOR2 *line_pt2, D3DXVECTOR2 *point)
static HRESULT WINAPI d3dx9_mesh_UnlockIndexBuffer(ID3DXMesh *iface)
static void convert_float4(BYTE *dst, const D3DXVECTOR4 *src, D3DDECLTYPE type_dst)
static BOOL weld_short4n(void *to, void *from, FLOAT epsilon)
static WORD vertex_index(UINT slices, int slice, int stack)
BOOL WINAPI D3DXBoxBoundProbe(const D3DXVECTOR3 *pmin, const D3DXVECTOR3 *pmax, const D3DXVECTOR3 *prayposition, const D3DXVECTOR3 *praydirection)
static HRESULT generate_effects(ID3DXBuffer *materials, DWORD num_materials, ID3DXBuffer **effects)
static HRESULT WINAPI d3dx9_mesh_QueryInterface(ID3DXMesh *iface, REFIID riid, void **out)
static HRESULT parse_texture_filename(ID3DXFileData *filedata, char **filename_out)
static DWORD WINAPI d3dx9_mesh_GetOptions(ID3DXMesh *iface)
static void destroy_materials(struct mesh_data *mesh)
HRESULT WINAPI D3DXFileCreate(ID3DXFile **d3dxfile)
#define HeapFree(x, y, z)
#define MultiByteToWideChar
static void cleanup(void)
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
#define wrap(journal, var)
GLint GLint GLsizei GLsizei GLsizei depth
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLuint GLuint GLsizei GLenum const GLvoid * indices
GLuint GLenum GLenum transform
GLenum GLenum GLenum GLenum GLenum scale
GLenum GLuint GLint GLenum face
GLboolean GLboolean GLboolean b
GLsizei GLsizei GLfloat distance
GLuint GLsizei GLsizei * length
GLenum GLuint GLsizei bufsize
GLboolean GLboolean GLboolean GLboolean a
GLfloat GLfloat GLfloat v2
GLsizeiptr const GLvoid GLenum usage
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
_Check_return_ float __cdecl acosf(_In_ float x)
_Check_return_ __CRT_INLINE float __CRTDECL fabsf(_In_ float x)
_Check_return_ float __cdecl cosf(_In_ float x)
_Check_return_ float __cdecl sinf(_In_ float x)
#define memcpy(s1, s2, n)
struct task_struct * current
static const WCHAR filenameW[]
static const WCHAR textW[]
static CRYPT_DATA_BLOB b2[]
static CRYPT_DATA_BLOB b1[]
static ID3DXAllocateHierarchy alloc_hier
static const ASMPROP_RES defaults[ASM_NAME_MAX_PARAMS]
static UINT UINT LPWORD glyphs
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static char memory[1024 *256]
static float(__cdecl *square_half_float)(float x
_In_ ULONG _In_ ULONG Offset
static void cross(float v1[3], float v2[3], float result[3])
#define IsEqualGUID(rguid1, rguid2)
static unsigned __int64 next
#define D3DRM_XTEMPLATE_BYTES
unsigned char D3DRM_XTEMPLATES[]
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
HRESULT WINAPI D3DXCreateSkinInfoFVF(DWORD num_vertices, DWORD fvf, DWORD num_bones, ID3DXSkinInfo **skin_info)
wchar_t const *const size_t const buffer_size
LPD3DXEFFECTDEFAULT pDefaults
struct _D3DXFRAME * pFrameFirstChild
D3DXMATRIX TransformationMatrix
LPD3DXMESHCONTAINER pMeshContainer
struct _D3DXFRAME * pFrameSibling
struct _D3DXMESHCONTAINER * pNextMeshContainer
POINTFLOAT gmfptGlyphOrigin
int attrib_buffer_lock_count
D3DVERTEXELEMENT9 cached_declaration[MAX_FVF_DECL_SIZE]
D3DXATTRIBUTERANGE * attrib_table
UINT vertex_declaration_size
IDirect3DDevice9 * device
IDirect3DVertexBuffer9 * vertex_buffer
ID3DXMesh ID3DXMesh_iface
IDirect3DIndexBuffer9 * index_buffer
IDirect3DVertexDeclaration9 * vertex_declaration
struct edge_face * entries
struct point2d_index_array ordered_vertices
struct outline_array outlines
struct ID3DXSkinInfo * skin_info
struct point2d_index * items
struct triangulation * items
struct word_array vertex_stack
#define CONTAINING_RECORD(address, type, field)
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
UINT WINAPI GetOutlineTextMetricsW(_In_ HDC hdc, _In_ UINT cjCopy, _Out_writes_bytes_opt_(cjCopy) LPOUTLINETEXTMETRICW potm)
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
DWORD WINAPI GetGlyphOutlineW(_In_ HDC hdc, _In_ UINT uChar, _In_ UINT fuFormat, _Out_ LPGLYPHMETRICS lpgm, _In_ DWORD cjBuffer, _Out_writes_bytes_opt_(cjBuffer) LPVOID pvBuffer, _In_ CONST MAT2 *lpmat2)