diff --git a/port/dAssimp/assimp/api.d b/port/dAssimp/assimp/api.d index 67cdfccbf..4619eb014 100644 --- a/port/dAssimp/assimp/api.d +++ b/port/dAssimp/assimp/api.d @@ -579,17 +579,33 @@ extern ( C ) { ) aiGetMaterialString; /** - * Helper function for retrieving a texture from the material. + * Get the number of textures for a particular texture type. + * + * Params: + * pMat = Pointer to the input material. May not be NULL + * type = Texture type to check for + * + * Returns: + * Number of textures for this type. + */ + uint function( aiMaterial* pMat, aiTextureType type ) aiGetMaterialTextureCount; + + /** + * Helper function to get all values pertaining to a particular texture slot + * from a material structure. * * This function is provided just for convenience. You could also read the - * texture by reading all of its properties manually. This function bundles - * all of them in a huge function-monster. + * texture by parsing all of its properties manually. This function bundles + * all of them in a huge function monster. * * Params: * mat = Pointer to the input material. May not be null. - * type = Specifies the aiTextureType of the texture to be - * retrieved. - * index = Index of the texture to be retrieved. + * type = Specifies the texture stack (aiTextureType) to + * read from. + * index = Index of the texture. The function fails if the requested + * index is not available for this texture type. + * aiGetMaterialTextureCount() can be used to determine + * the number of textures in a particular texture stack. * path = Receives the output path. null is not a valid value. * mapping = Recieves the texture mapping mode to be used. * Pass null if you are not interested in this information. @@ -606,7 +622,7 @@ extern ( C ) { * UV order) or null if you are not interested in this information. * * Returns: - * aiReturn.SUCCESS on success, something else otherwise. + * aiReturn.SUCCESS on success, otherwise something else. */ aiReturn function( aiMaterial* mat, diff --git a/port/dAssimp/assimp/loader.d b/port/dAssimp/assimp/loader.d index 22d1a4c15..5985fdaab 100644 --- a/port/dAssimp/assimp/loader.d +++ b/port/dAssimp/assimp/loader.d @@ -152,6 +152,7 @@ public: bind( aiGetMaterialIntegerArray )( "aiGetMaterialIntegerArray" ); bind( aiGetMaterialColor )( "aiGetMaterialColor" ); bind( aiGetMaterialString )( "aiGetMaterialString" ); + bind( aiGetMaterialTextureCount )( "aiGetMaterialTextureCount" ); bind( aiGetMaterialTexture )( "aiGetMaterialTexture" ); } ++m_sRefCount; diff --git a/port/dAssimp/assimp/types.d b/port/dAssimp/assimp/types.d index 3b2def9f0..d3c0b53de 100644 --- a/port/dAssimp/assimp/types.d +++ b/port/dAssimp/assimp/types.d @@ -85,11 +85,24 @@ extern ( C ) { const size_t MAXLEN = 1024; /** - * Represents a string, zero byte terminated. + * Represents an UTF-8 string, zero byte terminated. * - * The length of such a string is limited to MAXLEN characters + * The length of such a string is limited to MAXLEN bytes * (excluding the terminal \0). * + * The character set of an aiString is explicitly defined to be UTF-8. This + * Unicode transformation was chosen in the belief that most strings in 3d + * model files are limited to ASCII characters, thus the character set + * needed to be ASCII compatible. + * + * Most text file loaders provide proper Unicode input file handling, + * special unicode characters are correctly transcoded to UTF-8 and are kept + * throughout the libraries' import pipeline. + * + * For most applications, it will be absolutely sufficient to interpret the + * aiString as ASCII data and work with it as one would work with a plain + * char[]. + * * To access an aiString from D you might want to use something like the * following piece of code: * --- @@ -101,6 +114,10 @@ extern ( C ) { struct aiString { /** * Length of the string (excluding the terminal \0). + * + * This is not the logical length of strings containing UTF-8 + * multibyte sequences, but the number of bytes from the beginning of the + * string to its end. */ size_t length;