Removed TABS
This commit is contained in:
parent
5b09630d45
commit
3a1a489545
38
src/models.c
38
src/models.c
@ -736,7 +736,7 @@ Mesh GenMeshPlane(float width, float length, int resX, int resZ)
|
|||||||
Vector3 *normals = (Vector3 *)malloc(vertexCount*sizeof(Vector3));
|
Vector3 *normals = (Vector3 *)malloc(vertexCount*sizeof(Vector3));
|
||||||
for (int n = 0; n < vertexCount; n++) normals[n] = (Vector3){ 0.0f, 1.0f, 0.0f }; // Vector3.up;
|
for (int n = 0; n < vertexCount; n++) normals[n] = (Vector3){ 0.0f, 1.0f, 0.0f }; // Vector3.up;
|
||||||
|
|
||||||
// TexCoords definition
|
// TexCoords definition
|
||||||
Vector2 *texcoords = (Vector2 *)malloc(vertexCount*sizeof(Vector2));
|
Vector2 *texcoords = (Vector2 *)malloc(vertexCount*sizeof(Vector2));
|
||||||
for (int v = 0; v < resZ; v++)
|
for (int v = 0; v < resZ; v++)
|
||||||
{
|
{
|
||||||
@ -759,7 +759,7 @@ Mesh GenMeshPlane(float width, float length, int resX, int resZ)
|
|||||||
triangles[t++] = i + 1;
|
triangles[t++] = i + 1;
|
||||||
triangles[t++] = i;
|
triangles[t++] = i;
|
||||||
|
|
||||||
triangles[t++] = i + resX;
|
triangles[t++] = i + resX;
|
||||||
triangles[t++] = i + resX + 1;
|
triangles[t++] = i + resX + 1;
|
||||||
triangles[t++] = i + 1;
|
triangles[t++] = i + 1;
|
||||||
}
|
}
|
||||||
@ -2676,30 +2676,30 @@ static Mesh LoadGLTF(const char *fileName)
|
|||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
|
||||||
fseek(gltfFile, 0, SEEK_END);
|
fseek(gltfFile, 0, SEEK_END);
|
||||||
int size = ftell(gltfFile);
|
int size = ftell(gltfFile);
|
||||||
fseek(gltfFile, 0, SEEK_SET);
|
fseek(gltfFile, 0, SEEK_SET);
|
||||||
|
|
||||||
void *buffer = malloc(size);
|
void *buffer = malloc(size);
|
||||||
fread(buffer, size, 1, gltfFile);
|
fread(buffer, size, 1, gltfFile);
|
||||||
|
|
||||||
fclose(gltfFile);
|
fclose(gltfFile);
|
||||||
|
|
||||||
// GLTF data loading
|
// GLTF data loading
|
||||||
cgltf_options options = {0};
|
cgltf_options options = {0};
|
||||||
cgltf_data data;
|
cgltf_data data;
|
||||||
cgltf_result result = cgltf_parse(&options, buffer, size, &data);
|
cgltf_result result = cgltf_parse(&options, buffer, size, &data);
|
||||||
|
|
||||||
if (result == cgltf_result_success)
|
if (result == cgltf_result_success)
|
||||||
{
|
{
|
||||||
printf("Type: %u\n", data.file_type);
|
printf("Type: %u\n", data.file_type);
|
||||||
printf("Version: %d\n", data.version);
|
printf("Version: %d\n", data.version);
|
||||||
printf("Meshes: %lu\n", data.meshes_count);
|
printf("Meshes: %lu\n", data.meshes_count);
|
||||||
}
|
}
|
||||||
else TraceLog(LOG_WARNING, "[%s] GLTF data could not be loaded", fileName);
|
else TraceLog(LOG_WARNING, "[%s] GLTF data could not be loaded", fileName);
|
||||||
|
|
||||||
free(buffer);
|
free(buffer);
|
||||||
cgltf_free(&data);
|
cgltf_free(&data);
|
||||||
|
|
||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user