Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/WolfireGames/overgrowth.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeal Gompa (ニール・ゴンパ) <neal@gompa.dev>2022-05-12 14:23:40 +0300
committerGitHub <noreply@github.com>2022-05-12 14:23:40 +0300
commit9becdaf628478502b3a2157b0361fa6aa9792002 (patch)
treeedb806549a151b29c9ea7950dfa4c714ee0b4bc2
parentfaa98ea18d6ca23624cbf2215b25f29d5c4a6990 (diff)
parentebedafaa8335541281d0595238461809e0734303 (diff)
Merge pull request #67 from feliwir/fix-clang-check
Exclude unused header extension from format check
-rw-r--r--.github/workflows/format.yml5
-rw-r--r--Source/Graphics/dynamiclightcollection.hpp12
-rw-r--r--Source/Graphics/lightprobecollection.hpp17
-rw-r--r--Source/Graphics/simplify.hpp14
-rw-r--r--Source/Images/ddsformat.hpp10
-rw-r--r--Source/Images/image_export.hpp32
-rw-r--r--Source/Version/fallback_version.c10
7 files changed, 53 insertions, 47 deletions
diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
index 35f8d8df..7589ac40 100644
--- a/.github/workflows/format.yml
+++ b/.github/workflows/format.yml
@@ -9,7 +9,8 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Run clang-format style check for OverGrowth Source
- uses: jidicula/clang-format-action@v4.5.0
+ uses: jidicula/clang-format-action@v4.6.2
with:
clang-format-version: '13'
- check-path: 'Source' \ No newline at end of file
+ check-path: 'Source'
+ exclude-regex: '(hpp|snprintf.c|triangle.c)' \ 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/Source/Version/fallback_version.c b/Source/Version/fallback_version.c
index 0edce8f4..d3f72509 100644
--- a/Source/Version/fallback_version.c
+++ b/Source/Version/fallback_version.c
@@ -20,8 +20,8 @@
// limitations under the License.
//
//-----------------------------------------------------------------------------
-extern const int phoenix_build_id=-1;
-const char* phoenix_platform="Unknown";
-const char* phoenix_arch="Unknown";
-const char* phoenix_git_version_string="Unknown";
-const char* phoenix_build_timestamp="0000-00-00 00:00:00 UTC";
+extern const int phoenix_build_id = -1;
+const char* phoenix_platform = "Unknown";
+const char* phoenix_arch = "Unknown";
+const char* phoenix_git_version_string = "Unknown";
+const char* phoenix_build_timestamp = "0000-00-00 00:00:00 UTC";