diff --git a/src/AssetManager.cpp b/src/AssetManager.cpp index 57ab2f8..2029354 100644 --- a/src/AssetManager.cpp +++ b/src/AssetManager.cpp @@ -30,75 +30,6 @@ #include #include -/*void AssetManager::loadOBJ(const std::string &path, - const std::string &name) -{ - std::vector vertexIndices, - uvIndices, normalIndices; - std::vector temp_vertices; - std::vector temp_uvs; - std::vector temp_normals; - - FILE *file = fopen(path.c_str(), "r"); - if(not file) - { - System::logger->writeError("Failed to open file."); - return; - } - - while(true) - { - char lineHeader[128]; - int res = fscanf(file, "%s", lineHeader); - if(res == EOF) - break; - - if(strcmp(lineHeader, "v") == 0) - { - glm::vec3 vertex; - fscanf(file, "%f %f %f\n", - &vertex.x, &vertex.y, &vertex.z); - temp_vertices.push_back(vertex); - } - else if(strcmp(lineHeader, "vt") == 0) - { - glm::vec2 uv; - fscanf(file, "%f %f\n", &uv.x, &uv.y); - temp_uvs.push_back(uv); - } - else if(strcmp(lineHeader, "vn") == 0) - { - glm::vec3 normal; - fscanf(file, "%f %f %f\n", - &normal.x, &normal.y, &normal.z); - temp_normals.push_back(normal); - } - else if(strcmp(lineHeader, "f") == 0) - { - std::string v1, v2, v3; - unsigned int vIndex[3], uvIndex[3], normIndex[3]; - int matches = fscanf(file, - "%d/%d/%d %d/%d/%d %d/%d/%d\n", - &vIndex[0], &uvIndex[0], &normIndex[0], - &vIndex[1], &uvIndex[1], &normIndex[1], - &vIndex[2], &uvIndex[2], &normIndex[2]); - if(matches not_eq 9) - { - System::logger->writeError( - "OBJ file is too complicated."); - return; - } - - for(auto &i : vIndex) - vertexIndices.push_back(i); - for(auto &i : uvIndex) - uvIndices.push_back(i); - for(auto &i : normIndex) - normalIndices.push_back(i); - } - } -}*/ - void AssetManager::loadModel(const std::string &path, const std::string &name) { diff --git a/src/AssetManager.hpp b/src/AssetManager.hpp index f63e8da..7a77a67 100644 --- a/src/AssetManager.hpp +++ b/src/AssetManager.hpp @@ -26,13 +26,10 @@ class AssetManager { public: - /*void loadOBJ(const std::string &path, - const std::string &name);*/ void loadModel(const std::string &path, const std::string &name); std::shared_ptr getModel(const std::string &name); void unloadModel(const std::string &name); - //void unloadOBJ(const std::string &name); private: std::map> models; };