ReactOS  0.4.12-dev-708-g95ed44e
d3dx9mesh.h File Reference
#include <d3dx9.h>
Include dependency graph for d3dx9mesh.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _D3DXATTRIBUTERANGE
 
struct  _D3DXMATERIAL
 
struct  _D3DXEFFECTDEFAULT
 
struct  _D3DXEFFECTINSTANCE
 
struct  _D3DXATTRIBUTEWEIGHTS
 
struct  _D3DXWELDEPSILONS
 
struct  _D3DXBONECOMBINATION
 
struct  _D3DXPATCHINFO
 
struct  _D3DXINTERSECTINFO
 
struct  _D3DXSHMATERIAL
 
struct  _D3DXSHPRTSPLITMESHVERTDATA
 
struct  _D3DXSHPRTSPLITMESHCLUSTERDATA
 
struct  _XFILECOMPRESSEDANIMATIONSET
 

Macros

#define UNUSED16   (0xffff)
 
#define UNUSED32   (0xffffffff)
 
#define INTERFACE   ID3DXBaseMesh
 
#define INTERFACE   ID3DXMesh
 
#define INTERFACE   ID3DXPMesh
 
#define INTERFACE   ID3DXSPMesh
 
#define INTERFACE   ID3DXPatchMesh
 
#define INTERFACE   ID3DXSkinInfo
 
#define INTERFACE   ID3DXPRTBuffer
 
#define INTERFACE   ID3DXPRTCompBuffer
 
#define INTERFACE   ID3DXTextureGutterHelper
 
#define INTERFACE   ID3DXPRTEngine
 
#define D3DXLoadMeshFromX   WINELIB_NAME_AW(D3DXLoadMeshFromX)
 
#define D3DXLoadPRTBufferFromFile   WINELIB_NAME_AW(D3DXLoadPRTBufferFromFile)
 
#define D3DXLoadPRTCompBufferFromFile   WINELIB_NAME_AW(D3DXLoadPRTCompBufferFromFile)
 
#define D3DXSaveMeshToX   WINELIB_NAME_AW(D3DXSaveMeshToX)
 
#define D3DXSavePRTBufferToFile   WINELIB_NAME_AW(D3DXSavePRTBufferToFile)
 
#define D3DXSavePRTCompBufferToFile   WINELIB_NAME_AW(D3DXSavePRTCompBufferToFile)
 
#define XSKINEXP_TEMPLATES   "xof 0303txt 0032\ template XSkinMeshHeader \ { \ <3CF169CE-FF7C-44ab-93C0-F78F62D172E2> \ WORD nMaxSkinWeightsPerVertex; \ WORD nMaxSkinWeightsPerFace; \ WORD nBones; \ } \ template VertexDuplicationIndices \ { \ <B8D65549-D7C9-4995-89CF-53A9A8B031E3> \ DWORD nIndices; \ DWORD nOriginalVertices; \ array DWORD indices[nIndices]; \ } \ template FaceAdjacency \ { \ <A64C844A-E282-4756-8B80-250CDE04398C> \ DWORD nIndices; \ array DWORD indices[nIndices]; \ } \ template SkinWeights \ { \ <6F0D123B-BAD2-4167-A0D0-80224F25FABB> \ STRING transformNodeName; \ DWORD nWeights; \ array DWORD vertexIndices[nWeights]; \ array float weights[nWeights]; \ Matrix4x4 matrixOffset; \ } \ template Patch \ { \ <A3EB5D44-FC22-429D-9AFB-3221CB9719A6> \ DWORD nControlIndices; \ array DWORD controlIndices[nControlIndices]; \ } \ template PatchMesh \ { \ <D02C95CC-EDBA-4305-9B5D-1820D7704BBF> \ DWORD nVertices; \ array Vector vertices[nVertices]; \ DWORD nPatches; \ array Patch patches[nPatches]; \ [ ... ] \ } \ template PatchMesh9 \ { \ <B9EC94E1-B9A6-4251-BA18-94893F02C0EA> \ DWORD Type; \ DWORD Degree; \ DWORD Basis; \ DWORD nVertices; \ array Vector vertices[nVertices]; \ DWORD nPatches; \ array Patch patches[nPatches]; \ [ ... ] \ } template EffectFloats \ { \ <F1CFE2B3-0DE3-4e28-AFA1-155A750A282D> \ DWORD nFloats; \ array float Floats[nFloats]; \ } \ template EffectString \ { \ <D55B097E-BDB6-4c52-B03D-6051C89D0E42> \ STRING Value; \ } \ template EffectDWord \ { \ <622C0ED0-956E-4da9-908A-2AF94F3CE716> \ DWORD Value; \ } template EffectParamFloats \ { \ <3014B9A0-62F5-478c-9B86-E4AC9F4E418B> \ STRING ParamName; \ DWORD nFloats; \ array float Floats[nFloats]; \ } template EffectParamString \ { \ <1DBC4C88-94C1-46ee-9076-2C28818C9481> \ STRING ParamName; \ STRING Value; \ } \ template EffectParamDWord \ { \ <E13963BC-AE51-4c5d-B00F-CFA3A9D97CE5> \ STRING ParamName; \ DWORD Value; \ } \ template EffectInstance \ { \ <E331F7E4-0559-4cc2-8E99-1CEC1657928F> \ STRING EffectFilename; \ [ ... ] \ } template AnimTicksPerSecond \ { \ <9E415A43-7BA6-4a73-8743-B73D47E88476> \ DWORD AnimTicksPerSecond; \ } \ template CompressedAnimationSet \ { \ <7F9B00B3-F125-4890-876E-1C42BF697C4D> \ DWORD CompressedBlockSize; \ FLOAT TicksPerSec; \ DWORD PlaybackType; \ DWORD BufferLength; \ array DWORD CompressedData[BufferLength]; \ } "
 
#define XEXTENSIONS_TEMPLATES   "xof 0303txt 0032\ template FVFData \ { \ <B6E70A0E-8EF9-4e83-94AD-ECC8B0C04897> \ DWORD dwFVF; \ DWORD nDWords; \ array DWORD data[nDWords]; \ } \ template VertexElement \ { \ <F752461C-1E23-48f6-B9F8-8350850F336F> \ DWORD Type; \ DWORD Method; \ DWORD Usage; \ DWORD UsageIndex; \ } \ template DeclData \ { \ <BF22E553-292C-4781-9FEA-62BD554BDD93> \ DWORD nElements; \ array VertexElement Elements[nElements]; \ DWORD nDWords; \ array DWORD data[nDWords]; \ } \ template PMAttributeRange \ { \ <917E0427-C61E-4a14-9C64-AFE65F9E9844> \ DWORD iFaceOffset; \ DWORD nFacesMin; \ DWORD nFacesMax; \ DWORD iVertexOffset; \ DWORD nVerticesMin; \ DWORD nVerticesMax; \ } \ template PMVSplitRecord \ { \ <574CCC14-F0B3-4333-822D-93E8A8A08E4C> \ DWORD iFaceCLW; \ DWORD iVlrOffset; \ DWORD iCode; \ } \ template PMInfo \ { \ <B6C3E656-EC8B-4b92-9B62-681659522947> \ DWORD nAttributes; \ array PMAttributeRange attributeRanges[nAttributes]; \ DWORD nMaxValence; \ DWORD nMinLogicalVertices; \ DWORD nMaxLogicalVertices; \ DWORD nVSplits; \ array PMVSplitRecord splitRecords[nVSplits]; \ DWORD nAttributeMispredicts; \ array DWORD attributeMispredicts[nAttributeMispredicts]; \ } "
 

Typedefs

typedef enum _D3DXPATCHMESHTYPE D3DXPATCHMESHTYPE
 
typedef enum D3DXCLEANTYPE D3DXCLEANTYPE
 
typedef enum _D3DXTANGENT D3DXTANGENT
 
typedef enum _D3DXIMT D3DXIMT
 
typedef enum _D3DXUVATLAS D3DXUVATLAS
 
typedef enum _D3DXEFFECTDEFAULTTYPE D3DXEFFECTDEFAULTTYPE
 
typedef enum _D3DXSHCOMPRESSQUALITYTYPE D3DXSHCOMPRESSQUALITYTYPE
 
typedef enum _D3DXSHGPUSIMOPT D3DXSHGPUSIMOPT
 
typedef struct ID3DXBaseMesh * LPD3DXBASEMESH
 
typedef struct ID3DXMesh * LPD3DXMESH
 
typedef struct ID3DXPMesh * LPD3DXPMESH
 
typedef struct ID3DXSPMesh * LPD3DXSPMESH
 
typedef struct ID3DXSkinInfo * LPD3DXSKININFO
 
typedef struct ID3DXPatchMesh * LPD3DXPATCHMESH
 
typedef struct ID3DXPRTBuffer * LPD3DXPRTBUFFER
 
typedef struct ID3DXPRTCompBuffer * LPD3DXPRTCOMPBUFFER
 
typedef struct ID3DXPRTEngine * LPD3DXPRTENGINE
 
typedef struct ID3DXTextureGutterHelper * LPD3DXTEXTUREGUTTERHELPER
 
typedef struct _D3DXATTRIBUTERANGE D3DXATTRIBUTERANGE
 
typedef D3DXATTRIBUTERANGELPD3DXATTRIBUTERANGE
 
typedef struct _D3DXMATERIAL D3DXMATERIAL
 
typedef struct _D3DXMATERIALLPD3DXMATERIAL
 
typedef struct _D3DXEFFECTDEFAULT D3DXEFFECTDEFAULT
 
typedef struct _D3DXEFFECTDEFAULTLPD3DXEFFECTDEFAULT
 
typedef struct _D3DXEFFECTINSTANCE D3DXEFFECTINSTANCE
 
typedef struct _D3DXEFFECTINSTANCELPD3DXEFFECTINSTANCE
 
typedef struct _D3DXATTRIBUTEWEIGHTS D3DXATTRIBUTEWEIGHTS
 
typedef struct _D3DXATTRIBUTEWEIGHTSLPD3DXATTRIBUTEWEIGHTS
 
typedef struct _D3DXWELDEPSILONS D3DXWELDEPSILONS
 
typedef struct _D3DXWELDEPSILONSLPD3DXWELDEPSILONS
 
typedef struct _D3DXBONECOMBINATION D3DXBONECOMBINATION
 
typedef struct _D3DXBONECOMBINATIONLPD3DXBONECOMBINATION
 
typedef struct _D3DXPATCHINFO D3DXPATCHINFO
 
typedef struct _D3DXPATCHINFOLPD3DXPATCHINFO
 
typedef struct _D3DXINTERSECTINFO D3DXINTERSECTINFO
 
typedef struct _D3DXINTERSECTINFOLPD3DXINTERSECTINFO
 
typedef struct _D3DXSHMATERIAL D3DXSHMATERIAL
 
typedef struct _D3DXSHPRTSPLITMESHVERTDATA D3DXSHPRTSPLITMESHVERTDATA
 
typedef struct _D3DXSHPRTSPLITMESHCLUSTERDATA D3DXSHPRTSPLITMESHCLUSTERDATA
 
typedef struct _XFILECOMPRESSEDANIMATIONSET XFILECOMPRESSEDANIMATIONSET
 
typedef HRESULT(WINAPILPD3DXUVATLASCB) (float complete, void *ctx)
 
typedef HRESULT(WINAPILPD3DXIMTSIGNALCALLBACK) (const D3DXVECTOR2 *, UINT, UINT, void *, FLOAT *)
 
typedef HRESULT(WINAPILPD3DXSHPRTSIMCB) (float complete, void *ctx)
 

Enumerations

enum  _MAX_FVF_DECL_SIZE { MAX_FVF_DECL_SIZE = MAXD3DDECLLENGTH + 1 }
 
enum  _D3DXMESH {
  D3DXMESH_32BIT = 0x001, D3DXMESH_DONOTCLIP = 0x002, D3DXMESH_POINTS = 0x004, D3DXMESH_RTPATCHES = 0x008,
  D3DXMESH_NPATCHES = 0x4000, D3DXMESH_VB_SYSTEMMEM = 0x010, D3DXMESH_VB_MANAGED = 0x020, D3DXMESH_VB_WRITEONLY = 0x040,
  D3DXMESH_VB_DYNAMIC = 0x080, D3DXMESH_VB_SOFTWAREPROCESSING = 0x8000, D3DXMESH_IB_SYSTEMMEM = 0x100, D3DXMESH_IB_MANAGED = 0x200,
  D3DXMESH_IB_WRITEONLY = 0x400, D3DXMESH_IB_DYNAMIC = 0x800, D3DXMESH_IB_SOFTWAREPROCESSING = 0x10000, D3DXMESH_VB_SHARE = 0x1000,
  D3DXMESH_USEHWONLY = 0x2000, D3DXMESH_SYSTEMMEM = 0x110, D3DXMESH_MANAGED = 0x220, D3DXMESH_WRITEONLY = 0x440,
  D3DXMESH_DYNAMIC = 0x880, D3DXMESH_SOFTWAREPROCESSING = 0x18000
}
 
enum  _D3DXMESHOPT {
  D3DXMESHOPT_DEVICEINDEPENDENT = 0x00400000, D3DXMESHOPT_COMPACT = 0x01000000, D3DXMESHOPT_ATTRSORT = 0x02000000, D3DXMESHOPT_VERTEXCACHE = 0x04000000,
  D3DXMESHOPT_STRIPREORDER = 0x08000000, D3DXMESHOPT_IGNOREVERTS = 0x10000000, D3DXMESHOPT_DONOTSPLIT = 0x20000000
}
 
enum  _D3DXPATCHMESHTYPE { D3DXPATCHMESH_RECT = 1, D3DXPATCHMESH_TRI = 2, D3DXPATCHMESH_NPATCH = 3, D3DXPATCHMESH_FORCE_DWORD = 0x7fffffff }
 
enum  _D3DXPATCHMESH { D3DXPATCHMESH_DEFAULT = 0 }
 
enum  _D3DXMESHSIMP { D3DXMESHSIMP_VERTEX = 0x1, D3DXMESHSIMP_FACE = 0x2 }
 
enum  D3DXCLEANTYPE {
  D3DXCLEAN_BACKFACING = 0x00000001, D3DXCLEAN_BOWTIES = 0x00000002, D3DXCLEAN_SKINNING = D3DXCLEAN_BACKFACING, D3DXCLEAN_OPTIMIZATION = D3DXCLEAN_BACKFACING,
  D3DXCLEAN_SIMPLIFICATION = D3DXCLEAN_BACKFACING | D3DXCLEAN_BOWTIES
}
 
enum  _D3DXTANGENT {
  D3DXTANGENT_WRAP_U = 0x0001, D3DXTANGENT_WRAP_V = 0x0002, D3DXTANGENT_WRAP_UV = 0x0003, D3DXTANGENT_DONT_NORMALIZE_PARTIALS = 0x0004,
  D3DXTANGENT_DONT_ORTHOGONALIZE = 0x0008, D3DXTANGENT_ORTHOGONALIZE_FROM_V = 0x0010, D3DXTANGENT_ORTHOGONALIZE_FROM_U = 0x0020, D3DXTANGENT_WEIGHT_BY_AREA = 0x0040,
  D3DXTANGENT_WEIGHT_EQUAL = 0x0080, D3DXTANGENT_WIND_CW = 0x0100, D3DXTANGENT_CALCULATE_NORMALS = 0x0200, D3DXTANGENT_GENERATE_IN_PLACE = 0x0400
}
 
enum  _D3DXIMT { D3DXIMT_WRAP_U = 0x01, D3DXIMT_WRAP_V = 0x02, D3DXIMT_WRAP_UV = 0x03 }
 
enum  _D3DXUVATLAS { D3DXUVATLAS_DEFAULT = 0x00, D3DXUVATLAS_GEODESIC_FAST = 0x01, D3DXUVATLAS_GEODESIC_QUALITY = 0x02 }
 
enum  _D3DXEFFECTDEFAULTTYPE { D3DXEDT_STRING = 1, D3DXEDT_FLOATS = 2, D3DXEDT_DWORD = 3, D3DXEDT_FORCEDWORD = 0x7fffffff }
 
enum  _D3DXWELDEPSILONSFLAGS { D3DXWELDEPSILONS_WELDALL = 0x1, D3DXWELDEPSILONS_WELDPARTIALMATCHES = 0x2, D3DXWELDEPSILONS_DONOTREMOVEVERTICES = 0x4, D3DXWELDEPSILONS_DONOTSPLIT = 0x8 }
 
enum  _D3DXSHCOMPRESSQUALITYTYPE { D3DXSHCQUAL_FASTLOWQUALITY = 1, D3DXSHCQUAL_SLOWHIGHQUALITY = 2, D3DXSHCQUAL_FORCE_DWORD = 0x7fffffff }
 
enum  _D3DXSHGPUSIMOPT {
  D3DXSHGPUSIMOPT_SHADOWRES256 = 1, D3DXSHGPUSIMOPT_SHADOWRES512 = 0, D3DXSHGPUSIMOPT_SHADOWRES1024 = 2, D3DXSHGPUSIMOPT_SHADOWRES2048 = 3,
  D3DXSHGPUSIMOPT_HIGHQUALITY = 4, D3DXSHGPUSIMOPT_FORCE_DWORD = 0x7fffffff
}
 

Functions

 DEFINE_GUID (IID_ID3DXBaseMesh, 0x7ed943dd, 0x52e8, 0x40b5, 0xa8, 0xd8, 0x76, 0x68, 0x5c, 0x40, 0x63, 0x30)
 
 DEFINE_GUID (IID_ID3DXMesh, 0x4020e5c2, 0x1403, 0x4929, 0x88, 0x3f, 0xe2, 0xe8, 0x49, 0xfa, 0xc1, 0x95)
 
 DEFINE_GUID (IID_ID3DXPMesh, 0x8875769a, 0xd579, 0x4088, 0xaa, 0xeb, 0x53, 0x4d, 0x1a, 0xd8, 0x4e, 0x96)
 
 DEFINE_GUID (IID_ID3DXSPMesh, 0x667ea4c7, 0xf1cd, 0x4386, 0xb5, 0x23, 0x7c, 0x02, 0x90, 0xb8, 0x3c, 0xc5)
 
 DEFINE_GUID (IID_ID3DXSkinInfo, 0x11eaa540, 0xf9a6, 0x4d49, 0xae, 0x6a, 0xe1, 0x92, 0x21, 0xf7, 0x0c, 0xc4)
 
 DEFINE_GUID (IID_ID3DXPatchMesh, 0x3ce6cc22, 0xdbf2, 0x44f4, 0x89, 0x4d, 0xf9, 0xc3, 0x4a, 0x33, 0x71, 0x39)
 
 DEFINE_GUID (IID_ID3DXPRTBuffer, 0xf1827e47, 0x00a8, 0x49cd, 0x90, 0x8c, 0x9d, 0x11, 0x95, 0x5f, 0x87, 0x28)
 
 DEFINE_GUID (IID_ID3DXPRTCompBuffer, 0xa758d465, 0xfe8d, 0x45ad, 0x9c, 0xf0, 0xd0, 0x1e, 0x56, 0x26, 0x6a, 0x07)
 
 DEFINE_GUID (IID_ID3DXTextureGutterHelper, 0x838f01ec, 0x9729, 0x4527, 0xaa, 0xdb, 0xdf, 0x70, 0xad, 0xe7, 0xfe, 0xa9)
 
 DEFINE_GUID (IID_ID3DXPRTEngine, 0x683a4278, 0xcd5f, 0x4d24, 0x90, 0xad, 0xc4, 0xe1, 0xb6, 0x85, 0x5d, 0x53)
 
 DECLARE_INTERFACE_ (ID3DXBaseMesh, IUnknown)
 
 DECLARE_INTERFACE_ (ID3DXMesh, ID3DXBaseMesh)
 
 DECLARE_INTERFACE_ (ID3DXPMesh, ID3DXBaseMesh)
 
 DECLARE_INTERFACE_ (ID3DXSPMesh, IUnknown)
 
 DECLARE_INTERFACE_ (ID3DXPatchMesh, IUnknown)
 
 DECLARE_INTERFACE_ (ID3DXSkinInfo, IUnknown)
 
 DECLARE_INTERFACE_ (ID3DXPRTBuffer, IUnknown)
 
 DECLARE_INTERFACE_ (ID3DXPRTCompBuffer, IUnknown)
 
 DECLARE_INTERFACE_ (ID3DXTextureGutterHelper, IUnknown)
 
 DECLARE_INTERFACE_ (ID3DXPRTEngine, IUnknown)
 
