From 3bb418d91f4f8466cd6e3ed32f6a18563bd732a1 Mon Sep 17 00:00:00 2001 From: arf20 Date: Fri, 3 Feb 2023 12:37:19 +0100 Subject: [PATCH 1/3] Fixes for FreeBSD --- CMakeLists.txt | 3 +++ src/main.hpp | 1 + src/renderer.cpp | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5575541..110c66c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,9 @@ project(ww1game) set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) +include_directories("/usr/local/include") +link_directories("/usr/local/lib") + set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) diff --git a/src/main.hpp b/src/main.hpp index 3873680..48b9555 100644 --- a/src/main.hpp +++ b/src/main.hpp @@ -29,6 +29,7 @@ along with this program. If not, see . #include #include #include +#include // == Macros #define ASSET_PATH "../assets" diff --git a/src/renderer.cpp b/src/renderer.cpp index 44b31dc..c47ed11 100644 --- a/src/renderer.cpp +++ b/src/renderer.cpp @@ -99,7 +99,7 @@ namespace Assets { bool run = true; float fps = 0.0f; -std::chrono::_V2::system_clock::time_point time_prev = std::chrono::high_resolution_clock::now(); +auto time_prev = std::chrono::high_resolution_clock::now(); long frameCounter = 0; int anim_div = 0; bool inMenu = true; @@ -380,7 +380,7 @@ void renderLoop() { SDL_Event event; while (run) { //Uint32 time_now = SDL_GetTicks(); - std::chrono::_V2::system_clock::time_point time_now = std::chrono::high_resolution_clock::now(); + auto time_now = std::chrono::high_resolution_clock::now(); float deltaTime = (time_now - time_prev).count() / 1000000000.0f; fps = (deltaTime > 0.0f) ? 1.0f / deltaTime : 1.0f; anim_div = std::roundl(fps / (float)ANIM_FPS); From ff563db4e74cad3c4c3060f48bc149c186815712 Mon Sep 17 00:00:00 2001 From: arf20 <35542215+arf20@users.noreply.github.com> Date: Fri, 3 Feb 2023 11:50:44 +0100 Subject: [PATCH 2/3] Update cmake.yml --- .github/workflows/cmake.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 54b4d7b..9fbd2c8 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -14,7 +14,8 @@ jobs: - uses: actions/checkout@v3 - name: Install dependencies - run: sudo apt-get install build-essential cmake libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsdl2-mixer-dev + run: sudo apt-get update \ + sudo apt-get install build-essential cmake libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsdl2-mixer-dev - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} From 8033be848428c39f4649bc44cc9e2d5ee3c2a455 Mon Sep 17 00:00:00 2001 From: arf20 <35542215+arf20@users.noreply.github.com> Date: Fri, 3 Feb 2023 11:51:57 +0100 Subject: [PATCH 3/3] I hate Github actions --- .github/workflows/cmake.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 9fbd2c8..bb22377 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -14,8 +14,7 @@ jobs: - uses: actions/checkout@v3 - name: Install dependencies - run: sudo apt-get update \ - sudo apt-get install build-essential cmake libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsdl2-mixer-dev + run: sudo apt-get update && sudo apt-get install build-essential cmake libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libsdl2-mixer-dev - name: Configure CMake run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}