A Whole New World (clang-format edition)

I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?

I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon

A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format

A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
This commit is contained in:
Rémi Verschelde
2017-03-05 16:44:50 +01:00
parent 45438e9918
commit 5dbf1809c6
1318 changed files with 140051 additions and 166004 deletions
+9 -11
View File
@@ -33,15 +33,15 @@
class ShaderCompilerGLES2 {
class Uniform;
public:
struct Flags;
private:
ShaderLanguage::ProgramNode *program_node;
String dump_node_code(ShaderLanguage::Node *p_node,int p_level,bool p_assign_left=false);
String dump_node_code(ShaderLanguage::Node *p_node, int p_level, bool p_assign_left = false);
Error compile_node(ShaderLanguage::ProgramNode *p_program);
static Error create_glsl_120_code(void *p_str,ShaderLanguage::ProgramNode *p_program);
static Error create_glsl_120_code(void *p_str, ShaderLanguage::ProgramNode *p_program);
bool uses_light;
bool uses_texscreen;
@@ -87,7 +87,7 @@ private:
StringName vname_world_vec;
StringName vname_shadow;
Map<StringName,ShaderLanguage::Uniform> *uniforms;
Map<StringName, ShaderLanguage::Uniform> *uniforms;
StringName out_vertex_name;
@@ -95,13 +95,12 @@ private:
String code;
ShaderLanguage::ShaderType type;
String replace_string(const StringName& p_string);
String replace_string(const StringName &p_string);
Map<StringName,StringName> mode_replace_table[9];
Map<StringName,StringName> replace_table;
Map<StringName, StringName> mode_replace_table[9];
Map<StringName, StringName> replace_table;
public:
struct Flags {
bool uses_alpha;
@@ -126,10 +125,9 @@ public:
bool uses_shadow_color;
};
Error compile(const String& p_code, ShaderLanguage::ShaderType p_type, String& r_code_line, String& r_globals_line, Flags& r_flags, Map<StringName,ShaderLanguage::Uniform> *r_uniforms=NULL);
Error compile(const String &p_code, ShaderLanguage::ShaderType p_type, String &r_code_line, String &r_globals_line, Flags &r_flags, Map<StringName, ShaderLanguage::Uniform> *r_uniforms = NULL);
ShaderCompilerGLES2();
};
#endif // SHADER_COMPILERL_GL_H