HRESULT WINAPI D3DXCreateMesh (DWORD face_count, DWORD vertex_count, DWORD flags, const D3DVERTEXELEMENT9 *declaration, struct IDirect3DDevice9 *device, struct ID3DXMesh **mesh)
 
HRESULT WINAPI D3DXCreateMeshFVF (DWORD face_count, DWORD vertex_count, DWORD flags, DWORD fvf, struct IDirect3DDevice9 *device, struct ID3DXMesh **mesh)
 
HRESULT WINAPI D3DXCreateBuffer (DWORD size, ID3DXBuffer **buffer)
 
HRESULT WINAPI D3DXCreateSPMesh (ID3DXMesh *mesh, const DWORD *adjacency, const D3DXATTRIBUTEWEIGHTS *attribute_weights, const float *vertex_weights, ID3DXSPMesh **spmesh)
 
HRESULT WINAPI D3DXCreatePMeshFromStream (struct IStream *stream, DWORD flags, struct IDirect3DDevice9 *device, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances, DWORD *material_count, struct ID3DXPMesh **mesh)
 
HRESULT WINAPI D3DXCreateSkinInfo (DWORD vertex_count, const D3DVERTEXELEMENT9 *declaration, DWORD bone_count, ID3DXSkinInfo **skin_info)
 
HRESULT WINAPI D3DXCreateSkinInfoFVF (DWORD vertex_count, DWORD fvf, DWORD bone_count, ID3DXSkinInfo **skin_info)
 
HRESULT WINAPI D3DXCreateSkinInfoFromBlendedMesh (ID3DXBaseMesh *mesh, DWORD bone_count, const D3DXBONECOMBINATION *bone_combination_table, ID3DXSkinInfo **skin_info)
 
HRESULT WINAPI D3DXCreatePatchMesh (const D3DXPATCHINFO *patch_info, DWORD patch_count, DWORD vertex_count, DWORD flags, const D3DVERTEXELEMENT9 *declaration, struct IDirect3DDevice9 *device, struct ID3DXPatchMesh **mesh)
 
HRESULT WINAPI D3DXCreatePRTBuffer (UINT sample_count, UINT coeff_count, UINT channel_count, ID3DXPRTBuffer **buffer)
 
HRESULT WINAPI D3DXCreatePRTBufferTex (UINT width, UINT height, UINT coeff_count, UINT channel_count, ID3DXPRTBuffer **buffer)
 
HRESULT WINAPI D3DXCreatePRTCompBuffer (D3DXSHCOMPRESSQUALITYTYPE quality, UINT cluster_count, UINT pca_count, LPD3DXSHPRTSIMCB cb, void *ctx, ID3DXPRTBuffer *input, ID3DXPRTCompBuffer **buffer)
 
HRESULT WINAPI D3DXCreateTextureGutterHelper (UINT width, UINT height, ID3DXMesh *mesh, float gutter_size, ID3DXTextureGutterHelper **gh)
 
HRESULT WINAPI D3DXCreatePRTEngine (ID3DXMesh *mesh, DWORD *adjacency, BOOL extract_uv, ID3DXMesh *blocker_mesh, ID3DXPRTEngine **engine)
 
HRESULT WINAPI D3DXLoadMeshFromXA (const char *filename, DWORD flags, struct IDirect3DDevice9 *device, struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances, DWORD *material_count, struct ID3DXMesh **mesh)
 
HRESULT WINAPI D3DXLoadMeshFromXW (const WCHAR *filename, DWORD flags, struct IDirect3DDevice9 *device, struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances, DWORD *material_count, struct ID3DXMesh **mesh)
 
HRESULT WINAPI D3DXLoadMeshFromXInMemory (const void *data, DWORD data_size, DWORD flags, struct IDirect3DDevice9 *device, struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances, DWORD *material_count, struct ID3DXMesh **mesh)
 
HRESULT WINAPI D3DXLoadMeshFromXResource (HMODULE module, const char *resource, const char *resource_type, DWORD flags, struct IDirect3DDevice9 *device, struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances, DWORD *material_count, struct ID3DXMesh **mesh)
 
HRESULT WINAPI D3DXLoadMeshFromXof (struct ID3DXFileData *file_data, DWORD flags, struct IDirect3DDevice9 *device, struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances, DWORD *material_count, struct ID3DXMesh **mesh)
 
HRESULT WINAPI D3DXLoadPatchMeshFromXof (struct ID3DXFileData *file_data, DWORD flags, struct IDirect3DDevice9 *device, struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances, DWORD *material_count, struct ID3DXPatchMesh **mesh)
 
HRESULT WINAPI D3DXLoadSkinMeshFromXof (struct ID3DXFileData *file_data, DWORD flags, struct IDirect3DDevice9 *device, struct ID3DXBuffer **adjacency, struct ID3DXBuffer **materials, struct ID3DXBuffer **effect_instances, DWORD *material_count, struct ID3DXSkinInfo **skin_info, struct ID3DXMesh **mesh)
 
HRESULT WINAPI D3DXLoadPRTBufferFromFileA (const char *filename, ID3DXPRTBuffer **buffer)
 
HRESULT WINAPI D3DXLoadPRTBufferFromFileW (const WCHAR *filename, ID3DXPRTBuffer **buffer)
 
HRESULT WINAPI D3DXLoadPRTCompBufferFromFileA (const char *filename, ID3DXPRTCompBuffer **buffer)
 
HRESULT WINAPI D3DXLoadPRTCompBufferFromFileW (const WCHAR *filename, ID3DXPRTCompBuffer **buffer)
 
HRESULT WINAPI D3DXSaveMeshToXA (const char *filename, ID3DXMesh *mesh, const DWORD *adjacency, const D3DXMATERIAL *materials, const D3DXEFFECTINSTANCE *effect_instances, DWORD material_count, DWORD format)
 
HRESULT WINAPI D3DXSaveMeshToXW (const WCHAR *filename, ID3DXMesh *mesh, const DWORD *adjacency, const D3DXMATERIAL *materials, const D3DXEFFECTINSTANCE *effect_instances, DWORD material_count, DWORD format)
 
HRESULT WINAPI D3DXSavePRTBufferToFileA (const char *filename, ID3DXPRTBuffer *buffer)
 
HRESULT WINAPI D3DXSavePRTBufferToFileW (const WCHAR *filename, ID3DXPRTBuffer *buffer)
 
HRESULT WINAPI D3DXSavePRTCompBufferToFileA (const char *filename, ID3DXPRTCompBuffer *buffer)
 
HRESULT WINAPI D3DXSavePRTCompBufferToFileW (const WCHAR *filename, ID3DXPRTCompBuffer *buffer)
 
UINT WINAPI D3DXGetDeclLength (const D3DVERTEXELEMENT9 *decl)
 
UINT WINAPI D3DXGetDeclVertexSize (const D3DVERTEXELEMENT9 *decl, DWORD stream_idx)
 
UINT WINAPI D3DXGetFVFVertexSize (DWORD)
 
BOOL WINAPI D3DXBoxBoundProbe (const D3DXVECTOR3 *vmin, const D3DXVECTOR3 *vmax, const D3DXVECTOR3 *ray_pos, const D3DXVECTOR3 *ray_dir)
 
BOOL WINAPI D3DXSphereBoundProbe (const D3DXVECTOR3 *center, FLOAT radius, const D3DXVECTOR3 *ray_pos, const D3DXVECTOR3 *ray_dir)
 
HRESULT WINAPI D3DXCleanMesh (D3DXCLEANTYPE clean_type, ID3DXMesh *mesh_in, const DWORD *adjacency_in, ID3DXMesh **mesh_out, DWORD *adjacency_out, ID3DXBuffer **errors)
 
HRESULT WINAPI D3DXConcatenateMeshes (struct ID3DXMesh **meshes, UINT mesh_count, DWORD flags, const D3DXMATRIX *geometry_matrices, const D3DXMATRIX *texture_matrices, const D3DVERTEXELEMENT9 *declaration, struct IDirect3DDevice9 *device, struct ID3DXMesh **mesh)
 
HRESULT WINAPI D3DXComputeBoundingBox (const D3DXVECTOR3 *first_pos, DWORD num_vertices, DWORD stride, D3DXVECTOR3 *vmin, D3DXVECTOR3 *vmax)
 
HRESULT WINAPI D3DXComputeBoundingSphere (const D3DXVECTOR3 *first_pos, DWORD num_vertices, DWORD stride, D3DXVECTOR3 *center, FLOAT *radius)
 
HRESULT WINAPI D3DXComputeIMTFromPerTexelSignal (ID3DXMesh *mesh, DWORD texture_idx, float *texel_signal, UINT width, UINT height, UINT signal_dimension, UINT component_count, DWORD flags, LPD3DXUVATLASCB cb, void *ctx, ID3DXBuffer **buffer)
 
HRESULT WINAPI D3DXComputeIMTFromPerVertexSignal (ID3DXMesh *mesh, const float *vertex_signal, UINT signal_dimension, UINT signal_stride, DWORD flags, LPD3DXUVATLASCB cb, void *ctx, ID3DXBuffer **buffer)
 
HRESULT WINAPI D3DXComputeIMTFromSignal (ID3DXMesh *mesh, DWORD texture_idx, UINT signal_dimension, float max_uv_distance, DWORD flags, LPD3DXIMTSIGNALCALLBACK signal_cb, void *signal_ctx, LPD3DXUVATLASCB status_cb, void *status_ctx, ID3DXBuffer **buffer)
 
HRESULT WINAPI D3DXComputeIMTFromTexture (struct ID3DXMesh *mesh, struct IDirect3DTexture9 *texture, DWORD texture_idx, DWORD options, LPD3DXUVATLASCB cb, void *ctx, struct ID3DXBuffer **out)
 
HRESULT WINAPI D3DXComputeNormals (ID3DXBaseMesh *mesh, const DWORD *adjacency)
 
HRESULT WINAPI D3DXComputeTangentFrameEx (ID3DXMesh *mesh_in, DWORD texture_in_semantic, DWORD texture_in_idx, DWORD u_partial_out_semantic, DWORD u_partial_out_idx, DWORD v_partial_out_semantic, DWORD v_partial_out_idx, DWORD normal_out_semantic, DWORD normal_out_idx, DWORD flags, const DWORD *adjacency, float partial_edge_threshold, float singular_point_threshold, float normal_edge_threshold, ID3DXMesh **mesh_out, ID3DXBuffer **buffer)
 
HRESULT WINAPI D3DXComputeTangent (ID3DXMesh *mesh, DWORD stage, DWORD tangent_idx, DWORD binorm_idx, DWORD wrap, const DWORD *adjacency)
 
HRESULT WINAPI D3DXConvertMeshSubsetToSingleStrip (struct ID3DXBaseMesh *mesh_in, DWORD attribute_id, DWORD ib_flags, struct IDirect3DIndexBuffer9 **index_buffer, DWORD *index_count)
 
HRESULT WINAPI D3DXConvertMeshSubsetToStrips (struct ID3DXBaseMesh *mesh_in, DWORD attribute_id, DWORD ib_flags, struct IDirect3DIndexBuffer9 **index_buffer, DWORD *index_count, struct ID3DXBuffer **strip_lengths, DWORD *strip_count)
 
HRESULT WINAPI D3DXDeclaratorFromFVF (DWORD, D3DVERTEXELEMENT9[MAX_FVF_DECL_SIZE])
 
HRESULT WINAPI D3DXFVFFromDeclarator (const D3DVERTEXELEMENT9 *decl, DWORD *fvf)
 
HRESULT WINAPI D3DXGenerateOutputDecl (D3DVERTEXELEMENT9 *decl_out, const D3DVERTEXELEMENT9 *decl_in)
 
HRESULT WINAPI D3DXGeneratePMesh (ID3DXMesh *mesh, const DWORD *adjacency, const D3DXATTRIBUTEWEIGHTS *attribute_weights, const float *vertex_weights, DWORD min_value, DWORD flags, ID3DXPMesh **pmesh)
 
HRESULT WINAPI D3DXIntersect (ID3DXBaseMesh *mesh, const D3DXVECTOR3 *ray_position, const D3DXVECTOR3 *ray_direction, BOOL *hit, DWORD *face_idx, float *u, float *v, float *distance, ID3DXBuffer **hits, DWORD *hit_count)
 
HRESULT WINAPI D3DXIntersectSubset (ID3DXBaseMesh *mesh, DWORD attribute_id, const D3DXVECTOR3 *ray_position, const D3DXVECTOR3 *ray_direction, BOOL *hit, DWORD *face_idx, float *u, float *v, float *distance, ID3DXBuffer **hits, DWORD *hit_count)
 
BOOL WINAPI D3DXIntersectTri (const D3DXVECTOR3 *vtx0, const D3DXVECTOR3 *vtx1, const D3DXVECTOR3 *vtx2, const D3DXVECTOR3 *ray_pos, const D3DXVECTOR3 *ray_dir, FLOAT *u, FLOAT *v, FLOAT *dist)
 
HRESULT WINAPI D3DXOptimizeFaces (const void *indices, UINT face_count, UINT vertex_count, BOOL idx_32bit, DWORD *face_remap)
 
HRESULT WINAPI D3DXOptimizeVertices (const void *indices, UINT face_count, UINT vertex_count, BOOL idx_32bit, DWORD *vertex_remap)
 
HRESULT WINAPI D3DXRectPatchSize (const FLOAT *segment_count, DWORD *num_triangles, DWORD *num_vertices)
 
HRESULT WINAPI D3DXSHPRTCompSuperCluster (UINT *cluster_ids, ID3DXMesh *scene, UINT max_cluster_count, UINT cluster_count, UINT *scluster_ids, UINT *scluster_count)
 
HRESULT WINAPI D3DXSHPRTCompSplitMeshSC (UINT *cluster_idx, UINT vertex_count, UINT cluster_count, UINT *scluster_ids, UINT scluster_count, void *index_buffer_in, BOOL ib_in_32bit, UINT face_count, ID3DXBuffer **index_buffer_out, UINT *index_buffer_size, BOOL ib_out_32bit, ID3DXBuffer **face_remap, ID3DXBuffer **vertex_data, UINT *vertex_data_length, UINT *sc_cluster_list, D3DXSHPRTSPLITMESHCLUSTERDATA *sc_data)
 
HRESULT WINAPI D3DXSimplifyMesh (ID3DXMesh *mesh_in, const DWORD *adjacency, const D3DXATTRIBUTEWEIGHTS *attribute_weights, const float *vertex_weights, DWORD min_value, DWORD flags, ID3DXMesh **mesh_out)
 
HRESULT WINAPI D3DXSplitMesh (ID3DXMesh *mesh_in, const DWORD *adjacency_in, const DWORD max_size, const DWORD flags, DWORD *mesh_out_count, ID3DXBuffer **mesh_out, ID3DXBuffer **adjacency_out, ID3DXBuffer **face_remap_out, ID3DXBuffer **vertex_remap_out)
 
HRESULT WINAPI D3DXTessellateNPatches (ID3DXMesh *mesh_in, const DWORD *adjacency_in, float segment_count, BOOL quad_interp, ID3DXMesh **mesh_out, ID3DXBuffer **adjacency_out)
 
HRESULT WINAPI D3DXTessellateRectPatch (struct IDirect3DVertexBuffer9 *buffer, const float *segment_count, const D3DVERTEXELEMENT9 *declaration, const D3DRECTPATCH_INFO *patch_info, struct ID3DXMesh *mesh)
 
HRESULT WINAPI D3DXTessellateTriPatch (struct IDirect3DVertexBuffer9 *buffer, const float *segment_count, const D3DVERTEXELEMENT9 *declaration, const D3DTRIPATCH_INFO *patch_info, struct ID3DXMesh *mesh)
 
HRESULT WINAPI D3DXTriPatchSize (const FLOAT *segment_count, DWORD *num_triangles, DWORD *num_vertices)
 
HRESULT WINAPI D3DXUVAtlasCreate (ID3DXMesh *mesh_in, UINT max_chart_count, float max_stretch_in, UINT width, UINT height, float gutter, DWORD texture_idx, const DWORD *adjacency, const DWORD *false_edges, const float *imt_array, LPD3DXUVATLASCB cb, float cb_freq, void *ctx, DWORD flags, ID3DXMesh **mesh_out, ID3DXBuffer **face_partitioning_out, ID3DXBuffer **vertex_remap_out, float *max_stretch_out, UINT *chart_count)
 
HRESULT WINAPI D3DXUVAtlasPack (ID3DXMesh *mesh, UINT width, UINT height, float gutter, DWORD texture_idx, const DWORD *partition_result_adjacency, LPD3DXUVATLASCB cb, float cb_freq, void *ctx, DWORD flags, ID3DXBuffer *face_partitioning)
 
HRESULT WINAPI D3DXUVAtlasPartition (ID3DXMesh *mesh_in, UINT max_chart_count, float max_stretch_in, DWORD texture_idx, const DWORD *adjacency, const DWORD *false_edges, const float *imt_array, LPD3DXUVATLASCB cb, float cb_freq, void *ctx, DWORD flags, ID3DXMesh **mesh_out, ID3DXBuffer **face_partitioning_out, ID3DXBuffer **vertex_remap_out, ID3DXBuffer **adjacency_out, float *max_stretch_out, UINT *chart_count)
 
HRESULT WINAPI D3DXValidMesh (ID3DXMesh *mesh, const DWORD *adjacency, ID3DXBuffer **errors)
 
HRESULT WINAPI D3DXValidPatchMesh (ID3DXPatchMesh *mesh, DWORD *degenerate_vertex_count, DWORD *degenerate_patch_count, ID3DXBuffer **errors)
 
