ReactOS  0.4.15-dev-3193-g74513a7
skin.c File Reference
#include "d3dx9_private.h"
Include dependency graph for skin.c:

Go to the source code of this file.

Classes

struct  bone
 
struct  d3dx9_skin_info
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3dx)
 
static struct d3dx9_skin_infoimpl_from_ID3DXSkinInfo (ID3DXSkinInfo *iface)
 
static HRESULT WINAPI d3dx9_skin_info_QueryInterface (ID3DXSkinInfo *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3dx9_skin_info_AddRef (ID3DXSkinInfo *iface)
 
static ULONG WINAPI d3dx9_skin_info_Release (ID3DXSkinInfo *iface)
 
static HRESULT WINAPI d3dx9_skin_info_SetBoneInfluence (ID3DXSkinInfo *iface, DWORD bone_num, DWORD num_influences, const DWORD *vertices, const float *weights)
 
static HRESULT WINAPI d3dx9_skin_info_SetBoneVertexInfluence (ID3DXSkinInfo *iface, DWORD bone_num, DWORD influence_num, float weight)
 
static DWORD WINAPI d3dx9_skin_info_GetNumBoneInfluences (ID3DXSkinInfo *iface, DWORD bone_num)
 
static HRESULT WINAPI d3dx9_skin_info_GetBoneInfluence (ID3DXSkinInfo *iface, DWORD bone_num, DWORD *vertices, float *weights)
 
static HRESULT WINAPI d3dx9_skin_info_GetBoneVertexInfluence (ID3DXSkinInfo *iface, DWORD bone_num, DWORD influence_num, float *weight, DWORD *vertex_num)
 
static HRESULT WINAPI d3dx9_skin_info_GetMaxVertexInfluences (ID3DXSkinInfo *iface, DWORD *max_vertex_influences)
 
static DWORD WINAPI d3dx9_skin_info_GetNumBones (ID3DXSkinInfo *iface)
 
static HRESULT WINAPI d3dx9_skin_info_FindBoneVertexInfluenceIndex (ID3DXSkinInfo *iface, DWORD bone_num, DWORD vertex_num, DWORD *influence_index)
 
static HRESULT WINAPI d3dx9_skin_info_GetMaxFaceInfluences (struct ID3DXSkinInfo *iface, struct IDirect3DIndexBuffer9 *index_buffer, DWORD num_faces, DWORD *max_face_influences)
 
static HRESULT WINAPI d3dx9_skin_info_SetMinBoneInfluence (ID3DXSkinInfo *iface, float min_influence)
 
static float WINAPI d3dx9_skin_info_GetMinBoneInfluence (ID3DXSkinInfo *iface)
 
static HRESULT WINAPI d3dx9_skin_info_SetBoneName (ID3DXSkinInfo *iface, DWORD bone_idx, const char *name)
 
static const char *WINAPI d3dx9_skin_info_GetBoneName (ID3DXSkinInfo *iface, DWORD bone_idx)
 
static HRESULT WINAPI d3dx9_skin_info_SetBoneOffsetMatrix (ID3DXSkinInfo *iface, DWORD bone_num, const D3DXMATRIX *bone_transform)
 
static D3DXMATRIX *WINAPI d3dx9_skin_info_GetBoneOffsetMatrix (ID3DXSkinInfo *iface, DWORD bone_num)
 
static HRESULT WINAPI d3dx9_skin_info_Clone (ID3DXSkinInfo *iface, ID3DXSkinInfo **skin_info)
 
static HRESULT WINAPI d3dx9_skin_info_Remap (ID3DXSkinInfo *iface, DWORD num_vertices, DWORD *vertex_remap)
 
static HRESULT WINAPI d3dx9_skin_info_SetFVF (ID3DXSkinInfo *iface, DWORD fvf)
 
static HRESULT WINAPI d3dx9_skin_info_SetDeclaration (ID3DXSkinInfo *iface, const D3DVERTEXELEMENT9 *declaration)
 
static DWORD WINAPI d3dx9_skin_info_GetFVF (ID3DXSkinInfo *iface)
 
static HRESULT WINAPI d3dx9_skin_info_GetDeclaration (ID3DXSkinInfo *iface, D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE])
 
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)
 
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)
 
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)
 
HRESULT WINAPI D3DXCreateSkinInfo (DWORD num_vertices, const D3DVERTEXELEMENT9 *declaration, DWORD num_bones, ID3DXSkinInfo **skin_info)
 
