Changed output queue to vector

This commit is contained in:
2017-07-06 13:52:31 -07:00
parent 7595b42593
commit 984ff03c80
3 changed files with 12 additions and 15 deletions

View File

@@ -54,7 +54,7 @@ cxxopts::Options arguments(int ac, char ** av) {
}
bool convert_worldspawn(const cxxopts::Options &o,
queue<vector<string> > &q) {
vector<vector<string> > &q) {
bool is_ok = false;
brushdef fn = &brushdef_net;
if (o.count(ARG_BRUSHFORMAT)) {
@@ -83,7 +83,7 @@ bool convert_worldspawn(const cxxopts::Options &o,
return is_ok;
}
void print_entities(queue<vector<string> > &q) {
void print_entities(vector<vector<string> > &q) {
vector<string> entity;
do {
entity = q.front();
@@ -92,12 +92,11 @@ void print_entities(queue<vector<string> > &q) {
cout << s << endl;
}
cout << "--------------------------" << endl;
q.pop();
} while (!q.empty());
}
void convert_entities(const cxxopts::Options &o, queue<vector<string> > &q) {
void convert_entities(const cxxopts::Options &o, vector<vector<string> > &q) {
string entfile = o["e"].as<string>();
if (entfile.empty()) {
cout << "No entity data file given"
@@ -111,18 +110,16 @@ void convert_entities(const cxxopts::Options &o, queue<vector<string> > &q) {
if (o.count(ARG_BRUSHFORMAT)) {
fn = &brushdef_gtk;
}
do {
entity = q.front();
for (const vector<string> &entity : q) {
write(entity, fout, fn, e);
q.pop();
} while(!q.empty());
}
}
int main(int argc, char** argv)
{
cxxopts::Options p = arguments(argc, argv);
queue<vector<string> > entities;
vector<vector<string> > entities;
bool is_ok = convert_worldspawn(p, entities);
// print_entities(entities);
convert_entities(p, entities);