Replace ifdef guards with pragma once

This commit is contained in:
2022-07-07 23:09:30 -07:00
parent c7f9277780
commit 44055d1e6a
45 changed files with 55 additions and 198 deletions

View File

@@ -52,6 +52,7 @@ class KRAudioManager;
class KRPresentationThread; class KRPresentationThread;
class KRStreamerThread; class KRStreamerThread;
class KRDeviceManager; class KRDeviceManager;
class KRSurfaceManager;
class KRContext { class KRContext {
public: public:

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRMESHCUBE_H #pragma once
#define KRMESHCUBE_H
#include "KRMesh.h" #include "KRMesh.h"
@@ -41,4 +40,3 @@ public:
private: private:
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRMESHMANAGER_H #pragma once
#define KRMESHMANAGER_H
#include "KREngine-common.h" #include "KREngine-common.h"
@@ -220,5 +219,3 @@ private:
void primeVBO(KRVBOData *vbo_data); void primeVBO(KRVBOData *vbo_data);
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRMESHQUAD_H #pragma once
#define KRMESHQUAD_H
#include "KRMesh.h" #include "KRMesh.h"
@@ -40,5 +39,3 @@ public:
virtual ~KRMeshQuad(); virtual ~KRMeshQuad();
private: private:
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRMESHSPHERE_H #pragma once
#define KRMESHSPHERE_H
#include "KRMesh.h" #include "KRMesh.h"
@@ -40,5 +39,3 @@ public:
virtual ~KRMeshSphere(); virtual ~KRMeshSphere();
private: private:
}; };
#endif

View File

@@ -29,10 +29,9 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#include "KREngine-common.h" #pragma once
#ifndef KRMODEL_H #include "KREngine-common.h"
#define KRMODEL_H
#include "KRMesh.h" #include "KRMesh.h"
#include "KRModel.h" #include "KRModel.h"
@@ -93,6 +92,3 @@ private:
Vector3 m_rim_color; Vector3 m_rim_color;
float m_rim_power; float m_rim_power;
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRNODE_H #pragma once
#define KRNODE_H
#include "KRResource.h" #include "KRResource.h"
#include "KRViewport.h" #include "KRViewport.h"
@@ -345,6 +344,3 @@ public:
return NULL; return NULL;
} }
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KROCTREE_H #pragma once
#define KROCTREE_H
#include "KREngine-common.h" #include "KREngine-common.h"
#include "KROctreeNode.h" #include "KROctreeNode.h"
@@ -59,5 +58,3 @@ private:
void shrink(); void shrink();
}; };
#endif /* defined(KROCTREE_H) */

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KROCTREENODE_H #pragma once
#define KROCTREENODE_H
#include "KREngine-common.h" #include "KREngine-common.h"
#include "hitinfo.h" #include "hitinfo.h"
@@ -83,6 +82,3 @@ private:
std::set<KRNode *>m_sceneNodes; std::set<KRNode *>m_sceneNodes;
}; };
#endif /* defined(KROCTREENODE_H) */

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRPARTICLESYSTEM_H #pragma once
#define KRPARTICLESYSTEM_H
#include "KRNode.h" #include "KRNode.h"
@@ -51,5 +50,3 @@ protected:
private: private:
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRPARTICLESYSTEMNEWTONIAN_H #pragma once
#define KRPARTICLESYSTEMNEWTONIAN_H
#include "KRParticleSystem.h" #include "KRParticleSystem.h"
@@ -54,5 +53,3 @@ public:
private: private:
float m_particlesAbsoluteTime; float m_particlesAbsoluteTime;
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRPOINTLIGHT_H #pragma once
#define KRPOINTLIGHT_H
#include "KRLight.h" #include "KRLight.h"
@@ -52,5 +51,3 @@ private:
float *m_sphereVertices; float *m_sphereVertices;
int m_cVertices; int m_cVertices;
}; };
#endif

View File

@@ -29,6 +29,8 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#pragma once
#include "KREngine-common.h" #include "KREngine-common.h"
#include "KRContext.h" #include "KRContext.h"
@@ -38,8 +40,6 @@ using std::vector;
#include "KRPipeline.h" #include "KRPipeline.h"
#ifndef KRPRESENTATIONTHREAD_H
#define KRPRESENTATIONTHREAD_H
class KRPresentationThread : KRContextObject class KRPresentationThread : KRContextObject
{ {
@@ -72,5 +72,3 @@ private:
void run(); void run();
void renderFrame(); void renderFrame();
}; };
#endif // KRPRESENTATIONTHREAD_H

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRRENDERPASS_H #pragma once
#define KRRENDERPASS_H
#include "KREngine-common.h" #include "KREngine-common.h"
#include "KRContext.h" #include "KRContext.h"
@@ -58,6 +57,3 @@ public:
// private: // private:
VkRenderPass m_renderPass; VkRenderPass m_renderPass;
}; };
#endif // KRRENDERPASS_H

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRRENDERSETTINGS_H #pragma once
#define KRRENDERSETTINGS_H
#include "KREngine-common.h" #include "KREngine-common.h"
@@ -135,5 +134,3 @@ private:
float m_lodBias; float m_lodBias;
bool m_enable_realtime_occlusion; bool m_enable_realtime_occlusion;
}; };
#endif

