|
@@ -102,6 +102,7 @@ void meshFree()
|
|
|
static int objFileLoaderParser(const char *content);
|
|
|
static void objFileLoaderLineParser(char *line, uint32_t currentLine);
|
|
|
static int objFileLoaderExecuteLine(int argc, char *argv[], uint32_t currentLine);
|
|
|
+static void updateFaceUVValues();
|
|
|
|
|
|
static uint32_t objFileLoaderIgnoredLines = 0;
|
|
|
static uint32_t objFileLoaderLoadedVertices = 0;
|
|
@@ -373,8 +374,8 @@ int objFileLoaderExecuteLine(int argc, char *argv[], uint32_t currentLine)
|
|
|
|
|
|
face_t face =
|
|
|
{
|
|
|
- .a = v[1], .b = v[2], .c = v[3],
|
|
|
- .at = vt[1], .bt = vt[2], .ct = vt[3],
|
|
|
+ .a = v[1] - 1, .b = v[2] - 1, .c = v[3] - 1,
|
|
|
+ .at = vt[1] - 1 , .bt = vt[2] - 1, .ct = vt[3] - 1,
|
|
|
.colour = MAKE_RGB(45, 170, 10)
|
|
|
};
|
|
|
arrayAdd(mesh.faces, face);
|
|
@@ -387,8 +388,8 @@ int objFileLoaderExecuteLine(int argc, char *argv[], uint32_t currentLine)
|
|
|
for(i = 2; i < (argc - 1); i++)
|
|
|
{
|
|
|
face_t face = {
|
|
|
- .a = v[1], .b = v[i], .c = v[i + 1],
|
|
|
- .at = vt[1], .bt = vt[i], .ct = vt[i + 1],
|
|
|
+ .a = v[1] - 1, .b = v[i] - 1, .c = v[i + 1] - 1,
|
|
|
+ .at = vt[1] - 1, .bt = vt[i] - 1, .ct = vt[i + 1] - 1,
|
|
|
.colour = MAKE_RGB(45, 170, 10) };
|
|
|
arrayAdd(mesh.faces, face);
|
|
|
|