From e01838945213941803da7b929864d23eccc84826 Mon Sep 17 00:00:00 2001 From: - <-> Date: Sat, 25 Mar 2023 10:44:43 -0700 Subject: [PATCH] Added CMakeLists & addressed warning --- CMakeLists.txt | 21 +++++++++++++++++++++ README.md | 13 +++++++------ include/oopless-parser.hpp | 3 ++- 3 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..9aa947d --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,21 @@ + +cmake_minimum_required(VERSION 3.10) +project(reflex2q3 CXX) + +set(OBJ_SRC "src/planes.cpp" "src/brushdef.cpp" "src/oopless-parser.cpp" "src/EntityConverter.cpp") +add_executable(reflex2q3 src/main.cpp ${OBJ_SRC}) +add_executable(runtests test/catch.cpp ${OBJ_SRC}) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED True) + +find_package(PkgConfig) +pkg_check_modules(EIGEN REQUIRED eigen3) + +include_directories( + ${EIGEN_INCLUDE_DIRS} + "lib/Catch/single_include/catch2" + "lib/cxxopts/include" + "include" + "test" +) diff --git a/README.md b/README.md index 69a43d4..cf0e130 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,27 @@ # reflex2q3 -Converts Reflex maps (Version 8 and below) into id Tech map files. A pre-compiled [Windows executable](https://u.teknik.io/eOmo5.zip) is available. +Converts Reflex maps (Version 8 and below) into id Tech map files. #### Build Requirements +* cmake * [Eigen 3, C++ template library](http://eigen.tuxfamily.org/index.php?title=Main_Page) #### Building: ```bash git submodule update --init --recursive - make + cmake .; make; ``` #### Convert map geometry: ```bash - ./reflex2q3 [input].map [output].map + ./reflex2q3 input.map output.map ``` #### Convert map geometry and entities: ```bash - ./reflex2q3 [input].map [output].map -e [entity file].rem + ./reflex2q3 input.map output.map -e entity-file.rem ``` -We've provided Quake 3 and Xonotic entity conversion files (r2q3.rem and r2xonotic.rem). To create entity files for other games built on the [id Tech 3](https://en.wikipedia.org/wiki/Id_Tech_3) engine or previous [id Tech](https://en.wikipedia.org/wiki/Id_Tech) engines, refer to our [Reflex entity documentation](https://git.teknik.io/scuti/reflex2q3/src/f2b0341da38b82ad4f0a0cf258b0f6e6d8335fda/docs/doc-entities.txt), our sample .rem files, and relevant documentation for your game. +We've provided Quake 3 and Xonotic entity conversion files (r2q3.rem and r2xonotic.rem). To create entity files for other games built on the [id Tech 3](https://en.wikipedia.org/wiki/Id_Tech_3) engine or previous [id Tech](https://en.wikipedia.org/wiki/Id_Tech) engines, refer to our [Reflex entity documentation](https://notabug.org/scuti/reflex2q3/src/master/docs/doc-entities.txt), our sample .rem files, and relevant documentation for your game. #### List all command line arguments: ```bash @@ -28,8 +29,8 @@ We've provided Quake 3 and Xonotic entity conversion files (r2q3.rem and r2xonot ``` #### Compiler(s) -* mingw-w64, GCC 5.3.0 * gcc (Debian 10.2.1-6) 10.2.1 20210110 +* gcc version 12.2.0 (GCC) #### Tested With * netradiant-1.5.0-20120301 diff --git a/include/oopless-parser.hpp b/include/oopless-parser.hpp index 2677d60..5515aba 100644 --- a/include/oopless-parser.hpp +++ b/include/oopless-parser.hpp @@ -52,12 +52,13 @@ using namespace std; line.find(KEYWORD_PREFAB) != string::npos) || ( line.find(KEYWORD_BRUSH) != string::npos && !is_ebrush(output))) { f.seekg(pos); - return output; + break; } else { output.push_back(line); } pos = f.tellg(); } + return output; } template