HRESULT WINAPI D3DXCreateSkinInfoFVF (DWORD num_vertices, DWORD fvf, DWORD num_bones, ID3DXSkinInfo **skin_info)
 

Variables

static const struct ID3DXSkinInfoVtbl d3dx9_skin_info_vtbl
 

Function Documentation

◆ d3dx9_skin_info_AddRef()

static ULONG WINAPI d3dx9_skin_info_AddRef ( ID3DXSkinInfo *  iface)
static

Definition at line 73 of file skin.c.

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 }
#define TRACE(s)
Definition: solgame.cpp:4
LONG ref
Definition: skin.c:43
#define InterlockedIncrement
Definition: armddk.h:53
static struct d3dx9_skin_info * impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
Definition: skin.c:52
unsigned int ULONG
Definition: retypes.h:1

◆ d3dx9_skin_info_Clone()

static HRESULT WINAPI d3dx9_skin_info_Clone ( ID3DXSkinInfo *  iface,
ID3DXSkinInfo **  skin_info 
)
static

Definition at line 304 of file skin.c.

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 }
struct bone * bones
Definition: skin.c:49
Definition: skin.c:31
D3DVERTEXELEMENT9 vertex_declaration[MAX_FVF_DECL_SIZE]
Definition: skin.c:46
HRESULT hr
Definition: shlfolder.c:183
DWORD num_vertices
Definition: skin.c:47
ULONG Release()
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
HRESULT WINAPI D3DXCreateSkinInfo(DWORD num_vertices, const D3DVERTEXELEMENT9 *declaration, DWORD num_bones, ID3DXSkinInfo **skin_info)
Definition: skin.c:549
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
FLOAT * weights
Definition: skin.c:37
static struct d3dx9_skin_info * impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
Definition: skin.c:52
DWORD * vertices
Definition: skin.c:36
DWORD num_influences
Definition: skin.c:35
DWORD num_bones
Definition: skin.c:48
char * name
Definition: skin.c:33
D3DXMATRIX transform
Definition: skin.c:34

◆ d3dx9_skin_info_ConvertToBlendedMesh()

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 
)
static

Definition at line 492 of file skin.c.

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 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_skin_info_ConvertToIndexedBlendedMesh()

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 
)
static

Definition at line 505 of file skin.c.

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 }
#define FIXME(fmt,...)
Definition: debug.h:111
static unsigned int palette_size(DWORD flags)
Definition: palette.c:241
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_skin_info_FindBoneVertexInfluenceIndex()

static HRESULT WINAPI d3dx9_skin_info_FindBoneVertexInfluenceIndex ( ID3DXSkinInfo *  iface,
DWORD  bone_num,
DWORD  vertex_num,
DWORD influence_index 
)
static

Definition at line 212 of file skin.c.

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 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_skin_info_GetBoneInfluence()

static HRESULT WINAPI d3dx9_skin_info_GetBoneInfluence ( ID3DXSkinInfo *  iface,
DWORD  bone_num,
DWORD vertices,
float weights 
)
static

Definition at line 164 of file skin.c.

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 }
struct bone * bones
Definition: skin.c:49
Definition: skin.c:31
#define D3DERR_INVALIDCALL
#define TRACE(s)
Definition: solgame.cpp:4
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define D3D_OK
Definition: d3d.h:106
FLOAT * weights
Definition: skin.c:37
static struct d3dx9_skin_info * impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
Definition: skin.c:52
DWORD * vertices
Definition: skin.c:36
const GLbyte * weights
Definition: glext.h:6523
DWORD num_influences
Definition: skin.c:35
DWORD num_bones
Definition: skin.c:48

◆ d3dx9_skin_info_GetBoneName()

static const char* WINAPI d3dx9_skin_info_GetBoneName ( ID3DXSkinInfo *  iface,
DWORD  bone_idx 
)
static

Definition at line 266 of file skin.c.

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 }
struct bone * bones
Definition: skin.c:49
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112
static struct d3dx9_skin_info * impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
Definition: skin.c:52
DWORD num_bones
Definition: skin.c:48

◆ d3dx9_skin_info_GetBoneOffsetMatrix()

static D3DXMATRIX* WINAPI d3dx9_skin_info_GetBoneOffsetMatrix ( ID3DXSkinInfo *  iface,
DWORD  bone_num 
)
static

Definition at line 292 of file skin.c.

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 }
struct bone * bones
Definition: skin.c:49
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112
static struct d3dx9_skin_info * impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
Definition: skin.c:52
DWORD num_bones
Definition: skin.c:48