HRESULT WINAPI D3DXWeldVertices (ID3DXMesh *mesh, DWORD flags, const D3DXWELDEPSILONS *epsilons, const DWORD *adjacency_in, DWORD *adjacency_out, DWORD *face_remap_out, ID3DXBuffer **vertex_remap_out)
 
 DEFINE_GUID (DXFILEOBJ_XSkinMeshHeader, 0x3cf169ce, 0xff7c, 0x44ab, 0x93, 0xc0, 0xf7, 0x8f, 0x62, 0xd1, 0x72, 0xe2)
 
 DEFINE_GUID (DXFILEOBJ_VertexDuplicationIndices, 0xb8d65549, 0xd7c9, 0x4995, 0x89, 0xcf, 0x53, 0xa9, 0xa8, 0xb0, 0x31, 0xe3)
 
 DEFINE_GUID (DXFILEOBJ_FaceAdjacency, 0xa64c844a, 0xe282, 0x4756, 0x8b, 0x80, 0x25, 0x0c, 0xde, 0x04, 0x39, 0x8c)
 
 DEFINE_GUID (DXFILEOBJ_SkinWeights, 0x6f0d123b, 0xbad2, 0x4167, 0xa0, 0xd0, 0x80, 0x22, 0x4f, 0x25, 0xfa, 0xbb)
 
 DEFINE_GUID (DXFILEOBJ_Patch, 0xa3eb5d44, 0xfc22, 0x429d, 0x9a, 0xfb, 0x32, 0x21, 0xcb, 0x97, 0x19, 0xa6)
 
 DEFINE_GUID (DXFILEOBJ_PatchMesh, 0xd02c95cc, 0xedba, 0x4305, 0x9b, 0x5d, 0x18, 0x20, 0xd7, 0x70, 0x4d, 0xbf)
 
 DEFINE_GUID (DXFILEOBJ_PatchMesh9, 0xb9ec94e1, 0xb9a6, 0x4251, 0xba, 0x18, 0x94, 0x89, 0x3f, 0x02, 0xc0, 0xea)
 
 DEFINE_GUID (DXFILEOBJ_PMInfo, 0xb6c3e656, 0xec8b, 0x4b92, 0x9b, 0x62, 0x68, 0x16, 0x59, 0x52, 0x29, 0x47)
 
 DEFINE_GUID (DXFILEOBJ_PMAttributeRange, 0x917e0427, 0xc61e, 0x4a14, 0x9c, 0x64, 0xaf, 0xe6, 0x5f, 0x9e, 0x98, 0x44)
 
 DEFINE_GUID (DXFILEOBJ_PMVSplitRecord, 0x574ccc14, 0xf0b3, 0x4333, 0x82, 0x2d, 0x93, 0xe8, 0xa8, 0xa0, 0x8e, 0x4c)
 
 DEFINE_GUID (DXFILEOBJ_FVFData, 0xb6e70a0e, 0x8ef9, 0x4e83, 0x94, 0xad, 0xec, 0xc8, 0xb0, 0xc0, 0x48, 0x97)
 
 DEFINE_GUID (DXFILEOBJ_VertexElement, 0xf752461c, 0x1e23, 0x48f6, 0xb9, 0xf8, 0x83, 0x50, 0x85, 0x0f, 0x33, 0x6f)
 
 DEFINE_GUID (DXFILEOBJ_DeclData, 0xbf22e553, 0x292c, 0x4781, 0x9f, 0xea, 0x62, 0xbd, 0x55, 0x4b, 0xdd, 0x93)
 
 DEFINE_GUID (DXFILEOBJ_EffectFloats, 0xf1cfe2b3, 0x0de3, 0x4e28, 0xaf, 0xa1, 0x15, 0x5a, 0x75, 0x0a, 0x28, 0x2d)
 
 DEFINE_GUID (DXFILEOBJ_EffectString, 0xd55b097e, 0xbdb6, 0x4c52, 0xb0, 0x3d, 0x60, 0x51, 0xc8, 0x9d, 0x0e, 0x42)
 
 DEFINE_GUID (DXFILEOBJ_EffectDWord, 0x622c0ed0, 0x956e, 0x4da9, 0x90, 0x8a, 0x2a, 0xf9, 0x4f, 0x3c, 0xe7, 0x16)
 
 DEFINE_GUID (DXFILEOBJ_EffectParamFloats, 0x3014b9a0, 0x62f5, 0x478c, 0x9b, 0x86, 0xe4, 0xac, 0x9f, 0x4e, 0x41, 0x8b)
 
 DEFINE_GUID (DXFILEOBJ_EffectParamString, 0x1dbc4c88, 0x94c1, 0x46ee, 0x90, 0x76, 0x2c, 0x28, 0x81, 0x8c, 0x94, 0x81)
 
 DEFINE_GUID (DXFILEOBJ_EffectParamDWord, 0xe13963bc, 0xae51, 0x4c5d, 0xb0, 0x0f, 0xcf, 0xa3, 0xa9, 0xd9, 0x7c, 0xe5)
 
 DEFINE_GUID (DXFILEOBJ_EffectInstance, 0xe331f7e4, 0x0559, 0x4cc2, 0x8e, 0x99, 0x1c, 0xec, 0x16, 0x57, 0x92, 0x8f)
 
 DEFINE_GUID (DXFILEOBJ_AnimTicksPerSecond, 0x9e415a43, 0x7ba6, 0x4a73, 0x87, 0x43, 0xb7, 0x3d, 0x47, 0xe8, 0x84, 0x76)
 
 DEFINE_GUID (DXFILEOBJ_CompressedAnimationSet, 0x7f9b00b3, 0xf125, 0x4890, 0x87, 0x6e, 0x1c, 0x42, 0xbf, 0x69, 0x7c, 0x4d)
 

Macro Definition Documentation

◆ D3DXLoadMeshFromX

#define D3DXLoadMeshFromX   WINELIB_NAME_AW(D3DXLoadMeshFromX)

Definition at line 733 of file d3dx9mesh.h.

◆ D3DXLoadPRTBufferFromFile

#define D3DXLoadPRTBufferFromFile   WINELIB_NAME_AW(D3DXLoadPRTBufferFromFile)

Definition at line 752 of file d3dx9mesh.h.

◆ D3DXLoadPRTCompBufferFromFile

#define D3DXLoadPRTCompBufferFromFile   WINELIB_NAME_AW(D3DXLoadPRTCompBufferFromFile)

Definition at line 755 of file d3dx9mesh.h.

◆ D3DXSaveMeshToX

#define D3DXSaveMeshToX   WINELIB_NAME_AW(D3DXSaveMeshToX)

Definition at line 760 of file d3dx9mesh.h.

◆ D3DXSavePRTBufferToFile

#define D3DXSavePRTBufferToFile   WINELIB_NAME_AW(D3DXSavePRTBufferToFile)

Definition at line 763 of file d3dx9mesh.h.

◆ D3DXSavePRTCompBufferToFile

#define D3DXSavePRTCompBufferToFile   WINELIB_NAME_AW(D3DXSavePRTCompBufferToFile)

Definition at line 766 of file d3dx9mesh.h.

◆ INTERFACE [1/10]

#define INTERFACE   ID3DXBaseMesh

Definition at line 635 of file d3dx9mesh.h.

◆ INTERFACE [2/10]

#define INTERFACE   ID3DXMesh

Definition at line 635 of file d3dx9mesh.h.

◆ INTERFACE [3/10]

#define INTERFACE   ID3DXPMesh

Definition at line 635 of file d3dx9mesh.h.

◆ INTERFACE [4/10]

#define INTERFACE   ID3DXSPMesh

Definition at line 635 of file d3dx9mesh.h.

◆ INTERFACE [5/10]

#define INTERFACE   ID3DXPatchMesh

Definition at line 635 of file d3dx9mesh.h.

◆ INTERFACE [6/10]

#define INTERFACE   ID3DXSkinInfo

Definition at line 635 of file d3dx9mesh.h.

◆ INTERFACE [7/10]

#define INTERFACE   ID3DXPRTBuffer

Definition at line 635 of file d3dx9mesh.h.

◆ INTERFACE [8/10]

#define INTERFACE   ID3DXPRTCompBuffer

Definition at line 635 of file d3dx9mesh.h.

◆ INTERFACE [9/10]

#define INTERFACE   ID3DXTextureGutterHelper

Definition at line 635 of file d3dx9mesh.h.

◆ INTERFACE [10/10]

#define INTERFACE   ID3DXPRTEngine

Definition at line 635 of file d3dx9mesh.h.

◆ UNUSED16

#define UNUSED16   (0xffff)

Definition at line 36 of file d3dx9mesh.h.

◆ UNUSED32

#define UNUSED32   (0xffffffff)

Definition at line 37 of file d3dx9mesh.h.

◆ XEXTENSIONS_TEMPLATES

#define XEXTENSIONS_TEMPLATES   "xof 0303txt 0032\ template FVFData \ { \ <B6E70A0E-8EF9-4e83-94AD-ECC8B0C04897> \ DWORD dwFVF; \ DWORD nDWords; \ array DWORD data[nDWords]; \ } \ template VertexElement \ { \ <F752461C-1E23-48f6-B9F8-8350850F336F> \ DWORD Type; \ DWORD Method; \ DWORD Usage; \ DWORD UsageIndex; \ } \ template DeclData \ { \ <BF22E553-292C-4781-9FEA-62BD554BDD93> \ DWORD nElements; \ array VertexElement Elements[nElements]; \ DWORD nDWords; \ array DWORD data[nDWords]; \ } \ template PMAttributeRange \ { \ <917E0427-C61E-4a14-9C64-AFE65F9E9844> \ DWORD iFaceOffset; \ DWORD nFacesMin; \ DWORD nFacesMax; \ DWORD iVertexOffset; \ DWORD nVerticesMin; \ DWORD nVerticesMax; \ } \ template PMVSplitRecord \ { \ <574CCC14-F0B3-4333-822D-93E8A8A08E4C> \ DWORD iFaceCLW; \ DWORD iVlrOffset; \ DWORD iCode; \ } \ template PMInfo \ { \ <B6C3E656-EC8B-4b92-9B62-681659522947> \ DWORD nAttributes; \ array PMAttributeRange attributeRanges[nAttributes]; \ DWORD nMaxValence; \ DWORD nMinLogicalVertices; \ DWORD nMaxLogicalVertices; \ DWORD nVSplits; \ array PMVSplitRecord splitRecords[nVSplits]; \ DWORD nAttributeMispredicts; \ array DWORD attributeMispredicts[nAttributeMispredicts]; \ } "

Definition at line 1002 of file d3dx9mesh.h.

◆ XSKINEXP_TEMPLATES

#define XSKINEXP_TEMPLATES   "xof 0303txt 0032\ template XSkinMeshHeader \ { \ <3CF169CE-FF7C-44ab-93C0-F78F62D172E2> \ WORD nMaxSkinWeightsPerVertex; \ WORD nMaxSkinWeightsPerFace; \ WORD nBones; \ } \ template VertexDuplicationIndices \ { \ <B8D65549-D7C9-4995-89CF-53A9A8B031E3> \ DWORD nIndices; \ DWORD nOriginalVertices; \ array DWORD indices[nIndices]; \ } \ template FaceAdjacency \ { \ <A64C844A-E282-4756-8B80-250CDE04398C> \ DWORD nIndices; \ array DWORD indices[nIndices]; \ } \ template SkinWeights \ { \ <6F0D123B-BAD2-4167-A0D0-80224F25FABB> \ STRING transformNodeName; \ DWORD nWeights; \ array DWORD vertexIndices[nWeights]; \ array float weights[nWeights]; \ Matrix4x4 matrixOffset; \ } \ template Patch \ { \ <A3EB5D44-FC22-429D-9AFB-3221CB9719A6> \ DWORD nControlIndices; \ array DWORD controlIndices[nControlIndices]; \ } \ template PatchMesh \ { \ <D02C95CC-EDBA-4305-9B5D-1820D7704BBF> \ DWORD nVertices; \ array Vector vertices[nVertices]; \ DWORD nPatches; \ array Patch patches[nPatches]; \ [ ... ] \ } \ template PatchMesh9 \ { \ <B9EC94E1-B9A6-4251-BA18-94893F02C0EA> \ DWORD Type; \ DWORD Degree; \ DWORD Basis; \ DWORD nVertices; \ array Vector vertices[nVertices]; \ DWORD nPatches; \ array Patch patches[nPatches]; \ [ ... ] \ } template EffectFloats \ { \ <F1CFE2B3-0DE3-4e28-AFA1-155A750A282D> \ DWORD nFloats; \ array float Floats[nFloats]; \ } \ template EffectString \ { \ <D55B097E-BDB6-4c52-B03D-6051C89D0E42> \ STRING Value; \ } \ template EffectDWord \ { \ <622C0ED0-956E-4da9-908A-2AF94F3CE716> \ DWORD Value; \ } template EffectParamFloats \ { \ <3014B9A0-62F5-478c-9B86-E4AC9F4E418B> \ STRING ParamName; \ DWORD nFloats; \ array float Floats[nFloats]; \ } template EffectParamString \ { \ <1DBC4C88-94C1-46ee-9076-2C28818C9481> \ STRING ParamName; \ STRING Value; \ } \ template EffectParamDWord \ { \ <E13963BC-AE51-4c5d-B00F-CFA3A9D97CE5> \ STRING ParamName; \ DWORD Value; \ } \ template EffectInstance \ { \ <E331F7E4-0559-4cc2-8E99-1CEC1657928F> \ STRING EffectFilename; \ [ ... ] \ } template AnimTicksPerSecond \ { \ <9E415A43-7BA6-4a73-8743-B73D47E88476> \ DWORD AnimTicksPerSecond; \ } \ template CompressedAnimationSet \ { \ <7F9B00B3-F125-4890-876E-1C42BF697C4D> \ DWORD CompressedBlockSize; \ FLOAT TicksPerSec; \ DWORD PlaybackType; \ DWORD BufferLength; \ array DWORD CompressedData[BufferLength]; \ } "

Definition at line 892 of file d3dx9mesh.h.

Typedef Documentation

◆ D3DXATTRIBUTERANGE

◆ D3DXATTRIBUTEWEIGHTS

◆ D3DXBONECOMBINATION

◆ D3DXCLEANTYPE

◆ D3DXEFFECTDEFAULT

◆ D3DXEFFECTDEFAULTTYPE

◆ D3DXEFFECTINSTANCE

◆ D3DXIMT

◆ D3DXINTERSECTINFO

◆ D3DXMATERIAL

◆ D3DXPATCHINFO

◆ D3DXPATCHMESHTYPE

◆ D3DXSHCOMPRESSQUALITYTYPE

◆ D3DXSHGPUSIMOPT

◆ D3DXSHMATERIAL

◆ D3DXSHPRTSPLITMESHCLUSTERDATA

◆ D3DXSHPRTSPLITMESHVERTDATA

◆ D3DXTANGENT

◆ D3DXUVATLAS

◆ D3DXWELDEPSILONS

◆ LPD3DXATTRIBUTERANGE

Definition at line 191 of file d3dx9mesh.h.

◆ LPD3DXATTRIBUTEWEIGHTS

◆ LPD3DXBASEMESH

typedef struct ID3DXBaseMesh* LPD3DXBASEMESH

Definition at line 172 of file d3dx9mesh.h.

◆ LPD3DXBONECOMBINATION

◆ LPD3DXEFFECTDEFAULT

◆ LPD3DXEFFECTINSTANCE

◆ LPD3DXIMTSIGNALCALLBACK

typedef HRESULT(WINAPI * LPD3DXIMTSIGNALCALLBACK) (const D3DXVECTOR2 *, UINT, UINT, void *, FLOAT *)

Definition at line 301 of file d3dx9mesh.h.

◆ LPD3DXINTERSECTINFO

◆ LPD3DXMATERIAL

◆ LPD3DXMESH

typedef struct ID3DXMesh* LPD3DXMESH

Definition at line 173 of file d3dx9mesh.h.

◆ LPD3DXPATCHINFO

◆ LPD3DXPATCHMESH

typedef struct ID3DXPatchMesh* LPD3DXPATCHMESH

Definition at line 177 of file d3dx9mesh.h.

◆ LPD3DXPMESH

typedef struct ID3DXPMesh* LPD3DXPMESH

Definition at line 174 of file d3dx9mesh.h.

◆ LPD3DXPRTBUFFER

typedef struct ID3DXPRTBuffer* LPD3DXPRTBUFFER

Definition at line 178 of file d3dx9mesh.h.

◆ LPD3DXPRTCOMPBUFFER

typedef struct ID3DXPRTCompBuffer* LPD3DXPRTCOMPBUFFER

Definition at line 179 of file d3dx9mesh.h.

◆ LPD3DXPRTENGINE

typedef struct ID3DXPRTEngine* LPD3DXPRTENGINE

Definition at line 180 of file d3dx9mesh.h.

◆ LPD3DXSHPRTSIMCB

typedef HRESULT(WINAPI * LPD3DXSHPRTSIMCB) (float complete, void *ctx)

Definition at line 302 of file d3dx9mesh.h.

◆ LPD3DXSKININFO

typedef struct ID3DXSkinInfo* LPD3DXSKININFO

Definition at line 176 of file d3dx9mesh.h.

◆ LPD3DXSPMESH

typedef struct ID3DXSPMesh* LPD3DXSPMESH

Definition at line 175 of file d3dx9mesh.h.

◆ LPD3DXTEXTUREGUTTERHELPER

typedef struct ID3DXTextureGutterHelper* LPD3DXTEXTUREGUTTERHELPER

Definition at line 181 of file d3dx9mesh.h.

◆ LPD3DXUVATLASCB

typedef HRESULT(WINAPI * LPD3DXUVATLASCB) (float complete, void *ctx)

Definition at line 300 of file d3dx9mesh.h.

◆ LPD3DXWELDEPSILONS

◆ XFILECOMPRESSEDANIMATIONSET

Enumeration Type Documentation

◆ _D3DXEFFECTDEFAULTTYPE

Enumerator
D3DXEDT_STRING 
D3DXEDT_FLOATS 
D3DXEDT_DWORD 
D3DXEDT_FORCEDWORD 

Definition at line 139 of file d3dx9mesh.h.

