diff options
author | Stephan Vedder <vedder@mbits.info> | 2022-05-10 16:09:42 +0300 |
---|---|---|
committer | Stephan Vedder <vedder@mbits.info> | 2022-05-10 16:09:42 +0300 |
commit | 0f80296b5fe908901698efc83f9e8b1021159f6d (patch) | |
tree | e9ff945ca4a01b5452d9dd4bfc8e6338f88d51a2 | |
parent | ab216f7e5594665c5ab4ccd961343f1f78221cab (diff) |
Exclude unused header style
-rw-r--r-- | .github/workflows/format.yml | 3 | ||||
-rw-r--r-- | Source/Graphics/dynamiclightcollection.hpp | 12 | ||||
-rw-r--r-- | Source/Graphics/lightprobecollection.hpp | 17 | ||||
-rw-r--r-- | Source/Graphics/simplify.hpp | 14 | ||||
-rw-r--r-- | Source/Images/ddsformat.hpp | 10 | ||||
-rw-r--r-- | Source/Images/image_export.hpp | 32 | ||||
-rw-r--r-- | Tools/format_source.sh | 2 |
7 files changed, 48 insertions, 42 deletions
diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 35f8d8df..f32fd1d2 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -12,4 +12,5 @@ jobs: uses: jidicula/clang-format-action@v4.5.0 with: clang-format-version: '13' - check-path: 'Source'
\ No newline at end of file + check-path: 'Source' + exclude-regex: '*.hpp'
\ No newline at end of file diff --git a/Source/Graphics/dynamiclightcollection.hpp b/Source/Graphics/dynamiclightcollection.hpp index 26932692..390eef54 100644 --- a/Source/Graphics/dynamiclightcollection.hpp +++ b/Source/Graphics/dynamiclightcollection.hpp @@ -1,7 +1,7 @@ //----------------------------------------------------------------------------- // Name: dynamiclightcollection.hpp // Developer: Wolfire Games LLC -// Description: +// Description: // License: Read below //----------------------------------------------------------------------------- // @@ -37,20 +37,18 @@ struct DynamicLight { // for ShaderLight which is the GPU data struct }; - // when you want to add spot lights, DO NOT change DynamicLight // add new DynamicSpotLight since they need different data and are processed differently // also DynamicLight should be renamed to DynamicPointLight to clarify its meaning - class BulletWorld; class SceneGraph; class DynamicLightCollection { -public: + public: DynamicLightCollection(); - ~DynamicLightCollection(); - int AddLight(const vec3& pos, const vec3 &color, float radius); + ~DynamicLightCollection(); + int AddLight(const vec3& pos, const vec3& color, float radius); bool MoveLight(int id, const vec3& pos); bool DeleteLight(int id); void Draw(BulletWorld& bw); @@ -58,7 +56,7 @@ public: void Dispose(); DynamicLight* GetLightFromID(int id); -private: + private: std::vector<DynamicLight> dynamic_lights; int next_id; diff --git a/Source/Graphics/lightprobecollection.hpp b/Source/Graphics/lightprobecollection.hpp index 99a582de..18703edc 100644 --- a/Source/Graphics/lightprobecollection.hpp +++ b/Source/Graphics/lightprobecollection.hpp @@ -1,7 +1,7 @@ //----------------------------------------------------------------------------- // Name: lightprobecollection.h // Developer: Wolfire Games LLC -// Description: +// Description: // License: Read below //----------------------------------------------------------------------------- // @@ -37,7 +37,7 @@ struct LightProbe { vec3 pos; bool negative; vec3 ambient_cube_color[6]; - vec3 ambient_cube_color_buf[6]; // Used for calculating second bounce + vec3 ambient_cube_color_buf[6]; // Used for calculating second bounce }; struct TetMesh { @@ -50,23 +50,23 @@ struct TetMesh { struct LightProbeUpdateEntry { int id; - int pass; // 0 for first bounce, 1 for second bounce + int pass; // 0 for first bounce, 1 for second bounce }; struct GridLookup { static const int kMaxGridCells = 1000000; vec3 bounds[2]; int subdivisions[3]; - std::vector<unsigned> cell_tet; // What tetrahedron is closest to the center of each cell + std::vector<unsigned> cell_tet; // What tetrahedron is closest to the center of each cell }; class BulletWorld; class LightProbeCollection { -public: + public: LightProbeCollection(); ~LightProbeCollection(); - int AddProbe(const vec3& pos, bool negative, const float *coeff = NULL); + int AddProbe(const vec3& pos, bool negative, const float* coeff = NULL); bool MoveProbe(int id, const vec3& pos); bool SetNegative(int id, bool negative); bool DeleteProbe(int id); @@ -76,7 +76,7 @@ public: int ShaderNumLightProbes(); int ShaderNumTetrahedra(); LightProbe* GetNextProbeToProcess(); - // Returns id of tetrahedron containing position, + // Returns id of tetrahedron containing position, // and fills interpolated ambient cube color int GetTetrahedron(const vec3& position, vec3 ambient_cube_color[], int best_guess); GLuint cube_map_fbo; @@ -98,7 +98,8 @@ public: bool probe_lighting_enabled; bool light_volume_enabled; int probe_model_id; -private: + + private: bool tet_mesh_needs_update; int next_id; void UpdateTetMesh(BulletWorld& bw); diff --git a/Source/Graphics/simplify.hpp b/Source/Graphics/simplify.hpp index 3837a049..3949e133 100644 --- a/Source/Graphics/simplify.hpp +++ b/Source/Graphics/simplify.hpp @@ -1,7 +1,7 @@ //----------------------------------------------------------------------------- // Name: simplify.hpp // Developer: Wolfire Games LLC -// Description: +// Description: // License: Read below //----------------------------------------------------------------------------- // @@ -34,9 +34,9 @@ using std::vector; namespace WOLFIRE_SIMPLIFY { - void CalculateQuadrics(vector<glm::mat4> *quadrics, const vector<float> &vertices, const vector<int> &vert_indices); - bool SimplifyMorphLOD( const SimplifyModelInput &model_input, MorphModel* lod, ParentRecordListVec* vert_parents, ParentRecordListVec* tex_parents, int lod_levels ); - bool SimplifySimpleModel(const Model& input, Model* output, int edge_target, bool include_tex); - bool Process( const Model &model, SimplifyModel& processed_model, vector<HalfEdge>& half_edges, bool include_tex); - float CalculateError(float* pos, int edge[2], const vector<float> &vertices, const vector<glm::mat4> &quadrics, const int edge_tc[]); -} +void CalculateQuadrics(vector<glm::mat4>* quadrics, const vector<float>& vertices, const vector<int>& vert_indices); +bool SimplifyMorphLOD(const SimplifyModelInput& model_input, MorphModel* lod, ParentRecordListVec* vert_parents, ParentRecordListVec* tex_parents, int lod_levels); +bool SimplifySimpleModel(const Model& input, Model* output, int edge_target, bool include_tex); +bool Process(const Model& model, SimplifyModel& processed_model, vector<HalfEdge>& half_edges, bool include_tex); +float CalculateError(float* pos, int edge[2], const vector<float>& vertices, const vector<glm::mat4>& quadrics, const int edge_tc[]); +} // namespace WOLFIRE_SIMPLIFY diff --git a/Source/Images/ddsformat.hpp b/Source/Images/ddsformat.hpp index 4150ecfa..b72b1a84 100644 --- a/Source/Images/ddsformat.hpp +++ b/Source/Images/ddsformat.hpp @@ -1,7 +1,7 @@ //----------------------------------------------------------------------------- // Name: ddsformat.hpp // Developer: Wolfire Games LLC -// Description: +// Description: // License: Read below //----------------------------------------------------------------------------- // @@ -23,4 +23,10 @@ //----------------------------------------------------------------------------- #pragma once -enum DDSFormat {_DXT1, _DXT1A, _DXT3, _DXT5, _DXT5YCoCg, _RGBA, _RGB}; +enum DDSFormat { _DXT1, + _DXT1A, + _DXT3, + _DXT5, + _DXT5YCoCg, + _RGBA, + _RGB }; diff --git a/Source/Images/image_export.hpp b/Source/Images/image_export.hpp index f986e3cf..f33d62ef 100644 --- a/Source/Images/image_export.hpp +++ b/Source/Images/image_export.hpp @@ -30,20 +30,20 @@ #include <vector> namespace ImageExport { - struct CubemapFace { - std::vector<unsigned char> pixels; - }; - struct CubemapMipLevel { - CubemapFace faces[6]; - }; - struct CubemapMipmaps { - std::vector<CubemapMipLevel> mips; - }; +struct CubemapFace { + std::vector<unsigned char> pixels; +}; +struct CubemapMipLevel { + CubemapFace faces[6]; +}; +struct CubemapMipmaps { + std::vector<CubemapMipLevel> mips; +}; - void SaveJPEG(const char* abs_path, unsigned char *data, unsigned long width, unsigned long height); - void SavePNG(const char *file_path, unsigned char *data, unsigned long width, unsigned long height, unsigned short levels = 0); - void SavePNGTransparent(const char *file_path, unsigned char *data, unsigned long width, unsigned long height, unsigned short levels = 0); - void SavePNGofGrayscaleFloats(const char *file_path, std::vector<float>& data, unsigned long width, unsigned long height); - std::string FindEmptySequentialFile(const char* filename, const char* suffix); - void ScaleImageUp(const unsigned char *data, int levels, unsigned long *width, unsigned long *height, std::vector<unsigned char> *new_data); -} +void SaveJPEG(const char *abs_path, unsigned char *data, unsigned long width, unsigned long height); +void SavePNG(const char *file_path, unsigned char *data, unsigned long width, unsigned long height, unsigned short levels = 0); +void SavePNGTransparent(const char *file_path, unsigned char *data, unsigned long width, unsigned long height, unsigned short levels = 0); +void SavePNGofGrayscaleFloats(const char *file_path, std::vector<float> &data, unsigned long width, unsigned long height); +std::string FindEmptySequentialFile(const char *filename, const char *suffix); +void ScaleImageUp(const unsigned char *data, int levels, unsigned long *width, unsigned long *height, std::vector<unsigned char> *new_data); +} // namespace ImageExport diff --git a/Tools/format_source.sh b/Tools/format_source.sh index edeac847..eaf90ed3 100644 --- a/Tools/format_source.sh +++ b/Tools/format_source.sh @@ -1,3 +1,3 @@ #!/bin/bash -find ./Source/ -iname *.h -o -iname *.cpp | xargs clang-format -i
\ No newline at end of file +find ./Source/ -iname *.h -o -iname *.cpp -o -iname *.hpp| xargs clang-format -i
\ No newline at end of file |