View File

@@ -28,8 +28,8 @@
// authors and should not be interpreted as representing official policies, either expressed // authors and should not be interpreted as representing official policies, either expressed
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRRESOURCE_BLEND_H
#define KRRESOURCE_BLEND_H #pragma once
class KRBlendFile { class KRBlendFile {
public: public:
@@ -66,7 +66,3 @@ private:
std::vector<Block> m_blocks; std::vector<Block> m_blocks;
}; };
#endif

View File

@@ -29,12 +29,12 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#pragma once
#include "KREngine-common.h" #include "KREngine-common.h"
#include "KRContextObject.h" #include "KRContextObject.h"
#include "KRDataBlock.h" #include "KRDataBlock.h"
#ifndef KRRESOURCE_H
#define KRRESOURCE_H
class KRBundle; class KRBundle;
class KRScene; class KRScene;
class KRMesh; class KRMesh;
@@ -69,5 +69,3 @@ private:
}; };
#endif

View File

@@ -29,8 +29,8 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRRESOURCEMANAGER_H #pragma once
#define KRRESOURCEMANAGER_H
#include "KREngine-common.h" #include "KREngine-common.h"
#include "KRResource.h" #include "KRResource.h"
@@ -45,5 +45,3 @@ public:
virtual KRResource* loadResource(const std::string &name, const std::string &extension, KRDataBlock *data) = 0; virtual KRResource* loadResource(const std::string &name, const std::string &extension, KRDataBlock *data) = 0;
virtual KRResource* getResource(const std::string &name, const std::string &extension) = 0; virtual KRResource* getResource(const std::string &name, const std::string &extension) = 0;
}; };
#endif // KRRESOURCEMANAGER_H

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRREVERB_ZONE_H #pragma once
#define KRREVERB_ZONE_H
#include "KRResource.h" #include "KRResource.h"
#include "KRNode.h" #include "KRNode.h"
@@ -72,6 +71,3 @@ private:
std::string m_reverb; std::string m_reverb;
float m_reverb_gain; float m_reverb_gain;
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRSCENE_H #pragma once
#define KRSCENE_H
#include "KREngine-common.h" #include "KREngine-common.h"
@@ -123,7 +122,3 @@ public:
return NULL; return NULL;
} }
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRENGINE_KRSCENEMANAGER_H #pragma once
#define KRENGINE_KRSCENEMANAGER_H
#include "KREngine-common.h" #include "KREngine-common.h"
@@ -66,5 +65,3 @@ private:
std::mutex m_mutex; std::mutex m_mutex;
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRSHADER_H #pragma once
#define KRSHADER_H
#include "KREngine-common.h" #include "KREngine-common.h"
#include "KRContextObject.h" #include "KRContextObject.h"
@@ -66,5 +65,3 @@ private:
void parseReflection(); void parseReflection();
void freeReflection(); void freeReflection();
}; };
#endif /* defined(KRSHADER_H) */

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRSHADER_MANAGER_H #pragma once
#define KRSHADER_MANAGER_H
#include "KREngine-common.h" #include "KREngine-common.h"
@@ -65,5 +64,3 @@ private:
unordered_map<std::string, unordered_map<std::string, KRShader *> > m_shaders; unordered_map<std::string, unordered_map<std::string, KRShader *> > m_shaders;
bool m_initializedGlslang; bool m_initializedGlslang;
}; };
#endif /* defined(KRUNKNOWN_MANAGER_H) */

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRSOURCE_H #pragma once
#define KRSOURCE_H
#include "KREngine-common.h" #include "KREngine-common.h"
#include "KRContextObject.h" #include "KRContextObject.h"
@@ -55,5 +54,3 @@ private:
std::string m_extension; std::string m_extension;
KRDataBlock *m_pData; KRDataBlock *m_pData;
}; };
#endif /* defined(KRSOURCE_H) */

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRSOURCE_MANAGER_H #pragma once
#define KRSOURCE_MANAGER_H
#include "KREngine-common.h" #include "KREngine-common.h"
@@ -59,5 +58,3 @@ public:
private: private:
unordered_map<std::string, unordered_map<std::string, KRSource *> > m_sources; unordered_map<std::string, unordered_map<std::string, KRSource *> > m_sources;
}; };
#endif /* defined(KRUNKNOWN_MANAGER_H) */

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KREngine_KRSpotLight_h #pragma once
#define KREngine_KRSpotLight_h
#include "KRLight.h" #include "KRLight.h"
@@ -55,6 +54,3 @@ private:
float m_innerAngle; // Inner angle of the cone, in radians. Inside this radius, the light will be at full brightness float m_innerAngle; // Inner angle of the cone, in radians. Inside this radius, the light will be at full brightness
float m_outerAngle; // Outer angle of the cone, in radians. Outside this radius, the light will be completely attenuated float m_outerAngle; // Outer angle of the cone, in radians. Outside this radius, the light will be completely attenuated
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRSPRITE_H #pragma once
#define KRSPRITE_H
#include "KRResource.h" #include "KRResource.h"
#include "KRNode.h" #include "KRNode.h"
@@ -61,5 +60,3 @@ protected:
KRTexture *m_pSpriteTexture; KRTexture *m_pSpriteTexture;
float m_spriteAlpha; float m_spriteAlpha;
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRSTREAMERTHREAD_H #pragma once
#define KRSTREAMERTHREAD_H
#include "KREngine-common.h" #include "KREngine-common.h"
@@ -57,5 +56,3 @@ private:
void run(); void run();
}; };
#endif // KRSTREAMERTHREAD_H

