Attempted to fix partial conversion bug

This commit is contained in:
_
2017-12-15 23:42:19 -08:00
parent 579b23fccb
commit e6511e3306
3 changed files with 41 additions and 33 deletions

View File

@@ -25,12 +25,7 @@ void write(const std::vector<std::string> &,
void (*f) (std::stringstream &, const std::vector<TPlanePoints> &),
EntityConverter &);
void parse_prefab(std::ifstream &,
std::ofstream &,
void (*f) (std::stringstream &, const std::vector<TPlanePoints> &),
std::vector<std::vector<std::string> > &);
bool convertmap(const char * const,
bool convertmap(std::stringstream &,
const char * const,
void (*f) (std::stringstream &, const std::vector<TPlanePoints> &),
std::vector<std::vector<std::string> > &);
@@ -180,4 +175,19 @@ using namespace std;
return output;
}
#endif
template <class ISTR>
void parse_prefab(ISTR &f,
std::ofstream &out,
void (*b) (std::stringstream &, const std::vector<TPlanePoints> &),
std::vector<std::vector<std::string> > &entities) {
using namespace std;
string l;
getline(f, l);
if (l.find(KEYWORD_BRUSH) != string::npos) {
write(parse_brush<ISTR>(f), out, b);
} else if (l.find(KEYWORD_ENTITY) != string::npos) {
entities.push_back(get_entity<ISTR>(f));
}
}
#endif