◆ d3dx9_skin_info_GetBoneVertexInfluence()

static HRESULT WINAPI d3dx9_skin_info_GetBoneVertexInfluence ( ID3DXSkinInfo *  iface,
DWORD  bone_num,
DWORD  influence_num,
float weight,
DWORD vertex_num 
)
static

Definition at line 187 of file skin.c.

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 }
#define FIXME(fmt,...)
Definition: debug.h:111
weight
Definition: sortkey.c:156
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_skin_info_GetDeclaration()

static HRESULT WINAPI d3dx9_skin_info_GetDeclaration ( ID3DXSkinInfo *  iface,
D3DVERTEXELEMENT9  declaration[MAX_FVF_DECL_SIZE] 
)
static

Definition at line 391 of file skin.c.

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);
400  memcpy(declaration, skin->vertex_declaration, count * sizeof(declaration[0]));
401  return D3D_OK;
402 }
D3DVERTEXELEMENT9 vertex_declaration[MAX_FVF_DECL_SIZE]
Definition: skin.c:46
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define TRACE(s)
Definition: solgame.cpp:4
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define D3D_OK
Definition: d3d.h:106
unsigned int UINT
Definition: ndis.h:50
static struct d3dx9_skin_info * impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
Definition: skin.c:52

◆ d3dx9_skin_info_GetFVF()

static DWORD WINAPI d3dx9_skin_info_GetFVF ( ID3DXSkinInfo *  iface)
static

Definition at line 382 of file skin.c.

383 {
384  struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface);
385 
386  TRACE("iface %p.\n", iface);
387 
388  return skin->fvf;
389 }
DWORD fvf
Definition: skin.c:45
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3dx9_skin_info * impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
Definition: skin.c:52

◆ d3dx9_skin_info_GetMaxFaceInfluences()

static HRESULT WINAPI d3dx9_skin_info_GetMaxFaceInfluences ( struct ID3DXSkinInfo *  iface,
struct IDirect3DIndexBuffer9 *  index_buffer,
DWORD  num_faces,
DWORD max_face_influences 
)
static

Definition at line 221 of file skin.c.

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 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_skin_info_GetMaxVertexInfluences()

static HRESULT WINAPI d3dx9_skin_info_GetMaxVertexInfluences ( ID3DXSkinInfo *  iface,
DWORD max_vertex_influences 
)
static

Definition at line 196 of file skin.c.

197 {
198  FIXME("iface %p, max_vertex_influences %p stub!\n", iface, max_vertex_influences);
199 
200  return E_NOTIMPL;
201 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_skin_info_GetMinBoneInfluence()

static float WINAPI d3dx9_skin_info_GetMinBoneInfluence ( ID3DXSkinInfo *  iface)
static

Definition at line 237 of file skin.c.

238 {
239  FIXME("iface %p stub!\n", iface);
240 
241  return 0.0f;
242 }
#define FIXME(fmt,...)
Definition: debug.h:111

◆ d3dx9_skin_info_GetNumBoneInfluences()

static DWORD WINAPI d3dx9_skin_info_GetNumBoneInfluences ( ID3DXSkinInfo *  iface,
DWORD  bone_num 
)
static

Definition at line 152 of file skin.c.

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 }
struct bone * bones
Definition: skin.c:49
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3dx9_skin_info * impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
Definition: skin.c:52
DWORD num_bones
Definition: skin.c:48

◆ d3dx9_skin_info_GetNumBones()

static DWORD WINAPI d3dx9_skin_info_GetNumBones ( ID3DXSkinInfo *  iface)
static

Definition at line 203 of file skin.c.

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 }
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3dx9_skin_info * impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
Definition: skin.c:52
DWORD num_bones
Definition: skin.c:48

◆ d3dx9_skin_info_QueryInterface()

static HRESULT WINAPI d3dx9_skin_info_QueryInterface ( ID3DXSkinInfo *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 57 of file skin.c.

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 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:112
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
static FILE * out
Definition: regtests2xml.c:44
#define D3D_OK
Definition: d3d.h:106
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ d3dx9_skin_info_Release()

static ULONG WINAPI d3dx9_skin_info_Release ( ID3DXSkinInfo *  iface)
static

Definition at line 83 of file skin.c.

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 }
struct bone * bones
Definition: skin.c:49
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
LONG ref
Definition: skin.c:43
unsigned long DWORD
Definition: ntddk_ex.h:95
#define InterlockedDecrement
Definition: armddk.h:52
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
static struct d3dx9_skin_info * impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
Definition: skin.c:52
unsigned int ULONG
Definition: retypes.h:1
DWORD num_bones
Definition: skin.c:48
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ d3dx9_skin_info_Remap()