140 {
141  D3DXEDT_STRING = 1,
142  D3DXEDT_FLOATS = 2,
143  D3DXEDT_DWORD = 3,
144  D3DXEDT_FORCEDWORD = 0x7fffffff,
enum _D3DXEFFECTDEFAULTTYPE D3DXEFFECTDEFAULTTYPE

◆ _D3DXIMT

Enumerator
D3DXIMT_WRAP_U 
D3DXIMT_WRAP_V 
D3DXIMT_WRAP_UV 

Definition at line 125 of file d3dx9mesh.h.

126 {
127  D3DXIMT_WRAP_U = 0x01,
128  D3DXIMT_WRAP_V = 0x02,
129  D3DXIMT_WRAP_UV = 0x03,
130 } D3DXIMT;
enum _D3DXIMT D3DXIMT

◆ _D3DXMESH

Enumerator
D3DXMESH_32BIT 
D3DXMESH_DONOTCLIP 
D3DXMESH_POINTS 
D3DXMESH_RTPATCHES 
D3DXMESH_NPATCHES 
D3DXMESH_VB_SYSTEMMEM 
D3DXMESH_VB_MANAGED 
D3DXMESH_VB_WRITEONLY 
D3DXMESH_VB_DYNAMIC 
D3DXMESH_VB_SOFTWAREPROCESSING 
D3DXMESH_IB_SYSTEMMEM 
D3DXMESH_IB_MANAGED 
D3DXMESH_IB_WRITEONLY 
D3DXMESH_IB_DYNAMIC 
D3DXMESH_IB_SOFTWAREPROCESSING 
D3DXMESH_VB_SHARE 
D3DXMESH_USEHWONLY 
D3DXMESH_SYSTEMMEM 
D3DXMESH_MANAGED 
D3DXMESH_WRITEONLY 
D3DXMESH_DYNAMIC 
D3DXMESH_SOFTWAREPROCESSING 

Definition at line 44 of file d3dx9mesh.h.

45 {
46  D3DXMESH_32BIT = 0x001,
47  D3DXMESH_DONOTCLIP = 0x002,
48  D3DXMESH_POINTS = 0x004,
49  D3DXMESH_RTPATCHES = 0x008,
50  D3DXMESH_NPATCHES = 0x4000,
51  D3DXMESH_VB_SYSTEMMEM = 0x010,
52  D3DXMESH_VB_MANAGED = 0x020,
53  D3DXMESH_VB_WRITEONLY = 0x040,
54  D3DXMESH_VB_DYNAMIC = 0x080,
56  D3DXMESH_IB_SYSTEMMEM = 0x100,
57  D3DXMESH_IB_MANAGED = 0x200,
58  D3DXMESH_IB_WRITEONLY = 0x400,
59  D3DXMESH_IB_DYNAMIC = 0x800,
61  D3DXMESH_VB_SHARE = 0x1000,
62  D3DXMESH_USEHWONLY = 0x2000,
63  D3DXMESH_SYSTEMMEM = 0x110,
64  D3DXMESH_MANAGED = 0x220,
65  D3DXMESH_WRITEONLY = 0x440,
66  D3DXMESH_DYNAMIC = 0x880,
68 };

◆ _D3DXMESHOPT

Enumerator
D3DXMESHOPT_DEVICEINDEPENDENT 
D3DXMESHOPT_COMPACT 
D3DXMESHOPT_ATTRSORT 
D3DXMESHOPT_VERTEXCACHE 
D3DXMESHOPT_STRIPREORDER 
D3DXMESHOPT_IGNOREVERTS 
D3DXMESHOPT_DONOTSPLIT 

Definition at line 70 of file d3dx9mesh.h.

◆ _D3DXMESHSIMP

Enumerator
D3DXMESHSIMP_VERTEX 
D3DXMESHSIMP_FACE 

Definition at line 94 of file d3dx9mesh.h.

◆ _D3DXPATCHMESH

Enumerator
D3DXPATCHMESH_DEFAULT 

Definition at line 89 of file d3dx9mesh.h.

◆ _D3DXPATCHMESHTYPE

Enumerator
D3DXPATCHMESH_RECT 
D3DXPATCHMESH_TRI 
D3DXPATCHMESH_NPATCH 
D3DXPATCHMESH_FORCE_DWORD 

Definition at line 81 of file d3dx9mesh.h.

◆ _D3DXSHCOMPRESSQUALITYTYPE

Enumerator
D3DXSHCQUAL_FASTLOWQUALITY 
D3DXSHCQUAL_SLOWHIGHQUALITY 
D3DXSHCQUAL_FORCE_DWORD 

Definition at line 155 of file d3dx9mesh.h.

◆ _D3DXSHGPUSIMOPT

Enumerator
D3DXSHGPUSIMOPT_SHADOWRES256 
D3DXSHGPUSIMOPT_SHADOWRES512 
D3DXSHGPUSIMOPT_SHADOWRES1024 
D3DXSHGPUSIMOPT_SHADOWRES2048 
D3DXSHGPUSIMOPT_HIGHQUALITY 
D3DXSHGPUSIMOPT_FORCE_DWORD 

Definition at line 162 of file d3dx9mesh.h.

◆ _D3DXTANGENT

Enumerator
D3DXTANGENT_WRAP_U 
D3DXTANGENT_WRAP_V 
D3DXTANGENT_WRAP_UV 
D3DXTANGENT_DONT_NORMALIZE_PARTIALS 
D3DXTANGENT_DONT_ORTHOGONALIZE 
D3DXTANGENT_ORTHOGONALIZE_FROM_V 
D3DXTANGENT_ORTHOGONALIZE_FROM_U 
D3DXTANGENT_WEIGHT_BY_AREA 
D3DXTANGENT_WEIGHT_EQUAL 
D3DXTANGENT_WIND_CW 
D3DXTANGENT_CALCULATE_NORMALS 
D3DXTANGENT_GENERATE_IN_PLACE 

Definition at line 109 of file d3dx9mesh.h.

◆ _D3DXUVATLAS

Enumerator
D3DXUVATLAS_DEFAULT 
D3DXUVATLAS_GEODESIC_FAST 
D3DXUVATLAS_GEODESIC_QUALITY 

Definition at line 132 of file d3dx9mesh.h.

◆ _D3DXWELDEPSILONSFLAGS

Enumerator
D3DXWELDEPSILONS_WELDALL 
D3DXWELDEPSILONS_WELDPARTIALMATCHES 
D3DXWELDEPSILONS_DONOTREMOVEVERTICES 
D3DXWELDEPSILONS_DONOTSPLIT 

Definition at line 147 of file d3dx9mesh.h.

◆ _MAX_FVF_DECL_SIZE

Enumerator
MAX_FVF_DECL_SIZE 

Definition at line 39 of file d3dx9mesh.h.

40 {
42 };
#define MAXD3DDECLLENGTH
Definition: d3d9types.h:186

◆ D3DXCLEANTYPE

Enumerator
D3DXCLEAN_BACKFACING 
D3DXCLEAN_BOWTIES 
D3DXCLEAN_SKINNING 
D3DXCLEAN_OPTIMIZATION 
D3DXCLEAN_SIMPLIFICATION 

Definition at line 100 of file d3dx9mesh.h.

Function Documentation

◆ D3DXBoxBoundProbe()

BOOL WINAPI D3DXBoxBoundProbe ( const D3DXVECTOR3 vmin,
const D3DXVECTOR3 vmax,
const D3DXVECTOR3 ray_pos,
const D3DXVECTOR3 ray_dir 
)

Definition at line 1912 of file mesh.c.

1914 {
1915  FLOAT div, tmin, tmax, tymin, tymax, tzmin, tzmax;
1916 
1917  div = 1.0f / praydirection->x;
1918  if ( div >= 0.0f )
1919  {
1920  tmin = ( pmin->x - prayposition->x ) * div;
1921  tmax = ( pmax->x - prayposition->x ) * div;
1922  }
1923  else
1924  {
1925  tmin = ( pmax->x - prayposition->x ) * div;
1926  tmax = ( pmin->x - prayposition->x ) * div;
1927  }
1928 
1929  if ( tmax < 0.0f ) return FALSE;
1930 
1931  div = 1.0f / praydirection->y;
1932  if ( div >= 0.0f )
1933  {
1934  tymin = ( pmin->y - prayposition->y ) * div;
1935  tymax = ( pmax->y - prayposition->y ) * div;
1936  }
1937  else
1938  {
1939  tymin = ( pmax->y - prayposition->y ) * div;
1940  tymax = ( pmin->y - prayposition->y ) * div;
1941  }
1942 
1943  if ( ( tymax < 0.0f ) || ( tmin > tymax ) || ( tymin > tmax ) ) return FALSE;
1944 
1945  if ( tymin > tmin ) tmin = tymin;
1946  if ( tymax < tmax ) tmax = tymax;
1947 
1948  div = 1.0f / praydirection->z;
1949  if ( div >= 0.0f )
1950  {
1951  tzmin = ( pmin->z - prayposition->z ) * div;
1952  tzmax = ( pmax->z - prayposition->z ) * div;
1953  }
1954  else
1955  {
1956  tzmin = ( pmax->z - prayposition->z ) * div;
1957  tzmax = ( pmin->z - prayposition->z ) * div;
1958  }
1959 
1960  if ( (tzmax < 0.0f ) || ( tmin > tzmax ) || ( tzmin > tmax ) ) return FALSE;
1961 
1962  return TRUE;
1963 }
GLfloat f
Definition: glext.h:7540
_STLP_VENDOR_CSTD::ldiv_t div(long __x, long __y)
Definition: _cstdlib.h:137
float FLOAT
Definition: typedefs.h:67
#define TRUE
Definition: mesh.c:42

◆ D3DXCleanMesh()

HRESULT WINAPI D3DXCleanMesh ( D3DXCLEANTYPE  clean_type,
ID3DXMesh *  mesh_in,
const DWORD adjacency_in,
ID3DXMesh **  mesh_out,
DWORD adjacency_out,
ID3DXBuffer **  errors 
)

Definition at line 4002 of file mesh.c.

4004 {
4005  FIXME("(%u, %p, %p, %p, %p, %p)\n", clean_type, mesh_in, adjacency_in, mesh_out, adjacency_out, errors_and_warnings);
4006 
4007  return E_NOTIMPL;
4008 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ D3DXComputeBoundingBox()

HRESULT WINAPI D3DXComputeBoundingBox ( const D3DXVECTOR3 first_pos,
DWORD  num_vertices,
DWORD  stride,
D3DXVECTOR3 vmin,
D3DXVECTOR3 vmax 
)

Definition at line 1965 of file mesh.c.

1967 {
1968  D3DXVECTOR3 vec;
1969  unsigned int i;
1970 
1971  if( !pfirstposition || !pmin || !pmax ) return D3DERR_INVALIDCALL;
1972 
1973  *pmin = *pfirstposition;
1974  *pmax = *pmin;
1975 
1976  for(i=0; i<numvertices; i++)
1977  {
1978  vec = *( (const D3DXVECTOR3*)((const char*)pfirstposition + dwstride * i) );
1979 
1980  if ( vec.x < pmin->x ) pmin->x = vec.x;
1981  if ( vec.x > pmax->x ) pmax->x = vec.x;
1982 
1983  if ( vec.y < pmin->y ) pmin->y = vec.y;
1984  if ( vec.y > pmax->y ) pmax->y = vec.y;
1985 
1986  if ( vec.z < pmin->z ) pmin->z = vec.z;
1987  if ( vec.z > pmax->z ) pmax->z = vec.z;
1988  }
1989 
1990  return D3D_OK;
1991 }
FT_Pos y
Definition: ftimage.h:77
FT_Pos x
Definition: ftimage.h:76
#define D3DERR_INVALIDCALL
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
FT_Vector * vec
Definition: ftbbox.c:448
#define D3D_OK
Definition: d3d.h:106

◆ D3DXComputeBoundingSphere()

HRESULT WINAPI D3DXComputeBoundingSphere ( const D3DXVECTOR3 first_pos,
DWORD  num_vertices,
DWORD  stride,
D3DXVECTOR3 center,
FLOAT radius 
)

Definition at line 1993 of file mesh.c.

1995 {
1996  D3DXVECTOR3 temp;
1997  FLOAT d;
1998  unsigned int i;
1999 
2000  if( !pfirstposition || !pcenter || !pradius ) return D3DERR_INVALIDCALL;
2001 
2002  temp.x = 0.0f;
2003  temp.y = 0.0f;
2004  temp.z = 0.0f;
2005  *pradius = 0.0f;
2006 
2007  for(i=0; i<numvertices; i++)
2008  D3DXVec3Add(&temp, &temp, (const D3DXVECTOR3*)((const char*)pfirstposition + dwstride * i));
2009 
2010  D3DXVec3Scale(pcenter, &temp, 1.0f / numvertices);
2011 
2012  for(i=0; i<numvertices; i++)
2013  {
2014  d = D3DXVec3Length(D3DXVec3Subtract(&temp, (const D3DXVECTOR3*)((const char*)pfirstposition + dwstride * i), pcenter));
2015  if ( d > *pradius ) *pradius = d;
2016  }
2017  return D3D_OK;
2018 }
#define D3DERR_INVALIDCALL
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
GLfloat f
Definition: glext.h:7540
#define d
Definition: ke_i.h:81
static stack_node_t temp
Definition: rpn.c:18
#define D3D_OK
Definition: d3d.h:106
float FLOAT
Definition: typedefs.h:67

◆ D3DXComputeIMTFromPerTexelSignal()

HRESULT WINAPI D3DXComputeIMTFromPerTexelSignal ( ID3DXMesh *  mesh,
DWORD  texture_idx,
float *  texel_signal,
UINT  width,
UINT  height,
UINT  signal_dimension,
UINT  component_count,
DWORD  flags,
LPD3DXUVATLASCB  cb,
void ctx,
ID3DXBuffer **  buffer 
)

◆ D3DXComputeIMTFromPerVertexSignal()

HRESULT WINAPI D3DXComputeIMTFromPerVertexSignal ( ID3DXMesh *  mesh,
const float *  vertex_signal,
UINT  signal_dimension,
UINT  signal_stride,
DWORD  flags,
LPD3DXUVATLASCB  cb,
void ctx,
ID3DXBuffer **  buffer 
)

◆ D3DXComputeIMTFromSignal()

HRESULT WINAPI D3DXComputeIMTFromSignal ( ID3DXMesh *  mesh,
DWORD  texture_idx,
UINT  signal_dimension,
float  max_uv_distance,
DWORD  flags,
LPD3DXIMTSIGNALCALLBACK  signal_cb,
void signal_ctx,
LPD3DXUVATLASCB  status_cb,
void status_ctx,
ID3DXBuffer **  buffer 
)

◆ D3DXComputeIMTFromTexture()

HRESULT WINAPI D3DXComputeIMTFromTexture ( struct ID3DXMesh *  mesh,
struct IDirect3DTexture9 *  texture,
DWORD  texture_idx,
DWORD  options,
LPD3DXUVATLASCB  cb,
void ctx,
struct ID3DXBuffer **  out 
)

◆ D3DXComputeNormals()

HRESULT WINAPI D3DXComputeNormals ( ID3DXBaseMesh *  mesh,
const DWORD adjacency 
)

Definition at line 7563 of file mesh.c.

7564 {
7565  TRACE("mesh %p, adjacency %p\n", mesh, adjacency);
7566 
7567  if (mesh && (ID3DXMeshVtbl *)mesh->lpVtbl != &D3DXMesh_Vtbl)
7568  {
7569  ERR("Invalid virtual table\n");
7570  return D3DERR_INVALIDCALL;
7571  }
7572 
7573  return D3DXComputeTangentFrameEx((ID3DXMesh *)mesh, D3DX_DEFAULT, 0,
7576  adjacency, -1.01f, -0.01f, -1.01f, NULL, NULL);
7577 }
static const struct ID3DXMeshVtbl D3DXMesh_Vtbl
Definition: mesh.c:1863
#define D3DERR_INVALIDCALL
#define D3DX_DEFAULT
Definition: d3dx9.h:24
smooth NULL
Definition: ftsmooth.c:416
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
#define ERR(fmt,...)
Definition: debug.h:109
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)
Definition: mesh.c:7320

◆ D3DXComputeTangent()

HRESULT WINAPI D3DXComputeTangent ( ID3DXMesh *  mesh,
DWORD  stage,
DWORD  tangent_idx,
DWORD  binorm_idx,
DWORD  wrap,
const DWORD adjacency 
)

Definition at line 7545 of file mesh.c.

7547 {
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);
7550 
7551  return D3DXComputeTangentFrameEx( mesh, D3DDECLUSAGE_TEXCOORD, stage_idx,
7552  ( binorm_idx == D3DX_DEFAULT ) ? D3DX_DEFAULT : D3DDECLUSAGE_BINORMAL,
7553  binorm_idx,
7554  ( tangent_idx == D3DX_DEFAULT ) ? D3DX_DEFAULT : D3DDECLUSAGE_TANGENT,
7555  tangent_idx, D3DX_DEFAULT, 0,
7557  adjacency, -1.01f, -0.01f, -1.01f, NULL, NULL);
7558 }
#define D3DX_DEFAULT
Definition: d3dx9.h:24
smooth NULL
Definition: ftsmooth.c:416
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
#define wrap(journal, var)
Definition: recovery.c:207
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)
Definition: mesh.c:7320

◆ D3DXComputeTangentFrameEx()

HRESULT WINAPI D3DXComputeTangentFrameEx ( ID3DXMesh *  mesh_in,
DWORD  texture_in_semantic,
DWORD  texture_in_idx,
DWORD  u_partial_out_semantic,
DWORD  u_partial_out_idx,
DWORD  v_partial_out_semantic,
DWORD  v_partial_out_idx,
DWORD  normal_out_semantic,
DWORD  normal_out_idx,
DWORD  flags,
const DWORD adjacency,
float  partial_edge_threshold,
float  singular_point_threshold,
float  normal_edge_threshold,
ID3DXMesh **  mesh_out,
ID3DXBuffer **  buffer 
)

Definition at line 7320 of file mesh.c.

