2
0
mirror of https://github.com/raylib-cs/raylib-cs synced 2025-04-05 11:19:39 -04:00

Add .editorconfig and apply formatting

This commit is contained in:
ChrisDill 2023-08-27 15:20:26 +01:00
parent d1f0b9fd91
commit 696955463f
32 changed files with 7217 additions and 7194 deletions

51
.editorconfig Normal file
View File

@ -0,0 +1,51 @@
# EditorConfig is awesome: http://EditorConfig.org
root = true
[*]
indent_style = space
# General
[*.{cs,csx,vb,vbx}]
indent_size = 4
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
# C# styles
[*.cs]
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_switch_labels = true
csharp_indent_labels = flush_left
csharp_style_namespace_declarations = file_scoped:warning
# Newline settings
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Spacing
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_around_binary_operators = before_and_after
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
# Blocks are allowed
csharp_prefer_braces = true:error
csharp_preserve_single_line_blocks = false
csharp_preserve_single_line_statements = false

View File

@ -30,8 +30,8 @@ using System;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
namespace Raylib_cs.Tests
{
namespace Raylib_cs.Tests;
public static class BlittableHelper
{
public static bool IsBlittable<T>()
@ -67,4 +67,3 @@ namespace Raylib_cs.Tests
public static readonly bool VALUE = IsBlittable(typeof(T));
}
}
}

View File

@ -1,8 +1,8 @@
using System;
using Xunit;
namespace Raylib_cs.Tests
{
namespace Raylib_cs.Tests;
public class RaylibTests
{
private unsafe void CheckType<T>() where T : unmanaged
@ -43,4 +43,3 @@ namespace Raylib_cs.Tests
CheckType<RenderBatch>();
}
}
}

View File

@ -3,8 +3,8 @@ using System.Numerics;
using System.Runtime.InteropServices;
using System.Security;
namespace Raylib_cs
{
namespace Raylib_cs;
[SuppressUnmanagedCodeSecurity]
public static unsafe partial class Raylib
{
@ -2683,4 +2683,3 @@ namespace Raylib_cs
delegate* unmanaged[Cdecl]<void*, uint, void> processor
);
}
}

View File

@ -2,8 +2,8 @@ using System.Numerics;
using System.Runtime.InteropServices;
using System.Security;
namespace Raylib_cs
{
namespace Raylib_cs;
// NOTE: Helper types to be used instead of array return types for *ToFloat functions
public unsafe struct Float3
{
@ -541,4 +541,3 @@ namespace Raylib_cs
[DllImport(NativeLibName, CallingConvention = CallingConvention.Cdecl)]
public static extern int QuaternionEquals(Quaternion p, Quaternion q);
}
}

View File

@ -2,8 +2,8 @@ using System.Numerics;
using System.Runtime.InteropServices;
using System.Security;
namespace Raylib_cs
{
namespace Raylib_cs;
[SuppressUnmanagedCodeSecurity]
public static unsafe partial class Rlgl
{
@ -804,4 +804,3 @@ namespace Raylib_cs
[DllImport(NativeLibName, EntryPoint = "rlLoadDrawQuad", CallingConvention = CallingConvention.Cdecl)]
public static extern void LoadDrawQuad();
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Wave type, defines audio wave data
/// </summary>
@ -120,4 +120,3 @@ namespace Raylib_cs
/// </summary>
public void* CtxData;
}
}

View File

@ -1,8 +1,8 @@
using System.Numerics;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>Bounding box type</summary>
[StructLayout(LayoutKind.Sequential)]
public partial struct BoundingBox
@ -23,4 +23,3 @@ namespace Raylib_cs
this.Max = max;
}
}
}

View File

@ -1,8 +1,8 @@
using System.Numerics;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Camera2D, defines position/orientation in 2d space
/// </summary>
@ -37,4 +37,3 @@ namespace Raylib_cs
this.Zoom = zoom;
}
}
}

View File

@ -1,8 +1,8 @@
using System.Numerics;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Camera system modes
/// </summary>
@ -64,4 +64,3 @@ namespace Raylib_cs
this.Projection = projection;
}
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Color type, RGBA (32bit)
/// </summary>
@ -64,4 +64,3 @@ namespace Raylib_cs
return $"{{R:{R} G:{G} B:{B} A:{A}}}";
}
}
}

View File

@ -1,7 +1,7 @@
using System;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// System config flags<br/>
/// NOTE: Every bit registers one state (use it with bit masks)<br/>
@ -178,4 +178,3 @@ namespace Raylib_cs
/// </summary>
BLEND_CUSTOM_SEPARATE
}
}

View File

@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Font type, defines generation method
/// </summary>
@ -91,4 +91,3 @@ namespace Raylib_cs
/// </summary>
public GlyphInfo* Glyphs;
}
}

