removed some old commented out code
This commit is contained in:
102
src/amo.cpp
102
src/amo.cpp
@@ -275,39 +275,6 @@ std::vector<Vtexture> parse_vt(std::istringstream& s, std::ifstream& f) {
|
||||
return vt;
|
||||
}
|
||||
|
||||
/*
|
||||
// Parse Vertex Textures
|
||||
std::vector<std::tuple<float, float>> parse_vt(std::istringstream& s, std::ifstream& f) {
|
||||
// Get vertex textures count
|
||||
int vtcnt;
|
||||
s >> vtcnt;
|
||||
std::cout << "vt " << vtcnt << std::endl;
|
||||
|
||||
// Store our vertex texture coords for returning later
|
||||
std::vector<std::tuple<float, float>> vt;
|
||||
|
||||
// Parse lines until vtcnt
|
||||
int i;
|
||||
for (i=0; i<vtcnt; i++) {
|
||||
std::string l;
|
||||
|
||||
if (getline(f, l)) {
|
||||
std::istringstream stream(l);
|
||||
float x = 0;
|
||||
float y = 0;
|
||||
stream >> x >> y;
|
||||
// For debugging -> std::cout << l << std::endl;
|
||||
|
||||
vt.push_back({x, y});
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return vt;
|
||||
}
|
||||
*/
|
||||
|
||||
// Parse Vertices
|
||||
std::vector<std::tuple<float, float, float>> parse_v(std::istringstream& s, std::ifstream& f) {
|
||||
// Get vertices count
|
||||
@@ -348,15 +315,6 @@ std::tuple<std::string, int> parse_ao(std::istringstream& s) {
|
||||
return {name, statecnt};
|
||||
}
|
||||
|
||||
/*
|
||||
std::string nextline(std::ifstream& f) {
|
||||
std::string l;
|
||||
std::getline(f, l);
|
||||
return l;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
void Model::loadAMO(const std::string& filename) {
|
||||
// Print filename
|
||||
std::cout << filename << std::endl;
|
||||
@@ -364,20 +322,8 @@ void Model::loadAMO(const std::string& filename) {
|
||||
// Create ifstream from AMO file
|
||||
std::ifstream file(filename);
|
||||
|
||||
/*
|
||||
// Get next line
|
||||
std::string line;
|
||||
line = nextline(file);
|
||||
std::cout << line << std::endl;
|
||||
|
||||
line = nextline(file);
|
||||
std::cout << line << std::endl;
|
||||
*/
|
||||
|
||||
std::string line;
|
||||
while (getline(file, line)) {
|
||||
//std::cout << line << std::endl;
|
||||
|
||||
// Get prefix
|
||||
std::istringstream stream(line);
|
||||
std::string prefix;
|
||||
@@ -394,13 +340,6 @@ void Model::loadAMO(const std::string& filename) {
|
||||
std::cout << get<0>(i) << " " << get<1>(i) << " " << get<2>(i) << std::endl;
|
||||
}
|
||||
} else if (prefix == "vt") {
|
||||
/*std::vector<std::tuple<float, float>> vt;
|
||||
vt = parse_vt(stream, file);
|
||||
for (const std::tuple<float, float>& i: vt) {
|
||||
std::cout << get<0>(i) << " " << get<1>(i) << std::endl;
|
||||
}
|
||||
*/
|
||||
|
||||
std::vector<Vtexture> vt;
|
||||
vt = parse_vt(stream, file);
|
||||
for (const Vtexture& i: vt) {
|
||||
@@ -410,12 +349,6 @@ void Model::loadAMO(const std::string& filename) {
|
||||
std::cout << std::endl;
|
||||
}
|
||||
} else if (prefix == "vn") {
|
||||
/*std::vector<std::tuple<float, float, float>> vn;
|
||||
vn = parse_vn(stream, file);
|
||||
for (const std::tuple<float, float, float>& i : vn) {
|
||||
std::cout << get<0>(i) << " " << get<1>(i) << " " << get<2>(i) << std::endl;
|
||||
}*/
|
||||
|
||||
std::vector<Vnormal> vn;
|
||||
vn = parse_vn(stream, file);
|
||||
for (const Vnormal& i: vn) {
|
||||
@@ -425,13 +358,6 @@ void Model::loadAMO(const std::string& filename) {
|
||||
std::cout << std::endl;
|
||||
}
|
||||
} else if (prefix == "vj") {
|
||||
/*std::vector<std::tuple<int, int, int, int>> vj;
|
||||
vj = parse_vj(stream, file);
|
||||
for (const std::tuple<int, int, int, int>& i : vj) {
|
||||
std::cout << get<0>(i) << " " << get<1>(i) << " " << get<2>(i) << " " << get<3>(i) << std::endl;
|
||||
}
|
||||
*/
|
||||
|
||||
std::vector<Vjoint> vj;
|
||||
vj = parse_vj(stream, file);
|
||||
for (const Vjoint& i: vj) {
|
||||
@@ -442,13 +368,6 @@ void Model::loadAMO(const std::string& filename) {
|
||||
}
|
||||
|
||||
} else if (prefix == "vw") {
|
||||
/*
|
||||
std::vector<std::tuple<float, float, float, float>> vw;
|
||||
vw = parse_vw(stream, file);
|
||||
for (const std::tuple<float, float, float, float>& i : vw) {
|
||||
std::cout << get<0>(i) << " " << get<1>(i) << " " << get<2>(i) << " " << get<3>(i) << std::endl;
|
||||
}
|
||||
*/
|
||||
std::vector<Vweight> vw;
|
||||
vw = parse_vw(stream, file);
|
||||
for (const Vweight& i: vw) {
|
||||
@@ -460,27 +379,6 @@ void Model::loadAMO(const std::string& filename) {
|
||||
|
||||
|
||||
} else if (prefix == "f") {
|
||||
/*
|
||||
std::vector<std::tuple<int,int,int,int,int,int,int,int,int,int,int,int,int,int,int>> faces;
|
||||
faces = parse_f(stream, file);
|
||||
for (const std::tuple<int,int,int,int,int,int,int,int,int,int,int,int,int,int,int>& i: faces) {
|
||||
std::cout << get<0>(i) << " "
|
||||
<< get<1>(i) << " "
|
||||
<< get<2>(i) << " "
|
||||
<< get<3>(i) << " "
|
||||
<< get<4>(i) << " "
|
||||
<< get<5>(i) << " "
|
||||
<< get<6>(i) << " "
|
||||
<< get<7>(i) << " "
|
||||
<< get<8>(i) << " "
|
||||
<< get<9>(i) << " "
|
||||
<< get<10>(i) << " "
|
||||
<< get<11>(i) << " "
|
||||
<< get<12>(i) << " "
|
||||
<< get<13>(i) << " "
|
||||
<< get<14>(i) << std::endl;
|
||||
}
|
||||
*/
|
||||
std::vector<Face> faces;
|
||||
faces = parse_f(stream, file);
|
||||
for (const Face& i: faces) {
|
||||
|
Reference in New Issue
Block a user