7325 {
7326  HRESULT hr;
7327  void *indices = NULL;
7328  BYTE *vertices = NULL;
7329  DWORD *point_reps = NULL;
7330  size_t normal_size;
7331  BOOL indices_are_32bit;
7332  DWORD i, j, num_faces, num_vertices, vertex_stride;
7334  D3DVERTEXELEMENT9 *position_declaration = NULL, *normal_declaration = NULL;
7336 
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);
7344 
7345  if (!mesh)
7346  {
7347  WARN("mesh is NULL\n");
7348  return D3DERR_INVALIDCALL;
7349  }
7350 
7351  if (weighting_method == (D3DXTANGENT_WEIGHT_EQUAL | D3DXTANGENT_WEIGHT_BY_AREA))
7352  {
7353  WARN("D3DXTANGENT_WEIGHT_BY_AREA and D3DXTANGENT_WEIGHT_EQUAL are mutally exclusive\n");
7354  return D3DERR_INVALIDCALL;
7355  }
7356 
7357  if (u_partial_out_semantic != D3DX_DEFAULT)
7358  {
7359  FIXME("tangent vectors computation is not supported\n");
7360  return E_NOTIMPL;
7361  }
7362 
7363  if (v_partial_out_semantic != D3DX_DEFAULT)
7364  {
7365  FIXME("binormal vectors computation is not supported\n");
7366  return E_NOTIMPL;
7367  }
7368 
7370  {
7371  FIXME("unsupported options %#x\n", options);
7372  return E_NOTIMPL;
7373  }
7374 
7376  {
7377  FIXME("only normals computation is supported\n");
7378  return E_NOTIMPL;
7379  }
7380 
7381  if (!(options & D3DXTANGENT_GENERATE_IN_PLACE) || mesh_out || vertex_mapping)
7382  {
7383  FIXME("only D3DXTANGENT_GENERATE_IN_PLACE is supported\n");
7384  return E_NOTIMPL;
7385  }
7386 
7387  if (FAILED(hr = mesh->lpVtbl->GetDeclaration(mesh, declaration)))
7388  return hr;
7389 
7390  for (i = 0; declaration[i].Stream != 0xff; i++)
7391  {
7392  if (declaration[i].Usage == D3DDECLUSAGE_POSITION && !declaration[i].UsageIndex)
7393  position_declaration = &declaration[i];
7394  if (declaration[i].Usage == normal_out_semantic && declaration[i].UsageIndex == normal_out_index)
7395  normal_declaration = &declaration[i];
7396  }
7397 
7398  if (!position_declaration || !normal_declaration)
7399  return D3DERR_INVALIDCALL;
7400 
7401  if (normal_declaration->Type == D3DDECLTYPE_FLOAT3)
7402  {
7403  normal_size = sizeof(D3DXVECTOR3);
7404  }
7405  else if (normal_declaration->Type == D3DDECLTYPE_FLOAT4)
7406  {
7407  normal_size = sizeof(D3DXVECTOR4);
7408  }
7409  else
7410  {
7411  WARN("unsupported normals type %u\n", normal_declaration->Type);
7412  return D3DERR_INVALIDCALL;
7413  }
7414 
7415  num_faces = mesh->lpVtbl->GetNumFaces(mesh);
7416  num_vertices = mesh->lpVtbl->GetNumVertices(mesh);
7417  vertex_stride = mesh->lpVtbl->GetNumBytesPerVertex(mesh);
7418  indices_are_32bit = mesh->lpVtbl->GetOptions(mesh) & D3DXMESH_32BIT;
7419 
7420  point_reps = HeapAlloc(GetProcessHeap(), 0, num_vertices * sizeof(*point_reps));
7421  if (!point_reps)
7422  {
7423  hr = E_OUTOFMEMORY;
7424  goto done;
7425  }
7426 
7427  if (adjacency)
7428  {
7429  if (FAILED(hr = mesh->lpVtbl->ConvertAdjacencyToPointReps(mesh, adjacency, point_reps)))
7430  goto done;
7431  }
7432  else
7433  {
7434  for (i = 0; i < num_vertices; i++)
7435  point_reps[i] = i;
7436  }
7437 
7438  if (FAILED(hr = mesh->lpVtbl->LockIndexBuffer(mesh, 0, &indices)))
7439  goto done;
7440 
7441  if (FAILED(hr = mesh->lpVtbl->LockVertexBuffer(mesh, 0, (void **)&vertices)))
7442  goto done;
7443 
7444  for (i = 0; i < num_vertices; i++)
7445  {
7446  static const D3DXVECTOR4 default_vector = {0.0f, 0.0f, 0.0f, 1.0f};
7447  void *normal = vertices + normal_declaration->Offset + i * vertex_stride;
7448 
7449  memcpy(normal, &default_vector, normal_size);
7450  }
7451 
7452  for (i = 0; i < num_faces; i++)
7453  {
7454  float denominator, weights[3];
7455  D3DXVECTOR3 a, b, cross, face_normal;
7456  const DWORD face_indices[3] =
7457  {
7458  read_ib(indices, indices_are_32bit, 3 * i + 0),
7459  read_ib(indices, indices_are_32bit, 3 * i + 1),
7460  read_ib(indices, indices_are_32bit, 3 * i + 2)
7461  };
7462  const D3DXVECTOR3 v0 = read_vec3(vertices, position_declaration, vertex_stride, face_indices[0]);
7463  const D3DXVECTOR3 v1 = read_vec3(vertices, position_declaration, vertex_stride, face_indices[1]);
7464  const D3DXVECTOR3 v2 = read_vec3(vertices, position_declaration, vertex_stride, face_indices[2]);
7465 
7466  D3DXVec3Cross(&cross, D3DXVec3Subtract(&a, &v0, &v1), D3DXVec3Subtract(&b, &v0, &v2));
7467 
7468  switch (weighting_method)
7469  {
7471  weights[0] = weights[1] = weights[2] = 1.0f;
7472  break;
7474  weights[0] = weights[1] = weights[2] = D3DXVec3Length(&cross);
7475  break;
7476  default:
7477  /* weight by angle */
7478  denominator = D3DXVec3Length(&a) * D3DXVec3Length(&b);
7479  if (!denominator)
7480  weights[0] = 0.0f;
7481  else
7482  weights[0] = acosf(D3DXVec3Dot(&a, &b) / denominator);
7483 
7484  D3DXVec3Subtract(&a, &v1, &v0);
7485  D3DXVec3Subtract(&b, &v1, &v2);
7486  denominator = D3DXVec3Length(&a) * D3DXVec3Length(&b);
7487  if (!denominator)
7488  weights[1] = 0.0f;
7489  else
7490  weights[1] = acosf(D3DXVec3Dot(&a, &b) / denominator);
7491 
7492  D3DXVec3Subtract(&a, &v2, &v0);
7493  D3DXVec3Subtract(&b, &v2, &v1);
7494  denominator = D3DXVec3Length(&a) * D3DXVec3Length(&b);
7495  if (!denominator)
7496  weights[2] = 0.0f;
7497  else
7498  weights[2] = acosf(D3DXVec3Dot(&a, &b) / denominator);
7499 
7500  break;
7501  }
7502 
7503  D3DXVec3Normalize(&face_normal, &cross);
7504 
7505  for (j = 0; j < 3; j++)
7506  {
7508  DWORD rep_index = point_reps[face_indices[j]];
7509  D3DXVECTOR3 *rep_normal = vertex_element_vec3(vertices, normal_declaration, vertex_stride, rep_index);
7510 
7511  D3DXVec3Scale(&normal, &face_normal, weights[j]);
7512  D3DXVec3Add(rep_normal, rep_normal, &normal);
7513  }
7514  }
7515 
7516  for (i = 0; i < num_vertices; i++)
7517  {
7518  DWORD rep_index = point_reps[i];
7519  D3DXVECTOR3 *normal = vertex_element_vec3(vertices, normal_declaration, vertex_stride, i);
7520  D3DXVECTOR3 *rep_normal = vertex_element_vec3(vertices, normal_declaration, vertex_stride, rep_index);
7521 
7522  if (i == rep_index)
7523  D3DXVec3Normalize(rep_normal, rep_normal);
7524  else
7525  *normal = *rep_normal;
7526  }
7527 
7528  hr = D3D_OK;
7529 
7530 done:
7531  if (vertices)
7532  mesh->lpVtbl->UnlockVertexBuffer(mesh);
7533 
7534  if (indices)
7535  mesh->lpVtbl->UnlockIndexBuffer(mesh);
7536 
7537  HeapFree(GetProcessHeap(), 0, point_reps);
7538 
7539  return hr;
7540 }
GLuint GLuint GLsizei GLenum const GLvoid * indices
Definition: gl.h:1545
struct D3DXVECTOR4 D3DXVECTOR4
HRESULT hr
Definition: shlfolder.c:183
_Check_return_ __CRT_INLINE float acosf(_In_ float x)
Definition: math.h:203
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
Definition: hidpi.h:382
#define WARN(fmt,...)
Definition: debug.h:111
GLfloat v0
Definition: glext.h:6061
#define D3DERR_INVALIDCALL
static D3DXVECTOR3 * vertex_element_vec3(BYTE *vertices, const D3DVERTEXELEMENT9 *declaration, DWORD vertex_stride, DWORD index)
Definition: mesh.c:7284
static D3DXVECTOR3 read_vec3(BYTE *vertices, const D3DVERTEXELEMENT9 *declaration, DWORD vertex_stride, DWORD index)
Definition: mesh.c:7290
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 E_OUTOFMEMORY
Definition: ddrawi.h:100
#define a
Definition: ke_i.h:78
#define FIXME(fmt,...)
Definition: debug.h:110
#define D3DX_DEFAULT
Definition: d3dx9.h:24
smooth NULL
Definition: ftsmooth.c:416
#define b
Definition: ke_i.h:79
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
static DWORD read_ib(void *index_buffer, BOOL indices_are_32bit, DWORD index)
Definition: mesh.c:6951
static void cross(float v1[3], float v2[3], float result[3])
Definition: project.c:100
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
struct _D3DVECTOR D3DXVECTOR3
Definition: d3dx9math.h:97
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
#define D3DDECL_END()
Definition: d3d9types.h:311
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
#define D3D_OK
Definition: d3d.h:106
#define E_NOTIMPL
Definition: ddrawi.h:99
const GLbyte * weights
Definition: glext.h:6523
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
D3DXVECTOR3 *WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv)
Definition: math.c:1849
GLfloat GLfloat v1
Definition: glext.h:6062
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by D3DXComputeNormals(), and D3DXComputeTangent().

◆ D3DXConcatenateMeshes()

HRESULT WINAPI D3DXConcatenateMeshes ( struct ID3DXMesh **  meshes,
UINT  mesh_count,
DWORD  flags,
const D3DXMATRIX geometry_matrices,
const D3DXMATRIX texture_matrices,
const D3DVERTEXELEMENT9 declaration,
struct IDirect3DDevice9 *  device,
struct ID3DXMesh **  mesh 
)

◆ D3DXConvertMeshSubsetToSingleStrip()

HRESULT WINAPI D3DXConvertMeshSubsetToSingleStrip ( struct ID3DXBaseMesh *  mesh_in,
DWORD  attribute_id,
DWORD  ib_flags,
struct IDirect3DIndexBuffer9 **  index_buffer,
DWORD index_count 
)

Definition at line 7600 of file mesh.c.

7602 {
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);
7605 
7606  return E_NOTIMPL;
7607 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ D3DXConvertMeshSubsetToStrips()

HRESULT WINAPI D3DXConvertMeshSubsetToStrips ( struct ID3DXBaseMesh *  mesh_in,
DWORD  attribute_id,
DWORD  ib_flags,
struct IDirect3DIndexBuffer9 **  index_buffer,
DWORD index_count,
struct ID3DXBuffer **  strip_lengths,
DWORD strip_count 
)

◆ D3DXCreateBuffer()

HRESULT WINAPI D3DXCreateBuffer ( DWORD  size,
ID3DXBuffer **  buffer 
)

Definition at line 129 of file core.c.

130 {
131  struct ID3DXBufferImpl *object;
132  HRESULT hr;
133 
134  if (!buffer)
135  {
136  WARN("Invalid buffer specified.\n");
137  return D3DERR_INVALIDCALL;
138  }
139 
140  object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
141  if (!object)
142  return E_OUTOFMEMORY;
143 
144  hr = d3dx9_buffer_init(object, size);
145  if (FAILED(hr))
146  {
147  WARN("Failed to initialize buffer, hr %#x.\n", hr);
148  HeapFree(GetProcessHeap(), 0, object);
149  return hr;
150  }
151 
152  *buffer = &object->ID3DXBuffer_iface;
153 
154  TRACE("Created ID3DXBuffer %p.\n", *buffer);
155 
156  return D3D_OK;
157 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
#define D3DERR_INVALIDCALL
GLuint buffer
Definition: glext.h:5915
#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:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
#define D3D_OK
Definition: d3d.h:106
static HRESULT d3dx9_buffer_init(struct ID3DXBufferImpl *buffer, DWORD size)
Definition: core.c:113
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define HeapFree(x, y, z)
Definition: compat.h:394
void * object
Definition: jmemsys.h:48

◆ D3DXCreateMesh()

HRESULT WINAPI D3DXCreateMesh ( DWORD  face_count,
DWORD  vertex_count,
DWORD  flags,
const D3DVERTEXELEMENT9 declaration,
struct IDirect3DDevice9 *  device,
struct ID3DXMesh **  mesh 
)

Definition at line 2433 of file mesh.c.

2435 {
2436  HRESULT hr;
2437  DWORD fvf;
2438  IDirect3DVertexDeclaration9 *vertex_declaration;
2439  UINT vertex_declaration_size;
2440  UINT num_elem;
2441  IDirect3DVertexBuffer9 *vertex_buffer;
2442  IDirect3DIndexBuffer9 *index_buffer;
2443  DWORD *attrib_buffer;
2444  struct d3dx9_mesh *object;
2445  DWORD index_usage = 0;
2446  D3DPOOL index_pool = D3DPOOL_DEFAULT;
2447  D3DFORMAT index_format = D3DFMT_INDEX16;
2448  DWORD vertex_usage = 0;
2449  D3DPOOL vertex_pool = D3DPOOL_DEFAULT;
2450  int i;
2451 
2452  TRACE("numfaces %u, numvertices %u, options %#x, declaration %p, device %p, mesh %p.\n",
2454 
2455  if (numfaces == 0 || numvertices == 0 || declaration == NULL || device == NULL || mesh == NULL ||
2456  /* D3DXMESH_VB_SHARE is for cloning, and D3DXMESH_USEHWONLY is for ConvertToBlendedMesh */
2457  (options & (D3DXMESH_VB_SHARE | D3DXMESH_USEHWONLY | 0xfffe0000)))
2458  {
2459  return D3DERR_INVALIDCALL;
2460  }
2461  for (i = 0; declaration[i].Stream != 0xff; i++)
2462  if (declaration[i].Stream != 0)
2463  return D3DERR_INVALIDCALL;
2464  num_elem = i + 1;
2465 
2466  if (options & D3DXMESH_32BIT)
2467  index_format = D3DFMT_INDEX32;
2468 
2469  if (options & D3DXMESH_DONOTCLIP) {
2470  index_usage |= D3DUSAGE_DONOTCLIP;
2471  vertex_usage |= D3DUSAGE_DONOTCLIP;
2472  }
2473  if (options & D3DXMESH_POINTS) {
2474  index_usage |= D3DUSAGE_POINTS;
2475  vertex_usage |= D3DUSAGE_POINTS;
2476  }
2477  if (options & D3DXMESH_RTPATCHES) {
2478  index_usage |= D3DUSAGE_RTPATCHES;
2479  vertex_usage |= D3DUSAGE_RTPATCHES;
2480  }
2481  if (options & D3DXMESH_NPATCHES) {
2482  index_usage |= D3DUSAGE_NPATCHES;
2483  vertex_usage |= D3DUSAGE_NPATCHES;
2484  }
2485 
2487  vertex_pool = D3DPOOL_SYSTEMMEM;
2488  else if (options & D3DXMESH_VB_MANAGED)
2489  vertex_pool = D3DPOOL_MANAGED;
2490 
2492  vertex_usage |= D3DUSAGE_WRITEONLY;
2494  vertex_usage |= D3DUSAGE_DYNAMIC;
2496  vertex_usage |= D3DUSAGE_SOFTWAREPROCESSING;
2497 
2499  index_pool = D3DPOOL_SYSTEMMEM;
2500  else if (options & D3DXMESH_IB_MANAGED)
2501  index_pool = D3DPOOL_MANAGED;
2502 
2504  index_usage |= D3DUSAGE_WRITEONLY;
2506  index_usage |= D3DUSAGE_DYNAMIC;
2508  index_usage |= D3DUSAGE_SOFTWAREPROCESSING;
2509 
2511  if (hr != D3D_OK)
2512  {
2513  fvf = 0;
2514  }
2515 
2516  /* Create vertex declaration */
2518  declaration,
2520  if (FAILED(hr))
2521  {
2522  WARN("Unexpected return value %x from IDirect3DDevice9_CreateVertexDeclaration.\n",hr);
2523  return hr;
2524  }
2526 
2527  /* Create vertex buffer */
2530  vertex_usage,
2531  fvf,
2532  vertex_pool,
2533  &vertex_buffer,
2534  NULL);
2535  if (FAILED(hr))
2536  {
2537  WARN("Unexpected return value %x from IDirect3DDevice9_CreateVertexBuffer.\n",hr);
2539  return hr;
2540  }
2541 
2542  /* Create index buffer */
2544  numfaces * 3 * ((index_format == D3DFMT_INDEX16) ? 2 : 4),
2545  index_usage,
2546  index_format,
2547  index_pool,
2548  &index_buffer,
2549  NULL);
2550  if (FAILED(hr))
2551  {
2552  WARN("Unexpected return value %x from IDirect3DDevice9_CreateVertexBuffer.\n",hr);
2555  return hr;
2556  }
2557 
2559  object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
2560  if (object == NULL || attrib_buffer == NULL)
2561  {
2562  HeapFree(GetProcessHeap(), 0, object);
2567  *mesh = NULL;
2568  return E_OUTOFMEMORY;
2569  }
2570  object->ID3DXMesh_iface.lpVtbl = &D3DXMesh_Vtbl;
2571  object->ref = 1;
2572 
2573  object->numfaces = numfaces;
2574  object->numvertices = numvertices;
2575  object->options = options;
2576  object->fvf = fvf;
2577  object->device = device;
2579 
2580  copy_declaration(object->cached_declaration, declaration, num_elem);
2581  object->vertex_declaration = vertex_declaration;
2582  object->vertex_declaration_size = vertex_declaration_size;
2583  object->num_elem = num_elem;
2584  object->vertex_buffer = vertex_buffer;
2585  object->index_buffer = index_buffer;
2586  object->attrib_buffer = attrib_buffer;
2587 
2588  *mesh = &object->ID3DXMesh_iface;
2589 
2590  return D3D_OK;
2591 }
#define D3DUSAGE_DYNAMIC
Definition: d3d8types.h:99
#define IDirect3DDevice9_CreateVertexBuffer(p, a, b, c, d, e, f)
Definition: d3d9.h:1533
DWORD numfaces
Definition: mesh.c:50
HRESULT hr
Definition: shlfolder.c:183
static const struct ID3DXMeshVtbl D3DXMesh_Vtbl
Definition: mesh.c:1863
#define WARN(fmt,...)
Definition: debug.h:111
#define D3DUSAGE_POINTS
Definition: d3d8types.h:96
enum _D3DPOOL D3DPOOL
#define D3DUSAGE_DONOTCLIP
Definition: d3d8types.h:95
#define D3DERR_INVALIDCALL
#define IDirect3DDevice9_CreateVertexDeclaration(p, a, b)
Definition: d3d9.h:1593
#define D3DUSAGE_WRITEONLY
Definition: d3d8types.h:93
DWORD fvf
Definition: mesh.c:53
#define D3DUSAGE_SOFTWAREPROCESSING
Definition: d3d8types.h:94
static void copy_declaration(D3DVERTEXELEMENT9 *dst, const D3DVERTEXELEMENT9 *src, UINT num_elem)
Definition: mesh.c:218
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 E_OUTOFMEMORY
Definition: ddrawi.h:100
DWORD numvertices
Definition: mesh.c:51
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
enum _D3DFORMAT D3DFORMAT
int options
Definition: main.c:106
#define D3DUSAGE_NPATCHES
Definition: d3d8types.h:98
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
IDirect3DVertexBuffer9 * vertex_buffer
Definition: mesh.c:59
unsigned int UINT
Definition: ndis.h:50
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1507
UINT num_elem
Definition: mesh.c:58
#define IDirect3DDevice9_CreateIndexBuffer(p, a, b, c, d, e, f)
Definition: d3d9.h:1534
#define D3DUSAGE_RTPATCHES
Definition: d3d8types.h:97
#define IDirect3DVertexBuffer9_Release(p)
Definition: d3d9.h:696
DWORD * attrib_buffer
Definition: mesh.c:61
IDirect3DDevice9 * device
Definition: mesh.c:54
#define D3D_OK
Definition: d3d.h:106
#define IDirect3DIndexBuffer9_Release(p)
Definition: d3d9.h:764
IDirect3DIndexBuffer9 * index_buffer
Definition: mesh.c:60
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HRESULT WINAPI D3DXFVFFromDeclarator(const D3DVERTEXELEMENT9 *declaration, DWORD *fvf)
Definition: mesh.c:2135
IDirect3DVertexDeclaration9 * vertex_declaration
Definition: mesh.c:56
UINT vertex_declaration_size
Definition: mesh.c:57
UINT WINAPI D3DXGetDeclVertexSize(const D3DVERTEXELEMENT9 *decl, DWORD stream_idx)
Definition: mesh.c:2324
#define HeapFree(x, y, z)
Definition: compat.h:394
_Inout_opt_ PUNICODE_STRING _Inout_opt_ PUNICODE_STRING Stream
Definition: fltkernel.h:1092
void * object
Definition: jmemsys.h:48
#define IDirect3DVertexDeclaration9_Release(p)
Definition: d3d9.h:1185

Referenced by d3dx9_mesh_CloneMesh(), and D3DXCreateMeshFVF().

