diff --git a/neo/astyle-code.bat b/neo/astyle-code.bat index c75109c2..5bad80df 100644 --- a/neo/astyle-code.bat +++ b/neo/astyle-code.bat @@ -1,9 +1,9 @@ astyle.exe -v --formatted --options=astyle-options.ini --exclude="libs" --recursive *.h astyle.exe -v --formatted --options=astyle-options.ini --exclude="libs" --exclude="d3xp/gamesys/SysCvar.cpp" --exclude="d3xp/gamesys/Callbacks.cpp" --exclude="sys/win32/win_cpu.cpp" --exclude="sys/win32/win_main.cpp" --recursive *.cpp -astyle.exe -v -Q --options=astyle-options.ini ../base/renderprogs/postprocess.pixel -astyle.exe -v -Q --options=astyle-options.ini ../base/renderprogs/AmbientOcclusion_AO.pixel -astyle.exe -v -Q --options=astyle-options.ini ../base/renderprogs/AmbientOcclusion_blur.pixel -astyle.exe -v -Q --options=astyle-options.ini ../base/renderprogs/AmbientOcclusion_minify.pixel -astyle.exe -v -Q --options=astyle-options.ini ../base/renderprogs/DeepGBufferRadiosity_DeepGBufferRadiosity.pixel +astyle.exe -v -Q --options=astyle-options.ini ../base/renderprogs/postprocess.ps.hlsl +astyle.exe -v -Q --options=astyle-options.ini ../base/renderprogs/AmbientOcclusion_AO.ps.hlsl +astyle.exe -v -Q --options=astyle-options.ini ../base/renderprogs/AmbientOcclusion_blur.ps.hlsl +astyle.exe -v -Q --options=astyle-options.ini ../base/renderprogs/AmbientOcclusion_minify.ps.hlsl +astyle.exe -v -Q --options=astyle-options.ini ../base/renderprogs/DeepGBufferRadiosity_radiosity.ps.hlsl pause \ No newline at end of file diff --git a/neo/astyle-options.ini b/neo/astyle-options.ini index 8612b80b..7cad1fd7 100644 --- a/neo/astyle-options.ini +++ b/neo/astyle-options.ini @@ -1,11 +1,46 @@ -# C++ Ansi-Stil auch Standard für .NET C# +# Quotation from Rust Style Guide: + +# "Formatting code is a mostly mechanical task which takes both time and mental effort. By using an automatic formatting tool, a programmer is relieved of this task and can concentrate on more important things. Furthermore, by sticking to an established style guide (such as this one), programmers don't need to formulate ad hoc style rules, nor do they need to debate with other programmers what style rules should be used, saving time, communication overhead, and mental energy." + +# C++ Microsoft style --style=ansi -# Tabs sollten 4 Leerzeichen groß sein +#int Foo(bool isBar) +#{ +# if (isBar) +# { +# bar(); +# return 1; +# } +# else +# return 0; +#} + +# Don't waste time typing lots of empty space and use tabs --indent=tab=4 --indent=force-tab=4 -# case in switches sollte eingerückt sein +# Indent macros within multiple level hierarchies +--indent-preproc-block + +#ifdef _WIN32 +#include +#ifndef NO_EXPORT +#define EXPORT +#endif +#endif + +#becomes: + +#ifdef _WIN32 + #include + #ifndef NO_EXPORT + #define EXPORT + #endif +#endif + + +--indent-switches #switch (foo) #{ # case 1: @@ -18,35 +53,12 @@ # break; # } #} ---indent-switches -# Kommentare sollten nicht mit der ersten Spalte beginnen -#void Foo()\n" -#{ -#// comment -# if (isFoo) -# bar(); -#} +# Fill empty lines with the white space of the previous line +#--fill-empty-lines -#becomes: - -#void Foo()\n" -#{ -# // comment -# if (isFoo) -# bar(); -#} -#--indent-col1-comments - - -# Mindestabstand zwischen normalen code und Kontrollblöcken -#--break-blocks -#--delete-empty-lines - -# Leere Zeilen sollten gleichen Indent haben wie die voherige ---fill-empty-lines - -# genug Leerzeichen zwischen Operatoren +# Insert space padding around operators. This will also pad commas. +--pad-oper #if (foo==2) # a=bar((b-c)*a,d--); @@ -54,25 +66,15 @@ #if (foo == 2) # a = bar((b - c) * a, d--); ---pad-oper -# Doom 3 verwendet padding innerhalb von Klammern +# Uncommon but introduced by id Software and I really like it: +# Insert space padding around paren on the inside only. #if ( isFoo( a, b ) ) # bar( a, b ); --pad-paren-in -# Doom 3 padded zwischen Headern (e.g. 'if', 'for', 'while'...) -#if(isFoo(a, b)) -# bar(a, b); -#becomes: - -#if (isFoo(a, b)) -# bar(a, b); -#--pad-header - - -# Test: entfernte alle extra Leerzeichen zwischen den Klammern +# Remove extra space padding around parens on the outside. #if ( isFoo( a, b ) ) # bar ( a, b ); @@ -82,7 +84,7 @@ # bar(a, b); --unpad-paren -# binde Zeiger und Referenzen an den Typen und nicht an die Variable +# Attach a pointer or reference operator (*, &, or ^) to the variable type #char *foo1; #char &foo2; @@ -93,7 +95,18 @@ --align-pointer=type --align-reference=type -# keine .orig Backups +# Add braces to unbraced one line conditional statements (e.g. 'if', 'for', 'while'...). +#if (isFoo) +# isFoo = false; + +#becomes: + +#if (isFoo) { +# isFoo = false; +#} +--add-brackets + +# no .orig Backups --suffix=none