Browse Source

Engine: Change include guards to #pragma once

master
Riyyi 2 years ago
parent
commit
722bdd82b1
  1. 5
      src/inferno.h
  2. 5
      src/inferno/application.h
  3. 5
      src/inferno/assert.h
  4. 7
      src/inferno/component/cameracomponent.h
  5. 7
      src/inferno/component/luascriptcomponent.h
  6. 7
      src/inferno/component/nativescriptcomponent.h
  7. 7
      src/inferno/component/spritecomponent.h
  8. 9
      src/inferno/component/tagcomponent.h
  9. 7
      src/inferno/component/textareacomponent.h
  10. 7
      src/inferno/component/transformcomponent.h
  11. 5
      src/inferno/core.h
  12. 5
      src/inferno/entrypoint.h
  13. 7
      src/inferno/event/applicationevent.h
  14. 5
      src/inferno/event/event.h
  15. 7
      src/inferno/event/joystickevent.h
  16. 7
      src/inferno/event/keyevent.h
  17. 7
      src/inferno/event/mouseevent.h
  18. 7
      src/inferno/io/file.h
  19. 5
      src/inferno/io/gltffile.h
  20. 7
      src/inferno/io/input.h
  21. 7
      src/inferno/io/log.h
  22. 5
      src/inferno/keycodes.h
  23. 7
      src/inferno/render/buffer.h
  24. 8
      src/inferno/render/context.h
  25. 5
      src/inferno/render/font.h
  26. 15
      src/inferno/render/framebuffer.h
  27. 5
      src/inferno/render/gltf.h
  28. 5
      src/inferno/render/renderer.h
  29. 5
      src/inferno/render/renderer3d.h
  30. 5
      src/inferno/render/shader.h
  31. 5
      src/inferno/render/texture.h
  32. 7
      src/inferno/scene/scene.h
  33. 8
      src/inferno/script/cameracontroller.h
  34. 7
      src/inferno/script/luascript.h
  35. 7
      src/inferno/script/nativescript.h
  36. 7
      src/inferno/script/registration.h
  37. 5
      src/inferno/settings.h
  38. 6
      src/inferno/singleton.h
  39. 5
      src/inferno/system/camerasystem.h
  40. 5
      src/inferno/system/rendersystem.h
  41. 5
      src/inferno/system/scriptsystem.h
  42. 5
      src/inferno/system/textareasystem.h
  43. 7
      src/inferno/system/transformsystem.h
  44. 7
      src/inferno/time.h
  45. 9
      src/inferno/util/integer.h
  46. 5
      src/inferno/util/json.h
  47. 5
      src/inferno/util/string.h
  48. 7
      src/inferno/window.h

5
src/inferno.h

@ -1,5 +1,4 @@
#ifndef INFERNO_H
#define INFERNO_H
#pragma once
// For use by the game
@ -12,5 +11,3 @@
#include "inferno/io/log.h"
// -----------------------------------------
#endif // INFERNO_H

5
src/inferno/application.h

@ -1,5 +1,4 @@
#ifndef APPLICATION_H
#define APPLICATION_H
#pragma once
#include <memory> // std::unique_ptr, std::shared_ptr
@ -50,8 +49,6 @@ namespace Inferno {
} // namespace Inferno
#endif // APPLICATION_H
// C++17 features used:
// - std::string_view -> log.h
// - std::shared_ptr array management -> renderer.h

5
src/inferno/assert.h

@ -1,5 +1,4 @@
#ifndef ASSERT_H
#define ASSERT_H
#pragma once
#include <csignal> // raise
#include <cstdint> // uint32_t
@ -111,6 +110,4 @@ inline void __crash()
}
#endif // ASSERT_H
// https://github.com/scottt/debugbreak

7
src/inferno/component/cameracomponent.h

@ -1,5 +1,4 @@
#ifndef CAMERA_COMPONENT_H
#define CAMERA_COMPONENT_H
#pragma once
#include "glm/ext/matrix_float4x4.hpp" // glm::mat4
#include "glm/ext/vector_float3.hpp" // glm::vec3
@ -27,6 +26,4 @@ namespace Inferno {
glm::mat4 projection { 1.0f }; // Identity matrix
};
}
#endif // CAMERA_COMPONENT_H
} // namespace Inferno

7
src/inferno/component/luascriptcomponent.h