◆ D3DXCreateMeshFVF()

HRESULT WINAPI D3DXCreateMeshFVF ( DWORD  face_count,
DWORD  vertex_count,
DWORD  flags,
DWORD  fvf,
struct IDirect3DDevice9 *  device,
struct ID3DXMesh **  mesh 
)

Definition at line 2596 of file mesh.c.

2598 {
2599  HRESULT hr;
2601 
2602  TRACE("(%u, %u, %u, %u, %p, %p)\n", numfaces, numvertices, options, fvf, device, mesh);
2603 
2605  if (FAILED(hr)) return hr;
2606 
2608 }
DWORD numfaces
Definition: mesh.c:50
HRESULT hr
Definition: shlfolder.c:183
DWORD fvf
Definition: mesh.c:53
DWORD numvertices
Definition: mesh.c:51
Definition: devices.h:37
HRESULT WINAPI D3DXDeclaratorFromFVF(DWORD fvf, D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE])
Definition: mesh.c:2037
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI D3DXCreateMesh(DWORD numfaces, DWORD numvertices, DWORD options, const D3DVERTEXELEMENT9 *declaration, struct IDirect3DDevice9 *device, struct ID3DXMesh **mesh)
Definition: mesh.c:2433

Referenced by D3DXCreateBox(), D3DXCreateCylinder(), D3DXCreatePolygon(), D3DXCreateSphere(), D3DXCreateTextW(), D3DXCreateTorus(), D3DXLoadMeshFromXInMemory(), and D3DXLoadSkinMeshFromXof().

◆ D3DXCreatePatchMesh()

HRESULT WINAPI D3DXCreatePatchMesh ( const D3DXPATCHINFO patch_info,
DWORD  patch_count,
DWORD  vertex_count,
DWORD  flags,
const D3DVERTEXELEMENT9 declaration,
struct IDirect3DDevice9 *  device,
struct ID3DXPatchMesh **  mesh 
)

◆ D3DXCreatePMeshFromStream()

HRESULT WINAPI D3DXCreatePMeshFromStream ( struct IStream stream,
DWORD  flags,
struct IDirect3DDevice9 *  device,
struct ID3DXBuffer **  materials,
struct ID3DXBuffer **  effect_instances,
DWORD material_count,
struct ID3DXPMesh **  mesh 
)

◆ D3DXCreatePRTBuffer()

HRESULT WINAPI D3DXCreatePRTBuffer ( UINT  sample_count,
UINT  coeff_count,
UINT  channel_count,
ID3DXPRTBuffer **  buffer 
)

◆ D3DXCreatePRTBufferTex()

HRESULT WINAPI D3DXCreatePRTBufferTex ( UINT  width,
UINT  height,
UINT  coeff_count,
UINT  channel_count,
ID3DXPRTBuffer **  buffer 
)

◆ D3DXCreatePRTCompBuffer()

HRESULT WINAPI D3DXCreatePRTCompBuffer ( D3DXSHCOMPRESSQUALITYTYPE  quality,
UINT  cluster_count,
UINT  pca_count,
LPD3DXSHPRTSIMCB  cb,
void ctx,
ID3DXPRTBuffer *  input,
ID3DXPRTCompBuffer **  buffer 
)

◆ D3DXCreatePRTEngine()

HRESULT WINAPI D3DXCreatePRTEngine ( ID3DXMesh *  mesh,
DWORD adjacency,
BOOL  extract_uv,
ID3DXMesh *  blocker_mesh,
ID3DXPRTEngine **  engine 
)

◆ D3DXCreateSkinInfo()

HRESULT WINAPI D3DXCreateSkinInfo ( DWORD  vertex_count,
const D3DVERTEXELEMENT9 declaration,
DWORD  bone_count,
ID3DXSkinInfo **  skin_info 
)

Definition at line 523 of file skin.c.

525 {
526  HRESULT hr;
527  static const D3DVERTEXELEMENT9 empty_declaration = D3DDECL_END();
528  struct d3dx9_skin_info *object = NULL;
529 
530  TRACE("num_vertices %u, declaration %p, num_bones %u, skin_info %p.\n",
531  num_vertices, declaration, num_bones, skin_info);
532 
533  if (!skin_info || !declaration)
534  return D3DERR_INVALIDCALL;
535 
536  object = HeapAlloc(GetProcessHeap(), 0, sizeof(*object));
537  if (!object)
538  return E_OUTOFMEMORY;
539 
540  object->ID3DXSkinInfo_iface.lpVtbl = &d3dx9_skin_info_vtbl;
541  object->ref = 1;
542  object->num_vertices = num_vertices;
543  object->num_bones = num_bones;
544  object->vertex_declaration[0] = empty_declaration;
545  object->fvf = 0;
546 
547  object->bones = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, num_bones * sizeof(*object->bones));
548  if (!object->bones) {
549  hr = E_OUTOFMEMORY;
550  goto error;
551  }
552 
553  if (FAILED(hr = d3dx9_skin_info_SetDeclaration(&object->ID3DXSkinInfo_iface, declaration)))
554  goto error;
555 
556  *skin_info = &object->ID3DXSkinInfo_iface;
557 
558  return D3D_OK;
559 error:
560  HeapFree(GetProcessHeap(), 0, object->bones);
561  HeapFree(GetProcessHeap(), 0, object);
562  return hr;
563 }
static const struct ID3DXSkinInfoVtbl d3dx9_skin_info_vtbl
Definition: skin.c:492
HRESULT hr
Definition: shlfolder.c:183
#define error(str)
Definition: mkdosfs.c:1605
#define D3DERR_INVALIDCALL
DWORD num_vertices
Definition: skin.c:45
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
static HRESULT WINAPI d3dx9_skin_info_SetDeclaration(ID3DXSkinInfo *iface, const D3DVERTEXELEMENT9 *declaration)
Definition: skin.c:329
#define D3DDECL_END()
Definition: d3d9types.h:311
#define D3D_OK
Definition: d3d.h:106
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
DWORD num_bones
Definition: skin.c:46
#define HeapFree(x, y, z)
Definition: compat.h:394

Referenced by D3DXCreateSkinInfoFVF().

◆ D3DXCreateSkinInfoFromBlendedMesh()

HRESULT WINAPI D3DXCreateSkinInfoFromBlendedMesh ( ID3DXBaseMesh *  mesh,
DWORD  bone_count,
const D3DXBONECOMBINATION bone_combination_table,
ID3DXSkinInfo **  skin_info 
)

◆ D3DXCreateSkinInfoFVF()

HRESULT WINAPI D3DXCreateSkinInfoFVF ( DWORD  vertex_count,
DWORD  fvf,
DWORD  bone_count,
ID3DXSkinInfo **  skin_info 
)

Definition at line 565 of file skin.c.

566 {
567  HRESULT hr;
569 
570  TRACE("(%u, %x, %u, %p)\n", num_vertices, fvf, num_bones, skin_info);
571 
573  if (FAILED(hr))
574  return hr;
575 
577 }
HRESULT hr
Definition: shlfolder.c:183
DWORD num_vertices
Definition: skin.c:45
DWORD fvf
Definition: skin.c:43
HRESULT WINAPI D3DXDeclaratorFromFVF(DWORD fvf, D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE])
Definition: mesh.c:2037
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
HRESULT WINAPI D3DXCreateSkinInfo(DWORD num_vertices, const D3DVERTEXELEMENT9 *declaration, DWORD num_bones, ID3DXSkinInfo **skin_info)
Definition: skin.c:523
DWORD num_bones
Definition: skin.c:46

Referenced by parse_skin_mesh_info().

◆ D3DXCreateSPMesh()

HRESULT WINAPI D3DXCreateSPMesh ( ID3DXMesh *  mesh,
const DWORD adjacency,
const D3DXATTRIBUTEWEIGHTS attribute_weights,
const float *  vertex_weights,
ID3DXSPMesh **  spmesh 
)

◆ D3DXCreateTextureGutterHelper()

HRESULT WINAPI D3DXCreateTextureGutterHelper ( UINT  width,
UINT  height,
ID3DXMesh *  mesh,
float  gutter_size,
ID3DXTextureGutterHelper **  gh 
)

◆ D3DXDeclaratorFromFVF()

HRESULT WINAPI D3DXDeclaratorFromFVF ( DWORD  ,
D3DVERTEXELEMENT9  [MAX_FVF_DECL_SIZE] 
)

Definition at line 2037 of file mesh.c.

2038 {
2039  static const D3DVERTEXELEMENT9 end_element = D3DDECL_END();
2041  unsigned int offset = 0;
2042  unsigned int idx = 0;
2043  unsigned int i;
2044 
2045  TRACE("fvf %#x, declaration %p.\n", fvf, declaration);
2046 
2048 
2049  if (fvf & D3DFVF_POSITION_MASK)
2050  {
2051  BOOL has_blend = (fvf & D3DFVF_XYZB5) >= D3DFVF_XYZB1;
2052  DWORD blend_count = 1 + (((fvf & D3DFVF_XYZB5) - D3DFVF_XYZB1) >> 1);
2053  BOOL has_blend_idx = (fvf & D3DFVF_LASTBETA_D3DCOLOR) || (fvf & D3DFVF_LASTBETA_UBYTE4);
2054 
2055  if (has_blend_idx) --blend_count;
2056 
2058  || (has_blend && blend_count > 4))
2059  return D3DERR_INVALIDCALL;
2060 
2063  else
2065 
2066  if (has_blend)
2067  {
2068  switch (blend_count)
2069  {
2070  case 0:
2071  break;
2072  case 1:
2074  break;
2075  case 2:
2077  break;
2078  case 3:
2080  break;
2081  case 4:
2083  break;
2084  default:
2085  ERR("Invalid blend count %u.\n", blend_count);
2086  break;
2087  }
2088 
2089  if (has_blend_idx)
2090  {
2093  else if (fvf & D3DFVF_LASTBETA_D3DCOLOR)
2095  }
2096  }
2097  }
2098 
2099  if (fvf & D3DFVF_NORMAL)
2101  if (fvf & D3DFVF_PSIZE)
2103  if (fvf & D3DFVF_DIFFUSE)
2105  if (fvf & D3DFVF_SPECULAR)
2107 
2108  for (i = 0; i < tex_count; ++i)
2109  {
2110  switch ((fvf >> (16 + 2 * i)) & 0x03)
2111  {
2112  case D3DFVF_TEXTUREFORMAT1:
2114  break;
2115  case D3DFVF_TEXTUREFORMAT2:
2117  break;
2118  case D3DFVF_TEXTUREFORMAT3:
2120  break;
2121  case D3DFVF_TEXTUREFORMAT4:
2123  break;
2124  }
2125  }
2126 
2127  declaration[idx] = end_element;
2128 
2129  return D3D_OK;
2130 }
#define D3DFVF_XYZB1
Definition: d3d8types.h:115
#define D3DFVF_LASTBETA_UBYTE4
Definition: d3d8types.h:135
#define D3DFVF_XYZRHW
Definition: d3d8types.h:114
#define D3DFVF_PSIZE
Definition: d3d8types.h:121
#define D3DFVF_RESERVED0
Definition: d3d8types.h:111
#define D3DFVF_NORMAL
Definition: d3d8types.h:120
GLintptr offset
Definition: glext.h:5920
#define D3DERR_INVALIDCALL
#define D3DFVF_RESERVED2
Definition: d3d8types.h:136
DWORD fvf
Definition: skin.c:43
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 D3DFVF_TEXCOUNT_MASK
Definition: d3d8types.h:124
#define D3DFVF_POSITION_MASK
Definition: d3d8types.h:112
unsigned int idx
Definition: utils.c:41
#define D3DFVF_SPECULAR
Definition: d3d8types.h:123
static void append_decl_element(D3DVERTEXELEMENT9 *declaration, UINT *idx, UINT *offset, D3DDECLTYPE type, D3DDECLUSAGE usage, UINT usage_idx)
Definition: mesh.c:2020
#define D3DFVF_TEXTUREFORMAT2
Definition: d3d8types.h:61
#define D3DFVF_TEXTUREFORMAT4
Definition: d3d8types.h:63
#define TRACE(s)
Definition: solgame.cpp:4
unsigned int BOOL
Definition: ntddk_ex.h:94
#define D3DFVF_XYZB5
Definition: d3d8types.h:119
unsigned long DWORD
Definition: ntddk_ex.h:95
#define D3DDECL_END()
Definition: d3d9types.h:311
#define ERR(fmt,...)
Definition: debug.h:109
#define D3D_OK
Definition: d3d.h:106
#define D3DFVF_TEXCOUNT_SHIFT
Definition: d3d8types.h:125
#define D3DFVF_DIFFUSE
Definition: d3d8types.h:122
#define D3DFVF_TEXTUREFORMAT3
Definition: d3d8types.h:62
#define D3DFVF_XYZW
Definition: d3d9types.h:143
#define D3DFVF_LASTBETA_D3DCOLOR
Definition: d3d9types.h:160
#define D3DFVF_TEXTUREFORMAT1
Definition: d3d8types.h:60

Referenced by d3dx9_mesh_CloneMeshFVF(), d3dx9_skin_info_SetFVF(), D3DXCreateMeshFVF(), and D3DXCreateSkinInfoFVF().

◆ D3DXFVFFromDeclarator()

HRESULT WINAPI D3DXFVFFromDeclarator ( const D3DVERTEXELEMENT9 decl,
DWORD fvf 
)

Definition at line 2135 of file mesh.c.

2136 {
2137  unsigned int i = 0, texture, offset;
2138 
2139  TRACE("(%p, %p)\n", declaration, fvf);
2140 
2141  *fvf = 0;
2143  {
2145  declaration[1].UsageIndex == 0) &&
2147  declaration[2].UsageIndex == 0))
2148  {
2149  return D3DERR_INVALIDCALL;
2150  }
2152  declaration[1].Usage == D3DDECLUSAGE_BLENDINDICES && declaration[1].UsageIndex == 0)
2153  {
2155  {
2157  }
2158  else
2159  {
2161  }
2162  i = 2;
2163  }
2165  declaration[1].UsageIndex == 0)
2166  {
2168  declaration[2].Usage == D3DDECLUSAGE_BLENDINDICES && declaration[2].UsageIndex == 0)
2169  {
2171  {
2173  }
2174  else
2175  {
2177  }
2178  switch (declaration[1].Type)
2179  {
2180  case D3DDECLTYPE_FLOAT1: *fvf |= D3DFVF_XYZB2; break;
2181  case D3DDECLTYPE_FLOAT2: *fvf |= D3DFVF_XYZB3; break;
2182  case D3DDECLTYPE_FLOAT3: *fvf |= D3DFVF_XYZB4; break;
2183  case D3DDECLTYPE_FLOAT4: *fvf |= D3DFVF_XYZB5; break;
2184  }
2185  i = 3;
2186  }
2187  else
2188  {
2189  switch (declaration[1].Type)
2190  {
2191  case D3DDECLTYPE_FLOAT1: *fvf |= D3DFVF_XYZB1; break;
2192  case D3DDECLTYPE_FLOAT2: *fvf |= D3DFVF_XYZB2; break;
2193  case D3DDECLTYPE_FLOAT3: *fvf |= D3DFVF_XYZB3; break;
2194  case D3DDECLTYPE_FLOAT4: *fvf |= D3DFVF_XYZB4; break;
2195  }
2196  i = 2;
2197  }
2198  }
2199  else
2200  {
2201  *fvf |= D3DFVF_XYZ;
2202  i = 1;
2203  }
2204  }
2206  declaration[0].UsageIndex == 0)
2207  {
2208  *fvf |= D3DFVF_XYZRHW;
2209  i = 1;
2210  }
2211 
2213  {
2214  *fvf |= D3DFVF_NORMAL;
2215  i++;
2216  }
2218  declaration[i].UsageIndex == 0)
2219  {
2220  *fvf |= D3DFVF_PSIZE;
2221  i++;
2222  }
2224  declaration[i].UsageIndex == 0)
2225  {
2226  *fvf |= D3DFVF_DIFFUSE;
2227  i++;
2228  }
2230  declaration[i].UsageIndex == 1)
2231  {
2232  *fvf |= D3DFVF_SPECULAR;
2233  i++;
2234  }
2235 
2236  for (texture = 0; texture < D3DDP_MAXTEXCOORD; i++, texture++)
2237  {
2238  if (declaration[i].Stream == 0xFF)
2239  {
2240  break;
2241  }
2243  declaration[i].UsageIndex == texture)
2244  {
2245  *fvf |= D3DFVF_TEXCOORDSIZE1(declaration[i].UsageIndex);
2246  }
2248  declaration[i].UsageIndex == texture)
2249  {
2250  *fvf |= D3DFVF_TEXCOORDSIZE2(declaration[i].UsageIndex);
2251  }
2253  declaration[i].UsageIndex == texture)
2254  {
2255  *fvf |= D3DFVF_TEXCOORDSIZE3(declaration[i].UsageIndex);
2256  }
2258  declaration[i].UsageIndex == texture)
2259  {
2260  *fvf |= D3DFVF_TEXCOORDSIZE4(declaration[i].UsageIndex);
2261  }
2262  else
2263  {
2264  return D3DERR_INVALIDCALL;
2265  }
2266  }
2267 
2269 
2270  for (offset = 0, i = 0; declaration[i].Stream != 0xFF;
2271  offset += d3dx_decltype_size[declaration[i].Type], i++)
2272  {
2273  if (declaration[i].Offset != offset)
2274  {
2275  return D3DERR_INVALIDCALL;
2276  }
2277  }
2278 
2279  return D3D_OK;
2280 }
#define D3DFVF_XYZB1
Definition: d3d8types.h:115
#define D3DFVF_LASTBETA_UBYTE4
Definition: d3d8types.h:135
#define D3DFVF_XYZRHW
Definition: d3d8types.h:114
Type
Definition: Type.h:6
#define D3DFVF_PSIZE
Definition: d3d8types.h:121
#define D3DFVF_TEXCOORDSIZE1(CoordIndex)
Definition: d3d8types.h:64
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
Definition: hidpi.h:382
#define D3DFVF_NORMAL
Definition: d3d8types.h:120
GLintptr offset
Definition: glext.h:5920
#define D3DERR_INVALIDCALL
#define D3DFVF_TEXCOORDSIZE3(CoordIndex)
Definition: d3d8types.h:66
DWORD fvf
Definition: skin.c:43
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 D3DDP_MAXTEXCOORD
Definition: d3d8types.h:303
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define D3DFVF_SPECULAR
Definition: d3d8types.h:123
#define D3DFVF_TEXCOORDSIZE4(CoordIndex)
Definition: d3d8types.h:67
#define D3DFVF_XYZB2
Definition: d3d8types.h:116
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint texture
Definition: glext.h:6295
#define D3DFVF_XYZB5
Definition: d3d8types.h:119
#define D3DFVF_XYZ
Definition: d3d8types.h:113
#define D3DFVF_TEXCOORDSIZE2(CoordIndex)
Definition: d3d8types.h:65
#define D3DFVF_XYZB3
Definition: d3d8types.h:117
static const UINT d3dx_decltype_size[]
Definition: mesh.c:67
#define D3DFVF_XYZB4
Definition: d3d8types.h:118
#define D3D_OK
Definition: d3d.h:106
#define D3DFVF_TEXCOUNT_SHIFT
Definition: d3d8types.h:125
#define D3DFVF_DIFFUSE
Definition: d3d8types.h:122
#define D3DFVF_LASTBETA_D3DCOLOR
Definition: d3d9types.h:160
_Inout_opt_ PUNICODE_STRING _Inout_opt_ PUNICODE_STRING Stream
Definition: fltkernel.h:1092

