diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..b69ba2bc4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,61 @@ +os: linux +dist: trusty +language: cpp + +# script: cmake . + +compiler: + - clang + +addons: + apt: + # sources: + # - ubuntu-toolchain-r-test + packages: + - libopenal-dev + - libjpeg-dev + - libudev-dev + - libxrandr-dev + - libfreetype6-dev + - libvorbis-dev + - libflac-dev + - libegl1-mesa-dev + - libgles2-mesa-dev + - libtinyxml2-dev + - libsdl2-dev + - libsdl2-image-dev + - libsdl2-mixer-dev + - libsdl2-ttf-dev + # - g++-8 + - libglm-dev + - cmake + - cxxtest + - liblua5.2-dev + +before_install: + - sudo cp /usr/include/lua5.2/* /usr/include/ + - git clone git://github.com/SFML/SFML.git + - cd SFML + - cmake . + - make -j8 + - sudo make install + - cd .. + - git clone git://github.com/Quent42340/GameKit.git + - cd GameKit + - cmake . + - make -j8 + - sudo make install + - cd .. + +script: + - cmake . + - make -j8 + +notifications: + email: false + # irc: + # channels: + # - "irc.freenode.net#openminer" + # template: + # - "%{repository}/%{branch} (%{commit} - %{author}): %{build_url}: %{message}" + diff --git a/README.md b/README.md index 9edb3d0ce..1b4d528e0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # OpenMiner +[![Build Status](https://travis-ci.com/Quent42340/OpenMiner.svg?branch=network)](https://travis-ci.com/Quent42340/OpenMiner) [![Documentation](https://codedocs.xyz/Quent42340/OpenMiner.svg)](https://codedocs.xyz/Quent42340/OpenMiner/) [![License](https://img.shields.io/badge/license-LGPLv2.1%2B-blue.svg)](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html) [![Discord](https://img.shields.io/discord/527527086756200458.svg?style=popout)](https://discord.gg/eN8k8wt) diff --git a/TODO b/TODO index a96fdb4b5..6692d55f3 100644 --- a/TODO +++ b/TODO @@ -72,4 +72,8 @@ TODO • TODO: Add nodebox-like draw type +# Completely move to C++17 + +• TODO: `emplace` and `emplace_back` no longer return `void` + > vim:ft=notes diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index da801baa5..e29e3bebf 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -21,6 +21,7 @@ add_dependencies(${CMAKE_PROJECT_NAME} ${CMAKE_PROJECT_NAME}_common) target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -O3 -ffast-math) target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -g -Wall -Wextra -Wfatal-errors -Wno-variadic-macros) target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -DDEBUG_ENABLED) +target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -DGLM_FORCE_RADIANS) target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -DSOL_CHECK_ARGUMENTS # -DSOL_SAFE_USERTYPE=1 # -DSOL_SAFE_REFERENCES=1 @@ -31,7 +32,8 @@ target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -DSOL_CHECK_ARGUMENTS -DSOL_PRINT_ERRORS=1 ) -target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_17) +target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -std=c++17) +# target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_std_17) # target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -pg) # target_link_options(${CMAKE_PROJECT_NAME} PRIVATE -pg) @@ -48,6 +50,6 @@ target_link_libraries(${CMAKE_PROJECT_NAME} ${TINYXML2_LIBRARIES} ${GAMEKIT_LIBRARIES} ${LUA_LIBRARIES} - sfml-network + sfml-network -ldl ${CMAKE_PROJECT_NAME}_common) diff --git a/client/source/graphics/Skybox.cpp b/client/source/graphics/Skybox.cpp index b25fcf50e..c17293557 100644 --- a/client/source/graphics/Skybox.cpp +++ b/client/source/graphics/Skybox.cpp @@ -13,7 +13,6 @@ */ #include -#define GLM_FORCE_RADIANS #include #include diff --git a/client/source/hud/BlockCursor.cpp b/client/source/hud/BlockCursor.cpp index 368fe8b81..f4fa6bf9a 100644 --- a/client/source/hud/BlockCursor.cpp +++ b/client/source/hud/BlockCursor.cpp @@ -11,7 +11,6 @@ * * ===================================================================================== */ -#define GLM_FORCE_RADIANS #include #include diff --git a/client/source/hud/HUD.cpp b/client/source/hud/HUD.cpp index ac350a237..193f766a8 100644 --- a/client/source/hud/HUD.cpp +++ b/client/source/hud/HUD.cpp @@ -11,6 +11,8 @@ * * ===================================================================================== */ +#include + #include "Config.hpp" #include "HUD.hpp" diff --git a/client/source/states/GameState.cpp b/client/source/states/GameState.cpp index 5f78fbb88..1290b581a 100644 --- a/client/source/states/GameState.cpp +++ b/client/source/states/GameState.cpp @@ -13,7 +13,6 @@ */ #include -#define GLM_FORCE_RADIANS #include #include diff --git a/client/source/states/InventoryState.cpp b/client/source/states/InventoryState.cpp index f520b9ab5..00679612f 100644 --- a/client/source/states/InventoryState.cpp +++ b/client/source/states/InventoryState.cpp @@ -11,6 +11,8 @@ * * ===================================================================================== */ +#include + #include #include diff --git a/client/source/states/LuaGUIState.cpp b/client/source/states/LuaGUIState.cpp index a8136e521..dfd7ecb73 100644 --- a/client/source/states/LuaGUIState.cpp +++ b/client/source/states/LuaGUIState.cpp @@ -11,6 +11,8 @@ * * ===================================================================================== */ +#include + #include #include #include diff --git a/client/source/states/PauseMenuState.cpp b/client/source/states/PauseMenuState.cpp index fbec0d956..fa87e5a1b 100644 --- a/client/source/states/PauseMenuState.cpp +++ b/client/source/states/PauseMenuState.cpp @@ -11,6 +11,8 @@ * * ===================================================================================== */ +#include + #include #include diff --git a/client/source/states/SettingsMenuState.cpp b/client/source/states/SettingsMenuState.cpp index d9e455b7d..9839e91d3 100644 --- a/client/source/states/SettingsMenuState.cpp +++ b/client/source/states/SettingsMenuState.cpp @@ -11,6 +11,8 @@ * * ===================================================================================== */ +#include + #include #include diff --git a/client/source/world/ClientWorld.cpp b/client/source/world/ClientWorld.cpp index c026c89c3..0cc6d863c 100644 --- a/client/source/world/ClientWorld.cpp +++ b/client/source/world/ClientWorld.cpp @@ -11,6 +11,8 @@ * * ===================================================================================== */ +#include + #include #include diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 2b2f86689..d524f1214 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -17,9 +17,10 @@ add_library(${CMAKE_PROJECT_NAME}_common STATIC ${SOURCE_FILES}) #------------------------------------------------------------------------------ # Compiler flags #------------------------------------------------------------------------------ -# target_compile_options(${CMAKE_PROJECT_NAME}_common PRIVATE -O3 -ffast-math) +target_compile_options(${CMAKE_PROJECT_NAME}_common PRIVATE -O3 -ffast-math) target_compile_options(${CMAKE_PROJECT_NAME}_common PRIVATE -g -Wall -Wextra -Wfatal-errors -Wno-variadic-macros) target_compile_options(${CMAKE_PROJECT_NAME}_common PRIVATE -DDEBUG_ENABLED) +target_compile_options(${CMAKE_PROJECT_NAME}_common PRIVATE -DGLM_FORCE_RADIANS) target_compile_options(${CMAKE_PROJECT_NAME}_common PRIVATE -DSOL_CHECK_ARGUMENTS # -DSOL_SAFE_USERTYPE=1 # -DSOL_SAFE_REFERENCES=1 @@ -27,10 +28,11 @@ target_compile_options(${CMAKE_PROJECT_NAME}_common PRIVATE -DSOL_CHECK_ARGUMENT # -DSOL_SAFE_FUNCTION=1 # -DSOL_SAFE_NUMERICS=1 # -DSOL_SAFE_GETTER=1 - # -DSOL_PRINT_ERRORS=1 + -DSOL_PRINT_ERRORS=1 ) -target_compile_features(${CMAKE_PROJECT_NAME}_common PRIVATE cxx_std_17) +target_compile_options(${CMAKE_PROJECT_NAME}_common PRIVATE -std=c++17) +# target_compile_features(${CMAKE_PROJECT_NAME}_common PRIVATE cxx_std_17) # target_compile_options(${CMAKE_PROJECT_NAME}_server PRIVATE -pg) diff --git a/common/include/inventory/Recipe.hpp b/common/include/inventory/Recipe.hpp index dea93f532..355fa53fe 100644 --- a/common/include/inventory/Recipe.hpp +++ b/common/include/inventory/Recipe.hpp @@ -19,6 +19,7 @@ class Recipe { public: Recipe(const std::string &type, const ItemStack &result) : m_type(type), m_result(result) {} + virtual ~Recipe() = default; virtual bool isMatching(const Inventory &inventory) const = 0; diff --git a/common/include/world/Chunk.hpp b/common/include/world/Chunk.hpp index 70ef43da7..fb396ecfa 100644 --- a/common/include/world/Chunk.hpp +++ b/common/include/world/Chunk.hpp @@ -41,6 +41,7 @@ class Chunk : public gk::NonCopyable { public: Chunk(s32 x, s32 y, s32 z); + virtual ~Chunk() = default; virtual void update() = 0; diff --git a/common/source/gui/Cube.cpp b/common/source/gui/Cube.cpp index 348901e22..6794f4b7e 100644 --- a/common/source/gui/Cube.cpp +++ b/common/source/gui/Cube.cpp @@ -11,7 +11,6 @@ * * ===================================================================================== */ -#define GLM_FORCE_RADIANS #include #include diff --git a/common/source/world/World.cpp b/common/source/world/World.cpp index de7df68e1..8cfdd5a3c 100644 --- a/common/source/world/World.cpp +++ b/common/source/world/World.cpp @@ -11,7 +11,6 @@ * * ===================================================================================== */ -#define GLM_FORCE_RADIANS #include #include diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 2330a2b00..157929f2c 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -21,6 +21,7 @@ add_dependencies(${CMAKE_PROJECT_NAME}_server ${CMAKE_PROJECT_NAME}_common) target_compile_options(${CMAKE_PROJECT_NAME}_server PRIVATE -O3 -ffast-math) target_compile_options(${CMAKE_PROJECT_NAME}_server PRIVATE -g -Wall -Wextra -Wfatal-errors -Wno-variadic-macros) target_compile_options(${CMAKE_PROJECT_NAME}_server PRIVATE -DDEBUG_ENABLED) +target_compile_options(${CMAKE_PROJECT_NAME}_server PRIVATE -DGLM_FORCE_RADIANS) target_compile_options(${CMAKE_PROJECT_NAME}_server PRIVATE -DSOL_CHECK_ARGUMENTS # -DSOL_SAFE_USERTYPE=1 # -DSOL_SAFE_REFERENCES=1 @@ -31,7 +32,8 @@ target_compile_options(${CMAKE_PROJECT_NAME}_server PRIVATE -DSOL_CHECK_ARGUMENT -DSOL_PRINT_ERRORS=1 ) -target_compile_features(${CMAKE_PROJECT_NAME}_server PRIVATE cxx_std_17) +target_compile_options(${CMAKE_PROJECT_NAME}_server PRIVATE -std=c++17) +# target_compile_features(${CMAKE_PROJECT_NAME}_server PRIVATE cxx_std_17) # target_compile_options(${CMAKE_PROJECT_NAME}_server PRIVATE -pg) # target_link_options(${CMAKE_PROJECT_NAME}_server PRIVATE -pg) @@ -48,6 +50,6 @@ target_link_libraries(${CMAKE_PROJECT_NAME}_server ${TINYXML2_LIBRARIES} ${GAMEKIT_LIBRARIES} ${LUA_LIBRARIES} - sfml-network + sfml-network -ldl ${CMAKE_PROJECT_NAME}_common) diff --git a/server/include/network/Server.hpp b/server/include/network/Server.hpp index f60cd4a16..976059fc4 100644 --- a/server/include/network/Server.hpp +++ b/server/include/network/Server.hpp @@ -15,6 +15,7 @@ #define SERVER_HPP_ #include +#include #include #include diff --git a/server/include/world/ServerWorld.hpp b/server/include/world/ServerWorld.hpp index 365dd32db..34c9c1644 100644 --- a/server/include/world/ServerWorld.hpp +++ b/server/include/world/ServerWorld.hpp @@ -19,7 +19,7 @@ #include "ServerChunk.hpp" -class Client; +struct Client; class ServerWorld { public: