reflex2q3/ReflexToQ3/main.cpp

49 lines
1.3 KiB
C++
Raw Normal View History

2015-02-02 08:11:03 +05:30
//
// Author: Michael Cameron
// Email: chronokun@hotmail.com
//
#include <vector>
#include <string>
#include <sstream>
#include <fstream>
#include <iostream>
2017-05-06 08:03:26 +05:30
#include "oopless-parser.hpp"
2017-04-11 20:57:10 +05:30
#include "brushdef.hpp"
2015-02-02 08:11:03 +05:30
using namespace std;
2015-02-02 08:11:03 +05:30
int main(const int _kiArgC, const char** _kppcArgv)
{
#define ARG_POS_BRUSHDEF 5
#define ARG_POS_ENTITYCONV 4
// Minimum: program, input file, output file
2015-02-02 08:11:03 +05:30
if(_kiArgC < 3)
{
return(3);
}
/* // placeholder argument parsing until something more robust is decided upon
// optional arg #1: brush definition - gtkradiant or netradiant style
void (*brushdef) (std::stringstream &, const std::vector<TPlanePoints> &);
brushdef = ((string(_kppcArgv[ARG_POS_BRUSHDEF - 1])).compare("-gtk") == 0) ?
&brushdef_gtk: &brushdef_net;
2015-02-02 08:11:03 +05:30
// optional arg #2: entity mapping file - enables entity conversion
const char * const entitymap = (_kiArgC < ARG_POS_ENTITYCONV) ?
_kppcArgv[ARG_POS_ENTITYCONV - 1]: NULL; */
bool status = convertmap(_kppcArgv[1], _kppcArgv[2], &brushdef_net);
if (status) {
cout << "Successfully converted map "
<< _kppcArgv[1]
<< " to "
<< _kppcArgv[2]
<< endl;
} else {
cout << "Failed to convert map." << endl;
}
2015-02-02 08:11:03 +05:30
return(0);
}