Referenced by d3dx9_skin_info_SetDeclaration(), and D3DXCreateMesh().

◆ D3DXGenerateOutputDecl()

HRESULT WINAPI D3DXGenerateOutputDecl ( D3DVERTEXELEMENT9 decl_out,
const D3DVERTEXELEMENT9 decl_in 
)

◆ D3DXGeneratePMesh()

HRESULT WINAPI D3DXGeneratePMesh ( ID3DXMesh *  mesh,
const DWORD adjacency,
const D3DXATTRIBUTEWEIGHTS attribute_weights,
const float *  vertex_weights,
DWORD  min_value,
DWORD  flags,
ID3DXPMesh **  pmesh 
)

◆ D3DXGetDeclLength()

UINT WINAPI D3DXGetDeclLength ( const D3DVERTEXELEMENT9 decl)

Definition at line 2355 of file mesh.c.

2356 {
2357  const D3DVERTEXELEMENT9 *element;
2358 
2359  TRACE("decl %p\n", decl);
2360 
2361  /* null decl results in exception on Windows XP */
2362 
2363  for (element = decl; element->Stream != 0xff; ++element);
2364 
2365  return element - decl;
2366 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ D3DXGetDeclVertexSize()

UINT WINAPI D3DXGetDeclVertexSize ( const D3DVERTEXELEMENT9 decl,
DWORD  stream_idx 
)

Definition at line 2324 of file mesh.c.

2325 {
2326  const D3DVERTEXELEMENT9 *element;
2327  UINT size = 0;
2328 
2329  TRACE("decl %p, stream_idx %u\n", decl, stream_idx);
2330 
2331  if (!decl) return 0;
2332 
2333  for (element = decl; element->Stream != 0xff; ++element)
2334  {
2335  UINT type_size;
2336 
2337  if (element->Stream != stream_idx) continue;
2338 
2339  if (element->Type >= ARRAY_SIZE(d3dx_decltype_size))
2340  {
2341  FIXME("Unhandled element type %#x, size will be incorrect.\n", element->Type);
2342  continue;
2343  }
2344 
2345  type_size = d3dx_decltype_size[element->Type];
2346  if (element->Offset + type_size > size) size = element->Offset + type_size;
2347  }
2348 
2349  return size;
2350 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
unsigned int UINT
Definition: ndis.h:50
static const UINT d3dx_decltype_size[]
Definition: mesh.c:67
#define ARRAY_SIZE(a)
Definition: main.h:24

Referenced by d3dx9_mesh_UpdateSemantics(), D3DXCreateMesh(), and D3DXLoadMeshFromXInMemory().

◆ D3DXGetFVFVertexSize()

UINT WINAPI D3DXGetFVFVertexSize ( DWORD  )

Definition at line 2290 of file mesh.c.

2291 {
2292  DWORD size = 0;
2293  UINT i;
2294  UINT numTextures = (FVF & D3DFVF_TEXCOUNT_MASK) >> D3DFVF_TEXCOUNT_SHIFT;
2295 
2296  if (FVF & D3DFVF_NORMAL) size += sizeof(D3DXVECTOR3);
2297  if (FVF & D3DFVF_DIFFUSE) size += sizeof(DWORD);
2298  if (FVF & D3DFVF_SPECULAR) size += sizeof(DWORD);
2299  if (FVF & D3DFVF_PSIZE) size += sizeof(DWORD);
2300 
2301  switch (FVF & D3DFVF_POSITION_MASK)
2302  {
2303  case D3DFVF_XYZ: size += sizeof(D3DXVECTOR3); break;
2304  case D3DFVF_XYZRHW: size += 4 * sizeof(FLOAT); break;
2305  case D3DFVF_XYZB1: size += 4 * sizeof(FLOAT); break;
2306  case D3DFVF_XYZB2: size += 5 * sizeof(FLOAT); break;
2307  case D3DFVF_XYZB3: size += 6 * sizeof(FLOAT); break;
2308  case D3DFVF_XYZB4: size += 7 * sizeof(FLOAT); break;
2309  case D3DFVF_XYZB5: size += 8 * sizeof(FLOAT); break;
2310  case D3DFVF_XYZW: size += 4 * sizeof(FLOAT); break;
2311  }
2312 
2313  for (i = 0; i < numTextures; i++)
2314  {
2315  size += Get_TexCoord_Size_From_FVF(FVF, i) * sizeof(FLOAT);
2316  }
2317 
2318  return size;
2319 }
#define D3DFVF_XYZB1
Definition: d3d8types.h:115
#define D3DFVF_XYZRHW
Definition: d3d8types.h:114
#define D3DFVF_PSIZE
Definition: d3d8types.h:121
#define FLOAT
Definition: i386-dis.c:516
#define DWORD
Definition: msvc.h:34
#define D3DFVF_NORMAL
Definition: d3d8types.h:120
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 D3DFVF_TEXCOUNT_MASK
Definition: d3d8types.h:124
#define D3DFVF_POSITION_MASK
Definition: d3d8types.h:112
#define D3DFVF_SPECULAR
Definition: d3d8types.h:123
#define D3DFVF_XYZB2
Definition: d3d8types.h:116
GLsizeiptr size
Definition: glext.h:5919
#define D3DFVF_XYZB5
Definition: d3d8types.h:119
#define D3DFVF_XYZ
Definition: d3d8types.h:113
unsigned int UINT
Definition: ndis.h:50
struct _D3DVECTOR D3DXVECTOR3
Definition: d3dx9math.h:97
unsigned long DWORD
Definition: ntddk_ex.h:95
static UINT Get_TexCoord_Size_From_FVF(DWORD FVF, int tex_num)
Definition: mesh.c:2285
#define D3DFVF_XYZB3
Definition: d3d8types.h:117
#define D3DFVF_XYZB4
Definition: d3d8types.h:118
#define D3DFVF_TEXCOUNT_SHIFT
Definition: d3d8types.h:125
#define D3DFVF_DIFFUSE
Definition: d3d8types.h:122
#define D3DFVF_XYZW
Definition: d3d9types.h:143

◆ D3DXIntersect()

HRESULT WINAPI D3DXIntersect ( ID3DXBaseMesh *  mesh,
const D3DXVECTOR3 ray_position,
const D3DXVECTOR3 ray_direction,
BOOL hit,
DWORD face_idx,
float *  u,
float *  v,
float *  distance,
ID3DXBuffer **  hits,
DWORD hit_count 
)

Definition at line 7582 of file mesh.c.

7584 {
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);
7587 
7588  return E_NOTIMPL;
7589 }
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
Definition: glfuncs.h:240
GLsizei GLsizei GLfloat distance
Definition: glext.h:11755
#define FIXME(fmt,...)
Definition: debug.h:110
const GLdouble * v
Definition: gl.h:2040
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ D3DXIntersectSubset()

HRESULT WINAPI D3DXIntersectSubset ( ID3DXBaseMesh *  mesh,
DWORD  attribute_id,
const D3DXVECTOR3 ray_position,
const D3DXVECTOR3 ray_direction,
BOOL hit,
DWORD face_idx,
float *  u,
float *  v,
float *  distance,
ID3DXBuffer **  hits,
DWORD hit_count 
)

◆ D3DXIntersectTri()

BOOL WINAPI D3DXIntersectTri ( const D3DXVECTOR3 vtx0,
const D3DXVECTOR3 vtx1,
const D3DXVECTOR3 vtx2,
const D3DXVECTOR3 ray_pos,
const D3DXVECTOR3 ray_dir,
FLOAT u,
FLOAT v,
FLOAT dist 
)

Definition at line 2368 of file mesh.c.

2370 {
2371  D3DXMATRIX m;
2372  D3DXVECTOR4 vec;
2373 
2374  TRACE("p0 %p, p1 %p, p2 %p, praypos %p, praydir %p, pu %p, pv %p, pdist %p.\n",
2375  p0, p1, p2, praypos, praydir, pu, pv, pdist);
2376 
2377  m.u.m[0][0] = p1->x - p0->x;
2378  m.u.m[1][0] = p2->x - p0->x;
2379  m.u.m[2][0] = -praydir->x;
2380  m.u.m[3][0] = 0.0f;
2381  m.u.m[0][1] = p1->y - p0->y;
2382  m.u.m[1][1] = p2->y - p0->y;
2383  m.u.m[2][1] = -praydir->y;
2384  m.u.m[3][1] = 0.0f;
2385  m.u.m[0][2] = p1->z - p0->z;
2386  m.u.m[1][2] = p2->z - p0->z;
2387  m.u.m[2][2] = -praydir->z;
2388  m.u.m[3][2] = 0.0f;
2389  m.u.m[0][3] = 0.0f;
2390  m.u.m[1][3] = 0.0f;
2391  m.u.m[2][3] = 0.0f;
2392  m.u.m[3][3] = 1.0f;
2393 
2394  vec.x = praypos->x - p0->x;
2395  vec.y = praypos->y - p0->y;
2396  vec.z = praypos->z - p0->z;
2397  vec.w = 0.0f;
2398 
2399  if ( D3DXMatrixInverse(&m, NULL, &m) )
2400  {
2401  D3DXVec4Transform(&vec, &vec, &m);
2402  if ( (vec.x >= 0.0f) && (vec.y >= 0.0f) && (vec.x + vec.y <= 1.0f) && (vec.z >= 0.0f) )
2403  {
2404  if (pu) *pu = vec.x;
2405  if (pv) *pv = vec.y;
2406  if (pdist) *pdist = fabsf( vec.z );
2407  return TRUE;
2408  }
2409  }
2410 
2411  return FALSE;
2412 }
FT_Pos y
Definition: ftimage.h:77
FT_Pos x
Definition: ftimage.h:76
const GLfloat * m
Definition: glext.h:10848
DWORD void * pv
Definition: msvc.h:87
D3DXVECTOR4 *WINAPI D3DXVec4Transform(D3DXVECTOR4 *pout, const D3DXVECTOR4 *pv, const D3DXMATRIX *pm)
Definition: math.c:2117
smooth NULL
Definition: ftsmooth.c:416
D3DXMATRIX *WINAPI D3DXMatrixInverse(D3DXMATRIX *pout, FLOAT *pdeterminant, const D3DXMATRIX *pm)
Definition: math.c:254
#define TRACE(s)
Definition: solgame.cpp:4
FT_Vector * vec
Definition: ftbbox.c:448
_Check_return_ __CRT_INLINE float __CRTDECL fabsf(_In_ float x)
Definition: math.h:164
#define TRUE
Definition: mesh.c:42

◆ D3DXLoadMeshFromXA()

HRESULT WINAPI D3DXLoadMeshFromXA ( const char filename,
DWORD  flags,
struct IDirect3DDevice9 *  device,
struct ID3DXBuffer **  adjacency,
struct ID3DXBuffer **  materials,
struct ID3DXBuffer **  effect_instances,
DWORD material_count,
struct ID3DXMesh **  mesh 
)

Definition at line 4052 of file mesh.c.

4055 {
4056  WCHAR *filenameW;
4057  HRESULT hr;
4058  int len;
4059 
4060  TRACE("filename %s, options %#x, device %p, adjacency %p, materials %p, "
4061  "effect_instances %p, num_materials %p, mesh %p.\n",
4062  debugstr_a(filename), options, device, adjacency, materials,
4063  effect_instances, num_materials, mesh);
4064 
4065  if (!filename)
4066  return D3DERR_INVALIDCALL;
4067 
4068  len = MultiByteToWideChar(CP_ACP, 0, filename, -1, NULL, 0);
4069  filenameW = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
4070  if (!filenameW) return E_OUTOFMEMORY;
4072 
4073  hr = D3DXLoadMeshFromXW(filenameW, options, device, adjacency, materials,
4074  effect_instances, num_materials, mesh);
4076 
4077  return hr;
4078 }
HRESULT hr
Definition: shlfolder.c:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define CP_ACP
Definition: compat.h:99
#define D3DERR_INVALIDCALL
const char * filename
Definition: ioapi.h:135
static const WCHAR filenameW[]
Definition: amstream.c:41
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
GLenum GLsizei len
Definition: glext.h:6722
#define MultiByteToWideChar
Definition: compat.h:100
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)
Definition: mesh.c:4080
#define HeapFree(x, y, z)
Definition: compat.h:394

◆ D3DXLoadMeshFromXInMemory()

HRESULT WINAPI D3DXLoadMeshFromXInMemory ( const void data,
DWORD  data_size,
DWORD  flags,
struct IDirect3DDevice9 *  device,
struct ID3DXBuffer **  adjacency,
struct ID3DXBuffer **  materials,
struct ID3DXBuffer **  effect_instances,
DWORD material_count,
struct ID3DXMesh **  mesh 
)

Definition at line 4198 of file mesh.c.