@ -1,5 +1,4 @@
#ifndef LUA_SCRIPT_COMPONENT_H
#define LUA_SCRIPT_COMPONENT_H
#pragma once
#include <string> // std::string
#include <utility> // std::move
@ -17,6 +16,4 @@ namespace Inferno {
LuaScriptComponent(const std::string& path)
: path(std::move(path)) {}
};
}
#endif // LUA_SCRIPT_COMPONENT_H
} // namespace Inferno

7
src/inferno/component/nativescriptcomponent.h

@ -1,5 +1,4 @@
#ifndef NATIVE_SCRIPT_COMPONENT_H
#define NATIVE_SCRIPT_COMPONENT_H
#pragma once
#include "inferno/assert.h"
#include "inferno/script/nativescript.h"
@ -28,6 +27,4 @@ namespace Inferno {
}
};
}
#endif // NATIVE_SCRIPT_COMPONENT_H
} // namespace Inferno

7
src/inferno/component/spritecomponent.h

@ -1,5 +1,4 @@
#ifndef SPRITE_COMPONENT_H
#define SPRITE_COMPONENT_H
#pragma once
#include <memory> // std::shared_ptr
@ -14,6 +13,4 @@ namespace Inferno {
std::shared_ptr<Texture> texture;
};
}
#endif // SPRITE_COMPONENT_H
} // namespace Inferno

9
src/inferno/component/tagcomponent.h

@ -1,7 +1,6 @@
#ifndef TAG_COMPONENT_H
#define TAG_COMPONENT_H
#pragma once
#include <string> // std::string
#include <string> // std::string
#include <utility> // std::move
namespace Inferno {
@ -16,6 +15,4 @@ namespace Inferno {
operator const std::string&() const { return tag; }
};
}
#endif // TAG_COMPONENT_H
} // namespace Inferno

7
src/inferno/component/textareacomponent.h

@ -1,5 +1,4 @@
#ifndef TEXTAREA_COMPONENT_H
#define TEXTAREA_COMPONENT_H
#pragma once
#include <cstdint> // uint32_t
#include <string> // std::string
@ -27,6 +26,4 @@ namespace Inferno {
// float dropShadow { 0.0f };
};
}
#endif // TEXTAREA_COMPONENT_H
} // namespace Inferno

7
src/inferno/component/transformcomponent.h

@ -1,5 +1,4 @@
#ifndef TRANSFORM_COMPONENT_H
#define TRANSFORM_COMPONENT_H
#pragma once
#include "glm/ext/matrix_float4x4.hpp" // glm::mat4
#include "glm/ext/vector_float3.hpp" // glm::vec3
@ -22,6 +21,4 @@ namespace Inferno {
const LogStream& operator<<(const LogStream& stream, const glm::vec4& value);
const LogStream& operator<<(const LogStream& stream, const glm::mat4& value);
const LogStream& operator<<(const LogStream& stream, const TransformComponent& value);
}
#endif // TRANSFORM_COMPONENT_H
} // namespace Inferno

5
src/inferno/core.h

@ -1,5 +1,4 @@
#ifndef CORE_H
#define CORE_H
#pragma once
#include <functional> // std::bind, std::placeholders
@ -20,5 +19,3 @@
#elif defined(_MSC_VER)
#define MSVC
#endif
#endif // CORE_H

5
src/inferno/entrypoint.h

@ -4,8 +4,7 @@
* `g_` for global variables.
*/
#ifndef ENTRYPOINT_H
#define ENTRYPOINT_H
#pragma once
#include "inferno/application.h"
@ -23,5 +22,3 @@ int main(int argc, char* argv[])
return status;
}
#endif // ENTRYPOINT_H

7
src/inferno/event/applicationevent.h

@ -1,5 +1,4 @@
#ifndef APPLICATIONEVENT_H
#define APPLICATIONEVENT_H
#pragma once
#include <sstream> // std::stringstream
@ -37,6 +36,4 @@ namespace Inferno {
int m_width;
int m_height;
};
}
#endif // APPLICATIONEVENT_H
} // namespace Inferno

5
src/inferno/event/event.h

@ -1,5 +1,4 @@
#ifndef EVENT_H
#define EVENT_H
#pragma once
#include <ostream> // std::ostream
@ -110,5 +109,3 @@ inline std::ostream& operator<<(std::ostream& os, const Event& e)
}
} // namespace Inferno
#endif // EVENT_H

7
src/inferno/event/joystickevent.h

@ -1,5 +1,4 @@
#ifndef JOYSTICKEVENT_H
#define JOYSTICKEVENT_H
#pragma once
#include <sstream> // std::stringstream
@ -51,6 +50,4 @@ namespace Inferno {
EVENT_CLASS_TYPE(JoystickDisconnected)
};
}
#endif // JOYSTICKEVENT_H
} // namespace Inferno

7
src/inferno/event/keyevent.h

@ -1,5 +1,4 @@
#ifndef KEYEVENT_H
#define KEYEVENT_H
#pragma once
#include <sstream> // std::stringstream
@ -66,6 +65,4 @@ namespace Inferno {
EVENT_CLASS_TYPE(KeyPress)
};
}
#endif // KEYEVENT_H
} // namespace Inferno

7
src/inferno/event/mouseevent.h

@ -1,5 +1,4 @@
#ifndef MOUSEEVENT_H
#define MOUSEEVENT_H
#pragma once
#include <sstream> // std::stringstream
@ -101,6 +100,4 @@ namespace Inferno {
float m_yOffset;
};
}
#endif // MOUSEEVENT_H
} // namespace Inferno

7
src/inferno/io/file.h

@ -1,5 +1,4 @@
#ifndef FILE_H
#define FILE_H
#pragma once
#include <fstream> // std::ifstream, std::ofstream
#include <iomanip> // std::setfill, std::setw
@ -60,6 +59,4 @@ namespace Inferno {
}
};
}
#endif // FILE_H
} // namespace Inferno

5
src/inferno/io/gltffile.h

@ -1,5 +1,4 @@
#ifndef GLTF_FILE_H
#define GLTF_FILE_H
#pragma once
#include <cstdint> // uint32_t
#include <memory> // std::shared_ptr
@ -18,5 +17,3 @@ namespace Inferno {
};
} // namespace Inferno
#endif // GLTF_FILE_H

7
src/inferno/io/input.h

@ -1,5 +1,4 @@
#ifndef INPUT_H
#define INPUT_H
#pragma once
#include <utility> // std::pair
@ -34,6 +33,4 @@ namespace Inferno {
static float m_yOffset;
};
}
#endif // INPUT_H
} // namespace Inferno

7
src/inferno/io/log.h

@ -1,5 +1,4 @@
#ifndef LOG_H
#define LOG_H
#pragma once
#include <cstddef> // size_t
#include <cstring> // memcpy
@ -222,6 +221,4 @@ namespace Inferno {
StringLogStream str(std::string* fill);
}
#endif // LOG_H
} // namespace Inferno

5
src/inferno/keycodes.h

@ -1,5 +1,4 @@
#ifndef INPUTCODES_H
#define INPUTCODES_H
#pragma once
#define MAP_KEY(key) #key, key
@ -8,5 +7,3 @@ namespace Inferno {
int keyCode(const char* name);
}
#endif // INPUTCODES_H

7
src/inferno/render/buffer.h

@ -1,5 +1,4 @@
#ifndef BUFFER_H
#define BUFFER_H
#pragma once
#include <cstddef> // size_t
#include <cstdint> // int32_t, uint32_t
@ -143,6 +142,4 @@ namespace Inferno {
std::vector<std::shared_ptr<VertexBuffer>> m_vertexBuffers;
std::shared_ptr<IndexBuffer> m_indexBuffer;
};
}
#endif // BUFFER_H
} // namespace Inferno

8
src/inferno/render/context.h

@ -1,5 +1,4 @@
#ifndef CONTEXT_H
#define CONTEXT_H
#pragma once
struct GLFWwindow;
@ -19,7 +18,4 @@ namespace Inferno {
GLFWwindow* m_window { nullptr };
};
}
#endif // CONTEXT_H
} // namespace Inferno

5
src/inferno/render/font.h

@ -1,5 +1,4 @@
#ifndef FONT_H
#define FONT_H
#pragma once
#include <cstdint> // uint32_t
#include <memory> // std::shared_ptr
@ -75,8 +74,6 @@ namespace Inferno {
} // namespace Inferno
#endif // FONT_H
// FontManager fm;
// Font f = fm.load("path/to/font");
// Font f2("path/to/font");

15
src/inferno/render/framebuffer.h

@ -1,14 +1,11 @@
#ifndef FRAMEBUFFER_H
#define FRAMEBUFFER_H
#pragma once
namespace Inferno {
class Framebuffer {
public:
Framebuffer();
virtual ~Framebuffer();
};
class Framebuffer {
public:
Framebuffer();
virtual ~Framebuffer();
};
} // namespace Inferno
#endif // FRAMEBUFFER_H

5
src/inferno/render/gltf.h

@ -1,5 +1,4 @@
#ifndef GLTF_H
#define GLTF_H
#pragma once
#if 0
#include <cstdint> // uint32_t
@ -169,5 +168,3 @@ namespace Inferno {
} // namespace Inferno
#endif
#endif // GLTF_H

5
src/inferno/render/renderer.h

@ -1,5 +1,4 @@
#ifndef RENDERER_H
#define RENDERER_H
#pragma once
#include <cstdint> // int32_t, uint32_t
#include <memory> // std::shared_ptr, std::unique_ptr, std::make_shared, std::make_unique
@ -161,5 +160,3 @@ namespace Inferno {
};
} // namespace Inferno
#endif // RENDERER_H

5
src/inferno/render/renderer3d.h

@ -19,8 +19,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef RENDERER_3D_H
#define RENDERER_3D_H
#pragma once
namespace Inferno {
@ -32,8 +31,6 @@ public:
} // namespace Inferno
#endif // RENDERER_3D_H
// - what data do you need?
// - gltf
// - how are we going to batch

5
src/inferno/render/shader.h

@ -1,5 +1,4 @@
#ifndef SHADER_H
#define SHADER_H
#pragma once
#include <cstdint> // int32_t, uint32_t
#include <memory> // std::shared_ptr
@ -70,5 +69,3 @@ namespace Inferno {
};
} // namespace Inferno
#endif // SHADER_H

5
src/inferno/render/texture.h

@ -1,5 +1,4 @@
#ifndef TEXTURE_H
#define TEXTURE_H
#pragma once
#include <cstdint> // uint32_t
#include <memory> // std::shared_ptr
@ -57,5 +56,3 @@ namespace Inferno {
};
} // namespace Inferno
#endif // TEXTURE_H

7
src/inferno/scene/scene.h

@ -1,5 +1,4 @@
#ifndef SCENE_H
#define SCENE_H
#pragma once
#include <cstdint> // uint32_t
#include <memory> // std::shared_ptr
@ -79,9 +78,7 @@ namespace Inferno {
const LogStream& operator<<(const LogStream& stream, entt::entity handle);
}
#endif // SCENE_H
} // namespace Inferno
// @Todo
// - Convert registry to stack variable

8
src/inferno/script/cameracontroller.h

@ -1,5 +1,4 @@
#ifndef CAMERA_CONTROLLER_H
#define CAMERA_CONTROLLER_H
#pragma once
#include "inferno/component/cameracomponent.h"
#include "inferno/script/nativescript.h"
@ -15,7 +14,6 @@ namespace Inferno {
class CameraController final : public NativeScript {
public:
virtual void update(float deltaTime) override
{
m_camera = &getComponent<CameraComponent>();
@ -35,6 +33,4 @@ namespace Inferno {
CameraComponent* m_camera { nullptr };
};
}
#endif // CAMERA_CONTROLLER_H
} // namespace Inferno

7
src/inferno/script/luascript.h

@ -1,5 +1,4 @@
#ifndef LUA_SCRIPT_H
#define LUA_SCRIPT_H
#pragma once
#include <cstdint> // uint32_t
#include <string> // std::string
@ -52,6 +51,4 @@ namespace Inferno {
friend class ScriptSystem;
};
}
#endif // LUA_SCRIPT_H
} // namespace Inferno

7
src/inferno/script/nativescript.h

@ -1,5 +1,4 @@
#ifndef NATIVE_SCRIPT_H
#define NATIVE_SCRIPT_H
#pragma once
#include "inferno/scene/scene.h"
@ -31,6 +30,4 @@ namespace Inferno {
friend class ScriptSystem;
};
}
#endif // NATIVE_SCRIPT_H
} // namespace Inferno

7
src/inferno/script/registration.h

@ -1,5 +1,4 @@
#ifndef REGISTRATION_H
#define REGISTRATION_H
#pragma once
#include "sol/overload.hpp" // sol::overload
#include "sol/state_view.hpp" // sol::state_view
@ -66,6 +65,4 @@ namespace Inferno {
}
};
}
#endif // REGISTRATION_H
} // namespace Inferno

5
src/inferno/settings.h

@ -1,5 +1,4 @@
#ifndef SETTINGS_H
#define SETTINGS_H
#pragma once
#include "ruc/json/json.h"
@ -37,5 +36,3 @@ namespace Inferno {
void fromJson(const ruc::Json& object, WindowProperties& window);
} // namespace Inferno
#endif // SETTINGS_H

