From 727b1472684a9eae667693fe008b6d80d7eb1c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Sat, 24 Sep 2022 20:53:59 +0200 Subject: [PATCH] Move `src/game/bezier.cpp/h` to `src/base/bezier.cpp/h` As those functions are not game specific per se, they can be part of base instead. Closes #3334. --- CMakeLists.txt | 4 ++-- src/{game => base}/bezier.cpp | 0 src/{game => base}/bezier.h | 6 +++--- src/game/client/components/camera.h | 2 +- src/test/bezier.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) rename src/{game => base}/bezier.cpp (100%) rename src/{game => base}/bezier.h (89%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 532b56c80..a4d0691ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1686,6 +1686,8 @@ add_custom_command(OUTPUT "src/game/generated/wordlist.h" # Sources set_src(BASE GLOB_RECURSE src/base + bezier.cpp + bezier.h color.h detect.h dynamic.h @@ -1824,8 +1826,6 @@ set_src(ENGINE_GFX GLOB src/engine/gfx image_manipulation.h ) set_src(GAME_SHARED GLOB src/game - bezier.cpp - bezier.h collision.cpp collision.h ddracechat.h diff --git a/src/game/bezier.cpp b/src/base/bezier.cpp similarity index 100% rename from src/game/bezier.cpp rename to src/base/bezier.cpp diff --git a/src/game/bezier.h b/src/base/bezier.h similarity index 89% rename from src/game/bezier.h rename to src/base/bezier.h index 60e2cff52..e199c7caf 100644 --- a/src/game/bezier.h +++ b/src/base/bezier.h @@ -1,5 +1,5 @@ -#ifndef GAME_BEZIER_H -#define GAME_BEZIER_H +#ifndef BASE_BEZIER_H +#define BASE_BEZIER_H // Evaluates the Bernstein polynomial of degree 3/a one-dimensional Bezier curve // @@ -24,4 +24,4 @@ public: static CCubicBezier With(float Start, float StartDerivative, float EndDerivative, float End); }; -#endif // GAME_BEZIER_H +#endif // BASE_BEZIER_H diff --git a/src/game/client/components/camera.h b/src/game/client/components/camera.h index f3d0afb0c..257a9cec6 100644 --- a/src/game/client/components/camera.h +++ b/src/game/client/components/camera.h @@ -2,12 +2,12 @@ /* If you are missing that file, acquire a complete release at teeworlds.com. */ #ifndef GAME_CLIENT_COMPONENTS_CAMERA_H #define GAME_CLIENT_COMPONENTS_CAMERA_H +#include #include #include #include -#include #include class CCamera : public CComponent diff --git a/src/test/bezier.cpp b/src/test/bezier.cpp index c42d723a8..e0f2d3417 100644 --- a/src/test/bezier.cpp +++ b/src/test/bezier.cpp @@ -1,7 +1,7 @@ #include "test.h" #include -#include +#include // Due to the implementation, derivatives must be divisible by 3 to be exactly // represented.