summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--game/activities/go.h5
-rw-r--r--game/activities/idle.h5
-rw-r--r--game/activity.h5
-rw-r--r--game/activityOf.h5
-rw-r--r--game/gamestate.h5
-rw-r--r--game/network/link.h5
-rw-r--r--game/network/network.h5
-rw-r--r--game/network/rail.h5
-rw-r--r--game/network/routeWalker.h5
-rw-r--r--game/objective.h5
-rw-r--r--game/objectives/freeroam.h5
-rw-r--r--game/objectives/goto.h5
-rw-r--r--game/orders.h5
-rw-r--r--game/selectable.h5
-rw-r--r--game/terrain.h5
-rw-r--r--game/vehicles/linkHistory.h5
-rw-r--r--game/vehicles/railVehicle.h5
-rw-r--r--game/vehicles/railVehicleClass.h5
-rw-r--r--game/vehicles/train.h5
-rw-r--r--game/vehicles/vehicle.h5
-rw-r--r--game/worldobject.h5
-rw-r--r--gfx/camera_controller.h5
-rw-r--r--gfx/followCameraController.h4
-rw-r--r--gfx/gl/camera.h5
-rw-r--r--gfx/gl/glSource.h5
-rw-r--r--gfx/gl/programHandle.h5
-rw-r--r--gfx/gl/shader.h5
-rw-r--r--gfx/gl/uiShader.h5
-rw-r--r--gfx/image.h5
-rw-r--r--gfx/models/mesh.h5
-rw-r--r--gfx/models/obj.h5
-rw-r--r--gfx/models/stb_image.c4
-rw-r--r--gfx/models/stb_image.impl.c2
-rw-r--r--gfx/models/texture.h5
-rw-r--r--gfx/models/vertex.hpp5
-rw-r--r--gfx/renderable.h5
-rw-r--r--lib/cache.h5
-rw-r--r--lib/chronology.hpp5
-rw-r--r--lib/collection.hpp5
-rw-r--r--lib/embed-glsl.h.m42
-rw-r--r--lib/glRef.hpp5
-rw-r--r--lib/jsonParse-persistence.h5
-rw-r--r--lib/jsonParse.h5
-rw-r--r--lib/location.hpp5
-rw-r--r--lib/maths.h5
-rw-r--r--lib/persistence.h5
-rw-r--r--lib/ptr.hpp5
-rw-r--r--lib/resource.h5
-rw-r--r--lib/sorting.hpp5
-rw-r--r--lib/special_members.hpp5
-rw-r--r--lib/stream_support.hpp5
-rw-r--r--lib/strings.hpp7
-rw-r--r--lib/unicode.h5
-rw-r--r--lib/work.h5
-rw-r--r--lib/worker.h4
-rw-r--r--test/test-helpers.hpp5
-rw-r--r--ui/font.h5
-rw-r--r--ui/gameMainWindow.h5
-rw-r--r--ui/icon.h5
-rw-r--r--ui/iconButton.h5
-rw-r--r--ui/manualCameraController.h4
-rw-r--r--ui/toolbar.h5
-rw-r--r--ui/uiComponent.h5
-rw-r--r--ui/uiComponentPlacer.h5
-rw-r--r--ui/window.h5
65 files changed, 68 insertions, 249 deletions
diff --git a/game/activities/go.h b/game/activities/go.h
index 54af31b..701c13c 100644
--- a/game/activities/go.h
+++ b/game/activities/go.h
@@ -1,5 +1,4 @@
-#ifndef GO_H
-#define GO_H
+#pragma once
#include "../activity.h"
#include "../activityOf.h"
@@ -12,5 +11,3 @@ public:
std::optional<float> dist;
};
-
-#endif
diff --git a/game/activities/idle.h b/game/activities/idle.h
index 902d014..fa9067d 100644
--- a/game/activities/idle.h
+++ b/game/activities/idle.h
@@ -1,10 +1,7 @@
-#ifndef IDLE_H
-#define IDLE_H
+#pragma once
#include "../activityOf.h"
class Idle : public Activity::Of<Idle> {
public:
};
-
-#endif
diff --git a/game/activity.h b/game/activity.h
index 44f8d6f..6ba3712 100644
--- a/game/activity.h
+++ b/game/activity.h
@@ -1,5 +1,4 @@
-#ifndef ACTIVITY_H
-#define ACTIVITY_H
+#pragma once
#include <game/worldobject.h>
#include <memory>
@@ -29,5 +28,3 @@ public:
virtual void doActivity(AC *, TickDuration) = 0;
};
-
-#endif
diff --git a/game/activityOf.h b/game/activityOf.h
index c245866..1fc82aa 100644
--- a/game/activityOf.h
+++ b/game/activityOf.h
@@ -1,5 +1,4 @@
-#ifndef ACTIVITYOF_H
-#define ACTIVITYOF_H
+#pragma once
#include "activity.h"
#include "vehicles/vehicle.h"
@@ -13,5 +12,3 @@ template<typename T> class Activity::Of : public Activity {
}
}
};
-
-#endif
diff --git a/game/gamestate.h b/game/gamestate.h
index 536c420..605aac4 100644
--- a/game/gamestate.h
+++ b/game/gamestate.h
@@ -1,5 +1,4 @@
-#ifndef GAMESTATE_H
-#define GAMESTATE_H
+#pragma once
#include <collection.hpp>
#include <memory>
@@ -19,5 +18,3 @@ public:
std::shared_ptr<GeoData> geoData;
};
extern GameState * gameState;
-
-#endif
diff --git a/game/network/link.h b/game/network/link.h
index 16ae5f7..51c29ff 100644
--- a/game/network/link.h
+++ b/game/network/link.h
@@ -1,5 +1,4 @@
-#ifndef LINK_H
-#define LINK_H
+#pragma once
#include <array>
#include <glm/glm.hpp>
@@ -88,5 +87,3 @@ public:
Arc arc;
};
LinkCurve::~LinkCurve() = default;
-
-#endif
diff --git a/game/network/network.h b/game/network/network.h
index 31fc744..3be7943 100644
--- a/game/network/network.h
+++ b/game/network/network.h
@@ -1,5 +1,4 @@
-#ifndef NETWORK_H
-#define NETWORK_H
+#pragma once
#include "link.h"
#include <collection.hpp>
@@ -53,5 +52,3 @@ public:
void render(const Shader &) const override;
};
-
-#endif
diff --git a/game/network/rail.h b/game/network/rail.h
index 47969d6..758beb6 100644
--- a/game/network/rail.h
+++ b/game/network/rail.h
@@ -1,5 +1,4 @@
-#ifndef RAILLINKS_H
-#define RAILLINKS_H
+#pragma once
#include "chronology.hpp"
#include "game/worldobject.h"
@@ -58,5 +57,3 @@ public:
private:
void tick(TickDuration elapsed) override;
};
-
-#endif
diff --git a/game/network/routeWalker.h b/game/network/routeWalker.h
index d70103f..e0577ae 100644
--- a/game/network/routeWalker.h
+++ b/game/network/routeWalker.h
@@ -1,5 +1,4 @@
-#ifndef ROUTEWALKER_H
-#define ROUTEWALKER_H
+#pragma once
#include "link.h"
#include <set>
@@ -19,5 +18,3 @@ private:
Solution bestSolution, currentSolution;
float solutionLength;
};
-
-#endif
diff --git a/game/objective.h b/game/objective.h
index 5b3690e..617b8e9 100644
--- a/game/objective.h
+++ b/game/objective.h
@@ -1,5 +1,4 @@
-#ifndef OBJECTIVE_H
-#define OBJECTIVE_H
+#pragma once
#include "activity.h"
#include "network/link.h"
@@ -21,5 +20,3 @@ public:
Orders * orders;
};
using ObjectivePtr = std::unique_ptr<Objective>;
-
-#endif
diff --git a/game/objectives/freeroam.h b/game/objectives/freeroam.h
index 2cfdcfc..ef74eb7 100644
--- a/game/objectives/freeroam.h
+++ b/game/objectives/freeroam.h
@@ -1,5 +1,4 @@
-#ifndef FREEROAM_H
-#define FREEROAM_H
+#pragma once
#include <game/activity.h>
#include <game/network/link.h>
@@ -12,5 +11,3 @@ public:
[[nodiscard]] ActivityPtr createActivity() const override;
[[nodiscard]] Link::Next navigate(Link::Nexts::const_iterator, Link::Nexts::const_iterator) const override;
};
-
-#endif
diff --git a/game/objectives/goto.h b/game/objectives/goto.h
index 01e47ae..acd5e48 100644
--- a/game/objectives/goto.h
+++ b/game/objectives/goto.h
@@ -1,5 +1,4 @@
-#ifndef GOTO_H
-#define GOTO_H
+#pragma once
#include <game/activity.h>
#include <game/network/link.h>
@@ -18,5 +17,3 @@ private:
Link::Nexts links;
float startDist;
};
-
-#endif
diff --git a/game/orders.h b/game/orders.h
index cd72767..5ac0abf 100644
--- a/game/orders.h
+++ b/game/orders.h
@@ -1,5 +1,4 @@
-#ifndef ORDERS_H
-#define ORDERS_H
+#pragma once
#include <collection.hpp>
#include <memory>
@@ -12,5 +11,3 @@ public:
Objective * next();
};
using OrdersPtr = std::shared_ptr<Orders>;
-
-#endif
diff --git a/game/selectable.h b/game/selectable.h
index c16246c..0104f3d 100644
--- a/game/selectable.h
+++ b/game/selectable.h
@@ -1,5 +1,4 @@
-#ifndef SELECTABLE_H
-#define SELECTABLE_H
+#pragma once
#include <glm/glm.hpp>
#include <special_members.hpp>
@@ -12,5 +11,3 @@ public:
[[nodiscard]] virtual bool intersectRay(const glm::vec3 &, const glm::vec3 &, glm::vec2 *, float *) const = 0;
};
-
-#endif
diff --git a/game/terrain.h b/game/terrain.h
index 4775dff..b13efb6 100644
--- a/game/terrain.h
+++ b/game/terrain.h
@@ -1,5 +1,4 @@
-#ifndef TERRAIN_H
-#define TERRAIN_H
+#pragma once
#include "chronology.hpp"
#include "collection.hpp"
@@ -28,5 +27,3 @@ private:
Collection<Mesh, false> meshes;
std::shared_ptr<Texture> grass, water;
};
-
-#endif
diff --git a/game/vehicles/linkHistory.h b/game/vehicles/linkHistory.h
index 31d0023..6944727 100644
--- a/game/vehicles/linkHistory.h
+++ b/game/vehicles/linkHistory.h
@@ -1,5 +1,4 @@
-#ifndef LINKHISTORY_H
-#define LINKHISTORY_H
+#pragma once
#include <game/network/link.h>
#include <utility>
@@ -17,5 +16,3 @@ private:
std::vector<WEntry> links;
float totalLen {0.F};
};
-
-#endif
diff --git a/game/vehicles/railVehicle.h b/game/vehicles/railVehicle.h
index 55cb6a2..f52b154 100644
--- a/game/vehicles/railVehicle.h
+++ b/game/vehicles/railVehicle.h
@@ -1,5 +1,4 @@
-#ifndef RAILVEHICLE_H
-#define RAILVEHICLE_H
+#pragma once
#include "gfx/renderable.h"
#include "railVehicleClass.h"
@@ -28,5 +27,3 @@ public:
std::array<Location, 2> bogies;
};
using RailVehiclePtr = std::unique_ptr<RailVehicle>;
-
-#endif
diff --git a/game/vehicles/railVehicleClass.h b/game/vehicles/railVehicleClass.h
index fb881b9..8f82fd2 100644
--- a/game/vehicles/railVehicleClass.h
+++ b/game/vehicles/railVehicleClass.h
@@ -1,5 +1,4 @@
-#ifndef RAILVEHICLECLASS_H
-#define RAILVEHICLECLASS_H
+#pragma once
#include "gfx/models/mesh.h"
#include <array>
@@ -30,5 +29,3 @@ private:
static float objectLength(ObjParser & o);
};
using RailVehicleClassPtr = std::shared_ptr<RailVehicleClass>;
-
-#endif
diff --git a/game/vehicles/train.h b/game/vehicles/train.h
index c823aed..68f9fbf 100644
--- a/game/vehicles/train.h
+++ b/game/vehicles/train.h
@@ -1,5 +1,4 @@
-#ifndef TRAIN_H
-#define TRAIN_H
+#pragma once
#include "chronology.hpp"
#include "game/activities/go.h" // IWYU pragma: keep
@@ -36,5 +35,3 @@ public:
[[nodiscard]] Location getBogiePosition(float linkDist, float dist) const;
};
-
-#endif
diff --git a/game/vehicles/vehicle.h b/game/vehicles/vehicle.h
index 3ddeac5..24557b5 100644
--- a/game/vehicles/vehicle.h
+++ b/game/vehicles/vehicle.h
@@ -1,5 +1,4 @@
-#ifndef VEHICLE_H
-#define VEHICLE_H
+#pragma once
#include "chronology.hpp"
#include "linkHistory.h"
@@ -29,5 +28,3 @@ protected:
LinkHistory linkHist;
};
using VehicleWPtr = std::weak_ptr<Vehicle>;
-
-#endif
diff --git a/game/worldobject.h b/game/worldobject.h
index ba77cd0..994545b 100644
--- a/game/worldobject.h
+++ b/game/worldobject.h
@@ -1,5 +1,4 @@
-#ifndef WORLDOBJECT_H
-#define WORLDOBJECT_H
+#pragma once
#include "chronology.hpp"
#include <special_members.hpp>
@@ -13,5 +12,3 @@ public:
virtual void tick(TickDuration elapsed) = 0;
};
-
-#endif
diff --git a/gfx/camera_controller.h b/gfx/camera_controller.h
index e6fc16d..fd5c885 100644
--- a/gfx/camera_controller.h
+++ b/gfx/camera_controller.h
@@ -1,5 +1,4 @@
-#ifndef CAMERA_CONTROLLER_H
-#define CAMERA_CONTROLLER_H
+#pragma once
#include <special_members.hpp>
@@ -13,5 +12,3 @@ public:
virtual void updateCamera(Camera *) const = 0;
};
-
-#endif
diff --git a/gfx/followCameraController.h b/gfx/followCameraController.h
index cfe70c2..63010c2 100644
--- a/gfx/followCameraController.h
+++ b/gfx/followCameraController.h
@@ -1,5 +1,4 @@
-#ifndef FOLLOW_CAMERA_CONTROLLER_H
-#define FOLLOW_CAMERA_CONTROLLER_H
+#pragma once
#include <game/vehicles/vehicle.h>
#include <gfx/camera_controller.h>
@@ -17,4 +16,3 @@ private:
VehicleWPtr target;
Mode mode;
};
-#endif
diff --git a/gfx/gl/camera.h b/gfx/gl/camera.h
index 1d3f5b3..9fbb0a1 100644
--- a/gfx/gl/camera.h
+++ b/gfx/gl/camera.h
@@ -1,5 +1,4 @@
-#ifndef CAMERA_INCLUDED_H
-#define CAMERA_INCLUDED_H
+#pragma once
#include <glm/glm.hpp>
@@ -17,5 +16,3 @@ public:
private:
glm::mat4 projection;
};
-
-#endif
diff --git a/gfx/gl/glSource.h b/gfx/gl/glSource.h
index 7b43c48..c6b1f41 100644
--- a/gfx/gl/glSource.h
+++ b/gfx/gl/glSource.h
@@ -1,5 +1,4 @@
-#ifndef SHADER_SOURCE_H
-#define SHADER_SOURCE_H
+#pragma once
#include <GL/glew.h>
#include <glRef.hpp>
@@ -15,5 +14,3 @@ struct GLsource {
[[nodiscard]] ShaderRef compile() const;
static void CheckShaderError(GLuint shader, GLuint flag, bool isProgram, std::string_view errorMessage);
};
-
-#endif
diff --git a/gfx/gl/programHandle.h b/gfx/gl/programHandle.h
index 5bd5c05..a2a7a2d 100644
--- a/gfx/gl/programHandle.h
+++ b/gfx/gl/programHandle.h
@@ -1,5 +1,4 @@
-#ifndef PROGRAM_HANDLE_H
-#define PROGRAM_HANDLE_H
+#pragma once
#include <GL/glew.h>
#include <glRef.hpp>
@@ -12,5 +11,3 @@ public:
ProgramRef m_program;
GLint viewProjection_uniform, model_uniform;
};
-
-#endif
diff --git a/gfx/gl/shader.h b/gfx/gl/shader.h
index 7df7a07..8411b94 100644
--- a/gfx/gl/shader.h
+++ b/gfx/gl/shader.h
@@ -1,5 +1,4 @@
-#ifndef SHADER_INCLUDED_H
-#define SHADER_INCLUDED_H
+#pragma once
#include "programHandle.h"
#include <GL/glew.h>
@@ -26,5 +25,3 @@ private:
std::array<ProgramHandle, 4> programs;
};
-
-#endif
diff --git a/gfx/gl/uiShader.h b/gfx/gl/uiShader.h
index 502ba13..ea5bf25 100644
--- a/gfx/gl/uiShader.h
+++ b/gfx/gl/uiShader.h
@@ -1,5 +1,4 @@
-#ifndef UISHADER_H
-#define UISHADER_H
+#pragma once
#include "programHandle.h"
#include <GL/glew.h>
@@ -18,5 +17,3 @@ private:
};
UIProgramHandle progDefault, progText;
};
-
-#endif
diff --git a/gfx/image.h b/gfx/image.h
index 23e9a9b..47437ca 100644
--- a/gfx/image.h
+++ b/gfx/image.h
@@ -1,5 +1,4 @@
-#ifndef IMAGE_H
-#define IMAGE_H
+#pragma once
#include <span> // IWYU pragma: export
#include <special_members.hpp>
@@ -17,5 +16,3 @@ public:
unsigned int width, height, numComponents;
std::span<unsigned char> data;
};
-
-#endif
diff --git a/gfx/models/mesh.h b/gfx/models/mesh.h
index 9b74f48..c6f11a2 100644
--- a/gfx/models/mesh.h
+++ b/gfx/models/mesh.h
@@ -1,5 +1,4 @@
-#ifndef MESH_INCLUDED_H
-#define MESH_INCLUDED_H
+#pragma once
#include <GL/glew.h>
#include <glArrays.h>
@@ -21,5 +20,3 @@ private:
GLenum mode;
};
using MeshPtr = std::shared_ptr<const Mesh>;
-
-#endif
diff --git a/gfx/models/obj.h b/gfx/models/obj.h
index 6db16c0..e28f7de 100644
--- a/gfx/models/obj.h
+++ b/gfx/models/obj.h
@@ -1,5 +1,4 @@
-#ifndef OBJ_H
-#define OBJ_H
+#pragma once
#ifndef yyFlexLexer
# define yyFlexLexer objbaseFlexLexer
@@ -37,5 +36,3 @@ public:
using NamedMeshes = std::map<std::string, std::shared_ptr<const Mesh>>;
[[nodiscard]] NamedMeshes createMeshes() const;
};
-
-#endif
diff --git a/gfx/models/stb_image.c b/gfx/models/stb_image.c
deleted file mode 100644
index c15369e..0000000
--- a/gfx/models/stb_image.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef TIDY
-# define STB_IMAGE_IMPLEMENTATION
-# include "stb/stb_image.h"
-#endif
diff --git a/gfx/models/stb_image.impl.c b/gfx/models/stb_image.impl.c
new file mode 100644
index 0000000..38c72e9
--- /dev/null
+++ b/gfx/models/stb_image.impl.c
@@ -0,0 +1,2 @@
+#define STB_IMAGE_IMPLEMENTATION
+#include "stb/stb_image.h"
diff --git a/gfx/models/texture.h b/gfx/models/texture.h
index e029a9b..04aa9ec 100644
--- a/gfx/models/texture.h
+++ b/gfx/models/texture.h
@@ -1,5 +1,4 @@
-#ifndef TEXTURE_H
-#define TEXTURE_H
+#pragma once
#include <cache.h>
#include <filesystem>
@@ -18,5 +17,3 @@ public:
private:
glTexture m_texture;
};
-
-#endif
diff --git a/gfx/models/vertex.hpp b/gfx/models/vertex.hpp
index 3d7f933..f2e38f6 100644
--- a/gfx/models/vertex.hpp
+++ b/gfx/models/vertex.hpp
@@ -1,5 +1,4 @@
-#ifndef VERTEX_H
-#define VERTEX_H
+#pragma once
#include <glm/glm.hpp>
@@ -14,5 +13,3 @@ public:
glm::vec2 texCoord;
glm::vec3 normal;
};
-
-#endif
diff --git a/gfx/renderable.h b/gfx/renderable.h
index dea36c6..565f705 100644
--- a/gfx/renderable.h
+++ b/gfx/renderable.h
@@ -1,5 +1,4 @@
-#ifndef RENDERABLE_H
-#define RENDERABLE_H
+#pragma once
#include <special_members.hpp>
@@ -13,5 +12,3 @@ public:
virtual void render(const Shader & shader) const = 0;
};
-
-#endif
diff --git a/lib/cache.h b/lib/cache.h
index cdc0a2e..5ab9469 100644
--- a/lib/cache.h
+++ b/lib/cache.h
@@ -1,5 +1,4 @@
-#ifndef CACHE_H
-#define CACHE_H
+#pragma once
#include "special_members.hpp"
#include <functional>
@@ -37,5 +36,3 @@ private:
std::map<Key, Ptr, std::less<>> cached;
};
// IWYU pragma: no_forward_declare Cache
-
-#endif
diff --git a/lib/chronology.hpp b/lib/chronology.hpp
index 5edf95a..1980116 100644
--- a/lib/chronology.hpp
+++ b/lib/chronology.hpp
@@ -1,8 +1,5 @@
-#ifndef CHRONOLOGY_H
-#define CHRONOLOGY_H
+#pragma once
#include <chrono>
using TickDuration = std::chrono::duration<float, std::chrono::seconds::period>;
-
-#endif
diff --git a/lib/collection.hpp b/lib/collection.hpp
index cf51157..a80faa2 100644
--- a/lib/collection.hpp
+++ b/lib/collection.hpp
@@ -1,5 +1,4 @@
-#ifndef COLLECTION_H
-#define COLLECTION_H
+#pragma once
#include <algorithm>
#include <memory>
@@ -69,5 +68,3 @@ public:
return objects.end();
}
};
-
-#endif
diff --git a/lib/embed-glsl.h.m4 b/lib/embed-glsl.h.m4
index f277c56..57ba0cf 100644
--- a/lib/embed-glsl.h.m4
+++ b/lib/embed-glsl.h.m4
@@ -1,3 +1,5 @@
+#pragma once
+
// NAME
#include <gfx/gl/glSource.h>
diff --git a/lib/glRef.hpp b/lib/glRef.hpp
index 3377390..fc0c1c6 100644
--- a/lib/glRef.hpp
+++ b/lib/glRef.hpp
@@ -1,5 +1,4 @@
-#ifndef GLREF_H
-#define GLREF_H
+#pragma once
#include <special_members.hpp>
#include <stdexcept>
@@ -58,5 +57,3 @@ public:
private:
IdType id;
};
-
-#endif
diff --git a/lib/jsonParse-persistence.h b/lib/jsonParse-persistence.h
index edb5305..fa5e772 100644
--- a/lib/jsonParse-persistence.h
+++ b/lib/jsonParse-persistence.h
@@ -1,5 +1,4 @@
-#ifndef JSONPARSE_PERSISTANCE
-#define JSONPARSE_PERSISTANCE
+#pragma once
#include "jsonParse.h" // IWYU pragma: export
#include "persistence.h" // IWYU pragma: export
@@ -68,5 +67,3 @@ namespace Persistence {
std::ostream & strm;
};
}
-
-#endif
diff --git a/lib/jsonParse.h b/lib/jsonParse.h
index 79833eb..4205572 100644
--- a/lib/jsonParse.h
+++ b/lib/jsonParse.h
@@ -1,5 +1,4 @@
-#ifndef JSONFLEXLEXER_H
-#define JSONFLEXLEXER_H
+#pragma once
#ifndef FLEX_SCANNER
# define yyFlexLexer jsonBaseFlexLexer
@@ -39,5 +38,3 @@ namespace json {
std::string buf;
};
}
-
-#endif
diff --git a/lib/location.hpp b/lib/location.hpp
index b019b7a..1360c47 100644
--- a/lib/location.hpp
+++ b/lib/location.hpp
@@ -1,5 +1,4 @@
-#ifndef LOCATION_H
-#define LOCATION_H
+#pragma once
#include <glm/glm.hpp>
@@ -10,5 +9,3 @@ public:
glm::vec3 pos;
glm::vec3 rot;
};
-
-#endif
diff --git a/lib/maths.h b/lib/maths.h
index c7b1c8f..514a5ad 100644
--- a/lib/maths.h
+++ b/lib/maths.h
@@ -1,5 +1,4 @@
-#ifndef MATH_H
-#define MATH_H
+#pragma once
#include <cmath>
#include <glm/glm.hpp>
@@ -142,5 +141,3 @@ kph_to_ms(T v)
// ... literals are handy for now, probably go away when we load stuff externally
float operator"" _mph(const long double v);
float operator"" _kph(const long double v);
-
-#endif
diff --git a/lib/persistence.h b/lib/persistence.h
index 60b40ca..4fbff4c 100644
--- a/lib/persistence.h
+++ b/lib/persistence.h
@@ -1,5 +1,4 @@
-#ifndef PERSISTANCE_H
-#define PERSISTANCE_H
+#pragma once
#include <functional>
#include <glm/glm.hpp>
@@ -463,5 +462,3 @@ namespace Persistence {
#define STORE_TYPE store.persistType(this, typeid(*this))
#define STORE_MEMBER(mbr) store.persistValue(#mbr, mbr)
-
-#endif
diff --git a/lib/ptr.hpp b/lib/ptr.hpp
index f242670..931df39 100644
--- a/lib/ptr.hpp
+++ b/lib/ptr.hpp
@@ -1,5 +1,4 @@
-#ifndef PTR_H
-#define PTR_H
+#pragma once
#include <memory>
#include <special_members.hpp>
@@ -66,5 +65,3 @@ public:
{
}
};
-
-#endif
diff --git a/lib/resource.h b/lib/resource.h
index 958c49d..37dd657 100644
--- a/lib/resource.h
+++ b/lib/resource.h
@@ -1,5 +1,4 @@
-#ifndef RESOURCE_H
-#define RESOURCE_H
+#pragma once
#include <filesystem>
@@ -19,5 +18,3 @@ public:
};
BOOST_GLOBAL_FIXTURE(SetResourcePath);
#endif
-
-#endif
diff --git a/lib/sorting.hpp b/lib/sorting.hpp
index 0cb0eaf..6b9be6a 100644
--- a/lib/sorting.hpp
+++ b/lib/sorting.hpp
@@ -1,5 +1,4 @@
-#ifndef SORTING_H
-#define SORTING_H
+#pragma once
template<typename T> struct PtrSorter {
bool
@@ -8,5 +7,3 @@ template<typename T> struct PtrSorter {
return *a < *b;
}
};
-
-#endif
diff --git a/lib/special_members.hpp b/lib/special_members.hpp
index 4b85884..312862b 100644
--- a/lib/special_members.hpp
+++ b/lib/special_members.hpp
@@ -1,5 +1,4 @@
-#ifndef SPECIAL_MEMBERS_H
-#define SPECIAL_MEMBERS_H
+#pragma once
#define NO_COPY(TYPE) \
TYPE(const TYPE &) = delete; \
@@ -28,5 +27,3 @@
#define CUSTOM_MOVE(TYPE) \
TYPE(TYPE &&) noexcept; \
TYPE & operator=(TYPE &&) noexcept
-
-#endif
diff --git a/lib/stream_support.hpp b/lib/stream_support.hpp
index 1ee1661..449708c 100644
--- a/lib/stream_support.hpp
+++ b/lib/stream_support.hpp
@@ -1,5 +1,4 @@
-#ifndef STREAM_SUPPORT_H
-#define STREAM_SUPPORT_H
+#pragma once
#include <glm/glm.hpp>
#include <iostream>
@@ -38,5 +37,3 @@ namespace std {
}
#define CLOG(x) std::clog << #x " : " << x << "\n";
-
-#endif
diff --git a/lib/strings.hpp b/lib/strings.hpp
index ee0db95..9dca9ac 100644
--- a/lib/strings.hpp
+++ b/lib/strings.hpp
@@ -1,5 +1,6 @@
-#ifndef STRINGS_HPP
-#define STRINGS_HPP
+#pragma once
+
+#include <GL/glew.h>
constexpr auto
constexpr_strlen(const GLchar * const s)
@@ -10,5 +11,3 @@ constexpr_strlen(const GLchar * const s)
}
return ch;
}
-
-#endif
diff --git a/lib/unicode.h b/lib/unicode.h
index 8bd841b..dde1d3d 100644
--- a/lib/unicode.h
+++ b/lib/unicode.h
@@ -1,5 +1,4 @@
-#ifndef UNICODE_H
-#define UNICODE_H
+#pragma once
// Wrappers of some glib functions (why are we using glib then?) which we want, but glib.h is a bit C like
@@ -16,5 +15,3 @@ uint32_t get_codepoint(const char *);
#ifdef __cplusplus
}
#endif
-
-#endif
diff --git a/lib/work.h b/lib/work.h
index 2374673..c780e13 100644
--- a/lib/work.h
+++ b/lib/work.h
@@ -1,5 +1,4 @@
-#ifndef WORK_H
-#define WORK_H
+#pragma once
#include <special_members.hpp>
@@ -11,5 +10,3 @@ public:
virtual void doWork() = 0;
};
-
-#endif
diff --git a/lib/worker.h b/lib/worker.h
index 7df16cd..de7d973 100644
--- a/lib/worker.h
+++ b/lib/worker.h
@@ -1,5 +1,4 @@
-#ifndef WORKER_H
-#define WORKER_H
+#pragma once
#include <utility>
class Work;
@@ -57,4 +56,3 @@ public:
};
#endif
-#endif
diff --git a/test/test-helpers.hpp b/test/test-helpers.hpp
index 294b6ff..d99e1fa 100644
--- a/test/test-helpers.hpp
+++ b/test/test-helpers.hpp
@@ -1,5 +1,4 @@
-#ifndef TEST_HELPERS_H
-#define TEST_HELPERS_H
+#pragma once
#include <boost/test/tools/context.hpp>
#include <boost/test/tools/interface.hpp>
@@ -14,5 +13,3 @@
BOOST_CHECK_LE(b, a); \
BOOST_CHECK_GE(c, a); \
}
-
-#endif
diff --git a/ui/font.h b/ui/font.h
index 4b44ee3..f8a29de 100644
--- a/ui/font.h
+++ b/ui/font.h
@@ -1,5 +1,4 @@
-#ifndef FONT_H
-#define FONT_H
+#pragma once
#include <GL/glew.h>
#include <array>
@@ -48,5 +47,3 @@ protected:
mutable std::map<uint32_t, CharData> charsData;
mutable std::vector<FontTexture> fontTextures;
};
-
-#endif
diff --git a/ui/gameMainWindow.h b/ui/gameMainWindow.h
index b85b8a8..e26ad2d 100644
--- a/ui/gameMainWindow.h
+++ b/ui/gameMainWindow.h
@@ -1,5 +1,4 @@
-#ifndef UI_GAMEMAINWINDOW_H
-#define UI_GAMEMAINWINDOW_H
+#pragma once
#include "chronology.hpp"
#include "gfx/gl/camera.h"
@@ -21,5 +20,3 @@ private:
Shader shader;
Camera camera;
};
-
-#endif
diff --git a/ui/icon.h b/ui/icon.h
index 2650218..961c11b 100644
--- a/ui/icon.h
+++ b/ui/icon.h
@@ -1,5 +1,4 @@
-#ifndef ICON_H
-#define ICON_H
+#pragma once
#include <filesystem>
#include <glArrays.h>
@@ -18,5 +17,3 @@ public:
private:
glTexture m_texture;
};
-
-#endif
diff --git a/ui/iconButton.h b/ui/iconButton.h
index 53ada74..6ac9317 100644
--- a/ui/iconButton.h
+++ b/ui/iconButton.h
@@ -1,5 +1,4 @@
-#ifndef ICONBUTTON_H
-#define ICONBUTTON_H
+#pragma once
#include "icon.h"
#include "uiComponent.h"
@@ -24,5 +23,3 @@ public:
glVertexArray m_vertexArrayObject;
glBuffer m_vertexArrayBuffer;
};
-
-#endif
diff --git a/ui/manualCameraController.h b/ui/manualCameraController.h
index 5ed45f5..d15fa76 100644
--- a/ui/manualCameraController.h
+++ b/ui/manualCameraController.h
@@ -1,5 +1,4 @@
-#ifndef MANUAL_CAMERA_CONTROLLER_H
-#define MANUAL_CAMERA_CONTROLLER_H
+#pragma once
#include "uiComponent.h"
#include <SDL2/SDL.h>
@@ -25,4 +24,3 @@ private:
float direction {quarter_pi};
float dist {40}, pitch {quarter_pi};
};
-#endif
diff --git a/ui/toolbar.h b/ui/toolbar.h
index 28aba6c..d141139 100644
--- a/ui/toolbar.h
+++ b/ui/toolbar.h
@@ -1,5 +1,4 @@
-#ifndef TOOLBAR_H
-#define TOOLBAR_H
+#pragma once
#include "collection.hpp"
#include "iconButton.h"
@@ -22,5 +21,3 @@ public:
Collection<IconButton, false> icons;
};
-
-#endif
diff --git a/ui/uiComponent.h b/ui/uiComponent.h
index e7b3a0b..8a9613e 100644
--- a/ui/uiComponent.h
+++ b/ui/uiComponent.h
@@ -1,5 +1,4 @@
-#ifndef UICOMPONENT_H
-#define UICOMPONENT_H
+#pragma once
#include <functional>
#include <glm/glm.hpp>
@@ -30,5 +29,3 @@ public:
Position position;
};
-
-#endif
diff --git a/ui/uiComponentPlacer.h b/ui/uiComponentPlacer.h
index b68c4d8..1e64f78 100644
--- a/ui/uiComponentPlacer.h
+++ b/ui/uiComponentPlacer.h
@@ -1,5 +1,4 @@
-#ifndef UICOMPONENTPLACER_H
-#define UICOMPONENTPLACER_H
+#pragma once
#include <glm/glm.hpp>
@@ -18,5 +17,3 @@ private:
float current {};
float max {};
};
-
-#endif
diff --git a/ui/window.h b/ui/window.h
index 25443bd..49cdf45 100644
--- a/ui/window.h
+++ b/ui/window.h
@@ -1,5 +1,4 @@
-#ifndef DISPLAY_INCLUDED_H
-#define DISPLAY_INCLUDED_H
+#pragma once
#include "chronology.hpp"
#include "collection.hpp"
@@ -37,5 +36,3 @@ protected:
Collection<UIComponent> uiComponents;
UIShader uiShader;
};
-
-#endif