View File

@@ -29,12 +29,11 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#pragma once
#include "KREngine-common.h" #include "KREngine-common.h"
#include "KRContext.h" #include "KRContext.h"
#ifndef KRSURFACE_H
#define KRSURFACE_H
class KRDevice; class KRDevice;
class KRRenderPass; class KRRenderPass;
class KRSwapchain; class KRSwapchain;
@@ -87,5 +86,3 @@ private:
void destroySwapChain(); void destroySwapChain();
KrResult createSwapChain(); KrResult createSwapChain();
}; };
#endif // KRSURFACE_H

View File

@@ -29,14 +29,13 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#pragma once
#include "KREngine-common.h" #include "KREngine-common.h"
#include "KRContext.h" #include "KRContext.h"
#include "KRSurface.h" #include "KRSurface.h"
#ifndef KRSURFACEMANAGER_H
#define KRSURFACEMANAGER_H
class KRSurfaceManager : KRContextObject class KRSurfaceManager : KRContextObject
{ {
public: public:
@@ -55,5 +54,3 @@ private:
void destroySurfaces(); void destroySurfaces();
}; };
#endif // KRSURFACEMANAGER_H

View File

@@ -29,10 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#pragma once
#ifndef KRSWAPCHAIN_H
#define KRSWAPCHAIN_H
#include "KREngine-common.h" #include "KREngine-common.h"
#include "KRContext.h" #include "KRContext.h"
@@ -62,5 +59,3 @@ public:
std::vector<VkFramebuffer> m_framebuffers; std::vector<VkFramebuffer> m_framebuffers;
}; };
#endif KRSWAPCHAIN_H

View File

@@ -29,10 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#pragma once
#ifndef KRTEXTURE_H
#define KRTEXTURE_H
#include "KREngine-common.h" #include "KREngine-common.h"
#include "KRContextObject.h" #include "KRContextObject.h"
@@ -113,6 +110,3 @@ private:
std::atomic<long> m_textureMemUsed; std::atomic<long> m_textureMemUsed;
std::atomic<long> m_newTextureMemUsed; std::atomic<long> m_newTextureMemUsed;
}; };
#endif /* defined(KRTEXTURE_H) */

View File

@@ -29,14 +29,13 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#pragma once
#include "KREngine-common.h" #include "KREngine-common.h"
#include "KRDataBlock.h" #include "KRDataBlock.h"
using std::list; using std::list;
#ifndef KRTEXTURE2D_H
#define KRTEXTURE2D_H
#include "KRTexture.h" #include "KRTexture.h"
class KRTexture2D : public KRTexture { class KRTexture2D : public KRTexture {
@@ -54,5 +53,3 @@ protected:
virtual bool createGLTexture(int lod_max_dim); virtual bool createGLTexture(int lod_max_dim);
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRTEXTUREANIMATED_H #pragma once
#define KRTEXTUREANIMATED_H
#include "KRTexture.h" #include "KRTexture.h"
#include "KRTexture2D.h" #include "KRTexture2D.h"
@@ -62,6 +61,3 @@ private:
std::string textureNameForFrame(int frame); std::string textureNameForFrame(int frame);
KRTexture2D *textureForFrame(int frame); KRTexture2D *textureForFrame(int frame);
}; };
#endif /* defined(KRTEXTURECUBE_H) */

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRTEXTURECUBE_H #pragma once
#define KRTEXTURECUBE_H
#include "KRTexture.h" #include "KRTexture.h"
@@ -71,6 +70,3 @@ private:
KRTexture2D *m_textures[6]; KRTexture2D *m_textures[6];
}; };
#endif /* defined(KRTEXTURECUBE_H) */

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRTEXTUREKTX_H #pragma once
#define KRTEXTUREKTX_H
#include "KRTexture2D.h" #include "KRTexture2D.h"
@@ -70,5 +69,3 @@ protected:
KTXHeader m_header; KTXHeader m_header;
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRTEXTUREMANAGER_H #pragma once
#define KRTEXTUREMANAGER_H
#include "KREngine-common.h" #include "KREngine-common.h"
@@ -112,5 +111,3 @@ private:
std::mutex m_streamerFenceMutex; std::mutex m_streamerFenceMutex;
}; };
#endif

