From b77024de4351bcddee5c4781aa9fc031131f293b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 20 Feb 2021 14:06:29 +0000 Subject: Pass linters --- game/terrain.cpp | 2 -- game/terrain.h | 4 ++-- game/vehicles/railloco.cpp | 4 +++- game/vehicles/railloco.h | 7 +++++-- game/vehicles/vehicle.cpp | 1 - game/vehicles/vehicle.h | 2 +- gfx/followCameraController.cpp | 1 - gfx/gl/shader.cpp | 1 + gfx/manualCameraController.cpp | 1 - gfx/models/mesh.cpp | 6 ------ gfx/models/mesh.h | 7 ++----- gfx/models/obj.impl.cpp | 6 ++++++ test/test-obj.cpp | 1 + utility/embed-glsl.cpp.m4 | 3 ++- 14 files changed, 23 insertions(+), 23 deletions(-) diff --git a/game/terrain.cpp b/game/terrain.cpp index 20c06e8..44fd41d 100644 --- a/game/terrain.cpp +++ b/game/terrain.cpp @@ -1,6 +1,5 @@ #include "terrain.h" #include "gfx/models/texture.h" -#include #include #include #include @@ -9,7 +8,6 @@ #include #include #include -#include #include #include diff --git a/game/terrain.h b/game/terrain.h index 2cec963..979a8e0 100644 --- a/game/terrain.h +++ b/game/terrain.h @@ -2,9 +2,8 @@ #define TERRAIN_H #include "collection.hpp" -#include "worldobject.h" +#include "game/worldobject.h" #include -#include #include #include #include @@ -12,6 +11,7 @@ class Shader; class Texture; +class Vertex; class Terrain : public WorldObject, public Renderable { public: diff --git a/game/vehicles/railloco.cpp b/game/vehicles/railloco.cpp index b47722e..6a43965 100644 --- a/game/vehicles/railloco.cpp +++ b/game/vehicles/railloco.cpp @@ -6,7 +6,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -61,7 +63,7 @@ RailLoco::updateRailVehiclePosition(RailVehicle * w, float trailBy) const { const auto overhang {(w->length - w->wheelBase) / 2}; const auto & b1Pos = w->bogeys[0].location = getBogeyPosition(linkDist, trailBy += overhang); - const auto & b2Pos = w->bogeys[1].location = getBogeyPosition(linkDist, trailBy += wheelBase); + const auto & b2Pos = w->bogeys[1].location = getBogeyPosition(linkDist, trailBy + wheelBase); const auto diff = glm::normalize(b2Pos.GetPos() - b1Pos.GetPos()); w->location.GetPos() = (b1Pos.GetPos() + b2Pos.GetPos()) / 2.F; w->location.GetRot() = {-vector_pitch(diff), vector_yaw(diff), 0}; diff --git a/game/vehicles/railloco.h b/game/vehicles/railloco.h index 0d0425a..df5f970 100644 --- a/game/vehicles/railloco.h +++ b/game/vehicles/railloco.h @@ -1,11 +1,14 @@ #include "game/network/link.h" #include "game/vehicles/vehicle.h" #include "game/worldobject.h" +#include "gfx/gl/transform.h" #include "gfx/models/mesh.h" +#include #include -#include #include +class Shader; + class Texture; class RailVehicle : public Vehicle { public: @@ -42,7 +45,7 @@ public: private: void move(TickDuration dur); - Transform getBogeyPosition(float linkDist, float dist) const; + [[nodiscard]] Transform getBogeyPosition(float linkDist, float dist) const; void updateRailVehiclePosition(RailVehicle *, float trailBy) const; void updateWagons() const; }; diff --git a/game/vehicles/vehicle.cpp b/game/vehicles/vehicle.cpp index b9d10bc..26e33d4 100644 --- a/game/vehicles/vehicle.cpp +++ b/game/vehicles/vehicle.cpp @@ -1,6 +1,5 @@ #include "vehicle.h" #include "game/network/link.h" -#include #include #include diff --git a/game/vehicles/vehicle.h b/game/vehicles/vehicle.h index bbfa6ea..228f15a 100644 --- a/game/vehicles/vehicle.h +++ b/game/vehicles/vehicle.h @@ -1,11 +1,11 @@ #ifndef VEHICLE_H #define VEHICLE_H +#include "gfx/gl/transform.h" #include #include #include #include -#include #include #include diff --git a/gfx/followCameraController.cpp b/gfx/followCameraController.cpp index 25a64e4..1a5a5d3 100644 --- a/gfx/followCameraController.cpp +++ b/gfx/followCameraController.cpp @@ -2,7 +2,6 @@ #include "game/vehicles/vehicle.h" #include "gfx/gl/transform.h" #include -#include #include #include #include diff --git a/gfx/gl/shader.cpp b/gfx/gl/shader.cpp index d4cb747..f30af5c 100644 --- a/gfx/gl/shader.cpp +++ b/gfx/gl/shader.cpp @@ -1,4 +1,5 @@ #include "shader.h" +#include "gfx/gl/shader-source.h" #include #include #include diff --git a/gfx/manualCameraController.cpp b/gfx/manualCameraController.cpp index f8cdbf8..01787c6 100644 --- a/gfx/manualCameraController.cpp +++ b/gfx/manualCameraController.cpp @@ -1,6 +1,5 @@ #include "manualCameraController.h" #include -#include bool ManualCameraController::handleInput(SDL_Event & e) diff --git a/gfx/models/mesh.cpp b/gfx/models/mesh.cpp index c829f4e..3487083 100644 --- a/gfx/models/mesh.cpp +++ b/gfx/models/mesh.cpp @@ -1,11 +1,5 @@ #include "mesh.h" -#include "obj.h" #include "vertex.hpp" -#include -#include -#include -#include -#include Mesh::Mesh(std::span vertices, std::span indices, GLenum m) : m_vertexArrayObject {}, m_vertexArrayBuffers {}, m_numIndices {indices.size()}, mode {m} diff --git a/gfx/models/mesh.h b/gfx/models/mesh.h index ea3a26b..1e53407 100644 --- a/gfx/models/mesh.h +++ b/gfx/models/mesh.h @@ -4,14 +4,11 @@ #include #include #include -#include -#include +#include #include #include -#include -#include -class ObjParser; +class Vertex; enum MeshBufferPositions { POSITION_VB, TEXCOORD_VB, NORMAL_VB, INDEX_VB }; diff --git a/gfx/models/obj.impl.cpp b/gfx/models/obj.impl.cpp index e410058..0c1303a 100644 --- a/gfx/models/obj.impl.cpp +++ b/gfx/models/obj.impl.cpp @@ -1,6 +1,12 @@ #include "obj.h" +#include #include #include +#include +#include +#include +#include +#include std::vector ObjParser::createMeshes() const diff --git a/test/test-obj.cpp b/test/test-obj.cpp index 68221b8..0d53691 100644 --- a/test/test-obj.cpp +++ b/test/test-obj.cpp @@ -4,6 +4,7 @@ #include #include +#include #include BOOST_AUTO_TEST_CASE(objparse) diff --git a/utility/embed-glsl.cpp.m4 b/utility/embed-glsl.cpp.m4 index febba68..9e4c6d4 100644 --- a/utility/embed-glsl.cpp.m4 +++ b/utility/embed-glsl.cpp.m4 @@ -1,7 +1,8 @@ changecom()dnl // NAME #include "substr(TYPE,1)-NAME.h" -#include +#include +#include "gfx/gl/shader-source.h" constexpr const GLchar * src { R"GLSL-EMBED(dnl include(SOURCE))GLSL-EMBED" }; -- cgit v1.2.3