aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Herklotz <ymherklotz@gmail.com>2018-05-19 20:23:53 +0100
committerYann Herklotz <ymherklotz@gmail.com>2018-05-19 20:23:53 +0100
commitce72a4975b76c1f244221d7d11e6a4eebc98b99b (patch)
treeb50ba73b4e4a14f66b281c05fd5a52e960b94076
parentfe4ef72bde8e93589922a60b3a03dbb148a00b57 (diff)
downloadYAGE-ce72a4975b76c1f244221d7d11e6a4eebc98b99b.tar.gz
YAGE-ce72a4975b76c1f244221d7d11e6a4eebc98b99b.zip
Using pragma instead of gards
The reason for this is that it reduces clashes between names.
-rw-r--r--yage/core/camera.h5
-rw-r--r--yage/core/core.h2
-rw-r--r--yage/core/exception.h5
-rw-r--r--yage/core/imageloader.h5
-rw-r--r--yage/core/iomanager.h5
-rw-r--r--yage/core/resourcemanager.h13
-rw-r--r--yage/core/texturecache.h5
-rw-r--r--yage/core/window.h5
-rw-r--r--yage/data/cube.h2
-rw-r--r--yage/data/input.h5
-rw-r--r--yage/data/texture.h5
-rw-r--r--yage/data/vertex.h5
-rw-r--r--yage/entity/entitymanager.h5
-rw-r--r--yage/entity/space.h5
-rw-r--r--yage/entity/system.h5
-rw-r--r--yage/math/matrix.h5
-rw-r--r--yage/physics/body.h5
-rw-r--r--yage/physics/collider.h5
-rw-r--r--yage/physics/collisionbody.h5
-rw-r--r--yage/physics/particlebody.h5
-rw-r--r--yage/physics/physics.h5
-rw-r--r--yage/physics/rectanglecollider.h5
-rw-r--r--yage/physics/rigidbody.h5
-rw-r--r--yage/render/shader.h5
-rw-r--r--yage/render/spritebatch.h5
-rw-r--r--yage/util/active.h5
-rw-r--r--yage/util/noncopyable.h5
-rw-r--r--yage/util/syncqueue.h5
28 files changed, 30 insertions, 112 deletions
diff --git a/yage/core/camera.h b/yage/core/camera.h
index 63bf15ca..ec1a189d 100644
--- a/yage/core/camera.h
+++ b/yage/core/camera.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_CORE_CAMERA_H
-#define YAGE_CORE_CAMERA_H
+#pragma once
#include <glm/glm.hpp>
@@ -34,5 +33,3 @@ public:
};
} // namespace yage
-
-#endif
diff --git a/yage/core/core.h b/yage/core/core.h
index 2d89955f..95da1f7f 100644
--- a/yage/core/core.h
+++ b/yage/core/core.h
@@ -6,6 +6,8 @@
* ----------------------------------------------------------------------------
*/
+#pragma once
+
/**
* Project namespace.
*
diff --git a/yage/core/exception.h b/yage/core/exception.h
index 05733b39..843a58a1 100644
--- a/yage/core/exception.h
+++ b/yage/core/exception.h
@@ -1,5 +1,4 @@
-#ifndef YAGE_CORE_EXCEPTION_H
-#define YAGE_CORE_EXCEPTION_H
+#pragma once
#include <stdexcept>
#include <sstream>
@@ -19,5 +18,3 @@ private:
};
} // namespace yage
-
-#endif
diff --git a/yage/core/imageloader.h b/yage/core/imageloader.h
index bc041dc6..38980572 100644
--- a/yage/core/imageloader.h
+++ b/yage/core/imageloader.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef IMAGE_LOADER_H
-#define IMAGE_LOADER_H
+#pragma once
#include <string>
@@ -23,5 +22,3 @@ public:
};
} // namespace yage
-
-#endif
diff --git a/yage/core/iomanager.h b/yage/core/iomanager.h
index adf91ace..9a1bf12d 100644
--- a/yage/core/iomanager.h
+++ b/yage/core/iomanager.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef IO_MANAGER_H
-#define IO_MANAGER_H
+#pragma once
#include <string>
#include <vector>
@@ -24,5 +23,3 @@ extern bool readFileToBuffer(const std::string &file_path,
}
} // namespace yage
-
-#endif
diff --git a/yage/core/resourcemanager.h b/yage/core/resourcemanager.h
index 11a16f63..1f7d811c 100644
--- a/yage/core/resourcemanager.h
+++ b/yage/core/resourcemanager.h
@@ -6,16 +6,7 @@
* ----------------------------------------------------------------------------
*/
-/** ---------------------------------------------------------------------------
- * @file: resourcemanager.h
- *
- * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com>
- * MIT License, see LICENSE file for more details.
- * ----------------------------------------------------------------------------
- */
-
-#ifndef RESOURCE_MANAGER_H
-#define RESOURCE_MANAGER_H
+#pragma once
#include "texturecache.h"
@@ -37,5 +28,3 @@ public:
};
} // namespace yage
-
-#endif
diff --git a/yage/core/texturecache.h b/yage/core/texturecache.h
index 8b34d39e..842ffec8 100644
--- a/yage/core/texturecache.h
+++ b/yage/core/texturecache.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef TEXTURE_CACHE_H
-#define TEXTURE_CACHE_H
+#pragma once
#include "../data/texture.h"
@@ -28,5 +27,3 @@ public:
};
} // namespace yage
-
-#endif
diff --git a/yage/core/window.h b/yage/core/window.h
index 9980018d..6087fc8d 100644
--- a/yage/core/window.h
+++ b/yage/core/window.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_CORE_WINDOW_H
-#define YAGE_CORE_WINDOW_H
+#pragma once
#include <string>
@@ -60,5 +59,3 @@ public:
};
} // namespace yage
-
-#endif
diff --git a/yage/data/cube.h b/yage/data/cube.h
index 2aef00e5..070052c8 100644
--- a/yage/data/cube.h
+++ b/yage/data/cube.h
@@ -1,3 +1,5 @@
+#pragma once
+
#include "glad/glad.h"
static const GLfloat gl_cube_buffer[] = {
diff --git a/yage/data/input.h b/yage/data/input.h
index 22cadb62..7a0898ef 100644
--- a/yage/data/input.h
+++ b/yage/data/input.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_CORE_INPUT_H
-#define YAGE_CORE_INPUT_H
+#pragma once
#ifdef _WIN32
#ifdef DELETE
@@ -161,5 +160,3 @@ enum class key {
#undef YAGE_DELETE_TMP
#endif
#endif
-
-#endif
diff --git a/yage/data/texture.h b/yage/data/texture.h
index 81b2f004..0f676df2 100644
--- a/yage/data/texture.h
+++ b/yage/data/texture.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_CORE_TEXTURE_H
-#define YAGE_CORE_TEXTURE_H
+#pragma once
#include <glad/glad.h>
@@ -30,5 +29,3 @@ struct Texture {
};
} // namespace yage
-
-#endif
diff --git a/yage/data/vertex.h b/yage/data/vertex.h
index 4cd095a9..072feb9f 100644
--- a/yage/data/vertex.h
+++ b/yage/data/vertex.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef VERTEX_H
-#define VERTEX_H
+#pragma once
#include <glad/glad.h>
@@ -80,5 +79,3 @@ struct Vertex {
};
} // namespace yage
-
-#endif
diff --git a/yage/entity/entitymanager.h b/yage/entity/entitymanager.h
index 2de5e13c..5316c955 100644
--- a/yage/entity/entitymanager.h
+++ b/yage/entity/entitymanager.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_ENGINE_ENTITYMANAGER_H
-#define YAGE_ENGINE_ENTITYMANAGER_H
+#pragma once
#include <vector>
@@ -76,5 +75,3 @@ private:
};
} // namespace yage
-
-#endif
diff --git a/yage/entity/space.h b/yage/entity/space.h
index 113110aa..dff2d2ce 100644
--- a/yage/entity/space.h
+++ b/yage/entity/space.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_ENGINE_SPACE_H
-#define YAGE_ENGINE_SPACE_H
+#pragma once
#include <vector>
#include <memory>
@@ -71,5 +70,3 @@ private:
};
} // namespace yage
-
-#endif
diff --git a/yage/entity/system.h b/yage/entity/system.h
index 0ca50009..7c67ac6f 100644
--- a/yage/entity/system.h
+++ b/yage/entity/system.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_ENGINE_SYSTEM_H
-#define YAGE_ENGINE_SYSTEM_H
+#pragma once
#include <cstddef>
@@ -24,5 +23,3 @@ public:
};
} // namespace yage
-
-#endif
diff --git a/yage/math/matrix.h b/yage/math/matrix.h
index ac612385..cefcd221 100644
--- a/yage/math/matrix.h
+++ b/yage/math/matrix.h
@@ -9,8 +9,7 @@
/** @file
*/
-#ifndef YAGE_MATH_MATRIX_H
-#define YAGE_MATH_MATRIX_H
+#pragma once
#include <algorithm>
#include <exception>
@@ -480,5 +479,3 @@ Matrix<M, Q, T> multiply(const Matrix<M, N, T> &m1, const Matrix<P, Q, T> &m2)
} // namespace matrix
} // namespace yage
-
-#endif
diff --git a/yage/physics/body.h b/yage/physics/body.h
index 62173987..8e3d5e07 100644
--- a/yage/physics/body.h
+++ b/yage/physics/body.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_PHYSICS_BODY_H
-#define YAGE_PHYSICS_BODY_H
+#pragma once
#include <math/matrix.h>
@@ -54,5 +53,3 @@ protected:
};
} // namespace yage
-
-#endif
diff --git a/yage/physics/collider.h b/yage/physics/collider.h
index 220c785d..fe59f44b 100644
--- a/yage/physics/collider.h
+++ b/yage/physics/collider.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_PHYSICS_COLLIDER_H
-#define YAGE_PHYSICS_COLLIDER_H
+#pragma once
#include <glm/glm.hpp>
@@ -39,5 +38,3 @@ public:
};
} // namespace yage
-
-#endif
diff --git a/yage/physics/collisionbody.h b/yage/physics/collisionbody.h
index c779feae..e1d9e6cf 100644
--- a/yage/physics/collisionbody.h
+++ b/yage/physics/collisionbody.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_COLLISION_BODY_H
-#define YAGE_COLLISION_BODY_H
+#pragma once
#include "body.h"
@@ -24,5 +23,3 @@ public:
};
} // yage
-
-#endif
diff --git a/yage/physics/particlebody.h b/yage/physics/particlebody.h
index d4380695..865e7f0b 100644
--- a/yage/physics/particlebody.h
+++ b/yage/physics/particlebody.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_PHYSICS_PARTICLE_BODY_H
-#define YAGE_PHYSICS_PARTICLE_BODY_H
+#pragma once
#include "body.h"
#include <math/matrix.h>
@@ -28,5 +27,3 @@ public:
};
} // namespace yage
-
-#endif
diff --git a/yage/physics/physics.h b/yage/physics/physics.h
index 64dcd95f..77823540 100644
--- a/yage/physics/physics.h
+++ b/yage/physics/physics.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_PHYSICS_H
-#define YAGE_PHYSICS_H
+#pragma once
#include "body.h"
#include "collider.h"
@@ -15,5 +14,3 @@
#include "particlebody.h"
#include "rectanglecollider.h"
#include "rigidbody.h"
-
-#endif
diff --git a/yage/physics/rectanglecollider.h b/yage/physics/rectanglecollider.h
index ba3bdead..c08e553b 100644
--- a/yage/physics/rectanglecollider.h
+++ b/yage/physics/rectanglecollider.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_RECTANGLE_COLLIDER_H
-#define YAGE_RECTANGLE_COLLIDER_H
+#pragma once
#include "collider.h"
@@ -26,5 +25,3 @@ public:
};
} // namespace yage
-
-#endif
diff --git a/yage/physics/rigidbody.h b/yage/physics/rigidbody.h
index dae9f8e5..686a13a6 100644
--- a/yage/physics/rigidbody.h
+++ b/yage/physics/rigidbody.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_RIGID_BODY_H
-#define YAGE_RIGID_BODY_H
+#pragma once
#include "particlebody.h"
@@ -24,5 +23,3 @@ public:
};
} // namespace yage
-
-#endif
diff --git a/yage/render/shader.h b/yage/render/shader.h
index 086b7b70..c958a500 100644
--- a/yage/render/shader.h
+++ b/yage/render/shader.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_RENDER_SHADER_H
-#define YAGE_RENDER_SHADER_H
+#pragma once
#include <glad/glad.h>
#include <glm/glm.hpp>
@@ -45,5 +44,3 @@ private:
};
} // namespace yage
-
-#endif
diff --git a/yage/render/spritebatch.h b/yage/render/spritebatch.h
index 022a51c8..abefa93d 100644
--- a/yage/render/spritebatch.h
+++ b/yage/render/spritebatch.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_SPRITE_BATCH_H
-#define YAGE_SPRITE_BATCH_H
+#pragma once
#include "../data/vertex.h"
@@ -92,5 +91,3 @@ private:
};
} // namespace yage
-
-#endif
diff --git a/yage/util/active.h b/yage/util/active.h
index d1d9ba4c..9b5cb4dd 100644
--- a/yage/util/active.h
+++ b/yage/util/active.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_UTIL_ACTIVE_H
-#define YAGE_UTIL_ACTIVE_H
+#pragma once
#include "syncqueue.h"
@@ -42,5 +41,3 @@ private:
};
} // namespace yage
-
-#endif
diff --git a/yage/util/noncopyable.h b/yage/util/noncopyable.h
index f1325ed1..a2bf5e75 100644
--- a/yage/util/noncopyable.h
+++ b/yage/util/noncopyable.h
@@ -1,5 +1,4 @@
-#ifndef YAGE_UTIL_NONCOPYABLE_H
-#define YAGE_UTIL_NONCOPYABLE_H
+#pragma once
namespace yage
{
@@ -15,5 +14,3 @@ protected:
};
} // namespace yage
-
-#endif
diff --git a/yage/util/syncqueue.h b/yage/util/syncqueue.h
index 7b5e5680..d47d10a0 100644
--- a/yage/util/syncqueue.h
+++ b/yage/util/syncqueue.h
@@ -6,8 +6,7 @@
* ----------------------------------------------------------------------------
*/
-#ifndef YAGE_UTIL_SYNCQUEUE_H
-#define YAGE_UTIL_SYNCQUEUE_H
+#pragma once
#include <condition_variable>
#include <mutex>
@@ -85,5 +84,3 @@ void SyncQueue<T>::push(T &&item)
}
} // namespace yage
-
-#endif