4201 {
4202  HRESULT hr;
4203  ID3DXFile *d3dxfile = NULL;
4204  ID3DXFileEnumObject *enumobj = NULL;
4205  ID3DXFileData *filedata = NULL;
4207  ID3DXBuffer *materials = NULL;
4208  ID3DXBuffer *effects = NULL;
4209  ID3DXBuffer *adjacency = NULL;
4210  struct list container_list = LIST_INIT(container_list);
4211  struct mesh_container *container_ptr, *next_container_ptr;
4213  DWORD num_faces, num_vertices;
4215  DWORD provide_flags = 0;
4216  DWORD fvf;
4217  ID3DXMesh *concat_mesh = NULL;
4218  D3DVERTEXELEMENT9 concat_decl[MAX_FVF_DECL_SIZE];
4219  BYTE *concat_vertices = NULL;
4220  void *concat_indices = NULL;
4221  DWORD index_offset;
4222  DWORD concat_vertex_size;
4223  SIZE_T i, nb_children;
4224  GUID guid;
4225 
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);
4228 
4229  if (!memory || !memory_size || !device || !mesh_out)
4230  return D3DERR_INVALIDCALL;
4231 
4232  hr = D3DXFileCreate(&d3dxfile);
4233  if (FAILED(hr)) goto cleanup;
4234 
4235  hr = d3dxfile->lpVtbl->RegisterTemplates(d3dxfile, D3DRM_XTEMPLATES, D3DRM_XTEMPLATE_BYTES);
4236  if (FAILED(hr)) goto cleanup;
4237 
4238  source.lpMemory = (void*)memory;
4239  source.dSize = memory_size;
4240  hr = d3dxfile->lpVtbl->CreateEnumObject(d3dxfile, &source, D3DXF_FILELOAD_FROMMEMORY, &enumobj);
4241  if (FAILED(hr)) goto cleanup;
4242 
4243  D3DXMatrixIdentity(&identity);
4244  if (adjacency_out) provide_flags |= PROVIDE_ADJACENCY;
4245  if (materials_out || effects_out) provide_flags |= PROVIDE_MATERIALS;
4246 
4247  hr = enumobj->lpVtbl->GetChildren(enumobj, &nb_children);
4248  if (FAILED(hr))
4249  goto cleanup;
4250 
4251  for (i = 0; i < nb_children; i++)
4252  {
4253  hr = enumobj->lpVtbl->GetChild(enumobj, i, &filedata);
4254  if (FAILED(hr))
4255  goto cleanup;
4256 
4257  hr = filedata->lpVtbl->GetType(filedata, &guid);
4258  if (SUCCEEDED(hr)) {
4259  if (IsEqualGUID(&guid, &TID_D3DRMMesh)) {
4260  container_ptr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*container_ptr));
4261  if (!container_ptr) {
4262  hr = E_OUTOFMEMORY;
4263  goto cleanup;
4264  }
4265  list_add_tail(&container_list, &container_ptr->entry);
4266  D3DXMatrixIdentity(&container_ptr->transform);
4267 
4269  (provide_flags & PROVIDE_ADJACENCY) ? &container_ptr->adjacency : NULL,
4270  (provide_flags & PROVIDE_MATERIALS) ? &container_ptr->materials : NULL,
4271  NULL, &container_ptr->num_materials, NULL, &container_ptr->mesh);
4272  } else if (IsEqualGUID(&guid, &TID_D3DRMFrame)) {
4273  hr = parse_frame(filedata, options, device, &identity, &container_list, provide_flags);
4274  }
4275  if (FAILED(hr)) goto cleanup;
4276  }
4277  filedata->lpVtbl->Release(filedata);
4278  filedata = NULL;
4279  if (FAILED(hr))
4280  goto cleanup;
4281  }
4282 
4283  enumobj->lpVtbl->Release(enumobj);
4284  enumobj = NULL;
4285  d3dxfile->lpVtbl->Release(d3dxfile);
4286  d3dxfile = NULL;
4287 
4288  if (list_empty(&container_list)) {
4289  hr = E_FAIL;
4290  goto cleanup;
4291  }
4292 
4293  fvf = D3DFVF_XYZ;
4294  num_faces = 0;
4295  num_vertices = 0;
4296  num_materials = 0;
4297  LIST_FOR_EACH_ENTRY(container_ptr, &container_list, struct mesh_container, entry)
4298  {
4299  ID3DXMesh *mesh = container_ptr->mesh;
4300  fvf |= mesh->lpVtbl->GetFVF(mesh);
4301  num_faces += mesh->lpVtbl->GetNumFaces(mesh);
4302  num_vertices += mesh->lpVtbl->GetNumVertices(mesh);
4303  num_materials += container_ptr->num_materials;
4304  }
4305 
4306  hr = D3DXCreateMeshFVF(num_faces, num_vertices, options, fvf, device, &concat_mesh);
4307  if (FAILED(hr)) goto cleanup;
4308 
4309  hr = concat_mesh->lpVtbl->GetDeclaration(concat_mesh, concat_decl);
4310  if (FAILED(hr)) goto cleanup;
4311 
4312  concat_vertex_size = D3DXGetDeclVertexSize(concat_decl, 0);
4313 
4314  hr = concat_mesh->lpVtbl->LockVertexBuffer(concat_mesh, 0, (void**)&concat_vertices);
4315  if (FAILED(hr)) goto cleanup;
4316 
4317  LIST_FOR_EACH_ENTRY(container_ptr, &container_list, struct mesh_container, entry)
4318  {
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;
4324  DWORD i;
4325 
4326  hr = mesh->lpVtbl->GetDeclaration(mesh, mesh_decl);
4327  if (FAILED(hr)) goto cleanup;
4328 
4329  mesh_vertex_size = D3DXGetDeclVertexSize(mesh_decl, 0);
4330 
4331  hr = mesh->lpVtbl->LockVertexBuffer(mesh, D3DLOCK_READONLY, (void**)&mesh_vertices);
4332  if (FAILED(hr)) goto cleanup;
4333 
4334  for (i = 0; i < num_mesh_vertices; i++) {
4335  int j;
4336  int k = 1;
4337 
4338  D3DXVec3TransformCoord((D3DXVECTOR3*)concat_vertices,
4339  (D3DXVECTOR3*)mesh_vertices,
4340  &container_ptr->transform);
4341  for (j = 1; concat_decl[j].Stream != 0xff; j++)
4342  {
4343  if (concat_decl[j].Usage == mesh_decl[k].Usage &&
4344  concat_decl[j].UsageIndex == mesh_decl[k].UsageIndex)
4345  {
4346  if (concat_decl[j].Usage == D3DDECLUSAGE_NORMAL) {
4347  D3DXVec3TransformCoord((D3DXVECTOR3*)(concat_vertices + concat_decl[j].Offset),
4348  (D3DXVECTOR3*)(mesh_vertices + mesh_decl[k].Offset),
4349  &container_ptr->transform);
4350  } else {
4351  memcpy(concat_vertices + concat_decl[j].Offset,
4352  mesh_vertices + mesh_decl[k].Offset,
4353  d3dx_decltype_size[mesh_decl[k].Type]);
4354  }
4355  k++;
4356  }
4357  }
4358  mesh_vertices += mesh_vertex_size;
4359  concat_vertices += concat_vertex_size;
4360  }
4361 
4362  mesh->lpVtbl->UnlockVertexBuffer(mesh);
4363  }
4364 
4365  concat_mesh->lpVtbl->UnlockVertexBuffer(concat_mesh);
4366  concat_vertices = NULL;
4367 
4368  hr = concat_mesh->lpVtbl->LockIndexBuffer(concat_mesh, 0, &concat_indices);
4369  if (FAILED(hr)) goto cleanup;
4370 
4371  index_offset = 0;
4372  LIST_FOR_EACH_ENTRY(container_ptr, &container_list, struct mesh_container, entry)
4373  {
4374  ID3DXMesh *mesh = container_ptr->mesh;
4375  const void *mesh_indices;
4376  DWORD num_mesh_faces = mesh->lpVtbl->GetNumFaces(mesh);
4377  DWORD i;
4378 
4379  hr = mesh->lpVtbl->LockIndexBuffer(mesh, D3DLOCK_READONLY, (void**)&mesh_indices);
4380  if (FAILED(hr)) goto cleanup;
4381 
4382  if (options & D3DXMESH_32BIT) {
4383  DWORD *dest = concat_indices;
4384  const DWORD *src = mesh_indices;
4385  for (i = 0; i < num_mesh_faces * 3; i++)
4386  *dest++ = index_offset + *src++;
4387  concat_indices = dest;
4388  } else {
4389  WORD *dest = concat_indices;
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;
4394  }
4395  mesh->lpVtbl->UnlockIndexBuffer(mesh);
4396 
4397  index_offset += num_mesh_faces * 3;
4398  }
4399 
4400  concat_mesh->lpVtbl->UnlockIndexBuffer(concat_mesh);
4401  concat_indices = NULL;
4402 
4403  if (num_materials) {
4404  DWORD *concat_attrib_buffer = NULL;
4405  DWORD offset = 0;
4406 
4407  hr = concat_mesh->lpVtbl->LockAttributeBuffer(concat_mesh, 0, &concat_attrib_buffer);
4408  if (FAILED(hr)) goto cleanup;
4409 
4410  LIST_FOR_EACH_ENTRY(container_ptr, &container_list, struct mesh_container, entry)
4411  {
4412  ID3DXMesh *mesh = container_ptr->mesh;
4413  const DWORD *mesh_attrib_buffer = NULL;
4414  DWORD count = mesh->lpVtbl->GetNumFaces(mesh);
4415 
4416  hr = mesh->lpVtbl->LockAttributeBuffer(mesh, D3DLOCK_READONLY, (DWORD**)&mesh_attrib_buffer);
4417  if (FAILED(hr)) {
4418  concat_mesh->lpVtbl->UnlockAttributeBuffer(concat_mesh);
4419  goto cleanup;
4420  }
4421 
4422  while (count--)
4423  *concat_attrib_buffer++ = offset + *mesh_attrib_buffer++;
4424 
4425  mesh->lpVtbl->UnlockAttributeBuffer(mesh);
4426  offset += container_ptr->num_materials;
4427  }
4428  concat_mesh->lpVtbl->UnlockAttributeBuffer(concat_mesh);
4429  }
4430 
4431  if (materials_out || effects_out) {
4432  D3DXMATERIAL *out_ptr;
4433  if (!num_materials) {
4434  /* create default material */
4436  if (FAILED(hr)) goto cleanup;
4437 
4439  out_ptr->MatD3D.Diffuse.r = 0.5f;
4440  out_ptr->MatD3D.Diffuse.g = 0.5f;
4441  out_ptr->MatD3D.Diffuse.b = 0.5f;
4442  out_ptr->MatD3D.Specular.r = 0.5f;
4443  out_ptr->MatD3D.Specular.g = 0.5f;
4444  out_ptr->MatD3D.Specular.b = 0.5f;
4445  /* D3DXCreateBuffer initializes the rest to zero */
4446  } else {
4448  char *strings_out_ptr;
4449 
4450  LIST_FOR_EACH_ENTRY(container_ptr, &container_list, struct mesh_container, entry)
4451  {
4452  if (container_ptr->materials) {
4453  DWORD i;
4454  const D3DXMATERIAL *in_ptr = ID3DXBuffer_GetBufferPointer(container_ptr->materials);
4455  for (i = 0; i < container_ptr->num_materials; i++)
4456  {
4457  if (in_ptr->pTextureFilename)
4458  buffer_size += strlen(in_ptr->pTextureFilename) + 1;
4459  in_ptr++;
4460  }
4461  }
4462  }
4463 
4465  if (FAILED(hr)) goto cleanup;
4467  strings_out_ptr = (char*)(out_ptr + num_materials);
4468 
4469  LIST_FOR_EACH_ENTRY(container_ptr, &container_list, struct mesh_container, entry)
4470  {
4471  if (container_ptr->materials) {
4472  DWORD i;
4473  const D3DXMATERIAL *in_ptr = ID3DXBuffer_GetBufferPointer(container_ptr->materials);
4474  for (i = 0; i < container_ptr->num_materials; i++)
4475  {
4476  out_ptr->MatD3D = in_ptr->MatD3D;
4477  if (in_ptr->pTextureFilename) {
4478  out_ptr->pTextureFilename = strings_out_ptr;
4479  strcpy(out_ptr->pTextureFilename, in_ptr->pTextureFilename);
4480  strings_out_ptr += strlen(in_ptr->pTextureFilename) + 1;
4481  }
4482  in_ptr++;
4483  out_ptr++;
4484  }
4485  }
4486  }
4487  }
4488  }
4489  if (!num_materials)
4490  num_materials = 1;
4491 
4492  if (effects_out) {
4494  if (!materials_out) {
4496  materials = NULL;
4497  }
4498  }
4499 
4500  if (adjacency_out) {
4501  if (!list_next(&container_list, list_head(&container_list))) {
4502  container_ptr = LIST_ENTRY(list_head(&container_list), struct mesh_container, entry);
4503  adjacency = container_ptr->adjacency;
4504  container_ptr->adjacency = NULL;
4505  } else {
4506  DWORD offset = 0;
4507  DWORD *out_ptr;
4508 
4509  hr = D3DXCreateBuffer(num_faces * 3 * sizeof(DWORD), &adjacency);
4510  if (FAILED(hr)) goto cleanup;
4511 
4513  LIST_FOR_EACH_ENTRY(container_ptr, &container_list, struct mesh_container, entry)
4514  {
4515  DWORD i;
4516  DWORD count = 3 * container_ptr->mesh->lpVtbl->GetNumFaces(container_ptr->mesh);
4517  DWORD *in_ptr = ID3DXBuffer_GetBufferPointer(container_ptr->adjacency);
4518 
4519  for (i = 0; i < count; i++)
4520  *out_ptr++ = offset + *in_ptr++;
4521 
4522  offset += count;
4523  }
4524  }
4525  }
4526 
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;
4531  if (num_materials_out) *num_materials_out = num_materials;
4532 
4533  hr = D3D_OK;
4534 cleanup:
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);
4540  if (FAILED(hr)) {
4541  if (concat_mesh) IUnknown_Release(concat_mesh);
4545  }
4546  LIST_FOR_EACH_ENTRY_SAFE(container_ptr, next_container_ptr, &container_list, struct mesh_container, entry)
4547  {
4548  if (container_ptr->mesh) IUnknown_Release(container_ptr->mesh);
4549  if (container_ptr->adjacency) ID3DXBuffer_Release(container_ptr->adjacency);
4550  if (container_ptr->materials) ID3DXBuffer_Release(container_ptr->materials);
4551  if (container_ptr->effects) ID3DXBuffer_Release(container_ptr->effects);
4552  HeapFree(GetProcessHeap(), 0, container_ptr);
4553  }
4554  return hr;
4555 }
ID3DXBuffer * adjacency
Definition: mesh.c:4136
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)
Definition: mesh.c:3445
Type
Definition: Type.h:6
HRESULT hr
Definition: shlfolder.c:183
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
D3DCOLORVALUE Diffuse
Definition: d3d9types.h:1402
_Must_inspect_result_ _In_ USAGE _In_ USHORT _In_ USAGE Usage
Definition: hidpi.h:382
GLuint GLuint GLsizei count
Definition: gl.h:1545
uint8_t entry
Definition: isohybrid.c:63
HRESULT WINAPI D3DXCreateMeshFVF(DWORD numfaces, DWORD numvertices, DWORD options, DWORD fvf, struct IDirect3DDevice9 *device, struct ID3DXMesh **mesh)
Definition: mesh.c:2596
GLintptr offset
Definition: glext.h:5920
#define D3DERR_INVALIDCALL
#define E_FAIL
Definition: ddrawi.h:102
D3DMATERIAL9 MatD3D
Definition: d3dx9mesh.h:195
static char memory[1024 *256]
Definition: process.c:116
ID3DXBuffer * effects
Definition: mesh.c:4138
__WINE_SERVER_LIST_INLINE struct list * list_head(const struct list *list)
Definition: list.h:131
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
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
const GUID * guid
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
static D3DRMMATRIX4D identity
Definition: frame.c:29
Definition: devices.h:37
#define PROVIDE_ADJACENCY
Definition: mesh.c:3165
static void buffer_size(GLcontext *ctx, GLuint *width, GLuint *height)
Definition: swimpl.c:927
smooth NULL
Definition: ftsmooth.c:416
struct ID3DXBuffer ID3DXBuffer
Definition: d3dx8core.h:51
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
#define TRACE(s)
Definition: solgame.cpp:4
struct _D3DXMATERIAL D3DXMATERIAL
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define LIST_INIT(head)
Definition: queue.h:197
struct list entry
Definition: mesh.c:4134
LONG HRESULT
Definition: typedefs.h:77
#define D3DFVF_XYZ
Definition: d3d8types.h:113
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
D3DXVECTOR3 *WINAPI D3DXVec3TransformCoord(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv, const D3DXMATRIX *pm)
Definition: math.c:1939
D3DXMATRIX transform
Definition: mesh.c:4140
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: mem.h:68
Definition: _list.h:228
GLenum src
Definition: glext.h:6340
static const UINT d3dx_decltype_size[]
Definition: mesh.c:67
ULONG_PTR SIZE_T
Definition: typedefs.h:78
__WINE_SERVER_LIST_INLINE int list_empty(const struct list *list)
Definition: list.h:143
HRESULT WINAPI D3DXFileCreate(ID3DXFile **d3dxfile)
Definition: xfile.c:715
#define D3D_OK
Definition: d3d.h:106
#define LIST_FOR_EACH_ENTRY_SAFE(cursor, cursor2, list, type, field)
Definition: list.h:204
DWORD num_materials
Definition: mesh.c:4139
GLsizei GLsizei GLchar * source
Definition: glext.h:6048
#define ID3DXBuffer_Release(p)
Definition: d3dx9core.h:83
D3DCOLORVALUE Specular
Definition: d3d9types.h:1404
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
__WINE_SERVER_LIST_INLINE struct list * list_next(const struct list *list, const struct list *elem)
Definition: list.h:115
#define PROVIDE_MATERIALS
Definition: mesh.c:3163
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
ID3DXMesh * mesh
Definition: mesh.c:4135
char * cleanup(char *str)
Definition: wpickclick.c:99
#define D3DXF_FILELOAD_FROMMEMORY
Definition: d3dx9xof.h:41
static char * dest
Definition: rtl.c:135
#define D3DRM_XTEMPLATE_BYTES
Definition: rmxftmpl.h:283
UINT WINAPI D3DXGetDeclVertexSize(const D3DVERTEXELEMENT9 *decl, DWORD stream_idx)
Definition: mesh.c:2324
#define LIST_ENTRY(type)
Definition: queue.h:175
#define D3DLOCK_READONLY
Definition: d3d8types.h:69
int k
Definition: mpi.c:3369
#define HeapFree(x, y, z)
Definition: compat.h:394
HRESULT WINAPI D3DXCreateBuffer(DWORD size, ID3DXBuffer **buffer)
Definition: core.c:129
#define ID3DXBuffer_GetBufferPointer(p)
Definition: d3dx9core.h:85
static HRESULT generate_effects(ID3DXBuffer *materials, DWORD num_materials, ID3DXBuffer **effects)
Definition: mesh.c:3347
ID3DXBuffer * materials
Definition: mesh.c:4137
#define SUCCEEDED(hr)
Definition: intsafe.h:57
unsigned char D3DRM_XTEMPLATES[]
Definition: rmxftmpl.h:6
char * pTextureFilename
Definition: d3dx9mesh.h:196
static HRESULT parse_frame(struct ID3DXFileData *filedata, DWORD options, struct IDirect3DDevice9 *device, const D3DXMATRIX *parent_transform, struct list *container_list, DWORD provide_flags)
Definition: mesh.c:4143

Referenced by D3DXLoadMeshFromXResource(), and D3DXLoadMeshFromXW().

◆ D3DXLoadMeshFromXof()

HRESULT WINAPI D3DXLoadMeshFromXof ( struct ID3DXFileData *  file_data,
DWORD  flags,
struct IDirect3DDevice9 *  device,
struct ID3DXBuffer **  adjacency,
struct ID3DXBuffer **  materials,
struct ID3DXBuffer **  effect_instances,
DWORD material_count,
struct ID3DXMesh **  mesh 
)

◆ D3DXLoadMeshFromXResource()

HRESULT WINAPI D3DXLoadMeshFromXResource ( HMODULE  module,
const char resource,
const char resource_type,
DWORD  flags,
struct IDirect3DDevice9 *  device,
struct ID3DXBuffer **  adjacency,
struct ID3DXBuffer **  materials,
struct ID3DXBuffer **  effect_instances,
DWORD material_count,
struct ID3DXMesh **  mesh 
)

Definition at line 4108 of file mesh.c.

4111 {
4112  HRESULT hr;
4113  HRSRC resinfo;
4114  void *buffer;
4115  DWORD size;
4116 
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);
4121 
4122  resinfo = FindResourceA(module, name, type);
4123  if (!resinfo) return D3DXERR_INVALIDDATA;
4124 
4125  hr = load_resource_into_memory(module, resinfo, &buffer, &size);
4126  if (FAILED(hr)) return D3DXERR_INVALIDDATA;
4127 
4129  materials, effect_instances, num_materials, mesh);
4130 }
ID3DXBuffer * adjacency
Definition: mesh.c:4136
HRESULT hr
Definition: shlfolder.c:183
HRSRC WINAPI FindResourceA(HMODULE hModule, LPCSTR name, LPCSTR type)
Definition: res.c:155
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLuint buffer
Definition: glext.h:5915
Definition: devices.h:37
HRESULT load_resource_into_memory(HMODULE module, HRSRC resinfo, void **buffer, DWORD *length) DECLSPEC_HIDDEN
Definition: util.c:166
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
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)
Definition: mesh.c:4198
DWORD num_materials
Definition: mesh.c:4139
Definition: name.c:36
ID3DXMesh * mesh
Definition: mesh.c:4135
ID3DXBuffer * materials
Definition: mesh.c:4137

◆ D3DXLoadMeshFromXW()

HRESULT WINAPI D3DXLoadMeshFromXW ( const WCHAR filename,
DWORD  flags,
struct IDirect3DDevice9 *  device,
struct ID3DXBuffer **  adjacency,
struct ID3DXBuffer **  materials,
struct ID3DXBuffer **  effect_instances,
DWORD material_count,
struct ID3DXMesh **  mesh 
)

Definition at line 4080 of file mesh.c.

4083 {
4084  void *buffer;
4085  HRESULT hr;
4086  DWORD size;
4087 
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);
4092 
4093  if (!filename)
4094  return D3DERR_INVALIDCALL;
4095 
4097  if (FAILED(hr))
4098  return D3DXERR_INVALIDDATA;
4099 
4101  materials, effect_instances, num_materials, mesh);
4102 
4104 
4105  return hr;
4106 }
ID3DXBuffer * adjacency
Definition: mesh.c:4136
HRESULT hr
Definition: shlfolder.c:183
#define D3DERR_INVALIDCALL
GLuint buffer
Definition: glext.h:5915
const char * filename
Definition: ioapi.h:135
Definition: devices.h:37
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT map_view_of_file(const WCHAR *filename, void **buffer, DWORD *length) DECLSPEC_HIDDEN
Definition: util.c:118
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)
Definition: mesh.c:4198
DWORD num_materials
Definition: mesh.c:4139
ID3DXMesh * mesh
Definition: mesh.c:4135
#define UnmapViewOfFile
Definition: compat.h:403
ID3DXBuffer * materials
Definition: mesh.c:4137

Referenced by D3DXLoadMeshFromXA().

◆ D3DXLoadPatchMeshFromXof()

HRESULT WINAPI D3DXLoadPatchMeshFromXof ( struct ID3DXFileData *  file_data,
DWORD  flags,
struct IDirect3DDevice9 *  device,
struct ID3DXBuffer **  adjacency,
struct ID3DXBuffer **  materials,
struct ID3DXBuffer **  effect_instances,
DWORD material_count,
struct ID3DXPatchMesh **  mesh 
)

◆ D3DXLoadPRTBufferFromFileA()

HRESULT WINAPI D3DXLoadPRTBufferFromFileA ( const char filename,
ID3DXPRTBuffer **  buffer 
)

◆ D3DXLoadPRTBufferFromFileW()

HRESULT WINAPI D3DXLoadPRTBufferFromFileW ( const WCHAR filename,
ID3DXPRTBuffer **  buffer 
)

◆ D3DXLoadPRTCompBufferFromFileA()

HRESULT WINAPI D3DXLoadPRTCompBufferFromFileA ( const char filename,
ID3DXPRTCompBuffer **  buffer 
)

◆ D3DXLoadPRTCompBufferFromFileW()

HRESULT WINAPI D3DXLoadPRTCompBufferFromFileW ( const WCHAR filename,
ID3DXPRTCompBuffer **  buffer 
)

◆ D3DXLoadSkinMeshFromXof()

HRESULT WINAPI D3DXLoadSkinMeshFromXof ( struct ID3DXFileData *  file_data,
DWORD  flags,
struct IDirect3DDevice9 *  device,
struct ID3DXBuffer **  adjacency,
struct ID3DXBuffer **  materials,
struct ID3DXBuffer **  effect_instances,
DWORD material_count,
struct ID3DXSkinInfo **  skin_info,
struct ID3DXMesh **  mesh 
)

Definition at line 3445 of file mesh.c.

3449 {
3450  HRESULT hr;
3451  DWORD *index_in_ptr;
3452  struct mesh_data mesh_data;
3453  DWORD total_vertices;
3454  ID3DXMesh *d3dxmesh = NULL;
3455  ID3DXBuffer *adjacency = NULL;
3457  ID3DXBuffer *effects =