Update for gcc 10+ and cxxopts 3.1.1
This commit is contained in:
parent
c02f8da854
commit
c795352b28
2
Makefile
2
Makefile
@ -1,6 +1,6 @@
|
||||
EX=reflex2q3
|
||||
CC=g++
|
||||
CFLAGS=-std=c++11 -static -static-libgcc -static-libstdc++ -I"/mingw64/include/eigen3" -I"include" -I"lib/Catch/single_include" -I"lib/cxxopts/include" -I"/usr/include/eigen3"
|
||||
CFLAGS=-static -static-libgcc -static-libstdc++ -I"/mingw64/include/eigen3" -I"include" -I"lib/Catch/single_include" -I"lib/cxxopts/include" -I"/usr/include/eigen3"
|
||||
TESTEX=runtests
|
||||
|
||||
all: main test
|
||||
|
@ -29,7 +29,7 @@ We've provided Quake 3 and Xonotic entity conversion files (r2q3.rem and r2xonot
|
||||
|
||||
#### Compiler(s)
|
||||
* mingw-w64, GCC 5.3.0
|
||||
* gcc version 7.1.1 20170528
|
||||
* gcc (Debian 10.2.1-6) 10.2.1 20210110
|
||||
|
||||
#### Tested With
|
||||
* netradiant-1.5.0-20120301
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit d7b930846cdccfc8bcecc4d7150ddcbadffac360
|
||||
Subproject commit eb787304d67ec22f7c3a184ee8b4c481d04357fd
|
20
src/main.cpp
20
src/main.cpp
@ -8,6 +8,7 @@
|
||||
#include <iostream>
|
||||
#include <exception>
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -45,12 +46,12 @@ cxxopts::Options arguments(int ac, char ** av) {
|
||||
cxxopts::value<string>(), "FILE")
|
||||
;
|
||||
o.parse_positional(parg);
|
||||
o.parse(ac, av);
|
||||
if (o.count("help")) {
|
||||
auto options = o.parse(ac, av);
|
||||
if (options.count("help")) {
|
||||
cout << o.help() << endl;
|
||||
}
|
||||
if (o.count(ARG_INPUT_SHORTALIAS) < 1 ||
|
||||
o.count(ARG_OUTPUT_SHORTALIAS) < 1) {
|
||||
if (options.count(ARG_INPUT_SHORTALIAS) < 1 ||
|
||||
options.count(ARG_OUTPUT_SHORTALIAS) < 1) {
|
||||
cerr << "error: no input or output file given" << endl;
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
@ -73,7 +74,7 @@ stringstream loadmap(const char *filename) {
|
||||
return output;
|
||||
}
|
||||
|
||||
bool convert_worldspawn(const cxxopts::Options &o,
|
||||
bool convert_worldspawn(const cxxopts::ParseResult &o,
|
||||
vector<vector<string> > &q) {
|
||||
bool is_ok = false;
|
||||
brushdef fn = &brushdef_net;
|
||||
@ -118,7 +119,7 @@ void print_entities(vector<vector<string> > &q) {
|
||||
}
|
||||
|
||||
|
||||
void convert_entities(const cxxopts::Options &o, const vector<vector<string> > &q) {
|
||||
void convert_entities(const cxxopts::ParseResult &o, const vector<vector<string> > &q) {
|
||||
string entfile = o["e"].as<string>();
|
||||
if (entfile.empty()) {
|
||||
cout << "No entity data file given"
|
||||
@ -146,12 +147,13 @@ int main(int argc, char** argv)
|
||||
{
|
||||
try {
|
||||
cxxopts::Options p = arguments(argc, argv);
|
||||
auto options = p.parse(argc, argv);
|
||||
vector<vector<string> > entities;
|
||||
bool is_ok = convert_worldspawn(p, entities);
|
||||
bool is_ok = convert_worldspawn(options, entities);
|
||||
// print_entities(entities);
|
||||
convert_entities(p, entities);
|
||||
convert_entities(options, entities);
|
||||
}
|
||||
catch (cxxopts::option_not_exists_exception e) {
|
||||
catch (cxxopts::exceptions::no_such_option e) {
|
||||
cerr << e.what() << endl
|
||||
<< "./reflex2q3 -h for usage information" << endl;
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user