@@ -1688,7 +1688,7 @@ void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, i
16881688{
16891689#if defined(GRAPHICS_API_OPENGL_33 ) || defined(GRAPHICS_API_OPENGL_ES2 )
16901690 // Instancing required variables
1691- float16 * instanceTransforms = NULL ;
1691+ float16 * instanceTransform = NULL ;
16921692 unsigned int instancesVboId = 0 ;
16931693
16941694 // Bind shader program
@@ -1737,10 +1737,10 @@ void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, i
17371737 if (material .shader .locs [SHADER_LOC_MATRIX_PROJECTION ] != -1 ) rlSetUniformMatrix (material .shader .locs [SHADER_LOC_MATRIX_PROJECTION ], matProjection );
17381738
17391739 // Create instances buffer
1740- instanceTransforms = (float16 * )RL_CALLOC (instances , sizeof (float16 ));
1740+ instanceTransform = (float16 * )RL_CALLOC (instances , sizeof (float16 ));
17411741
17421742 // Fill buffer with instances transformations as float16 arrays
1743- for (int i = 0 ; i < instances ; i ++ ) instanceTransforms [i ] = MatrixToFloatV (transforms [i ]);
1743+ for (int i = 0 ; i < instances ; i ++ ) instanceTransform [i ] = MatrixToFloatV (transforms [i ]);
17441744
17451745 // Enable mesh VAO to attach new buffer
17461746 rlEnableVertexArray (mesh .vaoId );
@@ -1749,16 +1749,16 @@ void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, i
17491749 // It isn't clear which would be reliably faster in all cases and on all platforms,
17501750 // anecdotally glMapBuffer() seems very slow (syncs) while glBufferSubData() seems
17511751 // no faster, since all the transform matrices are transferred anyway
1752- instancesVboId = rlLoadVertexBuffer (instanceTransforms , instances * sizeof (float16 ), false);
1752+ instancesVboId = rlLoadVertexBuffer (instanceTransform , instances * sizeof (float16 ), false);
17531753
1754- // Instances transformation matrices are sent to shader attribute location: SHADER_LOC_VERTEX_INSTANCETRANSFORMS
1755- if (material .shader .locs [SHADER_LOC_VERTEX_INSTANCETRANSFORMS ] != -1 )
1754+ // Instances transformation matrices are sent to shader attribute location: SHADER_LOC_VERTEX_INSTANCETRANSFORM
1755+ if (material .shader .locs [SHADER_LOC_VERTEX_INSTANCETRANSFORM ] != -1 )
17561756 {
17571757 for (unsigned int i = 0 ; i < 4 ; i ++ )
17581758 {
1759- rlEnableVertexAttribute (material .shader .locs [SHADER_LOC_VERTEX_INSTANCETRANSFORMS ] + i );
1760- rlSetVertexAttribute (material .shader .locs [SHADER_LOC_VERTEX_INSTANCETRANSFORMS ] + i , 4 , RL_FLOAT , 0 , sizeof (Matrix ), i * sizeof (Vector4 ));
1761- rlSetVertexAttributeDivisor (material .shader .locs [SHADER_LOC_VERTEX_INSTANCETRANSFORMS ] + i , 1 );
1759+ rlEnableVertexAttribute (material .shader .locs [SHADER_LOC_VERTEX_INSTANCETRANSFORM ] + i );
1760+ rlSetVertexAttribute (material .shader .locs [SHADER_LOC_VERTEX_INSTANCETRANSFORM ] + i , 4 , RL_FLOAT , 0 , sizeof (Matrix ), i * sizeof (Vector4 ));
1761+ rlSetVertexAttributeDivisor (material .shader .locs [SHADER_LOC_VERTEX_INSTANCETRANSFORM ] + i , 1 );
17621762 }
17631763 }
17641764
@@ -1918,7 +1918,7 @@ void DrawMeshInstanced(Mesh mesh, Material material, const Matrix *transforms, i
19181918
19191919 // Remove instance transforms buffer
19201920 rlUnloadVertexBuffer (instancesVboId );
1921- RL_FREE (instanceTransforms );
1921+ RL_FREE (instanceTransform );
19221922#endif
19231923}
19241924
@@ -4404,11 +4404,10 @@ static void BuildPoseFromParentJoints(BoneInfo *bones, int boneCount, Transform
44044404
44054405#if defined(SUPPORT_FILEFORMAT_OBJ )
44064406// Load OBJ mesh data
4407- //
4408- // Keep the following information in mind when reading this
4407+ // Notes to keep in mind:
44094408// - A mesh is created for every material present in the obj file
4410- // - the model.meshCount is therefore the materialCount returned from tinyobj
4411- // - the mesh is automatically triangulated by tinyobj
4409+ // - The model.meshCount is therefore the materialCount returned from tinyobj
4410+ // - The mesh is automatically triangulated by tinyobj
44124411static Model LoadOBJ (const char * fileName )
44134412{
44144413 tinyobj_attrib_t objAttributes = { 0 };
@@ -4555,7 +4554,8 @@ static Model LoadOBJ(const char *fileName)
45554554 model .meshes [i ].texcoords = (float * )MemAlloc (sizeof (float )* vertexCount * 2 );
45564555 model .meshes [i ].colors = (unsigned char * )MemAlloc (sizeof (unsigned char )* vertexCount * 4 );
45574556 #else
4558- if (objAttributes .texcoords != NULL && objAttributes .num_texcoords > 0 ) model .meshes [i ].texcoords = (float * )MemAlloc (sizeof (float )* vertexCount * 2 );
4557+ if (objAttributes .texcoords != NULL && objAttributes .num_texcoords > 0 )
4558+ model .meshes [i ].texcoords = (float * )MemAlloc (sizeof (float )* vertexCount * 2 );
45594559 else model .meshes [i ].texcoords = NULL ;
45604560 model .meshes [i ].colors = NULL ;
45614561 #endif
@@ -4657,12 +4657,12 @@ static Model LoadOBJ(const char *fileName)
46574657// Load IQM mesh data
46584658static Model LoadIQM (const char * fileName )
46594659{
4660- #define IQM_MAGIC "INTERQUAKEMODEL" // IQM file magic number
4661- #define IQM_VERSION 2 // only IQM version 2 supported
4660+ #define IQM_MAGIC "INTERQUAKEMODEL" // IQM file magic number
4661+ #define IQM_VERSION 2 // Only IQM version 2 supported
46624662
4663- #define BONE_NAME_LENGTH 32 // BoneInfo name string length
4664- #define MESH_NAME_LENGTH 32 // Mesh name string length
4665- #define MATERIAL_NAME_LENGTH 32 // Material name string length
4663+ #define BONE_NAME_LENGTH 32 // BoneInfo name string length
4664+ #define MESH_NAME_LENGTH 32 // Mesh name string length
4665+ #define MATERIAL_NAME_LENGTH 32 // Material name string length
46664666
46674667 int dataSize = 0 ;
46684668 unsigned char * fileData = LoadFileData (fileName , & dataSize );
0 commit comments