static HRESULT WINAPI d3dx9_skin_info_Remap ( ID3DXSkinInfo *  iface,
DWORD  num_vertices,
DWORD vertex_remap 
)
static

Definition at line 335 of file skin.c.

336 {
337  FIXME("iface %p, num_vertices %u, vertex_remap %p stub!\n", iface, num_vertices, vertex_remap);
338 
339  return E_NOTIMPL;
340 }
DWORD num_vertices
Definition: skin.c:47
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_skin_info_SetBoneInfluence()

static HRESULT WINAPI d3dx9_skin_info_SetBoneInfluence ( ID3DXSkinInfo *  iface,
DWORD  bone_num,
DWORD  num_influences,
const DWORD vertices,
const float weights 
)
static

Definition at line 107 of file skin.c.

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 }
struct bone * bones
Definition: skin.c:49
Definition: skin.c:31
#define D3DERR_INVALIDCALL
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define D3D_OK
Definition: d3d.h:106
#define NULL
Definition: types.h:112
FLOAT * weights
Definition: skin.c:37
static struct d3dx9_skin_info * impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
Definition: skin.c:52
float FLOAT
Definition: typedefs.h:69
DWORD * vertices
Definition: skin.c:36
const GLbyte * weights
Definition: glext.h:6523
DWORD num_influences
Definition: skin.c:35
DWORD num_bones
Definition: skin.c:48
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ d3dx9_skin_info_SetBoneName()

static HRESULT WINAPI d3dx9_skin_info_SetBoneName ( ID3DXSkinInfo *  iface,
DWORD  bone_idx,
const char name 
)
static

Definition at line 244 of file skin.c.

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 }
struct bone * bones
Definition: skin.c:49
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define D3DERR_INVALIDCALL
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define debugstr_a
Definition: kernel32.h:31
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define D3D_OK
Definition: d3d.h:106
static struct d3dx9_skin_info * impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
Definition: skin.c:52
Definition: name.c:38
DWORD num_bones
Definition: skin.c:48
#define HeapFree(x, y, z)
Definition: compat.h:594

◆ d3dx9_skin_info_SetBoneOffsetMatrix()

static HRESULT WINAPI d3dx9_skin_info_SetBoneOffsetMatrix ( ID3DXSkinInfo *  iface,
DWORD  bone_num,
const D3DXMATRIX bone_transform 
)
static

Definition at line 278 of file skin.c.

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 }
struct bone * bones
Definition: skin.c:49
#define D3DERR_INVALIDCALL
#define TRACE(s)
Definition: solgame.cpp:4
#define D3D_OK
Definition: d3d.h:106
static struct d3dx9_skin_info * impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
Definition: skin.c:52
DWORD num_bones
Definition: skin.c:48

◆ d3dx9_skin_info_SetBoneVertexInfluence()

static HRESULT WINAPI d3dx9_skin_info_SetBoneVertexInfluence ( ID3DXSkinInfo *  iface,
DWORD  bone_num,
DWORD  influence_num,
float  weight 
)
static

Definition at line 143 of file skin.c.

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 }
#define FIXME(fmt,...)
Definition: debug.h:111
weight
Definition: sortkey.c:156
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_skin_info_SetDeclaration()

static HRESULT WINAPI d3dx9_skin_info_SetDeclaration ( ID3DXSkinInfo *  iface,
const D3DVERTEXELEMENT9 declaration 
)
static

Definition at line 355 of file skin.c.

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 
376  if (FAILED(hr = D3DXFVFFromDeclarator(skin->vertex_declaration, &skin->fvf)))
377  skin->fvf = 0;
378 
379  return D3D_OK;
380 }
D3DVERTEXELEMENT9 vertex_declaration[MAX_FVF_DECL_SIZE]
Definition: skin.c:46
HRESULT hr
Definition: shlfolder.c:183
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define WARN(fmt,...)
Definition: debug.h:112
#define D3DERR_INVALIDCALL
DWORD fvf
Definition: skin.c:45
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
HRESULT WINAPI D3DXFVFFromDeclarator(const D3DVERTEXELEMENT9 *declaration, DWORD *fvf)
Definition: mesh.c:2134
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define D3D_OK
Definition: d3d.h:106
static struct d3dx9_skin_info * impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
Definition: skin.c:52
_Inout_opt_ PUNICODE_STRING _Inout_opt_ PUNICODE_STRING Stream
Definition: fltkernel.h:1092