View File

@@ -28,8 +28,8 @@
// authors and should not be interpreted as representing official policies, either expressed // authors and should not be interpreted as representing official policies, either expressed
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRTEXTUREPVR_H
#define KRTEXTUREPVR_H #pragma once
#include "KRTexture2D.h" #include "KRTexture2D.h"
@@ -53,5 +53,3 @@ protected:
std::list<KRDataBlock *> m_blocks; std::list<KRDataBlock *> m_blocks;
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRTEXTURETGA_H #pragma once
#define KRTEXTURETGA_H
#include "KRTexture2D.h" #include "KRTexture2D.h"
@@ -51,5 +50,3 @@ public:
private: private:
long m_imageSize; long m_imageSize;
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRUNKNOWN_H #pragma once
#define KRUNKNOWN_H
#include "KREngine-common.h" #include "KREngine-common.h"
#include "KRContextObject.h" #include "KRContextObject.h"
@@ -55,5 +54,3 @@ private:
std::string m_extension; std::string m_extension;
KRDataBlock *m_pData; KRDataBlock *m_pData;
}; };
#endif /* defined(KRUNKNOWN_H) */

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRUNKNOWN_MANAGER_H #pragma once
#define KRUNKNOWN_MANAGER_H
#include "KREngine-common.h" #include "KREngine-common.h"
@@ -61,5 +60,3 @@ public:
private: private:
unordered_map<std::string, unordered_map<std::string, KRUnknown *> > m_unknowns; unordered_map<std::string, unordered_map<std::string, KRUnknown *> > m_unknowns;
}; };
#endif /* defined(KRUNKNOWN_MANAGER_H) */

View File

@@ -28,8 +28,8 @@
// authors and should not be interpreted as representing official policies, either expressed // authors and should not be interpreted as representing official policies, either expressed
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRENGINE_KRVIEWPORT_H
#define KRENGINE_KRVIEWPORT_H #pragma once
#include "KREngine-common.h" #include "KREngine-common.h"
@@ -90,8 +90,4 @@ private:
void calculateDerivedValues(); void calculateDerivedValues();
unordered_map<AABB, int> m_visibleBounds; // AABB's that output fragments in the last frame unordered_map<AABB, int> m_visibleBounds; // AABB's that output fragments in the last frame
}; };
#endif

View File

@@ -29,8 +29,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRAKEN_CONTEXT_H #pragma once
#define KRAKEN_CONTEXT_H
namespace kraken { namespace kraken {
@@ -47,5 +46,3 @@ private:
}; };
} // namepsace kraken } // namepsace kraken
#endif // KRAKEN_CONTEXT_H

View File

@@ -28,8 +28,7 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef KRAKEN_H #pragma once
#define KRAKEN_H
#include "context.h" #include "context.h"
#include "hydra.h" #include "hydra.h"
@@ -435,5 +434,3 @@ KrResult KrAppendAfterNode(const KrAppendAfterNodeInfo* pAppendAfterNodeInfo);
KrResult KrAppendFirstChildNode(const KrAppendFirstChildNodeInfo* pAppendFirstChildNodeInfo); KrResult KrAppendFirstChildNode(const KrAppendFirstChildNodeInfo* pAppendFirstChildNodeInfo);
KrResult KrAppendLastChildNode(const KrAppendLastChildNodeInfo* pAppendLastChildNodeInfo); KrResult KrAppendLastChildNode(const KrAppendLastChildNodeInfo* pAppendLastChildNodeInfo);
KrResult KrUpdateNode(const KrUpdateNodeInfo* pUpdateNodeInfo); KrResult KrUpdateNode(const KrUpdateNodeInfo* pUpdateNodeInfo);
#endif // KRAKEN_H

View File

@@ -29,9 +29,6 @@
// or implied, of Kearwood Gilbert. // or implied, of Kearwood Gilbert.
// //
#ifndef HELLO_CUBE_H #pragma once
#define HELLO_CUBE_H
void smoke_load(); void smoke_load();
#endif // HELLO_CUBE_H