ReactOS 0.4.16-dev-252-g9ccafe8
skin.c
Go to the documentation of this file.
1#ifdef __REACTOS__
2#include "precomp.h"
3#else
4/*
5 * Skin Info operations specific to D3DX9.
6 *
7 * Copyright (C) 2011 Dylan Smith
8 * Copyright (C) 2013 Christian Costa
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25
26#include "d3dx9_private.h"
27#endif /* __REACTOS__ */
28
30
31struct bone
32{
33 char *name;
38};
39
41{
42 ID3DXSkinInfo ID3DXSkinInfo_iface;
44
49 struct bone *bones;
50};
51
52static inline struct d3dx9_skin_info *impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
53{
55}
56
57static HRESULT WINAPI d3dx9_skin_info_QueryInterface(ID3DXSkinInfo *iface, REFIID riid, void **out)
58{
59 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
60
61 if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_ID3DXSkinInfo))
62 {
63 IUnknown_AddRef(iface);
64 *out = iface;
65 return D3D_OK;
66 }
67
68 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
69
70 return E_NOINTERFACE;
71}
72
73static ULONG WINAPI d3dx9_skin_info_AddRef(ID3DXSkinInfo *iface)
74{
75 struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
76 ULONG refcount = InterlockedIncrement(&skin->ref);
77
78 TRACE("%p increasing refcount to %u.\n", skin, refcount);
79
80 return refcount;
81}
82
83static ULONG WINAPI d3dx9_skin_info_Release(ID3DXSkinInfo *iface)
84{
85 struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
86 ULONG refcount = InterlockedDecrement(&skin->ref);
87
88 TRACE("%p decreasing refcount to %u.\n", skin, refcount);
89
90 if (!refcount)
91 {
92 DWORD i;
93
94 for (i = 0; i < skin->num_bones; ++i)
95 {
96 HeapFree(GetProcessHeap(), 0, skin->bones[i].name);
97 HeapFree(GetProcessHeap(), 0, skin->bones[i].vertices);
98 HeapFree(GetProcessHeap(), 0, skin->bones[i].weights);
99 }
100 HeapFree(GetProcessHeap(), 0, skin->bones);
101 HeapFree(GetProcessHeap(), 0, skin);
102 }
103
104 return refcount;
105}
106
108 DWORD bone_num, DWORD num_influences, const DWORD *vertices, const float *weights)
109{
110 struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
111 struct bone *bone;
112 DWORD *new_vertices = NULL;
113 FLOAT *new_weights = NULL;
114
115 TRACE("iface %p, bone_num %u, num_influences %u, vertices %p, weights %p.\n",
116 iface, bone_num, num_influences, vertices, weights);
117
118 if (bone_num >= skin->num_bones || !vertices || !weights)
119 return D3DERR_INVALIDCALL;
120
121 if (num_influences) {
122 new_vertices = HeapAlloc(GetProcessHeap(), 0, num_influences * sizeof(*vertices));
123 if (!new_vertices)
124 return E_OUTOFMEMORY;
125 new_weights = HeapAlloc(GetProcessHeap(), 0, num_influences * sizeof(*weights));
126 if (!new_weights) {
127 HeapFree(GetProcessHeap(), 0, new_vertices);
128 return E_OUTOFMEMORY;
129 }
130 memcpy(new_vertices, vertices, num_influences * sizeof(*vertices));
131 memcpy(new_weights, weights, num_influences * sizeof(*weights));
132 }
133 bone = &skin->bones[bone_num];
137 bone->vertices = new_vertices;
138 bone->weights = new_weights;
139
140 return D3D_OK;
141}
142
144 DWORD bone_num, DWORD influence_num, float weight)
145{
146 FIXME("iface %p, bone_num %u, influence_num %u, weight %.8e stub!\n",
147 iface, bone_num, influence_num, weight);
148
149 return E_NOTIMPL;
150}
151
152static DWORD WINAPI d3dx9_skin_info_GetNumBoneInfluences(ID3DXSkinInfo *iface, DWORD bone_num)
153{
154 struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
155
156 TRACE("iface %p, bone_num %u.\n", iface, bone_num);
157
158 if (bone_num >= skin->num_bones)
159 return 0;
160
161 return skin->bones[bone_num].num_influences;
162}
163
165 DWORD bone_num, DWORD *vertices, float *weights)
166{
167 struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
168 struct bone *bone;
169
170 TRACE("iface %p, bone_num %u, vertices %p, weights %p.\n",
171 iface, bone_num, vertices, weights);
172
173 if (bone_num >= skin->num_bones || !vertices)
174 return D3DERR_INVALIDCALL;
175
176 bone = &skin->bones[bone_num];
177 if (!bone->num_influences)
178 return D3D_OK;
179
181 if (weights)
183
184 return D3D_OK;
185}
186
188 DWORD bone_num, DWORD influence_num, float *weight, DWORD *vertex_num)
189{
190 FIXME("iface %p, bone_num %u, influence_num %u, weight %p, vertex_num %p stub!\n",
191 iface, bone_num, influence_num, weight, vertex_num);
192
193 return E_NOTIMPL;
194}
195
196static HRESULT WINAPI d3dx9_skin_info_GetMaxVertexInfluences(ID3DXSkinInfo *iface, DWORD *max_vertex_influences)
197{
198 FIXME("iface %p, max_vertex_influences %p stub!\n", iface, max_vertex_influences);
199
200 return E_NOTIMPL;
201}
202
203static DWORD WINAPI d3dx9_skin_info_GetNumBones(ID3DXSkinInfo *iface)
204{
205 struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
206
207 TRACE("iface %p.\n", iface);
208
209 return skin->num_bones;
210}
211
213 DWORD bone_num, DWORD vertex_num, DWORD *influence_index)
214{
215 FIXME("iface %p, bone_num %u, vertex_num %u, influence_index %p stub!\n",
216 iface, bone_num, vertex_num, influence_index);
217
218 return E_NOTIMPL;
219}
220
221static HRESULT WINAPI d3dx9_skin_info_GetMaxFaceInfluences(struct ID3DXSkinInfo *iface,
222 struct IDirect3DIndexBuffer9 *index_buffer, DWORD num_faces, DWORD *max_face_influences)
223{
224 FIXME("iface %p, index_buffer %p, num_faces %u, max_face_influences %p stub!\n",
225 iface, index_buffer, num_faces, max_face_influences);
226
227 return E_NOTIMPL;
228}
229
230static HRESULT WINAPI d3dx9_skin_info_SetMinBoneInfluence(ID3DXSkinInfo *iface, float min_influence)
231{
232 FIXME("iface %p, min_influence %.8e stub!\n", iface, min_influence);
233
234 return E_NOTIMPL;
235}
236
237static float WINAPI d3dx9_skin_info_GetMinBoneInfluence(ID3DXSkinInfo *iface)
238{
239 FIXME("iface %p stub!\n", iface);
240
241 return 0.0f;
242}
243
244static HRESULT WINAPI d3dx9_skin_info_SetBoneName(ID3DXSkinInfo *iface, DWORD bone_idx, const char *name)
245{
246 struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
247 char *new_name;
248 size_t size;
249
250 TRACE("iface %p, bone_idx %u, name %s.\n", iface, bone_idx, debugstr_a(name));
251
252 if (bone_idx >= skin->num_bones || !name)
253 return D3DERR_INVALIDCALL;
254
255 size = strlen(name) + 1;
256 new_name = HeapAlloc(GetProcessHeap(), 0, size);
257 if (!new_name)
258 return E_OUTOFMEMORY;
259 memcpy(new_name, name, size);
260 HeapFree(GetProcessHeap(), 0, skin->bones[bone_idx].name);
261 skin->bones[bone_idx].name = new_name;
262
263 return D3D_OK;
264}
265
266static const char * WINAPI d3dx9_skin_info_GetBoneName(ID3DXSkinInfo *iface, DWORD bone_idx)
267{
268 struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
269
270 TRACE("iface %p, bone_idx %u.\n", iface, bone_idx);
271
272 if (bone_idx >= skin->num_bones)
273 return NULL;
274
275 return skin->bones[bone_idx].name;
276}
277
279 DWORD bone_num, const D3DXMATRIX *bone_transform)
280{
281 struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
282
283 TRACE("iface %p, bone_num %u, bone_transform %p.\n", iface, bone_num, bone_transform);
284
285 if (bone_num >= skin->num_bones || !bone_transform)
286 return D3DERR_INVALIDCALL;
287
288 skin->bones[bone_num].transform = *bone_transform;
289 return D3D_OK;
290}
291
292static D3DXMATRIX * WINAPI d3dx9_skin_info_GetBoneOffsetMatrix(ID3DXSkinInfo *iface, DWORD bone_num)
293{
294 struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
295
296 TRACE("iface %p, bone_num %u.\n", iface, bone_num);
297
298 if (bone_num >= skin->num_bones)
299 return NULL;
300
301 return &skin->bones[bone_num].transform;
302}
303
304static HRESULT WINAPI d3dx9_skin_info_Clone(ID3DXSkinInfo *iface, ID3DXSkinInfo **skin_info)
305{
306 struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
307 unsigned int i;
308 HRESULT hr;
309
310 TRACE("iface %p, skin_info %p.\n", iface, skin_info);
311
312 if (FAILED(hr = D3DXCreateSkinInfo(skin->num_vertices, skin->vertex_declaration, skin->num_bones, skin_info)))
313 return hr;
314
315 for (i = 0; i < skin->num_bones; ++i)
316 {
317 struct bone *current_bone = &skin->bones[i];
318
319 if (current_bone->name && FAILED(hr = (*skin_info)->lpVtbl->SetBoneName(*skin_info, i, current_bone->name)))
320 break;
321 if (FAILED(hr = (*skin_info)->lpVtbl->SetBoneOffsetMatrix(*skin_info, i, &current_bone->transform)))
322 break;
323 if (current_bone->vertices && current_bone->weights
324 && FAILED(hr = (*skin_info)->lpVtbl->SetBoneInfluence(*skin_info, i, current_bone->num_influences,
325 current_bone->vertices, current_bone->weights)))
326 break;
327 }
328
329 if (FAILED(hr))
330 (*skin_info)->lpVtbl->Release(*skin_info);
331
332 return hr;
333}
334
335static HRESULT WINAPI d3dx9_skin_info_Remap(ID3DXSkinInfo *iface, DWORD num_vertices, DWORD *vertex_remap)
336{
337 FIXME("iface %p, num_vertices %u, vertex_remap %p stub!\n", iface, num_vertices, vertex_remap);
338
339 return E_NOTIMPL;
340}
341
342static HRESULT WINAPI d3dx9_skin_info_SetFVF(ID3DXSkinInfo *iface, DWORD fvf)
343{
344 HRESULT hr;
346
347 TRACE("iface %p, fvf %#x.\n", iface, fvf);
348
350 if (FAILED(hr)) return hr;
351
352 return iface->lpVtbl->SetDeclaration(iface, declaration);
353}
354
356{
357 struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
358 HRESULT hr;
359 int count;
360
361 TRACE("iface %p, declaration %p.\n", iface, declaration);
362
363 if (!declaration)
364 return D3DERR_INVALIDCALL;
365 for (count = 0; declaration[count].Stream != 0xff; count++) {
366 if (declaration[count].Stream != 0) {
367 WARN("Invalid vertex element %u; contains non-zero stream %u\n",
369 return D3DERR_INVALIDCALL;
370 }
371 }
372 count++;
373
375
377 skin->fvf = 0;
378
379 return D3D_OK;
380}
381
382static DWORD WINAPI d3dx9_skin_info_GetFVF(ID3DXSkinInfo *iface)
383{
384 struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
385
386 TRACE("iface %p.\n", iface);
387
388 return skin->fvf;
389}
390
393{
394 struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
395 UINT count = 0;
396
397 TRACE("iface %p, declaration %p.\n", iface, declaration);
398
399 while (skin->vertex_declaration[count++].Stream != 0xff);
401 return D3D_OK;
402}
403
404static HRESULT WINAPI d3dx9_skin_info_UpdateSkinnedMesh(ID3DXSkinInfo *iface, const D3DXMATRIX *bone_transforms,
405 const D3DXMATRIX *bone_inv_transpose_transforms, const void *src_vertices, void *dst_vertices)
406{
407 struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
409 DWORD i, j;
410
411 TRACE("iface %p, bone_transforms %p, bone_inv_transpose_transforms %p, src_vertices %p, dst_vertices %p\n",
412 skin, bone_transforms, bone_inv_transpose_transforms, src_vertices, dst_vertices);
413
414 if (bone_inv_transpose_transforms)
415 FIXME("Skinning vertices with two position elements not supported\n");
416
417 if ((skin->fvf & D3DFVF_POSITION_MASK) != D3DFVF_XYZ) {
418 FIXME("Vertex type %#x not supported\n", skin->fvf & D3DFVF_POSITION_MASK);
419 return E_FAIL;
420 }
421
422 /* Reset all positions */
423 for (i = 0; i < skin->num_vertices; i++) {
424 D3DXVECTOR3 *position = (D3DXVECTOR3*)((BYTE*)dst_vertices + size * i);
425 position->x = 0.0f;
426 position->y = 0.0f;
427 position->z = 0.0f;
428 }
429
430 /* Update positions that are influenced by bones */
431 for (i = 0; i < skin->num_bones; i++) {
432 D3DXMATRIX bone_inverse, matrix;
433
434 D3DXMatrixInverse(&bone_inverse, NULL, &skin->bones[i].transform);
435 D3DXMatrixMultiply(&matrix, &bone_transforms[i], &bone_inverse);
436 D3DXMatrixMultiply(&matrix, &matrix, &skin->bones[i].transform);
437
438 for (j = 0; j < skin->bones[i].num_influences; j++) {
439 D3DXVECTOR3 position;
440 D3DXVECTOR3 *position_src = (D3DXVECTOR3*)((BYTE*)src_vertices + size * skin->bones[i].vertices[j]);
441 D3DXVECTOR3 *position_dest = (D3DXVECTOR3*)((BYTE*)dst_vertices + size * skin->bones[i].vertices[j]);
442 FLOAT weight = skin->bones[i].weights[j];
443
444 D3DXVec3TransformCoord(&position, position_src, &matrix);
445 position_dest->x += weight * position.x;
446 position_dest->y += weight * position.y;
447 position_dest->z += weight * position.z;
448 }
449 }
450
451 if (skin->fvf & D3DFVF_NORMAL) {
452 /* Reset all normals */
453 for (i = 0; i < skin->num_vertices; i++) {
454 D3DXVECTOR3 *normal = (D3DXVECTOR3*)((BYTE*)dst_vertices + size * i + sizeof(D3DXVECTOR3));
455 normal->x = 0.0f;
456 normal->y = 0.0f;
457 normal->z = 0.0f;
458 }
459
460 /* Update normals that are influenced by bones */
461 for (i = 0; i < skin->num_bones; i++) {
462 D3DXMATRIX bone_inverse, matrix;
463
464 D3DXMatrixInverse(&bone_inverse, NULL, &skin->bones[i].transform);
465 D3DXMatrixMultiply(&matrix, &skin->bones[i].transform, &bone_transforms[i]);
466
467 for (j = 0; j < skin->bones[i].num_influences; j++) {
469 D3DXVECTOR3 *normal_src = (D3DXVECTOR3*)((BYTE*)src_vertices + size * skin->bones[i].vertices[j] + sizeof(D3DXVECTOR3));
470 D3DXVECTOR3 *normal_dest = (D3DXVECTOR3*)((BYTE*)dst_vertices + size * skin->bones[i].vertices[j] + sizeof(D3DXVECTOR3));
471 FLOAT weight = skin->bones[i].weights[j];
472
473 D3DXVec3TransformNormal(&normal, normal_src, &bone_inverse);
475 normal_dest->x += weight * normal.x;
476 normal_dest->y += weight * normal.y;
477 normal_dest->z += weight * normal.z;
478 }
479 }
480
481 /* Normalize all normals that are influenced by bones*/
482 for (i = 0; i < skin->num_vertices; i++) {
483 D3DXVECTOR3 *normal_dest = (D3DXVECTOR3*)((BYTE*)dst_vertices + (i * size) + sizeof(D3DXVECTOR3));
484 if ((normal_dest->x != 0.0f) && (normal_dest->y != 0.0f) && (normal_dest->z != 0.0f))
485 D3DXVec3Normalize(normal_dest, normal_dest);
486 }
487 }
488
489 return D3D_OK;
490}
491
492static HRESULT WINAPI d3dx9_skin_info_ConvertToBlendedMesh(ID3DXSkinInfo *iface, ID3DXMesh *mesh_in,
493 DWORD options, const DWORD *adjacency_in, DWORD *adjacency_out, DWORD *face_remap,
494 ID3DXBuffer **vertex_remap, DWORD *max_face_infl, DWORD *num_bone_combinations,
495 ID3DXBuffer **bone_combination_table, ID3DXMesh **mesh_out)
496{
497 FIXME("iface %p, mesh_in %p, options %#x, adjacency_in %p, adjacency_out %p, face_remap %p, vertex_remap %p, "
498 "max_face_infl %p, num_bone_combinations %p, bone_combination_table %p, mesh_out %p stub!\n",
499 iface, mesh_in, options, adjacency_in, adjacency_out, face_remap, vertex_remap,
500 max_face_infl, num_bone_combinations, bone_combination_table, mesh_out);
501
502 return E_NOTIMPL;
503}
504
505static HRESULT WINAPI d3dx9_skin_info_ConvertToIndexedBlendedMesh(ID3DXSkinInfo *iface, ID3DXMesh *mesh_in,
506 DWORD options, DWORD palette_size, const DWORD *adjacency_in, DWORD *adjacency_out, DWORD *face_remap,
507 ID3DXBuffer **vertex_remap, DWORD *max_face_infl, DWORD *num_bone_combinations,
508 ID3DXBuffer **bone_combination_table, ID3DXMesh **mesh_out)
509{
510 FIXME("iface %p, mesh_in %p, options %#x, palette_size %u, adjacency_in %p, adjacency_out %p, face_remap %p, vertex_remap %p, "
511 "max_face_infl %p, num_bone_combinations %p, bone_combination_table %p, mesh_out %p stub!\n",
512 iface, mesh_in, options, palette_size, adjacency_in, adjacency_out, face_remap, vertex_remap,
513 max_face_infl, num_bone_combinations, bone_combination_table, mesh_out);
514
515 return E_NOTIMPL;
516}
517
518static const struct ID3DXSkinInfoVtbl d3dx9_skin_info_vtbl =
519{
547};
548
550 DWORD num_bones, ID3DXSkinInfo **skin_info)
551{
552 HRESULT hr;
553 static const D3DVERTEXELEMENT9 empty_declaration = D3DDECL_END();
554 struct d3dx9_skin_info *object = NULL;
555
556 TRACE("num_vertices %u, declaration %p, num_bones %u, skin_info %p.\n",
557 num_vertices, declaration, num_bones, skin_info);
558
559 if (!skin_info || !declaration)
560 return D3DERR_INVALIDCALL;
561
562 object = HeapAlloc(GetProcessHeap(), 0, sizeof(*object));
563 if (!object)
564 return E_OUTOFMEMORY;
565
566 object->ID3DXSkinInfo_iface.lpVtbl = &d3dx9_skin_info_vtbl;
567 object->ref = 1;
568 object->num_vertices = num_vertices;
569 object->num_bones = num_bones;
570 object->vertex_declaration[0] = empty_declaration;
571 object->fvf = 0;
572
573 object->bones = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, num_bones * sizeof(*object->bones));
574 if (!object->bones) {
576 goto error;
577 }
578
579 if (FAILED(hr = d3dx9_skin_info_SetDeclaration(&object->ID3DXSkinInfo_iface, declaration)))
580 goto error;
581
582 *skin_info = &object->ID3DXSkinInfo_iface;
583
584 return D3D_OK;
585error:
586 HeapFree(GetProcessHeap(), 0, object->bones);
587 HeapFree(GetProcessHeap(), 0, object);
588 return hr;
589}
590
592{
593 HRESULT hr;
595
596 TRACE("(%u, %x, %u, %p)\n", num_vertices, fvf, num_bones, skin_info);
597
599 if (FAILED(hr))
600 return hr;
601
603}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
const GUID IID_IUnknown
#define D3DFVF_XYZ
Definition: d3d8types.h:113
#define D3DFVF_NORMAL
Definition: d3d8types.h:120
#define D3DFVF_POSITION_MASK
Definition: d3d8types.h:112
#define D3DDECL_END()
Definition: d3d9types.h:311
#define D3D_OK
Definition: d3d.h:106
#define D3DERR_INVALIDCALL
struct ID3DXBuffer ID3DXBuffer
Definition: d3dx8core.h:51
struct _D3DVECTOR D3DXVECTOR3
Definition: d3dx9math.h:97
@ MAX_FVF_DECL_SIZE
Definition: d3dx9mesh.h:41
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
D3DXVECTOR3 *WINAPI D3DXVec3TransformCoord(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv, const D3DXMATRIX *pm)
Definition: math.c:1895
D3DXMATRIX *WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, const D3DXMATRIX *pm1, const D3DXMATRIX *pm2)
Definition: math.c:397
D3DXMATRIX *WINAPI D3DXMatrixInverse(D3DXMATRIX *pout, FLOAT *pdeterminant, const D3DXMATRIX *pm)
Definition: math.c:258
D3DXVECTOR3 *WINAPI D3DXVec3TransformNormal(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv, const D3DXMATRIX *pm)
Definition: math.c:1928
D3DXVECTOR3 *WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv)
Definition: math.c:1805
UINT WINAPI D3DXGetFVFVertexSize(DWORD FVF)
Definition: mesh.c:2289
HRESULT WINAPI D3DXDeclaratorFromFVF(DWORD fvf, D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE])
Definition: mesh.c:2036
HRESULT WINAPI D3DXFVFFromDeclarator(const D3DVERTEXELEMENT9 *declaration, DWORD *fvf)
Definition: mesh.c:2134
static unsigned int palette_size(DWORD flags)
Definition: palette.c:241
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
unsigned long DWORD
Definition: ntddk_ex.h:95
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLsizeiptr size
Definition: glext.h:5919
GLuint GLenum matrix
Definition: glext.h:9407
const GLbyte * weights
Definition: glext.h:6523
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
Definition: glfuncs.h:248
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
Definition: glfuncs.h:250
REFIID riid
Definition: atlbase.h:39
ULONG Release()
#define FAILED(hr)
Definition: intsafe.h:51
#define debugstr_guid
Definition: kernel32.h:35
#define debugstr_a
Definition: kernel32.h:31
#define error(str)
Definition: mkdosfs.c:1605
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static IStream Stream
Definition: htmldoc.c:1115
unsigned int UINT
Definition: ndis.h:50
@ normal
Definition: optimize.h:166
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
static FILE * out
Definition: regtests2xml.c:44
weight
Definition: sortkey.c:157
HRESULT hr
Definition: shlfolder.c:183
static HRESULT WINAPI d3dx9_skin_info_FindBoneVertexInfluenceIndex(ID3DXSkinInfo *iface, DWORD bone_num, DWORD vertex_num, DWORD *influence_index)
Definition: skin.c:212
static float WINAPI d3dx9_skin_info_GetMinBoneInfluence(ID3DXSkinInfo *iface)
Definition: skin.c:237
static HRESULT WINAPI d3dx9_skin_info_Clone(ID3DXSkinInfo *iface, ID3DXSkinInfo **skin_info)
Definition: skin.c:304
static HRESULT WINAPI d3dx9_skin_info_SetFVF(ID3DXSkinInfo *iface, DWORD fvf)
Definition: skin.c:342
static HRESULT WINAPI d3dx9_skin_info_GetBoneInfluence(ID3DXSkinInfo *iface, DWORD bone_num, DWORD *vertices, float *weights)
Definition: skin.c:164
static const char *WINAPI d3dx9_skin_info_GetBoneName(ID3DXSkinInfo *iface, DWORD bone_idx)
Definition: skin.c:266
static HRESULT WINAPI d3dx9_skin_info_ConvertToBlendedMesh(ID3DXSkinInfo *iface, ID3DXMesh *mesh_in, DWORD options, const DWORD *adjacency_in, DWORD *adjacency_out, DWORD *face_remap, ID3DXBuffer **vertex_remap, DWORD *max_face_infl, DWORD *num_bone_combinations, ID3DXBuffer **bone_combination_table, ID3DXMesh **mesh_out)
Definition: skin.c:492
static HRESULT WINAPI d3dx9_skin_info_ConvertToIndexedBlendedMesh(ID3DXSkinInfo *iface, ID3DXMesh *mesh_in, DWORD options, DWORD palette_size, const DWORD *adjacency_in, DWORD *adjacency_out, DWORD *face_remap, ID3DXBuffer **vertex_remap, DWORD *max_face_infl, DWORD *num_bone_combinations, ID3DXBuffer **bone_combination_table, ID3DXMesh **mesh_out)
Definition: skin.c:505
static const struct ID3DXSkinInfoVtbl d3dx9_skin_info_vtbl
Definition: skin.c:518
static HRESULT WINAPI d3dx9_skin_info_SetBoneInfluence(ID3DXSkinInfo *iface, DWORD bone_num, DWORD num_influences, const DWORD *vertices, const float *weights)
Definition: skin.c:107
static HRESULT WINAPI d3dx9_skin_info_GetDeclaration(ID3DXSkinInfo *iface, D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE])
Definition: skin.c:391
static HRESULT WINAPI d3dx9_skin_info_SetBoneVertexInfluence(ID3DXSkinInfo *iface, DWORD bone_num, DWORD influence_num, float weight)
Definition: skin.c:143
static HRESULT WINAPI d3dx9_skin_info_GetMaxVertexInfluences(ID3DXSkinInfo *iface, DWORD *max_vertex_influences)
Definition: skin.c:196
static HRESULT WINAPI d3dx9_skin_info_GetBoneVertexInfluence(ID3DXSkinInfo *iface, DWORD bone_num, DWORD influence_num, float *weight, DWORD *vertex_num)
Definition: skin.c:187
static ULONG WINAPI d3dx9_skin_info_Release(ID3DXSkinInfo *iface)
Definition: skin.c:83
static HRESULT WINAPI d3dx9_skin_info_SetBoneOffsetMatrix(ID3DXSkinInfo *iface, DWORD bone_num, const D3DXMATRIX *bone_transform)
Definition: skin.c:278
static struct d3dx9_skin_info * impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
Definition: skin.c:52
static HRESULT WINAPI d3dx9_skin_info_GetMaxFaceInfluences(struct ID3DXSkinInfo *iface, struct IDirect3DIndexBuffer9 *index_buffer, DWORD num_faces, DWORD *max_face_influences)
Definition: skin.c:221
static D3DXMATRIX *WINAPI d3dx9_skin_info_GetBoneOffsetMatrix(ID3DXSkinInfo *iface, DWORD bone_num)
Definition: skin.c:292
static HRESULT WINAPI d3dx9_skin_info_QueryInterface(ID3DXSkinInfo *iface, REFIID riid, void **out)
Definition: skin.c:57
HRESULT WINAPI D3DXCreateSkinInfo(DWORD num_vertices, const D3DVERTEXELEMENT9 *declaration, DWORD num_bones, ID3DXSkinInfo **skin_info)
Definition: skin.c:549
static DWORD WINAPI d3dx9_skin_info_GetNumBoneInfluences(ID3DXSkinInfo *iface, DWORD bone_num)
Definition: skin.c:152
HRESULT WINAPI D3DXCreateSkinInfoFVF(DWORD num_vertices, DWORD fvf, DWORD num_bones, ID3DXSkinInfo **skin_info)
Definition: skin.c:591
static HRESULT WINAPI d3dx9_skin_info_UpdateSkinnedMesh(ID3DXSkinInfo *iface, const D3DXMATRIX *bone_transforms, const D3DXMATRIX *bone_inv_transpose_transforms, const void *src_vertices, void *dst_vertices)
Definition: skin.c:404
static HRESULT WINAPI d3dx9_skin_info_SetBoneName(ID3DXSkinInfo *iface, DWORD bone_idx, const char *name)
Definition: skin.c:244
static HRESULT WINAPI d3dx9_skin_info_Remap(ID3DXSkinInfo *iface, DWORD num_vertices, DWORD *vertex_remap)
Definition: skin.c:335
static ULONG WINAPI d3dx9_skin_info_AddRef(ID3DXSkinInfo *iface)
Definition: skin.c:73
static HRESULT WINAPI d3dx9_skin_info_SetMinBoneInfluence(ID3DXSkinInfo *iface, float min_influence)
Definition: skin.c:230
static HRESULT WINAPI d3dx9_skin_info_SetDeclaration(ID3DXSkinInfo *iface, const D3DVERTEXELEMENT9 *declaration)
Definition: skin.c:355
static DWORD WINAPI d3dx9_skin_info_GetNumBones(ID3DXSkinInfo *iface)
Definition: skin.c:203
static DWORD WINAPI d3dx9_skin_info_GetFVF(ID3DXSkinInfo *iface)
Definition: skin.c:382
#define TRACE(s)
Definition: solgame.cpp:4
Definition: skin.c:32
FLOAT * weights
Definition: skin.c:37
char * name
Definition: skin.c:33
DWORD * vertices
Definition: skin.c:36
D3DXMATRIX transform
Definition: skin.c:34
DWORD num_influences
Definition: skin.c:35
struct bone * bones
Definition: skin.c:49
ID3DXSkinInfo ID3DXSkinInfo_iface
Definition: skin.c:42
DWORD fvf
Definition: skin.c:45
LONG ref
Definition: skin.c:43
DWORD num_vertices
Definition: skin.c:47
D3DVERTEXELEMENT9 vertex_declaration[MAX_FVF_DECL_SIZE]
Definition: skin.c:46
DWORD num_bones
Definition: skin.c:48
Definition: name.c:39
float FLOAT
Definition: typedefs.h:69
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
unsigned char BYTE
Definition: xxhash.c:193