From 1927f4fdf346d094416a39c4106e64fe693e6f4d Mon Sep 17 00:00:00 2001 From: Youmu Liu <105042599+Nitload-NSI@users.noreply.github.com> Date: Fri, 17 Oct 2025 10:49:00 +0800 Subject: [PATCH] code clean up --- .../Collections/BidirectionalDictionary.cs | 157 +++++++------ StgSharp.Common/Collections/CachePool.cs | 51 ++--- .../Collections/IBidrirectionalDictionary.cs | 61 +++-- .../Collections/IHashMultiplexer.cs | 67 +++--- StgSharp.Common/Collections/ListSegment.cs | 99 ++++----- .../Collections/NotEnumerableList.cs | 29 ++- .../Collections/PartialDictionary.cs | 126 +++++------ .../Collections/RandomAccessibleStack.cs | 43 ++-- .../Collections/StringHashMultiplexer.cs | 107 +++++---- .../Controlling/Controls/BattleField.cs | 43 ++-- .../Controlling/Controls/ButtonGroup.cs | 4 +- .../Controls/CharacterIndexImage.cs | 4 +- .../Controlling/Controls/ControllingIntem.cs | 4 +- .../Controlling/Controls/DecorationBox.cs | 4 +- .../Controlling/Controls/MarkingLable.cs | 4 +- .../Controlling/Controls/TriggerButton.cs | 4 +- StgSharp.Common/Controlling/KeyEnum.cs | 51 ++--- .../Controlling/KeyEventAttribute.cs | 77 ++++--- .../Controlling/UsrActivity/IClickTrigger.cs | 51 ++--- .../UsrActivity/JoystickTrigger.cs | 71 +++--- .../Controlling/UsrActivity/KeyTrigger.cs | 72 +++--- .../Controlling/UsrActivity/MouseTrigger.cs | 61 +++-- .../Controlling/UsrActivity/TriggetFactory.cs | 103 +++++---- StgSharp.Common/Counter.cs | 51 ++--- StgSharp.Common/Data/GlobalData/root.cs | 43 ++-- StgSharp.Common/Data/RandomGenerator.cs | 54 ++--- StgSharp.Common/Data/SSD/Area.cs | 51 ++--- StgSharp.Common/Data/SSD/DataHead.cs | 83 ++++--- StgSharp.Common/Data/SSD/DataSegment.cs | 43 ++-- StgSharp.Common/Data/SSD/SSD.cs | 57 +++-- StgSharp.Common/Data/SSD/SSDVirtualFolder.cs | 65 +++--- StgSharp.Common/Data/SSD/SSDraw.cs | 61 +++-- StgSharp.Common/Data/Serialize/Define.cs | 51 ++--- .../Data/Serialize/ISSDSerializable.cs | 65 +++--- StgSharp.Common/Data/ValueBox.cs | 51 ++--- StgSharp.Common/Entities/BehaviorArgs.cs | 51 ++--- StgSharp.Common/Entities/Enemy.cs | 51 ++--- StgSharp.Common/Entities/EntityPartical.cs | 51 ++--- StgSharp.Common/Entities/IEntity.cs | 53 +++-- StgSharp.Common/Entities/Launcher.cs | 4 +- StgSharp.Common/Entities/Partical.cs | 51 ++--- StgSharp.Common/Entities/Player.cs | 51 ++--- StgSharp.Common/Environment/Dialogue.cs | 110 +++++---- StgSharp.Common/Environment/ErrorDefine.cs | 55 +++-- StgSharp.Common/Environment/GlobalSetting.cs | 43 ++-- StgSharp.Common/Environment/Monitors.cs | 43 ++-- StgSharp.Common/Environment/Platform.cs | 4 +- StgSharp.Common/Environment/globalKeyStat.cs | 55 +++-- .../Coordination/CoordinationBase.cs | 4 +- .../Coordination/PlainCoordinate.cs | 4 +- .../Coordination/SpaceCoordinate.cs | 4 +- .../Coordination/StreamLocalCoordinate.cs | 51 ++--- StgSharp.Common/Geometries/GemoryException.cs | 67 +++--- .../GeometryOperation/GeometryOperation.cs | 4 +- .../Geometries/GeometryScaler/Angle.cs | 151 +++++++------ StgSharp.Common/Geometries/IGeometry.cs | 43 ++-- StgSharp.Common/Geometries/IGeomtryBuffer.cs | 51 ++--- StgSharp.Common/Geometries/IInstancing.cs | 4 +- .../Geometries/IInstancingBuffer.cs | 4 +- .../Geometries/PlainGeometry/Cordinate.cs | 43 ++-- .../PlainGeometry/Define/GeometryOperation.cs | 4 +- .../PlainGeometry/Define/IPlainEntity.cs | 43 ++-- .../PlainGeometry/Define/ParticleOnPlain.cs | 4 +- .../PlainGeometry/Define/PlainGeometry.cs | 4 +- .../Define/PlainInstancingBuffer.cs | 4 +- .../Geometries/PlainGeometry/Parallelogram.cs | 16 +- .../Geometries/PlainGeometry/Plain.cs | 4 +- .../Geometries/PlainGeometry/Polygon4.cs | 13 +- .../Geometries/PlainGeometry/Polygon5.cs | 16 +- .../Geometries/PlainGeometry/Polygon6.cs | 19 +- .../Geometries/PlainGeometry/Rectangle.cs | 59 +++-- .../Geometries/PlainGeometry/Square.cs | 65 +++--- .../Geometries/PlainGeometry/Triangle.cs | 49 +++-- StgSharp.Common/Geometries/Point.cs | 4 +- .../Geometries/SpaceGeometry/Class1.cs | 51 ++--- .../SpaceGeometry/TriangulatedSurface.cs | 4 +- StgSharp.Common/Global.cs | 50 ++--- .../Graphics/CPUanimation/IImageProvider.cs | 51 ++--- .../Graphics/CPUanimation/ImageHelper.cs | 65 +++--- .../Graphics/Define/BufferObjectBase.cs | 43 ++-- StgSharp.Common/Graphics/IGraphicAPIs.cs | 56 +++-- StgSharp.Common/Graphics/Image.cs | 90 ++++---- StgSharp.Common/Graphics/ImageInfo.cs | 53 +++-- .../Graphics/OpenGL/Buffer/AutoTexture.cs | 127 ++++++----- StgSharp.Common/Graphics/OpenGL/Buffer/EBO.cs | 49 ++--- StgSharp.Common/Graphics/OpenGL/Buffer/FBO.cs | 43 ++-- .../OpenGL/Buffer/GLBufferObjectBase.cs | 53 +++-- StgSharp.Common/Graphics/OpenGL/Buffer/RBO.cs | 75 +++---- .../Graphics/OpenGL/Buffer/TextureGL.cs | 149 ++++++------- StgSharp.Common/Graphics/OpenGL/Buffer/VAO.cs | 80 ++++--- StgSharp.Common/Graphics/OpenGL/Buffer/VBO.cs | 4 +- StgSharp.Common/Graphics/OpenGL/GLfixed.cs | 59 +++-- .../OpenGL/ShaderEdit/IglConvertable.cs | 53 +++-- .../Graphics/OpenGL/ShaderEdit/Shader.cs | 66 +++--- .../Graphics/OpenGL/ShaderEdit/Uniform.cs | 43 ++-- .../Graphics/OpenGL/glAPICalling.cs | 53 +++-- .../Graphics/OpenGL/glApiManager.cs | 43 ++-- .../Graphics/OpenGL/glApiManagerConst.cs | 51 ++--- StgSharp.Common/Graphics/OpenGL/glClampf.cs | 71 +++--- StgSharp.Common/Graphics/OpenGL/glConst.cs | 59 +++-- StgSharp.Common/Graphics/OpenGL/glContext.cs | 69 +++--- StgSharp.Common/Graphics/OpenGL/glEnum.cs | 51 ++--- .../Graphics/OpenGL/glException.cs | 80 ++++--- .../OpenGL/glFucntionSourceManager.cs | 71 +++--- StgSharp.Common/Graphics/OpenGL/glFunction.cs | 15 +- StgSharp.Common/Graphics/OpenGL/glHalfNV.cs | 69 +++--- StgSharp.Common/Graphics/OpenGL/glHandle.cs | 65 +++--- .../Graphics/OpenGL/glRenderObjectGenrator.cs | 93 ++++---- .../Graphics/OpenGL/glRenderStream.cs | 4 +- .../Graphics/OpenGL/glRenderThreadSecurity.cs | 51 ++--- StgSharp.Common/Graphics/OpenGL/glType.cs | 65 +++--- StgSharp.Common/Graphics/Pixels.cs | 71 +++--- StgSharp.Common/Graphics/PlainGeometryMesh.cs | 4 +- StgSharp.Common/Graphics/RenderStream.cs | 4 +- .../Graphics/ShaderEdit/ShaderGenerator.cs | 102 ++++----- .../Graphics/ShaderEdit/ShaderStruct.cs | 75 +++---- StgSharp.Common/Graphics/TexturePipeline.cs | 59 +++-- StgSharp.Common/Graphics/TextureProvider.cs | 43 ++-- StgSharp.Common/Graphics/Vulkan/vkEnum.cs | 31 ++- StgSharp.Common/Graphics/Vulkan/vkHandle.cs | 61 +++-- StgSharp.Common/Graphics/framework.cs | 47 ++-- .../Graphics/frameworkSyncContext.cs | 63 +++--- .../HighPerformance/IRegisterPresentation.cs | 43 ++-- .../HighPerformance/IRegisterType.cs | 43 ++-- StgSharp.Common/HighPerformance/Lable.cs | 43 ++-- StgSharp.Common/HighPerformance/M128.cs | 43 ++-- StgSharp.Common/HighPerformance/M256.cs | 43 ++-- StgSharp.Common/HighPerformance/M512.cs | 43 ++-- StgSharp.Common/HighPerformance/M64.cs | 43 ++-- .../HighPerformance/MatrixKernel.cs | 43 ++-- .../HighPerformance/Memory/BufferStack.cs | 43 ++-- .../Memory/HLSFAllocationHandle.cs | 49 ++--- .../Memory/HLSFAllocator.Debug.cs | 43 ++-- .../Memory/HLSFAllocator.Free.cs | 43 ++-- .../Memory/HLSFAllocator.Level.cs | 56 ++--- .../Memory/HLSFAllocator.SegmentEntry.cs | 43 ++-- .../Memory/SlabAllocationHandle.cs | 43 ++-- .../Memory/SlabAllocator.Chunked.cs | 43 ++-- .../Memory/SlabAllocator.ChunkedConcurrent.cs | 43 ++-- .../SlabAllocator.SequencialConcurrent.cs | 45 ++-- .../HighPerformance/Memory/SlabAllocator.cs | 84 ++++--- .../HighPerformance/UnsafeCompute.cs | 43 ++-- StgSharp.Common/Internal/ClangLoad/gl.cs | 57 +++-- StgSharp.Common/Internal/InternalIO.cs | 43 ++-- StgSharp.Common/Internal/InternalResource.cs | 51 ++--- .../Internal/Intrinsic/ColumnSet2.cs | 101 +++++---- .../Internal/Intrinsic/ColumnSet3.cs | 47 ++-- .../Internal/Intrinsic/ColumnSet4.cs | 43 ++-- .../Internal/Intrinsic/IntrinsicContext.cs | 43 ++-- .../Internal/Intrinsic/MatInterface.cs | 51 ++--- .../Intrinsic/intrinsicContextProvider.cs | 47 ++-- StgSharp.Common/Internal/StructDefine.cs | 208 +++++++++--------- StgSharp.Common/Internal/glfw.cs | 43 ++-- StgSharp.Common/Internal/glfwFunction.cs | 43 ++-- StgSharp.Common/Internal/publicType.cs | 51 ++--- .../MVVM/OpenGLControllingItemRender.cs | 51 ++--- StgSharp.Common/MVVM/View/ViewBase.cs | 90 ++++---- StgSharp.Common/MVVM/View/ViewDesigner.cs | 79 ++++--- StgSharp.Common/MVVM/View/ViewRender.cs | 78 ++++--- StgSharp.Common/MVVM/View/ViewResponder.cs | 107 +++++---- StgSharp.Common/MVVM/ViewModel/DataBinding.cs | 113 +++++----- .../MVVM/ViewModel/ShowViewPort.cs | 124 +++++------ StgSharp.Common/MVVM/ViewModel/ViewManage.cs | 58 +++-- StgSharp.Common/MVVM/ViewModel/ViewModel.cs | 4 +- StgSharp.Common/MVVM/ViewPort.cs | 51 ++--- .../Mathematics/Graphic/Vector.Cross.cs | 45 ++-- .../Mathematics/Graphic/Vector.GetAngle.cs | 43 ++-- .../Mathematics/Graphic/Vector.GetLength.cs | 43 ++-- .../Mathematics/Graphic/Vector.Normalize.cs | 43 ++-- .../Graphic/Vector.Orthogonalize.cs | 45 ++-- .../Mathematics/Linear/Cordination.cs | 4 +- .../Mathematics/Linear/IUnmanagedVector.cs | 43 ++-- .../Mathematics/Linear/Matrix.GC.cs | 43 ++-- .../Mathematics/Linear/Matrix.HLSF.cs | 43 ++-- StgSharp.Common/Mathematics/Linear/Matrix.cs | 43 ++-- .../Mathematics/Linear/MatrixEnum.cs | 43 ++-- .../Mathematics/Linear/MatrixIndex.cs | 43 ++-- StgSharp.Common/Mathematics/Scalar/ACos.cs | 43 ++-- StgSharp.Common/Mathematics/Scalar/ASin.cs | 43 ++-- StgSharp.Common/Mathematics/Scalar/ATan.cs | 57 +++-- .../Mathematics/Scalar/BasicOps.cs | 73 +++--- StgSharp.Common/Mathematics/Scalar/Compare.cs | 43 ++-- StgSharp.Common/Mathematics/Scalar/Cos.cs | 43 ++-- StgSharp.Common/Mathematics/Scalar/Ctor.cs | 65 +++--- StgSharp.Common/Mathematics/Scalar/Exp.cs | 43 ++-- .../Mathematics/Scalar/Factorial.cs | 59 +++-- .../Mathematics/Scalar/Function.cs | 51 ++--- StgSharp.Common/Mathematics/Scalar/Log.cs | 77 ++++--- StgSharp.Common/Mathematics/Scalar/Pow.cs | 43 ++-- StgSharp.Common/Mathematics/Scalar/Random.cs | 43 ++-- StgSharp.Common/Mathematics/Scalar/SignOf.cs | 67 +++--- StgSharp.Common/Mathematics/Scalar/Sin.cs | 43 ++-- StgSharp.Common/Mathematics/Scalar/Sqrt.cs | 43 ++-- StgSharp.Common/Mathematics/Scalar/Tan.cs | 43 ++-- .../PipeLine/CrossFramePipelineNode.cs | 78 ++++--- .../PipeLine/IConvertableToPipelineNode.cs | 64 +++--- StgSharp.Common/PipeLine/PipeLineRunner.cs | 159 +++++++------ StgSharp.Common/PipeLine/PipelineMarshal.cs | 78 ++++--- StgSharp.Common/PipeLine/PipelineNode.cs | 43 ++-- StgSharp.Common/PipeLine/PipelineNodeLabel.cs | 61 ++--- StgSharp.Common/PipeLine/PipelineNodePort.cs | 121 +++++----- StgSharp.Common/PipeLine/PipelineScheduler.cs | 195 ++++++++-------- StgSharp.Common/PipeLine/PortArgs.cs | 83 ++++--- StgSharp.Common/PipeLine/SideNode.cs | 75 +++---- .../PlainGeometryCollisionSensor.cs | 43 ++-- StgSharp.Common/StateMachine.cs | 54 +++-- StgSharp.Common/Stg/Bullet.cs | 4 +- StgSharp.Common/Stg/CollisionTexture.cs | 4 +- StgSharp.Common/Stg/TimeLine.cs | 51 ++--- StgSharp.Common/Stg/Touhou/TouhouBuilder.cs | 51 ++--- StgSharp.Common/Stg/Touhou/TouhouWindow.cs | 53 +++-- .../Stg/Touhou/View/OpenningView.cs | 53 +++-- .../Threading/AdaptiveBackoffStrategy.cs | 48 ++-- .../Threading/BufferExpansionLock.cs | 45 ++-- StgSharp.Common/Threading/CancellableTask.cs | 87 ++++---- StgSharp.Common/Threading/EmptyThread.cs | 53 +++-- StgSharp.Common/Threading/MainThreadAssert.cs | 65 +++--- .../Threading/SingleConsumerBell.cs | 12 +- StgSharp.Common/Timing/TimeFunction.cs | 80 ++++--- StgSharp.Common/Timing/TimeProvider.cs | 43 ++-- StgSharp.Common/Timing/TimeSourceProvider.cs | 43 ++-- .../Timing/TimeSpanAwaitingToken.cs | 45 ++-- StgSharp.Common/Timing/TimeSpanProvider.cs | 121 +++++----- 223 files changed, 5675 insertions(+), 6160 deletions(-) diff --git a/StgSharp.Common/Collections/BidirectionalDictionary.cs b/StgSharp.Common/Collections/BidirectionalDictionary.cs index fd50cb73..374fd206 100644 --- a/StgSharp.Common/Collections/BidirectionalDictionary.cs +++ b/StgSharp.Common/Collections/BidirectionalDictionary.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="BidirectionalDictionary.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="BidirectionalDictionary" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; @@ -49,49 +46,49 @@ namespace StgSharp.Commom.Collections _reverse = new Dictionary(); } - public TFirst this[ TSecond key ] + public TFirst this[TSecond key] { get { - if( _reverse.TryGetValue( key, out TFirst value ) ) { + if (_reverse.TryGetValue(key, out TFirst value)) { return value; } - throw new ArgumentException( $"Cannot find key {key!.ToString()} in dictionary." ); + throw new ArgumentException($"Cannot find key {key!.ToString()} in dictionary."); } set { - if( _reverse.TryGetValue( key, out TFirst origin ) ) + if (_reverse.TryGetValue(key, out TFirst origin)) { - _reverse[ key ] = value; - _forward.Remove( origin ); + _reverse[key] = value; + _forward.Remove(origin); } else { - _reverse.Add( key, value ); + _reverse.Add(key, value); } - _forward.Add( value, key ); + _forward.Add(value, key); } } - public TSecond this[ TFirst key ] + public TSecond this[TFirst key] { get { - if( _forward.TryGetValue( key, out TSecond value ) ) { + if (_forward.TryGetValue(key, out TSecond value)) { return value; } - throw new ArgumentException( $"Cannot find key {key!.ToString()} in dictionary." ); + throw new ArgumentException($"Cannot find key {key!.ToString()} in dictionary."); } set { - if( _forward.TryGetValue( key, out TSecond origin ) ) + if (_forward.TryGetValue(key, out TSecond origin)) { - _forward[ key ] = value; - _reverse.Remove( origin ); + _forward[key] = value; + _reverse.Remove(origin); } else { - _forward.Add( key, value ); + _forward.Add(key, value); } - _reverse.Add( value, key ); + _reverse.Add(value, key); } } @@ -104,27 +101,27 @@ namespace StgSharp.Commom.Collections public int Count => _forward.Count; public IReadOnlyDictionary Forward => new ReadOnlyDictionary( - _forward ); + _forward); public IReadOnlyDictionary Reverse => new ReadOnlyDictionary( - _reverse ); + _reverse); - public void Add( KeyValuePair item ) + public void Add(KeyValuePair item) { - if( _forward.ContainsKey( item.Key ) || _reverse.ContainsKey( item.Value ) ) { - throw new ArgumentException( "Duplicate key or value." ); + if (_forward.ContainsKey(item.Key) || _reverse.ContainsKey(item.Value)) { + throw new ArgumentException("Duplicate key or value."); } - _forward.Add( item.Key, item.Value ); - _reverse.Add( item.Value, item.Key ); + _forward.Add(item.Key, item.Value); + _reverse.Add(item.Value, item.Key); } - public void Add( TFirst key, TSecond value ) + public void Add(TFirst key, TSecond value) { - if( _forward.ContainsKey( key ) || _reverse.ContainsKey( value ) ) { - throw new ArgumentException( "Duplicate key or value." ); + if (_forward.ContainsKey(key) || _reverse.ContainsKey(value)) { + throw new ArgumentException("Duplicate key or value."); } - _forward.Add( key, value ); - _reverse.Add( value, key ); + _forward.Add(key, value); + _reverse.Add(value, key); } public void Clear() @@ -133,68 +130,66 @@ namespace StgSharp.Commom.Collections _reverse.Clear(); } - public bool Contains( KeyValuePair item ) + public bool Contains(KeyValuePair item) { - return _forward.Contains( item ) && - _reverse.TryGetValue( item.Value, out TFirst var ) && - var!.Equals( item.Key ); + return _forward.Contains(item) && _reverse.TryGetValue(item.Value, out TFirst var) && var!.Equals(item.Key); } - public bool Contains( TSecond key ) + public bool Contains(TSecond key) { - return _reverse.ContainsKey( key ); + return _reverse.ContainsKey(key); } - public bool Contains( TFirst key ) + public bool Contains(TFirst key) { - return _forward.ContainsKey( key ); + return _forward.ContainsKey(key); } - public void CopyTo( KeyValuePair[] array, int arrayIndex ) + public void CopyTo(KeyValuePair[] array, int arrayIndex) { - if( array == null ) { - throw new ArgumentNullException( nameof( array ) ); + if (array == null) { + throw new ArgumentNullException(nameof(array)); } - if( arrayIndex < 0 || arrayIndex > array.Length ) { - throw new ArgumentOutOfRangeException( nameof( arrayIndex ) ); + if (arrayIndex < 0 || arrayIndex > array.Length) { + throw new ArgumentOutOfRangeException(nameof(arrayIndex)); } - if( array.Length - arrayIndex < _forward.Count ) { - throw new ArgumentException( "The array is too small to copy the elements." ); + if (array.Length - arrayIndex < _forward.Count) { + throw new ArgumentException("The array is too small to copy the elements."); } - foreach( KeyValuePair pair in _forward ) { - array[ arrayIndex++ ] = pair; + foreach (KeyValuePair pair in _forward) { + array[arrayIndex++] = pair; } } public IEnumerator> GetEnumerator() { - foreach( KeyValuePair pair in _forward ) { + foreach (KeyValuePair pair in _forward) { yield return pair; } } - public bool Remove( TFirst key ) + public bool Remove(TFirst key) { throw new NotImplementedException(); } - public bool Remove( KeyValuePair item ) + public bool Remove(KeyValuePair item) { - if( _forward.Remove( item.Key ) ) { - return _reverse.Remove( item.Value ); + if (_forward.Remove(item.Key)) { + return _reverse.Remove(item.Value); } return false; } - public bool TryGetValue( TFirst key, out TSecond value ) + public bool TryGetValue(TFirst key, out TSecond value) { - return _forward.TryGetValue( key, out value ); + return _forward.TryGetValue(key, out value); } - public bool TryGetValue( TSecond key, out TFirst value ) + public bool TryGetValue(TSecond key, out TFirst value) { - return _reverse.TryGetValue( key, out value ); + return _reverse.TryGetValue(key, out value); } IEnumerator IEnumerable.GetEnumerator() diff --git a/StgSharp.Common/Collections/CachePool.cs b/StgSharp.Common/Collections/CachePool.cs index ce2d4d23..535a8cfd 100644 --- a/StgSharp.Common/Collections/CachePool.cs +++ b/StgSharp.Common/Collections/CachePool.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="CachePool.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="CachePool" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics.OpenGL; using System; diff --git a/StgSharp.Common/Collections/IBidrirectionalDictionary.cs b/StgSharp.Common/Collections/IBidrirectionalDictionary.cs index 004d5297..0c618f83 100644 --- a/StgSharp.Common/Collections/IBidrirectionalDictionary.cs +++ b/StgSharp.Common/Collections/IBidrirectionalDictionary.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="IBidrirectionalDictionary.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="IBidrirectionalDictionary" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the ¡°Software¡±), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED ¡°AS IS¡±, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; @@ -38,7 +35,7 @@ namespace StgSharp.Commom.Collections public interface IBidirectionalDictionary : IDictionary { - public TFirst this[ TSecond key ] { get; set; } + public TFirst this[TSecond key] { get; set; } public ICollection FirstIndex { get; } @@ -59,7 +56,7 @@ namespace StgSharp.Commom.Collections /// true if the contains an /// element with the specified key; otherwise, false. /// - public bool Contains( TSecond key ); + public bool Contains(TSecond key); /// /// Determines whether the @@ -72,16 +69,16 @@ namespace StgSharp.Commom.Collections /// true if the contains an /// element with the specified key; otherwise, false. /// - public bool Contains( TFirst key ); + public bool Contains(TFirst key); - public bool TryGetValue( TSecond key, out TFirst value ); + public bool TryGetValue(TSecond key, out TFirst value); #pragma warning disable CA1033 ICollection IDictionary.Keys => FirstIndex; ICollection IDictionary.Values => SecondIndex; - bool IDictionary.ContainsKey( TFirst key ) => Contains( key ); + bool IDictionary.ContainsKey(TFirst key) => Contains(key); #pragma warning restore CA1033 } } \ No newline at end of file diff --git a/StgSharp.Common/Collections/IHashMultiplexer.cs b/StgSharp.Common/Collections/IHashMultiplexer.cs index 56ce0004..6f0acde4 100644 --- a/StgSharp.Common/Collections/IHashMultiplexer.cs +++ b/StgSharp.Common/Collections/IHashMultiplexer.cs @@ -1,35 +1,31 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="IHashMultiplexer.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="IHashMultiplexer" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; namespace StgSharp.Collections { @@ -38,11 +34,20 @@ namespace StgSharp.Collections int RemainedMultiplexCount { get; set; } - void CacheHash( T obj, int count ); + /// + /// Cache hash result for obj with counts. + /// + /// + /// + /// + /// + /// + /// + void CacheHash(T obj, int count); - void ExtendCache( int count ); + void ExtendCache(int count); - int ForceComputeHash( T count ); + int ForceComputeHash(T count); } } \ No newline at end of file diff --git a/StgSharp.Common/Collections/ListSegment.cs b/StgSharp.Common/Collections/ListSegment.cs index fca67ba5..1185648d 100644 --- a/StgSharp.Common/Collections/ListSegment.cs +++ b/StgSharp.Common/Collections/ListSegment.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="ListSegment.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="ListSegment" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; @@ -53,35 +50,35 @@ namespace StgSharp.Collections private int _length; private List _collection; - public ListSegment( List collection, int begin, int length ) + public ListSegment(List collection, int begin, int length) { - ArgumentNullException.ThrowIfNull( collection ); - ArgumentOutOfRangeException.ThrowIfLessThan( begin, 0 ); - ArgumentOutOfRangeException.ThrowIfLessThan( length, 0 ); - ArgumentOutOfRangeException.ThrowIfLessThan( begin + length, collection.Count ); + ArgumentNullException.ThrowIfNull(collection); + ArgumentOutOfRangeException.ThrowIfLessThan(begin, 0); + ArgumentOutOfRangeException.ThrowIfLessThan(length, 0); + ArgumentOutOfRangeException.ThrowIfLessThan(begin + length, collection.Count); _collection = collection; _begin = begin; _length = length; } - public T this[ int indexValue ] + public T this[int indexValue] { get { - ArgumentOutOfRangeException.ThrowIfLessThan( indexValue, 0 ); - ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual( indexValue, _length ); - return _collection[ indexValue + _begin ]; + ArgumentOutOfRangeException.ThrowIfLessThan(indexValue, 0); + ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(indexValue, _length); + return _collection[indexValue + _begin]; } } - public T this[ Index i ] + public T this[Index i] { get { int offset = i.IsFromEnd ? _length - i.Value : i.Value; - ArgumentOutOfRangeException.ThrowIfLessThan( offset, 0 ); - ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual( offset, _length ); - return _collection[ offset + _begin ]; + ArgumentOutOfRangeException.ThrowIfLessThan(offset, 0); + ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(offset, _length); + return _collection[offset + _begin]; } } @@ -89,28 +86,28 @@ namespace StgSharp.Collections public int Count => _length; - public bool Contains( T item ) + public bool Contains(T item) { - int index = _collection.IndexOf( item ); + int index = _collection.IndexOf(item); return index >= _begin && index < _length + index; } - public void CopyTo( T[] array, int arrayIndex ) + public void CopyTo(T[] array, int arrayIndex) { - ArgumentNullException.ThrowIfNull( array ); - Span span = CollectionsMarshal.AsSpan( _collection ).Slice( _begin, _length ); - Span target = new Span( array, arrayIndex, _length ); - span.CopyTo( target ); + ArgumentNullException.ThrowIfNull(array); + Span span = CollectionsMarshal.AsSpan(_collection).Slice(_begin, _length); + Span target = new Span(array, arrayIndex, _length); + span.CopyTo(target); } public IEnumerator GetEnumerator() { - for( int i = _begin; i < _length; i++ ) { - yield return this[ i ]; + for (int i = _begin; i < _length; i++) { + yield return this[i]; } } - void ICollection.Add( T item ) + void ICollection.Add(T item) { throw new NotSupportedException(); } @@ -120,7 +117,7 @@ namespace StgSharp.Collections throw new NotSupportedException(); } - bool ICollection.Remove( T item ) + bool ICollection.Remove(T item) { throw new NotSupportedException(); } diff --git a/StgSharp.Common/Collections/NotEnumerableList.cs b/StgSharp.Common/Collections/NotEnumerableList.cs index 7efc6e7a..0cf0f77a 100644 --- a/StgSharp.Common/Collections/NotEnumerableList.cs +++ b/StgSharp.Common/Collections/NotEnumerableList.cs @@ -1,4 +1,31 @@ -using System; +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="NotEnumerableList" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; using System.Runtime.CompilerServices; namespace StgSharp.Collections diff --git a/StgSharp.Common/Collections/PartialDictionary.cs b/StgSharp.Common/Collections/PartialDictionary.cs index 6499321b..f0c3e314 100644 --- a/StgSharp.Common/Collections/PartialDictionary.cs +++ b/StgSharp.Common/Collections/PartialDictionary.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="PartialDictionary.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="PartialDictionary" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; @@ -45,61 +42,58 @@ namespace StgSharp.Collections private readonly HashSet _keys; private readonly PartialDictionaryValues _values; - public PartialDictionary( Dictionary source, TKey[] index ) + public PartialDictionary(Dictionary source, TKey[] index) { _source = source; - _keys = new HashSet( index ); - foreach( TKey item in _keys ) + _keys = new HashSet(index); + foreach (TKey item in _keys) { - if( !_source.ContainsKey( item ) ) { - _source.Add( item, default! ); + if (!_source.ContainsKey(item)) { + _source.Add(item, default!); } } - _values = new PartialDictionaryValues( this ); + _values = new PartialDictionaryValues(this); } - public PartialDictionary( Dictionary source, HashSet keys ) + public PartialDictionary(Dictionary source, HashSet keys) { _source = source; _keys = keys; - foreach( TKey item in _keys ) + foreach (TKey item in _keys) { - if( !_source.ContainsKey( item ) ) { - _source.Add( item, default! ); + if (!_source.ContainsKey(item)) { + _source.Add(item, default!); } } - _values = new PartialDictionaryValues( this ); + _values = new PartialDictionaryValues(this); } - public PartialDictionary( - Dictionary source, - TKey[] index, - IHashMultiplexer multiplexer ) + public PartialDictionary(Dictionary source, TKey[] index, IHashMultiplexer multiplexer) { _source = source; - _keys = new HashSet( index ); - foreach( TKey item in _keys ) + _keys = new HashSet(index); + foreach (TKey item in _keys) { - if( !_source.ContainsKey( item ) ) { - _source.Add( item, default! ); + if (!_source.ContainsKey(item)) { + _source.Add(item, default!); } } - _values = new PartialDictionaryValues( this ); + _values = new PartialDictionaryValues(this); } - public TValue this[ TKey key ] + public TValue this[TKey key] { get { - if( _keys.Contains( key ) ) { - return _source[ key ]; + if (_keys.Contains(key)) { + return _source[key]; } throw new KeyNotFoundException(); } set { - if( _keys.Contains( key ) ) { - _source[ key ] = value; + if (_keys.Contains(key)) { + _source[key] = value; } throw new KeyNotFoundException(); } @@ -111,40 +105,40 @@ namespace StgSharp.Collections public int Count => _keys.Count; - public bool Contains( KeyValuePair item ) + public bool Contains(KeyValuePair item) { - return _keys.Contains( item.Key ) && _source.Contains( item ); + return _keys.Contains(item.Key) && _source.Contains(item); } - public bool ContainsKey( TKey key ) + public bool ContainsKey(TKey key) { - return _keys.Contains( key ); + return _keys.Contains(key); } - public void CopyTo( KeyValuePair[] array, int arrayIndex ) + public void CopyTo(KeyValuePair[] array, int arrayIndex) { throw new NotImplementedException(); } public IEnumerator> GetEnumerator() { - foreach( TKey item in _keys ) { - yield return new KeyValuePair( item, _source[ item ] ); + foreach (TKey item in _keys) { + yield return new KeyValuePair(item, _source[item]); } } - public bool TryGetValue( TKey key, out TValue value ) + public bool TryGetValue(TKey key, out TValue value) { - if( _keys.Contains( key ) ) + if (_keys.Contains(key)) { - value = _source[ key ]; + value = _source[key]; return true; } value = default!; return false; } - void ICollection>.Add( KeyValuePair item ) + void ICollection>.Add(KeyValuePair item) { return; } @@ -154,19 +148,19 @@ namespace StgSharp.Collections throw new NotSupportedException(); } - bool ICollection>.Remove( KeyValuePair item ) + bool ICollection>.Remove(KeyValuePair item) { throw new NotSupportedException(); } bool ICollection>.IsReadOnly => true; - void IDictionary.Add( TKey key, TValue value ) + void IDictionary.Add(TKey key, TValue value) { return; } - bool IDictionary.Remove( TKey key ) + bool IDictionary.Remove(TKey key) { throw new NotSupportedException(); } diff --git a/StgSharp.Common/Collections/RandomAccessibleStack.cs b/StgSharp.Common/Collections/RandomAccessibleStack.cs index 036399ca..024fe062 100644 --- a/StgSharp.Common/Collections/RandomAccessibleStack.cs +++ b/StgSharp.Common/Collections/RandomAccessibleStack.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="RandomAccessibleStack.cs" +// file="RandomAccessibleStack" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Collections/StringHashMultiplexer.cs b/StgSharp.Common/Collections/StringHashMultiplexer.cs index 7e263318..1a8a3368 100644 --- a/StgSharp.Common/Collections/StringHashMultiplexer.cs +++ b/StgSharp.Common/Collections/StringHashMultiplexer.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="StringHashMultiplexer.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="StringHashMultiplexer" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -50,47 +47,47 @@ namespace StgSharp.Collections set => _initCount = value; } - public void CacheHash( string obj, int count ) + public void CacheHash(string obj, int count) { - _hashCache = ForceComputeHash( obj ); + _hashCache = ForceComputeHash(obj); _initCount = count; _remainedCount = _initCount; _source = obj; } - public bool Equals( string x, string y ) + public bool Equals(string x, string y) { return x == y; } - public void ExtendCache( int count ) + public void ExtendCache(int count) { _initCount += count; _remainedCount += count; } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public unsafe int ForceComputeHash( [NotNull] string obj ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public unsafe int ForceComputeHash([NotNull] string obj) { int hash; - fixed( char* cPtr = obj.AsSpan() ) { - hash = InternalIO.Intrinsic.city_hash_simplify( cPtr, obj.Length ); + fixed (char* cPtr = obj.AsSpan()) { + hash = InternalIO.Intrinsic.city_hash_simplify(cPtr, obj.Length); } return hash; } - public int GetHashCode( string obj ) + public int GetHashCode(string obj) { - if( _remainedCount > 0 && ReferenceEquals( _source, obj ) ) + if (_remainedCount > 0 && ReferenceEquals(_source, obj)) { _remainedCount--; return _hashCache; } - if( ReferenceEquals( _sourceLast, obj ) ) { + if (ReferenceEquals(_sourceLast, obj)) { return _hashLast; } _sourceLast = obj; - _hashLast = ForceComputeHash( obj ); + _hashLast = ForceComputeHash(obj); return _hashLast; } @@ -101,7 +98,7 @@ namespace StgSharp.Collections private bool disposedValue; private readonly ThreadLocal _multiplexers = - new( () => new StringHashMultiplexer() ); + new(() => new StringHashMultiplexer()); public int RemainedMultiplexCount { @@ -109,51 +106,51 @@ namespace StgSharp.Collections set => _multiplexers.Value.RemainedMultiplexCount = value; } - public void CacheHash( string obj, int count ) + public void CacheHash(string obj, int count) { throw new NotImplementedException(); } // ~ConcurrentStringHashMultiplexer() // { - // Dispose(disposing: false); + // Dispose(disposing: false); // } public void Dispose() { - Dispose( disposing: true ); - GC.SuppressFinalize( this ); + Dispose(disposing:true); + GC.SuppressFinalize(this); } - public bool Equals( string x, string y ) + public bool Equals(string x, string y) { return x == y; } - public void ExtendCache( int count ) + public void ExtendCache(int count) { - _multiplexers.Value.ExtendCache( count ); + _multiplexers.Value.ExtendCache(count); } - public unsafe int ForceComputeHash( [NotNull] string obj ) + public unsafe int ForceComputeHash([NotNull] string obj) { int hash; - fixed( char* cPtr = obj.AsSpan() ) { - hash = InternalIO.Intrinsic.city_hash_simplify( cPtr, obj.Length ); + fixed (char* cPtr = obj.AsSpan()) { + hash = InternalIO.Intrinsic.city_hash_simplify(cPtr, obj.Length); } return hash; } - public int GetHashCode( string obj ) + public int GetHashCode(string obj) { - return _multiplexers.Value.GetHashCode( obj ); + return _multiplexers.Value.GetHashCode(obj); } - private void Dispose( bool disposing ) + private void Dispose(bool disposing) { - if( !disposedValue ) + if (!disposedValue) { - if( disposing ) { + if (disposing) { _multiplexers.Dispose(); } diff --git a/StgSharp.Common/Controlling/Controls/BattleField.cs b/StgSharp.Common/Controlling/Controls/BattleField.cs index 3849f30f..8f2b5e8b 100644 --- a/StgSharp.Common/Controlling/Controls/BattleField.cs +++ b/StgSharp.Common/Controlling/Controls/BattleField.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="BattleField.cs" +// file="BattleField" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Controlling/Controls/ButtonGroup.cs b/StgSharp.Common/Controlling/Controls/ButtonGroup.cs index eb3992b0..2b85ab21 100644 --- a/StgSharp.Common/Controlling/Controls/ButtonGroup.cs +++ b/StgSharp.Common/Controlling/Controls/ButtonGroup.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="ButtonGroup" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Controlling/Controls/CharacterIndexImage.cs b/StgSharp.Common/Controlling/Controls/CharacterIndexImage.cs index ef696ef0..3ff71e2c 100644 --- a/StgSharp.Common/Controlling/Controls/CharacterIndexImage.cs +++ b/StgSharp.Common/Controlling/Controls/CharacterIndexImage.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="CharacterIndexImage" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Controlling/Controls/ControllingIntem.cs b/StgSharp.Common/Controlling/Controls/ControllingIntem.cs index 03715888..b93a2066 100644 --- a/StgSharp.Common/Controlling/Controls/ControllingIntem.cs +++ b/StgSharp.Common/Controlling/Controls/ControllingIntem.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="ControllingIntem" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Controlling/Controls/DecorationBox.cs b/StgSharp.Common/Controlling/Controls/DecorationBox.cs index d202d748..cff76f6b 100644 --- a/StgSharp.Common/Controlling/Controls/DecorationBox.cs +++ b/StgSharp.Common/Controlling/Controls/DecorationBox.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="DecorationBox" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Controlling/Controls/MarkingLable.cs b/StgSharp.Common/Controlling/Controls/MarkingLable.cs index cf261ca0..548c86f1 100644 --- a/StgSharp.Common/Controlling/Controls/MarkingLable.cs +++ b/StgSharp.Common/Controlling/Controls/MarkingLable.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="MarkingLable" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Controlling/Controls/TriggerButton.cs b/StgSharp.Common/Controlling/Controls/TriggerButton.cs index 5ca04d8b..f5c612bd 100644 --- a/StgSharp.Common/Controlling/Controls/TriggerButton.cs +++ b/StgSharp.Common/Controlling/Controls/TriggerButton.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="TriggerButton" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Controlling/KeyEnum.cs b/StgSharp.Common/Controlling/KeyEnum.cs index e76d1930..5505e64a 100644 --- a/StgSharp.Common/Controlling/KeyEnum.cs +++ b/StgSharp.Common/Controlling/KeyEnum.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="KeyEnum.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="KeyEnum" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics; using StgSharp.Graphics.OpenGL; using StgSharp.Internal.OpenGL; diff --git a/StgSharp.Common/Controlling/KeyEventAttribute.cs b/StgSharp.Common/Controlling/KeyEventAttribute.cs index d56ee7b1..36e936d5 100644 --- a/StgSharp.Common/Controlling/KeyEventAttribute.cs +++ b/StgSharp.Common/Controlling/KeyEventAttribute.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="KeyEventAttribute.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="KeyEventAttribute" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; @@ -36,7 +33,7 @@ using System.Threading.Tasks; namespace StgSharp { - [AttributeUsage( AttributeTargets.Method )] + [AttributeUsage(AttributeTargets.Method)] public class KeyEventAttribute : Attribute { @@ -44,25 +41,25 @@ namespace StgSharp internal int _keyStat; internal int _keyTarget; - public KeyEventAttribute( KeyboardKey key, KeyStatus status ) + public KeyEventAttribute(KeyboardKey key, KeyStatus status) { - _equipment = ( int )InputEquipment.Keyboard; - _keyTarget = ( int )key; - _keyStat = ( int )status; + _equipment = (int)InputEquipment.Keyboard; + _keyTarget = (int)key; + _keyStat = (int)status; } - public KeyEventAttribute( Joystick joystick, KeyStatus status ) + public KeyEventAttribute(Joystick joystick, KeyStatus status) { - _equipment = ( int )InputEquipment.Keyboard; - _keyTarget = ( int )joystick; - _keyStat = ( int )status; + _equipment = (int)InputEquipment.Keyboard; + _keyTarget = (int)joystick; + _keyStat = (int)status; } - public KeyEventAttribute( Mouse mouse, KeyStatus status ) + public KeyEventAttribute(Mouse mouse, KeyStatus status) { - _equipment = ( int )InputEquipment.Keyboard; - _keyTarget = ( int )mouse; - _keyStat = ( int )status; + _equipment = (int)InputEquipment.Keyboard; + _keyTarget = (int)mouse; + _keyStat = (int)status; } } diff --git a/StgSharp.Common/Controlling/UsrActivity/IClickTrigger.cs b/StgSharp.Common/Controlling/UsrActivity/IClickTrigger.cs index 2986cf74..fe9e90ee 100644 --- a/StgSharp.Common/Controlling/UsrActivity/IClickTrigger.cs +++ b/StgSharp.Common/Controlling/UsrActivity/IClickTrigger.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="IClickTrigger.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="IClickTrigger" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; diff --git a/StgSharp.Common/Controlling/UsrActivity/JoystickTrigger.cs b/StgSharp.Common/Controlling/UsrActivity/JoystickTrigger.cs index 777f23ba..2331d2ad 100644 --- a/StgSharp.Common/Controlling/UsrActivity/JoystickTrigger.cs +++ b/StgSharp.Common/Controlling/UsrActivity/JoystickTrigger.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="JoystickTrigger.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="JoystickTrigger" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; @@ -40,13 +37,13 @@ namespace StgSharp.Controlling.UsrActivity private readonly Joystick _stick; private readonly KeyStatus _status; - public JoystickTrigger( Joystick targetKey, KeyStatus status ) + public JoystickTrigger(Joystick targetKey, KeyStatus status) { this._stick = targetKey; _status = status; } - public int TargetKeyOrButtonID => ( int )_stick; + public int TargetKeyOrButtonID => (int)_stick; public Joystick Stick { @@ -55,14 +52,14 @@ namespace StgSharp.Controlling.UsrActivity public KeyStatus TriggeredStatus => _status; - public override bool Equals( object obj ) + public override bool Equals(object obj) { - return base.Equals( obj ); + return base.Equals(obj); } public override int GetHashCode() { - return ( ( int )_stick ) + ( 17 * ( ( int )_status ) ); + return ((int)_stick) + (17 * ((int)_status)); } public override string ToString() @@ -70,17 +67,17 @@ namespace StgSharp.Controlling.UsrActivity return $"Key {_stick} triggered when {_status}"; } - public static bool operator !=( JoystickTrigger left, JoystickTrigger right ) + public static bool operator !=(JoystickTrigger left, JoystickTrigger right) { - return !( left == right ); + return !(left == right); } - public static bool operator ==( JoystickTrigger left, JoystickTrigger right ) + public static bool operator ==(JoystickTrigger left, JoystickTrigger right) { - return ( left._status == right._status ) && ( left._stick == right._stick ); + return (left._status == right._status) && (left._stick == right._stick); } - bool IEquatable.Equals( JoystickTrigger other ) + bool IEquatable.Equals(JoystickTrigger other) { return other == this; } diff --git a/StgSharp.Common/Controlling/UsrActivity/KeyTrigger.cs b/StgSharp.Common/Controlling/UsrActivity/KeyTrigger.cs index bb7bc5d7..2f310e4c 100644 --- a/StgSharp.Common/Controlling/UsrActivity/KeyTrigger.cs +++ b/StgSharp.Common/Controlling/UsrActivity/KeyTrigger.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="KeyTrigger.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="KeyTrigger" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Data.Common; @@ -41,24 +38,24 @@ namespace StgSharp.Controlling.UsrActivity private readonly KeyboardKey _targetKey; private readonly KeyStatus _triggerStat; - public KeyTrigger( KeyboardKey targetKey, KeyStatus targetStat ) + public KeyTrigger(KeyboardKey targetKey, KeyStatus targetStat) { this._targetKey = targetKey; this._triggerStat = targetStat; } - public int TargetKeyOrButtonID => ( int )_targetKey; + public int TargetKeyOrButtonID => (int)_targetKey; public KeyStatus TriggeredStatus => _triggerStat; - public override bool Equals( object obj ) + public override bool Equals(object obj) { - return base.Equals( obj ); + return base.Equals(obj); } public override int GetHashCode() { - return ( ( int )_targetKey ) + ( 17 * ( ( int )_triggerStat ) ); + return ((int)_targetKey) + (17 * ((int)_triggerStat)); } public override string ToString() @@ -66,18 +63,17 @@ namespace StgSharp.Controlling.UsrActivity return $"Key {_targetKey} triggered when {_triggerStat}"; } - public static bool operator !=( KeyTrigger left, KeyTrigger right ) + public static bool operator !=(KeyTrigger left, KeyTrigger right) { - return !( left == right ); + return !(left == right); } - public static bool operator ==( KeyTrigger left, KeyTrigger right ) + public static bool operator ==(KeyTrigger left, KeyTrigger right) { - return ( left._triggerStat == right._triggerStat ) && - ( left._targetKey == right._targetKey ); + return (left._triggerStat == right._triggerStat) && (left._targetKey == right._targetKey); } - bool IEquatable.Equals( KeyTrigger other ) + bool IEquatable.Equals(KeyTrigger other) { return other == this; } diff --git a/StgSharp.Common/Controlling/UsrActivity/MouseTrigger.cs b/StgSharp.Common/Controlling/UsrActivity/MouseTrigger.cs index d0453755..4df57366 100644 --- a/StgSharp.Common/Controlling/UsrActivity/MouseTrigger.cs +++ b/StgSharp.Common/Controlling/UsrActivity/MouseTrigger.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="MouseTrigger.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="MouseTrigger" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Mathematics; using System; @@ -43,27 +40,27 @@ namespace StgSharp.Controlling.UsrActivity private readonly KeyStatus _status; private readonly Mouse _mouse; - public MouseTrigger( Mouse mouse, KeyStatus status ) + public MouseTrigger(Mouse mouse, KeyStatus status) { _mouse = mouse; _status = status; } - public int TargetKeyOrButtonID => ( int )_mouse; + public int TargetKeyOrButtonID => (int)_mouse; public KeyStatus TriggeredStatus => _status; - public bool Equals( MouseTrigger other ) + public bool Equals(MouseTrigger other) { return this == other; } - public static bool operator !=( MouseTrigger left, MouseTrigger right ) + public static bool operator !=(MouseTrigger left, MouseTrigger right) { return left._mouse != right._mouse || left._status != right._status; } - public static bool operator ==( MouseTrigger left, MouseTrigger right ) + public static bool operator ==(MouseTrigger left, MouseTrigger right) { return left._mouse == right._mouse && left._status == right._status; } diff --git a/StgSharp.Common/Controlling/UsrActivity/TriggetFactory.cs b/StgSharp.Common/Controlling/UsrActivity/TriggetFactory.cs index d8515a5b..dc29cfb6 100644 --- a/StgSharp.Common/Controlling/UsrActivity/TriggetFactory.cs +++ b/StgSharp.Common/Controlling/UsrActivity/TriggetFactory.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="TriggetFactory.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="TriggetFactory" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Mathematics; using System; @@ -39,52 +36,52 @@ namespace StgSharp.Controlling.UsrActivity public static class TriggetBuilder { - private const int JoystickMax = ( int )Joystick.Last + 1; - private const int JoystickMin = ( int )Joystick.First - 1; - private const int KeyboardMax = ( int )KeyboardKey.Last + 1; - private const int KeyboardMin = ( int )KeyboardKey.First - 1; - private const int MouseMax = ( int )Mouse.Last + 1; - private const int MouseMin = ( int )Mouse.First - 1; + private const int JoystickMax = (int)Joystick.Last + 1; + private const int JoystickMin = (int)Joystick.First - 1; + private const int KeyboardMax = (int)KeyboardKey.Last + 1; + private const int KeyboardMin = (int)KeyboardKey.First - 1; + private const int MouseMax = (int)Mouse.Last + 1; + private const int MouseMin = (int)Mouse.First - 1; private static KeyTrigger keyboardtemp; private static MouseTrigger mousetemp; - public static JoystickTrigger BuildJoystickClickTrigger( int keyCode, KeyStatus status ) + public static JoystickTrigger BuildJoystickClickTrigger(int keyCode, KeyStatus status) { - if( keyCode > MouseMin && keyCode < MouseMax ) { - return new JoystickTrigger( ( Joystick )keyCode, status ); + if (keyCode > MouseMin && keyCode < MouseMax) { + return new JoystickTrigger((Joystick)keyCode, status); } - throw new InvalidOperationException( "Known key code or key is not on joystick." ); + throw new InvalidOperationException("Known key code or key is not on joystick."); } - public static KeyTrigger BuildKeyboardClickTrigger( int keyCode, KeyStatus status ) + public static KeyTrigger BuildKeyboardClickTrigger(int keyCode, KeyStatus status) { - if( keyCode > KeyboardMin && keyCode < KeyboardMax ) { - return new KeyTrigger( ( KeyboardKey )keyCode, status ); + if (keyCode > KeyboardMin && keyCode < KeyboardMax) { + return new KeyTrigger((KeyboardKey)keyCode, status); } - throw new InvalidOperationException( "Known key code or kay is not on keyboard." ); + throw new InvalidOperationException("Known key code or kay is not on keyboard."); } - public static MouseTrigger BuildMouseClickTrigger( int keyCode, KeyStatus status ) + public static MouseTrigger BuildMouseClickTrigger(int keyCode, KeyStatus status) { - if( keyCode >= MouseMin && keyCode <= MouseMax ) { - return new MouseTrigger( ( Mouse )keyCode, status ); + if (keyCode >= MouseMin && keyCode <= MouseMax) { + return new MouseTrigger((Mouse)keyCode, status); } - throw new InvalidOperationException( "Known key code or key is not on mouse." ); + throw new InvalidOperationException("Known key code or key is not on mouse."); } - public static IClickTrigger BuildTrigger( int keyCode, KeyStatus status ) + public static IClickTrigger BuildTrigger(int keyCode, KeyStatus status) { - if( keyCode > KeyboardMin && keyCode < KeyboardMax ) { - return new KeyTrigger( ( KeyboardKey )keyCode, status ); + if (keyCode > KeyboardMin && keyCode < KeyboardMax) { + return new KeyTrigger((KeyboardKey)keyCode, status); } - if( keyCode > JoystickMin && keyCode < JoystickMax ) { - return new JoystickTrigger( ( Joystick )keyCode, status ); + if (keyCode > JoystickMin && keyCode < JoystickMax) { + return new JoystickTrigger((Joystick)keyCode, status); } - if( keyCode >= MouseMin && keyCode <= MouseMax ) { - return new MouseTrigger( ( Mouse )keyCode, status ); + if (keyCode >= MouseMin && keyCode <= MouseMax) { + return new MouseTrigger((Mouse)keyCode, status); } - throw new InvalidOperationException( "Known key code." ); + throw new InvalidOperationException("Known key code."); } } diff --git a/StgSharp.Common/Counter.cs b/StgSharp.Common/Counter.cs index 2ab229cf..c74b7765 100644 --- a/StgSharp.Common/Counter.cs +++ b/StgSharp.Common/Counter.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Counter.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="Counter" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Numerics; diff --git a/StgSharp.Common/Data/GlobalData/root.cs b/StgSharp.Common/Data/GlobalData/root.cs index 93d7019d..a8c2b707 100644 --- a/StgSharp.Common/Data/GlobalData/root.cs +++ b/StgSharp.Common/Data/GlobalData/root.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="root.cs" +// file="root" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Data/RandomGenerator.cs b/StgSharp.Common/Data/RandomGenerator.cs index 044d2140..51ae4a18 100644 --- a/StgSharp.Common/Data/RandomGenerator.cs +++ b/StgSharp.Common/Data/RandomGenerator.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="RandomGenerator.cs" +// file="RandomGenerator" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -56,7 +53,12 @@ namespace StgSharp.Data string data = sw.ToString(); originKey = Encoding.Unicode.GetBytes(data); } - currentKey = [0,0,0,0]; + currentKey = [ + 0, + 0, + 0, + 0 + ]; fixed (byte* o = originKey, c = currentKey) { *(int*)c = UnsafeCompute.CityHashSimplify((char*)o, 0, originKey.Length / 2); } @@ -65,9 +67,9 @@ namespace StgSharp.Data public int TotalGeneratedRandom { -[MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get; -[MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] private set; } diff --git a/StgSharp.Common/Data/SSD/Area.cs b/StgSharp.Common/Data/SSD/Area.cs index 434695dc..2a27e1b2 100644 --- a/StgSharp.Common/Data/SSD/Area.cs +++ b/StgSharp.Common/Data/SSD/Area.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Area.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="Area" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Internal.FileIO; using System; diff --git a/StgSharp.Common/Data/SSD/DataHead.cs b/StgSharp.Common/Data/SSD/DataHead.cs index 498db9e1..cfa53ead 100644 --- a/StgSharp.Common/Data/SSD/DataHead.cs +++ b/StgSharp.Common/Data/SSD/DataHead.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="DataHead.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="DataHead" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.HighPerformance; using System; @@ -36,41 +33,41 @@ using System.Runtime.InteropServices; namespace StgSharp.Internal { - [StructLayout( LayoutKind.Explicit, Size = 16 )] + [StructLayout(LayoutKind.Explicit, Size = 16)] public struct SSDSegmentHead { - [FieldOffset( 12 )] internal byte size; + [FieldOffset(12)] internal byte size; - [FieldOffset( 0 )] internal M128 data; - [FieldOffset( 13 )] public byte selfDefine_1; - [FieldOffset( 14 )] public byte selfDefine_2; - [FieldOffset( 15 )] public byte selfDefine_3; + [FieldOffset(0)] internal M128 data; + [FieldOffset(13)] public byte selfDefine_1; + [FieldOffset(14)] public byte selfDefine_2; + [FieldOffset(15)] public byte selfDefine_3; - [FieldOffset( 0 )] public int globalID; - [FieldOffset( 4 )] public int nextID; - [FieldOffset( 8 )] public int previousHash; + [FieldOffset(0)] public int globalID; + [FieldOffset(4)] public int nextID; + [FieldOffset(8)] public int previousHash; public int Size { - get => ( ( int )size ) + 1; + get => ((int)size) + 1; set { - if( ( value > 256 ) || ( value < 0 ) ) { + if ((value > 256) || (value < 0)) { throw new ArgumentOutOfRangeException(); } - size = ( byte )( value - 1 ); + size = (byte)(value - 1); } } public unsafe byte[] GetBytes() { byte[] ret = new byte[16]; - fixed( M128* vptr = &data ) + fixed (M128* vptr = &data) { - byte* bptr = ( byte* )vptr; - for( int i = 0; i < 15; i++ ) { - ret[ i ] = *bptr; + byte* bptr = (byte*)vptr; + for (int i = 0; i < 15; i++) { + ret[i] = *bptr; } } return ret; diff --git a/StgSharp.Common/Data/SSD/DataSegment.cs b/StgSharp.Common/Data/SSD/DataSegment.cs index 04de8fc0..dccc0b21 100644 --- a/StgSharp.Common/Data/SSD/DataSegment.cs +++ b/StgSharp.Common/Data/SSD/DataSegment.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="DataSegment.cs" +// file="DataSegment" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Data/SSD/SSD.cs b/StgSharp.Common/Data/SSD/SSD.cs index 27da3035..c13805bc 100644 --- a/StgSharp.Common/Data/SSD/SSD.cs +++ b/StgSharp.Common/Data/SSD/SSD.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="SSD.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="SSD" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Internal.FileIO; using System; @@ -50,15 +47,15 @@ namespace StgSharp.Internal fileList = new Dictionary(); } - public SSD( FileStream fileStream ) + public SSD(FileStream fileStream) { fileList = new Dictionary(); file = fileStream; } - public static SSD FromFile( string fileRoute ) + public static SSD FromFile(string fileRoute) { - return new SSD( new FileStream( fileRoute, FileMode.Open, FileAccess.Read ) ) + return new SSD(new FileStream(fileRoute, FileMode.Open, FileAccess.Read)) { }; } diff --git a/StgSharp.Common/Data/SSD/SSDVirtualFolder.cs b/StgSharp.Common/Data/SSD/SSDVirtualFolder.cs index 1c18c666..b49d7382 100644 --- a/StgSharp.Common/Data/SSD/SSDVirtualFolder.cs +++ b/StgSharp.Common/Data/SSD/SSDVirtualFolder.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="SSDVirtualFolder.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="SSDVirtualFolder" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Internal.FileIO; using System; @@ -49,15 +46,15 @@ namespace StgSharp.Internal folders = new Dictionary(); } - internal SSDFolder( string name ) + internal SSDFolder(string name) { - if( name == "root" ) { + if (name == "root") { throw new ArgumentException( - "Name cannot be root," + "it is preserved for root file indexer." ); + "Name cannot be root," + "it is preserved for root file indexer."); } - if( name == "default" ) { + if (name == "default") { throw new ArgumentException( - "Name cannot be default," + "it is preserved for default file id provider." ); + "Name cannot be default," + "it is preserved for default file id provider."); } _name = name; folders = new Dictionary(); @@ -65,12 +62,12 @@ namespace StgSharp.Internal public SerializableTypeCode SSDTypeCode => SerializableTypeCode.VirtualFolder; - public void FromBytes( byte[] stream ) + public void FromBytes(byte[] stream) { throw new NotImplementedException(); } - //TODO TOUGH TO Get Bytes from virtual folders + // TODO TOUGH TO Get Bytes from virtual folders public byte[] GetBytes() { throw new NotImplementedException(); diff --git a/StgSharp.Common/Data/SSD/SSDraw.cs b/StgSharp.Common/Data/SSD/SSDraw.cs index 88628c39..34896a49 100644 --- a/StgSharp.Common/Data/SSD/SSDraw.cs +++ b/StgSharp.Common/Data/SSD/SSDraw.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="SSDraw.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="SSDraw" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics.ShaderEdit; using System; @@ -50,14 +47,14 @@ namespace StgSharp.Internal.FileIO private byte[] data; - public SSDraw( string name, Stream streamSource ) + public SSDraw(string name, Stream streamSource) { - if( ( streamSource == null ) || ( streamSource.Length == 0 ) ) { - throw new ArgumentNullException( nameof( streamSource ) ); + if ((streamSource == null) || (streamSource.Length == 0)) { + throw new ArgumentNullException(nameof(streamSource)); } Name = name; data = new byte[streamSource.Length]; - streamSource.Read( data.AsSpan() ); + streamSource.Read(data.AsSpan()); } public SSDrawHead Head { get; set; } @@ -66,6 +63,6 @@ namespace StgSharp.Internal.FileIO } - [StructLayout( LayoutKind.Explicit, Size = 32 * 16 )] + [StructLayout(LayoutKind.Explicit, Size = 32 * 16)] public unsafe struct SSDrawHead { } } diff --git a/StgSharp.Common/Data/Serialize/Define.cs b/StgSharp.Common/Data/Serialize/Define.cs index 721f8766..44898c8f 100644 --- a/StgSharp.Common/Data/Serialize/Define.cs +++ b/StgSharp.Common/Data/Serialize/Define.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Define.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="Define" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; diff --git a/StgSharp.Common/Data/Serialize/ISSDSerializable.cs b/StgSharp.Common/Data/Serialize/ISSDSerializable.cs index 23ea07f0..c2b7ea60 100644 --- a/StgSharp.Common/Data/Serialize/ISSDSerializable.cs +++ b/StgSharp.Common/Data/Serialize/ISSDSerializable.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="ISSDSerializable.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="ISSDSerializable" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; @@ -43,7 +40,7 @@ namespace StgSharp.Internal public byte[] GetBytes(); - internal void FromBytes( byte[] stream ); + internal void FromBytes(byte[] stream); } @@ -65,16 +62,16 @@ namespace StgSharp.Internal public static partial class Serializer { - public static T Deserialize( byte[] stream ) where T: ISSDSerializable + public static T Deserialize(byte[] stream) where T: ISSDSerializable { T serializableObject = Activator.CreateInstance(); - serializableObject.FromBytes( stream ); + serializableObject.FromBytes(stream); return serializableObject; } - public static string GetNameTail( SerializableTypeCode typeCode ) + public static string GetNameTail(SerializableTypeCode typeCode) { - switch( typeCode ) + switch (typeCode) { case SerializableTypeCode.IndexTable: return "_idt"; @@ -93,11 +90,11 @@ namespace StgSharp.Internal case SerializableTypeCode.VirtualFolder: return "_fod"; default: - throw new ArgumentException( "Unknown file type" ); + throw new ArgumentException("Unknown file type"); } } - public static byte[] Serialize( ISSDSerializable serializableObject ) + public static byte[] Serialize(ISSDSerializable serializableObject) { return serializableObject.GetBytes(); } diff --git a/StgSharp.Common/Data/ValueBox.cs b/StgSharp.Common/Data/ValueBox.cs index 8ccd82d6..f978951b 100644 --- a/StgSharp.Common/Data/ValueBox.cs +++ b/StgSharp.Common/Data/ValueBox.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="ValueBox.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="ValueBox" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; diff --git a/StgSharp.Common/Entities/BehaviorArgs.cs b/StgSharp.Common/Entities/BehaviorArgs.cs index 01cc4e09..1f0c0aef 100644 --- a/StgSharp.Common/Entities/BehaviorArgs.cs +++ b/StgSharp.Common/Entities/BehaviorArgs.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="BehaviorArgs.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="BehaviorArgs" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- namespace StgSharp.Entities { public abstract class BehaviorArgs { } diff --git a/StgSharp.Common/Entities/Enemy.cs b/StgSharp.Common/Entities/Enemy.cs index 72c888e6..04e2a429 100644 --- a/StgSharp.Common/Entities/Enemy.cs +++ b/StgSharp.Common/Entities/Enemy.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Enemy.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="Enemy" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- namespace StgSharp.Entities { public class Enemy : IEntity diff --git a/StgSharp.Common/Entities/EntityPartical.cs b/StgSharp.Common/Entities/EntityPartical.cs index 9b654c1a..3c22673d 100644 --- a/StgSharp.Common/Entities/EntityPartical.cs +++ b/StgSharp.Common/Entities/EntityPartical.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="EntityPartical.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="EntityPartical" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- namespace StgSharp.Entities { public abstract class EntityPartical : IEntity { } diff --git a/StgSharp.Common/Entities/IEntity.cs b/StgSharp.Common/Entities/IEntity.cs index 0db4dc36..e7ce6aab 100644 --- a/StgSharp.Common/Entities/IEntity.cs +++ b/StgSharp.Common/Entities/IEntity.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="IEntity.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="IEntity" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Geometries; using StgSharp.Mathematics; using StgSharp.Mathematics.Graphic; @@ -84,7 +81,7 @@ namespace StgSharp public abstract void OnRenderFrame(); - public void SetLocation( Point p ) + public void SetLocation(Point p) { _pos = p; } diff --git a/StgSharp.Common/Entities/Launcher.cs b/StgSharp.Common/Entities/Launcher.cs index f5a7fbe0..6f8b3f92 100644 --- a/StgSharp.Common/Entities/Launcher.cs +++ b/StgSharp.Common/Entities/Launcher.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="Launcher" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Entities/Partical.cs b/StgSharp.Common/Entities/Partical.cs index b4609948..8f5ed83f 100644 --- a/StgSharp.Common/Entities/Partical.cs +++ b/StgSharp.Common/Entities/Partical.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Partical.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="Partical" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; namespace StgSharp diff --git a/StgSharp.Common/Entities/Player.cs b/StgSharp.Common/Entities/Player.cs index 1fed616b..691511ec 100644 --- a/StgSharp.Common/Entities/Player.cs +++ b/StgSharp.Common/Entities/Player.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Player.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="Player" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- namespace StgSharp { public abstract class Player : IEntity diff --git a/StgSharp.Common/Environment/Dialogue.cs b/StgSharp.Common/Environment/Dialogue.cs index 2f713741..9f1b507c 100644 --- a/StgSharp.Common/Environment/Dialogue.cs +++ b/StgSharp.Common/Environment/Dialogue.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Dialogue.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="Dialogue" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -54,30 +51,30 @@ namespace StgSharp public static bool NeedShowWhenStartup { get; set; } - public static void PostError( Exception ex ) + public static void PostError(Exception ex) { CreateDialogueProcessIfNotExist(); - _dw.WriteLine( $"posterror {ex.Message}" ); + _dw.WriteLine($"posterror {ex.Message}"); _dialogueProcess!.Exited -= DialogueProcessExitCallback; } - public static void SetReadAndWriteThread( Thread thread ) + public static void SetReadAndWriteThread(Thread thread) { _readAndWriteThreadId = thread.ManagedThreadId; } internal static void CreateDialogueProcessIfNotExist() { - if( _dialogueProcess != null ) { + if (_dialogueProcess != null) { return; } - if( !File.Exists( _dialogueProcessInfo.FileName ) ) { } - _dialogueProcess = Process.Start( _dialogueProcessInfo ); + if (!File.Exists(_dialogueProcessInfo.FileName)) { } + _dialogueProcess = Process.Start(_dialogueProcessInfo); - _dr = new StreamReader( _dialogueClientPipe ); - _dw = new StreamWriter( _dialogueServerPipe ); + _dr = new StreamReader(_dialogueClientPipe); + _dw = new StreamWriter(_dialogueServerPipe); _dialogueProcess!.Exited += DialogueProcessExitCallback; @@ -88,49 +85,50 @@ namespace StgSharp internal static void LoadDialogue() { _dialogueServerPipe = new AnonymousPipeServerStream( - PipeDirection.Out, HandleInheritability.Inheritable ); + PipeDirection.Out, HandleInheritability.Inheritable); _dialogueClientPipe = new AnonymousPipeServerStream( - PipeDirection.In, HandleInheritability.Inheritable ); + PipeDirection.In, HandleInheritability.Inheritable); - string route = Assembly.GetAssembly( typeof( World ) ).Location; - string path = Path.GetDirectoryName( route ); + string route = Assembly.GetAssembly(typeof(World)).Location; + string path = Path.GetDirectoryName(route); string exeName; - if( RuntimeInformation.IsOSPlatform( OSPlatform.Windows ) ) + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { exeName = ".exe"; - } else if( RuntimeInformation.IsOSPlatform( OSPlatform.Linux ) || - RuntimeInformation.IsOSPlatform( OSPlatform.OSX ) ) + } else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || + RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { exeName = string.Empty; } else { - throw new PlatformNotSupportedException( "Unknown OS platform" ); + throw new PlatformNotSupportedException("Unknown OS platform"); } string consoleRoute = Path.Combine( - path, @"StgSharpTerminalDialogue", $@"StgSharpTerminalDialogue{exeName}" ); + path, @"StgSharpTerminalDialogue", $@"StgSharpTerminalDialogue{exeName}"); _dialogueProcessInfo = new ProcessStartInfo { FileName = consoleRoute, - Arguments = $"{_dialogueServerPipe.GetClientHandleAsString()} {_dialogueClientPipe.GetClientHandleAsString()}", + Arguments = + $"{_dialogueServerPipe.GetClientHandleAsString()} {_dialogueClientPipe.GetClientHandleAsString()}", UseShellExecute = true, RedirectStandardOutput = false, }; } - internal static void PostMessage( string instruction, params string[] operands ) + internal static void PostMessage(string instruction, params string[] operands) { CreateDialogueProcessIfNotExist(); - _dw.WriteLine( $"{instruction} {operands}" ); + _dw.WriteLine($"{instruction} {operands}"); } internal static void UnloadDialogue() { - if( _dialogueProcess != null ) { + if (_dialogueProcess != null) { _dialogueProcess.Kill(); } _dialogueProcess = null; @@ -139,9 +137,9 @@ namespace StgSharp _dialogueClientPipe.Dispose(); } - internal static string WaitCertainReturn( string target ) + internal static string WaitCertainReturn(string target) { - if( _dialogueProcess == null ) { + if (_dialogueProcess == null) { return string.Empty; } @@ -150,25 +148,25 @@ namespace StgSharp { temp = _dr.ReadLine(); temp = temp ?? string.Empty; - if( !temp!.StartsWith( target ) ) + if (!temp!.StartsWith(target)) { break; } } while (true); - int index = temp.IndexOf( ' ' ); - return index != -1 ? temp.Substring( index + 1 ) : string.Empty; + int index = temp.IndexOf(' '); + return index != -1 ? temp.Substring(index + 1) : string.Empty; } private static void AssertThread() { - if( _readAndWriteThreadId != Environment.CurrentManagedThreadId ) { + if (_readAndWriteThreadId != Environment.CurrentManagedThreadId) { throw new InvalidOperationException( - "Communication with dialogue can only call from certain thread." ); + "Communication with dialogue can only call from certain thread."); } } - private static void DialogueProcessExitCallback( object? sender, EventArgs e ) + private static void DialogueProcessExitCallback(object? sender, EventArgs e) { _dialogueProcess = null; _dr.Close(); diff --git a/StgSharp.Common/Environment/ErrorDefine.cs b/StgSharp.Common/Environment/ErrorDefine.cs index 05123fb7..3a668dab 100644 --- a/StgSharp.Common/Environment/ErrorDefine.cs +++ b/StgSharp.Common/Environment/ErrorDefine.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="ErrorDefine.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="ErrorDefine" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; @@ -39,9 +36,9 @@ namespace StgSharp public class UniformEmptyReferenceException : Exception { - public UniformEmptyReferenceException( string program, string name ) + public UniformEmptyReferenceException(string program, string name) : base( - $"Location -1 returned when trying to find uniform {name} in shader program {program}" ) { } + $"Location -1 returned when trying to find uniform {name} in shader program {program}") { } } } diff --git a/StgSharp.Common/Environment/GlobalSetting.cs b/StgSharp.Common/Environment/GlobalSetting.cs index 69cfbb08..83977321 100644 --- a/StgSharp.Common/Environment/GlobalSetting.cs +++ b/StgSharp.Common/Environment/GlobalSetting.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="GlobalSetting.cs" +// file="GlobalSetting" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Environment/Monitors.cs b/StgSharp.Common/Environment/Monitors.cs index f455892f..6fe23141 100644 --- a/StgSharp.Common/Environment/Monitors.cs +++ b/StgSharp.Common/Environment/Monitors.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Monitors.cs" +// file="Monitors" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Environment/Platform.cs b/StgSharp.Common/Environment/Platform.cs index fb241f3a..3463b8d2 100644 --- a/StgSharp.Common/Environment/Platform.cs +++ b/StgSharp.Common/Environment/Platform.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="Platform" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Environment/globalKeyStat.cs b/StgSharp.Common/Environment/globalKeyStat.cs index 0c60f833..3e307a0f 100644 --- a/StgSharp.Common/Environment/globalKeyStat.cs +++ b/StgSharp.Common/Environment/globalKeyStat.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="globalKeyStat.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="globalKeyStat" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -43,9 +40,9 @@ namespace StgSharp private static ConcurrentDictionary keyListener = new ConcurrentDictionary(); - public static KeyStatus CheckKey( KeyboardKey key ) + public static KeyStatus CheckKey(KeyboardKey key) { - return keyListener.GetOrAdd( ( int )key, KeyStatus.RELEASE ); + return keyListener.GetOrAdd((int)key, KeyStatus.RELEASE); } } diff --git a/StgSharp.Common/Geometries/Coordination/CoordinationBase.cs b/StgSharp.Common/Geometries/Coordination/CoordinationBase.cs index cb2c5b9f..1bbb536e 100644 --- a/StgSharp.Common/Geometries/Coordination/CoordinationBase.cs +++ b/StgSharp.Common/Geometries/Coordination/CoordinationBase.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="CoordinationBase" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Geometries/Coordination/PlainCoordinate.cs b/StgSharp.Common/Geometries/Coordination/PlainCoordinate.cs index bba1e8f2..062f8f2d 100644 --- a/StgSharp.Common/Geometries/Coordination/PlainCoordinate.cs +++ b/StgSharp.Common/Geometries/Coordination/PlainCoordinate.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="PlainCoordinate" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Geometries/Coordination/SpaceCoordinate.cs b/StgSharp.Common/Geometries/Coordination/SpaceCoordinate.cs index 2c7b1598..6a6b098c 100644 --- a/StgSharp.Common/Geometries/Coordination/SpaceCoordinate.cs +++ b/StgSharp.Common/Geometries/Coordination/SpaceCoordinate.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="SpaceCoordinate" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Geometries/Coordination/StreamLocalCoordinate.cs b/StgSharp.Common/Geometries/Coordination/StreamLocalCoordinate.cs index 8e19a734..94b989f9 100644 --- a/StgSharp.Common/Geometries/Coordination/StreamLocalCoordinate.cs +++ b/StgSharp.Common/Geometries/Coordination/StreamLocalCoordinate.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="StreamLocalCoordinate.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="StreamLocalCoordinate" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Mathematics; using System; diff --git a/StgSharp.Common/Geometries/GemoryException.cs b/StgSharp.Common/Geometries/GemoryException.cs index 3cf4b2a1..d8117f18 100644 --- a/StgSharp.Common/Geometries/GemoryException.cs +++ b/StgSharp.Common/Geometries/GemoryException.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="GemoryException.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="GemoryException" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Runtime.Serialization; @@ -36,15 +33,13 @@ namespace StgSharp.Geometries public unsafe class ToUpperDimensionException : Exception { - protected ToUpperDimensionException( SerializationInfo info, StreamingContext context ) - : base( info, context ) { } + protected ToUpperDimensionException(SerializationInfo info, StreamingContext context) : base(info, context) { } public ToUpperDimensionException() { } - public ToUpperDimensionException( string message ) : base( message ) { } + public ToUpperDimensionException(string message) : base(message) { } - public ToUpperDimensionException( string message, Exception innerException ) - : base( message, innerException ) { } + public ToUpperDimensionException(string message, Exception innerException) : base(message, innerException) { } } @@ -54,15 +49,13 @@ namespace StgSharp.Geometries public class UnusedVertexException : Exception { - protected UnusedVertexException( SerializationInfo info, StreamingContext context ) - : base( info, context ) { } + protected UnusedVertexException(SerializationInfo info, StreamingContext context) : base(info, context) { } public UnusedVertexException() { } - public UnusedVertexException( string message ) : base( message ) { } + public UnusedVertexException(string message) : base(message) { } - public UnusedVertexException( string message, Exception innerException ) - : base( message, innerException ) { } + public UnusedVertexException(string message, Exception innerException) : base(message, innerException) { } } } diff --git a/StgSharp.Common/Geometries/GeometryOperation/GeometryOperation.cs b/StgSharp.Common/Geometries/GeometryOperation/GeometryOperation.cs index a7da22df..efdc757e 100644 --- a/StgSharp.Common/Geometries/GeometryOperation/GeometryOperation.cs +++ b/StgSharp.Common/Geometries/GeometryOperation/GeometryOperation.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="GeometryOperation" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Geometries/GeometryScaler/Angle.cs b/StgSharp.Common/Geometries/GeometryScaler/Angle.cs index 45785ae9..aa3a4aba 100644 --- a/StgSharp.Common/Geometries/GeometryScaler/Angle.cs +++ b/StgSharp.Common/Geometries/GeometryScaler/Angle.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Angle.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="Angle" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; @@ -42,46 +39,46 @@ namespace StgSharp.Mathematics internal const float DegToRad = 180 / Scaler.Pi; - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static float Cos( Radius r ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Cos(Radius r) { - return MathF.Cos( r._radius ); + return MathF.Cos(r._radius); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static float Cos( Degree r ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Cos(Degree r) { - return MathF.Cos( r._degree / DegToRad ); + return MathF.Cos(r._degree / DegToRad); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static float Sin( Radius r ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Sin(Radius r) { - return MathF.Sin( r._radius ); + return MathF.Sin(r._radius); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static float Sin( Degree r ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Sin(Degree r) { - return MathF.Sin( r._degree / DegToRad ); + return MathF.Sin(r._degree / DegToRad); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static float Tan( Radius r ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Tan(Radius r) { - return MathF.Tan( r._radius ); + return MathF.Tan(r._radius); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static float Tan( Degree r ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float Tan(Degree r) { - return MathF.Tan( r._degree / DegToRad ); + return MathF.Tan(r._degree / DegToRad); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static Degree ToDegree( float value ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Degree ToDegree(float value) { - return new Degree( value ); + return new Degree(value); } } @@ -91,14 +88,14 @@ namespace StgSharp.Mathematics internal float _degree; - public Degree( float dgree ) + public Degree(float dgree) { _degree = dgree; } - public static implicit operator Radius( Degree d ) + public static implicit operator Radius(Degree d) { - return new Radius( d._degree / GeometryScaler.DegToRad ); + return new Radius(d._degree / GeometryScaler.DegToRad); } } @@ -108,70 +105,70 @@ namespace StgSharp.Mathematics internal float _radius; - [Obsolete( "Unsafe, you may forget this is radius.", true )] + [Obsolete("Unsafe, you may forget this is radius.", true)] public Radius() { } - public Radius( float radius ) + public Radius(float radius) { _radius = radius; } public static Radius Zero { - get => new Radius( 0 ); + get => new Radius(0); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static Radius operator -( Radius r ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Radius operator -(Radius r) { - return new Radius( -r._radius ); + return new Radius(-r._radius); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static Radius operator -( Radius left, Radius Right ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Radius operator -(Radius left, Radius Right) { - return new Radius( left._radius - Right._radius ); + return new Radius(left._radius - Right._radius); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static bool operator !=( Radius left, Radius right ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(Radius left, Radius right) { return left._radius != right._radius; } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static Radius operator *( Radius left, float right ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Radius operator *(Radius left, float right) { - return new Radius( left._radius * right ); + return new Radius(left._radius * right); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static Radius operator /( Radius left, float right ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Radius operator /(Radius left, float right) { - return new Radius( left._radius / right ); + return new Radius(left._radius / right); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static float operator /( Radius left, Radius right ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static float operator /(Radius left, Radius right) { return left._radius / right._radius; } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static Radius operator +( Radius left, Radius Right ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static Radius operator +(Radius left, Radius Right) { - return new Radius( left._radius + Right._radius ); + return new Radius(left._radius + Right._radius); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static bool operator ==( Radius left, Radius right ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(Radius left, Radius right) { return left._radius == right._radius; } - public static implicit operator Degree( Radius r ) + public static implicit operator Degree(Radius r) { - return new Degree( ( r._radius * 180 ) / Scaler.Pi ); + return new Degree((r._radius * 180) / Scaler.Pi); } } diff --git a/StgSharp.Common/Geometries/IGeometry.cs b/StgSharp.Common/Geometries/IGeometry.cs index 3933e689..d88eb569 100644 --- a/StgSharp.Common/Geometries/IGeometry.cs +++ b/StgSharp.Common/Geometries/IGeometry.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="IGeometry.cs" +// file="IGeometry" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Geometries/IGeomtryBuffer.cs b/StgSharp.Common/Geometries/IGeomtryBuffer.cs index 3dc01ff7..3cb80107 100644 --- a/StgSharp.Common/Geometries/IGeomtryBuffer.cs +++ b/StgSharp.Common/Geometries/IGeomtryBuffer.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="IGeomtryBuffer.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="IGeomtryBuffer" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; diff --git a/StgSharp.Common/Geometries/IInstancing.cs b/StgSharp.Common/Geometries/IInstancing.cs index e4d19eec..ecab0a6d 100644 --- a/StgSharp.Common/Geometries/IInstancing.cs +++ b/StgSharp.Common/Geometries/IInstancing.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="IInstancing" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Geometries/IInstancingBuffer.cs b/StgSharp.Common/Geometries/IInstancingBuffer.cs index 7cd040e1..654ccb99 100644 --- a/StgSharp.Common/Geometries/IInstancingBuffer.cs +++ b/StgSharp.Common/Geometries/IInstancingBuffer.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="IInstancingBuffer" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Geometries/PlainGeometry/Cordinate.cs b/StgSharp.Common/Geometries/PlainGeometry/Cordinate.cs index cd9e5035..6fa362cf 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Cordinate.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Cordinate.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Cordinate.cs" +// file="Cordinate" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Geometries/PlainGeometry/Define/GeometryOperation.cs b/StgSharp.Common/Geometries/PlainGeometry/Define/GeometryOperation.cs index 1285e08e..755b1762 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Define/GeometryOperation.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Define/GeometryOperation.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="GeometryOperation" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Geometries/PlainGeometry/Define/IPlainEntity.cs b/StgSharp.Common/Geometries/PlainGeometry/Define/IPlainEntity.cs index f5c2effa..375e0604 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Define/IPlainEntity.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Define/IPlainEntity.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="IPlainEntity.cs" +// file="IPlainEntity" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Geometries/PlainGeometry/Define/ParticleOnPlain.cs b/StgSharp.Common/Geometries/PlainGeometry/Define/ParticleOnPlain.cs index 82afe920..02f2bba0 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Define/ParticleOnPlain.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Define/ParticleOnPlain.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="ParticleOnPlain" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Geometries/PlainGeometry/Define/PlainGeometry.cs b/StgSharp.Common/Geometries/PlainGeometry/Define/PlainGeometry.cs index de6720de..45e87a2e 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Define/PlainGeometry.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Define/PlainGeometry.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="PlainGeometry" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Geometries/PlainGeometry/Define/PlainInstancingBuffer.cs b/StgSharp.Common/Geometries/PlainGeometry/Define/PlainInstancingBuffer.cs index 29702a1f..452fcb6c 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Define/PlainInstancingBuffer.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Define/PlainInstancingBuffer.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="PlainInstancingBuffer" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Geometries/PlainGeometry/Parallelogram.cs b/StgSharp.Common/Geometries/PlainGeometry/Parallelogram.cs index f1e5bcc6..34ac987a 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Parallelogram.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Parallelogram.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="Parallelogram" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -43,12 +43,12 @@ namespace StgSharp.Geometries public Parallelogram(float v0x, float v0y, float v1x, float v1y, float v2x, float v2y, float v3x, float v3y) : base(v0x, v0y, v1x, v1y, v2x, v2y, v3x, v3y) { - #if DEBUG - if( this[ 0 ].Coord + this[ 2 ].Coord != this[ 1 ].Coord + this[ 3 ].Coord ) + #if DEBUG + if (this[0].Coord + this[2].Coord != this[1].Coord + this[3].Coord) { InternalIO.InternalWriteLog( "Init of geometry item failed, because four vertices cannot form a rectangle.", - LogType.Warning ); + LogType.Warning); } #endif } @@ -65,12 +65,12 @@ namespace StgSharp.Geometries float v3y) : base(coordination, v0x, v0y, v1x, v1y, v2x, v2y, v3x, v3y) { - #if DEBUG - if( this[ 0 ].Coord + this[ 2 ].Coord != this[ 1 ].Coord + this[ 3 ].Coord ) + #if DEBUG + if (this[0].Coord + this[2].Coord != this[1].Coord + this[3].Coord) { InternalIO.InternalWriteLog( "Init of geometry item failed, because four vertices cannot form a rectangle.", - LogType.Warning ); + LogType.Warning); } #endif } diff --git a/StgSharp.Common/Geometries/PlainGeometry/Plain.cs b/StgSharp.Common/Geometries/PlainGeometry/Plain.cs index 5f85cc4e..ccb02f9a 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Plain.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Plain.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="Plain" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Geometries/PlainGeometry/Polygon4.cs b/StgSharp.Common/Geometries/PlainGeometry/Polygon4.cs index fa3d2da6..007569c0 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Polygon4.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Polygon4.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="Polygon4" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -36,7 +36,14 @@ namespace StgSharp.Geometries public class Polygon4 : PlainGeometry { - protected static int[] Indices = [ 0, 1, 2, 0, 2, 3 ]; + protected static int[] Indices = [ + 0, + 1, + 2, + 0, + 2, + 3 + ]; internal Polygon4() : base(PlainCoordinate.StandardPlainCoordination) diff --git a/StgSharp.Common/Geometries/PlainGeometry/Polygon5.cs b/StgSharp.Common/Geometries/PlainGeometry/Polygon5.cs index 2aaecbe7..320dddda 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Polygon5.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Polygon5.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="Polygon5" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -36,7 +36,17 @@ namespace StgSharp.Geometries public unsafe class Polygon5 : PlainGeometry { - internal static int[] Indices = [ 0, 1, 2, 0, 2, 3, 0, 3, 4 ]; + internal static int[] Indices = [ + 0, + 1, + 2, + 0, + 2, + 3, + 0, + 3, + 4 + ]; public unsafe Polygon5() : base(PlainCoordinate.StandardPlainCoordination) diff --git a/StgSharp.Common/Geometries/PlainGeometry/Polygon6.cs b/StgSharp.Common/Geometries/PlainGeometry/Polygon6.cs index f33d5c34..3cd6d964 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Polygon6.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Polygon6.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="Polygon6" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -36,7 +36,20 @@ namespace StgSharp.Geometries public class Polygon6 : PlainGeometry { - internal static int[] Indices = [ 0, 1, 2, 0, 2, 3, 0, 3, 4, 0, 4, 5 ]; + internal static int[] Indices = [ + 0, + 1, + 2, + 0, + 2, + 3, + 0, + 3, + 4, + 0, + 4, + 5 + ]; public Polygon6() : base(PlainCoordinate.StandardPlainCoordination) diff --git a/StgSharp.Common/Geometries/PlainGeometry/Rectangle.cs b/StgSharp.Common/Geometries/PlainGeometry/Rectangle.cs index 19119162..56389b05 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Rectangle.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Rectangle.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Rectangle.cs" +// file="Rectangle" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -42,10 +39,10 @@ namespace StgSharp.Geometries public Rectangle(float v0x, float v0y, float v1x, float v1y, float v2x, float v2y, float v3x, float v3y) : base(v0x, v0y, v1x, v1y, v2x, v2y, v3x, v3y) { - #if DEBUG - Vec2 side0 = ( this[ 0 ].Coord - this[ 1 ].Coord ).XY; - Vec2 side1 = ( this[ 2 ].Coord - this[ 1 ].Coord ).XY; - if( side0.Cross( side1 ) == 0 ) { + #if DEBUG + Vec2 side0 = (this[0].Coord - this[1].Coord).XY; + Vec2 side1 = (this[2].Coord - this[1].Coord).XY; + if (side0.Cross(side1) == 0) { throw new ArgumentException(); } #endif @@ -63,10 +60,10 @@ namespace StgSharp.Geometries float v3y) : base(coordination, v0x, v0y, v1x, v1y, v2x, v2y, v3x, v3y) { - #if DEBUG - Vec2 side0 = ( this[ 0 ].Coord - this[ 1 ].Coord ).XY; - Vec2 side1 = ( this[ 2 ].Coord - this[ 1 ].Coord ).XY; - if( side0.Cross( side1 ) == 0 ) { + #if DEBUG + Vec2 side0 = (this[0].Coord - this[1].Coord).XY; + Vec2 side1 = (this[2].Coord - this[1].Coord).XY; + if (side0.Cross(side1) == 0) { throw new ArgumentException(); } #endif diff --git a/StgSharp.Common/Geometries/PlainGeometry/Square.cs b/StgSharp.Common/Geometries/PlainGeometry/Square.cs index dc4ec5d7..15f04494 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Square.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Square.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Square.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="Square" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Mathematics; using System.Numerics; @@ -40,18 +37,10 @@ namespace StgSharp.Geometries public class Square : Rectangle { - public Square( - float v0x, - float v0y, - float v1x, - float v1y, - float v2x, - float v2y, - float v3x, - float v3y ) - : base( v0x, v0y, v1x, v1y, v2x, v2y, v3x, v3y ) + public Square(float v0x, float v0y, float v1x, float v1y, float v2x, float v2y, float v3x, float v3y) + : base(v0x, v0y, v1x, v1y, v2x, v2y, v3x, v3y) { - if( true ) { } + if (true) { } } } diff --git a/StgSharp.Common/Geometries/PlainGeometry/Triangle.cs b/StgSharp.Common/Geometries/PlainGeometry/Triangle.cs index b7d97da1..e35b018c 100644 --- a/StgSharp.Common/Geometries/PlainGeometry/Triangle.cs +++ b/StgSharp.Common/Geometries/PlainGeometry/Triangle.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Triangle.cs" +// file="Triangle" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -40,7 +37,11 @@ namespace StgSharp.Geometries public unsafe class Triangle : PlainGeometry { - internal static int[] Indices = [ 0, 1, 2 ]; + internal static int[] Indices = [ + 0, + 1, + 2 + ]; public Triangle() : base(PlainCoordinate.StandardPlainCoordination) diff --git a/StgSharp.Common/Geometries/Point.cs b/StgSharp.Common/Geometries/Point.cs index 75366f4d..96a8db7c 100644 --- a/StgSharp.Common/Geometries/Point.cs +++ b/StgSharp.Common/Geometries/Point.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="Point" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Geometries/SpaceGeometry/Class1.cs b/StgSharp.Common/Geometries/SpaceGeometry/Class1.cs index 1a2d98c1..60e2a685 100644 --- a/StgSharp.Common/Geometries/SpaceGeometry/Class1.cs +++ b/StgSharp.Common/Geometries/SpaceGeometry/Class1.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Class1.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="Class1" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; diff --git a/StgSharp.Common/Geometries/SpaceGeometry/TriangulatedSurface.cs b/StgSharp.Common/Geometries/SpaceGeometry/TriangulatedSurface.cs index 2e903c8c..ee9a7611 100644 --- a/StgSharp.Common/Geometries/SpaceGeometry/TriangulatedSurface.cs +++ b/StgSharp.Common/Geometries/SpaceGeometry/TriangulatedSurface.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="TriangulatedSurface" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Global.cs b/StgSharp.Common/Global.cs index 61879606..af546338 100644 --- a/StgSharp.Common/Global.cs +++ b/StgSharp.Common/Global.cs @@ -1,38 +1,30 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Global.cs" -// Project: StepVisualizer -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// file="Global" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// This file is used by Code Analysis to maintain SuppressMessage -// attributes that are applied to this project. -// Project-level suppressions either have no target or are given -// a specific target and scoped to a namespace, type, member, etc. - global using StgSharp.Internal; global using StgSharp.Internal.Intrinsic; global using StgSharp.Internal.OpenGL; diff --git a/StgSharp.Common/Graphics/CPUanimation/IImageProvider.cs b/StgSharp.Common/Graphics/CPUanimation/IImageProvider.cs index 1741e253..63095bd9 100644 --- a/StgSharp.Common/Graphics/CPUanimation/IImageProvider.cs +++ b/StgSharp.Common/Graphics/CPUanimation/IImageProvider.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="IImageProvider.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="IImageProvider" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; diff --git a/StgSharp.Common/Graphics/CPUanimation/ImageHelper.cs b/StgSharp.Common/Graphics/CPUanimation/ImageHelper.cs index 017be4ec..559e4f06 100644 --- a/StgSharp.Common/Graphics/CPUanimation/ImageHelper.cs +++ b/StgSharp.Common/Graphics/CPUanimation/ImageHelper.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="ImageHelper.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="ImageHelper" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.ComponentModel; @@ -38,23 +35,23 @@ namespace StgSharp.Graphics public static class ImageHelper { - public static void Resize( Image i, int width, int height, ImageMovement move ) + public static void Resize(Image i, int width, int height, ImageMovement move) { - if( i == null ) { - throw new ArgumentNullException( nameof( i ) ); + if (i == null) { + throw new ArgumentNullException(nameof(i)); } - if( i.Size == (width, height) ) { + if (i.Size == (width, height)) { return; } - if( !Enum.IsDefined( typeof( ImageMovement ), move ) ) { - throw new InvalidEnumArgumentException( nameof( move ) ); + if (!Enum.IsDefined(typeof(ImageMovement), move)) { + throw new InvalidEnumArgumentException(nameof(move)); } byte[] oldData = i.Data; i.Data = new byte[width * height * i.PixelSize]; i.Height = height; i.Width = width; i.PixelUpdateCount++; - switch( move ) + switch (move) { case ImageMovement.Discard: break; diff --git a/StgSharp.Common/Graphics/Define/BufferObjectBase.cs b/StgSharp.Common/Graphics/Define/BufferObjectBase.cs index 1f84c1ac..5d65f090 100644 --- a/StgSharp.Common/Graphics/Define/BufferObjectBase.cs +++ b/StgSharp.Common/Graphics/Define/BufferObjectBase.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="BufferObjectBase.cs" +// file="BufferObjectBase" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Graphics/IGraphicAPIs.cs b/StgSharp.Common/Graphics/IGraphicAPIs.cs index 70646eac..823c60f1 100644 --- a/StgSharp.Common/Graphics/IGraphicAPIs.cs +++ b/StgSharp.Common/Graphics/IGraphicAPIs.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="IGraphicAPIs.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="IGraphicAPIs" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; @@ -37,10 +34,7 @@ namespace StgSharp.Graphics public interface IGraphicAPIs { - public IntPtr GraphicApiPackageHandle - { - get; - } + public IntPtr GraphicApiPackageHandle { get; } } } diff --git a/StgSharp.Common/Graphics/Image.cs b/StgSharp.Common/Graphics/Image.cs index 1c5599bf..4af9abf3 100644 --- a/StgSharp.Common/Graphics/Image.cs +++ b/StgSharp.Common/Graphics/Image.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Image.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="Image" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics.OpenGL; using StgSharp.Internal; using StgSharp.Mathematics; @@ -56,12 +53,12 @@ namespace StgSharp.Graphics _rawInfo = new ImageInfo(); } - internal Image( ImageInfo information ) + internal Image(ImageInfo information) { _rawInfo = information; _data = Array.Empty(); - //int length = _rawInfo.width * _rawInfo.height * _rawInfo.channel; + // int length = _rawInfo.width * _rawInfo.height * _rawInfo.channel; } public (int width, int height) Size @@ -73,7 +70,7 @@ namespace StgSharp.Graphics { get { - if( ( _data.Length == 0 ) || ( _data == null ) ) + if ((_data.Length == 0) || (_data == null)) { GetBytes(); return _data!; @@ -107,7 +104,7 @@ namespace StgSharp.Graphics internal set => _rawInfo.Width = value; } - public int PixelSize => ImageInfo.GetPixelSize( _rawInfo.pixelLayout, _rawInfo.Channel ); + public int PixelSize => ImageInfo.GetPixelSize(_rawInfo.pixelLayout, _rawInfo.Channel); public PixelChannelLayout PixelLayout { @@ -122,21 +119,18 @@ namespace StgSharp.Graphics get => ref _data; } - public void FromBytes( byte[] stream ) { } + public void FromBytes(byte[] stream) { } - public static unsafe Image FromFile( string route, ImageLoader loader ) + public static unsafe Image FromFile(string route, ImageLoader loader) { Image ret = new Image(); - fixed( ImageInfo* iptr = &ret._rawInfo ) { - InternalIO.InternalLoadImage( route, iptr, loader ); + fixed (ImageInfo* iptr = &ret._rawInfo) { + InternalIO.InternalLoadImage(route, iptr, loader); } return ret; } - public static Image FromMemory( - (int width, int height) size, - ImageChannel channel, - byte[] stream ) + public static Image FromMemory((int width, int height) size, ImageChannel channel, byte[] stream) { ImageInfo _info = new ImageInfo { @@ -145,7 +139,7 @@ namespace StgSharp.Graphics Channel = channel, StreamPtr = IntPtr.Zero }; - Image ret = new Image( _info ); + Image ret = new Image(_info); ret.PixelLayout = PixelChannelLayout.Byte; ret._data = stream; return ret; @@ -155,7 +149,7 @@ namespace StgSharp.Graphics (int width, int height) size, ImageChannel channel, PixelChannelLayout layout, - byte[] stream ) + byte[] stream) { ImageInfo _info = new ImageInfo { @@ -164,7 +158,7 @@ namespace StgSharp.Graphics Channel = channel, StreamPtr = IntPtr.Zero }; - Image ret = new Image( _info ); + Image ret = new Image(_info); ret.PixelLayout = layout; ret._data = stream; return ret; @@ -172,12 +166,12 @@ namespace StgSharp.Graphics public unsafe byte[] GetBytes() { - if( _data.Length == 0 ) + if (_data.Length == 0) { - int size = Width * Height * ImageInfo.GetPixelSize( PixelLayout, Channel ); - _data = new Span( ( byte* )_rawInfo.StreamPtr, size ).ToArray(); - fixed( ImageInfo* pptr = &_rawInfo ) { - InternalIO.InternalUnloadImage( pptr ); + int size = Width * Height * ImageInfo.GetPixelSize(PixelLayout, Channel); + _data = new Span((byte*)_rawInfo.StreamPtr, size).ToArray(); + fixed (ImageInfo* pptr = &_rawInfo) { + InternalIO.InternalUnloadImage(pptr); } _rawInfo.StreamPtr = IntPtr.Zero; } @@ -186,7 +180,7 @@ namespace StgSharp.Graphics public Image ProvideImage() => this; - internal static Image FromMemory( ImageInfo info, byte[] data, int operationCount ) + internal static Image FromMemory(ImageInfo info, byte[] data, int operationCount) { return new Image { diff --git a/StgSharp.Common/Graphics/ImageInfo.cs b/StgSharp.Common/Graphics/ImageInfo.cs index ccb46ce5..963fe35e 100644 --- a/StgSharp.Common/Graphics/ImageInfo.cs +++ b/StgSharp.Common/Graphics/ImageInfo.cs @@ -1,21 +1,46 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Runtime.CompilerServices; +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="ImageInfo" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics.OpenGL; +using System; +using System.Collections.Generic; +using System.Runtime.CompilerServices; using System.Runtime.InteropServices; - +using System.Text; namespace StgSharp.Graphics { [UnmanagedFunctionPointer(CallingConvention.Cdecl, CharSet = CharSet.Ansi)] public delegate IntPtr ImageLoader( - string name, - ref int width, - ref int height, - ref int definedChannel, - int desiredChannel); - + string name, + ref int width, + ref int height, + ref int definedChannel, + int desiredChannel); [StructLayout(LayoutKind.Sequential)] internal struct ImageInfo @@ -76,7 +101,6 @@ namespace StgSharp.Graphics return $"{channel}\t{width}\t{height}\t{(ulong)StreamPtr}"; } - internal static int GetChannelCount(ImageChannel channel) { return channel switch @@ -90,9 +114,7 @@ namespace StgSharp.Graphics }; } - internal static int GetPixelSize( - PixelChannelLayout layout, - ImageChannel channel) + internal static int GetPixelSize(PixelChannelLayout layout, ImageChannel channel) { return layout switch { @@ -137,5 +159,4 @@ namespace StgSharp.Graphics WithAlphaChannel = glConst.RGBA, } - } diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/AutoTexture.cs b/StgSharp.Common/Graphics/OpenGL/Buffer/AutoTexture.cs index cf1fadd6..cdfc232e 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/AutoTexture.cs +++ b/StgSharp.Common/Graphics/OpenGL/Buffer/AutoTexture.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="AutoTexture.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="AutoTexture" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Commom.Collections; using System; using System.Collections.Generic; @@ -62,22 +59,22 @@ namespace StgSharp.Graphics.OpenGL private TextureProperty _textureProperty; - private AutoTextureGL( TextureGL texture ) + private AutoTextureGL(TextureGL texture) { texturePackage = texture; _size = texture.Count; imageIndexMap = new BidirectionalDictionary(); - unusedTextureUnitIndex = new Queue( Enumerable.Range( 0, _size ) ); + unusedTextureUnitIndex = new Queue(Enumerable.Range(0, _size)); usedTextureIndex = new LinkedList(); propertyCache = new TextureProperty[_size]; } - public AutoTextureGL( int textureObjectSize, [NotNull]glRender binding ) + public AutoTextureGL(int textureObjectSize, [NotNull]glRender binding) { this._size = textureObjectSize; imageIndexMap = new BidirectionalDictionary(); - texturePackage = new TextureGL( textureObjectSize, binding ); - unusedTextureUnitIndex = new Queue( Enumerable.Range( 0, _size ) ); + texturePackage = new TextureGL(textureObjectSize, binding); + unusedTextureUnitIndex = new Queue(Enumerable.Range(0, _size)); usedTextureIndex = new LinkedList(); propertyCache = new TextureProperty[_size]; } @@ -93,69 +90,69 @@ namespace StgSharp.Graphics.OpenGL get => texturePackage.GL; } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public void SelectTextureAndBind( Image i ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SelectTextureAndBind(Image i) { TextureProperty property = _textureProperty; - SelectTextureAndBind( i, property ); + SelectTextureAndBind(i, property); } - public void SelectTextureAndBind( [NotNull]Image i, TextureProperty property ) + public void SelectTextureAndBind([NotNull]Image i, TextureProperty property) { - //usable texture with image match - if( imageIndexMap.TryGetValue( i, out int index ) ) + // usable texture with image match + if (imageIndexMap.TryGetValue(i, out int index)) { - //prop setting match - if( propertyCache[ index ] == property ) + // prop setting match + if (propertyCache[index] == property) { _currentIndex = index; //GL.Assert(true); - texturePackage.Bind2D( index ); //GL.Assert(true); - if( i.PixelUpdateCount != imageUpdateIndex[ i ] ) + texturePackage.Bind2D(index); //GL.Assert(true); + if (i.PixelUpdateCount != imageUpdateIndex[i]) { - texturePackage.LoadTexture( index, i ); //GL.Assert(true); + texturePackage.LoadTexture(index, i); //GL.Assert(true); } } else { _currentIndex = index; //GL.Assert(true); - texturePackage.Bind2D( index ); //GL.Assert(true); - texturePackage.Set2dProperty( index, property ); //GL.Assert(true); - if( i.PixelUpdateCount != imageUpdateIndex[ i ] ) + texturePackage.Bind2D(index); //GL.Assert(true); + texturePackage.Set2dProperty(index, property); //GL.Assert(true); + if (i.PixelUpdateCount != imageUpdateIndex[i]) { - texturePackage.LoadTexture( index, i ); //GL.Assert(true); + texturePackage.LoadTexture(index, i); //GL.Assert(true); } } } else { - if( unusedTextureUnitIndex.TryDequeue( out int newIndex ) ) + if (unusedTextureUnitIndex.TryDequeue(out int newIndex)) { - //has extra unused texture object - imageIndexMap.Add( i, index ); - texturePackage.Bind2D( index ); - texturePackage.Set2dProperty( index, property ); - texturePackage.LoadTexture( index, i ); - usedTextureIndex.AddLast( newIndex ); - propertyCache[ newIndex ] = property; - imageUpdateIndex[ i ] = i.PixelUpdateCount; + // has extra unused texture object + imageIndexMap.Add(i, index); + texturePackage.Bind2D(index); + texturePackage.Set2dProperty(index, property); + texturePackage.LoadTexture(index, i); + usedTextureIndex.AddLast(newIndex); + propertyCache[newIndex] = property; + imageUpdateIndex[i] = i.PixelUpdateCount; } else { - //recycle from current + // recycle from current int reusedIndex = usedTextureIndex.First!.Value; usedTextureIndex.RemoveFirst(); - usedTextureIndex.AddLast( reusedIndex ); - imageIndexMap[ i ] = reusedIndex; - propertyCache[ newIndex ] = property; - imageUpdateIndex[ i ] = i.PixelUpdateCount; + usedTextureIndex.AddLast(reusedIndex); + imageIndexMap[i] = reusedIndex; + propertyCache[newIndex] = property; + imageUpdateIndex[i] = i.PixelUpdateCount; } } } - public static AutoTextureGL ToAuto( [NotNull]TextureGL texture ) + public static AutoTextureGL ToAuto([NotNull]TextureGL texture) { - if( texture.IndexOfCurrentTexture != -1 ) { - throw new InvalidOperationException( "Texture to be converted has been editted." ); + if (texture.IndexOfCurrentTexture != -1) { + throw new InvalidOperationException("Texture to be converted has been editted."); } - return new AutoTextureGL( texture ); + return new AutoTextureGL(texture); } } diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/EBO.cs b/StgSharp.Common/Graphics/OpenGL/Buffer/EBO.cs index e2f513a9..86aa5f9b 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/EBO.cs +++ b/StgSharp.Common/Graphics/OpenGL/Buffer/EBO.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="EBO.cs" +// file="EBO" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -61,15 +58,13 @@ namespace StgSharp.Graphics.OpenGL GL.BindBuffer(BufferType.ElementArrayBuffer, _bufferHandle[index]); } - public void SetValue(int index, T[] bufferArray, BufferUsage usage) - where T: unmanaged, INumber + public void SetValue(int index, T[] bufferArray, BufferUsage usage) where T: unmanaged, INumber { GL.BindBuffer(BufferType.ElementArrayBuffer, _bufferHandle[index]); GL.SetBufferData(BufferType.ElementArrayBuffer, bufferArray, usage); } - public void SetValue(int index, ReadOnlySpan bufferSpan, BufferUsage usage) - where T: unmanaged, INumber + public void SetValue(int index, ReadOnlySpan bufferSpan, BufferUsage usage) where T: unmanaged, INumber { GL.BindBuffer(BufferType.ElementArrayBuffer, _bufferHandle[index]); GL.SetBufferData(BufferType.ElementArrayBuffer, bufferSpan, usage); diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/FBO.cs b/StgSharp.Common/Graphics/OpenGL/Buffer/FBO.cs index 18538958..9d9d7443 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/FBO.cs +++ b/StgSharp.Common/Graphics/OpenGL/Buffer/FBO.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="FBO.cs" +// file="FBO" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/GLBufferObjectBase.cs b/StgSharp.Common/Graphics/OpenGL/Buffer/GLBufferObjectBase.cs index 675cb155..a3c5c756 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/GLBufferObjectBase.cs +++ b/StgSharp.Common/Graphics/OpenGL/Buffer/GLBufferObjectBase.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="GLBufferObjectBase.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="GLBufferObjectBase" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics.OpenGL; using System; @@ -41,7 +38,7 @@ namespace StgSharp.Graphics.OpenGL private readonly glRender _contextBinding; - protected GlBufferObjectBase( glRender contextBinding ) + protected GlBufferObjectBase(glRender contextBinding) { binding = contextBinding; _contextBinding = contextBinding; diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/RBO.cs b/StgSharp.Common/Graphics/OpenGL/Buffer/RBO.cs index 29b52b24..c2810b67 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/RBO.cs +++ b/StgSharp.Common/Graphics/OpenGL/Buffer/RBO.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="RBO.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="RBO" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics.OpenGL; using System; @@ -40,30 +37,30 @@ namespace StgSharp.Graphics.OpenGL public sealed class RenderBuffer : GlBufferObjectBase { - public RenderBuffer( int count, glRender binding ) - : base( binding ) + public RenderBuffer(int count, glRender binding) + : base(binding) { - _bufferHandle = GL.GenRenderBuffer( count ); + _bufferHandle = GL.GenRenderBuffer(count); } - public override void Bind( int index ) + public override void Bind(int index) { - GL.BindRenderBuffer( this[ index ] ); + GL.BindRenderBuffer(this[index]); } - public void Store( RenderBufferInternalFormat format, (int width, int height) size ) + public void Store(RenderBufferInternalFormat format, (int width, int height) size) { - if( ( size.width > binding.Width ) || ( size.height > binding.Height ) ) { - World.LogWarning( "FrameBuffer is larger than current canvas binding" ); + if ((size.width > binding.Width) || (size.height > binding.Height)) { + World.LogWarning("FrameBuffer is larger than current canvas binding"); } } - protected override void Dispose( bool disposing ) + protected override void Dispose(bool disposing) { - foreach( GlHandle item in _bufferHandle ) + foreach (GlHandle item in _bufferHandle) { - Console.WriteLine( "removing a render buffer" ); - GL.DeleteRenderBuffer( item ); + Console.WriteLine("removing a render buffer"); + GL.DeleteRenderBuffer(item); } } diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/TextureGL.cs b/StgSharp.Common/Graphics/OpenGL/Buffer/TextureGL.cs index 84bf7ab5..a3ebe0cf 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/TextureGL.cs +++ b/StgSharp.Common/Graphics/OpenGL/Buffer/TextureGL.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="TextureGL.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="TextureGL" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.HighPerformance; using System; @@ -46,16 +43,16 @@ namespace StgSharp.Graphics.OpenGL private OpenGLFunction _gl; internal GlHandle[] _textureHandle; - internal TextureGL( int count, glRender binding ) + internal TextureGL(int count, glRender binding) { - //sourceList = new Image[count]; + // sourceList = new Image[count]; this._gl = binding.GL; - _textureHandle = _gl.GenTextures( count ); + _textureHandle = _gl.GenTextures(count); } - public GlHandle this[ int index ] + public GlHandle this[int index] { - get => _textureHandle[ index ]; + get => _textureHandle[index]; } public int Count @@ -63,7 +60,7 @@ namespace StgSharp.Graphics.OpenGL get => _textureHandle.Length; } - //internal Image[] sourceList; + // internal Image[] sourceList; public int IndexOfCurrentTexture { @@ -72,15 +69,15 @@ namespace StgSharp.Graphics.OpenGL internal OpenGLFunction GL => _gl; - public void ActivateAs( TextureUnit unit ) + public void ActivateAs(TextureUnit unit) { - _gl.ActiveTextureUnit( ( uint )unit ); + _gl.ActiveTextureUnit((uint)unit); } - public void Bind2D( int index ) + public void Bind2D(int index) { currentEditingTextureIndex = index; - _gl.BindTexture( glConst.TEXTURE_2D, _textureHandle[ index ] ); + _gl.BindTexture(glConst.TEXTURE_2D, _textureHandle[index]); } /// @@ -92,79 +89,73 @@ namespace StgSharp.Graphics.OpenGL /// /// /// - public unsafe void LoadTexture( int index, Image i ) + public unsafe void LoadTexture(int index, Image i) { byte[] handle = i.PixelBuffer; _gl.TextureImage2d( - Texture2DTarget.Texture2D, 0, i.Channel, ( uint )i.Width, ( uint )i.Height, - i.Channel, i.PixelLayout, pixels: handle ); - _gl.GenerateMipmap( Texture2DTarget.Texture2D ); + Texture2DTarget.Texture2D, 0, i.Channel, (uint)i.Width, (uint)i.Height, i.Channel, i.PixelLayout, + pixels:handle); + _gl.GenerateMipmap(Texture2DTarget.Texture2D); } #region texture setting - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public void Set2dFilterProperty( - int index, - TextureFilter onMinify, - TextureFilter onMagnify ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Set2dFilterProperty(int index, TextureFilter onMinify, TextureFilter onMagnify) { #if DEBUG - if( index != currentEditingTextureIndex ) + if (index != currentEditingTextureIndex) { throw new InvalidOperationException( - "Texture to be editted is not the one being activated." ); + "Texture to be editted is not the one being activated."); } #endif - _gl.TextureParameter( glConst.TEXTURE_2D, glConst.TEXTURE_MIN_FILTER, ( int )onMinify ); - _gl.TextureParameter( glConst.TEXTURE_2D, glConst.TEXTURE_MAG_FILTER, - ( int )onMagnify ); + _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_MIN_FILTER, (int)onMinify); + _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_MAG_FILTER, + (int)onMagnify); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public void Set2dWrapProperty( - int index, - TextureWrap onHorizontial, - TextureWrap onVertical ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Set2dWrapProperty(int index, TextureWrap onHorizontial, TextureWrap onVertical) { #if DEBUG - if( index != currentEditingTextureIndex ) + if (index != currentEditingTextureIndex) { throw new InvalidOperationException( - "Texture to be editted is not the one being activated." ); + "Texture to be editted is not the one being activated."); } #endif - _gl.TextureParameter( glConst.TEXTURE_2D, glConst.TEXTURE_WRAP_S, - ( int )onHorizontial ); - _gl.TextureParameter( glConst.TEXTURE_2D, glConst.TEXTURE_WRAP_T, ( int )onVertical ); + _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_WRAP_S, + (int)onHorizontial); + _gl.TextureParameter(glConst.TEXTURE_2D, glConst.TEXTURE_WRAP_T, (int)onVertical); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public void Set2dProperty( int index, TextureProperty property ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Set2dProperty(int index, TextureProperty property) { - Set2dFilterProperty( index, property.FilterOnMinify, property.FilterOnMagnify ); - Set2dWrapProperty( index, property.WrapOnHorizontial, property.WrapOnVertical ); + Set2dFilterProperty(index, property.FilterOnMinify, property.FilterOnMagnify); + Set2dWrapProperty(index, property.WrapOnHorizontial, property.WrapOnVertical); } #endregion texture setting } - [StructLayout( LayoutKind.Explicit )] + [StructLayout(LayoutKind.Explicit)] public struct TextureProperty { - [FieldOffset( 0 )] private M128 mask; - [FieldOffset( 0 )] private TextureFilter mag; - [FieldOffset( 4 )] private TextureFilter min; + [FieldOffset(0)] private M128 mask; + [FieldOffset(0)] private TextureFilter mag; + [FieldOffset(4)] private TextureFilter min; - [FieldOffset( 8 )] private TextureWrap hori; - [FieldOffset( 12 )] private TextureWrap vert; + [FieldOffset(8)] private TextureWrap hori; + [FieldOffset(12)] private TextureWrap vert; public TextureProperty( TextureFilter onMagnify, TextureFilter onMinify, TextureWrap onHorizontial, - TextureWrap onVertical ) + TextureWrap onVertical) { FilterOnMagnify = onMagnify; FilterOnMinify = onMinify; @@ -196,15 +187,15 @@ namespace StgSharp.Graphics.OpenGL set => vert = value; } - public override bool Equals( [NotNullWhen( true )] object obj ) + public override bool Equals([NotNullWhen(true)] object obj) { - return base.Equals( obj ); + return base.Equals(obj); } public override int GetHashCode() { return HashCode.Combine( - FilterOnMagnify, FilterOnMagnify, WrapOnHorizontial, WrapOnVertical ); + FilterOnMagnify, FilterOnMagnify, WrapOnHorizontial, WrapOnVertical); } public override string ToString() @@ -212,12 +203,12 @@ namespace StgSharp.Graphics.OpenGL return $"FilterOnMagnify:{FilterOnMagnify}, " + $"FilterOnMagnify:{FilterOnMagnify}, " + $"WrapOnHorizontial:{WrapOnHorizontial}, " + $"WrapOnVertical:{WrapOnVertical}"; } - public static bool operator !=( TextureProperty left, TextureProperty right ) + public static bool operator !=(TextureProperty left, TextureProperty right) { return left.mask != right.mask; } - public static bool operator ==( TextureProperty left, TextureProperty right ) + public static bool operator ==(TextureProperty left, TextureProperty right) { return left.mask == right.mask; } @@ -226,11 +217,11 @@ namespace StgSharp.Graphics.OpenGL ( TextureFilter onMagnify, TextureFilter onMinify, TextureWrap onHorizontial, TextureWrap onVertical - ) propertyValueTuple ) + ) propertyValueTuple) { return new TextureProperty( propertyValueTuple.onMagnify, propertyValueTuple.onMinify, - propertyValueTuple.onHorizontial, propertyValueTuple.onVertical ); + propertyValueTuple.onHorizontial, propertyValueTuple.onVertical); } } diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/VAO.cs b/StgSharp.Common/Graphics/OpenGL/Buffer/VAO.cs index 46cc1121..0efbd93a 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/VAO.cs +++ b/StgSharp.Common/Graphics/OpenGL/Buffer/VAO.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="VAO.cs" -// Project: StepVisualizer -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="VAO" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Runtime.CompilerServices; @@ -38,41 +35,40 @@ namespace StgSharp.Graphics.OpenGL public sealed unsafe class VertexArray : GlBufferObjectBase { - internal VertexArray( int n, glRender binding ) - : base( binding ) + internal VertexArray(int n, glRender binding) + : base(binding) { - _bufferHandle = GL.GenVertexArrays( n ); + _bufferHandle = GL.GenVertexArrays(n); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public override sealed void Bind( int index ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public sealed override void Bind(int index) { - GL.BindVertexArray( _bufferHandle[ index ] ); + GL.BindVertexArray(_bufferHandle[index]); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void BindNull() { - OpenGLFunction.CurrentGL.BindVertexArray( GlHandle.Zero ); + OpenGLFunction.CurrentGL.BindVertexArray(GlHandle.Zero); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void SetVertexAttribute( uint attributeIndex, int vertexLength, TypeCode dataType, bool isNomalized, uint stride, - int pointer ) + int pointer) { - GL.SetVertexAttribute( - attributeIndex, vertexLength, dataType, isNomalized, stride, pointer ); + GL.SetVertexAttribute(attributeIndex, vertexLength, dataType, isNomalized, stride, pointer); } - protected override sealed void Dispose( bool disposing ) + protected sealed override void Dispose(bool disposing) { - if( disposing ) { - GL.DeleteVertexArrays( _bufferHandle ); + if (disposing) { + GL.DeleteVertexArrays(_bufferHandle); } } diff --git a/StgSharp.Common/Graphics/OpenGL/Buffer/VBO.cs b/StgSharp.Common/Graphics/OpenGL/Buffer/VBO.cs index 77305a3e..97da5169 100644 --- a/StgSharp.Common/Graphics/OpenGL/Buffer/VBO.cs +++ b/StgSharp.Common/Graphics/OpenGL/Buffer/VBO.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="VBO" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Graphics/OpenGL/GLfixed.cs b/StgSharp.Common/Graphics/OpenGL/GLfixed.cs index 9ccba942..82a106ff 100644 --- a/StgSharp.Common/Graphics/OpenGL/GLfixed.cs +++ b/StgSharp.Common/Graphics/OpenGL/GLfixed.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="GLfixed.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="GLfixed" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; @@ -37,13 +34,13 @@ using System.Threading.Tasks; namespace StgSharp.Internal { - [StructLayout( LayoutKind.Explicit, Size = 8 )] + [StructLayout(LayoutKind.Explicit, Size = 8)] public struct GLfixed { - [FieldOffset( 0 )] public int All; - [FieldOffset( 0 )] public short Decimals; - [FieldOffset( 4 )] public short Inertger; + [FieldOffset(0)] public int All; + [FieldOffset(0)] public short Decimals; + [FieldOffset(4)] public short Inertger; } } diff --git a/StgSharp.Common/Graphics/OpenGL/ShaderEdit/IglConvertable.cs b/StgSharp.Common/Graphics/OpenGL/ShaderEdit/IglConvertable.cs index b2055b7d..b555891b 100644 --- a/StgSharp.Common/Graphics/OpenGL/ShaderEdit/IglConvertable.cs +++ b/StgSharp.Common/Graphics/OpenGL/ShaderEdit/IglConvertable.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="IglConvertable.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="IglConvertable" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics.OpenGL; using System; @@ -49,7 +46,7 @@ namespace StgSharp.Graphics.ShaderEdit /// /// /// - public void GainAllUniforms( ShaderProgram source, params string[] uniformName ); + public void GainAllUniforms(ShaderProgram source, params string[] uniformName); /// /// diff --git a/StgSharp.Common/Graphics/OpenGL/ShaderEdit/Shader.cs b/StgSharp.Common/Graphics/OpenGL/ShaderEdit/Shader.cs index 2546cd7a..c67e788c 100644 --- a/StgSharp.Common/Graphics/OpenGL/ShaderEdit/Shader.cs +++ b/StgSharp.Common/Graphics/OpenGL/ShaderEdit/Shader.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Shader.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="Shader" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp; using StgSharp.Internal; @@ -52,13 +49,13 @@ namespace StgSharp.Graphics.OpenGL /// New instance of instance. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected override sealed ShaderProgram CreateShaderProgram() + protected sealed override ShaderProgram CreateShaderProgram() { return new ShaderProgram(this); } [MethodImpl(MethodImplOptions.AggressiveInlining)] - protected override sealed Shader CreateShaderSegment(ShaderType type, int count) + protected sealed override Shader CreateShaderSegment(ShaderType type, int count) { return new Shader(GL.CreateShaderSet(count, type), type, this); } @@ -221,8 +218,7 @@ namespace StgSharp.Graphics.OpenGL /// /// /// - public unsafe Uniform GetUniform(string name) where T: unmanaged - where U: struct + public unsafe Uniform GetUniform(string name) where T: unmanaged where U: struct where V: struct { return new Uniform(GL.GetUniformLocation(this.handle, name)); @@ -237,8 +233,7 @@ namespace StgSharp.Graphics.OpenGL /// /// /// - public unsafe Uniform GetUniform(string name) where T: unmanaged - where U: struct + public unsafe Uniform GetUniform(string name) where T: unmanaged where U: struct where V: struct where W: struct { @@ -251,8 +246,7 @@ namespace StgSharp.Graphics.OpenGL public unsafe void Link() { if (InternalIO.InternalLinkShaderProgram( - (OpenglContext*)this.GL.ContextHandle, handle.Value) == - 0) + (OpenglContext*)this.GL.ContextHandle, handle.Value) == 0) { IntPtr logPtr = InternalIO.InternalReadSSCLog(); try @@ -281,7 +275,7 @@ namespace StgSharp.Graphics.OpenGL ~ShaderProgram() { - //handle.Dispose(); + // handle.Dispose(); } } diff --git a/StgSharp.Common/Graphics/OpenGL/ShaderEdit/Uniform.cs b/StgSharp.Common/Graphics/OpenGL/ShaderEdit/Uniform.cs index 68553797..b0c8f421 100644 --- a/StgSharp.Common/Graphics/OpenGL/ShaderEdit/Uniform.cs +++ b/StgSharp.Common/Graphics/OpenGL/ShaderEdit/Uniform.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Uniform.cs" +// file="Uniform" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Graphics/OpenGL/glAPICalling.cs b/StgSharp.Common/Graphics/OpenGL/glAPICalling.cs index 05af95e9..943ec6f1 100644 --- a/StgSharp.Common/Graphics/OpenGL/glAPICalling.cs +++ b/StgSharp.Common/Graphics/OpenGL/glAPICalling.cs @@ -1,40 +1,37 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="glAPICalling.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="glAPICalling" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; namespace StgSharp.Graphics.OpenGL { - [AttributeUsage( AttributeTargets.Method )] + [AttributeUsage(AttributeTargets.Method)] public sealed class OpenGLAPICallingAttribute : Attribute { diff --git a/StgSharp.Common/Graphics/OpenGL/glApiManager.cs b/StgSharp.Common/Graphics/OpenGL/glApiManager.cs index 012eeb5a..f1c3aeb9 100644 --- a/StgSharp.Common/Graphics/OpenGL/glApiManager.cs +++ b/StgSharp.Common/Graphics/OpenGL/glApiManager.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="glApiManager.cs" +// file="glApiManager" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Graphics/OpenGL/glApiManagerConst.cs b/StgSharp.Common/Graphics/OpenGL/glApiManagerConst.cs index f3ccd5c3..ccea2fc6 100644 --- a/StgSharp.Common/Graphics/OpenGL/glApiManagerConst.cs +++ b/StgSharp.Common/Graphics/OpenGL/glApiManagerConst.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="glApiManagerConst.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="glApiManagerConst" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; diff --git a/StgSharp.Common/Graphics/OpenGL/glClampf.cs b/StgSharp.Common/Graphics/OpenGL/glClampf.cs index a1034d60..9b4e39db 100644 --- a/StgSharp.Common/Graphics/OpenGL/glClampf.cs +++ b/StgSharp.Common/Graphics/OpenGL/glClampf.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="glClampf.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="glClampf" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; @@ -40,25 +37,25 @@ namespace StgSharp.Internal /// /// OpenGL numeric type. An IEEE-754 floating-point value, clamped to the range [0,1]. /// - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public struct GLclampf { public float value; - public GLclampf( float a ) + public GLclampf(float a) { value = a; } - public static explicit operator float( GLclampf v ) + public static explicit operator float(GLclampf v) { return v.value; } - public static explicit operator GLclampf( float v ) + public static explicit operator GLclampf(float v) { - return new GLclampf( v ); + return new GLclampf(v); } } @@ -67,25 +64,25 @@ namespace StgSharp.Internal /// OpenGL numeric type. An IEEE-754 double precision floating-point value, clamped to the /// range [0,1]. /// - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public struct GLclampd { public double value; - public GLclampd( double a ) + public GLclampd(double a) { value = a; } - public static explicit operator double( GLclampd v ) + public static explicit operator double(GLclampd v) { return v.value; } - public static explicit operator GLclampd( double v ) + public static explicit operator GLclampd(double v) { - return new GLclampd( v ); + return new GLclampd(v); } } diff --git a/StgSharp.Common/Graphics/OpenGL/glConst.cs b/StgSharp.Common/Graphics/OpenGL/glConst.cs index ec723f0b..08a3f5ab 100644 --- a/StgSharp.Common/Graphics/OpenGL/glConst.cs +++ b/StgSharp.Common/Graphics/OpenGL/glConst.cs @@ -1,39 +1,36 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="glConst.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="glConst" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Drawing; namespace StgSharp.Graphics.OpenGL { - //rename types in style of glConst + // rename types in style of glConst public static unsafe class glConst { @@ -4848,15 +4845,15 @@ namespace StgSharp.Graphics.OpenGL public const uint DepthAndStencil = glConst.DEPTH_STENCIL_ATTACHMENT; public const uint Stencil = glConst.STENCIL_ATTACHMENT; - public static uint Color( int i ) + public static uint Color(int i) { #if DEBUG - if( ( i > OpenGLFunction.CurrentGL.AttachmentColorRange ) || ( i < 0 ) ) + if ((i > OpenGLFunction.CurrentGL.AttachmentColorRange) || (i < 0)) { throw new ArgumentOutOfRangeException(); } #endif - return ( uint )( glConst.COLOR_ATTACHMENT0 + i ); + return (uint)(glConst.COLOR_ATTACHMENT0 + i); } } diff --git a/StgSharp.Common/Graphics/OpenGL/glContext.cs b/StgSharp.Common/Graphics/OpenGL/glContext.cs index cdcd11e0..2e23581b 100644 --- a/StgSharp.Common/Graphics/OpenGL/glContext.cs +++ b/StgSharp.Common/Graphics/OpenGL/glContext.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="glContext.cs" -// Project: StepVisualizer -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="glContext" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.HighPerformance; using StgSharp.Internal; using StgSharp.Internal.Intrinsic; @@ -40,30 +37,30 @@ using System.Text; namespace StgSharp.Graphics.OpenGL { - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public struct OpenglContext { - public override bool Equals( object obj ) + public override bool Equals(object obj) { return false; } public override unsafe int GetHashCode() { - fixed( OpenglContext* sptr = &this ) { + fixed (OpenglContext* sptr = &this) { return sptr->GetHashCode(); } } - public static bool operator !=( OpenglContext left, OpenglContext right ) + public static bool operator !=(OpenglContext left, OpenglContext right) { - return !( left == right ); + return !(left == right); } - public static bool operator ==( OpenglContext left, OpenglContext right ) + public static bool operator ==(OpenglContext left, OpenglContext right) { - return left.Equals( right ); + return left.Equals(right); } #region glapi @@ -208,7 +205,7 @@ namespace StgSharp.Graphics.OpenGL internal unsafe delegate* glBufferPageCommitmentMemNV; internal unsafe delegate* glBufferParameteriAPPLE; internal unsafe delegate* glBufferStorage; - [Obsolete( "Param type uncertain", true )] internal unsafe delegate* glBufferStorageExternalEXT; + [Obsolete("Param type uncertain", true)] internal unsafe delegate* glBufferStorageExternalEXT; internal unsafe delegate* glBufferStorageMemEXT; internal unsafe delegate* glBufferSubData; internal unsafe delegate* glBufferSubDataARB; @@ -1389,7 +1386,7 @@ namespace StgSharp.Graphics.OpenGL internal unsafe delegate* glNamedBufferPageCommitmentMemNV; internal unsafe delegate* glNamedBufferStorage; internal unsafe delegate* glNamedBufferStorageEXT; - [Obsolete( "Param type uncertain", true )] internal unsafe delegate* glNamedBufferStorageExternalEXT; + [Obsolete("Param type uncertain", true)] internal unsafe delegate* glNamedBufferStorageExternalEXT; internal unsafe delegate* glNamedBufferStorageMemEXT; internal unsafe delegate* glNamedBufferSubData; internal unsafe delegate* glNamedBufferSubDataEXT; diff --git a/StgSharp.Common/Graphics/OpenGL/glEnum.cs b/StgSharp.Common/Graphics/OpenGL/glEnum.cs index c9895567..82014a9b 100644 --- a/StgSharp.Common/Graphics/OpenGL/glEnum.cs +++ b/StgSharp.Common/Graphics/OpenGL/glEnum.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="glEnum.cs" -// Project: StepVisualizer -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="glEnum" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System.Runtime.CompilerServices; namespace StgSharp.Graphics.OpenGL diff --git a/StgSharp.Common/Graphics/OpenGL/glException.cs b/StgSharp.Common/Graphics/OpenGL/glException.cs index da15f02d..2cf1906b 100644 --- a/StgSharp.Common/Graphics/OpenGL/glException.cs +++ b/StgSharp.Common/Graphics/OpenGL/glException.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="glException.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="glException" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Diagnostics; @@ -41,51 +38,48 @@ namespace StgSharp.Graphics.OpenGL public sealed class GlErrorOverflowException : Exception { - public GlErrorOverflowException( int errorCount, uint errorCode ) + public GlErrorOverflowException(int errorCount, uint errorCode) : base( - "Too many opengl error detected at certain position. " + $"The amount of errors exceeds {errorCount}. " + $"Code of the last error is {errorCode}" ) { } + "Too many opengl error detected at certain position. " + $"The amount of errors exceeds {errorCount}. " + $"Code of the last error is {errorCode}") { } } public sealed class GlExecutionException : Exception { - public GlExecutionException( uint errorCode ) - : base( $"Critical OpenGL error: {errorCode}" ) { } + public GlExecutionException(uint errorCode) : base($"Critical OpenGL error: {errorCode}") { } } public sealed class GlArrayFormatException : Exception { - internal GlArrayFormatException( string message ) : base( message ) { } + internal GlArrayFormatException(string message) : base(message) { } - internal GlArrayFormatException( SerializationInfo info, StreamingContext context ) - : base( info, context ) { } + internal GlArrayFormatException(SerializationInfo info, StreamingContext context) : base(info, context) { } - internal GlArrayFormatException( string message, Exception innerException ) - : base( message, innerException ) { } + internal GlArrayFormatException(string message, Exception innerException) : base(message, innerException) { } - public GlArrayFormatException( PixelChannelLayout layout, string arrayname ) - : base( $"{arrayname} cannot be used as layout of {layout}" ) { } + public GlArrayFormatException(PixelChannelLayout layout, string arrayname) + : base($"{arrayname} cannot be used as layout of {layout}") { } } public static partial class GlHelper { - public static bool CheckArrayFormat( this Array array, PixelChannelLayout layout ) + public static bool CheckArrayFormat(this Array array, PixelChannelLayout layout) { return layout switch { - PixelChannelLayout.Byte or PixelChannelLayout.UByte332 or PixelChannelLayout.UByte233Rev => ( array is byte[] ) || - ( array is sbyte[] ), + PixelChannelLayout.Byte or PixelChannelLayout.UByte332 or PixelChannelLayout.UByte233Rev => (array is byte[]) || + (array is sbyte[]), PixelChannelLayout.Short => array is short[], PixelChannelLayout.UShort => array is ushort[], PixelChannelLayout.Int => array is int[], PixelChannelLayout.Float => array is float[], - PixelChannelLayout.UShort4444 => ( array is ushort[] ) || ( array is byte[] ), - PixelChannelLayout.UByte => ( array is byte[] ) || ( array is sbyte[] ), + PixelChannelLayout.UShort4444 => (array is ushort[]) || (array is byte[]), + PixelChannelLayout.UByte => (array is byte[]) || (array is sbyte[]), PixelChannelLayout.UInt => array is uint[], PixelChannelLayout.UShort565 or PixelChannelLayout.UShort565Rev or diff --git a/StgSharp.Common/Graphics/OpenGL/glFucntionSourceManager.cs b/StgSharp.Common/Graphics/OpenGL/glFucntionSourceManager.cs index b41d2845..e913b18d 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFucntionSourceManager.cs +++ b/StgSharp.Common/Graphics/OpenGL/glFucntionSourceManager.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="glFucntionSourceManager.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="glFucntionSourceManager" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the ¡°Software¡±), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED ¡°AS IS¡±, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp; using System; @@ -52,26 +49,26 @@ namespace StgSharp.Graphics.OpenGL get => unusedTextureImageUintInitilizing.Value; } - internal void ReturnAvailableUnit( IEnumerable source ) + internal void ReturnAvailableUnit(IEnumerable source) { int v = glConst.TEXTURE0 + TextureUnitCount; - foreach( TextureUnit unit in source ) + foreach (TextureUnit unit in source) { - if( ( int )unit > v ) { + if ((int)unit > v) { throw new InvalidOperationException( - "Source contains texture unit beyond context support." ); + "Source contains texture unit beyond context support."); } } } - internal int TryGetAvailableTextureUnit( int count, out IEnumerable result ) + internal int TryGetAvailableTextureUnit(int count, out IEnumerable result) { result = new Queue(); - for( int i = 0; i < count; i++ ) + for (int i = 0; i < count; i++) { - if( UnusedTextureImageUint.TryDequeue( out TextureUnit unit ) ) + if (UnusedTextureImageUint.TryDequeue(out TextureUnit unit)) { - ( result as Queue )!.Enqueue( unit ); + (result as Queue)!.Enqueue(unit); } else { return i; @@ -83,8 +80,8 @@ namespace StgSharp.Graphics.OpenGL private ConcurrentQueue InitializeUnusedTextureImageUint() { ConcurrentQueue result = new ConcurrentQueue(); - for( int index = 0; index < TextureUnitCount; index++ ) { - result.Enqueue( ( TextureUnit )( glConst.TEXTURE0 + index ) ); + for (int index = 0; index < TextureUnitCount; index++) { + result.Enqueue((TextureUnit)(glConst.TEXTURE0 + index)); } return result; } diff --git a/StgSharp.Common/Graphics/OpenGL/glFunction.cs b/StgSharp.Common/Graphics/OpenGL/glFunction.cs index 5a28f972..1f966752 100644 --- a/StgSharp.Common/Graphics/OpenGL/glFunction.cs +++ b/StgSharp.Common/Graphics/OpenGL/glFunction.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="glFunction" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -121,8 +121,8 @@ namespace StgSharp.Graphics.OpenGL } /// - /// Bind a frame BufferHandle to a frame BufferHandle target Same function as glBindFramebuffer. + /// Bind a frame BufferHandle to a frame BufferHandle target Same function as glBindFramebuffer . /// /// /// The frame BufferHandle target of the binding operation. @@ -272,9 +272,10 @@ namespace StgSharp.Graphics.OpenGL } /// - /// Delete a render BufferHandle object Very simlilar function as glDeleteRenderbuffers. The only - /// deifference is that this mehtod can only delete one renderbuffer at the same time. + /// Delete a render BufferHandle object Very simlilar function as glDeleteRenderbuffers . The + /// only deifference is that this mehtod can only delete one renderbuffer at the same + /// time. /// /// /// Handle to BufferHandle to delete. diff --git a/StgSharp.Common/Graphics/OpenGL/glHalfNV.cs b/StgSharp.Common/Graphics/OpenGL/glHalfNV.cs index 0f83ee16..48928ad1 100644 --- a/StgSharp.Common/Graphics/OpenGL/glHalfNV.cs +++ b/StgSharp.Common/Graphics/OpenGL/glHalfNV.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="glHalfNV.cs" -// Project: StepVisualizer -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="glHalfNV" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; @@ -37,33 +34,33 @@ using System.Threading.Tasks; namespace StgSharp.Graphics.OpenGL { - [StructLayout( LayoutKind.Explicit, Size = 16 )] + [StructLayout(LayoutKind.Explicit, Size = 16)] public struct glHalfNV { - [FieldOffset( 0 )] public short binary; + [FieldOffset(0)] public short binary; - public glHalfNV( short bin ) + public glHalfNV(short bin) { binary = bin; } - public static glHalfNV FromInt16( short x ) + public static glHalfNV FromInt16(short x) { - return new glHalfNV( x ); + return new glHalfNV(x); } - public static short ToInt16( glHalfNV half ) + public static short ToInt16(glHalfNV half) { return half.binary; } - public static explicit operator glHalfNV( short x ) + public static explicit operator glHalfNV(short x) { - return new glHalfNV( x ); + return new glHalfNV(x); } - public static explicit operator short( glHalfNV x ) + public static explicit operator short(glHalfNV x) { return x.binary; } diff --git a/StgSharp.Common/Graphics/OpenGL/glHandle.cs b/StgSharp.Common/Graphics/OpenGL/glHandle.cs index 259c6ea1..3d0f3674 100644 --- a/StgSharp.Common/Graphics/OpenGL/glHandle.cs +++ b/StgSharp.Common/Graphics/OpenGL/glHandle.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="glHandle.cs" -// Project: StepVisualizer -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="glHandle" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Data.Common; @@ -42,12 +39,12 @@ using System.Threading.Tasks; namespace StgSharp.Graphics.OpenGL { - [StructLayout( LayoutKind.Explicit, Size = 4 )] + [StructLayout(LayoutKind.Explicit, Size = 4)] public struct GlHandle { - [FieldOffset( 0 )] internal int SignedValue; - [FieldOffset( 0 )] internal uint Value; + [FieldOffset(0)] internal int SignedValue; + [FieldOffset(0)] internal uint Value; public static GlHandle Zero { @@ -57,8 +54,8 @@ namespace StgSharp.Graphics.OpenGL }; } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static GlHandle Alloc( uint value ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static GlHandle Alloc(uint value) { return new GlHandle { @@ -66,8 +63,8 @@ namespace StgSharp.Graphics.OpenGL }; } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static GlHandle SignedAlloc( int value ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static GlHandle SignedAlloc(int value) { return new GlHandle { diff --git a/StgSharp.Common/Graphics/OpenGL/glRenderObjectGenrator.cs b/StgSharp.Common/Graphics/OpenGL/glRenderObjectGenrator.cs index a8eb0d86..7e5eb4d8 100644 --- a/StgSharp.Common/Graphics/OpenGL/glRenderObjectGenrator.cs +++ b/StgSharp.Common/Graphics/OpenGL/glRenderObjectGenrator.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="glRenderObjectGenrator.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="glRenderObjectGenrator" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -41,10 +38,10 @@ namespace StgSharp.Graphics.OpenGL public partial class glRender { - [MethodImpl( MethodImplOptions.AggressiveInlining )] - protected AutoTextureGL CreateAutoTexture( int count ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected AutoTextureGL CreateAutoTexture(int count) { - return new AutoTextureGL( count, this ); + return new AutoTextureGL(count, this); } /// @@ -56,22 +53,22 @@ namespace StgSharp.Graphics.OpenGL /// /// /// - [MethodImpl( MethodImplOptions.AggressiveInlining )] - protected ElementBuffer CreateElementBuffer( int count ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected ElementBuffer CreateElementBuffer(int count) { - return new ElementBuffer( count, this ); + return new ElementBuffer(count, this); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - protected FrameBuffer CreateFrameBuffer( int count ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected FrameBuffer CreateFrameBuffer(int count) { - return new FrameBuffer( count, this ); + return new FrameBuffer(count, this); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - protected RenderBuffer CreateRenderBuffer( int count ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected RenderBuffer CreateRenderBuffer(int count) { - return new RenderBuffer( count, this ); + return new RenderBuffer(count, this); } /// @@ -83,10 +80,10 @@ namespace StgSharp.Graphics.OpenGL /// /// /// - [MethodImpl( MethodImplOptions.AggressiveInlining )] - protected TextureGL CreateTexture( int count ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected TextureGL CreateTexture(int count) { - return new TextureGL( count, this ); + return new TextureGL(count, this); } /// @@ -98,10 +95,10 @@ namespace StgSharp.Graphics.OpenGL /// /// /// - [MethodImpl( MethodImplOptions.AggressiveInlining )] - protected VertexArray CreateVertexArray( int count ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected VertexArray CreateVertexArray(int count) { - return new VertexArray( count, this ); + return new VertexArray(count, this); } /// @@ -113,10 +110,10 @@ namespace StgSharp.Graphics.OpenGL /// /// /// - [MethodImpl( MethodImplOptions.AggressiveInlining )] - protected VertexBuffer CreateVertexBuffer( int count ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + protected VertexBuffer CreateVertexBuffer(int count) { - return new VertexBuffer( count, this ); + return new VertexBuffer(count, this); } } diff --git a/StgSharp.Common/Graphics/OpenGL/glRenderStream.cs b/StgSharp.Common/Graphics/OpenGL/glRenderStream.cs index 8928c375..a9abc101 100644 --- a/StgSharp.Common/Graphics/OpenGL/glRenderStream.cs +++ b/StgSharp.Common/Graphics/OpenGL/glRenderStream.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="glRenderStream" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Graphics/OpenGL/glRenderThreadSecurity.cs b/StgSharp.Common/Graphics/OpenGL/glRenderThreadSecurity.cs index c0dca674..53b6fe5b 100644 --- a/StgSharp.Common/Graphics/OpenGL/glRenderThreadSecurity.cs +++ b/StgSharp.Common/Graphics/OpenGL/glRenderThreadSecurity.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="glRenderThreadSecurity.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="glRenderThreadSecurity" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Concurrent; using System.Collections.Generic; diff --git a/StgSharp.Common/Graphics/OpenGL/glType.cs b/StgSharp.Common/Graphics/OpenGL/glType.cs index d521626d..ef8256ed 100644 --- a/StgSharp.Common/Graphics/OpenGL/glType.cs +++ b/StgSharp.Common/Graphics/OpenGL/glType.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="glType.cs" -// Project: StepVisualizer -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="glType" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -43,18 +40,18 @@ namespace StgSharp.Internal.OpenGL private dynamic value; - public unsafe glHandleARB( dynamic value ) + public unsafe glHandleARB(dynamic value) { - if( !RuntimeInformation.IsOSPlatform( OSPlatform.OSX ) ) + if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { - if( value.GetType().Name != "Uint32" ) + if (value.GetType().Name != "Uint32") { goto errorlog; } this.value = value; } else { - if( value.GetType().Name != "IntPtr" ) + if (value.GetType().Name != "IntPtr") { goto errorlog; } @@ -65,13 +62,13 @@ namespace StgSharp.Internal.OpenGL { InternalIO.InternalWriteLog( $"{value.GetType().Name} does not match definination of GLhandlARB on OS {Environment.OSVersion.Platform} ", - LogType.Error ); + LogType.Error); } } - public static implicit operator uint( glHandleARB value ) + public static implicit operator uint(glHandleARB value) { - return ( uint )value; + return (uint)value; } } diff --git a/StgSharp.Common/Graphics/Pixels.cs b/StgSharp.Common/Graphics/Pixels.cs index 8634b7a1..12c5318d 100644 --- a/StgSharp.Common/Graphics/Pixels.cs +++ b/StgSharp.Common/Graphics/Pixels.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Pixels.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="Pixels" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Runtime.InteropServices; @@ -50,36 +47,36 @@ namespace StgSharp.Graphics } - [StructLayout( LayoutKind.Explicit, Size = 32 )] + [StructLayout(LayoutKind.Explicit, Size = 32)] public unsafe struct Pixel32RGBA : IPixel { - [FieldOffset( 0 )] private unsafe fixed byte data[ 4 ]; + [FieldOffset(0)] private unsafe fixed byte data[4]; public int Size => 4; float IPixel.Alpha { - get => data[ 3 ] / 256 ; - set => data[ 3 ] = ( byte )( value * 256 ); + get => data[3] / 256 ; + set => data[3] = (byte)(value * 256); } float IPixel.Blue { - get => data[ 2 ] / 256 ; - set => data[ 2 ] = ( byte )( value * 256 ); + get => data[2] / 256 ; + set => data[2] = (byte)(value * 256); } float IPixel.Green { - get => data[ 1 ] / 256 ; - set => data[ 1 ] = ( byte )( value * 256 ); + get => data[1] / 256 ; + set => data[1] = (byte)(value * 256); } float IPixel.Red { - get => data[ 0 ] / 256 ; - set => data[ 0 ] = ( byte )( value * 256 ); + get => data[0] / 256 ; + set => data[0] = (byte)(value * 256); } } diff --git a/StgSharp.Common/Graphics/PlainGeometryMesh.cs b/StgSharp.Common/Graphics/PlainGeometryMesh.cs index 5afd7254..2c6fffe9 100644 --- a/StgSharp.Common/Graphics/PlainGeometryMesh.cs +++ b/StgSharp.Common/Graphics/PlainGeometryMesh.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="PlainGeometryMesh" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Graphics/RenderStream.cs b/StgSharp.Common/Graphics/RenderStream.cs index 35e5d959..54aa019d 100644 --- a/StgSharp.Common/Graphics/RenderStream.cs +++ b/StgSharp.Common/Graphics/RenderStream.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="RenderStream" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Graphics/ShaderEdit/ShaderGenerator.cs b/StgSharp.Common/Graphics/ShaderEdit/ShaderGenerator.cs index a97c45d0..4850604f 100644 --- a/StgSharp.Common/Graphics/ShaderEdit/ShaderGenerator.cs +++ b/StgSharp.Common/Graphics/ShaderEdit/ShaderGenerator.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="ShaderGenerator.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="ShaderGenerator" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics; using StgSharp.Graphics.OpenGL; using StgSharp.Mathematics; @@ -48,12 +45,12 @@ namespace StgSharp.Graphics.ShaderEdit private List codeList; private List usedShaderFunctions; - public Uniform DefineUniform( string name, int index ) where T:unmanaged + public Uniform DefineUniform(string name, int index) where T: unmanaged { - ShaderParameter p = new ShaderParameter( name, ShaderParameter.TypeMarshal() ); - uniformDefine.Add( index, p ); + ShaderParameter p = new ShaderParameter(name, ShaderParameter.TypeMarshal()); + uniformDefine.Add(index, p); - //return new Uniform(); + // return new Uniform(); throw new NotImplementedException(); } @@ -69,42 +66,39 @@ namespace StgSharp.Graphics.ShaderEdit public int ParameterCount => inputList.Count; - public void EmitCall( - ShaderFunction function, - ShaderParameter outPut, - params ShaderParameter[] inputParams ) + public void EmitCall(ShaderFunction function, ShaderParameter outPut, params ShaderParameter[] inputParams) { - if( inputParams.Length != function.ParameterCount ) + if (inputParams.Length != function.ParameterCount) { // Param list length not equal throw new ArgumentException( - "Provided parameters does not match function's parameter list." ); + "Provided parameters does not match function's parameter list."); } - if( !ShaderParameter.IsSameType( outPut, function.outPut ) ) + if (!ShaderParameter.IsSameType(outPut, function.outPut)) { // Type of returning value not equal throw new ArgumentException( - "Provided parameters does not match function's parameter list." ); + "Provided parameters does not match function's parameter list."); } - for( int i = 0; i < inputParams.Length; i++ ) + for (int i = 0; i < inputParams.Length; i++) { - if( !ShaderParameter.IsSameType( function.inputList[ i ], inputParams[ i ] ) ) + if (!ShaderParameter.IsSameType(function.inputList[i], inputParams[i])) { // Input type not match throw new InvalidCastException( - "Provided parameters does not match function's parameter list." ); + "Provided parameters does not match function's parameter list."); } } string codeLine = string.Empty; // adding a line like " outvalue = Func(input1, input2,...); " - if( outPut != ShaderParameter.Void ) { + if (outPut != ShaderParameter.Void) { codeLine += $"{outPut.name} = "; } codeLine += $"{function.name}("; - foreach( ShaderParameter inputParam in inputParams ) { + foreach (ShaderParameter inputParam in inputParams) { codeLine += inputParam.name; } codeLine += ");\n"; - codeList.Add( codeLine ); + codeList.Add(codeLine); } } @@ -113,32 +107,32 @@ namespace StgSharp.Graphics.ShaderEdit { public static readonly ShaderParameter Void = new ShaderParameter( - string.Empty, InternalShaderType.Void ); + string.Empty, InternalShaderType.Void); internal readonly bool isReadOnly; internal readonly InternalShaderType type; internal readonly string name; - public ShaderParameter( string name, InternalShaderType type ) + public ShaderParameter(string name, InternalShaderType type) { this.name = name; this.type = type; isReadOnly = false; } - public static bool IsSameType( ShaderParameter param1, ShaderParameter param2 ) + public static bool IsSameType(ShaderParameter param1, ShaderParameter param2) { - if( param1.type != InternalShaderType.Struct ) + if (param1.type != InternalShaderType.Struct) { return param1.type == param2.type; } else { - throw new Exception( "Struct is currently not supported." ); + throw new Exception("Struct is currently not supported."); } } - public static InternalShaderType TypeMarshal() where T:unmanaged + public static InternalShaderType TypeMarshal() where T: unmanaged { - switch( Type.GetTypeCode( typeof( T ) ) ) + switch (Type.GetTypeCode(typeof(T))) { case TypeCode.Single: return InternalShaderType.Float; @@ -151,7 +145,7 @@ namespace StgSharp.Graphics.ShaderEdit default: break; } - switch( typeof( T ).Name ) + switch (typeof(T).Name) { case "vec4d": return InternalShaderType.Vector4; @@ -174,7 +168,7 @@ namespace StgSharp.Graphics.ShaderEdit case "Matrix4x4": return InternalShaderType.Matrix4x4; default: - throw new ArgumentException( "Not supported shader data type." ); + throw new ArgumentException("Not supported shader data type."); } } diff --git a/StgSharp.Common/Graphics/ShaderEdit/ShaderStruct.cs b/StgSharp.Common/Graphics/ShaderEdit/ShaderStruct.cs index 1ca12fe4..a7892f8b 100644 --- a/StgSharp.Common/Graphics/ShaderEdit/ShaderStruct.cs +++ b/StgSharp.Common/Graphics/ShaderEdit/ShaderStruct.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="ShaderStruct.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="ShaderStruct" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics.OpenGL; using System; @@ -53,43 +50,43 @@ namespace StgSharp.Graphics.ShaderEdit internal ShaderStruct() { } - public ShaderStruct( params (GlHandle, ShaderStructMember)[] uniformPairs ) + public ShaderStruct(params (GlHandle, ShaderStructMember)[] uniformPairs) { uniformPair = new Dictionary(); - if( uniformPairs.Length == 0 ) { + if (uniformPairs.Length == 0) { return; } - foreach( (GlHandle, ShaderStructMember) item in uniformPairs ) { - uniformPair.Add( item.Item1, item.Item2 ); + foreach ((GlHandle, ShaderStructMember) item in uniformPairs) { + uniformPair.Add(item.Item1, item.Item2); } } public unsafe void SetAllUniforms() { - OpenglContext* gl = ( OpenglContext* )OpenGL.OpenGLFunction.CurrentGL.ContextHandle; - foreach( KeyValuePair uniform in uniformPair ) + OpenglContext* gl = (OpenglContext*)OpenGL.OpenGLFunction.CurrentGL.ContextHandle; + foreach (KeyValuePair uniform in uniformPair) { int id = uniform.Key.SignedValue; ShaderStructMember s = uniform.Value; - switch( s.type ) + switch (s.type) { case InternalShaderType.Struct: throw new ArgumentException( - "Incorrect type \"Struct\" defined in this self define type" ); + "Incorrect type \"Struct\" defined in this self define type"); case InternalShaderType.Void: throw new ArgumentException( - "Incorrect type \"Void\" defined in this self define type" ); + "Incorrect type \"Void\" defined in this self define type"); case InternalShaderType.Float: - gl->glUniform1f( id, ( float )s.value ); + gl->glUniform1f(id, (float)s.value); break; case InternalShaderType.Int: - gl->glUniform1f( id, ( int )s.value ); + gl->glUniform1f(id, (int)s.value); break; default: throw new NotImplementedException(); throw new ArgumentException( - "Incorrect type \"Unknown\" defined in this self define type" ); + "Incorrect type \"Unknown\" defined in this self define type"); } } }//------------------------------------ End of Class --------------------------------------- diff --git a/StgSharp.Common/Graphics/TexturePipeline.cs b/StgSharp.Common/Graphics/TexturePipeline.cs index 14bfab2c..3f43390e 100644 --- a/StgSharp.Common/Graphics/TexturePipeline.cs +++ b/StgSharp.Common/Graphics/TexturePipeline.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="TexturePipeline.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="TexturePipeline" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.PipeLine; using System; @@ -43,7 +40,7 @@ namespace StgSharp.Graphics private Image _value; - public TexturePipeline( Image i ) + public TexturePipeline(Image i) { _value = i; } @@ -55,9 +52,9 @@ namespace StgSharp.Graphics get => _value; set { - ArgumentNullException.ThrowIfNull( value ); - if( value is not Image image ) { - throw new ArgumentException( "Value must be of type Image" ); + ArgumentNullException.ThrowIfNull(value); + if (value is not Image image) { + throw new ArgumentException("Value must be of type Image"); } _value = image; } diff --git a/StgSharp.Common/Graphics/TextureProvider.cs b/StgSharp.Common/Graphics/TextureProvider.cs index 6774abd7..535de4c6 100644 --- a/StgSharp.Common/Graphics/TextureProvider.cs +++ b/StgSharp.Common/Graphics/TextureProvider.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="TextureProvider.cs" +// file="TextureProvider" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Graphics/Vulkan/vkEnum.cs b/StgSharp.Common/Graphics/Vulkan/vkEnum.cs index 227c1fc3..abac24ca 100644 --- a/StgSharp.Common/Graphics/Vulkan/vkEnum.cs +++ b/StgSharp.Common/Graphics/Vulkan/vkEnum.cs @@ -1,10 +1,36 @@ -using System; +//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// file="vkEnum" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. +// +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +using System; using System.Collections.Generic; using System.Text; namespace StgSharp.Graphics.Vulkan { - internal enum VkStructureType : uint { @@ -47,5 +73,4 @@ namespace StgSharp.Graphics.Vulkan VK_RESULT_MAX_ENUM = 0x7FFFFFFF } - } diff --git a/StgSharp.Common/Graphics/Vulkan/vkHandle.cs b/StgSharp.Common/Graphics/Vulkan/vkHandle.cs index 5396a1f7..db4bd73d 100644 --- a/StgSharp.Common/Graphics/Vulkan/vkHandle.cs +++ b/StgSharp.Common/Graphics/Vulkan/vkHandle.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="vkHandle.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="vkHandle" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; @@ -38,14 +35,14 @@ using System.Threading.Tasks; namespace StgSharp.Graphics.Vulkan { - [StructLayout( LayoutKind.Explicit, Size = 8 )] + [StructLayout(LayoutKind.Explicit, Size = 8)] public struct vkHandle { - [FieldOffset( 0 )] public int SignedHalfValue; - [FieldOffset( 0 )] public IntPtr Handle; - [FieldOffset( 0 )] public IntPtr UnsignedHandle; - [FieldOffset( 0 )] public uint HalfValue; + [FieldOffset(0)] public int SignedHalfValue; + [FieldOffset(0)] public IntPtr Handle; + [FieldOffset(0)] public IntPtr UnsignedHandle; + [FieldOffset(0)] public uint HalfValue; } } diff --git a/StgSharp.Common/Graphics/framework.cs b/StgSharp.Common/Graphics/framework.cs index 08a2056f..788f2f45 100644 --- a/StgSharp.Common/Graphics/framework.cs +++ b/StgSharp.Common/Graphics/framework.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="framework.cs" +// file="framework" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -57,10 +54,10 @@ namespace StgSharp.Graphics #region StgSharpDele -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public unsafe delegate void FrameBufferSizeHandler(IntPtr window, int width, int height); -[UnmanagedFunctionPointer(CallingConvention.Cdecl)] + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public unsafe delegate void FramePositionHandler(IntPtr window, float width, float height); #endregion diff --git a/StgSharp.Common/Graphics/frameworkSyncContext.cs b/StgSharp.Common/Graphics/frameworkSyncContext.cs index 8f33a9a6..d8fcfb06 100644 --- a/StgSharp.Common/Graphics/frameworkSyncContext.cs +++ b/StgSharp.Common/Graphics/frameworkSyncContext.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="frameworkSyncContext.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="frameworkSyncContext" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -59,19 +56,19 @@ namespace StgSharp.Threading get => _mainThreadContext; } - public override void Post( SendOrPostCallback d, object state ) + public override void Post(SendOrPostCallback d, object state) { - _syncContexts.Add( d ); + _syncContexts.Add(d); } - public override void Send( SendOrPostCallback d, object state ) + public override void Send(SendOrPostCallback d, object state) { - if( Thread.CurrentThread == _mainThread ) + if (Thread.CurrentThread == _mainThread) { - d( state ); + d(state); } else { - Post( d, state ); + Post(d, state); } } diff --git a/StgSharp.Common/HighPerformance/IRegisterPresentation.cs b/StgSharp.Common/HighPerformance/IRegisterPresentation.cs index 07d236ef..9f92daf5 100644 --- a/StgSharp.Common/HighPerformance/IRegisterPresentation.cs +++ b/StgSharp.Common/HighPerformance/IRegisterPresentation.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="IRegisterPresentation.cs" +// file="IRegisterPresentation" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/HighPerformance/IRegisterType.cs b/StgSharp.Common/HighPerformance/IRegisterType.cs index 6f06745a..9579b965 100644 --- a/StgSharp.Common/HighPerformance/IRegisterType.cs +++ b/StgSharp.Common/HighPerformance/IRegisterType.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="IRegisterType.cs" +// file="IRegisterType" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/HighPerformance/Lable.cs b/StgSharp.Common/HighPerformance/Lable.cs index 60bf81dd..bb336db4 100644 --- a/StgSharp.Common/HighPerformance/Lable.cs +++ b/StgSharp.Common/HighPerformance/Lable.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Lable.cs" +// file="Lable" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the ¡°Software¡±), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED ¡°AS IS¡±, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/HighPerformance/M128.cs b/StgSharp.Common/HighPerformance/M128.cs index ecc62cec..690372d1 100644 --- a/StgSharp.Common/HighPerformance/M128.cs +++ b/StgSharp.Common/HighPerformance/M128.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="M128.cs" +// file="M128" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the ¡°Software¡±), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED ¡°AS IS¡±, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/HighPerformance/M256.cs b/StgSharp.Common/HighPerformance/M256.cs index 0b20ccff..4314ce27 100644 --- a/StgSharp.Common/HighPerformance/M256.cs +++ b/StgSharp.Common/HighPerformance/M256.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="M256.cs" +// file="M256" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/HighPerformance/M512.cs b/StgSharp.Common/HighPerformance/M512.cs index 47b87fb8..57fd920e 100644 --- a/StgSharp.Common/HighPerformance/M512.cs +++ b/StgSharp.Common/HighPerformance/M512.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="M512.cs" +// file="M512" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/HighPerformance/M64.cs b/StgSharp.Common/HighPerformance/M64.cs index 9c302693..5b6a1798 100644 --- a/StgSharp.Common/HighPerformance/M64.cs +++ b/StgSharp.Common/HighPerformance/M64.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="M64.cs" +// file="M64" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/HighPerformance/MatrixKernel.cs b/StgSharp.Common/HighPerformance/MatrixKernel.cs index 50e03fa0..e68941f3 100644 --- a/StgSharp.Common/HighPerformance/MatrixKernel.cs +++ b/StgSharp.Common/HighPerformance/MatrixKernel.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="MatrixKernel.cs" +// file="MatrixKernel" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/HighPerformance/Memory/BufferStack.cs b/StgSharp.Common/HighPerformance/Memory/BufferStack.cs index b4c2e11e..564ad06b 100644 --- a/StgSharp.Common/HighPerformance/Memory/BufferStack.cs +++ b/StgSharp.Common/HighPerformance/Memory/BufferStack.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="BufferStack.cs" +// file="BufferStack" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/HighPerformance/Memory/HLSFAllocationHandle.cs b/StgSharp.Common/HighPerformance/Memory/HLSFAllocationHandle.cs index 653cfe3e..4bb75469 100644 --- a/StgSharp.Common/HighPerformance/Memory/HLSFAllocationHandle.cs +++ b/StgSharp.Common/HighPerformance/Memory/HLSFAllocationHandle.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="HLSFAllocationHandle.cs" +// file="HLSFAllocationHandle" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -55,19 +52,19 @@ namespace StgSharp.HighPerformance.Memory public readonly ref byte this[int index] { -[MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get => ref BufferPointer[index]; } public readonly byte* Pointer { -[MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get => BufferPointer; } public readonly Span BufferHandle { -[MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get => new((byte*) EntryHandle->Position, (int)AllocSize); } diff --git a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Debug.cs b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Debug.cs index 4b42a17f..4bbecc9e 100644 --- a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Debug.cs +++ b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Debug.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="HLSFAllocator.Debug.cs" +// file="HLSFAllocator.Debug" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Free.cs b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Free.cs index fe4cb169..b38281f6 100644 --- a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Free.cs +++ b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Free.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="HLSFAllocator.Free.cs" +// file="HLSFAllocator.Free" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Level.cs b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Level.cs index f58ad870..5e03a9d4 100644 --- a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Level.cs +++ b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.Level.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="HLSFAllocator.Level.cs" +// file="HLSFAllocator.Level" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -44,8 +41,17 @@ namespace StgSharp.HighPerformance.Memory private const int MaxLevel = 9; private static readonly int[] levelSizeArray = [ - 64, 256, 1024, 4096, 16384, 65536, 262144, 1048576, 4194304, 16777216 - ]; + 64, + 256, + 1024, + 4096, + 16384, + 65536, + 262144, + 1048576, + 4194304, + 16777216 + ]; public int AlignOfLevel(int bucketLevel) { diff --git a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.SegmentEntry.cs b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.SegmentEntry.cs index 33967eb5..506201ce 100644 --- a/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.SegmentEntry.cs +++ b/StgSharp.Common/HighPerformance/Memory/HLSFAllocator.SegmentEntry.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="HLSFAllocator.SegmentEntry.cs" +// file="HLSFAllocator.SegmentEntry" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/HighPerformance/Memory/SlabAllocationHandle.cs b/StgSharp.Common/HighPerformance/Memory/SlabAllocationHandle.cs index 82a8f049..3e2f1a12 100644 --- a/StgSharp.Common/HighPerformance/Memory/SlabAllocationHandle.cs +++ b/StgSharp.Common/HighPerformance/Memory/SlabAllocationHandle.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="SlabAllocationHandle.cs" +// file="SlabAllocationHandle" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/HighPerformance/Memory/SlabAllocator.Chunked.cs b/StgSharp.Common/HighPerformance/Memory/SlabAllocator.Chunked.cs index 09d3cf78..0966182a 100644 --- a/StgSharp.Common/HighPerformance/Memory/SlabAllocator.Chunked.cs +++ b/StgSharp.Common/HighPerformance/Memory/SlabAllocator.Chunked.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="SlabAllocator.Chunked.cs" +// file="SlabAllocator.Chunked" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/HighPerformance/Memory/SlabAllocator.ChunkedConcurrent.cs b/StgSharp.Common/HighPerformance/Memory/SlabAllocator.ChunkedConcurrent.cs index dd7a67ec..10ed094a 100644 --- a/StgSharp.Common/HighPerformance/Memory/SlabAllocator.ChunkedConcurrent.cs +++ b/StgSharp.Common/HighPerformance/Memory/SlabAllocator.ChunkedConcurrent.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="SlabAllocator.ChunkedConcurrent.cs" +// file="SlabAllocator.ChunkedConcurrent" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/HighPerformance/Memory/SlabAllocator.SequencialConcurrent.cs b/StgSharp.Common/HighPerformance/Memory/SlabAllocator.SequencialConcurrent.cs index ca78b2a9..dc5ab1bd 100644 --- a/StgSharp.Common/HighPerformance/Memory/SlabAllocator.SequencialConcurrent.cs +++ b/StgSharp.Common/HighPerformance/Memory/SlabAllocator.SequencialConcurrent.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="SlabAllocator.SequencialConcurrent.cs" +// file="SlabAllocator.SequencialConcurrent" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -71,7 +68,7 @@ namespace StgSharp.HighPerformance.Memory internal T* BasePointer { -[MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _buffer; } diff --git a/StgSharp.Common/HighPerformance/Memory/SlabAllocator.cs b/StgSharp.Common/HighPerformance/Memory/SlabAllocator.cs index 06972bff..94d5833b 100644 --- a/StgSharp.Common/HighPerformance/Memory/SlabAllocator.cs +++ b/StgSharp.Common/HighPerformance/Memory/SlabAllocator.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="SlabAllocator.cs" +// file="SlabAllocator" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -59,26 +56,27 @@ namespace StgSharp.HighPerformance.Memory /// Thrown when requesting unsupported configurations. /// /// - /// Important Threading Considerations: While SLAB - /// allocators themselves may be designed for single-threaded use, allocated objects are - /// frequently shared across multiple threads in real-world applications. Due to the - /// special implementation of expandable concurrent sequential SLAB allocators, they rely - /// on internal expansion locks to ensure that memory buffer expansions (which involve - /// copying the entire buffer to a new location) do not occur while other threads are - /// reading from allocated regions. Sequential Layout Limitations: - ///
Sequential layout SLAB allocators cannot provide a single-threaded - /// version because: They use contiguous memory - /// layout that requires buffer expansion when capacity is exceeded - /// Buffer expansion involves copying all - /// existing data to a new memory location - /// Without proper synchronization, concurrent access to allocated objects during - /// expansion would cause memory corruption The - /// expansion lock mechanism is essential even if allocation itself is single- - /// threaded
Chunked Layout: - ///
Chunked layout allocators can optionally provide single-threaded - /// versions since they don't require buffer expansion and copying. Each chunk is - /// allocated independently, avoiding the memory relocation issues present in sequential - /// layouts.
+ /// Important Threading Considerations: While SLAB + /// /// allocators themselves may be designed for single-threaded use, allocated objects + /// are /// frequently shared across multiple threads in real-world applications. Due to + /// the /// special implementation of expandable concurrent sequential SLAB allocators, + /// they rely /// on internal expansion locks to ensure that memory buffer expansions + /// (which involve /// copying the entire buffer to a new location) do not occur while + /// other threads are /// reading from allocated regions. + /// Sequential Layout Limitations: ///
Sequential layout SLAB + /// allocators cannot provide a single-threaded /// version because:They use contiguous memory /// layout that requires + /// buffer expansion when capacity is exceeded + /// ///Buffer expansion involves copying all /// + /// existing data to a new memory location /// + /// Without proper synchronization, concurrent access to allocated objects during /// + /// expansion would cause memory corruptionThe + /// /// expansion lock mechanism is essential even if allocation itself is single- /// + /// threaded
Chunked Layout: + /// ///
Chunked layout allocators can optionally provide single-threaded + /// /// versions since they don't require buffer expansion and copying. Each chunk is + /// /// allocated independently, avoiding the memory relocation issues present in + /// sequential /// layouts.
///
public static SlabAllocator Create(nuint count, SlabBufferLayout layout, bool concurrentSupport = true) { diff --git a/StgSharp.Common/HighPerformance/UnsafeCompute.cs b/StgSharp.Common/HighPerformance/UnsafeCompute.cs index f6cb5f48..a7c9f845 100644 --- a/StgSharp.Common/HighPerformance/UnsafeCompute.cs +++ b/StgSharp.Common/HighPerformance/UnsafeCompute.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="UnsafeCompute.cs" +// file="UnsafeCompute" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Internal/ClangLoad/gl.cs b/StgSharp.Common/Internal/ClangLoad/gl.cs index c0e6b8d7..676f4f9a 100644 --- a/StgSharp.Common/Internal/ClangLoad/gl.cs +++ b/StgSharp.Common/Internal/ClangLoad/gl.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="gl.cs" +// file="gl" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -43,7 +40,7 @@ namespace StgSharp.Internal { [LibraryImport(NativeLibName, EntryPoint = "glCheckShaderStat")] - [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + [UnmanagedCallConv(CallConvs =[ typeof(CallConvCdecl) ])] #pragma warning disable CA5392 internal static partial int glCheckShaderStatus( ref OpenglContext context, @@ -56,27 +53,27 @@ namespace StgSharp.Internal #region ssgc api define [LibraryImport(NativeLibName, EntryPoint = "initGL")] - [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + [UnmanagedCallConv(CallConvs =[ typeof(CallConvCdecl) ])] internal static partial void InternalInitGL(int majorVersion, int minorVersion); [LibraryImport(NativeLibName, EntryPoint = "loadGlfuncDefault", StringMarshalling = StringMarshalling.Utf8)] - [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + [UnmanagedCallConv(CallConvs =[ typeof(CallConvCdecl) ])] internal static partial IntPtr InternalLoadGlfuncDefault(string name); [LibraryImport(NativeLibName, EntryPoint = "linkShaderProgram")] - [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + [UnmanagedCallConv(CallConvs =[ typeof(CallConvCdecl) ])] internal static unsafe partial uint InternalLinkShaderProgram(OpenglContext* context, uint shaderProgram); [LibraryImport(NativeLibName, EntryPoint = "readLog")] - [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + [UnmanagedCallConv(CallConvs =[ typeof(CallConvCdecl) ])] internal static unsafe partial IntPtr InternalReadSSCLog(); [LibraryImport(NativeLibName, EntryPoint = "loadImageData", StringMarshalling = StringMarshalling.Utf8)] - [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + [UnmanagedCallConv(CallConvs =[ typeof(CallConvCdecl) ])] internal static unsafe partial void InternalLoadImage(string fileName, ImageInfo* output, ImageLoader loader); [LibraryImport(NativeLibName, EntryPoint = "unloadImageData")] - [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + [UnmanagedCallConv(CallConvs =[ typeof(CallConvCdecl) ])] internal static unsafe partial void InternalUnloadImage(ImageInfo* output); #endregion ssgc api define diff --git a/StgSharp.Common/Internal/InternalIO.cs b/StgSharp.Common/Internal/InternalIO.cs index bd6e763c..ba7635b1 100644 --- a/StgSharp.Common/Internal/InternalIO.cs +++ b/StgSharp.Common/Internal/InternalIO.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="InternalIO.cs" +// file="InternalIO" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Internal/InternalResource.cs b/StgSharp.Common/Internal/InternalResource.cs index fd73565e..30dd8ec5 100644 --- a/StgSharp.Common/Internal/InternalResource.cs +++ b/StgSharp.Common/Internal/InternalResource.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="InternalResource.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="InternalResource" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; diff --git a/StgSharp.Common/Internal/Intrinsic/ColumnSet2.cs b/StgSharp.Common/Internal/Intrinsic/ColumnSet2.cs index dc8e17ba..e72f73d3 100644 --- a/StgSharp.Common/Internal/Intrinsic/ColumnSet2.cs +++ b/StgSharp.Common/Internal/Intrinsic/ColumnSet2.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="ColumnSet2.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="ColumnSet2" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp; using StgSharp.Internal.Intrinsic; @@ -39,51 +36,51 @@ using System.Text; namespace StgSharp.Internal.Intrinsic { - [StructLayout( LayoutKind.Explicit, Size = 12 * sizeof( float ), Pack = 16 )] + [StructLayout(LayoutKind.Explicit, Size = 12 * sizeof(float), Pack = 16)] internal struct ColumnSet2 : IEquatable { - [FieldOffset( 0 * sizeof( float ) )] internal float m00; - [FieldOffset( 4 * sizeof( float ) )] internal float m01; - [FieldOffset( 1 * sizeof( float ) )] internal float m10; - [FieldOffset( 5 * sizeof( float ) )] internal float m11; - [FieldOffset( 2 * sizeof( float ) )] internal float m20; - [FieldOffset( 6 * sizeof( float ) )] internal float m21; - [FieldOffset( 3 * sizeof( float ) )] internal float m30; - [FieldOffset( 7 * sizeof( float ) )] internal float m31; + [FieldOffset(0 * sizeof(float))] internal float m00; + [FieldOffset(4 * sizeof(float))] internal float m01; + [FieldOffset(1 * sizeof(float))] internal float m10; + [FieldOffset(5 * sizeof(float))] internal float m11; + [FieldOffset(2 * sizeof(float))] internal float m20; + [FieldOffset(6 * sizeof(float))] internal float m21; + [FieldOffset(3 * sizeof(float))] internal float m30; + [FieldOffset(7 * sizeof(float))] internal float m31; - [FieldOffset( 0 )] internal Vector4 colum0; - [FieldOffset( 4 * sizeof( float ) )] internal Vector4 colum1; + [FieldOffset(0)] internal Vector4 colum0; + [FieldOffset(4 * sizeof(float))] internal Vector4 colum1; - internal ColumnSet2( Vector4 c0, Vector4 c1 ) + internal ColumnSet2(Vector4 c0, Vector4 c1) { - Unsafe.SkipInit( out this ); + Unsafe.SkipInit(out this); colum0 = c0; colum1 = c1; } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public override bool Equals( object? obj ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public override bool Equals(object? obj) { - return ( obj is ColumnSet2 mat ) && Equals( mat ); + return (obj is ColumnSet2 mat) && Equals(mat); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public bool Equals( ColumnSet2 other ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public bool Equals(ColumnSet2 other) { - return colum0.Equals( other.colum0 ) && colum1.Equals( other.colum1 ); + return colum0.Equals(other.colum0) && colum1.Equals(other.colum1); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static bool operator !=( ColumnSet2 left, ColumnSet2 right ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator !=(ColumnSet2 left, ColumnSet2 right) { - return !( left == right ); + return !(left == right); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static bool operator ==( ColumnSet2 left, ColumnSet2 right ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool operator ==(ColumnSet2 left, ColumnSet2 right) { - return left.Equals( right ); + return left.Equals(right); } } diff --git a/StgSharp.Common/Internal/Intrinsic/ColumnSet3.cs b/StgSharp.Common/Internal/Intrinsic/ColumnSet3.cs index f3a5c6bd..56802767 100644 --- a/StgSharp.Common/Internal/Intrinsic/ColumnSet3.cs +++ b/StgSharp.Common/Internal/Intrinsic/ColumnSet3.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="ColumnSet3.cs" +// file="ColumnSet3" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -67,9 +64,7 @@ namespace StgSharp.Internal.Intrinsic [MethodImpl(MethodImplOptions.AggressiveInlining)] public bool Equals(ColumnSet3 other) { - return colum0.Equals(other.colum0) && - colum1.Equals(other.colum1) && - colum2.Equals(other.colum2); + return colum0.Equals(other.colum0) && colum1.Equals(other.colum1) && colum2.Equals(other.colum2); } [MethodImpl(MethodImplOptions.AggressiveInlining)] diff --git a/StgSharp.Common/Internal/Intrinsic/ColumnSet4.cs b/StgSharp.Common/Internal/Intrinsic/ColumnSet4.cs index dd1c2219..5380349b 100644 --- a/StgSharp.Common/Internal/Intrinsic/ColumnSet4.cs +++ b/StgSharp.Common/Internal/Intrinsic/ColumnSet4.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="ColumnSet4.cs" +// file="ColumnSet4" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Internal/Intrinsic/IntrinsicContext.cs b/StgSharp.Common/Internal/Intrinsic/IntrinsicContext.cs index 04dbac6f..9600d3d2 100644 --- a/StgSharp.Common/Internal/Intrinsic/IntrinsicContext.cs +++ b/StgSharp.Common/Internal/Intrinsic/IntrinsicContext.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="IntrinsicContext.cs" +// file="IntrinsicContext" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Internal/Intrinsic/MatInterface.cs b/StgSharp.Common/Internal/Intrinsic/MatInterface.cs index 4425f944..d2033627 100644 --- a/StgSharp.Common/Internal/Intrinsic/MatInterface.cs +++ b/StgSharp.Common/Internal/Intrinsic/MatInterface.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="MatInterface.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="MatInterface" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; diff --git a/StgSharp.Common/Internal/Intrinsic/intrinsicContextProvider.cs b/StgSharp.Common/Internal/Intrinsic/intrinsicContextProvider.cs index 42659ab6..d5fa16ad 100644 --- a/StgSharp.Common/Internal/Intrinsic/intrinsicContextProvider.cs +++ b/StgSharp.Common/Internal/Intrinsic/intrinsicContextProvider.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="intrinsicContextProvider.cs" +// file="intrinsicContextProvider" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the ¡°Software¡±), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED ¡°AS IS¡±, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -46,7 +43,7 @@ namespace StgSharp.Internal internal static IntrinsicContext Intrinsic { -[MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _intrinsicContext; } @@ -72,7 +69,7 @@ namespace StgSharp.Internal } [LibraryImport(NativeLibName, EntryPoint = "load_intrinsic_function")] - [UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])] + [UnmanagedCallConv(CallConvs =[ typeof(CallConvCdecl) ])] private static partial int LoadIntrinsicFunction(IntrinsicContext* context); } diff --git a/StgSharp.Common/Internal/StructDefine.cs b/StgSharp.Common/Internal/StructDefine.cs index 5a7667dc..a23311dd 100644 --- a/StgSharp.Common/Internal/StructDefine.cs +++ b/StgSharp.Common/Internal/StructDefine.cs @@ -1,34 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="StructDefine.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="StructDefine" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- - +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics.OpenGL; using System; @@ -38,13 +34,13 @@ using System.Runtime.InteropServices; namespace StgSharp.Internal { - //rename types in style of GLFW + // rename types in style of GLFW using GLFWbool = Boolean; #region glad struct - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] internal struct GLsync { @@ -54,11 +50,11 @@ namespace StgSharp.Internal #endregion glad struct - //strucs defined in GLFW3.h + // strucs defined in GLFW3.h #region GLFW3 struct - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWcontext { @@ -87,13 +83,13 @@ namespace StgSharp.Internal private int source; private IntPtr destroy; - //PFNGLGETINTEGERVPROC GetIntegerv; + // PFNGLGETINTEGERVPROC GetIntegerv; private IntPtr GetIntegerv; - //PFNGLGETSTRINGPROC GetString; + // PFNGLGETSTRINGPROC GetString; private IntPtr GetString; - //PFNGLGETSTRINGIPROC GetStringi; + // PFNGLGETSTRINGIPROC GetStringi; private IntPtr GetStringi; internal struct egl @@ -117,7 +113,7 @@ namespace StgSharp.Internal private void* buffer; - //OSMesaContext handle; + // OSMesaContext handle; private void* handle; private int height; @@ -126,10 +122,10 @@ namespace StgSharp.Internal } // This is defined in platform.h - //GLFW_PLATFORM_CONTEXT_STATE + // GLFW_PLATFORM_CONTEXT_STATE } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct glfwVideomode { /*! The refresh rate, in Hz, of the video mode. @@ -155,7 +151,7 @@ namespace StgSharp.Internal } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct glfwGammaramp { /*! An array of value describing the response of the blue channel. @@ -175,7 +171,7 @@ namespace StgSharp.Internal } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWimage { /*! The pixel _data of this image, arranged left-to-right, top-to-bottom. @@ -192,40 +188,40 @@ namespace StgSharp.Internal } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWgamepadstate { /*! The states of each [gamepad button](@ref gamepad_buttons), `GLFW_PRESS` * or `GLFW_RELEASE`. */ - public fixed byte buttons[ 15 ]; + public fixed byte buttons[15]; /*! The states of each [gamepad axis](@ref gamepad_axes), in the range -1.0 * to 1.0 inclusive. */ - public fixed float axes[ 6 ]; + public fixed float axes[6]; } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWallocator { private void* user; - //GLFWallocatefun allocate; + // GLFWallocatefun allocate; private IntPtr allocate; - //GLFWdeallocatefun deallocate; + // GLFWdeallocatefun deallocate; private IntPtr deallocate; - //GLFWreallocatefun reallocate; + // GLFWreallocatefun reallocate; private IntPtr reallocate; } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct glfwMonitor { @@ -233,7 +229,7 @@ namespace StgSharp.Internal private glfwWindow* window; - private fixed byte name[ 128 ]; + private fixed byte name[128]; private glfwGammaramp currentRamp; private glfwGammaramp originalRamp; @@ -249,15 +245,15 @@ namespace StgSharp.Internal { get { - fixed( byte* cptr = name ) { - return Marshal.PtrToStringAnsi( ( IntPtr )cptr ); + fixed (byte* cptr = name) { + return Marshal.PtrToStringAnsi((IntPtr)cptr); } } } } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] internal unsafe struct glfwWindow { @@ -290,8 +286,8 @@ namespace StgSharp.Internal private IntPtr cursor; // _GLFWcursor* cursor; // glfwVideomode videoMode; // 根据GLFWvidmode的定义转换 private IntPtr monitor; // _GLFWmonitor* monitor; - public fixed byte keys[ glConst.GLFW_KEY_LAST + 1 ]; - public fixed byte mouseButtons[ glConst.GLFW_MOUSE_BUTTON_LAST + 1 ]; + public fixed byte keys[glConst.GLFW_KEY_LAST + 1]; + public fixed byte mouseButtons[glConst.GLFW_MOUSE_BUTTON_LAST + 1]; // _GLFWcontext viewPortDisplay; // 根据_GLFWcontext的定义转换 @@ -322,14 +318,14 @@ namespace StgSharp.Internal // GLFW_PLATFORM_WINDOW_STATE platformWindowState; } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public struct GLFWwindowCallback { } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public struct GLFWcursor { - //GLFWcursor* next; + // GLFWcursor* next; private IntPtr next; // This is defined in platform.h @@ -353,7 +349,7 @@ namespace StgSharp.Internal } */ - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWinitconfig { @@ -362,12 +358,12 @@ namespace StgSharp.Internal private int angleType; private int platformID; - //PFN_vkGetInstanceProcAddr vulkanLoader; + // PFN_vkGetInstanceProcAddr vulkanLoader; private IntPtr vulkanLoader; } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWwndconfig { @@ -404,7 +400,7 @@ namespace StgSharp.Internal { private GLFWbool retina = false; - public fixed byte frameName[ 256 ]; + public fixed byte frameName[256]; public Ns() { } @@ -413,8 +409,8 @@ namespace StgSharp.Internal internal struct X11 { - public fixed byte className[ 256 ]; - public fixed byte instanceName[ 256 ]; + public fixed byte className[256]; + public fixed byte instanceName[256]; public X11() { } @@ -430,7 +426,7 @@ namespace StgSharp.Internal internal struct Wl { - public fixed byte appId[ 256 ]; + public fixed byte appId[256]; public Wl() { } @@ -438,7 +434,7 @@ namespace StgSharp.Internal } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWctxconfig { @@ -454,7 +450,7 @@ namespace StgSharp.Internal private int robustness; private int source; - //glfwWindow* share; + // glfwWindow* share; private IntPtr share; internal Nsgl nsgl = new Nsgl(); @@ -470,7 +466,7 @@ namespace StgSharp.Internal } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWfbconfig { @@ -496,11 +492,11 @@ namespace StgSharp.Internal } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] internal unsafe struct GLFWlibrary { - [MarshalAs( UnmanagedType.ByValArray, SizeConst = glConst.GLFW_JOYSTICK_LAST + 1 )] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = glConst.GLFW_JOYSTICK_LAST + 1)] private GLFWjoystick[] joysticks = new GLFWjoystick[glConst.GLFW_JOYSTICK_LAST + 1]; private GLFWallocator allocator; @@ -519,19 +515,19 @@ namespace StgSharp.Internal private int monitorCount; - //GLFWcursor* cursorListHead; + // GLFWcursor* cursorListHead; private IntPtr cursorListHead; - //GLFWerror* errorListHead; + // GLFWerror* errorListHead; private IntPtr errorListHead; - //GLFWmapping* mappings; + // GLFWmapping* mappings; private IntPtr mappings; - //GLFWmonitor** monitors; + // GLFWmonitor** monitors; private IntPtr monitors; - //glfwWindow* windowListHead; + // glfwWindow* windowListHead; private IntPtr windowListHead; internal Callbacks callbacks = new Callbacks(); @@ -563,8 +559,8 @@ namespace StgSharp.Internal // This is defined in platform.h - //not transformed function defination - //GLFW_PLATFORM_LIBRARY_TIMER_STATE + // not transformed function defination + // GLFW_PLATFORM_LIBRARY_TIMER_STATE } internal unsafe struct Egl @@ -647,7 +643,7 @@ namespace StgSharp.Internal private GLFWbool KHR_xlib_surface; private GLFWbool MVK_macos_surface; private IntPtr GetInstanceProcAddr; - private fixed ulong extensions[ 2 ]; + private fixed ulong extensions[2]; public vk() { } @@ -664,7 +660,7 @@ namespace StgSharp.Internal } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWmapelement { @@ -677,24 +673,24 @@ namespace StgSharp.Internal } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWmapping { - [MarshalAs( UnmanagedType.ByValArray, SizeConst = 6 )] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] private GLFWmapelement[] axes = new GLFWmapelement[6]; - [MarshalAs( UnmanagedType.ByValArray, SizeConst = 15 )] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)] private GLFWmapelement[] buttons = new GLFWmapelement[15]; - private fixed byte guid[ 33 ]; + private fixed byte guid[33]; - private fixed byte name[ 128 ]; + private fixed byte name[128]; public GLFWmapping() { } } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWjoystick { @@ -702,8 +698,8 @@ namespace StgSharp.Internal private byte* buttons; private byte* hats; private void* userPointer; - private fixed byte guid[ 33 ]; - private fixed byte name[ 128 ]; + private fixed byte guid[33]; + private fixed byte name[128]; private GLFWbool allocated; private GLFWbool connected; @@ -711,7 +707,7 @@ namespace StgSharp.Internal private int buttonCount; private int hatCount; - //GLFWmapping* mapping; + // GLFWmapping* mapping; private IntPtr mapping; // This is defined in platform.h @@ -722,26 +718,26 @@ namespace StgSharp.Internal } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWls { // This is defined in platform.h - //GLFW_PLATFORM_TLS_STATE + // GLFW_PLATFORM_TLS_STATE } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWplatform { private int platformID; // init - //GLFWbool(*init)(void); + // GLFWbool(*init)(void); private IntPtr init; - //void (* terminate) (void); + // void (* terminate) (void); private IntPtr terminate; internal IntPtr createCursor; internal IntPtr createStandardCursor; @@ -762,9 +758,9 @@ namespace StgSharp.Internal internal IntPtr getEGLNativeWindow; // EGL - //EGLenum(*getEGLPlatform)(EGLint**); - //EGLNativeDisplayType(*getEGLNativeDisplay)(void); - //EGLNativeWindowType(*getEGLNativeWindow)(glfwWindow*); + // EGLenum(*getEGLPlatform)(EGLint**); + // EGLNativeDisplayType(*getEGLNativeDisplay)(void); + // EGLNativeWindowType(*getEGLNativeWindow)(glfwWindow*); internal IntPtr getEGLPlatform; internal IntPtr getFramebufferSize; internal IntPtr getGammaRamp; @@ -776,9 +772,9 @@ namespace StgSharp.Internal internal IntPtr getMonitorWorkarea; // vulkan - //void (* getRequiredInstanceExtensions) (byte**); - //GLFWbool(*getPhysicalDevicePresentationSupport)(VkInstance, VkPhysicalDevice, uint32_t); - //VkResult(*createWindowSurface)(VkInstance, glfwWindow*,const VkAllocationCallbacks*, VkSurfaceKHR*); + // void (* getRequiredInstanceExtensions) (byte**); + // GLFWbool(*getPhysicalDevicePresentationSupport)(VkInstance, VkPhysicalDevice, uint32_t); + // VkResult(*createWindowSurface)(VkInstance, glfwWindow*,const VkAllocationCallbacks*, VkSurfaceKHR*); internal IntPtr getRequiredInstanceExtensions; internal IntPtr getScancodeName; internal IntPtr getVideoMode; @@ -904,21 +900,21 @@ namespace StgSharp.Internal } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] public unsafe struct GLFWmutex { // This is defined in platform.h - //GLFW_PLATFORM_MUTEX_STATE + // GLFW_PLATFORM_MUTEX_STATE } - //public unsafe struct VkAllocationCallbacks { } + // public unsafe struct VkAllocationCallbacks { } - [StructLayout( LayoutKind.Sequential )] + [StructLayout(LayoutKind.Sequential)] internal unsafe struct VkExtensionProperties { - private fixed byte extensionName[ 256 ]; + private fixed byte extensionName[256]; private uint specVersion; public VkExtensionProperties() { } @@ -940,14 +936,14 @@ namespace StgSharp.Internal } */ - [StructLayout( LayoutKind.Explicit, Size = 16 )] + [StructLayout(LayoutKind.Explicit, Size = 16)] public struct uintptr_t { - [FieldOffset( 0 )] + [FieldOffset(0)] private long part1; - [FieldOffset( 8 )] + [FieldOffset(8)] private long part2; } diff --git a/StgSharp.Common/Internal/glfw.cs b/StgSharp.Common/Internal/glfw.cs index dd4b0d59..92b67ad7 100644 --- a/StgSharp.Common/Internal/glfw.cs +++ b/StgSharp.Common/Internal/glfw.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="glfw.cs" +// file="glfw" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Internal/glfwFunction.cs b/StgSharp.Common/Internal/glfwFunction.cs index 167f296e..990aa1e5 100644 --- a/StgSharp.Common/Internal/glfwFunction.cs +++ b/StgSharp.Common/Internal/glfwFunction.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="glfwFunction.cs" +// file="glfwFunction" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the ¡°Software¡±), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED ¡°AS IS¡±, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Internal/publicType.cs b/StgSharp.Common/Internal/publicType.cs index 8aaf866c..06820097 100644 --- a/StgSharp.Common/Internal/publicType.cs +++ b/StgSharp.Common/Internal/publicType.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="publicType.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="publicType" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics.OpenGL; using System; diff --git a/StgSharp.Common/MVVM/OpenGLControllingItemRender.cs b/StgSharp.Common/MVVM/OpenGLControllingItemRender.cs index 79f6649e..0277d4c8 100644 --- a/StgSharp.Common/MVVM/OpenGLControllingItemRender.cs +++ b/StgSharp.Common/MVVM/OpenGLControllingItemRender.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="OpenGLControllingItemRender.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="OpenGLControllingItemRender" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics.OpenGL; using System; diff --git a/StgSharp.Common/MVVM/View/ViewBase.cs b/StgSharp.Common/MVVM/View/ViewBase.cs index 57a43d8b..2570e8ef 100644 --- a/StgSharp.Common/MVVM/View/ViewBase.cs +++ b/StgSharp.Common/MVVM/View/ViewBase.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="ViewBase.cs" -// Project: StepVisualizer -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="ViewBase" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics; using StgSharp.Mathematics; using StgSharp.MVVM.ViewModel; @@ -73,16 +70,16 @@ namespace StgSharp.MVVM private ViewPort context; - private delegate bool GetDataBindingEntryDelegate( string name, out DataBindingEntry entry ); + private delegate bool GetDataBindingEntryDelegate(string name, out DataBindingEntry entry); - public DataBindingEntry this[ string name ] + public DataBindingEntry this[string name] { get { - if( getDataBindingEntry( name, out DataBindingEntry entry ) ) { + if (getDataBindingEntry(name, out DataBindingEntry entry)) { return entry; } - if( TryGetObjectReference( name, out entry ) ) { + if (TryGetObjectReference(name, out entry)) { return entry; } throw new KeyNotFoundException(); @@ -142,7 +139,7 @@ namespace StgSharp.MVVM set => _responder = value; } - public abstract void CustomizedInitialize( [NotNull]ViewModelBase viewModelBinding ); + public abstract void CustomizedInitialize([NotNull]ViewModelBase viewModelBinding); /// /// Get the status of a certain key on the keyboard. @@ -153,16 +150,13 @@ namespace StgSharp.MVVM /// /// representing if a key is pressed or released. /// - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public KeyStatus GetKeyStatus( KeyboardKey key ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public KeyStatus GetKeyStatus(KeyboardKey key) { - return InternalIO.glfwGetKey( context.ViewPortHandle, ( int )key ); + return InternalIO.glfwGetKey(context.ViewPortHandle, (int)key); } - public void InternalInitialize( - string name, - (int, int, int) cubeSize, - [NotNull]ViewModelBase viewModelBinding ) + public void InternalInitialize(string name, (int, int, int) cubeSize, [NotNull]ViewModelBase viewModelBinding) { SelfName = name; unitCubeSize = cubeSize; @@ -170,18 +164,18 @@ namespace StgSharp.MVVM context = viewModelBinding.ViewPortBinding; time = viewModelBinding.frameTimeProvider; - CustomizedInitialize( viewModelBinding ); + CustomizedInitialize(viewModelBinding); } - public abstract bool TryGetObjectReference( string name, out DataBindingEntry entry ); + public abstract bool TryGetObjectReference(string name, out DataBindingEntry entry); public void Use() { - if( usedFrame == 0 ) + if (usedFrame == 0) { - if( !ValidateInitialization() ) { + if (!ValidateInitialization()) { throw new InvalidOperationException( - "This view is not correctly initialized before rendering." ); + "This view is not correctly initialized before rendering."); } } Show(); @@ -190,10 +184,10 @@ namespace StgSharp.MVVM public bool ValidateInitialization() { - return ( _design != null ) && - ( _render != null ) && - ( getDataBindingEntry != null ) && - ( _responder != null ) && + return (_design != null) && + (_render != null) && + (getDataBindingEntry != null) && + (_responder != null) && _design.ValidateInitializing() && _responder.ValidateInitializing() && _render.ValidateInitializing(); diff --git a/StgSharp.Common/MVVM/View/ViewDesigner.cs b/StgSharp.Common/MVVM/View/ViewDesigner.cs index 1ad21992..172438f3 100644 --- a/StgSharp.Common/MVVM/View/ViewDesigner.cs +++ b/StgSharp.Common/MVVM/View/ViewDesigner.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="ViewDesigner.cs" -// Project: StepVisualizer -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="ViewDesigner" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Controlling.UsrActivity; using StgSharp.Controls; using StgSharp.Geometries; @@ -69,7 +66,7 @@ namespace StgSharp.MVVM private List _controlList; protected TView _binding; - public ViewDesigner( TView binding ) + public ViewDesigner(TView binding) { _binding = binding; _controlList = new List(); @@ -84,23 +81,23 @@ namespace StgSharp.MVVM int length, char blankFilling, PlainGeometryMesh tittle, - IEnumerable<(char, PlainGeometryMesh)> charList ) + IEnumerable<(char, PlainGeometryMesh)> charList) { CharacterLineIndexImage ret = new CharacterLineIndexImage( - length, blankFilling, tittle, charList ); - _controlList.Add( ret ); + length, blankFilling, tittle, charList); + _controlList.Add(ret); return ret; } public TriggerButton CreateKeyboardButton( Rectangle bonding, TextureProvider defaultAnimation, - bool isEnable ) + bool isEnable) { TriggerButton ret = new TriggerButton(); ret.BoundingBox = bonding; ret.Texture = defaultAnimation; - if( isEnable ) + if (isEnable) { ret.IsDisabled = false; ret.Enable(); @@ -109,7 +106,7 @@ namespace StgSharp.MVVM ret.IsDisabled = true; ret.Disable(); } - currentButtonGroup.AddButton( ret ); + currentButtonGroup.AddButton(ret); return ret; } @@ -118,17 +115,17 @@ namespace StgSharp.MVVM IClickTrigger rightBinding, IClickTrigger upBinding, IClickTrigger downBinding, - IClickTrigger confirmBinding ) + IClickTrigger confirmBinding) where TButtonGroup: KeyboardButtonGroup, new() { TButtonGroup ret = new TButtonGroup(); - _controlList.Add( ret ); + _controlList.Add(ret); currentButtonGroup = ret; - _binding.Responder[ leftBidning ] = ret.MoveLeft; - _binding.Responder[ rightBinding ] = ret.MoveRight; - _binding.Responder[ upBinding ] = ret.MoveUp; - _binding.Responder[ downBinding ] = ret.MoveDown; - _binding.Responder[ confirmBinding ] = ret.Confirm; + _binding.Responder[leftBidning] = ret.MoveLeft; + _binding.Responder[rightBinding] = ret.MoveRight; + _binding.Responder[upBinding] = ret.MoveUp; + _binding.Responder[downBinding] = ret.MoveDown; + _binding.Responder[confirmBinding] = ret.Confirm; return ret; } diff --git a/StgSharp.Common/MVVM/View/ViewRender.cs b/StgSharp.Common/MVVM/View/ViewRender.cs index 7a682898..06a9b786 100644 --- a/StgSharp.Common/MVVM/View/ViewRender.cs +++ b/StgSharp.Common/MVVM/View/ViewRender.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="ViewRender.cs" -// Project: StepVisualizer -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="ViewRender" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics; using StgSharp.HighPerformance; @@ -44,7 +41,7 @@ namespace StgSharp.MVVM protected internal interface IViewRender where TView: ViewBase { - RenderStream this[ DataLabel renderName ] { get; } + RenderStream this[DataLabel renderName] { get; } void CustomizedInitialize(); @@ -59,24 +56,23 @@ namespace StgSharp.MVVM protected abstract class ViewRender : IViewRender where TView: ViewBase { - protected ViewRender( TView binding ) + protected ViewRender(TView binding) { _binding = binding; _render = new Dictionary(); } - public RenderStream this[ DataLabel renderName ] + public RenderStream this[DataLabel renderName] { - get => _render.TryGetValue( renderName, out RenderStream stream ) ? - stream : ( null! ); + get => _render.TryGetValue(renderName, out RenderStream stream) ? stream : (null!); protected set { - if( _render.ContainsKey( renderName ) ) + if (_render.ContainsKey(renderName)) { - _render[ renderName ] = value; + _render[renderName] = value; } else { - _render.Add( renderName, value ); + _render.Add(renderName, value); } } } @@ -85,26 +81,26 @@ namespace StgSharp.MVVM protected ViewPort ContextBinding => _binding.context; - protected ViewDesigner Design => ( _binding.Designer as ViewDesigner )!; + protected ViewDesigner Design => (_binding.Designer as ViewDesigner)!; protected Dictionary Render { get => _render; } - protected ViewResponder Responder => ( _binding.Responder as ViewResponder )!; + protected ViewResponder Responder => (_binding.Responder as ViewResponder)!; public T CreateRenderStream() where T: RenderStream, new() { T ret = new T(); - ret.Initialize( _binding.context, Binding.TimeProvider ); + ret.Initialize(_binding.context, Binding.TimeProvider); return ret; } - public T CreateRenderStream( ViewPort vp ) where T: RenderStream, new() + public T CreateRenderStream(ViewPort vp) where T: RenderStream, new() { T ret = new T(); - ret.Initialize( vp, Binding.TimeProvider ); + ret.Initialize(vp, Binding.TimeProvider); return ret; } @@ -112,7 +108,7 @@ namespace StgSharp.MVVM public IEnumerator GetEnumerator() { - foreach( RenderStream item in Render.Values ) { + foreach (RenderStream item in Render.Values) { yield return item.BindedViewPortContext; } } diff --git a/StgSharp.Common/MVVM/View/ViewResponder.cs b/StgSharp.Common/MVVM/View/ViewResponder.cs index a792c87c..92aed7c9 100644 --- a/StgSharp.Common/MVVM/View/ViewResponder.cs +++ b/StgSharp.Common/MVVM/View/ViewResponder.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="ViewResponder.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="ViewResponder" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Controlling.UsrActivity; using StgSharp.MVVM.ViewModel; @@ -45,11 +42,11 @@ namespace StgSharp.MVVM protected interface IViewResponder where TVIew: ViewBase { - Action? this[ IClickTrigger trigger ] { get; set; } + Action? this[IClickTrigger trigger] { get; set; } - void CustomizedInitialize( Func keyRegister ); + void CustomizedInitialize(Func keyRegister); - void Initialize( MethodLookUpDelegate methodGetter ); + void Initialize(MethodLookUpDelegate methodGetter); void ProcessUserInput(); @@ -65,7 +62,7 @@ namespace StgSharp.MVVM private Dictionary nameToCallbackMap; private TView _binding; - protected ViewResponder( TView binding ) + protected ViewResponder(TView binding) { keyCallbackIndex = new Dictionary(); nameToCallbackMap = new Dictionary(); @@ -73,58 +70,54 @@ namespace StgSharp.MVVM } #pragma warning disable CA1043 - public Action? this[ IClickTrigger trigger ] + public Action? this[IClickTrigger trigger] #pragma warning restore CA1043 { - get => keyCallbackIndex.TryGetValue( trigger, out Action callback ) ? - callback : null; + get => keyCallbackIndex.TryGetValue(trigger, out Action callback) ? callback : null; set { - if( keyCallbackIndex.TryGetValue( trigger, out Action callback ) ) + if (keyCallbackIndex.TryGetValue(trigger, out Action callback)) { callback += value; } else { keyCallbackIndex.Add( - trigger, value ?? throw new ArgumentNullException( nameof( value ) ) ); + trigger, value ?? throw new ArgumentNullException(nameof(value))); } } } protected TView Binding => _binding; - public abstract void CustomizedInitialize( - Func keyRegister ); + public abstract void CustomizedInitialize(Func keyRegister); - public void Initialize( MethodLookUpDelegate methodGetter ) + public void Initialize(MethodLookUpDelegate methodGetter) { - if( _isInitialized ) { + if (_isInitialized) { return; } - CustomizedInitialize( - ( trigger, name ) => { - if( !nameToCallbackMap.TryGetValue( name, out Action ret ) ) + CustomizedInitialize((trigger, name) => { + if (!nameToCallbackMap.TryGetValue(name, out Action ret)) + { + if (methodGetter(name, out Action lookup)) { - if( methodGetter( name, out Action lookup ) ) - { - this[ trigger ] = lookup; - } else - { - throw new InvalidOperationException( - $"Cannot find method named {name} in binded view model" ); - } + this[trigger] = lookup; + } else + { + throw new InvalidOperationException( + $"Cannot find method named {name} in binded view model"); } - return ret; - } ); + } + return ret; + }); } public void ProcessUserInput() { - foreach( KeyValuePair pair in keyCallbackIndex ) + foreach (KeyValuePair pair in keyCallbackIndex) { - if( InternalIO.glfwGetKey( _binding.ViewHandle, - pair.Key.TargetKeyOrButtonID ) == - pair.Key.TriggeredStatus ) { + if (InternalIO.glfwGetKey(_binding.ViewHandle, + pair.Key.TargetKeyOrButtonID) == pair.Key.TriggeredStatus) { pair.Value(); } } diff --git a/StgSharp.Common/MVVM/ViewModel/DataBinding.cs b/StgSharp.Common/MVVM/ViewModel/DataBinding.cs index 4f95b533..38911c32 100644 --- a/StgSharp.Common/MVVM/ViewModel/DataBinding.cs +++ b/StgSharp.Common/MVVM/ViewModel/DataBinding.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="DataBinding.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="DataBinding" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.HighPerformance; using System; @@ -40,40 +37,40 @@ namespace StgSharp.MVVM.ViewModel { #nullable enable -[UnmanagedFunctionPointer( CallingConvention.Cdecl )] + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] public delegate ref object BindingDataGetter(); -[UnmanagedFunctionPointer( CallingConvention.Cdecl )] - public delegate void BindingDataSetter( ref object value ); -[UnmanagedFunctionPointer( CallingConvention.Cdecl )] - public delegate bool MethodLookUpDelegate( string name, out Action callback ); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void BindingDataSetter(ref object value); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate bool MethodLookUpDelegate(string name, out Action callback); public abstract partial class ViewModelBase { - public bool MethodLookup( string methodName, out Action callback ) + public bool MethodLookup(string methodName, out Action callback) { - MethodInfo method = GetType().GetMethod( methodName )!; - if( method == null ) + MethodInfo method = GetType().GetMethod(methodName)!; + if (method == null) { callback = null!; return false; } try { - callback = ( Action )Delegate.CreateDelegate( typeof( Action ), this, methodName ); + callback = (Action)Delegate.CreateDelegate(typeof(Action), this, methodName); return true; } - catch( MissingMethodException ) + catch (MissingMethodException) { callback = null!; return false; } - catch( MethodAccessException ) + catch (MethodAccessException) { callback = null!; return false; } - catch( Exception ) + catch (Exception) { throw; } @@ -81,20 +78,20 @@ namespace StgSharp.MVVM.ViewModel } - [StructLayout( LayoutKind.Explicit )] + [StructLayout(LayoutKind.Explicit)] public unsafe struct DataBindingEntry { - [FieldOffset( 0 )] private IntPtr getterPtr; - [FieldOffset( 8 )] private IntPtr setterPtr; - [FieldOffset( 0 )] private M128 _mask; + [FieldOffset(0)] private IntPtr getterPtr; + [FieldOffset(8)] private IntPtr setterPtr; + [FieldOffset(0)] private M128 _mask; public DataBindingEntry( [NotNull] BindingDataGetter gettingCallback, - [NotNull] BindingDataSetter settingCallback ) + [NotNull] BindingDataSetter settingCallback) { - getterPtr = Marshal.GetFunctionPointerForDelegate( gettingCallback ); - setterPtr = Marshal.GetFunctionPointerForDelegate( settingCallback ); + getterPtr = Marshal.GetFunctionPointerForDelegate(gettingCallback); + setterPtr = Marshal.GetFunctionPointerForDelegate(settingCallback); } public static DataBindingEntry NullBinding @@ -102,22 +99,22 @@ namespace StgSharp.MVVM.ViewModel get => new DataBindingEntry(); } - public bool Equals( DataBindingEntry other ) + public bool Equals(DataBindingEntry other) { - return ( _mask == other._mask ); + return (_mask == other._mask); } - public override bool Equals( object obj ) + public override bool Equals(object obj) { - if( obj is not DataBindingEntry other ) { + if (obj is not DataBindingEntry other) { return false; } - return Equals( other ); + return Equals(other); } - public bool ExactEqual( DataBindingEntry other ) + public bool ExactEqual(DataBindingEntry other) { - return ( getterPtr == other.getterPtr ) && ( setterPtr == other.setterPtr ); + return (getterPtr == other.getterPtr) && (setterPtr == other.setterPtr); } public override int GetHashCode() @@ -127,20 +124,20 @@ namespace StgSharp.MVVM.ViewModel public ref object GetValue() { - return ref ( ( delegate* unmanaged[Cdecl] )getterPtr )(); + return ref ((delegate* unmanaged[Cdecl])getterPtr)(); } - public void SetValue( ref object value ) + public void SetValue(ref object value) { - ( ( delegate* unmanaged[Cdecl] )setterPtr )( ref value ); + ((delegate* unmanaged[Cdecl])setterPtr)(ref value); } - public static bool operator !=( DataBindingEntry left, DataBindingEntry right ) + public static bool operator !=(DataBindingEntry left, DataBindingEntry right) { return left._mask != right._mask; } - public static bool operator ==( DataBindingEntry left, DataBindingEntry right ) + public static bool operator ==(DataBindingEntry left, DataBindingEntry right) { return left._mask == right._mask; } diff --git a/StgSharp.Common/MVVM/ViewModel/ShowViewPort.cs b/StgSharp.Common/MVVM/ViewModel/ShowViewPort.cs index af5937aa..477dbe8d 100644 --- a/StgSharp.Common/MVVM/ViewModel/ShowViewPort.cs +++ b/StgSharp.Common/MVVM/ViewModel/ShowViewPort.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="ShowViewPort.cs" -// Project: StepVisualizer -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="ShowViewPort" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Controls; using StgSharp.Graphics; using StgSharp.MVVM; @@ -56,39 +53,38 @@ namespace StgSharp.MVVM.ViewModel /// /// CustomizeInit this form and render it on screen, and respond with operation /// - public unsafe void UseViewModel( string viewEntryName ) + public unsafe void UseViewModel(string viewEntryName) { CustomizeInitialize(); - UseViewInNextFrame( viewEntryName ); - TimeSpanAwaitingToken fpsCountingToken = fpsCountProvider.ParticipantSpanAwaiting( 1 ); + UseViewInNextFrame(viewEntryName); + TimeSpanAwaitingToken fpsCountingToken = fpsCountProvider.ParticipantSpanAwaiting(1); fpsCountingToken.TimeSpanRefreshed += CountFps; fpsCountingToken.MissTimeSpanRefreshed += CountFps; - if( _nextView != _currentView ) { - Interlocked.Exchange( ref _currentView, _nextView ); + if (_nextView != _currentView) { + Interlocked.Exchange(ref _currentView, _nextView); } - Thread renderThread = new Thread( - ( token ) => { - try - { - ProcessFrameWithoutEvent(); - } - catch( Exception ex ) - { - InternalIO.InternalWriteLog( - $"Critical error when rendering:\n" + $"{ex}", LogType.Error ); - ShouldClose = true; - throw; - } - } ); + Thread renderThread = new Thread((token) => { + try + { + ProcessFrameWithoutEvent(); + } + catch (Exception ex) + { + InternalIO.InternalWriteLog( + $"Critical error when rendering:\n" + $"{ex}", LogType.Error); + ShouldClose = true; + throw; + } + }); renderThread.Start(); /**/ - using( TimeSpanAwaitingToken eventAwaitingToken = frameTimeProvider.ParticipantSpanAwaiting( - 1 ) ) + using (TimeSpanAwaitingToken eventAwaitingToken = frameTimeProvider.ParticipantSpanAwaiting( + 1)) { - while( _closed ) + while (_closed) { - if( _nextView != _currentView ) { - Interlocked.Exchange( ref _currentView, _nextView ); + if (_nextView != _currentView) { + Interlocked.Exchange(ref _currentView, _nextView); } InternalIO.glfwPollEvents(); eventAwaitingToken.WaitNextSpan(); @@ -102,24 +98,24 @@ namespace StgSharp.MVVM.ViewModel frameTimeProvider.StopSpanProviding(); } - protected void UseViewInNextFrame( string name ) + protected void UseViewInNextFrame(string name) { - if( !allView.TryGetValue( name, out ViewBase v ) ) { + if (!allView.TryGetValue(name, out ViewBase v)) { throw new KeyNotFoundException( - $"{$"Cannot find View named {name} "}{$"in current View Model of {GetType().FullName}"}" ); + $"{$"Cannot find View named {name} "}{$"in current View Model of {GetType().FullName}"}"); } CurrentView = v; } - private void CountFps( object sender, EventArgs e ) + private void CountFps(object sender, EventArgs e) { - Interlocked.Exchange( ref _frameSpeed, _frameCount ); - Interlocked.Exchange( ref _frameCount, 0 ); + Interlocked.Exchange(ref _frameSpeed, _frameCount); + Interlocked.Exchange(ref _frameCount, 0); } private unsafe void PrivateShow() { - if( 0 == InternalIO.glfwWindowShouldClose( this.viewPortDisplay.ViewPortHandle ) ) + if (0 == InternalIO.glfwWindowShouldClose(this.viewPortDisplay.ViewPortHandle)) { CurrentView.Use(); RenderStream.PollEvents(); @@ -128,18 +124,18 @@ namespace StgSharp.MVVM.ViewModel private void ProcessFrameWithoutEvent() { - using( TimeSpanAwaitingToken renderAwaitingToken = frameTimeProvider.ParticipantSpanAwaiting( - 1 ) ) + using (TimeSpanAwaitingToken renderAwaitingToken = frameTimeProvider.ParticipantSpanAwaiting( + 1)) { - renderAwaitingToken.TimeSpanRefreshed += ( _, _ ) => { }; - while( _closed ) + renderAwaitingToken.TimeSpanRefreshed += (_, _) => { }; + while (_closed) { - foreach( ViewPort context in CurrentView.Render ) { + foreach (ViewPort context in CurrentView.Render) { context.FlushSize(); } CurrentView.Use(); renderAwaitingToken.WaitNextSpan(); - Interlocked.Add( ref _frameCount, 1 ); + Interlocked.Add(ref _frameCount, 1); } } } diff --git a/StgSharp.Common/MVVM/ViewModel/ViewManage.cs b/StgSharp.Common/MVVM/ViewModel/ViewManage.cs index d50bf863..02f91f64 100644 --- a/StgSharp.Common/MVVM/ViewModel/ViewManage.cs +++ b/StgSharp.Common/MVVM/ViewModel/ViewManage.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="ViewManage.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="ViewManage" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics; using StgSharp.Graphics.OpenGL; using StgSharp.MVVM; @@ -44,13 +41,12 @@ namespace StgSharp.MVVM.ViewModel private Dictionary allView; - public T CreateAndBindView( string name, (int x, int y, int z) unitCubeSize ) - where T: ViewBase, new() + public T CreateAndBindView(string name, (int x, int y, int z) unitCubeSize) where T: ViewBase, new() { T ret = new T(); ret.SelfName = name; - ret.InternalInitialize( name, unitCubeSize, this ); - allView.Add( name, ret ); + ret.InternalInitialize(name, unitCubeSize, this); + allView.Add(name, ret); return ret; } diff --git a/StgSharp.Common/MVVM/ViewModel/ViewModel.cs b/StgSharp.Common/MVVM/ViewModel/ViewModel.cs index 712f1bde..3ddc85e4 100644 --- a/StgSharp.Common/MVVM/ViewModel/ViewModel.cs +++ b/StgSharp.Common/MVVM/ViewModel/ViewModel.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="ViewModel" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/MVVM/ViewPort.cs b/StgSharp.Common/MVVM/ViewPort.cs index e34b40fa..f166677e 100644 --- a/StgSharp.Common/MVVM/ViewPort.cs +++ b/StgSharp.Common/MVVM/ViewPort.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="ViewPort.cs" +// file="ViewPort" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -77,17 +74,17 @@ namespace StgSharp.MVVM public unsafe int Height { -[MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _height; -[MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal set => Interlocked.Exchange(ref _height, value); } public unsafe int Width { -[MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _width; -[MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal set => Interlocked.Exchange(ref _width, value); } diff --git a/StgSharp.Common/Mathematics/Graphic/Vector.Cross.cs b/StgSharp.Common/Mathematics/Graphic/Vector.Cross.cs index e68a2baf..242c505f 100644 --- a/StgSharp.Common/Mathematics/Graphic/Vector.Cross.cs +++ b/StgSharp.Common/Mathematics/Graphic/Vector.Cross.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Vector.Cross.cs" -// Project: World -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// file="Vector.Cross" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Graphic/Vector.GetAngle.cs b/StgSharp.Common/Mathematics/Graphic/Vector.GetAngle.cs index 32578f4e..e1af8773 100644 --- a/StgSharp.Common/Mathematics/Graphic/Vector.GetAngle.cs +++ b/StgSharp.Common/Mathematics/Graphic/Vector.GetAngle.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Vector.GetAngle.cs" +// file="Vector.GetAngle" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Graphic/Vector.GetLength.cs b/StgSharp.Common/Mathematics/Graphic/Vector.GetLength.cs index a0079c1c..45d6d33d 100644 --- a/StgSharp.Common/Mathematics/Graphic/Vector.GetLength.cs +++ b/StgSharp.Common/Mathematics/Graphic/Vector.GetLength.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Vector.GetLength.cs" +// file="Vector.GetLength" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Graphic/Vector.Normalize.cs b/StgSharp.Common/Mathematics/Graphic/Vector.Normalize.cs index 3070d9dc..13aaf369 100644 --- a/StgSharp.Common/Mathematics/Graphic/Vector.Normalize.cs +++ b/StgSharp.Common/Mathematics/Graphic/Vector.Normalize.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Vector.Normalize.cs" +// file="Vector.Normalize" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Graphic/Vector.Orthogonalize.cs b/StgSharp.Common/Mathematics/Graphic/Vector.Orthogonalize.cs index 0dde5cde..35758d11 100644 --- a/StgSharp.Common/Mathematics/Graphic/Vector.Orthogonalize.cs +++ b/StgSharp.Common/Mathematics/Graphic/Vector.Orthogonalize.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Vector.Orthogonalize.cs" -// Project: World -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// file="Vector.Orthogonalize" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Linear/Cordination.cs b/StgSharp.Common/Mathematics/Linear/Cordination.cs index 180f8e63..c40da654 100644 --- a/StgSharp.Common/Mathematics/Linear/Cordination.cs +++ b/StgSharp.Common/Mathematics/Linear/Cordination.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="Cordination" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Mathematics/Linear/IUnmanagedVector.cs b/StgSharp.Common/Mathematics/Linear/IUnmanagedVector.cs index 88262747..4b2cc294 100644 --- a/StgSharp.Common/Mathematics/Linear/IUnmanagedVector.cs +++ b/StgSharp.Common/Mathematics/Linear/IUnmanagedVector.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="IUnmanagedVector.cs" +// file="IUnmanagedVector" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Linear/Matrix.GC.cs b/StgSharp.Common/Mathematics/Linear/Matrix.GC.cs index 2cb25aaf..aa9e4919 100644 --- a/StgSharp.Common/Mathematics/Linear/Matrix.GC.cs +++ b/StgSharp.Common/Mathematics/Linear/Matrix.GC.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Matrix.GC.cs" +// file="Matrix.GC" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Linear/Matrix.HLSF.cs b/StgSharp.Common/Mathematics/Linear/Matrix.HLSF.cs index 14740ee0..073a22e7 100644 --- a/StgSharp.Common/Mathematics/Linear/Matrix.HLSF.cs +++ b/StgSharp.Common/Mathematics/Linear/Matrix.HLSF.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Matrix.HLSF.cs" +// file="Matrix.HLSF" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Linear/Matrix.cs b/StgSharp.Common/Mathematics/Linear/Matrix.cs index 25a6e716..53feeb04 100644 --- a/StgSharp.Common/Mathematics/Linear/Matrix.cs +++ b/StgSharp.Common/Mathematics/Linear/Matrix.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Matrix.cs" +// file="Matrix" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Linear/MatrixEnum.cs b/StgSharp.Common/Mathematics/Linear/MatrixEnum.cs index 588a98f1..4c0aee51 100644 --- a/StgSharp.Common/Mathematics/Linear/MatrixEnum.cs +++ b/StgSharp.Common/Mathematics/Linear/MatrixEnum.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="MatrixEnum.cs" +// file="MatrixEnum" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Linear/MatrixIndex.cs b/StgSharp.Common/Mathematics/Linear/MatrixIndex.cs index 205e8cd5..6275eb0f 100644 --- a/StgSharp.Common/Mathematics/Linear/MatrixIndex.cs +++ b/StgSharp.Common/Mathematics/Linear/MatrixIndex.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="MatrixIndex.cs" +// file="MatrixIndex" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Scalar/ACos.cs b/StgSharp.Common/Mathematics/Scalar/ACos.cs index f46bc237..d81c3b47 100644 --- a/StgSharp.Common/Mathematics/Scalar/ACos.cs +++ b/StgSharp.Common/Mathematics/Scalar/ACos.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="ACos.cs" +// file="ACos" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Scalar/ASin.cs b/StgSharp.Common/Mathematics/Scalar/ASin.cs index 1067d241..e1ae92d4 100644 --- a/StgSharp.Common/Mathematics/Scalar/ASin.cs +++ b/StgSharp.Common/Mathematics/Scalar/ASin.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="ASin.cs" +// file="ASin" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Scalar/ATan.cs b/StgSharp.Common/Mathematics/Scalar/ATan.cs index d1cbbd73..77469b91 100644 --- a/StgSharp.Common/Mathematics/Scalar/ATan.cs +++ b/StgSharp.Common/Mathematics/Scalar/ATan.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="ATan.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="ATan" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Runtime.CompilerServices; @@ -36,10 +33,10 @@ namespace StgSharp.Mathematics public static unsafe partial class Scaler { - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static unsafe float ATan( float x ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe float ATan(float x) { - return MathF.Atan( x ); + return MathF.Atan(x); /* float sign = 1, angle = 0; if (x < 0) diff --git a/StgSharp.Common/Mathematics/Scalar/BasicOps.cs b/StgSharp.Common/Mathematics/Scalar/BasicOps.cs index 529b1ae8..08f6784c 100644 --- a/StgSharp.Common/Mathematics/Scalar/BasicOps.cs +++ b/StgSharp.Common/Mathematics/Scalar/BasicOps.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="BasicOps.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="BasicOps" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Globalization; using System.Runtime.CompilerServices; @@ -37,29 +34,29 @@ namespace StgSharp.Mathematics public static unsafe partial class Scaler { - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static unsafe float Abs( float x ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe float Abs(float x) { - uint* a = ( uint* )&x; + uint* a = (uint*)&x; *a &= 0b_0111_1111_1111_1111_1111_1111_1111_1111; - return *( float* )a; + return *(float*)a; } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static unsafe int Abs( int x ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe int Abs(int x) { - uint* a = ( uint* )&x; + uint* a = (uint*)&x; *a &= 0b_0111_1111_1111_1111_1111_1111_1111_1111; - return *( int* )a; + return *(int*)a; } - internal static string GetListSeparator( IFormatProvider formatProvider ) + internal static string GetListSeparator(IFormatProvider formatProvider) { - if( formatProvider is CultureInfo cultureInfo ) { + if (formatProvider is CultureInfo cultureInfo) { return cultureInfo.TextInfo.ListSeparator; } - if( formatProvider?.GetFormat( typeof( TextInfo ) ) is TextInfo textInfo ) { + if (formatProvider?.GetFormat(typeof(TextInfo)) is TextInfo textInfo) { return textInfo.ListSeparator; } diff --git a/StgSharp.Common/Mathematics/Scalar/Compare.cs b/StgSharp.Common/Mathematics/Scalar/Compare.cs index 5a9d27b6..ed29b609 100644 --- a/StgSharp.Common/Mathematics/Scalar/Compare.cs +++ b/StgSharp.Common/Mathematics/Scalar/Compare.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Compare.cs" +// file="Compare" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Scalar/Cos.cs b/StgSharp.Common/Mathematics/Scalar/Cos.cs index b777e40e..54359c02 100644 --- a/StgSharp.Common/Mathematics/Scalar/Cos.cs +++ b/StgSharp.Common/Mathematics/Scalar/Cos.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Cos.cs" +// file="Cos" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Scalar/Ctor.cs b/StgSharp.Common/Mathematics/Scalar/Ctor.cs index d2036d0a..bd97331f 100644 --- a/StgSharp.Common/Mathematics/Scalar/Ctor.cs +++ b/StgSharp.Common/Mathematics/Scalar/Ctor.cs @@ -1,39 +1,36 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Ctor.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="Ctor" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Runtime.InteropServices; namespace StgSharp.Mathematics { - public unsafe delegate float ScalarCalcHandler( float* x ); + public unsafe delegate float ScalarCalcHandler(float* x); public static unsafe partial class Scaler { @@ -45,15 +42,11 @@ namespace StgSharp.Mathematics static Scaler() { } - [DllImport( "Kernel32.dll", EntryPoint = "VirtualAlloc" )] - private static extern IntPtr VirtualAlloc( - IntPtr address, - int size, - uint allocType, - uint protect ); + [DllImport("Kernel32.dll", EntryPoint = "VirtualAlloc")] + private static extern IntPtr VirtualAlloc(IntPtr address, int size, uint allocType, uint protect); - [DllImport( "Kernel32.dll", EntryPoint = "VirtualFree" )] - private static extern bool VirtualFree( IntPtr address, int size, uint freeType ); + [DllImport("Kernel32.dll", EntryPoint = "VirtualFree")] + private static extern bool VirtualFree(IntPtr address, int size, uint freeType); } } diff --git a/StgSharp.Common/Mathematics/Scalar/Exp.cs b/StgSharp.Common/Mathematics/Scalar/Exp.cs index d3b2919e..db92bb2a 100644 --- a/StgSharp.Common/Mathematics/Scalar/Exp.cs +++ b/StgSharp.Common/Mathematics/Scalar/Exp.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Exp.cs" +// file="Exp" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Scalar/Factorial.cs b/StgSharp.Common/Mathematics/Scalar/Factorial.cs index 47c08ff8..df68247a 100644 --- a/StgSharp.Common/Mathematics/Scalar/Factorial.cs +++ b/StgSharp.Common/Mathematics/Scalar/Factorial.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Factorial.cs" +// file="Factorial" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -39,7 +36,21 @@ namespace StgSharp.Mathematics public static partial class Scaler { - private static readonly uint[] factorialResult = [1, 1, 2, 6, 24,120,720,5040,40320,362880,3628800,39916800,479001600]; + private static readonly uint[] factorialResult = [ + 1, + 1, + 2, + 6, + 24, + 120, + 720, + 5040, + 40320, + 362880, + 3628800, + 39916800, + 479001600 + ]; public static unsafe ulong Factorial(int n) { diff --git a/StgSharp.Common/Mathematics/Scalar/Function.cs b/StgSharp.Common/Mathematics/Scalar/Function.cs index 163c8819..571618d0 100644 --- a/StgSharp.Common/Mathematics/Scalar/Function.cs +++ b/StgSharp.Common/Mathematics/Scalar/Function.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Function.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="Function" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- namespace StgSharp.Mathematics { public class Function { } diff --git a/StgSharp.Common/Mathematics/Scalar/Log.cs b/StgSharp.Common/Mathematics/Scalar/Log.cs index 6d1b446a..d80c415a 100644 --- a/StgSharp.Common/Mathematics/Scalar/Log.cs +++ b/StgSharp.Common/Mathematics/Scalar/Log.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="Log.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="Log" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; namespace StgSharp.Mathematics @@ -48,35 +45,35 @@ namespace StgSharp.Mathematics /// /// Returns the value of ln(x). /// - public static unsafe float Log( float x ) + public static unsafe float Log(float x) { - if( x < 0 ) { + if (x < 0) { throw new ArgumentOutOfRangeException(); } - uint input = *( uint* )&x; + uint input = *(uint*)&x; - int f = ( int )input; + int f = (int)input; f >>= 23; f -= 127; input <<= 9; input >>= 9; input += 0b_0011_1111_1000_0000_0000_0000_0000_0000; - float result = *( float* )&input; - uint order = ( ( uint )( result * 100 ) ) - 100; + float result = *(float*)&input; + uint order = ((uint)(result * 100)) - 100; - float cache = ( result / ( 1f + ( 0.01f * order ) ) ) - 1; - result = ( cache * ( -0.25f ) ) + 0.3333333333333f; - result = ( result * cache ) - 0.5f; - result = ( result * cache ) + 1.0f; + float cache = (result / (1f + (0.01f * order))) - 1; + result = (cache * (-0.25f)) + 0.3333333333333f; + result = (result * cache) - 0.5f; + result = (result * cache) + 1.0f; result *= cache; return - ( f * 0.6931471806f ) + result + logArray[ order ]; + (f * 0.6931471806f) + result + logArray[order]; } - public static float Log( float x, float y ) + public static float Log(float x, float y) { - return Log( x ) / Log( y ); + return Log(x) / Log(y); } } diff --git a/StgSharp.Common/Mathematics/Scalar/Pow.cs b/StgSharp.Common/Mathematics/Scalar/Pow.cs index 5baf6fad..95bf0a13 100644 --- a/StgSharp.Common/Mathematics/Scalar/Pow.cs +++ b/StgSharp.Common/Mathematics/Scalar/Pow.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Pow.cs" +// file="Pow" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Scalar/Random.cs b/StgSharp.Common/Mathematics/Scalar/Random.cs index 95c1ee6b..4bd672f2 100644 --- a/StgSharp.Common/Mathematics/Scalar/Random.cs +++ b/StgSharp.Common/Mathematics/Scalar/Random.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Random.cs" +// file="Random" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Scalar/SignOf.cs b/StgSharp.Common/Mathematics/Scalar/SignOf.cs index 3eecc6a6..fb291592 100644 --- a/StgSharp.Common/Mathematics/Scalar/SignOf.cs +++ b/StgSharp.Common/Mathematics/Scalar/SignOf.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="SignOf.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="SignOf" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; @@ -40,25 +37,25 @@ namespace StgSharp.Mathematics public static unsafe partial class Scaler { - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static unsafe int SignOf( float x ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe int SignOf(float x) { - if( x == 0 ) { + if (x == 0) { return 0; } - if( x > 0 ) { + if (x > 0) { return 1; } return -1; } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public static unsafe int SignOf( int x ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static unsafe int SignOf(int x) { - if( x == 0 ) { + if (x == 0) { return 0; } - if( x > 0 ) { + if (x > 0) { return 1; } return -1; diff --git a/StgSharp.Common/Mathematics/Scalar/Sin.cs b/StgSharp.Common/Mathematics/Scalar/Sin.cs index 58cd2e5d..0e428c6e 100644 --- a/StgSharp.Common/Mathematics/Scalar/Sin.cs +++ b/StgSharp.Common/Mathematics/Scalar/Sin.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Sin.cs" +// file="Sin" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Scalar/Sqrt.cs b/StgSharp.Common/Mathematics/Scalar/Sqrt.cs index 28721f82..b070fc0b 100644 --- a/StgSharp.Common/Mathematics/Scalar/Sqrt.cs +++ b/StgSharp.Common/Mathematics/Scalar/Sqrt.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Sqrt.cs" +// file="Sqrt" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Mathematics/Scalar/Tan.cs b/StgSharp.Common/Mathematics/Scalar/Tan.cs index c1663f95..08bd6656 100644 --- a/StgSharp.Common/Mathematics/Scalar/Tan.cs +++ b/StgSharp.Common/Mathematics/Scalar/Tan.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="Tan.cs" +// file="Tan" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/PipeLine/CrossFramePipelineNode.cs b/StgSharp.Common/PipeLine/CrossFramePipelineNode.cs index dd8c8ef9..5863abb0 100644 --- a/StgSharp.Common/PipeLine/CrossFramePipelineNode.cs +++ b/StgSharp.Common/PipeLine/CrossFramePipelineNode.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="CrossFramePipelineNode.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="CrossFramePipelineNode" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.PipeLine; using System; @@ -41,18 +38,19 @@ namespace StgSharp.PipeLine public class CrossFrameOperation : IConvertableToPipelineNode { - private static string[] _inputName = ["TaskIn"]; - private static string[] _outputName = ["TaskOut"]; + private static string[] _inputName = [ "TaskIn" ]; + private static string[] _outputName = [ "TaskOut" ]; private Action _mainExecution; private int currentCount; private readonly int cycleCount; - public CrossFrameOperation( Action startup, int cycleCount ) + public CrossFrameOperation(Action startup, int cycleCount) { MainExecution = startup; - this.cycleCount = ( cycleCount > 1 ) ? - cycleCount : throw new ArgumentException( - $"{$"The {typeof(CrossFrameOperation).Name} crosses only one cycle, "}{$"please use a {typeof(PipelineNode).Name} instead."}" ); + this.cycleCount = (cycleCount > 1) ? + cycleCount : + throw new ArgumentException( + $"{$"The {typeof(CrossFrameOperation).Name} crosses only one cycle, "}{$"please use a {typeof(PipelineNode).Name} instead."}"); this.cycleCount = cycleCount; currentCount = cycleCount; } @@ -74,19 +72,19 @@ namespace StgSharp.PipeLine public void NodeMain( in Dictionary input, - in Dictionary output ) + in Dictionary output) { - if( currentCount < cycleCount ) + if (currentCount < cycleCount) { - Interlocked.Increment( ref currentCount ); + Interlocked.Increment(ref currentCount); } else { - Interlocked.Exchange( ref currentCount, 0 ); - Task.Run( MainExecution ); + Interlocked.Exchange(ref currentCount, 0); + Task.Run(MainExecution); } - //Console.WriteLine(currentCount); - PipelineNodeOutPort.SkipAll( output ); + // Console.WriteLine(currentCount); + PipelineNodeOutPort.SkipAll(output); } } diff --git a/StgSharp.Common/PipeLine/IConvertableToPipelineNode.cs b/StgSharp.Common/PipeLine/IConvertableToPipelineNode.cs index cf8447ac..c220b7c5 100644 --- a/StgSharp.Common/PipeLine/IConvertableToPipelineNode.cs +++ b/StgSharp.Common/PipeLine/IConvertableToPipelineNode.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="IConvertableToPipelineNode.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="IConvertableToPipelineNode" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Runtime.CompilerServices; @@ -37,7 +34,7 @@ namespace StgSharp.PipeLine { public delegate void PipelineNodeOperation( in Dictionary input, - in Dictionary output ); + in Dictionary output); public interface IConvertableToPipelineNode { @@ -50,7 +47,7 @@ namespace StgSharp.PipeLine void NodeMain( in Dictionary input, - in Dictionary output ); + in Dictionary output); } @@ -61,10 +58,7 @@ namespace StgSharp.PipeLine private string[] _output; private PipelineNodeOperation _execution; - public DefaultConvertableToBlueprintNode( - PipelineNodeOperation execution, - string[] input, - string[] output ) + public DefaultConvertableToBlueprintNode(PipelineNodeOperation execution, string[] input, string[] output) { _input = input; _output = output; @@ -79,9 +73,9 @@ namespace StgSharp.PipeLine public void NodeMain( in Dictionary input, - in Dictionary output ) + in Dictionary output) { - _execution.Invoke( input, output ); + _execution.Invoke(input, output); } } diff --git a/StgSharp.Common/PipeLine/PipeLineRunner.cs b/StgSharp.Common/PipeLine/PipeLineRunner.cs index f75ae0fa..5dfb7ae1 100644 --- a/StgSharp.Common/PipeLine/PipeLineRunner.cs +++ b/StgSharp.Common/PipeLine/PipeLineRunner.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="PipeLineRunner.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="PipeLineRunner" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Threading; using System; @@ -51,83 +48,82 @@ namespace StgSharp.PipeLine private static ConcurrentStack pipelineInWaiting = new ConcurrentStack(); private static int _callingThread; - private static SemaphoreSlim pipelineLock = new SemaphoreSlim( 0, 1 ); + private static SemaphoreSlim pipelineLock = new SemaphoreSlim(0, 1); - public static void Run( PipelineScheduler pipeline ) + public static void Run(PipelineScheduler pipeline) { - //Console.WriteLine(); - if( pipeline == null ) + // Console.WriteLine(); + if (pipeline == null) { return; } - if( pipeline.IsRunning ) { - throw new InvalidOperationException( "Attempt to run a blueprint instance twice." ); + if (pipeline.IsRunning) { + throw new InvalidOperationException("Attempt to run a blueprint instance twice."); } - if( !IsValidCalling() ) { + if (!IsValidCalling()) { pipelineLock.Wait(); } - if( InterruptAndRunNewPipeline( pipeline ) ) + if (InterruptAndRunNewPipeline(pipeline)) { - while( InterruptAndRunNewPipeline( NodeRunner.CurrentPipeline! ) ) { } + while (InterruptAndRunNewPipeline(NodeRunner.CurrentPipeline!)) { } } pipelineLock.Release(); - Interlocked.Exchange( ref _callingThread, -1 ); + Interlocked.Exchange(ref _callingThread, -1); } - public static void SetMaxTaskCount( int size ) + public static void SetMaxTaskCount(int size) { - if( size < 1 ) { + if (size < 1) { size = 1; } - if( allAvailableTask.Length >= size ) + if (allAvailableTask.Length >= size) { - for( int i = size; i < allAvailableTask.Length; i++ ) + for (int i = size; i < allAvailableTask.Length; i++) { - if( allAvailableTask[ i ] != null ) { - allAvailableTask[ i ].Cancel(); + if (allAvailableTask[i] != null) { + allAvailableTask[i].Cancel(); } } } - Array.Resize( ref allAvailableTask, size ); + Array.Resize(ref allAvailableTask, size); } public static void Terminate() { cts.Cancel(); - if( NodeRunner.CurrentPipeline is null ) { + if (NodeRunner.CurrentPipeline is null) { return; } NodeRunner.CurrentPipeline.Terminate(); - foreach( NodeRunner task in allAvailableTask ) { + foreach (NodeRunner task in allAvailableTask) { task.Cts.Cancel(); } - foreach( PipelineScheduler bp in pipelineInWaiting ) { + foreach (PipelineScheduler bp in pipelineInWaiting) { bp.Terminate(); } pipelineInWaiting.Clear(); } - internal static bool InterruptAndRunNewPipeline( PipelineScheduler newPipeline ) + internal static bool InterruptAndRunNewPipeline(PipelineScheduler newPipeline) { - ArgumentNullException.ThrowIfNull( newPipeline ); - if( ( newPipeline != NodeRunner.CurrentPipeline ) && - ( NodeRunner.CurrentPipeline != null ) ) + ArgumentNullException.ThrowIfNull(newPipeline); + if ((newPipeline != NodeRunner.CurrentPipeline) && (NodeRunner.CurrentPipeline != null)) { - //if a running bp exists - pipelineInWaiting.Push( NodeRunner.CurrentPipeline ); + // if a running bp exists + pipelineInWaiting.Push(NodeRunner.CurrentPipeline); } - //load new bp to current bp + // load new bp to current bp NodeRunner.CurrentPipeline = newPipeline; - Interlocked.Exchange( ref _callingThread, Environment.CurrentManagedThreadId ); + Interlocked.Exchange(ref _callingThread, Environment.CurrentManagedThreadId); - //run beginning node to init it first. - if( !NodeRunner.CurrentPipeline.IsRunning ) + // run beginning node to init it first. + if (!NodeRunner.CurrentPipeline.IsRunning) { - ( NodeRunner.CurrentPipeline.BeginLayer as BeginningNode )!.Run(); + (NodeRunner.CurrentPipeline.BeginLayer as BeginningNode)!.Run(); } - //refresh all tasks + // refresh all tasks /* for( int i = 0; i < allAvailableTask.Length; i++ ) { @@ -138,58 +134,57 @@ namespace StgSharp.PipeLine } /**/ PipelineNode node; - while( !cts.Token.IsCancellationRequested && - NodeRunner.CurrentPipeline.RequestNextMainThreadNode( out node ) ) + while (!cts.Token.IsCancellationRequested && NodeRunner.CurrentPipeline.RequestNextMainThreadNode(out node)) { node.Run(); - if( !NodeRunner.CurrentPipeline.IsRunning ) + if (!NodeRunner.CurrentPipeline.IsRunning) { break; } } - while( ( NodeRunner.CurrentPipeline != null ) && + while ((NodeRunner.CurrentPipeline != null) && NodeRunner.CurrentPipeline.IsRunning && !cts.Token.IsCancellationRequested && - NodeRunner.CurrentPipeline!.RequestNexConcurrentNode( out node ) ) + NodeRunner.CurrentPipeline!.RequestNexConcurrentNode(out node)) { node.Run(); - if( !NodeRunner.CurrentPipeline!.IsRunning ) + if (!NodeRunner.CurrentPipeline!.IsRunning) { break; } } - ( NodeRunner.CurrentPipeline!.EndLayer as EndingNode )!.Run(); - bool isEmpty = pipelineInWaiting.TryPop( out PipelineScheduler? pipeline ); + (NodeRunner.CurrentPipeline!.EndLayer as EndingNode)!.Run(); + bool isEmpty = pipelineInWaiting.TryPop(out PipelineScheduler? pipeline); NodeRunner.CurrentPipeline = pipeline!; return isEmpty; } /// - /// Only the following occasions of calling are valid: 1. no bp is - /// running or the only bp is quitting.2. calling from the main thread or a - /// thread the current bp is running on. + /// Only the following occasions of calling are valid: 1. no bp is + /// running or the only bp is quitting. 2. calling from the main thread or a + /// thread the current bp is running on. /// internal static bool IsValidCalling() { - if( ( NodeRunner.CurrentPipeline == null ) || //no bp running at all - ( ( pipelineInWaiting.IsEmpty ) && ( NodeRunner.CurrentPipeline.IsRunning == false ) ) ) + if ((NodeRunner.CurrentPipeline == null) || //no bp running at all + ((pipelineInWaiting.IsEmpty) && (NodeRunner.CurrentPipeline.IsRunning == false))) { // a bp is quitting - //in case no bp is running + // in case no bp is running return true; } int? id = Task.CurrentId; - if( id is null ) + if (id is null) { // in case calling from main thread and current running bp return _callingThread == Environment.CurrentManagedThreadId; } - foreach( NodeRunner item in allAvailableTask ) + foreach (NodeRunner item in allAvailableTask) { - if( item.Id == id ) + if (item.Id == id) { - //if calling from any bp running task + // if calling from any bp running task return true; } } @@ -227,18 +222,18 @@ namespace StgSharp.PipeLine { _startup = InternalRun }; - ret._internalTask = Task.Run( ret.InternalAction ); + ret._internalTask = Task.Run(ret.InternalAction); return ret; } - private static void InternalRun( CancellationToken token ) + private static void InternalRun(CancellationToken token) { PipelineNode item; - Console.WriteLine( $"Global thread {Environment.CurrentManagedThreadId} starts." ); - while( ( CurrentPipeline != null ) && + Console.WriteLine($"Global thread {Environment.CurrentManagedThreadId} starts."); + while ((CurrentPipeline != null) && CurrentPipeline.IsRunning && !token.IsCancellationRequested && - CurrentPipeline.RequestNexConcurrentNode( out item ) ) { + CurrentPipeline.RequestNexConcurrentNode(out item)) { item.Run(); } } diff --git a/StgSharp.Common/PipeLine/PipelineMarshal.cs b/StgSharp.Common/PipeLine/PipelineMarshal.cs index 1941b1dc..a47cff83 100644 --- a/StgSharp.Common/PipeLine/PipelineMarshal.cs +++ b/StgSharp.Common/PipeLine/PipelineMarshal.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="PipelineMarshal.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="PipelineMarshal" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections; using System.Collections.Generic; @@ -41,11 +38,10 @@ namespace StgSharp.PipeLine public static class PipelineMarshal { - public static IEnumerable GetNodeSortedEnumeration( - PipelineScheduler scheduler ) + public static IEnumerable GetNodeSortedEnumeration(PipelineScheduler scheduler) { - ArgumentNullException.ThrowIfNull( scheduler ); - return new PipelineNodeEnumerator( scheduler ) + ArgumentNullException.ThrowIfNull(scheduler); + return new PipelineNodeEnumerator(scheduler) { _count = scheduler._allNode.Count, }; @@ -58,10 +54,10 @@ namespace StgSharp.PipeLine public int _count; - public PipelineNodeEnumerator( PipelineScheduler scheduler ) + public PipelineNodeEnumerator(PipelineScheduler scheduler) { - if( !scheduler.TryGetAllNode( out _mt, out _c ) ) { - throw new InvalidOperationException( "Binded scheduler is not sorted." ); + if (!scheduler.TryGetAllNode(out _mt, out _c)) { + throw new InvalidOperationException("Binded scheduler is not sorted."); } } @@ -71,18 +67,18 @@ namespace StgSharp.PipeLine public IEnumerator GetEnumerator() { - for( int i = 1; i < _mt.Count; i++ ) + for (int i = 1; i < _mt.Count; i++) { - foreach( PipelineNode node in _mt[ i ] ) { + foreach (PipelineNode node in _mt[i]) { yield return node; } - foreach( PipelineNode node in _c[ i ] ) { + foreach (PipelineNode node in _c[i]) { yield return node; } } } - void ICollection.Add( PipelineNode item ) + void ICollection.Add(PipelineNode item) { throw new NotSupportedException(); } @@ -92,17 +88,17 @@ namespace StgSharp.PipeLine throw new NotSupportedException(); } - bool ICollection.Contains( PipelineNode item ) + bool ICollection.Contains(PipelineNode item) { throw new NotSupportedException(); } - void ICollection.CopyTo( PipelineNode[] array, int arrayIndex ) + void ICollection.CopyTo(PipelineNode[] array, int arrayIndex) { throw new NotSupportedException(); } - bool ICollection.Remove( PipelineNode item ) + bool ICollection.Remove(PipelineNode item) { throw new NotSupportedException(); } diff --git a/StgSharp.Common/PipeLine/PipelineNode.cs b/StgSharp.Common/PipeLine/PipelineNode.cs index 2775a9fa..341e5dc4 100644 --- a/StgSharp.Common/PipeLine/PipelineNode.cs +++ b/StgSharp.Common/PipeLine/PipelineNode.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="PipelineNode.cs" +// file="PipelineNode" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/PipeLine/PipelineNodeLabel.cs b/StgSharp.Common/PipeLine/PipelineNodeLabel.cs index 8663b671..4e64a4dc 100644 --- a/StgSharp.Common/PipeLine/PipelineNodeLabel.cs +++ b/StgSharp.Common/PipeLine/PipelineNodeLabel.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="PipelineNodeLabel.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="PipelineNodeLabel" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -40,6 +37,7 @@ namespace StgSharp.PipeLine { public abstract record class PipelineNodeLabel { + public static PipelineNodeLabel Empty => PipelineNodeLabelEmpty.Only; public abstract int ComputeHashCode(); @@ -48,11 +46,13 @@ namespace StgSharp.PipeLine { return ComputeHashCode(); } + } public record class PipelineNodeStringLabel : PipelineNodeLabel { - public PipelineNodeStringLabel( string name ) + + public PipelineNodeStringLabel(string name) { Name = name; } @@ -61,17 +61,20 @@ namespace StgSharp.PipeLine public override int ComputeHashCode() { - return string.GetHashCode( Name ); + return string.GetHashCode(Name); } + } internal record class PipelineNodeLabelEmpty : PipelineNodeLabel { + public static PipelineNodeLabelEmpty Only { get; } = new PipelineNodeLabelEmpty(); public override int ComputeHashCode() { return 0; } + } } diff --git a/StgSharp.Common/PipeLine/PipelineNodePort.cs b/StgSharp.Common/PipeLine/PipelineNodePort.cs index 0c3bb7f8..f130c012 100644 --- a/StgSharp.Common/PipeLine/PipelineNodePort.cs +++ b/StgSharp.Common/PipeLine/PipelineNodePort.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="PipelineNodePort.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="PipelineNodePort" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; @@ -43,7 +40,7 @@ namespace StgSharp.PipeLine private HashSet _linkerSet = new HashSet(); - public PipelineNodeInPort( PipelineNode container, string label ) + public PipelineNodeInPort(PipelineNode container, string label) { Container = container; Label = label; @@ -59,45 +56,45 @@ namespace StgSharp.PipeLine internal HashSet Linkers => _linkerSet; - public void Connect( PipelineNodeOutPort port ) + public void Connect(PipelineNodeOutPort port) { - ArgumentNullException.ThrowIfNull( port ); - if( _linkerSet.Add( port ) ) + ArgumentNullException.ThrowIfNull(port); + if (_linkerSet.Add(port)) { - port.Linkers.Add( this ); - Container.Previous.Add( port.Container ); - port.Container.Next.Add( Container ); + port.Linkers.Add(this); + Container.Previous.Add(port.Container); + port.Container.Next.Add(Container); } } public IEnumerator GetFormerNodes() { - foreach( PipelineNodeOutPort port in _linkerSet ) { + foreach (PipelineNodeOutPort port in _linkerSet) { yield return port.Container; } } public void Wait() { - PipelineNodeOutPort.WaitAll( _linkerSet ); + PipelineNodeOutPort.WaitAll(_linkerSet); } - public static void WaitAll( IDictionary ports ) + public static void WaitAll(IDictionary ports) { - if( ports is null ) { + if (ports is null) { return; } - foreach( PipelineNodeInPort port in ports.Values ) { + foreach (PipelineNodeInPort port in ports.Values) { port.Wait(); } } - public static void WaitAll( IEnumerable ports ) + public static void WaitAll(IEnumerable ports) { - if( ports is null ) { + if (ports is null) { return; } - foreach( PipelineNodeInPort port in ports ) { + foreach (PipelineNodeInPort port in ports) { port.Wait(); } } @@ -111,11 +108,11 @@ namespace StgSharp.PipeLine private volatile int _passCount; private SemaphoreSlim formerCompleteSemaphore; - public PipelineNodeOutPort( PipelineNode container, string label ) + public PipelineNodeOutPort(PipelineNode container, string label) { Container = container; Label = label; - formerCompleteSemaphore = new SemaphoreSlim( initialCount: 0, maxCount: 1 ); + formerCompleteSemaphore = new SemaphoreSlim(initialCount:0, maxCount:1); } public PipelineNode Container { get; init; } @@ -126,20 +123,20 @@ namespace StgSharp.PipeLine private SemaphoreSlim Waiter => formerCompleteSemaphore; - public void Connect( PipelineNodeInPort port ) + public void Connect(PipelineNodeInPort port) { - ArgumentNullException.ThrowIfNull( port ); - if( _linkerSet.Add( port ) ) + ArgumentNullException.ThrowIfNull(port); + if (_linkerSet.Add(port)) { - port.Linkers.Add( this ); - Container.Next.Add( port.Container ); - port.Container.Previous.Add( Container ); + port.Linkers.Add(this); + Container.Next.Add(port.Container); + port.Container.Previous.Add(Container); } } public void Release() { - if( _passCount == 0 ) + if (_passCount == 0) { Waiter.Release(); } else @@ -148,27 +145,27 @@ namespace StgSharp.PipeLine } } - public static void SkipAll( Dictionary ports ) + public static void SkipAll(Dictionary ports) { - if( ports is null ) { + if (ports is null) { return; } - foreach( PipelineNodeOutPort port in ports.Values ) { + foreach (PipelineNodeOutPort port in ports.Values) { port.Release(); } } - public void TransmitValue( IPipeLineConnectionPayload value ) + public void TransmitValue(IPipeLineConnectionPayload value) { - foreach( PipelineNodeInPort item in _linkerSet ) { } + foreach (PipelineNodeInPort item in _linkerSet) { } } - public static void WaitAll( IEnumerable ports ) + public static void WaitAll(IEnumerable ports) { - if( ports is null ) { + if (ports is null) { return; } - foreach( PipelineNodeOutPort port in ports ) { + foreach (PipelineNodeOutPort port in ports) { port.Wait(); } } @@ -176,12 +173,12 @@ namespace StgSharp.PipeLine internal void Wait() { Waiter.Wait(); - if( _passCount >= _linkerSet.Count ) + if (_passCount >= _linkerSet.Count) { - Interlocked.Exchange( ref _passCount, 0 ); + Interlocked.Exchange(ref _passCount, 0); } else { - Interlocked.Increment( ref _passCount ); + Interlocked.Increment(ref _passCount); Waiter.Release(); } } diff --git a/StgSharp.Common/PipeLine/PipelineScheduler.cs b/StgSharp.Common/PipeLine/PipelineScheduler.cs index 5ae5485c..c463ba72 100644 --- a/StgSharp.Common/PipeLine/PipelineScheduler.cs +++ b/StgSharp.Common/PipeLine/PipelineScheduler.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="PipelineScheduler.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="PipelineScheduler" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Stg; using System; @@ -54,21 +51,21 @@ namespace StgSharp.PipeLine private int mtLevel, cLevel,mtIndex, cIndex; private List> _concurrentNodes, _mainThreadNodes ; - private SemaphoreSlim runningStat,_concurrentLock = new SemaphoreSlim( 1, 1 ); + private SemaphoreSlim runningStat,_concurrentLock = new SemaphoreSlim(1, 1); internal Dictionary _allNode; public PipelineScheduler() { _allNode = new Dictionary(); - runningStat = new SemaphoreSlim( 1, 1 ); - _beginning = new BeginningNode( this ); - _ending = new EndingNode( this ); + runningStat = new SemaphoreSlim(1, 1); + _beginning = new BeginningNode(this); + _ending = new EndingNode(this); } /**/ - public PipelineNode this[ PipelineNodeLabel label ] + public PipelineNode this[PipelineNodeLabel label] { - get { return _allNode[ label ]; } + get { return _allNode[label]; } } public bool IsRunning @@ -92,7 +89,7 @@ namespace StgSharp.PipeLine public PipelineNodeOperation Operation { - get => ( this as IConvertableToPipelineNode ).NodeMain; + get => (this as IConvertableToPipelineNode).NodeMain; } /**/ @@ -102,85 +99,83 @@ namespace StgSharp.PipeLine get => runningStat; } - public void AddNode( PipelineNode node, bool isNative ) + public void AddNode(PipelineNode node, bool isNative) { - ArgumentNullException.ThrowIfNull( node ); + ArgumentNullException.ThrowIfNull(node); node.IsNative = isNative; - _allNode.TryAdd( node.Label, node ); + _allNode.TryAdd(node.Label, node); } public void ArrangeNodes() { - if( _isAvailable ) { + if (_isAvailable) { return; } int maxLevel = 1; Queue completedNodes = new Queue(); - foreach( PipelineNode item in _beginning.Next ) + foreach (PipelineNode item in _beginning.Next) { - item.TryIncreaseLevelTo( 1 ); - completedNodes.Enqueue( item ); + item.TryIncreaseLevelTo(1); + completedNodes.Enqueue(item); } - //calc level of nodes O(V) - while( completedNodes.Count > 0 ) + // calc level of nodes O(V) + while (completedNodes.Count > 0) { PipelineNode u = completedNodes.Dequeue(); - foreach( PipelineNode v in u.Next ) + foreach (PipelineNode v in u.Next) { - if( !v.TryIncreaseLevelTo( u.Level + 1 ) ) { - throw new InvalidOperationException( "Ring in DAG detected." ); + if (!v.TryIncreaseLevelTo(u.Level + 1)) { + throw new InvalidOperationException("Ring in DAG detected."); } - if( v.RemainingIncreaseCount == 0 ) + if (v.RemainingIncreaseCount == 0) { - completedNodes.Enqueue( v ); - maxLevel = int.Max( maxLevel, v.Level ); + completedNodes.Enqueue(v); + maxLevel = int.Max(maxLevel, v.Level); } } } - //bucket sort of nodes, O(E) - _concurrentNodes = new List>( maxLevel + 1 ); - _mainThreadNodes = new List>( maxLevel + 1 ); - for( int i = 0; i <= maxLevel; i++ ) + // bucket sort of nodes, O(E) + _concurrentNodes = new List>(maxLevel + 1); + _mainThreadNodes = new List>(maxLevel + 1); + for (int i = 0; i <= maxLevel; i++) { - _concurrentNodes.Add( [] ); - _mainThreadNodes.Add( [] ); + _concurrentNodes.Add([]); + _mainThreadNodes.Add([]); } - foreach( PipelineNode item in _allNode.Values ) + foreach (PipelineNode item in _allNode.Values) { - if( item.IsNative ) + if (item.IsNative) { - _mainThreadNodes[ item.Level ].Add( item ); + _mainThreadNodes[item.Level].Add(item); } else { - _concurrentNodes[ item.Level ].Add( item ); + _concurrentNodes[item.Level].Add(item); } } - foreach( List item in _concurrentNodes ) { + foreach (List item in _concurrentNodes) { item.TrimExcess(); } - foreach( List item in _mainThreadNodes ) { + foreach (List item in _mainThreadNodes) { item.TrimExcess(); } _isAvailable = true; } - public PipelineNode Create( - PipelineNodeLabel label, - [NotNull] IConvertableToPipelineNode body ) + public PipelineNode Create(PipelineNodeLabel label, [NotNull] IConvertableToPipelineNode body) { - if( _allNode.TryGetValue( label, out PipelineNode? node ) ) { - throw new InvalidOperationException( "Label has exist in scheduler." ); + if (_allNode.TryGetValue(label, out PipelineNode? node)) { + throw new InvalidOperationException("Label has exist in scheduler."); } - node = new PipelineNode( label, body, false ); - _allNode.Add( label, node ); + node = new PipelineNode(label, body, false); + _allNode.Add(label, node); return node; } - public PipelineNode GetNode( PipelineNodeLabel label ) + public PipelineNode GetNode(PipelineNodeLabel label) { - if( _allNode.TryGetValue( label, out PipelineNode? node ) ) + if (_allNode.TryGetValue(label, out PipelineNode? node)) { return node; } else @@ -189,24 +184,24 @@ namespace StgSharp.PipeLine } } - public void LinkToInput( PipelineNodeInPort port ) + public void LinkToInput(PipelineNodeInPort port) { - ArgumentNullException.ThrowIfNull( port ); + ArgumentNullException.ThrowIfNull(port); PipelineNodeOutPort p = _beginning.DefaultOut; - p.Connect( port ); + p.Connect(port); } - public void LinkToInput( PipelineNodeInPort port, string inputPortName ) + public void LinkToInput(PipelineNodeInPort port, string inputPortName) { - ArgumentNullException.ThrowIfNull( port ); - PipelineNodeOutPort p = _beginning.DefineCertainOutputPort( inputPortName ); - p.Connect( port ); + ArgumentNullException.ThrowIfNull(port); + PipelineNodeOutPort p = _beginning.DefineCertainOutputPort(inputPortName); + p.Connect(port); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public void SetInput( params (string label, IPipeLineConnectionPayload arg)[] parameters ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void SetInput(params (string label, IPipeLineConnectionPayload arg)[] parameters) { - _beginning.SetInputData( parameters ); + _beginning.SetInputData(parameters); } public void Terminate() @@ -218,9 +213,9 @@ namespace StgSharp.PipeLine public bool TryGetAllNode( out List> mainThreadNodes, - out List> concurrentNodes ) + out List> concurrentNodes) { - if( _isAvailable ) + if (_isAvailable) { mainThreadNodes = _mainThreadNodes; concurrentNodes = _concurrentNodes; @@ -231,20 +226,20 @@ namespace StgSharp.PipeLine return false; } - internal bool RequestNexConcurrentNode( out PipelineNode node ) + internal bool RequestNexConcurrentNode(out PipelineNode node) { int index, level; - if( cLevel >= _concurrentNodes.Count ) + if (cLevel >= _concurrentNodes.Count) { node = null!; return false; } _concurrentLock.Wait(); - while( cIndex >= _concurrentNodes[ cLevel ].Count ) + while (cIndex >= _concurrentNodes[cLevel].Count) { - Interlocked.Increment( ref cLevel ); - Interlocked.Exchange( ref cIndex, 0 ); - if( cLevel >= _concurrentNodes.Count ) + Interlocked.Increment(ref cLevel); + Interlocked.Exchange(ref cIndex, 0); + if (cLevel >= _concurrentNodes.Count) { node = null!; return false; @@ -252,30 +247,30 @@ namespace StgSharp.PipeLine } index = cIndex; level = cLevel; - Interlocked.Increment( ref cIndex ); + Interlocked.Increment(ref cIndex); _concurrentLock.Release(); - node = _concurrentNodes[ level ][ index ]; + node = _concurrentNodes[level][index]; return true; } - internal bool RequestNextMainThreadNode( out PipelineNode node ) + internal bool RequestNextMainThreadNode(out PipelineNode node) { - if( mtLevel >= _mainThreadNodes.Count ) + if (mtLevel >= _mainThreadNodes.Count) { node = null!; return false; } - while( mtIndex >= _mainThreadNodes[ cLevel ].Count ) + while (mtIndex >= _mainThreadNodes[cLevel].Count) { - Interlocked.Increment( ref mtLevel ); - Interlocked.Exchange( ref mtIndex, 0 ); - if( mtLevel >= _mainThreadNodes.Count ) + Interlocked.Increment(ref mtLevel); + Interlocked.Exchange(ref mtIndex, 0); + if (mtLevel >= _mainThreadNodes.Count) { node = null!; return false; } } - node = _mainThreadNodes[ mtLevel ][ mtIndex ]; + node = _mainThreadNodes[mtLevel][mtIndex]; return true; } @@ -287,10 +282,10 @@ namespace StgSharp.PipeLine void IConvertableToPipelineNode.NodeMain( in Dictionary input, - in Dictionary output ) + in Dictionary output) { - PipeLineRunner.Run( this ); - PipelineNodeOutPort.SkipAll( output ); + PipeLineRunner.Run(this); + PipelineNodeOutPort.SkipAll(output); } ~PipelineScheduler() diff --git a/StgSharp.Common/PipeLine/PortArgs.cs b/StgSharp.Common/PipeLine/PortArgs.cs index 213ca1c7..0a799c7f 100644 --- a/StgSharp.Common/PipeLine/PortArgs.cs +++ b/StgSharp.Common/PipeLine/PortArgs.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="PortArgs.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="PortArgs" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; @@ -48,11 +45,11 @@ namespace StgSharp.PipeLine private protected PipelineNodeOutPort input; private protected SemaphoreSlim formerCompleteSemaphore; - public PipelineConnector( PipelineNodeOutPort former, PipelineNodeInPort after ) + public PipelineConnector(PipelineNodeOutPort former, PipelineNodeInPort after) { this.input = former; this.output = after; - formerCompleteSemaphore = new SemaphoreSlim( initialCount: 0, maxCount: 1 ); + formerCompleteSemaphore = new SemaphoreSlim(initialCount:0, maxCount:1); } public IPipeLineConnectionPayload Args @@ -65,36 +62,36 @@ namespace StgSharp.PipeLine public PipelineNodeOutPort Input => input; - public static void SkipAll( Dictionary ports ) + public static void SkipAll(Dictionary ports) { - if( ports == null ) { + if (ports == null) { return; } - foreach( KeyValuePair item in ports ) + foreach (KeyValuePair item in ports) { - if( item.Value != null ) { + if (item.Value != null) { item.Value.CompleteAndSkip(); } } } - public static void WaitAll( Dictionary ports ) + public static void WaitAll(Dictionary ports) { - if( ports == null ) { + if (ports == null) { return; } - foreach( KeyValuePair item in ports ) + foreach (KeyValuePair item in ports) { - if( item.Value != null ) { + if (item.Value != null) { item.Value.WaitForStart(); } } } - [MethodImpl( MethodImplOptions.AggressiveInlining )] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public virtual void WaitForStart() { - //Console.WriteLine($"Waiting \t{input.ContextName}\t->\t{output.ContextName}"); + // Console.WriteLine($"Waiting \t{input.ContextName}\t->\t{output.ContextName}"); formerCompleteSemaphore.Wait(); } @@ -105,15 +102,15 @@ namespace StgSharp.PipeLine #region pipline op - [MethodImpl( MethodImplOptions.AggressiveInlining )] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public void CompleteAndSkip() { - //Console.WriteLine($"Complete\t{input.Name}\t->\t{output.Name}"); + // Console.WriteLine($"Complete\t{input.Name}\t->\t{output.Name}"); formerCompleteSemaphore.Release(); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] - public void CompleteAndWriteData( IPipeLineConnectionPayload args ) + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void CompleteAndWriteData(IPipeLineConnectionPayload args) { this.args = args; CompleteAndSkip(); diff --git a/StgSharp.Common/PipeLine/SideNode.cs b/StgSharp.Common/PipeLine/SideNode.cs index 7f349f81..bac1eec2 100644 --- a/StgSharp.Common/PipeLine/SideNode.cs +++ b/StgSharp.Common/PipeLine/SideNode.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="SideNode.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="SideNode" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Globalization; @@ -46,29 +43,28 @@ namespace StgSharp.PipeLine private PipelineScheduler _bp; - public BeginningNode( PipelineScheduler bp ) + public BeginningNode(PipelineScheduler bp) : base( - DefaultOperation, new PipelineNodeStringLabel( "BeginningNode" ), true, ["default"], - [OutName] ) + DefaultOperation, new PipelineNodeStringLabel("BeginningNode"), true, [ "default" ],[ OutName ]) { _bp = bp; } - public PipelineNodeOutPort DefaultOut => OutputPorts[ OutName ]; + public PipelineNodeOutPort DefaultOut => OutputPorts[OutName]; public override void Run() { _bp.RunningStat.Wait(); - PipelineNodeOutPort.SkipAll( _output ); + PipelineNodeOutPort.SkipAll(_output); } - internal void SetInputData( IEnumerable<(string, IPipeLineConnectionPayload)> data ) + internal void SetInputData(IEnumerable<(string, IPipeLineConnectionPayload)> data) { - if( data is null ) { + if (data is null) { return; } - foreach( (string, IPipeLineConnectionPayload) item in data ) { - OutputPorts[ item.Item1 ].TransmitValue( item.Item2 ); + foreach ((string, IPipeLineConnectionPayload) item in data) { + OutputPorts[item.Item1].TransmitValue(item.Item2); } } @@ -79,17 +75,16 @@ namespace StgSharp.PipeLine private PipelineScheduler _bp; - public EndingNode( PipelineScheduler bp ) + public EndingNode(PipelineScheduler bp) : base( - DefaultOperation, name: new PipelineNodeStringLabel( "EndingNode" ), true, ["default"], - ["default"] ) + DefaultOperation, name:new PipelineNodeStringLabel("EndingNode"), true, [ "default" ],[ "default" ]) { _bp = bp; } public override void Run() { - PipelineNodeInPort.WaitAll( _input ); + PipelineNodeInPort.WaitAll(_input); _bp.ResetIndex(); _bp.RunningStat.Release(); } diff --git a/StgSharp.Common/PlainGeometryCollisionSensor.cs b/StgSharp.Common/PlainGeometryCollisionSensor.cs index 9392bb24..442c53f3 100644 --- a/StgSharp.Common/PlainGeometryCollisionSensor.cs +++ b/StgSharp.Common/PlainGeometryCollisionSensor.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="PlainGeometryCollisionSensor.cs" +// file="PlainGeometryCollisionSensor" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/StateMachine.cs b/StgSharp.Common/StateMachine.cs index ba33ba53..c3ac794e 100644 --- a/StgSharp.Common/StateMachine.cs +++ b/StgSharp.Common/StateMachine.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="StateMachine.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="StateMachine" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; @@ -49,8 +46,7 @@ namespace StgSharp } - public interface IStateMachineWithSwitchSpan : IStateMachine - where TState: Enum + public interface IStateMachineWithSwitchSpan : IStateMachine where TState: Enum { public bool IsInStabelState { get; } diff --git a/StgSharp.Common/Stg/Bullet.cs b/StgSharp.Common/Stg/Bullet.cs index 72985869..6e437bc3 100644 --- a/StgSharp.Common/Stg/Bullet.cs +++ b/StgSharp.Common/Stg/Bullet.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="Bullet" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Stg/CollisionTexture.cs b/StgSharp.Common/Stg/CollisionTexture.cs index 440af6d5..11f3c4a2 100644 --- a/StgSharp.Common/Stg/CollisionTexture.cs +++ b/StgSharp.Common/Stg/CollisionTexture.cs @@ -2,8 +2,8 @@ // ----------------------------------------------------------------------- // file="CollisionTexture" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/StgSharp.Common/Stg/TimeLine.cs b/StgSharp.Common/Stg/TimeLine.cs index 1d05b480..5eb9592f 100644 --- a/StgSharp.Common/Stg/TimeLine.cs +++ b/StgSharp.Common/Stg/TimeLine.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="TimeLine.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="TimeLine" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; diff --git a/StgSharp.Common/Stg/Touhou/TouhouBuilder.cs b/StgSharp.Common/Stg/Touhou/TouhouBuilder.cs index e720313a..b92c742b 100644 --- a/StgSharp.Common/Stg/Touhou/TouhouBuilder.cs +++ b/StgSharp.Common/Stg/Touhou/TouhouBuilder.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="TouhouBuilder.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="TouhouBuilder" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics; using StgSharp.Touhou; diff --git a/StgSharp.Common/Stg/Touhou/TouhouWindow.cs b/StgSharp.Common/Stg/Touhou/TouhouWindow.cs index 0613d45c..82b2a9f6 100644 --- a/StgSharp.Common/Stg/Touhou/TouhouWindow.cs +++ b/StgSharp.Common/Stg/Touhou/TouhouWindow.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="TouhouWindow.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="TouhouWindow" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.Graphics; using StgSharp.MVVM; using StgSharp.MVVM.ViewModel; @@ -41,7 +38,7 @@ namespace StgSharp.Touhou public abstract class TouhouWindowMain : ViewModelBase { - protected TouhouWindowMain( ViewPort vp ) : base( vp, 60 ) { } + protected TouhouWindowMain(ViewPort vp) : base(vp, 60) { } } } diff --git a/StgSharp.Common/Stg/Touhou/View/OpenningView.cs b/StgSharp.Common/Stg/Touhou/View/OpenningView.cs index 64995b76..42ceba70 100644 --- a/StgSharp.Common/Stg/Touhou/View/OpenningView.cs +++ b/StgSharp.Common/Stg/Touhou/View/OpenningView.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="OpenningView.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="OpenningView" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using StgSharp.MVVM; using StgSharp.MVVM.ViewModel; @@ -42,7 +39,7 @@ namespace StgSharp.Stg.Touhou public abstract class OpenningView : ViewBase { - public override void CustomizedInitialize( ViewModelBase viewModelBinding ) + public override void CustomizedInitialize(ViewModelBase viewModelBinding) { throw new NotImplementedException(); } diff --git a/StgSharp.Common/Threading/AdaptiveBackoffStrategy.cs b/StgSharp.Common/Threading/AdaptiveBackoffStrategy.cs index 88a1e73b..7ae08707 100644 --- a/StgSharp.Common/Threading/AdaptiveBackoffStrategy.cs +++ b/StgSharp.Common/Threading/AdaptiveBackoffStrategy.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="AdaptiveBackoffStrategy.cs" +// file="AdaptiveBackoffStrategy" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -119,8 +116,7 @@ public struct AdaptiveBackoffStrategy /// /// Gets global statistics for the specified strategy (for monitoring) /// - public static (long attempts, long successes, double successRate) GetGlobalStats( - BackoffMethod method) + public static (long attempts, long successes, double successRate) GetGlobalStats(BackoffMethod method) { PerformanceStats stats = s_globalStats[(int)method]; return (stats.Attempts, stats.Successes, stats.SuccessRate); @@ -344,7 +340,7 @@ public struct AdaptiveBackoffStrategy public readonly double SuccessRate { -[MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get => Attempts == 0 ? 0.0 : (double)Successes / Attempts; } diff --git a/StgSharp.Common/Threading/BufferExpansionLock.cs b/StgSharp.Common/Threading/BufferExpansionLock.cs index 9998d8cd..6ecbc3f9 100644 --- a/StgSharp.Common/Threading/BufferExpansionLock.cs +++ b/StgSharp.Common/Threading/BufferExpansionLock.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="BufferExpansionLock.cs" +// file="BufferExpansionLock" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -58,7 +55,7 @@ namespace StgSharp.Threading public bool IsThreadReadingMetaData { -[MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _expansionLock.IsReadLockHeld; } diff --git a/StgSharp.Common/Threading/CancellableTask.cs b/StgSharp.Common/Threading/CancellableTask.cs index 2dac6c94..18a133f5 100644 --- a/StgSharp.Common/Threading/CancellableTask.cs +++ b/StgSharp.Common/Threading/CancellableTask.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="CancellableTask.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="CancellableTask" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Linq; @@ -51,9 +48,9 @@ namespace StgSharp.Threading cts = new CancellationTokenSource(); } - private protected CancellableTask( Action action ) + private protected CancellableTask(Action action) { - _internalTask = new Task( InternalAction ); + _internalTask = new Task(InternalAction); cts = new CancellationTokenSource(); } @@ -85,22 +82,22 @@ namespace StgSharp.Threading // ~CancellableTask() // { - // Dispose(disposing: false); + // Dispose(disposing: false); // } public void Dispose() { - Dispose( disposing: true ); - GC.SuppressFinalize( this ); + Dispose(disposing:true); + GC.SuppressFinalize(this); } - public static CancellableTask Run( Action startup ) + public static CancellableTask Run(Action startup) { CancellableTask ret = new CancellableTask { _startup = startup }; - ret._internalTask = Task.Run( ret.InternalAction ); + ret._internalTask = Task.Run(ret.InternalAction); return ret; } @@ -109,33 +106,33 @@ namespace StgSharp.Threading _internalTask.Wait(); } - public static void WaitAll( IEnumerable tasks ) + public static void WaitAll(IEnumerable tasks) { IEnumerable convertedTasks = tasks.Select( - ct => ct._internalTask ); - Task.WaitAll( convertedTasks.ToArray() ); + ct => ct._internalTask); + Task.WaitAll(convertedTasks.ToArray()); } - [MethodImpl( MethodImplOptions.AggressiveInlining )] + [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void InternalAction() { - _startup( Cts.Token ); + _startup(Cts.Token); } - protected virtual void Dispose( bool disposing ) + protected virtual void Dispose(bool disposing) { - if( !disposedValue ) + if (!disposedValue) { - if( disposing ) + if (disposing) { - if( IsCompleted ) + if (IsCompleted) { cts.Dispose(); _internalTask.Dispose(); } else { throw new InvalidOperationException( - "Cannot dispose a cancellable task before completed" ); + "Cannot dispose a cancellable task before completed"); } } @@ -143,7 +140,7 @@ namespace StgSharp.Threading } } - public static implicit operator Task( CancellableTask task ) + public static implicit operator Task(CancellableTask task) { return task._internalTask; } diff --git a/StgSharp.Common/Threading/EmptyThread.cs b/StgSharp.Common/Threading/EmptyThread.cs index 064e6216..7863593e 100644 --- a/StgSharp.Common/Threading/EmptyThread.cs +++ b/StgSharp.Common/Threading/EmptyThread.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="EmptyThread.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="EmptyThread" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Diagnostics; @@ -41,7 +38,7 @@ namespace StgSharp.Threading public static partial class ThreadHelper { - private static readonly Thread _emptyThreadCache = new Thread( () => { } ); + private static readonly Thread _emptyThreadCache = new Thread(() => { }); static ThreadHelper() { diff --git a/StgSharp.Common/Threading/MainThreadAssert.cs b/StgSharp.Common/Threading/MainThreadAssert.cs index e9327a40..3928ffa6 100644 --- a/StgSharp.Common/Threading/MainThreadAssert.cs +++ b/StgSharp.Common/Threading/MainThreadAssert.cs @@ -1,40 +1,33 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="MainThreadAssert.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="MainThreadAssert" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Text; using System.Threading; -using System.Threading.Tasks; namespace StgSharp.Threading { @@ -42,15 +35,15 @@ namespace StgSharp.Threading { private static readonly int mainThreadId = Environment.CurrentManagedThreadId; - private static readonly ThreadLocal isNotMainThread = new ThreadLocal( - () => Environment.CurrentManagedThreadId != mainThreadId ); + private static readonly ThreadLocal isNotMainThread = new( + () => Environment.CurrentManagedThreadId != mainThreadId); - [Conditional( "DEBUG" )] + [Conditional("DEBUG")] internal static void MainThreadAssert() { - if( isNotMainThread.Value ) { + if (isNotMainThread.Value) { throw new InvalidOperationException( - $"Attempt to call sensitive operation which can be only called from main thread " + $"from thread {Environment.CurrentManagedThreadId}." ); + $"Attempt to call sensitive operation which can be only called from main thread from thread {Environment.CurrentManagedThreadId}."); } } diff --git a/StgSharp.Common/Threading/SingleConsumerBell.cs b/StgSharp.Common/Threading/SingleConsumerBell.cs index 2c6ac362..379b2a79 100644 --- a/StgSharp.Common/Threading/SingleConsumerBell.cs +++ b/StgSharp.Common/Threading/SingleConsumerBell.cs @@ -34,15 +34,15 @@ namespace StgSharp.Threading /// A single-consumer bell/signal primitive. /// /// - /// Producers can call multiple times to publish signals. The bell + /// Producers can call multiple times to publish signals. The bell /// keeps a pending count of not-yet-consumed signals. The consumer uses or to consume - /// signals. When a producer increments the pending count from 0 to 1, the + /// signals. When a producer increments the pending count from 0 to 1, the /// internal event is set to wake the consumer. Consuming via /// or clears the entire pending count /// (aggregate consumption). If new signals arrive while resetting, the event is set again to - /// avoid missed signals. Ownership: only the specified owner can call - /// the consumer APIs. + /// avoid missed signals. Ownership: only the specified owner can call + /// the consumer APIs. /// public sealed class SingleConsumerBell : IDisposable { @@ -113,8 +113,8 @@ namespace StgSharp.Threading /// The consumer object; must be the same reference provided at construction. /// /// - /// true if a signal was available (pending or event set); otherwise - /// false. + /// true if a signal was available (pending or event set); otherwise false + /// . /// /// /// Thrown if is not the owner. diff --git a/StgSharp.Common/Timing/TimeFunction.cs b/StgSharp.Common/Timing/TimeFunction.cs index c8834ab1..0fbd2000 100644 --- a/StgSharp.Common/Timing/TimeFunction.cs +++ b/StgSharp.Common/Timing/TimeFunction.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="TimeFunction.cs" -// Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="TimeFunction" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Text; @@ -43,14 +40,11 @@ namespace StgSharp.Timing internal TimeFunction() { } - public TimeFunction( - TimeSpanProvider timeSpanProvider, - Func timeRelatedCalculation, - float range ) + public TimeFunction(TimeSpanProvider timeSpanProvider, Func timeRelatedCalculation, float range) { _timeProvider = timeSpanProvider; _timeRelatedCalculation = timeRelatedCalculation; - if( timeSpanProvider == null ) { + if (timeSpanProvider == null) { return; } _beginning = _timeProvider.CurrentSecond; @@ -81,25 +75,25 @@ namespace StgSharp.Timing public virtual float Calculate() { - if( _timeProvider.CurrentSecond < _ending ) { + if (_timeProvider.CurrentSecond < _ending) { return 0; } - return _timeRelatedCalculation( _timeProvider.CurrentSecond - _beginning ); + return _timeRelatedCalculation(_timeProvider.CurrentSecond - _beginning); } - public static TimeFunction Proportional( TimeSpanProvider time, float begin, float range ) + public static TimeFunction Proportional(TimeSpanProvider time, float begin, float range) { - return new TimeFunction( time, ( float t ) => t + begin, range ); + return new TimeFunction(time, (float t) => t + begin, range); } - public virtual TimeFunction Renew( (Func func, float range) funcPair ) + public virtual TimeFunction Renew((Func func, float range) funcPair) { - return new TimeFunction( _timeProvider, funcPair.func, funcPair.range ); + return new TimeFunction(_timeProvider, funcPair.func, funcPair.range); } - public virtual TimeFunction Renew( Func func, float range ) + public virtual TimeFunction Renew(Func func, float range) { - return new TimeFunction( _timeProvider, func, range ); + return new TimeFunction(_timeProvider, func, range); } public void Reset() @@ -113,7 +107,7 @@ namespace StgSharp.Timing { float range = _ending - _beginning; return new TimeFunction( - _timeProvider, p => _timeRelatedCalculation( range - p ), range ); + _timeProvider, p => _timeRelatedCalculation(range - p), range); } } @@ -133,12 +127,12 @@ namespace StgSharp.Timing return 1; } - public override TimeFunction Renew( (Func func, float range) funcPair ) + public override TimeFunction Renew((Func func, float range) funcPair) { throw new NotSupportedException(); } - public override TimeFunction Renew( Func func, float range ) + public override TimeFunction Renew(Func func, float range) { throw new NotSupportedException(); } diff --git a/StgSharp.Common/Timing/TimeProvider.cs b/StgSharp.Common/Timing/TimeProvider.cs index b29de393..84d0e813 100644 --- a/StgSharp.Common/Timing/TimeProvider.cs +++ b/StgSharp.Common/Timing/TimeProvider.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="TimeProvider.cs" +// file="TimeProvider" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Timing/TimeSourceProvider.cs b/StgSharp.Common/Timing/TimeSourceProvider.cs index c3526ceb..49897242 100644 --- a/StgSharp.Common/Timing/TimeSourceProvider.cs +++ b/StgSharp.Common/Timing/TimeSourceProvider.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="TimeSourceProvider.cs" +// file="TimeSourceProvider" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- diff --git a/StgSharp.Common/Timing/TimeSpanAwaitingToken.cs b/StgSharp.Common/Timing/TimeSpanAwaitingToken.cs index 997ca746..5fe50834 100644 --- a/StgSharp.Common/Timing/TimeSpanAwaitingToken.cs +++ b/StgSharp.Common/Timing/TimeSpanAwaitingToken.cs @@ -1,30 +1,27 @@ //----------------------------------------------------------------------- // ----------------------------------------------------------------------- -// file="TimeSpanAwaitingToken.cs" +// file="TimeSpanAwaitingToken" // Project: StgSharp -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: -// -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- @@ -98,7 +95,7 @@ namespace StgSharp.Timing internal SemaphoreSlim AwaitingSemaphoreSlim { -[MethodImpl(MethodImplOptions.AggressiveInlining)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] get => _awaitingSemaphore; } diff --git a/StgSharp.Common/Timing/TimeSpanProvider.cs b/StgSharp.Common/Timing/TimeSpanProvider.cs index 0fade796..f41ba563 100644 --- a/StgSharp.Common/Timing/TimeSpanProvider.cs +++ b/StgSharp.Common/Timing/TimeSpanProvider.cs @@ -1,33 +1,30 @@ //----------------------------------------------------------------------- -//----------------------------------------------------------------------- -// file="TimeSpanProvider.cs" -// Project: StepVisualizer -// AuthorGroup: Nitload Space -// Copyright (c) Nitload Space. All rights reserved. +// ----------------------------------------------------------------------- +// file="TimeSpanProvider" +// Project: StgSharp +// AuthorGroup: Nitload +// Copyright (c) Nitload. All rights reserved. // -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the “Software”), to deal in the Software without restriction, -// including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, -// and to permit persons to whom the Software is furnished to do so, -// subject to the following conditions: +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. // -// The above copyright notice and -// this permission notice shall be included in all copies -// or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED “AS IS”, -// WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -// ARISING FROM, OUT OF OR IN CONNECTION WITH -// THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// -//----------------------------------------------------------------------- -//----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -49,7 +46,7 @@ namespace StgSharp.Timing private ConcurrentQueue _tokenToAdd = new ConcurrentQueue( ); private ConcurrentQueue _tokenToQuit; - private Counter timeSpanCount = new Counter( -1, 1, 1 ); + private Counter timeSpanCount = new Counter(-1, 1, 1); private HashSet _awaitingTokens; private long _maxSpanCount; private long _spanBegin; @@ -66,13 +63,13 @@ namespace StgSharp.Timing /// /// /// - public TimeSpanProvider( long spanMicroSeconds, TimeSourceProviderBase provider ) + public TimeSpanProvider(long spanMicroSeconds, TimeSourceProviderBase provider) { - ArgumentNullException.ThrowIfNull( provider ); + ArgumentNullException.ThrowIfNull(provider); _timeSource = provider; _spanLength = spanMicroSeconds; _maxSpanCount = int.MaxValue; - provider.AddSubscriber( this ); + provider.AddSubscriber(this); _subscribed = true; _awaitingTokens = new HashSet(); _tokenToQuit = new ConcurrentQueue(); @@ -88,14 +85,14 @@ namespace StgSharp.Timing /// /// /// - public TimeSpanProvider( double spanSeconds, TimeSourceProviderBase provider ) + public TimeSpanProvider(double spanSeconds, TimeSourceProviderBase provider) { - ArgumentNullException.ThrowIfNull( provider ); + ArgumentNullException.ThrowIfNull(provider); _timeSource = provider; - _spanLength = ( long )( spanSeconds * 1000L * 1000L ); + _spanLength = (long)(spanSeconds * 1000L * 1000L); _spanBegin = -_spanLength; _maxSpanCount = long.MaxValue; - provider.AddSubscriber( this ); + provider.AddSubscriber(this); _subscribed = true; _awaitingTokens = new HashSet(); _tokenToQuit = new ConcurrentQueue(); @@ -114,16 +111,16 @@ namespace StgSharp.Timing /// /// /// - public TimeSpanProvider( long spanLength, long maxSpan, TimeSourceProviderBase provider ) + public TimeSpanProvider(long spanLength, long maxSpan, TimeSourceProviderBase provider) { - ArgumentNullException.ThrowIfNull( provider ); - if( maxSpan <= 0 ) { - throw new ArgumentException( "Sapn count cannot be smaller than zero" ); + ArgumentNullException.ThrowIfNull(provider); + if (maxSpan <= 0) { + throw new ArgumentException("Sapn count cannot be smaller than zero"); } _timeSource = provider; _spanLength = spanLength; _spanBegin = -_spanLength; - provider.AddSubscriber( this ); + provider.AddSubscriber(this); _subscribed = true; _awaitingTokens = new HashSet(); _tokenToQuit = new ConcurrentQueue(); @@ -131,7 +128,7 @@ namespace StgSharp.Timing public double SpanLength { - get => ( _spanLength * 1.0 ) / ( 1000L * 1000L ); + get => (_spanLength * 1.0) / (1000L * 1000L); } public float CurrentSecond @@ -141,7 +138,7 @@ namespace StgSharp.Timing public float SpanLengthLowPrecession { - get => ( _spanLength * 1.0f ) / ( 1000 * 1000 ); + get => (_spanLength * 1.0f) / (1000 * 1000); } public int CurrentSpan @@ -154,31 +151,31 @@ namespace StgSharp.Timing ///
public static TimeSourceProviderBase DefaultProvider => StgSharpTime.OnlyInstance; - public TimeSpanAwaitingToken ParticipantSpanAwaiting( int count ) + public TimeSpanAwaitingToken ParticipantSpanAwaiting(int count) { - TimeSpanAwaitingToken token = new TimeSpanAwaitingToken( this, count ); - _tokenToAdd.Enqueue( token ); + TimeSpanAwaitingToken token = new TimeSpanAwaitingToken(this, count); + _tokenToAdd.Enqueue(token); return token; } - public void QuitSpanAwaiting( TimeSpanAwaitingToken token ) + public void QuitSpanAwaiting(TimeSpanAwaitingToken token) { - _tokenToQuit.Enqueue( token ); + _tokenToQuit.Enqueue(token); } public void StopSpanProviding() { - Interlocked.Exchange( ref _maxSpanCount, 0 ); + Interlocked.Exchange(ref _maxSpanCount, 0); } - public void SubscribeToTimeSource( TimeSourceProviderBase serviceHandler ) + public void SubscribeToTimeSource(TimeSourceProviderBase serviceHandler) { - ArgumentNullException.ThrowIfNull( serviceHandler ); - if( _subscribed ) { + ArgumentNullException.ThrowIfNull(serviceHandler); + if (_subscribed) { return; } _subscribed = true; - serviceHandler.AddSubscriber( this ); + serviceHandler.AddSubscriber(this); } public int ToInt32() @@ -186,29 +183,29 @@ namespace StgSharp.Timing return timeSpanCount.Value; } - internal bool CheckTime( long microseconds ) + internal bool CheckTime(long microseconds) { - if( microseconds - _spanBegin < _spanLength ) { + if (microseconds - _spanBegin < _spanLength) { return true; } - foreach( TimeSpanAwaitingToken tokenAdd in _tokenToAdd ) { - _awaitingTokens.Add( tokenAdd ); + foreach (TimeSpanAwaitingToken tokenAdd in _tokenToAdd) { + _awaitingTokens.Add(tokenAdd); } _tokenToAdd.Clear(); - foreach( TimeSpanAwaitingToken tokenQuit in _tokenToQuit ) + foreach (TimeSpanAwaitingToken tokenQuit in _tokenToQuit) { - _awaitingTokens.Remove( tokenQuit ); + _awaitingTokens.Remove(tokenQuit); InternalIO.InternalWriteLog( - $"Awaiting token {tokenQuit!.TokenID} has been removed.", LogType.Info ); + $"Awaiting token {tokenQuit!.TokenID} has been removed.", LogType.Info); } _tokenToQuit.Clear(); _spanBegin = microseconds; timeSpanCount++; - foreach( TimeSpanAwaitingToken item in _awaitingTokens ) + foreach (TimeSpanAwaitingToken item in _awaitingTokens) { - if( item.AwaitingSemaphoreSlim.CurrentCount == 0 ) + if (item.AwaitingSemaphoreSlim.CurrentCount == 0) { item.AwaitingSemaphoreSlim.Release(); item.Refresh(); @@ -221,7 +218,7 @@ namespace StgSharp.Timing return timeSpanCount < _maxSpanCount; } - public static explicit operator int( [NotNull]TimeSpanProvider provider ) + public static explicit operator int([NotNull]TimeSpanProvider provider) { return provider.ToInt32(); }