wsparcie dla visual studio, lekkie uprzątnięcie kodu

This commit is contained in:
2024-11-27 23:35:34 +01:00
parent 74256cf14b
commit bab9ab751c
451 changed files with 149074 additions and 129 deletions

View File

@@ -1,13 +1,4 @@
#include "loadOBJ.h"
#include <string>
//#include <vector>
#include <windows.h>
//#include <gl\gl.h>
//#include <gl\glu.h>
//#include <cstdio>
//#include <glm\glm.hpp>
// using namespace glm;
bool loadOBJ(const char* path, std::vector <glm::vec3>& out_vertices, std::vector <glm::vec2>& out_uvs, std::vector <glm::vec3>& out_normals){
@@ -16,11 +7,11 @@ bool loadOBJ(const char* path, std::vector <glm::vec3>& out_vertices, std::vecto
std::vector <glm::vec2> temp_uvs;
std::vector <glm::vec3> temp_normals;
printf("Ladowanie pliku %s...\n", path);
printf("(loadOBJ.cpp) Ladowanie pliku ze sciezki: %s...\n", path);
FILE* file = fopen(path, "r");
if (file == NULL) {
printf("Impossible to open the file!\n");
printf("(loadOBJ.cpp) Nie udalo sie odtworzyc pliku. Czy na pewno jest on we wskazanym katalogu?\n");
return false;
}
@@ -54,7 +45,6 @@ bool loadOBJ(const char* path, std::vector <glm::vec3>& out_vertices, std::vecto
} else if (strcmp(lineHeader, "f") == 0) {
std::string vertex1, vertex2, vertex3;
unsigned int vertexIndex[3], uvIndex[3], normalIndex[3];
int matches = fscanf(file, "%d/%d/%d %d/%d/%d %d/%d/%d\n", &vertexIndex[0], &uvIndex[0], &normalIndex[0], &vertexIndex[1], &uvIndex[1], &normalIndex[1], &vertexIndex[2], &uvIndex[2], &normalIndex[2]);
@@ -93,5 +83,5 @@ bool loadOBJ(const char* path, std::vector <glm::vec3>& out_vertices, std::vecto
}
return 0;
return true;
}