From ce72a4975b76c1f244221d7d11e6a4eebc98b99b Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sat, 19 May 2018 20:23:53 +0100 Subject: Using pragma instead of gards The reason for this is that it reduces clashes between names. --- yage/core/camera.h | 5 +---- yage/core/core.h | 2 ++ yage/core/exception.h | 5 +---- yage/core/imageloader.h | 5 +---- yage/core/iomanager.h | 5 +---- yage/core/resourcemanager.h | 13 +------------ yage/core/texturecache.h | 5 +---- yage/core/window.h | 5 +---- yage/data/cube.h | 2 ++ yage/data/input.h | 5 +---- yage/data/texture.h | 5 +---- yage/data/vertex.h | 5 +---- yage/entity/entitymanager.h | 5 +---- yage/entity/space.h | 5 +---- yage/entity/system.h | 5 +---- yage/math/matrix.h | 5 +---- yage/physics/body.h | 5 +---- yage/physics/collider.h | 5 +---- yage/physics/collisionbody.h | 5 +---- yage/physics/particlebody.h | 5 +---- yage/physics/physics.h | 5 +---- yage/physics/rectanglecollider.h | 5 +---- yage/physics/rigidbody.h | 5 +---- yage/render/shader.h | 5 +---- yage/render/spritebatch.h | 5 +---- yage/util/active.h | 5 +---- yage/util/noncopyable.h | 5 +---- yage/util/syncqueue.h | 5 +---- 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 @@ -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 #include @@ -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 @@ -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 #include @@ -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 - * 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 @@ -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 @@ -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 @@ -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 @@ -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 #include @@ -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 @@ -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 #include @@ -480,5 +479,3 @@ Matrix multiply(const Matrix &m1, const Matrix &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 @@ -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 @@ -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 @@ -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 #include @@ -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 #include @@ -85,5 +84,3 @@ void SyncQueue::push(T &&item) } } // namespace yage - -#endif -- cgit