6
src/inferno/singleton.h

@ -1,5 +1,4 @@
#ifndef SINGLETON_H
#define SINGLETON_H
#pragma once
#include "inferno/assert.h"
@ -50,6 +49,3 @@ namespace Inferno {
T* Singleton<T>::s_instance = nullptr;
} // namespace Inferno
#endif // SINGLETON_H

5
src/inferno/system/camerasystem.h

@ -1,5 +1,4 @@
#ifndef CAMERA_SYSTEM_H
#define CAMERA_SYSTEM_H
#pragma once
#include <memory> //std::shared_ptr
@ -34,5 +33,3 @@ namespace Inferno {
};
} // namespace Inferno
#endif // CAMERA_SYSTEM_H

5
src/inferno/system/rendersystem.h

@ -1,5 +1,4 @@
#ifndef RENDER_SYSTEM_H
#define RENDER_SYSTEM_H
#pragma once
#include <memory> //std::shared_ptr
@ -24,5 +23,3 @@ namespace Inferno {
};
} // namespace Inferno
#endif // RENDER_SYSTEM_H

5
src/inferno/system/scriptsystem.h

@ -1,5 +1,4 @@
#ifndef SCRIPT_SYSTEM_H
#define SCRIPT_SYSTEM_H
#pragma once
#include <cstdint> // uint32_t
@ -30,5 +29,3 @@ namespace Inferno {
};
} // namespace Inferno
#endif // SCRIPT_SYSTEM_H

5
src/inferno/system/textareasystem.h

@ -1,5 +1,4 @@
#ifndef TEXTAREA_H
#define TEXTAREA_H
#pragma once
#include <cstdint> // std::uint32_t
#include <memory> // std::shared_ptr
@ -34,5 +33,3 @@ namespace Inferno {
};
} // namespace Inferno
#endif // TEXTAREA_H

7
src/inferno/system/transformsystem.h

@ -1,7 +1,6 @@
#ifndef TRANSFORM_SYSTEM_H
#define TRANSFORM_SYSTEM_H
#pragma once
#include <memory> //std::shared_ptr
#include <memory> // std::shared_ptr
#include "entt/entity/registry.hpp" // entt::entity, entt::registry
#include "ruc/singleton.h"
@ -22,5 +21,3 @@ namespace Inferno {
};
} // namespace Inferno
#endif // TRANSFORM_SYSTEM_H

7
src/inferno/time.h

@ -1,5 +1,4 @@
#ifndef TIME_H
#define TIME_H
#pragma once
namespace Inferno {
@ -8,6 +7,4 @@ namespace Inferno {
static float time();
};
}
#endif // TIME_H
} // namespace Inferno

9
src/inferno/util/integer.h

@ -1,8 +1,7 @@
#ifndef INTEGER_UTIL_H
#define INTEGER_UTIL_H
#pragma once
#include <limits> // std::numeric_limits
#include <string> // std::string, std::stoul
#include <limits> // std::numeric_limits
#include <string> // std::string, std::stoul
#include "inferno/assert.h"
@ -23,5 +22,3 @@ namespace std {
}
} // namespace std
#endif // INTEGER_UTIL_H

5
src/inferno/util/json.h

@ -1,5 +1,4 @@
#ifndef JSON_UTIL_H
#define JSON_UTIL_H
#pragma once
#if 0
#include <cstdint> // int32_t, uint32_t
@ -249,8 +248,6 @@ namespace Inferno {
} // namespace Inferno
#endif
#endif // JSON_UTIL_H
// JSON syntax:
// [ ] = std::map, array (ordered)
// { } = std::vector, object (unordered)

5
src/inferno/util/string.h

@ -1,5 +1,4 @@
#ifndef STRING_UTIL_H
#define STRING_UTIL_H
#pragma once
#include <iomanip> // std::setfill, std::setw
#include <sstream> // std::stringstream
@ -18,5 +17,3 @@ namespace Inferno {
}
} // namespace Inferno
#endif // STRING_UTIL_H

7
src/inferno/window.h

@ -1,5 +1,4 @@
#ifndef WINDOW_H
#define WINDOW_H
#pragma once
#include <cstdint> // uint32_t
#include <functional> // std::function
@ -61,6 +60,4 @@ namespace Inferno {
static unsigned char s_windowCount;
};
}
#endif // WINDOW_H
} // namespace Inferno

Loading…
Cancel
Save