Skip to content

Commit

Permalink
feat: support for .3d input
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioJPinto committed Mar 6, 2024
1 parent 1218f3a commit f9cbe06
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
34 changes: 24 additions & 10 deletions engine/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,23 @@ void processNormalKeys(unsigned char key, int x, int y) {
void setupConfig(char* arg) {
std::string filename;
filename.assign(arg);
c = parseConfig(filename);
for (std::string file : c.models) {
std::string dir = MODELS;
dir.append(file);

std::vector<Point> points = parseFile(dir);
if (points.empty()) {
std::cerr << "File not found";
}

if (filename.substr(filename.size() - 4) == ".xml") {
c = parseConfig(filename);
for (std::string file : c.models) {
std::string dir = MODELS;
dir.append(file);

std::vector<Point> points = parseFile(dir);
if (points.empty()) {
std::cerr << "File not found";
}

vectors.push_back(points);
}
} else {
c = parseConfig("../scenes/default.xml");
std::vector<Point> points = parseFile(filename);
vectors.push_back(points);
}
}
Expand All @@ -155,7 +162,14 @@ int main(int argc, char** argv) {
return 1;
}

setupConfig(argv[1]);
std::string filepath = argv[1];
if (filepath.substr(filepath.size() - 4) == ".xml") {
setupConfig(argv[1]);
} else {
c = parseConfig("../scenes/default.xml");
std::vector<Point> points = parseFile(filepath);
vectors.push_back(points);
}

// put GLUT�s init here
glutInit(&argc, argv);
Expand Down
File renamed without changes.

0 comments on commit f9cbe06

Please sign in to comment.