Referenced by D3DXCreateSkinInfo().

◆ d3dx9_skin_info_SetFVF()

static HRESULT WINAPI d3dx9_skin_info_SetFVF ( ID3DXSkinInfo *  iface,
DWORD  fvf 
)
static

Definition at line 342 of file skin.c.

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 }
HRESULT hr
Definition: shlfolder.c:183
DWORD fvf
Definition: skin.c:45
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
HRESULT WINAPI D3DXDeclaratorFromFVF(DWORD fvf, D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE])
Definition: mesh.c:2036

◆ d3dx9_skin_info_SetMinBoneInfluence()

static HRESULT WINAPI d3dx9_skin_info_SetMinBoneInfluence ( ID3DXSkinInfo *  iface,
float  min_influence 
)
static

Definition at line 230 of file skin.c.

231 {
232  FIXME("iface %p, min_influence %.8e stub!\n", iface, min_influence);
233 
234  return E_NOTIMPL;
235 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ d3dx9_skin_info_UpdateSkinnedMesh()

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 
)
static

Definition at line 404 of file skin.c.

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 }
struct bone * bones
Definition: skin.c:49
D3DXVECTOR3 *WINAPI D3DXVec3TransformNormal(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv, const D3DXMATRIX *pm)
Definition: math.c:1928
GLuint GLenum matrix
Definition: glext.h:9407
D3DXMATRIX *WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, const D3DXMATRIX *pm1, const D3DXMATRIX *pm2)
Definition: math.c:397
#define D3DFVF_NORMAL
Definition: d3d8types.h:120
DWORD num_vertices
Definition: skin.c:47
UINT WINAPI D3DXGetFVFVertexSize(DWORD FVF)
Definition: mesh.c:2289
#define E_FAIL
Definition: ddrawi.h:102
DWORD fvf
Definition: skin.c:45
#define D3DFVF_POSITION_MASK
Definition: d3d8types.h:112
#define FIXME(fmt,...)
Definition: debug.h:111
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
D3DXMATRIX *WINAPI D3DXMatrixInverse(D3DXMATRIX *pout, FLOAT *pdeterminant, const D3DXMATRIX *pm)
Definition: math.c:258
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define D3DFVF_XYZ
Definition: d3d8types.h:113
struct _D3DVECTOR D3DXVECTOR3
Definition: d3dx9math.h:97
unsigned long DWORD
Definition: ntddk_ex.h:95
D3DXVECTOR3 *WINAPI D3DXVec3TransformCoord(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv, const D3DXMATRIX *pm)
Definition: math.c:1895
unsigned char BYTE
Definition: xxhash.c:193
#define D3D_OK
Definition: d3d.h:106
weight
Definition: sortkey.c:156
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
#define NULL
Definition: types.h:112
static struct d3dx9_skin_info * impl_from_ID3DXSkinInfo(ID3DXSkinInfo *iface)
Definition: skin.c:52
float FLOAT
Definition: typedefs.h:69
DWORD num_bones
Definition: skin.c:48
D3DXVECTOR3 *WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv)
Definition: math.c:1805

◆ D3DXCreateSkinInfo()

HRESULT WINAPI D3DXCreateSkinInfo ( DWORD  num_vertices,
const D3DVERTEXELEMENT9 declaration,
DWORD  num_bones,
ID3DXSkinInfo **  skin_info 
)

Definition at line 549 of file skin.c.

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) {
575  hr = E_OUTOFMEMORY;
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;
585 error:
586  HeapFree(GetProcessHeap(), 0, object->bones);
587  HeapFree(GetProcessHeap(), 0, object);
588  return hr;
589 }
static const struct ID3DXSkinInfoVtbl d3dx9_skin_info_vtbl
Definition: skin.c:518
HRESULT hr
Definition: shlfolder.c:183
#define error(str)
Definition: mkdosfs.c:1605
#define D3DERR_INVALIDCALL
DWORD num_vertices
Definition: skin.c:47
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:79
static HRESULT WINAPI d3dx9_skin_info_SetDeclaration(ID3DXSkinInfo *iface, const D3DVERTEXELEMENT9 *declaration)
Definition: skin.c:355
#define D3DDECL_END()
Definition: d3d9types.h:311
#define D3D_OK
Definition: d3d.h:106
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
DWORD num_bones
Definition: skin.c:48
#define HeapFree(x, y, z)
Definition: compat.h:594

