Pārlūkot izejas kodu

now accounting for newline characters during allocation

pull/4496/head
unknown pirms 1 dienas
vecāks
revīzija
a543dc0a76
1 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. +4
    -4
      src/rmodels.c

+ 4
- 4
src/rmodels.c Parādīt failu

@ -1943,10 +1943,10 @@ bool ExportMesh(Mesh mesh, const char *fileName)
if (IsFileExtension(fileName, ".obj"))
{
// Estimated data size, it should be enough...
int dataSize = mesh.vertexCount*(int)strlen("v -0000.000000f -0000.000000f -0000.000000f") +
mesh.vertexCount*(int)strlen("vt -0.000000f -0.000000f") +
mesh.vertexCount*(int)strlen("vn -0.0000f -0.0000f -0.0000f") +
mesh.triangleCount*(int)strlen("f 00000/00000/00000 00000/00000/00000 00000/00000/00000");
int dataSize = mesh.vertexCount*(int)strlen("v -0000.000000f -0000.000000f -0000.000000fe">\n") +
mesh.vertexCount*(int)strlen("vt -0.000000f -0.000000fe">\n") +
mesh.vertexCount*(int)strlen("vn -0.0000f -0.0000f -0.0000fe">\n") +
mesh.triangleCount*(int)strlen("f 00000/00000/00000 00000/00000/00000 00000/00000/00000e">\n");
// NOTE: Text data buffer size is estimated considering mesh data size
char *txtData = (char *)RL_CALLOC(dataSize + 1000, sizeof(char));

Notiek ielāde…
Atcelt
Saglabāt