View File

@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Pixel formats<br/>
/// NOTE: Support depends on OpenGL version and platform
@ -145,4 +145,3 @@ namespace Raylib_cs
/// </summary>
public PixelFormat Format;
}
}

View File

@ -2,8 +2,8 @@ using System;
using System.Numerics;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Keyboard keys (US keyboard layout)<br/>
/// NOTE: Use GetKeyPressed() to allow redefining required keys for alternative layouts
@ -502,4 +502,3 @@ namespace Raylib_cs
/// </summary>
public Vector2 ScaleIn;
}
}

View File

@ -4,8 +4,8 @@
using System;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
internal readonly struct Native
{
internal const string Msvcrt = "msvcrt";
@ -161,4 +161,3 @@ namespace Raylib_cs
return -1;
}
}
}

View File

@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Material map index
/// </summary>
@ -88,4 +88,3 @@ namespace Raylib_cs
/// </summary>
public fixed float Param[4];
}
}

View File

@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Vertex data definning a mesh<br/>
/// NOTE: Data stored in CPU memory (and GPU)
@ -96,4 +96,3 @@ namespace Raylib_cs
#endregion
}
}

View File

@ -2,8 +2,8 @@ using System;
using System.Numerics;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Bone information
/// </summary>
@ -142,4 +142,3 @@ namespace Raylib_cs
this._count = count;
}
}
}

View File

@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// N-patch layout
/// </summary>
@ -59,4 +59,3 @@ namespace Raylib_cs
/// </summary>
public NPatchLayout Layout;
}
}

View File

@ -1,8 +1,8 @@
using System.Numerics;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Ray, ray for raycasting
/// </summary>
@ -52,4 +52,3 @@ namespace Raylib_cs
/// </summary>
public Vector3 Normal;
}
}

View File

@ -2,8 +2,8 @@ using System;
using System.Numerics;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
public static unsafe partial class Raylib
{
/// <summary>Initialize window and OpenGL context</summary>
@ -1103,4 +1103,3 @@ namespace Raylib_cs
model.Materials[materialIndex].Shader = shader;
}
}
}

View File

@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Rectangle type
/// </summary>
@ -26,4 +26,3 @@ namespace Raylib_cs
return $"{{X:{X} Y:{Y} Width:{Width} Height:{Height}}}";
}
}
}

View File

@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// RenderBatch type
/// </summary>
@ -268,4 +268,3 @@ namespace Raylib_cs
/// </summary>
COMPUTE = 0x91b9
}
}

View File

@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// RenderTexture2D type, for texture rendering
/// </summary>
@ -23,4 +23,3 @@ namespace Raylib_cs
/// </summary>
public Texture2D Depth;
}
}

View File

@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Shader location index
/// </summary>
@ -81,4 +81,3 @@ namespace Raylib_cs
/// </summary>
public int* Locs;
}
}

View File

@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Texture parameters: filter mode<br/>
/// NOTE 1: Filtering considers mipmaps if available in the texture<br/>
@ -134,4 +134,3 @@ namespace Raylib_cs
/// </summary>
public PixelFormat Format;
}
}

View File

@ -1,8 +1,8 @@
using System.Numerics;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Transform, vectex transformation data
/// </summary>
@ -24,4 +24,3 @@ namespace Raylib_cs
/// </summary>
public Vector3 Scale;
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Converts text to a Ansi buffer for passing to native code
/// </summary>
@ -33,4 +33,3 @@ namespace Raylib_cs
return new AnsiBuffer(text);
}
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
[StructLayout(LayoutKind.Sequential)]
public readonly struct CBool
{
@ -20,7 +20,10 @@ namespace Raylib_cs
*
* 'value' is visible and constructable (if necessary), but impossible to modify or access.
*/
public sbyte Value { init; private get; }
public sbyte Value
{
init; private get;
}
// Constructors for easier usage.
public CBool(bool value)
@ -84,4 +87,3 @@ namespace Raylib_cs
return ((bool)this).ToString();
}
}
}

View File

@ -1,7 +1,7 @@
using System.Runtime.InteropServices;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// File path list
/// </summary>
@ -23,4 +23,3 @@ namespace Raylib_cs
/// </summary>
public byte** Paths;
}
}

View File

@ -1,9 +1,9 @@
using System;
using System;
using System.Runtime.InteropServices;
using System.Text;
namespace Raylib_cs
{
namespace Raylib_cs;
/// <summary>
/// Converts text to a UTF8 buffer for passing to native code
/// </summary>
@ -60,4 +60,3 @@ namespace Raylib_cs
return Encoding.UTF8.GetBytes(text);
}
}
}