Referenced by d3dx9_skin_info_Clone(), D3DXCreateSkinInfoFVF(), and test_create_skin_info().

◆ D3DXCreateSkinInfoFVF()

HRESULT WINAPI D3DXCreateSkinInfoFVF ( DWORD  num_vertices,
DWORD  fvf,
DWORD  num_bones,
ID3DXSkinInfo **  skin_info 
)

Definition at line 591 of file skin.c.

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 }
HRESULT hr
Definition: shlfolder.c:183
DWORD num_vertices
Definition: skin.c:47
DWORD fvf
Definition: skin.c:45
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
HRESULT WINAPI D3DXCreateSkinInfo(DWORD num_vertices, const D3DVERTEXELEMENT9 *declaration, DWORD num_bones, ID3DXSkinInfo **skin_info)
Definition: skin.c:549
HRESULT WINAPI D3DXDeclaratorFromFVF(DWORD fvf, D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE])
Definition: mesh.c:2036
DWORD num_bones
Definition: skin.c:48

Referenced by parse_mesh(), parse_skin_mesh_info(), test_create_skin_info(), and test_update_skinned_mesh().

◆ impl_from_ID3DXSkinInfo()

static struct d3dx9_skin_info* impl_from_ID3DXSkinInfo ( ID3DXSkinInfo *  iface)
inlinestatic

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3dx  )

Variable Documentation

◆ d3dx9_skin_info_vtbl

const struct ID3DXSkinInfoVtbl d3dx9_skin_info_vtbl
static
Initial value:
=
{
}
static DWORD WINAPI d3dx9_skin_info_GetNumBones(ID3DXSkinInfo *iface)
Definition: skin.c:203
static HRESULT WINAPI d3dx9_skin_info_GetMaxVertexInfluences(ID3DXSkinInfo *iface, DWORD *max_vertex_influences)
Definition: skin.c:196
static D3DXMATRIX *WINAPI d3dx9_skin_info_GetBoneOffsetMatrix(ID3DXSkinInfo *iface, DWORD bone_num)
Definition: skin.c:292
static HRESULT WINAPI d3dx9_skin_info_Remap(ID3DXSkinInfo *iface, DWORD num_vertices, DWORD *vertex_remap)
Definition: skin.c:335
static DWORD WINAPI d3dx9_skin_info_GetNumBoneInfluences(ID3DXSkinInfo *iface, DWORD bone_num)
Definition: skin.c:152
static HRESULT WINAPI d3dx9_skin_info_QueryInterface(ID3DXSkinInfo *iface, REFIID riid, void **out)
Definition: skin.c:57
static HRESULT WINAPI d3dx9_skin_info_SetMinBoneInfluence(ID3DXSkinInfo *iface, float min_influence)
Definition: skin.c:230
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_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_FindBoneVertexInfluenceIndex(ID3DXSkinInfo *iface, DWORD bone_num, DWORD vertex_num, DWORD *influence_index)
Definition: skin.c:212
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 float WINAPI d3dx9_skin_info_GetMinBoneInfluence(ID3DXSkinInfo *iface)
Definition: skin.c:237
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 DWORD WINAPI d3dx9_skin_info_GetFVF(ID3DXSkinInfo *iface)
Definition: skin.c:382
static HRESULT WINAPI d3dx9_skin_info_SetBoneOffsetMatrix(ID3DXSkinInfo *iface, DWORD bone_num, const D3DXMATRIX *bone_transform)
Definition: skin.c:278
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_SetBoneName(ID3DXSkinInfo *iface, DWORD bone_idx, const char *name)
Definition: skin.c:244
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 HRESULT WINAPI d3dx9_skin_info_SetDeclaration(ID3DXSkinInfo *iface, const D3DVERTEXELEMENT9 *declaration)
Definition: skin.c:355
static const char *WINAPI d3dx9_skin_info_GetBoneName(ID3DXSkinInfo *iface, DWORD bone_idx)
Definition: skin.c:266
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_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 HRESULT WINAPI d3dx9_skin_info_Clone(ID3DXSkinInfo *iface, ID3DXSkinInfo **skin_info)
Definition: skin.c:304
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_AddRef(ID3DXSkinInfo *iface)
Definition: skin.c:73
static ULONG WINAPI d3dx9_skin_info_Release(ID3DXSkinInfo *iface)
Definition: skin.c:83

Definition at line 518 of file skin.c.

Referenced by D3DXCreateSkinInfo().