diff --git a/Sources/Sandbox.Game/Definitions/MyBlueprintDefinitionBase.cs b/Sources/Sandbox.Game/Definitions/MyBlueprintDefinitionBase.cs index c5b11128ab..59ec2fcdda 100644 --- a/Sources/Sandbox.Game/Definitions/MyBlueprintDefinitionBase.cs +++ b/Sources/Sandbox.Game/Definitions/MyBlueprintDefinitionBase.cs @@ -79,7 +79,7 @@ public MyObjectBuilderType InputItemType /// /// Postprocess initialization. Should set PostprocessNeeded to false if initialization was successful. /// - public abstract void Postprocess(); + public abstract override void Postprocess(); /// /// Whether the Postprocess method still needs to be called. diff --git a/Sources/Sandbox.Game/Definitions/MyCategoryClassDefinition.cs b/Sources/Sandbox.Game/Definitions/MyCategoryClassDefinition.cs index 35699f3750..54f511d629 100644 --- a/Sources/Sandbox.Game/Definitions/MyCategoryClassDefinition.cs +++ b/Sources/Sandbox.Game/Definitions/MyCategoryClassDefinition.cs @@ -19,7 +19,7 @@ public class MyGuiBlockCategoryDefinition : MyDefinitionBase public bool SearchBlocks = true; public bool ShowAnimations = false; public bool ShowInCreative = true; - public bool Public = true; + public new bool Public = true; private class SubtypeComparer : IComparer { diff --git a/Sources/Sandbox.Game/Definitions/MyComponentGroupDefinition.cs b/Sources/Sandbox.Game/Definitions/MyComponentGroupDefinition.cs index 3223ddc6d0..790e502d66 100644 --- a/Sources/Sandbox.Game/Definitions/MyComponentGroupDefinition.cs +++ b/Sources/Sandbox.Game/Definitions/MyComponentGroupDefinition.cs @@ -40,7 +40,7 @@ protected override void Init(MyObjectBuilder_DefinitionBase builder) MyDebug.AssertDebug(m_postprocessBuilder != null); } - public void Postprocess() + public override void Postprocess() { bool valid = true; diff --git a/Sources/Sandbox.Game/Definitions/MyDefinitionManager.cs b/Sources/Sandbox.Game/Definitions/MyDefinitionManager.cs index b3b1ba18fc..793689bead 100644 --- a/Sources/Sandbox.Game/Definitions/MyDefinitionManager.cs +++ b/Sources/Sandbox.Game/Definitions/MyDefinitionManager.cs @@ -1,16 +1,10 @@  #region Using -using Sandbox.Common; -using Sandbox.Common.ObjectBuilders; -using Sandbox.Common.ObjectBuilders.Definitions; using Sandbox.Engine.Utils; -using Sandbox.Engine.Voxels; -using Sandbox.Game.Entities; using Sandbox.Game.Entities.Cube; using Sandbox.Game.Localization; using Sandbox.Game.Screens; -using Sandbox.Game.World.Generator; using System; using System.Collections.Generic; using System.Diagnostics; @@ -23,13 +17,10 @@ using VRage; using VRage.Collections; -using VRage; using VRage.Audio; -using VRage.Plugins; using VRage.Utils; using VRage.Data; using VRage.Filesystem.FindFilesRegEx; -using VRage.Utils; using VRageMath; using VRageRender; using VRage.Library.Utils; diff --git a/Sources/Sandbox.Game/Definitions/MyDestructionDefinition.cs b/Sources/Sandbox.Game/Definitions/MyDestructionDefinition.cs index 7fea9673d5..f5b3f1aa6a 100644 --- a/Sources/Sandbox.Game/Definitions/MyDestructionDefinition.cs +++ b/Sources/Sandbox.Game/Definitions/MyDestructionDefinition.cs @@ -13,7 +13,7 @@ namespace Sandbox.Definitions public class MyDestructionDefinition : MyDefinitionBase { public float DestructionDamage; - public string[] Icons; + public new string[] Icons; public float ConvertedFractureIntegrityRatio; public class MyFracturedPieceDefinition diff --git a/Sources/Sandbox.Game/Definitions/MyPirateAntennaDefinition.cs b/Sources/Sandbox.Game/Definitions/MyPirateAntennaDefinition.cs index 3936ccb631..6506ab9020 100644 --- a/Sources/Sandbox.Game/Definitions/MyPirateAntennaDefinition.cs +++ b/Sources/Sandbox.Game/Definitions/MyPirateAntennaDefinition.cs @@ -42,7 +42,7 @@ protected override void Init(MyObjectBuilder_DefinitionBase builder) } } - public void Postprocess() + public override void Postprocess() { List spawnGroups = new List(); List frequencies = new List(); diff --git a/Sources/Sandbox.Game/Engine/GUI/FunctionalBlocks/MyGuiControlGenericFunctionalBlock.cs b/Sources/Sandbox.Game/Engine/GUI/FunctionalBlocks/MyGuiControlGenericFunctionalBlock.cs index b92f000c18..be8c0a496e 100644 --- a/Sources/Sandbox.Game/Engine/GUI/FunctionalBlocks/MyGuiControlGenericFunctionalBlock.cs +++ b/Sources/Sandbox.Game/Engine/GUI/FunctionalBlocks/MyGuiControlGenericFunctionalBlock.cs @@ -1,25 +1,18 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Linq; using System.Text; using Sandbox.Game.Entities; using Sandbox.Game.Entities.Cube; using Sandbox.Game.Gui; -using Sandbox.Game.Screens; using VRage; using VRageMath; -using Sandbox.Common; using Sandbox.Game.World; using Sandbox.Game.Multiplayer; using Sandbox.Engine.Utils; -using Sandbox.Common.ObjectBuilders; -using VRage; using Sandbox.Game.Localization; using VRage.Utils; -using VRage.Library.Utils; -using Sandbox.Game.SessionComponents; using Sandbox.Game.Entities.Blocks; using VRage.Game; diff --git a/Sources/Sandbox.Game/Engine/Multiplayer/MyMultiplayerClient.cs b/Sources/Sandbox.Game/Engine/Multiplayer/MyMultiplayerClient.cs index 4db0dc2068..3c8b0a1930 100644 --- a/Sources/Sandbox.Game/Engine/Multiplayer/MyMultiplayerClient.cs +++ b/Sources/Sandbox.Game/Engine/Multiplayer/MyMultiplayerClient.cs @@ -1,31 +1,20 @@ #region Using -using Sandbox.Common; -using Sandbox.Common.ObjectBuilders; using Sandbox.Engine.Networking; -using Sandbox.Engine.Utils; -using Sandbox.Game; using Sandbox.Game.Gui; -using Sandbox.Game.Localization; using Sandbox.Game.Multiplayer; -using Sandbox.Game.World; using Sandbox.Graphics.GUI; using SteamSDK; using System; using System.Collections.Generic; using System.Diagnostics; -using System.Globalization; -using System.IO; -using System.Net; -using System.Runtime.InteropServices; using System.Text; using System.Threading; using VRage; using VRage.Utils; using VRage.Trace; -using VRage.Utils; using VRage.Library.Utils; using VRage.Network; using VRage.Replication; diff --git a/Sources/Sandbox.Game/Engine/Networking/MyReceiveQueue.cs b/Sources/Sandbox.Game/Engine/Networking/MyReceiveQueue.cs index e29e56230a..00d44736e5 100644 --- a/Sources/Sandbox.Game/Engine/Networking/MyReceiveQueue.cs +++ b/Sources/Sandbox.Game/Engine/Networking/MyReceiveQueue.cs @@ -1,18 +1,11 @@ -using Sandbox.Engine.Networking; -using Sandbox.Game.Multiplayer; -using SteamSDK; +using SteamSDK; using System; -using System.Collections.Generic; using System.Diagnostics; using System.Globalization; -using System.Linq; -using System.Runtime.ExceptionServices; -using System.Text; using System.Threading; using VRage.Collections; using VRage.Library.Utils; using VRage.Utils; -using VRage.Utils; namespace Sandbox.Engine.Networking { diff --git a/Sources/Sandbox.Game/Engine/Physics/MyBreakableShapeManager.cs b/Sources/Sandbox.Game/Engine/Physics/MyBreakableShapeManager.cs index ea981ddbae..382ad0aa3c 100644 --- a/Sources/Sandbox.Game/Engine/Physics/MyBreakableShapeManager.cs +++ b/Sources/Sandbox.Game/Engine/Physics/MyBreakableShapeManager.cs @@ -1,14 +1,10 @@ using Havok; using Sandbox.Definitions; -using Sandbox.Engine.Models; using Sandbox.Engine.Utils; using Sandbox.Engine.Voxels; using System; using System.Collections.Concurrent; using System.Collections.Generic; -using System.Linq; -using System.Text; -using VRage; using VRage; using VRage.Game; using VRage.Utils; diff --git a/Sources/Sandbox.Game/Engine/Physics/MyDestructionHelper.cs b/Sources/Sandbox.Game/Engine/Physics/MyDestructionHelper.cs index 34266f83a3..737350439a 100644 --- a/Sources/Sandbox.Game/Engine/Physics/MyDestructionHelper.cs +++ b/Sources/Sandbox.Game/Engine/Physics/MyDestructionHelper.cs @@ -9,16 +9,11 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Text; -using VRage; using VRage; using VRage.Game.Components; -using VRage.Library.Utils; using VRage.ModAPI; using VRageMath; using Sandbox.Game.EntityComponents; -using Sandbox.Engine.Multiplayer; using VRage.Game; using VRage.Utils; using VRage.Game.Entity; diff --git a/Sources/Sandbox.Game/Engine/Utils/MyConfigDedicated.cs b/Sources/Sandbox.Game/Engine/Utils/MyConfigDedicated.cs index a73d45259f..ed9260e8c6 100644 --- a/Sources/Sandbox.Game/Engine/Utils/MyConfigDedicated.cs +++ b/Sources/Sandbox.Game/Engine/Utils/MyConfigDedicated.cs @@ -252,7 +252,7 @@ bool IMyConfigDedicated.PauseGameWhenEmpty } } - void IMyConfigDedicated.Save(string path = null) + void IMyConfigDedicated.Save(string path) { Save(path); } diff --git a/Sources/Sandbox.Game/Engine/Utils/MySpectatorCameraController.cs b/Sources/Sandbox.Game/Engine/Utils/MySpectatorCameraController.cs index f0385af6e7..edaa135f68 100644 --- a/Sources/Sandbox.Game/Engine/Utils/MySpectatorCameraController.cs +++ b/Sources/Sandbox.Game/Engine/Utils/MySpectatorCameraController.cs @@ -20,7 +20,7 @@ public class MySpectatorCameraController : MySpectator, IMyCameraController // Increases how far the light can reflect private const int REFLECTOR_RANGE_MULTIPLIER = 5; - public static MySpectatorCameraController Static; + public static new MySpectatorCameraController Static; private double m_yaw; private double m_pitch; diff --git a/Sources/Sandbox.Game/Engine/Voxels/MyMarchingCubesMesher.cs b/Sources/Sandbox.Game/Engine/Voxels/MyMarchingCubesMesher.cs index e1555f8000..a556d3294b 100644 --- a/Sources/Sandbox.Game/Engine/Voxels/MyMarchingCubesMesher.cs +++ b/Sources/Sandbox.Game/Engine/Voxels/MyMarchingCubesMesher.cs @@ -593,7 +593,6 @@ private void ComputeSizeAndOrigin(int lodIdx, Vector3I storageSize) private void CreateTriangles(ref Vector3I coord0, int cubeIndex, ref Vector3I tempVoxelCoord0) { MyVoxelVertex tmpVertex = new MyVoxelVertex(); - int g = MyVoxelConstants.GEOMETRY_CELL_SIZE_IN_VOXELS; Vector3I edge = new Vector3I(coord0.X, coord0.Y, coord0.Z); for (int i = 0; MyMarchingCubesConstants.TriangleTable[cubeIndex, i] != -1; i += 3) { diff --git a/Sources/Sandbox.Game/Engine/Voxels/MyPrecalcComponent.cs b/Sources/Sandbox.Game/Engine/Voxels/MyPrecalcComponent.cs index ac4a2629c7..7179e52cdb 100644 --- a/Sources/Sandbox.Game/Engine/Voxels/MyPrecalcComponent.cs +++ b/Sources/Sandbox.Game/Engine/Voxels/MyPrecalcComponent.cs @@ -175,7 +175,7 @@ public override void UpdateBeforeSimulation() job.DebugDraw(new Color((shade - p) / shade, 0.0f, p / shade, (max - xi) / max)); } } - catch (Exception e) + catch (Exception) { } } @@ -330,7 +330,7 @@ public WorkPriority Priority set { m_workPriority = value; } } - void IWork.DoWork(ParallelTasks.WorkData workData = null) + void IWork.DoWork(ParallelTasks.WorkData workData) { m_timer.Start(); MyPrecalcJob work; diff --git a/Sources/Sandbox.Game/Engine/Voxels/MyVoxelGeometry.cs b/Sources/Sandbox.Game/Engine/Voxels/MyVoxelGeometry.cs index 553a6e4c5d..43ba1fc26e 100644 --- a/Sources/Sandbox.Game/Engine/Voxels/MyVoxelGeometry.cs +++ b/Sources/Sandbox.Game/Engine/Voxels/MyVoxelGeometry.cs @@ -1,13 +1,8 @@ - -using Sandbox.Common; -using Sandbox.Engine.Physics; -using System; +using System; using System.Collections.Generic; using System.Diagnostics; -using System.Threading; using VRage; using VRage.Collections; -using VRage; using VRage.Utils; using VRage.Voxels; using VRageMath; diff --git a/Sources/Sandbox.Game/Engine/Voxels/Planet/MyPlanetMaterialProvider.cs b/Sources/Sandbox.Game/Engine/Voxels/Planet/MyPlanetMaterialProvider.cs index b2600e36be..3d42ed230d 100644 --- a/Sources/Sandbox.Game/Engine/Voxels/Planet/MyPlanetMaterialProvider.cs +++ b/Sources/Sandbox.Game/Engine/Voxels/Planet/MyPlanetMaterialProvider.cs @@ -343,9 +343,7 @@ public void ReadMaterialRange(ref MyVoxelDataRequest req) var target = req.Target; float lodVoxelSize = 1 << req.Lod; - - MyVoxelRequestFlags usedFlags = 0; - + bool computeOcclusion = req.RequestedData.Requests(MyStorageDataTypeEnum.Occlusion); // We don't bother determining where the surface is if we don't have the normal. diff --git a/Sources/Sandbox.Game/Engine/Voxels/Storage/IMyStorage.cs b/Sources/Sandbox.Game/Engine/Voxels/Storage/IMyStorage.cs index 28ef21f7f6..8d9bbd5b9d 100644 --- a/Sources/Sandbox.Game/Engine/Voxels/Storage/IMyStorage.cs +++ b/Sources/Sandbox.Game/Engine/Voxels/Storage/IMyStorage.cs @@ -27,7 +27,7 @@ public interface IMyStorage : VRage.ModAPI.IMyStorage void OverwriteAllMaterials(MyVoxelMaterialDefinition material); - void Save(out byte[] outCompressedData); + new void Save(out byte[] outCompressedData); /// /// Reads range of content and/or materials from specified LOD. If you want to write data back later, you must read LOD0 as that is the only writable one. diff --git a/Sources/Sandbox.Game/Game/AI/Actions/MyHumanoidBotActions.cs b/Sources/Sandbox.Game/Game/AI/Actions/MyHumanoidBotActions.cs index a59a8d826a..69bd80461b 100644 --- a/Sources/Sandbox.Game/Game/AI/Actions/MyHumanoidBotActions.cs +++ b/Sources/Sandbox.Game/Game/AI/Actions/MyHumanoidBotActions.cs @@ -92,7 +92,6 @@ private void AreaReservationHandler(ref MyAiTargetManager.ReservedAreaData reser [MyBehaviorTreeAction("TryReserveEntity")] protected MyBehaviorTreeState TryReserveEntity([BTIn] ref MyBBMemoryTarget inTarget, [BTParam] int timeMs) { - MyBehaviorTreeState retStatus = MyBehaviorTreeState.FAILURE; if(Bot == null || Bot.Player == null) return MyBehaviorTreeState.FAILURE; @@ -140,7 +139,6 @@ protected MyBehaviorTreeState TryReserveEntity([BTIn] ref MyBBMemoryTarget inTar break; default: logic.ReservationStatus = Logic.MyReservationStatus.FAILURE; - retStatus = MyBehaviorTreeState.FAILURE; break; } m_reservationTimeOut = MySandboxGame.Static.UpdateTime + MyTimeSpan.FromSeconds(RESERVATION_WAIT_TIMEOUT_SECONDS); diff --git a/Sources/Sandbox.Game/Game/AI/BehaviorTree/MyBehaviorTree.cs b/Sources/Sandbox.Game/Game/AI/BehaviorTree/MyBehaviorTree.cs index 43c726a4df..3832841918 100644 --- a/Sources/Sandbox.Game/Game/AI/BehaviorTree/MyBehaviorTree.cs +++ b/Sources/Sandbox.Game/Game/AI/BehaviorTree/MyBehaviorTree.cs @@ -1,16 +1,7 @@ using Sandbox.Definitions; -using Sandbox.Engine.Utils; -using Sandbox.Graphics; -using System; using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; using System.Text; -using VRageMath; -using VRage.Win32; using VRage.Utils; -using VRage.Utils; -using VRage.Library.Utils; namespace Sandbox.Game.AI.BehaviorTree { diff --git a/Sources/Sandbox.Game/Game/AI/BehaviorTree/MyBehaviorTreeActionNode.cs b/Sources/Sandbox.Game/Game/AI/BehaviorTree/MyBehaviorTreeActionNode.cs index a53dbfd694..0ed10b1394 100644 --- a/Sources/Sandbox.Game/Game/AI/BehaviorTree/MyBehaviorTreeActionNode.cs +++ b/Sources/Sandbox.Game/Game/AI/BehaviorTree/MyBehaviorTreeActionNode.cs @@ -1,16 +1,9 @@ -using Sandbox.Definitions; -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Text; using VRageMath; using VRage.Utils; -using Sandbox.Common; using VRage; using VRage.Game; -using VRage.Utils; -using VRage.Library.Utils; namespace Sandbox.Game.AI.BehaviorTree { diff --git a/Sources/Sandbox.Game/Game/AI/BehaviorTree/MyPerTreeBotMemory.cs b/Sources/Sandbox.Game/Game/AI/BehaviorTree/MyPerTreeBotMemory.cs index da2ed8749a..b85caae4f9 100644 --- a/Sources/Sandbox.Game/Game/AI/BehaviorTree/MyPerTreeBotMemory.cs +++ b/Sources/Sandbox.Game/Game/AI/BehaviorTree/MyPerTreeBotMemory.cs @@ -1,11 +1,7 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using VRage.Utils; using System.Diagnostics; -using VRage.Utils; -using VRage.Library.Utils; using VRage.Collections; using VRage.Game; diff --git a/Sources/Sandbox.Game/Game/AI/Navigation/MyBotNavigation.cs b/Sources/Sandbox.Game/Game/AI/Navigation/MyBotNavigation.cs index 63747f7d70..7f48f619fc 100644 --- a/Sources/Sandbox.Game/Game/AI/Navigation/MyBotNavigation.cs +++ b/Sources/Sandbox.Game/Game/AI/Navigation/MyBotNavigation.cs @@ -3,13 +3,9 @@ using Sandbox.Game.Entities; using Sandbox.Game.Entities.Character; using Sandbox.Game.GameSystems; -using Sandbox.Graphics; using System; using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Text; -using VRage; using VRage; using VRage.Game.Entity; using VRageMath; diff --git a/Sources/Sandbox.Game/Game/AI/Pathfinding/MyGridHighLevelHelper.cs b/Sources/Sandbox.Game/Game/AI/Pathfinding/MyGridHighLevelHelper.cs index 6c587a4aa9..cdae040ed5 100644 --- a/Sources/Sandbox.Game/Game/AI/Pathfinding/MyGridHighLevelHelper.cs +++ b/Sources/Sandbox.Game/Game/AI/Pathfinding/MyGridHighLevelHelper.cs @@ -2,9 +2,6 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Text; -using VRage; using VRage; using VRage.Utils; using VRage.Voxels; diff --git a/Sources/Sandbox.Game/Game/AI/Pathfinding/MyVoxelConnectionHelper.cs b/Sources/Sandbox.Game/Game/AI/Pathfinding/MyVoxelConnectionHelper.cs index a0c6a91200..b2e602487a 100644 --- a/Sources/Sandbox.Game/Game/AI/Pathfinding/MyVoxelConnectionHelper.cs +++ b/Sources/Sandbox.Game/Game/AI/Pathfinding/MyVoxelConnectionHelper.cs @@ -167,14 +167,13 @@ public void FixOuterEdge(int edgeIndex, bool firstPoint, Vector3 currentPosition { OuterEdgePoint data = new OuterEdgePoint(edgeIndex, firstPoint); var query = m_outerEdgePoints.QueryPointsSphere(ref currentPosition, OUTER_EDGE_EPSILON * 3); - bool moved = false; + while (query.MoveNext()) { if (query.Current.EdgeIndex == edgeIndex && query.Current.FirstPoint == firstPoint) { //Debug.Assert(moved == false, "The point was already moved!"); m_outerEdgePoints.MovePoint(query.StorageIndex, ref currentPosition); - moved = true; } } } diff --git a/Sources/Sandbox.Game/Game/Entities/Blocks/MyAssembler.cs b/Sources/Sandbox.Game/Game/Entities/Blocks/MyAssembler.cs index bce693f56b..013fb04aa4 100644 --- a/Sources/Sandbox.Game/Game/Entities/Blocks/MyAssembler.cs +++ b/Sources/Sandbox.Game/Game/Entities/Blocks/MyAssembler.cs @@ -5,33 +5,20 @@ using System.Text; using Sandbox.Common.ObjectBuilders; -using Sandbox.Common.ObjectBuilders.Definitions; using Sandbox.Definitions; -using Sandbox.Graphics.GUI; -using Sandbox.Engine.Utils; -using Sandbox.Game.Entities.Character; using Sandbox.Game.Gui; - -using VRage.Trace; -using VRageMath; using Sandbox.Game.World; using Sandbox.Game.Multiplayer; using System.Collections.Generic; -using SteamSDK; using Sandbox.Engine.Multiplayer; -using Sandbox.Game.Screens; -using Sandbox.Graphics; using VRage; using Sandbox.Game.GameSystems; using VRage.Utils; using Sandbox.Game.GameSystems.Conveyors; using Sandbox.ModAPI.Ingame; using Sandbox.Game.Localization; -using VRage; -using Sandbox.Game.Entities.Interfaces; using Sandbox.Game.EntityComponents; using VRage.ObjectBuilders; -using Sandbox.ModAPI.Interfaces; using VRage.Game; using VRage.Game.Entity; using VRage.Network; diff --git a/Sources/Sandbox.Game/Game/Entities/Blocks/MyCockpit.cs b/Sources/Sandbox.Game/Game/Entities/Blocks/MyCockpit.cs index f0daec6b7c..b1a7bbd792 100644 --- a/Sources/Sandbox.Game/Game/Entities/Blocks/MyCockpit.cs +++ b/Sources/Sandbox.Game/Game/Entities/Blocks/MyCockpit.cs @@ -1,10 +1,8 @@ #region Using -using Sandbox.Common; using Sandbox.Common.ObjectBuilders; using Sandbox.Common.ObjectBuilders.Definitions; using Sandbox.Definitions; -using Sandbox.Engine.Models; using Sandbox.Engine.Utils; using Sandbox.Game.AI; using Sandbox.Game.Entities.Character; @@ -16,11 +14,9 @@ using Sandbox.Game.Multiplayer; using Sandbox.Game.World; using Sandbox.ModAPI.Ingame; -using Sandbox.ModAPI.Interfaces; using System; using System.Collections.Generic; using System.Diagnostics; -using VRage.Audio; using VRage.FileSystem; using VRageMath; using VRage; @@ -39,7 +35,6 @@ using VRage.Game.Definitions.Animation; using VRage.Game.Gui; using VRage.Game.Entity; -using VRage.Game.Entity; using VRage.Game.ModAPI.Interfaces; using VRage.Serialization; using VRage.ObjectBuilders; diff --git a/Sources/Sandbox.Game/Game/Entities/Blocks/MyOreDetectorComponent.cs b/Sources/Sandbox.Game/Game/Entities/Blocks/MyOreDetectorComponent.cs index 0f4b38b84a..9b64e5d668 100644 --- a/Sources/Sandbox.Game/Game/Entities/Blocks/MyOreDetectorComponent.cs +++ b/Sources/Sandbox.Game/Game/Entities/Blocks/MyOreDetectorComponent.cs @@ -4,14 +4,11 @@ using Sandbox.Definitions; using Sandbox.Engine.Voxels; using Sandbox.Game.Gui; -using Sandbox.Game.World; using System; using System.Collections.Generic; using System.Diagnostics; -using System.Linq; using VRage; using VRage.Collections; -using VRage; using VRage.Generics; using VRage.Utils; using VRage.Voxels; @@ -346,7 +343,7 @@ WorkPriority IPrioritizedWork.Priority get { return WorkPriority.VeryLow; } } - void IWork.DoWork(WorkData workData = null) + void IWork.DoWork(WorkData workData) { ProfilerShort.Begin("MyDepositQuery.DoWork"); try diff --git a/Sources/Sandbox.Game/Game/Entities/Blocks/MyShipController.cs b/Sources/Sandbox.Game/Game/Entities/Blocks/MyShipController.cs index a6e7ea7571..fb53ab7579 100644 --- a/Sources/Sandbox.Game/Game/Entities/Blocks/MyShipController.cs +++ b/Sources/Sandbox.Game/Game/Entities/Blocks/MyShipController.cs @@ -1,6 +1,5 @@ #region Using -using Sandbox.Common; using Sandbox.Common.ObjectBuilders; using Sandbox.Definitions; using Sandbox.Engine.Utils; @@ -17,7 +16,6 @@ using Sandbox.Game.World; using Sandbox.Graphics; using Sandbox.ModAPI.Ingame; -using Sandbox.ModAPI.Interfaces; using System.Diagnostics; using System.Text; using Sandbox.Engine.Networking; @@ -37,18 +35,12 @@ using Sandbox.Engine.Multiplayer; -using System.Collections.Generic; using VRage.Game.Gui; using VRage.Game.Components; using VRage.Game.Entity; -using Sandbox.Engine.Physics; -using Sandbox.Game.AI; -using Sandbox.Engine.Multiplayer; using VRage.Game; using VRage.Game.ModAPI.Interfaces; using VRage.Serialization; -using Sandbox.Game.Replication; -using VRage.Audio; #endregion namespace Sandbox.Game.Entities diff --git a/Sources/Sandbox.Game/Game/Entities/Cube/MyCubeBlockCollector.cs b/Sources/Sandbox.Game/Game/Entities/Cube/MyCubeBlockCollector.cs index 10a62c7ca0..63567dae9b 100644 --- a/Sources/Sandbox.Game/Game/Entities/Cube/MyCubeBlockCollector.cs +++ b/Sources/Sandbox.Game/Game/Entities/Cube/MyCubeBlockCollector.cs @@ -1,19 +1,9 @@ using Havok; -using Sandbox.Common.ObjectBuilders; using System; using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using VRageMath; -using Sandbox.Definitions; using Sandbox.Engine.Utils; -using VRage.Utils; -using Sandbox.Common.ObjectBuilders.Definitions; -using Sandbox.Graphics; -using VRage; -using Sandbox.Common; using VRage; using VRage.Game; diff --git a/Sources/Sandbox.Game/Game/Entities/Cube/MyCubeBuilder-Draw.cs b/Sources/Sandbox.Game/Game/Entities/Cube/MyCubeBuilder-Draw.cs index dfebcab884..895dc46e01 100644 --- a/Sources/Sandbox.Game/Game/Entities/Cube/MyCubeBuilder-Draw.cs +++ b/Sources/Sandbox.Game/Game/Entities/Cube/MyCubeBuilder-Draw.cs @@ -1,34 +1,21 @@ #region Using -using Sandbox.Common; -using Sandbox.Common.ObjectBuilders; -using Sandbox.Common.ObjectBuilders.Definitions; using Sandbox.Definitions; using Sandbox.Engine.Utils; -using Sandbox.Engine.Voxels; -using Sandbox.Game.Entities.Character; using Sandbox.Game.Entities.Cube; using Sandbox.Game.Gui; -using Sandbox.Game.GUI; -using Sandbox.Game.Localization; -using Sandbox.Game.Screens.Helpers; -using Sandbox.Game.SessionComponents; using Sandbox.Game.World; using Sandbox.Graphics; -using Sandbox.Graphics.GUI; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using VRage; -using VRage; using VRage.Utils; using VRageMath; using VRageRender; -using ModelId = System.Int32; using Sandbox.Engine.Physics; -using Sandbox.Engine.Models; using Havok; using VRage.Game.Models; using VRage.Game; diff --git a/Sources/Sandbox.Game/Game/Entities/Cube/MyCubeGrid.cs b/Sources/Sandbox.Game/Game/Entities/Cube/MyCubeGrid.cs index f77674f6a9..7eaca4913d 100644 --- a/Sources/Sandbox.Game/Game/Entities/Cube/MyCubeGrid.cs +++ b/Sources/Sandbox.Game/Game/Entities/Cube/MyCubeGrid.cs @@ -2,9 +2,7 @@ using Havok; using ProtoBuf; -using Sandbox.Common; using Sandbox.Common.ObjectBuilders; -using Sandbox.Common.ObjectBuilders.Definitions; using Sandbox.Definitions; using Sandbox.Engine.Multiplayer; using Sandbox.Engine.Physics; @@ -15,11 +13,8 @@ using Sandbox.Game.GameSystems; using Sandbox.Game.GameSystems.StructuralIntegrity; using Sandbox.Game.GUI; -using Sandbox.Game.Localization; using Sandbox.Game.Multiplayer; using Sandbox.Game.World; -using Sandbox.ModAPI; -using Sandbox.ModAPI.Interfaces; using System; using System.Collections.Generic; using System.Diagnostics; @@ -42,7 +37,6 @@ using VRage.Library.Sync; using Sandbox.Game.GameSystems.CoordinateSystem; using VRage.Game.Entity; -using VRage.Game.Entity; using VRage.Game.Models; using Sandbox.Game.Weapons; using VRage.Game; diff --git a/Sources/Sandbox.Game/Game/Entities/Cube/MyCubeGridRenderCell.cs b/Sources/Sandbox.Game/Game/Entities/Cube/MyCubeGridRenderCell.cs index 26f26a787b..5c102de158 100644 --- a/Sources/Sandbox.Game/Game/Entities/Cube/MyCubeGridRenderCell.cs +++ b/Sources/Sandbox.Game/Game/Entities/Cube/MyCubeGridRenderCell.cs @@ -1,27 +1,16 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Sandbox.Engine.Utils; using VRage.Import; using VRageMath; using VRageRender; using Sandbox.Definitions; using VRage.Utils; -using Sandbox.Engine.Models; using ModelId = System.Int32; -using Sandbox.Graphics; -using Sandbox.Common.ObjectBuilders; -using Sandbox.Common.ObjectBuilders.Definitions; using VRage; -using Sandbox.Common; using Sandbox.Game.Components; -using VRage.Utils; -using VRage; using VRage.Game; -using VRage.Library.Utils; using VRage.ObjectBuilders; using VRage.Game.Models; diff --git a/Sources/Sandbox.Game/Game/Entities/Cube/MyDisconnectHelper.cs b/Sources/Sandbox.Game/Game/Entities/Cube/MyDisconnectHelper.cs index 405d751522..85c76cdf4a 100644 --- a/Sources/Sandbox.Game/Game/Entities/Cube/MyDisconnectHelper.cs +++ b/Sources/Sandbox.Game/Game/Entities/Cube/MyDisconnectHelper.cs @@ -1,19 +1,6 @@ -using Sandbox.Common.ObjectBuilders; -using Sandbox.Game.Multiplayer; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Collections.Generic; using VRageMath; -using VRageRender; -using Sandbox.Graphics; -using Sandbox.Definitions; -using Sandbox.Game.GameSystems; -using Sandbox.Common; -using Sandbox.Engine.Utils; using VRage; -using VRage; -using Sandbox.Game.GameSystems.StructuralIntegrity; namespace Sandbox.Game.Entities.Cube { diff --git a/Sources/Sandbox.Game/Game/Entities/Cube/MyGridClipboard.cs b/Sources/Sandbox.Game/Game/Entities/Cube/MyGridClipboard.cs index 43c6aa7d51..6aba75b45d 100644 --- a/Sources/Sandbox.Game/Game/Entities/Cube/MyGridClipboard.cs +++ b/Sources/Sandbox.Game/Game/Entities/Cube/MyGridClipboard.cs @@ -1,17 +1,12 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using Havok; -using Sandbox.Common; using Sandbox.Common.ObjectBuilders; using Sandbox.Definitions; using Sandbox.Engine.Physics; using Sandbox.Engine.Utils; -using Sandbox.Game.Entities.Character; using Sandbox.Game.Gui; using Sandbox.Game.Multiplayer; -using Sandbox.Game.Weapons; using Sandbox.Game.World; using VRage.Utils; using VRageMath; @@ -20,16 +15,11 @@ using Sandbox.Graphics.GUI; using VRage; -using Sandbox.Game.Localization; -using Sandbox.Graphics; -using VRage.ObjectBuilders; using VRage.ModAPI; -using VRage.Network; using Sandbox.Engine.Multiplayer; using Sandbox.Game.GameSystems.CoordinateSystem; using VRage.Game; using VRage.Game.Entity; -using VRage.Game.Entity; namespace Sandbox.Game.Entities.Cube { diff --git a/Sources/Sandbox.Game/Game/Entities/Inventory/MyInventory.cs b/Sources/Sandbox.Game/Game/Entities/Inventory/MyInventory.cs index 3a93c68a39..483da09cec 100644 --- a/Sources/Sandbox.Game/Game/Entities/Inventory/MyInventory.cs +++ b/Sources/Sandbox.Game/Game/Entities/Inventory/MyInventory.cs @@ -1778,7 +1778,6 @@ private void AddEntityInternal(IMyEntity ientity, bool blockManipulatedEntity = { return; } - MyCubeBlock block; Vector3D? hitPosition = null; MyCharacterDetectorComponent detectorComponent = Owner.Components.Get(); diff --git a/Sources/Sandbox.Game/Game/Entities/MyEntityCycling.cs b/Sources/Sandbox.Game/Game/Entities/MyEntityCycling.cs index 7924ad0997..e9606dcd25 100644 --- a/Sources/Sandbox.Game/Game/Entities/MyEntityCycling.cs +++ b/Sources/Sandbox.Game/Game/Entities/MyEntityCycling.cs @@ -80,6 +80,19 @@ public Metric(float value, long entityId) { return !(a == b); } + + public override bool Equals(object obj) + { + if (obj is Metric) + return (this == (Metric)obj); + else + return false; + } + + public override int GetHashCode() + { + throw new InvalidOperationException("GetHashCode and Equals must be overridden"); + } } public static float GetMetric(MyEntityCyclingOrder order, MyEntity entity) diff --git a/Sources/Sandbox.Game/Game/Entities/MyHandToolBase.cs b/Sources/Sandbox.Game/Game/Entities/MyHandToolBase.cs index d6ab271848..fcf3a468f9 100644 --- a/Sources/Sandbox.Game/Game/Entities/MyHandToolBase.cs +++ b/Sources/Sandbox.Game/Game/Entities/MyHandToolBase.cs @@ -160,7 +160,7 @@ public float ShakeAmount protected set { } } - public MyDefinitionId DefinitionId + public new MyDefinitionId DefinitionId { get { return m_handItemDefinitionId; } } diff --git a/Sources/Sandbox.Game/Game/Entities/MyMeteor.cs b/Sources/Sandbox.Game/Game/Entities/MyMeteor.cs index 25a1fe3879..8ea7f0872f 100644 --- a/Sources/Sandbox.Game/Game/Entities/MyMeteor.cs +++ b/Sources/Sandbox.Game/Game/Entities/MyMeteor.cs @@ -187,7 +187,7 @@ public override MyObjectBuilder_EntityBase GetObjectBuilder(bool copy = false) public class MyMeteorGameLogic : MyEntityGameLogic { - internal MyMeteor Entity { get { return Container != null ? Container.Entity as MyMeteor : null; } } + internal new MyMeteor Entity { get { return Container != null ? Container.Entity as MyMeteor : null; } } public MyPhysicalInventoryItem Item; public MyVoxelMaterialDefinition VoxelMaterial { get; set; } diff --git a/Sources/Sandbox.Game/Game/Entities/MyVoxelPhysics.cs b/Sources/Sandbox.Game/Game/Entities/MyVoxelPhysics.cs index 62f0c8bd14..f58374560f 100644 --- a/Sources/Sandbox.Game/Game/Entities/MyVoxelPhysics.cs +++ b/Sources/Sandbox.Game/Game/Entities/MyVoxelPhysics.cs @@ -69,7 +69,7 @@ public void Init(IMyStorage storage, MatrixD worldMatrix, Vector3I storageMin, V } - public MyPlanet Parent + public new MyPlanet Parent { get { return m_parent; } } diff --git a/Sources/Sandbox.Game/Game/Entities/Planet/MyPlanetEnvironmentSector.cs b/Sources/Sandbox.Game/Game/Entities/Planet/MyPlanetEnvironmentSector.cs index 1815dcde07..2c89d62414 100644 --- a/Sources/Sandbox.Game/Game/Entities/Planet/MyPlanetEnvironmentSector.cs +++ b/Sources/Sandbox.Game/Game/Entities/Planet/MyPlanetEnvironmentSector.cs @@ -111,9 +111,9 @@ public static void Unpack64(long value, out MyPlanetSectorId id) public long Pack64() { - long value = Position.X - | ((long)Position.Y << 16) - | ((long)Position.Z << 32); + long value = ((long)Position.X & 0xFFFF) + | (((long)Position.Y & 0xFFFF) << 16) + | (((long)Position.Z & 0xFFFF) << 32); Vector3I dirv = Direction; var dir = (long)Base6Directions.GetDirection(ref dirv); @@ -1512,7 +1512,7 @@ private void UpdateSectorFrustrum() m_sectorFrustum = v; } - public void DebugDraw() + public new void DebugDraw() { if (IsClosed) return; diff --git a/Sources/Sandbox.Game/Game/EntityComponents/MyCraftingComponentBasic.cs b/Sources/Sandbox.Game/Game/EntityComponents/MyCraftingComponentBasic.cs index 9598a7ace5..38d44b036b 100644 --- a/Sources/Sandbox.Game/Game/EntityComponents/MyCraftingComponentBasic.cs +++ b/Sources/Sandbox.Game/Game/EntityComponents/MyCraftingComponentBasic.cs @@ -1,14 +1,6 @@ using VRage.Game.ObjectBuilders.ComponentSystem; using Sandbox.Definitions; -using Sandbox.Game.Entities.Character; -using Sandbox.Game.Multiplayer; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using VRage; using VRage.Game.Components; -using VRage.Game.ObjectBuilders.ComponentSystem; using VRage.Network; using Sandbox.Game.EntityComponents; using Sandbox.Game.Entities; diff --git a/Sources/Sandbox.Game/Game/EntityComponents/MyCraftingComponentBlock.cs b/Sources/Sandbox.Game/Game/EntityComponents/MyCraftingComponentBlock.cs index 422ec1403a..385ac6f9be 100644 --- a/Sources/Sandbox.Game/Game/EntityComponents/MyCraftingComponentBlock.cs +++ b/Sources/Sandbox.Game/Game/EntityComponents/MyCraftingComponentBlock.cs @@ -1,23 +1,16 @@ -using Sandbox.Common.ObjectBuilders; -using VRage.Game.ObjectBuilders.ComponentSystem; +using VRage.Game.ObjectBuilders.ComponentSystem; using Sandbox.Definitions; using Sandbox.Game.Entities; -using Sandbox.Game.Entities.Character; using Sandbox.Game.EntityComponents; -using Sandbox.Game.Localization; using Sandbox.Game.Multiplayer; using Sandbox.Game.World; using System; using System.Collections.Generic; using System.Linq; -using System.Text; using VRage; using VRage.Game; using VRage.Game.Components; -using VRage.Game.ObjectBuilders.ComponentSystem; using VRage.Network; -using VRage.ObjectBuilders; -using VRageMath; using VRage.Game.Entity; namespace Sandbox.Game.Components diff --git a/Sources/Sandbox.Game/Game/EntityComponents/MyCraftingComponentInteractive.cs b/Sources/Sandbox.Game/Game/EntityComponents/MyCraftingComponentInteractive.cs index f84f773471..c9c2a954c6 100644 --- a/Sources/Sandbox.Game/Game/EntityComponents/MyCraftingComponentInteractive.cs +++ b/Sources/Sandbox.Game/Game/EntityComponents/MyCraftingComponentInteractive.cs @@ -1,19 +1,13 @@ using VRage.Game.ObjectBuilders.ComponentSystem; using Sandbox.Definitions; -using Sandbox.Game.Entities.Character; using Sandbox.Game.Multiplayer; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using VRage; using VRage.Game.Components; -using VRage.Game.ObjectBuilders.ComponentSystem; using VRage.Network; using Sandbox.Game.EntityComponents; using Sandbox.Game.Entities; using VRage.Game.Entity; -using System.Diagnostics; using VRage.Game; using VRage.ModAPI; diff --git a/Sources/Sandbox.Game/Game/EntityComponents/MyFractureComponentBase.cs b/Sources/Sandbox.Game/Game/EntityComponents/MyFractureComponentBase.cs index 7e5fe5785e..1f4bc79a59 100644 --- a/Sources/Sandbox.Game/Game/EntityComponents/MyFractureComponentBase.cs +++ b/Sources/Sandbox.Game/Game/EntityComponents/MyFractureComponentBase.cs @@ -1,18 +1,12 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Diagnostics; -using System.Linq; -using System.Text; using Havok; using VRage.Game.ObjectBuilders.ComponentSystem; using Sandbox.Definitions; -using Sandbox.Engine.Models; using Sandbox.Engine.Physics; using Sandbox.Game.Components; -using Sandbox.Game.Entities; using VRage.Game.Components; -using VRage.Game.ObjectBuilders.ComponentSystem; using VRage.ObjectBuilders; using VRageMath; using VRage.Game.Entity; diff --git a/Sources/Sandbox.Game/Game/EntityComponents/MyFractureComponentCubeBlock.cs b/Sources/Sandbox.Game/Game/EntityComponents/MyFractureComponentCubeBlock.cs index 484b2ee50a..bda79b3f61 100644 --- a/Sources/Sandbox.Game/Game/EntityComponents/MyFractureComponentCubeBlock.cs +++ b/Sources/Sandbox.Game/Game/EntityComponents/MyFractureComponentCubeBlock.cs @@ -2,13 +2,10 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; -using System.Text; using Havok; using VRage.Game.ObjectBuilders.ComponentSystem; using Sandbox.Definitions; -using Sandbox.Engine.Models; -using Sandbox.Engine.Physics; using Sandbox.Engine.Utils; using Sandbox.Game.Components; using Sandbox.Game.Entities; @@ -16,7 +13,6 @@ using Sandbox.Game.Multiplayer; using VRage; using VRage.Game.Components; -using VRage.Game.ObjectBuilders.ComponentSystem; using VRageMath; namespace Sandbox.Game.EntityComponents diff --git a/Sources/Sandbox.Game/Game/EntityComponents/MyResourceDistributorComponent.cs b/Sources/Sandbox.Game/Game/EntityComponents/MyResourceDistributorComponent.cs index 7fcafed812..8e13dec4e4 100644 --- a/Sources/Sandbox.Game/Game/EntityComponents/MyResourceDistributorComponent.cs +++ b/Sources/Sandbox.Game/Game/EntityComponents/MyResourceDistributorComponent.cs @@ -1147,8 +1147,6 @@ private void RecomputeResourceDistribution(ref MyDefinitionId typeId, bool updat RecreatePhysicalDistributionGroups(ref typeId, m_dataPerType[typeIndex].SinksByPriority, m_dataPerType[typeIndex].SourcesByPriority, m_dataPerType[typeIndex].InputOutputList); } - MyResourceStateEnum totalState = MyResourceStateEnum.Ok; - int powerOutCounter = 0; for (int groupIndex = 0; groupIndex < m_dataPerType[typeIndex].DistributionGroupsInUse; ++groupIndex) { MyPhysicalDistributionGroup group = m_dataPerType[typeIndex].DistributionGroups[groupIndex]; diff --git a/Sources/Sandbox.Game/Game/EntityComponents/Renders/MyRenderComponentCubeGrid.cs b/Sources/Sandbox.Game/Game/EntityComponents/Renders/MyRenderComponentCubeGrid.cs index 8be76916eb..ba4a8b62c1 100644 --- a/Sources/Sandbox.Game/Game/EntityComponents/Renders/MyRenderComponentCubeGrid.cs +++ b/Sources/Sandbox.Game/Game/EntityComponents/Renders/MyRenderComponentCubeGrid.cs @@ -148,7 +148,6 @@ public override void OnBeforeRemovedFromContainer() void DrawTrashAdminView() { - float metric; var state = MyTrashRemoval.GetTrashState(m_grid, MyTrashRemoval.PreviewSettings); var color = Color.Green; var aabb = m_grid.PositionComp.WorldAABB; diff --git a/Sources/Sandbox.Game/Game/GUI/DebugInputComponents/MyComponentsDebugInputComponent.cs b/Sources/Sandbox.Game/Game/GUI/DebugInputComponents/MyComponentsDebugInputComponent.cs index a066a1273b..22e4c23d55 100644 --- a/Sources/Sandbox.Game/Game/GUI/DebugInputComponents/MyComponentsDebugInputComponent.cs +++ b/Sources/Sandbox.Game/Game/GUI/DebugInputComponents/MyComponentsDebugInputComponent.cs @@ -205,7 +205,7 @@ class MyGuiScreenSpawnEntity : MyGuiScreenBase MyGuiControlButton m_cancelButton; MyGuiControlListbox m_addComponentsListBox; MyGuiControlCheckbox m_replicableEntityCheckBox; - Vector3 m_position; + new Vector3 m_position; public MyGuiScreenSpawnEntity(Vector3 position) : base(new Vector2(0.5f, 0.5f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, null) @@ -338,7 +338,7 @@ class MyGuiScreenSpawnDefinedEntity : MyGuiScreenBase MyGuiControlButton m_cancelButton; MyGuiControlListbox m_containersListBox; MyGuiControlCheckbox m_replicableEntityCheckBox; - Vector3 m_position; + new Vector3 m_position; public MyGuiScreenSpawnDefinedEntity(Vector3 position) : base(new Vector2(0.5f, 0.5f), MyGuiConstants.SCREEN_BACKGROUND_COLOR, null) diff --git a/Sources/Sandbox.Game/Game/GUI/DebugInputComponents/MyMartinDebugInputComponent.cs b/Sources/Sandbox.Game/Game/GUI/DebugInputComponents/MyMartinDebugInputComponent.cs index a99293227d..202ee66805 100644 --- a/Sources/Sandbox.Game/Game/GUI/DebugInputComponents/MyMartinDebugInputComponent.cs +++ b/Sources/Sandbox.Game/Game/GUI/DebugInputComponents/MyMartinDebugInputComponent.cs @@ -309,8 +309,6 @@ public override string GetName() public override bool HandleInput() { - bool handled = false; - if (MySession.Static == null) return false;// game isn't loaded yet @@ -325,6 +323,8 @@ public override bool HandleInput() // All of my keypresses require M to be pressed as well. #if false + bool handled = false; + if (!MyInput.Static.IsKeyPress(MyKeys.M)) return handled; diff --git a/Sources/Sandbox.Game/Game/GUI/DebugInputComponents/MyOndraDebugIntegrity2.cs b/Sources/Sandbox.Game/Game/GUI/DebugInputComponents/MyOndraDebugIntegrity2.cs index 449f4da729..00d99bb0c5 100644 --- a/Sources/Sandbox.Game/Game/GUI/DebugInputComponents/MyOndraDebugIntegrity2.cs +++ b/Sources/Sandbox.Game/Game/GUI/DebugInputComponents/MyOndraDebugIntegrity2.cs @@ -1,18 +1,4 @@ -using Sandbox.Common; -using Sandbox.Game.Entities; -using Sandbox.Game.World; -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using VRage; -using VRage; -using VRage.Utils; -using VRageMath; -using VRageRender; - -namespace Sandbox.Game.GUI.DebugInputComponents +namespace Sandbox.Game.GUI.DebugInputComponents { public class MyOndraDebugIntegrity2 { diff --git a/Sources/Sandbox.Game/Game/GUI/DebugInputComponents/MyRenderDebugInputComponent.cs b/Sources/Sandbox.Game/Game/GUI/DebugInputComponents/MyRenderDebugInputComponent.cs index 6c37026cec..482aa91998 100644 --- a/Sources/Sandbox.Game/Game/GUI/DebugInputComponents/MyRenderDebugInputComponent.cs +++ b/Sources/Sandbox.Game/Game/GUI/DebugInputComponents/MyRenderDebugInputComponent.cs @@ -59,7 +59,7 @@ public override void Draw() { OnDraw(); } - catch (Exception e) + catch (Exception) { OnDraw = null; } diff --git a/Sources/Sandbox.Game/Game/GUI/GuiSandbox/MyDX9Gui.cs b/Sources/Sandbox.Game/Game/GUI/GuiSandbox/MyDX9Gui.cs index 79a267c69f..5c6f952720 100644 --- a/Sources/Sandbox.Game/Game/GUI/GuiSandbox/MyDX9Gui.cs +++ b/Sources/Sandbox.Game/Game/GUI/GuiSandbox/MyDX9Gui.cs @@ -1,8 +1,6 @@ #region Using using Sandbox.Common; -using Sandbox.Common.ObjectBuilders; -using Sandbox.Definitions; using Sandbox.Engine.Networking; using Sandbox.Engine.Platform.VideoMode; using Sandbox.Engine.Utils; @@ -16,13 +14,10 @@ using System; using System.Collections.Generic; using System.Diagnostics; -using System.IO; using System.Runtime.InteropServices; -using System.Runtime.Serialization.Formatters.Binary; using System.Text; using Sandbox.Game.GUI.DebugInputComponents; using VRage; -using VRage; using VRage.Audio; using VRage.Input; using VRage.Utils; diff --git a/Sources/Sandbox.Game/Game/GUI/MyGuiBlueprintScreen.cs b/Sources/Sandbox.Game/Game/GUI/MyGuiBlueprintScreen.cs index 00ea30101e..4c23185c9b 100644 --- a/Sources/Sandbox.Game/Game/GUI/MyGuiBlueprintScreen.cs +++ b/Sources/Sandbox.Game/Game/GUI/MyGuiBlueprintScreen.cs @@ -1,13 +1,9 @@ #region Using using ParallelTasks; -using Sandbox.Common.ObjectBuilders; -using Sandbox.Common.ObjectBuilders.Definitions; -using Sandbox.Definitions; using Sandbox.Engine.Networking; using Sandbox.Game.Entities; using Sandbox.Game.Entities.Cube; -using Sandbox.Game.Localization; using Sandbox.Game.Multiplayer; using Sandbox.Game.World; using Sandbox.Graphics; @@ -19,13 +15,11 @@ using System.Linq; using System.Text; -using VRage; using VRage; using VRage.Input; using VRage.Utils; using VRage.Compression; using VRageMath; -using VRage.Library.Utils; using VRage.FileSystem; using Sandbox.Engine.Utils; using VRage.ObjectBuilders; @@ -338,10 +332,10 @@ bool ValidateModInfo(MyObjectBuilder_ModInfo info) return false; if (info.SubtypeName == null) return false; - if (info.WorkshopId == null) - return false; - if (info.SteamIDOwner == null) - return false; + //if (info.WorkshopId == null) + // return false; + //if (info.SteamIDOwner == null) + // return false; return true; } diff --git a/Sources/Sandbox.Game/Game/GUI/MyGuiDetailScreen.cs b/Sources/Sandbox.Game/Game/GUI/MyGuiDetailScreen.cs index 6b4fa8b7af..f03eabdd80 100644 --- a/Sources/Sandbox.Game/Game/GUI/MyGuiDetailScreen.cs +++ b/Sources/Sandbox.Game/Game/GUI/MyGuiDetailScreen.cs @@ -1,36 +1,17 @@ #region Using -using Sandbox.Common; -using Sandbox.Common.ObjectBuilders; -using Sandbox.Common.ObjectBuilders.Definitions; -using Sandbox.Definitions; using Sandbox.Engine.Utils; -using Sandbox.Game.Entities; -using Sandbox.Game.Entities.Cube; -using Sandbox.Graphics; using Sandbox.Graphics.GUI; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Text; -using System.Threading; using VRage; using VRage.Utils; using VRageMath; -using Sandbox.Game.GUI; -using System.Drawing; -using Sandbox.Engine.Networking; -using Sandbox.Engine.Platform.VideoMode; -using SteamSDK; using Sandbox.Game.Multiplayer; using System.Diagnostics; -using VRage; -using Sandbox.Game.Localization; using VRage.Game; -using VRage.Utils; -using VRage.Library.Utils; using Sandbox.Engine.Multiplayer; using Sandbox.Game.World; #endregion @@ -557,7 +538,7 @@ void ChangeName(string name) { Directory.Move(file, newFile); } - catch (System.IO.IOException ex) + catch (System.IO.IOException) { MyGuiSandbox.AddScreen(MyGuiSandbox.CreateMessageBox( diff --git a/Sources/Sandbox.Game/Game/GUI/MyGuiIngameScriptsPage.cs b/Sources/Sandbox.Game/Game/GUI/MyGuiIngameScriptsPage.cs index 9618f760da..5b1e2ecee3 100644 --- a/Sources/Sandbox.Game/Game/GUI/MyGuiIngameScriptsPage.cs +++ b/Sources/Sandbox.Game/Game/GUI/MyGuiIngameScriptsPage.cs @@ -1,7 +1,6 @@  using ParallelTasks; using Sandbox.Engine.Networking; -using Sandbox.Engine.Utils; using Sandbox.Game.Localization; using Sandbox.Graphics; using Sandbox.Graphics.GUI; @@ -11,11 +10,9 @@ using System.IO; using System.Text; using VRage; -using VRage; using VRage.FileSystem; using VRage.Game; using VRage.Input; -using VRage.Library.Utils; using VRage.Utils; using VRageMath; diff --git a/Sources/Sandbox.Game/Game/GUI/MyHudCharacterInfo.cs b/Sources/Sandbox.Game/Game/GUI/MyHudCharacterInfo.cs index 42899fe404..933aa7b7f6 100644 --- a/Sources/Sandbox.Game/Game/GUI/MyHudCharacterInfo.cs +++ b/Sources/Sandbox.Game/Game/GUI/MyHudCharacterInfo.cs @@ -1,16 +1,13 @@ #region Using -using Sandbox.Common; using Sandbox.Game.Localization; using Sandbox.Game.World; using System; -using System.Collections.Generic; using System.Diagnostics; using System.Text; using Sandbox.Engine.Utils; using Sandbox.Game.Entities.Character.Components; using VRage; -using VRage; using VRage.Game; #endregion diff --git a/Sources/Sandbox.Game/Game/GUI/MyHudNotification.cs b/Sources/Sandbox.Game/Game/GUI/MyHudNotification.cs index e20c1b8234..03c4206626 100644 --- a/Sources/Sandbox.Game/Game/GUI/MyHudNotification.cs +++ b/Sources/Sandbox.Game/Game/GUI/MyHudNotification.cs @@ -1,20 +1,8 @@ using System; -using System.Text; -using System.Collections.Generic; -using System.Diagnostics; -using Sandbox.Engine.Utils; -using Sandbox.Graphics.GUI; - -using Sandbox.Common; -using Sandbox.ModAPI; using VRage; using Sandbox.Definitions; -using Sandbox.Graphics; using VRage.Utils; -using VRage; using VRage.Game; -using VRage.Utils; -using VRage.Library.Utils; namespace Sandbox.Game.Gui { diff --git a/Sources/Sandbox.Game/Game/GUI/MyHudSinkGroupInfo.cs b/Sources/Sandbox.Game/Game/GUI/MyHudSinkGroupInfo.cs index ee66abd95e..feb93579f3 100644 --- a/Sources/Sandbox.Game/Game/GUI/MyHudSinkGroupInfo.cs +++ b/Sources/Sandbox.Game/Game/GUI/MyHudSinkGroupInfo.cs @@ -1,15 +1,10 @@ #region Using -using System.Collections.Generic; -using Sandbox.Common; -using Sandbox.Game.GameSystems.Electricity; using Sandbox.Game.Localization; using System.Text; using Sandbox.Definitions; using Sandbox.Game.EntityComponents; using VRage; -using VRage.Library.Utils; -using VRage.Utils; using VRage.Utils; using System.Diagnostics; using VRage.Game; diff --git a/Sources/Sandbox.Game/Game/GUI/MyHudWarning.cs b/Sources/Sandbox.Game/Game/GUI/MyHudWarning.cs index 8098883c67..9a66469bd4 100644 --- a/Sources/Sandbox.Game/Game/GUI/MyHudWarning.cs +++ b/Sources/Sandbox.Game/Game/GUI/MyHudWarning.cs @@ -1,26 +1,16 @@ -using Sandbox; -using Sandbox.Common; -using Sandbox.Engine.Utils; -using Sandbox.Game.Components; +using Sandbox.Game.Components; using Sandbox.Game.Entities; using Sandbox.Game.Entities.Character; -using Sandbox.Game.Gui; using Sandbox.Game.GUI; using Sandbox.Game.Localization; using Sandbox.Game.World; using System; -using System.Collections; using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; using Sandbox.Game.EntityComponents; using Sandbox.Game.GameSystems.Electricity; using VRage; using VRage.Audio; using VRage.Game; -using VRage.Library.Utils; -using VRage.Utils; using VRage.Utils; using VRageMath; using VRage.Game.Components; diff --git a/Sources/Sandbox.Game/Game/GameSystems/MyHeightMapLoadingSystem.cs b/Sources/Sandbox.Game/Game/GameSystems/MyHeightMapLoadingSystem.cs index c1b60a5075..c4efc650a7 100644 --- a/Sources/Sandbox.Game/Game/GameSystems/MyHeightMapLoadingSystem.cs +++ b/Sources/Sandbox.Game/Game/GameSystems/MyHeightMapLoadingSystem.cs @@ -481,7 +481,7 @@ private Image TryGetPlanetTexture(string name, MyModContext context, string p, o { return SharpDXImage.Load(sbm.GetFile(fileRelativeArchivePath).GetStream()); } - catch (Exception ex) + catch (Exception) { MyDebug.FailRelease("Failed to load existing " + p + " file from .sbm archive. " + fullPath); return null; diff --git a/Sources/Sandbox.Game/Game/Localization/MyLanguage.cs b/Sources/Sandbox.Game/Game/Localization/MyLanguage.cs index 5e25e3ba3a..91edfbafee 100644 --- a/Sources/Sandbox.Game/Game/Localization/MyLanguage.cs +++ b/Sources/Sandbox.Game/Game/Localization/MyLanguage.cs @@ -5,8 +5,6 @@ using VRage.Collections; using VRage; using VRage.Utils; -using VRage.Utils; -using VRage.Library.Utils; using VRage.FileSystem; namespace Sandbox.Game.Localization diff --git a/Sources/Sandbox.Game/Game/MyGuiDetailScreenScript.cs b/Sources/Sandbox.Game/Game/MyGuiDetailScreenScript.cs index a2d61a984f..2f8ceb18d3 100644 --- a/Sources/Sandbox.Game/Game/MyGuiDetailScreenScript.cs +++ b/Sources/Sandbox.Game/Game/MyGuiDetailScreenScript.cs @@ -1,24 +1,15 @@ - -using Sandbox.Common.ObjectBuilders; -using Sandbox.Engine.Networking; -using Sandbox.Engine.Utils; +using Sandbox.Engine.Networking; using Sandbox.Game.Localization; using Sandbox.Game.Multiplayer; using Sandbox.Graphics.GUI; using SteamSDK; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using VRage; using VRage; using VRage.FileSystem; using VRage.Game; -using VRage.Library.Utils; using VRage.ObjectBuilders; using VRage.Utils; -using VRage.Utils; using VRageMath; namespace Sandbox.Game.Gui diff --git a/Sources/Sandbox.Game/Game/ParticleEffects/MyParticleEffects.cs b/Sources/Sandbox.Game/Game/ParticleEffects/MyParticleEffects.cs index fa14332506..31b3702bd2 100644 --- a/Sources/Sandbox.Game/Game/ParticleEffects/MyParticleEffects.cs +++ b/Sources/Sandbox.Game/Game/ParticleEffects/MyParticleEffects.cs @@ -73,7 +73,7 @@ public EffectSoundEmitter(uint id, Vector3 position, MySoundPair sound) private static short UpdateCount = 0; public static void UpdateEffects() { - int i, j; + int i; bool newSound; UpdateCount++; diff --git a/Sources/Sandbox.Game/Game/Screens/DebugScreens/MyGuiScreenDebugHandItemBase.cs b/Sources/Sandbox.Game/Game/Screens/DebugScreens/MyGuiScreenDebugHandItemBase.cs index 3ebd5ed416..361866f91e 100644 --- a/Sources/Sandbox.Game/Game/Screens/DebugScreens/MyGuiScreenDebugHandItemBase.cs +++ b/Sources/Sandbox.Game/Game/Screens/DebugScreens/MyGuiScreenDebugHandItemBase.cs @@ -113,7 +113,7 @@ protected void SelectFirstHandItem() } - catch (Exception e) + catch (Exception) { m_handItemsCombo.SelectItemByIndex(0); } diff --git a/Sources/Sandbox.Game/Game/Screens/DebugScreens/MyGuiScreenDebugOfficial.cs b/Sources/Sandbox.Game/Game/Screens/DebugScreens/MyGuiScreenDebugOfficial.cs index c135961459..71b3b95648 100644 --- a/Sources/Sandbox.Game/Game/Screens/DebugScreens/MyGuiScreenDebugOfficial.cs +++ b/Sources/Sandbox.Game/Game/Screens/DebugScreens/MyGuiScreenDebugOfficial.cs @@ -1,8 +1,5 @@ -using Sandbox.Common; -using Sandbox.Definitions; -using Sandbox.Engine.Utils; +using Sandbox.Engine.Utils; using Sandbox.Game.Entities; -using Sandbox.Game.Localization; using Sandbox.Graphics; using Sandbox.Graphics.GUI; using System; @@ -12,12 +9,9 @@ using System.Text; using System.Threading; using VRage; -using VRage; using VRage.FileSystem; using VRage.Game; using VRage.Input; -using VRage.Library.Utils; -using VRage.Utils; using VRage.Utils; using VRageMath; diff --git a/Sources/Sandbox.Game/Game/Screens/Helpers/MyGuiControlComponentList.cs b/Sources/Sandbox.Game/Game/Screens/Helpers/MyGuiControlComponentList.cs index 0c47c2fd0c..5fe4204206 100644 --- a/Sources/Sandbox.Game/Game/Screens/Helpers/MyGuiControlComponentList.cs +++ b/Sources/Sandbox.Game/Game/Screens/Helpers/MyGuiControlComponentList.cs @@ -1,19 +1,9 @@ -using Sandbox.Common; - -using Sandbox.Common.ObjectBuilders.Definitions; -using Sandbox.Definitions; +using Sandbox.Definitions; using Sandbox.Graphics.GUI; -using Sandbox.Engine.Utils; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; using System.Text; using VRage; using VRageMath; using System.Globalization; -using Sandbox.Graphics; -using VRage; using VRage.Game; using VRage.Utils; diff --git a/Sources/Sandbox.Game/Game/Screens/Helpers/MyGuiControlInventoryOwner.cs b/Sources/Sandbox.Game/Game/Screens/Helpers/MyGuiControlInventoryOwner.cs index 6c783d08f0..f5aa03323b 100644 --- a/Sources/Sandbox.Game/Game/Screens/Helpers/MyGuiControlInventoryOwner.cs +++ b/Sources/Sandbox.Game/Game/Screens/Helpers/MyGuiControlInventoryOwner.cs @@ -1,28 +1,17 @@ using System; using System.Collections.Generic; using System.Globalization; -using System.Linq; using System.Text; -using System.Threading.Tasks; -using Sandbox.Common; - -using Sandbox.Common.ObjectBuilders; using Sandbox.Common.ObjectBuilders.Definitions; using Sandbox.Definitions; using Sandbox.Engine.Utils; -using Sandbox.Game; using VRageMath; using System.Diagnostics; -using Sandbox.Game.Gui; using VRage; using Sandbox.Graphics.GUI; using Sandbox.Game.World; using VRage.Utils; -using VRage; using Sandbox.Game.Localization; -using VRage.Utils; -using VRage.Library.Utils; -using Sandbox.ModAPI.Interfaces; using Sandbox.Game.Entities; using VRage.Game; using VRage.Game.Entity; diff --git a/Sources/Sandbox.Game/Game/Screens/Helpers/MyGuiControlOnOffSwitch.cs b/Sources/Sandbox.Game/Game/Screens/Helpers/MyGuiControlOnOffSwitch.cs index ddb8d5d55c..72429c3ab7 100644 --- a/Sources/Sandbox.Game/Game/Screens/Helpers/MyGuiControlOnOffSwitch.cs +++ b/Sources/Sandbox.Game/Game/Screens/Helpers/MyGuiControlOnOffSwitch.cs @@ -1,10 +1,8 @@ -using Sandbox.Common; -using Sandbox.Game.Localization; +using Sandbox.Game.Localization; using Sandbox.Graphics.GUI; using System; using System.Diagnostics; using VRage; -using VRage; using VRage.Game; using VRage.Input; using VRage.Utils; diff --git a/Sources/Sandbox.Game/Game/Screens/Helpers/MyToolbarComponent.cs b/Sources/Sandbox.Game/Game/Screens/Helpers/MyToolbarComponent.cs index f03fc87352..45bee34181 100644 --- a/Sources/Sandbox.Game/Game/Screens/Helpers/MyToolbarComponent.cs +++ b/Sources/Sandbox.Game/Game/Screens/Helpers/MyToolbarComponent.cs @@ -1,6 +1,4 @@ -using Sandbox.Common; -using Sandbox.Common.ObjectBuilders; -using Sandbox.Engine.Utils; +using Sandbox.Engine.Utils; using Sandbox.Game.Entities; using Sandbox.Game.Gui; using Sandbox.Game.GUI; @@ -13,8 +11,6 @@ using VRage.Game; using VRage.Game.Components; using VRage.Input; -using VRage.Library.Utils; -using VRage.Utils; using VRage.Utils; namespace Sandbox.Game.Screens.Helpers diff --git a/Sources/Sandbox.Game/Game/Screens/Helpers/MyToolbarItemDefinition.cs b/Sources/Sandbox.Game/Game/Screens/Helpers/MyToolbarItemDefinition.cs index a2452f5a98..56695411fd 100644 --- a/Sources/Sandbox.Game/Game/Screens/Helpers/MyToolbarItemDefinition.cs +++ b/Sources/Sandbox.Game/Game/Screens/Helpers/MyToolbarItemDefinition.cs @@ -26,7 +26,10 @@ public override bool Equals(object obj) return true; var otherObj = obj as MyToolbarItemDefinition; - return otherObj != null && Definition != null && Definition.Id.Equals(otherObj.Definition.Id); + if (otherObj != null && Definition != null && Definition.Id.Equals(otherObj.Definition.Id)) + return ((obj != null) && (obj.GetType() == this.GetType())); + else + return false; } public sealed override int GetHashCode() diff --git a/Sources/Sandbox.Game/Game/Screens/Helpers/MyToolbarItemWeapon.cs b/Sources/Sandbox.Game/Game/Screens/Helpers/MyToolbarItemWeapon.cs index b72318a263..bc26fd928b 100644 --- a/Sources/Sandbox.Game/Game/Screens/Helpers/MyToolbarItemWeapon.cs +++ b/Sources/Sandbox.Game/Game/Screens/Helpers/MyToolbarItemWeapon.cs @@ -44,18 +44,18 @@ public override bool Init(MyObjectBuilder_ToolbarItem data) return init; } - public override bool Equals(object obj) - { - bool returnValue = base.Equals(obj); - - if (returnValue) - { - var otherObj = obj as MyToolbarItemWeapon; - if (otherObj == null) - returnValue = false; - } - return returnValue; - } + //public override bool Equals(object obj) + //{ + // bool returnValue = base.Equals(obj); + + // if (returnValue) + // { + // var otherObj = obj as MyToolbarItemWeapon; + // if (otherObj == null) + // returnValue = false; + // } + // return returnValue; + //} public override MyObjectBuilder_ToolbarItem GetObjectBuilder() { diff --git a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenAdminMenu.cs b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenAdminMenu.cs index f39279d0ee..ce46c61f4e 100644 --- a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenAdminMenu.cs +++ b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenAdminMenu.cs @@ -386,7 +386,7 @@ public override bool Update(bool hasFocus) void OnEntityRemoveClicked(MyTrashRemovalOperation operation) { - if (m_attachCamera != null) + //if (m_attachCamera != null) { MyMultiplayer.RaiseStaticEvent(x => RemoveEntity_Implementation, m_attachCamera, operation); } diff --git a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenEditor.cs b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenEditor.cs index d8302d2d23..8a6aca9545 100644 --- a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenEditor.cs +++ b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenEditor.cs @@ -1,23 +1,14 @@ -using Sandbox.Common; -using Sandbox.Graphics.GUI; -using Sandbox.ModAPI; +using Sandbox.Graphics.GUI; using System; using System.Collections.Generic; using System.IO; -using System.Linq; using System.Reflection; -using System.Text; using System.Text.RegularExpressions; using VRage; using VRage.Utils; using VRage.Compiler; using VRageMath; - -using Sandbox.Engine.Networking; -using Sandbox.Engine.Utils; -using VRage; using Sandbox.Game.Localization; -using VRage.Library.Utils; using VRage.FileSystem; using Sandbox.Game.Screens; using VRage.Game; @@ -217,7 +208,7 @@ string FormatError(string error) return error; } } - catch (Exception e) { };//unknown error format + catch (Exception){ };//unknown error format return error; } diff --git a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenJoinGame.Lobbies.cs b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenJoinGame.Lobbies.cs index 81c97c8dd6..010f7b2ad7 100644 --- a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenJoinGame.Lobbies.cs +++ b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenJoinGame.Lobbies.cs @@ -3,26 +3,16 @@ using System; using System.Collections.Generic; using System.Text; -using System.Threading; using ParallelTasks; -using Sandbox.Common; using Sandbox.Graphics.GUI; using Sandbox.Engine.Networking; using Sandbox.Engine.Utils; using SteamSDK; - -using VRageMath; -using Sandbox.Common.ObjectBuilders; -using Sandbox.Game.World; using Sandbox.Engine.Multiplayer; using VRage; using VRage.Utils; using System.Diagnostics; -using Sandbox.Game.Screens.Helpers; -using VRage.Utils; -using Sandbox.Game.Multiplayer; using Sandbox.Game.Localization; -using VRage; using VRage.Game; using VRage.Library.Utils; diff --git a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenJoinGame.Servers.cs b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenJoinGame.Servers.cs index 177c978283..27bc44f622 100644 --- a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenJoinGame.Servers.cs +++ b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenJoinGame.Servers.cs @@ -1,6 +1,5 @@ #region Using -using Sandbox.Common; using Sandbox.Engine.Multiplayer; using Sandbox.Engine.Networking; using Sandbox.Engine.Utils; @@ -12,7 +11,6 @@ using System.Net; using System.Text; using VRage; -using VRage; using VRage.Input; using VRage.Utils; using System.Globalization; diff --git a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenJoinGame.cs b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenJoinGame.cs index ff7895caf1..32c7db0d84 100644 --- a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenJoinGame.cs +++ b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenJoinGame.cs @@ -1,30 +1,15 @@ #region Using using System; -using System.Collections.Generic; using System.Text; -using System.Threading; -using ParallelTasks; -using Sandbox.Common; using Sandbox.Graphics.GUI; -using Sandbox.Engine.Networking; using Sandbox.Engine.Utils; using SteamSDK; using VRageMath; -using Sandbox.Common.ObjectBuilders; -using Sandbox.Game.World; -using Sandbox.Engine.Multiplayer; using VRage; using VRage.Utils; -using System.Diagnostics; -using Sandbox.Game.Screens.Helpers; -using VRage.Utils; -using Sandbox.Game.Multiplayer; using System.IO; -using Sandbox.Game.Localization; -using VRage; -using VRage.Library.Utils; using VRage.FileSystem; using VRage.Game; using VRage.ObjectBuilders; diff --git a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenLoadSubscribedWorld.cs b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenLoadSubscribedWorld.cs index 5c981a253d..66d24bdd48 100644 --- a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenLoadSubscribedWorld.cs +++ b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenLoadSubscribedWorld.cs @@ -1,21 +1,14 @@ using System; using System.Collections.Generic; using System.Text; -using System.Threading; using ParallelTasks; -using Sandbox.Common; using Sandbox.Graphics.GUI; using Sandbox.Engine.Networking; -using Sandbox.Engine.Utils; using VRage; using VRageMath; using VRage.Utils; -using Sandbox.Game.Localization; -using VRage; using VRage.Game; -using VRage.Utils; -using VRage.Library.Utils; using System.IO; namespace Sandbox.Game.Gui diff --git a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenMainMenu.cs b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenMainMenu.cs index b90b7d02f0..4abe53619f 100644 --- a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenMainMenu.cs +++ b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenMainMenu.cs @@ -1,7 +1,6 @@ #region Using using ParallelTasks; -using Sandbox.Common; using Sandbox.Engine.Multiplayer; using Sandbox.Engine.Networking; using Sandbox.Engine.Utils; @@ -20,13 +19,10 @@ using System.Text; using System.Xml.Serialization; using VRage; -using VRage; using VRage.Audio; using VRage.Game; using VRage.Game.News; using VRage.Input; -using VRage.Library.Utils; -using VRage.Utils; using VRage.Utils; using VRageMath; diff --git a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenMods.cs b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenMods.cs index c478ba6b53..a1feec52f1 100644 --- a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenMods.cs +++ b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenMods.cs @@ -1,8 +1,6 @@ using ParallelTasks; -using Sandbox.Common.ObjectBuilders; using Sandbox.Engine.Networking; using Sandbox.Engine.Utils; -using Sandbox.Game.Localization; using Sandbox.Graphics.GUI; using SteamSDK; using System; @@ -12,12 +10,9 @@ using System.Text; using VRage; using VRage.Collections; -using VRage; using VRage.Input; using VRage.Utils; -using VRage.Utils; using VRageMath; -using VRage.Library.Utils; using MyFileSystem = VRage.FileSystem.MyFileSystem; using Sandbox.Game.Multiplayer; using VRage.Game; diff --git a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenOptionsAudio.cs b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenOptionsAudio.cs index b7b0f97fc7..b02dc90313 100644 --- a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenOptionsAudio.cs +++ b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenOptionsAudio.cs @@ -1,15 +1,7 @@ -using System.Text; -using VRageMath; -using Sandbox; - -using Sandbox.Engine.Utils; +using VRageMath; using Sandbox.Graphics.GUI; - -using Sandbox.Common; using VRage; using Sandbox.Game.GUI; -using Sandbox.Game.Localization; -using VRage; using VRage.Audio; using VRage.Utils; diff --git a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenOptionsGame.cs b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenOptionsGame.cs index f0bd996786..bb290bafe4 100644 --- a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenOptionsGame.cs +++ b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenOptionsGame.cs @@ -1,14 +1,12 @@ using Sandbox.Engine.Utils; using Sandbox.Game.Entities; using Sandbox.Game.Localization; -using Sandbox.Game.Screens; using Sandbox.Graphics.GUI; using System.Text; using VRage; using VRage.Library.Utils; using VRage.Utils; using VRageMath; -using Sandbox.Engine.Utils; using VRage.Game; namespace Sandbox.Game.Gui diff --git a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenToolbarConfigBase.cs b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenToolbarConfigBase.cs index 5dfff1e6c7..38d3a3a998 100644 --- a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenToolbarConfigBase.cs +++ b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenToolbarConfigBase.cs @@ -1,12 +1,10 @@ #region Using using Sandbox.Common.ObjectBuilders; -using Sandbox.Common.ObjectBuilders.Definitions; using Sandbox.Definitions; using Sandbox.Engine.Utils; using Sandbox.Game.Entities; using Sandbox.Game.Entities.Character; -using Sandbox.Game.Entities.Cube; using Sandbox.Game.GameSystems; using Sandbox.Game.GUI; using Sandbox.Game.Localization; @@ -22,14 +20,11 @@ using System.Text; using Sandbox.Engine.Networking; using VRage; -using VRage; using VRage.Collections; using VRage.FileSystem; using VRage.Game; -using VRage.Game.Definitions; using VRage.Game.Definitions.Animation; using VRage.Input; -using VRage.Library.Utils; using VRage.ObjectBuilders; using VRage.Utils; using VRageMath; diff --git a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenWardrobe.cs b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenWardrobe.cs index 5eb4c04a91..0285312f36 100644 --- a/Sources/Sandbox.Game/Game/Screens/MyGuiScreenWardrobe.cs +++ b/Sources/Sandbox.Game/Game/Screens/MyGuiScreenWardrobe.cs @@ -1,9 +1,6 @@ - -using Sandbox.Common.ObjectBuilders; -using Sandbox.Definitions; +using Sandbox.Definitions; using Sandbox.Game.Entities.Character; using Sandbox.Game.Gui; -using Sandbox.Game.Localization; using Sandbox.Game.Multiplayer; using Sandbox.Game.World; using Sandbox.Graphics; @@ -13,11 +10,8 @@ using System.Linq; using System.Text; using VRage; -using VRage; using VRage.Game; using VRage.Input; -using VRage.Library.Utils; -using VRage.Utils; using VRage.Utils; using VRageMath; diff --git a/Sources/Sandbox.Game/Game/Screens/Terminal/MyTerminalGpsController.cs b/Sources/Sandbox.Game/Game/Screens/Terminal/MyTerminalGpsController.cs index 5f7c9c4725..0b475024b9 100644 --- a/Sources/Sandbox.Game/Game/Screens/Terminal/MyTerminalGpsController.cs +++ b/Sources/Sandbox.Game/Game/Screens/Terminal/MyTerminalGpsController.cs @@ -1,23 +1,14 @@ -using Sandbox.ModAPI; -using Sandbox.Common; - -using Sandbox.Game.Multiplayer; -using Sandbox.Game.World; +using Sandbox.Game.World; using Sandbox.Graphics.GUI; using System; using System.Collections.Generic; -using System.Linq; using System.Text; using VRageMath; using Sandbox.Game.Screens.Helpers; using VRage; -using Sandbox.Engine.Networking; -using PlayerId = Sandbox.Game.World.MyPlayer.PlayerId; using System.Threading; -using System.Text.RegularExpressions; using Sandbox.Game.Localization; -using VRage; namespace Sandbox.Game.Gui { diff --git a/Sources/Sandbox.Game/Game/Screens/Terminal/MyTerminalProductionController.cs b/Sources/Sandbox.Game/Game/Screens/Terminal/MyTerminalProductionController.cs index 1f7753cb0c..8c8815a9ab 100644 --- a/Sources/Sandbox.Game/Game/Screens/Terminal/MyTerminalProductionController.cs +++ b/Sources/Sandbox.Game/Game/Screens/Terminal/MyTerminalProductionController.cs @@ -1,6 +1,4 @@ -using Sandbox.Common; -using Sandbox.Common.ObjectBuilders; -using Sandbox.Definitions; +using Sandbox.Definitions; using Sandbox.Engine.Utils; using Sandbox.Game.Entities; using Sandbox.Game.Entities.Cube; @@ -14,12 +12,9 @@ using System.Diagnostics; using System.Text; using VRage; -using VRage; using VRage.Game; using VRage.Game.Entity; using VRage.Input; -using VRage.Library.Utils; -using VRage.Utils; using VRage.Utils; using VRageMath; diff --git a/Sources/Sandbox.Game/Game/SessionComponents/MySessionComponentMissionTriggers.cs b/Sources/Sandbox.Game/Game/SessionComponents/MySessionComponentMissionTriggers.cs index 5008a7bbfa..5283afb5e7 100644 --- a/Sources/Sandbox.Game/Game/SessionComponents/MySessionComponentMissionTriggers.cs +++ b/Sources/Sandbox.Game/Game/SessionComponents/MySessionComponentMissionTriggers.cs @@ -238,7 +238,7 @@ public void Load(MyObjectBuilder_SessionComponentMission obj) } } - public MyObjectBuilder_SessionComponentMission GetObjectBuilder() + public new MyObjectBuilder_SessionComponentMission GetObjectBuilder() // "new" because can't override when return value is different { var builder = new MyObjectBuilder_SessionComponentMission(); diff --git a/Sources/Sandbox.Game/Game/Weapons/Guns/MyAutomaticRifleGun.cs b/Sources/Sandbox.Game/Game/Weapons/Guns/MyAutomaticRifleGun.cs index 856cd0377a..6a27ee2e36 100644 --- a/Sources/Sandbox.Game/Game/Weapons/Guns/MyAutomaticRifleGun.cs +++ b/Sources/Sandbox.Game/Game/Weapons/Guns/MyAutomaticRifleGun.cs @@ -405,7 +405,7 @@ public void DrawHud(IMyCameraController camera, long playerId) { } - public MyDefinitionId DefinitionId + public new MyDefinitionId DefinitionId { get { return m_handItemDefId; } } diff --git a/Sources/Sandbox.Game/Game/Weapons/Guns/MyEngineerToolBase.cs b/Sources/Sandbox.Game/Game/Weapons/Guns/MyEngineerToolBase.cs index f283c46cc2..874d98f80b 100644 --- a/Sources/Sandbox.Game/Game/Weapons/Guns/MyEngineerToolBase.cs +++ b/Sources/Sandbox.Game/Game/Weapons/Guns/MyEngineerToolBase.cs @@ -686,7 +686,7 @@ private void UpdateHudComponentMark() MyHud.BlockInfo.MissingComponentIndex = m_markedComponent; } - public MyDefinitionId DefinitionId + public new MyDefinitionId DefinitionId { get { return m_handItemDef.Id; } } diff --git a/Sources/Sandbox.Game/Game/Weapons/Guns/MyHandDrill.cs b/Sources/Sandbox.Game/Game/Weapons/Guns/MyHandDrill.cs index ef27c1f0e9..735527dfe3 100644 --- a/Sources/Sandbox.Game/Game/Weapons/Guns/MyHandDrill.cs +++ b/Sources/Sandbox.Game/Game/Weapons/Guns/MyHandDrill.cs @@ -353,7 +353,7 @@ public void DrawHud(IMyCameraController camera, long playerId) private bool m_tryingToDrill; private bool m_objectInDrillingRange; - public MyDefinitionId DefinitionId + public new MyDefinitionId DefinitionId { get { return m_handItemDefId; } } diff --git a/Sources/Sandbox.Game/Game/Weapons/Guns/MyLargeTurretBase.cs b/Sources/Sandbox.Game/Game/Weapons/Guns/MyLargeTurretBase.cs index 4af4699e6b..44d86e30a5 100644 --- a/Sources/Sandbox.Game/Game/Weapons/Guns/MyLargeTurretBase.cs +++ b/Sources/Sandbox.Game/Game/Weapons/Guns/MyLargeTurretBase.cs @@ -1721,7 +1721,7 @@ public void OnControlReleased() } - public MyDefinitionId DefinitionId + public new MyDefinitionId DefinitionId { get { return m_defId; } } diff --git a/Sources/Sandbox.Game/Game/Weapons/Guns/MyShipDrill.cs b/Sources/Sandbox.Game/Game/Weapons/Guns/MyShipDrill.cs index cb36faf502..4c18c02849 100644 --- a/Sources/Sandbox.Game/Game/Weapons/Guns/MyShipDrill.cs +++ b/Sources/Sandbox.Game/Game/Weapons/Guns/MyShipDrill.cs @@ -81,7 +81,7 @@ public bool EnabledInWorldRules { get { return true; } } - public MyDefinitionId DefinitionId + public new MyDefinitionId DefinitionId { get { return m_defId; } } @@ -352,7 +352,7 @@ private bool HasObjectInDrillingRange() foreach (var entry in m_drillBase.Sensor.EntitiesInRange) { - const float sparksMoveDist = 0.1f; + //const float sparksMoveDist = 0.1f; var pt = entry.Value.DetectionPoint; if (Vector3.DistanceSquared(pt, origin) < distSq) diff --git a/Sources/Sandbox.Game/Game/Weapons/Guns/MyShipToolBase.cs b/Sources/Sandbox.Game/Game/Weapons/Guns/MyShipToolBase.cs index 22e383bdb3..3678aa4165 100644 --- a/Sources/Sandbox.Game/Game/Weapons/Guns/MyShipToolBase.cs +++ b/Sources/Sandbox.Game/Game/Weapons/Guns/MyShipToolBase.cs @@ -441,7 +441,7 @@ public float ShakeAmount protected set; } - public MyDefinitionId DefinitionId + public new MyDefinitionId DefinitionId { get { return m_defId; } } diff --git a/Sources/Sandbox.Game/Game/Weapons/Guns/MySmallGatlingGun.cs b/Sources/Sandbox.Game/Game/Weapons/Guns/MySmallGatlingGun.cs index 1ed840c2a8..3be6c97de6 100644 --- a/Sources/Sandbox.Game/Game/Weapons/Guns/MySmallGatlingGun.cs +++ b/Sources/Sandbox.Game/Game/Weapons/Guns/MySmallGatlingGun.cs @@ -61,7 +61,7 @@ class MySmallGatlingGun : MyUserControllableGun, IMyGunObject, IMyInv MyGunBase m_gunBase; List m_hits = new List(); - bool m_isShooting = false; + new bool m_isShooting = false; protected override bool CheckIsWorking() { @@ -365,7 +365,7 @@ public float ProjectileCountMultiplier public bool EnabledInWorldRules { get { return MySession.Static.WeaponsEnabled; } } - public MyDefinitionId DefinitionId + public new MyDefinitionId DefinitionId { get { return BlockDefinition.Id; } } diff --git a/Sources/Sandbox.Game/Game/Weapons/Guns/MySmallMissileLauncher.cs b/Sources/Sandbox.Game/Game/Weapons/Guns/MySmallMissileLauncher.cs index b11cbec291..839eac7b2c 100644 --- a/Sources/Sandbox.Game/Game/Weapons/Guns/MySmallMissileLauncher.cs +++ b/Sources/Sandbox.Game/Game/Weapons/Guns/MySmallMissileLauncher.cs @@ -331,7 +331,7 @@ public void DrawHud(IMyCameraController camera, long playerId) } } - public MyDefinitionId DefinitionId + public new MyDefinitionId DefinitionId { get { return BlockDefinition.Id; } } diff --git a/Sources/Sandbox.Game/Game/World/MyGlobalEvents.cs b/Sources/Sandbox.Game/Game/World/MyGlobalEvents.cs index b2d6e3fad7..dc302dbe99 100644 --- a/Sources/Sandbox.Game/Game/World/MyGlobalEvents.cs +++ b/Sources/Sandbox.Game/Game/World/MyGlobalEvents.cs @@ -57,7 +57,7 @@ public void Init(MyObjectBuilder_GlobalEvents objectBuilder) } } - public static MyObjectBuilder_GlobalEvents GetObjectBuilder() + public new static MyObjectBuilder_GlobalEvents GetObjectBuilder() // static from virtual ? { MyObjectBuilder_GlobalEvents objectBuilder = MyObjectBuilderSerializer.CreateNewObject(); diff --git a/Sources/Sandbox.Game/Game/World/MySession.Components.cs b/Sources/Sandbox.Game/Game/World/MySession.Components.cs index 8e69ee3c00..bf0472c447 100644 --- a/Sources/Sandbox.Game/Game/World/MySession.Components.cs +++ b/Sources/Sandbox.Game/Game/World/MySession.Components.cs @@ -81,7 +81,7 @@ private void RegisterComponentsFromAssemblies() RegisterComponentsFromAssembly(plugin.GetType().Assembly, true); } } - catch (Exception e) + catch (Exception) { } try { RegisterComponentsFromAssembly(MyPlugins.GameAssembly); } diff --git a/Sources/Sandbox.Game/ModAPI/Blocks/MyTerminalBlock_ModAPI.cs b/Sources/Sandbox.Game/ModAPI/Blocks/MyTerminalBlock_ModAPI.cs index abda6924c0..e0e42f0098 100644 --- a/Sources/Sandbox.Game/ModAPI/Blocks/MyTerminalBlock_ModAPI.cs +++ b/Sources/Sandbox.Game/ModAPI/Blocks/MyTerminalBlock_ModAPI.cs @@ -78,7 +78,7 @@ void ModAPI.Ingame.IMyTerminalBlock.GetActions(List resultList, Func collect = null) + void ModAPI.Ingame.IMyTerminalBlock.SearchActionsOfName(string name, List resultList, Func collect) { (MyTerminalControlFactoryHelper.Static as IMyTerminalActionsHelper).SearchActionsOfName(name, this.GetType(), resultList, collect); } diff --git a/Sources/Sandbox.Game/ModAPI/MyAPIUtilities_ModAPI.cs b/Sources/Sandbox.Game/ModAPI/MyAPIUtilities_ModAPI.cs index c1b0517a6c..4269b49b73 100644 --- a/Sources/Sandbox.Game/ModAPI/MyAPIUtilities_ModAPI.cs +++ b/Sources/Sandbox.Game/ModAPI/MyAPIUtilities_ModAPI.cs @@ -249,7 +249,7 @@ void IMyUtilities.DeleteFileInGlobalStorage(string file) } } - void IMyUtilities.ShowMissionScreen(string screenTitle, string currentObjectivePrefix, string currentObjective, string screenDescription, Action callback = null, string okButtonCaption = null) + void IMyUtilities.ShowMissionScreen(string screenTitle, string currentObjectivePrefix, string currentObjective, string screenDescription, Action callback, string okButtonCaption) { var missionScreen = new MyGuiScreenMission(missionTitle: screenTitle, currentObjectivePrefix: currentObjectivePrefix, diff --git a/Sources/Sandbox.Game/ModAPI/MyGridTerminalSystem_ModAPI.cs b/Sources/Sandbox.Game/ModAPI/MyGridTerminalSystem_ModAPI.cs index 8f81adbb57..c3bd3ee394 100644 --- a/Sources/Sandbox.Game/ModAPI/MyGridTerminalSystem_ModAPI.cs +++ b/Sources/Sandbox.Game/ModAPI/MyGridTerminalSystem_ModAPI.cs @@ -31,7 +31,7 @@ void IMyGridTerminalSystem.GetBlockGroups(List blockGroups) } } - void IMyGridTerminalSystem.GetBlocksOfType(List blocks, Func collect = null) + void IMyGridTerminalSystem.GetBlocksOfType(List blocks, Func collect) { blocks.Clear(); foreach (var block in m_blocks) @@ -47,7 +47,7 @@ void IMyGridTerminalSystem.GetBlocksOfType(List blocks, Fun } } - void IMyGridTerminalSystem.SearchBlocksOfName(string name, List blocks, Func collect = null) + void IMyGridTerminalSystem.SearchBlocksOfName(string name, List blocks, Func collect) { blocks.Clear(); foreach (var block in m_blocks) diff --git a/Sources/Sandbox.Game/ModAPI/MyInventory_ModAPI.cs b/Sources/Sandbox.Game/ModAPI/MyInventory_ModAPI.cs index b6aa232bd4..c01315c714 100644 --- a/Sources/Sandbox.Game/ModAPI/MyInventory_ModAPI.cs +++ b/Sources/Sandbox.Game/ModAPI/MyInventory_ModAPI.cs @@ -182,11 +182,11 @@ IMyInventoryItem IMyInventory.FindItem(SerializableDefinitionId contentId) return null; } - bool VRage.Game.ModAPI.IMyInventory.TransferItemTo(IMyInventory dst, int sourceItemIndex, int? targetItemIndex = null, bool? stackIfPossible = null, VRage.MyFixedPoint? amount = null, bool checkConnection = false) + bool VRage.Game.ModAPI.IMyInventory.TransferItemTo(IMyInventory dst, int sourceItemIndex, int? targetItemIndex, bool? stackIfPossible, VRage.MyFixedPoint? amount, bool checkConnection) { return TransferItemsTo(dst, sourceItemIndex, targetItemIndex, amount, checkConnection); } - bool VRage.Game.ModAPI.IMyInventory.TransferItemFrom(IMyInventory sourceInventory, int sourceItemIndex, int? targetItemIndex = null, bool? stackIfPossible = null, VRage.MyFixedPoint? amount = null, bool checkConnection = false) + bool VRage.Game.ModAPI.IMyInventory.TransferItemFrom(IMyInventory sourceInventory, int sourceItemIndex, int? targetItemIndex, bool? stackIfPossible, VRage.MyFixedPoint? amount, bool checkConnection) { return TransferItemsFrom(sourceInventory, sourceItemIndex, targetItemIndex, stackIfPossible, amount, checkConnection); } diff --git a/Sources/Sandbox.Game/ModAPI/MyTerminalControlFactoryHelper_ModAPI.cs b/Sources/Sandbox.Game/ModAPI/MyTerminalControlFactoryHelper_ModAPI.cs index 6c7cf97507..83e076ab10 100644 --- a/Sources/Sandbox.Game/ModAPI/MyTerminalControlFactoryHelper_ModAPI.cs +++ b/Sources/Sandbox.Game/ModAPI/MyTerminalControlFactoryHelper_ModAPI.cs @@ -42,7 +42,7 @@ void IMyTerminalActionsHelper.GetActions(Type blockType, List resultList, Func collect = null) + void IMyTerminalActionsHelper.SearchActionsOfName(string name, Type blockType, List resultList, Func collect) { if (!typeof(MyTerminalBlock).IsAssignableFrom(blockType)) return; diff --git a/Sources/SpaceEngineers.Game/AI/MySpiderTarget.cs b/Sources/SpaceEngineers.Game/AI/MySpiderTarget.cs index b1b9647be2..71a5ab5e15 100644 --- a/Sources/SpaceEngineers.Game/AI/MySpiderTarget.cs +++ b/Sources/SpaceEngineers.Game/AI/MySpiderTarget.cs @@ -32,7 +32,6 @@ public class MySpiderTarget : MyAiTargetBase private BoundingSphereD m_attackBoundingSphere; private static readonly int ATTACK_LENGTH = 1000; - private static readonly int ATTACK_ACTIVATION = 700; private static readonly int ATTACK_DAMAGE_TO_CHARACTER = 35; // spider attack (spider damage) to character private static readonly int ATTACK_DAMAGE_TO_GRID = 50; // spider attack (spider damage) to grid diff --git a/Sources/SpaceEngineers.Game/Entities/Blocks/MyAirVent.cs b/Sources/SpaceEngineers.Game/Entities/Blocks/MyAirVent.cs index 50a8968784..26b463fc83 100644 --- a/Sources/SpaceEngineers.Game/Entities/Blocks/MyAirVent.cs +++ b/Sources/SpaceEngineers.Game/Entities/Blocks/MyAirVent.cs @@ -81,7 +81,7 @@ MyModelDummy VentDummy private float GasOutputPerUpdate { get { return GasOutputPerSecond * VRage.Game.MyEngineConstants.UPDATE_STEP_SIZE_IN_SECONDS; } } private float GasInputPerUpdate { get { return GasInputPerSecond * VRage.Game.MyEngineConstants.UPDATE_STEP_SIZE_IN_SECONDS; } } - private readonly Sync m_isDepressurizing; + private readonly Sync m_isDepressurizing = null; public bool IsDepressurizing { get { return m_isDepressurizing; } set { m_isDepressurizing.Value = value; } } private MyResourceSourceComponent m_sourceComp; diff --git a/Sources/SpaceEngineers.Game/Entities/Blocks/MyButtonPanel.cs b/Sources/SpaceEngineers.Game/Entities/Blocks/MyButtonPanel.cs index 685b9a34a8..7535990202 100644 --- a/Sources/SpaceEngineers.Game/Entities/Blocks/MyButtonPanel.cs +++ b/Sources/SpaceEngineers.Game/Entities/Blocks/MyButtonPanel.cs @@ -30,7 +30,7 @@ internal class MyButtonPanel : MyFunctionalBlock, IMyButtonPanel { private const string DETECTOR_NAME = "panel"; private List m_emissiveNames; // new string[] { "Emissive1", "Emissive2", "Emissive3", "Emissive4", "Emissive5", "Emissive6", "Emissive7", "Emissive8" }; - private readonly Sync m_anyoneCanUse; + private readonly Sync m_anyoneCanUse = null; int m_selectedButton = -1; diff --git a/Sources/SpaceEngineers.Game/Entities/Blocks/MyGravityGenerator.cs b/Sources/SpaceEngineers.Game/Entities/Blocks/MyGravityGenerator.cs index c246c6c373..3eaa3b5498 100644 --- a/Sources/SpaceEngineers.Game/Entities/Blocks/MyGravityGenerator.cs +++ b/Sources/SpaceEngineers.Game/Entities/Blocks/MyGravityGenerator.cs @@ -34,7 +34,7 @@ public class MyGravityGenerator : MyGravityGeneratorBase, IMyGravityGenerator private BoundingBox m_gizmoBoundingBox = new BoundingBox(); - private readonly Sync m_fieldSize; + private readonly Sync m_fieldSize = null; public Vector3 FieldSize { get { return m_fieldSize; } diff --git a/Sources/SpaceEngineers.Game/Entities/Blocks/MyGravityGeneratorSphere.cs b/Sources/SpaceEngineers.Game/Entities/Blocks/MyGravityGeneratorSphere.cs index 7aa9be130f..ab1d769260 100644 --- a/Sources/SpaceEngineers.Game/Entities/Blocks/MyGravityGeneratorSphere.cs +++ b/Sources/SpaceEngineers.Game/Entities/Blocks/MyGravityGeneratorSphere.cs @@ -33,7 +33,7 @@ public class MyGravityGeneratorSphere : MyGravityGeneratorBase, IMyGravityGenera } private const float DEFAULT_RADIUS = 100f; - private readonly Sync m_radius; + private readonly Sync m_radius = null; public float Radius { get { return m_radius; } diff --git a/Sources/SpaceEngineers.Game/Entities/Blocks/MyLandingGear.cs b/Sources/SpaceEngineers.Game/Entities/Blocks/MyLandingGear.cs index 80cb6bf319..7d2e6122f5 100644 --- a/Sources/SpaceEngineers.Game/Entities/Blocks/MyLandingGear.cs +++ b/Sources/SpaceEngineers.Game/Entities/Blocks/MyLandingGear.cs @@ -64,7 +64,7 @@ private HkConstraint SafeConstraint } } - private readonly Sync m_lockModeSync; + private readonly Sync m_lockModeSync = null; LandingGearMode m_lockMode = LandingGearMode.Unlocked; Action m_physicsChangedHandler; @@ -102,10 +102,10 @@ private set public event LockModeChangedHandler LockModeChanged; private float m_breakForce; - private readonly Sync m_autoLock; - private readonly Sync m_attachedState; + private readonly Sync m_autoLock = null; + private readonly Sync m_attachedState = null; - private readonly Sync m_breakForceSync; + private readonly Sync m_breakForceSync = null; private long? m_attachedEntityId; diff --git a/Sources/SpaceEngineers.Game/Entities/Blocks/MyShipMergeBlock.cs b/Sources/SpaceEngineers.Game/Entities/Blocks/MyShipMergeBlock.cs index a817fe4587..26c4a9ccb8 100644 --- a/Sources/SpaceEngineers.Game/Entities/Blocks/MyShipMergeBlock.cs +++ b/Sources/SpaceEngineers.Game/Entities/Blocks/MyShipMergeBlock.cs @@ -74,7 +74,6 @@ private HkConstraint SafeConstraint public MyShipMergeBlock Other { get { return m_other; } } private HashSet m_gridList = new HashSet(); public int GridCount { get { return m_gridList.Count; } } - private Vector3 m_pos; private ushort m_frameCounter; diff --git a/Sources/SpaceEngineers.Game/Entities/Blocks/MyShipWelder.cs b/Sources/SpaceEngineers.Game/Entities/Blocks/MyShipWelder.cs index 093fb6b17a..5aac1cda80 100644 --- a/Sources/SpaceEngineers.Game/Entities/Blocks/MyShipWelder.cs +++ b/Sources/SpaceEngineers.Game/Entities/Blocks/MyShipWelder.cs @@ -35,7 +35,7 @@ class MyShipWelder : MyShipToolBase, IMyShipWelder private static MySoundPair METAL_SOUND = new MySoundPair("ToolLrgWeldMetal"); private static MySoundPair IDLE_SOUND = new MySoundPair("ToolLrgWeldIdle"); private const MyParticleEffectsIDEnum PARTICLE_EFFECT = MyParticleEffectsIDEnum.Welder; - private Sync m_helpOthers; + private Sync m_helpOthers = null; public static readonly float WELDER_AMOUNT_PER_SECOND = 2f; public static readonly float WELDER_MAX_REPAIR_BONE_MOVEMENT_SPEED = 0.6f; diff --git a/Sources/SpaceEngineers.Game/Entities/Blocks/MySoundBlock.cs b/Sources/SpaceEngineers.Game/Entities/Blocks/MySoundBlock.cs index 6525574e03..babefcea28 100644 --- a/Sources/SpaceEngineers.Game/Entities/Blocks/MySoundBlock.cs +++ b/Sources/SpaceEngineers.Game/Entities/Blocks/MySoundBlock.cs @@ -34,10 +34,10 @@ class MySoundBlock : MyFunctionalBlock, IMySoundBlock #region Fields - private readonly Sync m_soundRadius; - private readonly Sync m_volume; - private readonly Sync m_cueId; - private readonly Sync m_loopPeriod; + private readonly Sync m_soundRadius = null; + private readonly Sync m_volume = null; + private readonly Sync m_cueId = null; + private readonly Sync m_loopPeriod = null; private MySoundPair m_soundPair; private bool m_isLoopable; private MyEntity3DSoundEmitter[] m_soundEmitters; diff --git a/Sources/SpaceEngineers.Game/Entities/Blocks/MySpaceBall.cs b/Sources/SpaceEngineers.Game/Entities/Blocks/MySpaceBall.cs index 319c32cf66..af2f4f7ed0 100644 --- a/Sources/SpaceEngineers.Game/Entities/Blocks/MySpaceBall.cs +++ b/Sources/SpaceEngineers.Game/Entities/Blocks/MySpaceBall.cs @@ -29,7 +29,7 @@ class MySpaceBall : MyFunctionalBlock, IMySpaceBall { #region Properties - readonly Sync m_friction; + readonly Sync m_friction = null; public float Friction { get @@ -43,7 +43,7 @@ public float Friction } } - readonly Sync m_virtualMass; + readonly Sync m_virtualMass = null; public float VirtualMass { get @@ -57,7 +57,7 @@ public float VirtualMass } } - readonly Sync m_restitution; + readonly Sync m_restitution = null; public float Restitution { get { return m_restitution; } @@ -67,7 +67,7 @@ public float Restitution } } - readonly Sync m_broadcastSync; + readonly Sync m_broadcastSync = null; private new MySpaceBallDefinition BlockDefinition { diff --git a/Sources/SpaceEngineers.Game/Entities/Blocks/MyTimerBlock.cs b/Sources/SpaceEngineers.Game/Entities/Blocks/MyTimerBlock.cs index 79e41a0315..15a7d77e04 100644 --- a/Sources/SpaceEngineers.Game/Entities/Blocks/MyTimerBlock.cs +++ b/Sources/SpaceEngineers.Game/Entities/Blocks/MyTimerBlock.cs @@ -38,7 +38,7 @@ internal class MyTimerBlock : MyFunctionalBlock, IMyTimerBlock private MySoundPair m_beepEnd = MySoundPair.Empty; private MyEntity3DSoundEmitter m_beepEmitter = null; - readonly Sync m_isCountingDown; + readonly Sync m_isCountingDown = null; public bool IsCountingDown { get @@ -50,7 +50,7 @@ private set m_isCountingDown.Value = value; } } - readonly Sync m_silent; + readonly Sync m_silent = null; public bool Silent { get @@ -67,7 +67,7 @@ private set private static bool m_shouldSetOtherToolbars; bool m_syncing = false; - readonly Sync m_timerSync; + readonly Sync m_timerSync = null; public MyTimerBlock() { m_timerSync.ValueChanged += (x) => TimerChanged(); diff --git a/Sources/SpaceEngineers.Game/Weapons/Guns/Barrels/MyLargeGatlingBarrel.cs b/Sources/SpaceEngineers.Game/Weapons/Guns/Barrels/MyLargeGatlingBarrel.cs index c86013c782..1ff6ef8d59 100644 --- a/Sources/SpaceEngineers.Game/Weapons/Guns/Barrels/MyLargeGatlingBarrel.cs +++ b/Sources/SpaceEngineers.Game/Weapons/Guns/Barrels/MyLargeGatlingBarrel.cs @@ -14,10 +14,6 @@ class MyLargeGatlingBarrel : MyLargeBarrelBase { //private Vector3 m_muzzleFlashStartPosition; // Position of the barrel muzzle flashes from the dummy private Vector3D m_muzzleFlashPosition; - float m_projectileMaxTrajectory; - Vector3 m_projectileColor; - - float m_rotationAngle; // Actual rotation angle (not rotation speed) around Z axis float m_rotationTimeout; diff --git a/Sources/SpaceEngineers.Game/Weapons/Guns/Barrels/MyLargeInteriorBarrel.cs b/Sources/SpaceEngineers.Game/Weapons/Guns/Barrels/MyLargeInteriorBarrel.cs index 2abc2f42ef..ae69d815bc 100644 --- a/Sources/SpaceEngineers.Game/Weapons/Guns/Barrels/MyLargeInteriorBarrel.cs +++ b/Sources/SpaceEngineers.Game/Weapons/Guns/Barrels/MyLargeInteriorBarrel.cs @@ -12,9 +12,6 @@ namespace SpaceEngineers.Game.Weapons.Guns.Barrels { class MyLargeInteriorBarrel : MyLargeBarrelBase { - float m_projectileMaxTrajectory; - Vector3 m_projectileColor; - public MyLargeInteriorBarrel() { } diff --git a/Sources/SpaceEngineers.Game/World/MySpacePlanetTrackComponent.cs b/Sources/SpaceEngineers.Game/World/MySpacePlanetTrackComponent.cs index ab7bb159ac..3b6b37951d 100644 --- a/Sources/SpaceEngineers.Game/World/MySpacePlanetTrackComponent.cs +++ b/Sources/SpaceEngineers.Game/World/MySpacePlanetTrackComponent.cs @@ -106,8 +106,8 @@ public override void UpdateAfterSimulation() if (planet != null) { var distanceFromPlanet = Vector3D.Distance(planet.PositionComp.GetPosition(), position); - if (distanceFromPlanet > planet.MaximumRadius + Math.Max(100, planet.MaximumRadius)) ; - planet = null; //too far planet + if (distanceFromPlanet > planet.MaximumRadius + Math.Max(100, planet.MaximumRadius)) + planet = null; //too far planet } if (m_closestPlanet != planet) diff --git a/Sources/VRage.Game/Components/MyPhysicsComponentBase.cs b/Sources/VRage.Game/Components/MyPhysicsComponentBase.cs index b4105a114c..867c42b1a3 100644 --- a/Sources/VRage.Game/Components/MyPhysicsComponentBase.cs +++ b/Sources/VRage.Game/Components/MyPhysicsComponentBase.cs @@ -71,7 +71,7 @@ public bool ReportAllContacts #region Properties - public IMyEntity Entity { get; protected set; } + public new IMyEntity Entity { get; protected set; } public bool CanUpdateAccelerations { get; set; } diff --git a/Sources/VRage.Game/Graphics/Particles/MyParticleGPUGeneration.cs b/Sources/VRage.Game/Graphics/Particles/MyParticleGPUGeneration.cs index f9df1b87d0..f1cd8d6d38 100644 --- a/Sources/VRage.Game/Graphics/Particles/MyParticleGPUGeneration.cs +++ b/Sources/VRage.Game/Graphics/Particles/MyParticleGPUGeneration.cs @@ -18,12 +18,6 @@ namespace VRage.Game public class MyParticleGPUGeneration : IMyParticleGeneration { - #region Static - - static int m_globalCounter; - - #endregion - #region Members static readonly int Version = 1; diff --git a/Sources/VRage.Game/ModAPI/IMyCubeBlock.cs b/Sources/VRage.Game/ModAPI/IMyCubeBlock.cs index 1dd4ea8c3f..c161ea54c2 100644 --- a/Sources/VRage.Game/ModAPI/IMyCubeBlock.cs +++ b/Sources/VRage.Game/ModAPI/IMyCubeBlock.cs @@ -13,7 +13,7 @@ namespace VRage.Game.ModAPI public interface IMyCubeBlock : Ingame.IMyCubeBlock, IMyEntity { event Action IsWorkingChanged; - SerializableDefinitionId BlockDefinition { get; } + new SerializableDefinitionId BlockDefinition { get; } /// /// @@ -33,7 +33,7 @@ public interface IMyCubeBlock : Ingame.IMyCubeBlock, IMyEntity /// Whether the grid should call the ConnectionAllowed method for this block ///(ConnectionAllowed checks mount points and other per-block requirements) /// - bool CheckConnectionAllowed { get; set; } + new bool CheckConnectionAllowed { get; set; } //bool ConnectionAllowed(ref VRageMath.Vector3I otherBlockMinPos, ref VRageMath.Vector3I otherBlockMaxPos, ref VRageMath.Vector3I faceNormal, Sandbox.Definitions.MyCubeBlockDefinition def); //bool ConnectionAllowed(ref VRageMath.Vector3I otherBlockPos, ref VRageMath.Vector3I faceNormal, Sandbox.Definitions.MyCubeBlockDefinition def); @@ -41,29 +41,29 @@ public interface IMyCubeBlock : Ingame.IMyCubeBlock, IMyEntity /// /// Grid in which the block is placed /// - IMyCubeGrid CubeGrid { get; } + new IMyCubeGrid CubeGrid { get; } /// /// Debug only method. Effects may wary through time. /// /// - bool DebugDraw(); + new bool DebugDraw(); /// /// Definition name /// - String DefinitionDisplayNameText { get; } + new String DefinitionDisplayNameText { get; } /// /// Is set in definition /// Ratio at which is the block disassembled (grinding) /// - float DisassembleRatio { get; } + new float DisassembleRatio { get; } /// /// Translated block name /// - String DisplayNameText { get; } + new String DisplayNameText { get; } /// /// Returns block object builder which can be serialized or added to grid @@ -76,20 +76,20 @@ public interface IMyCubeBlock : Ingame.IMyCubeBlock, IMyEntity /// /// /// Tag of faction owning block - string GetOwnerFactionTag(); + new string GetOwnerFactionTag(); /// /// /// /// Relation of local player to the block - VRage.Game.MyRelationsBetweenPlayerAndBlock GetPlayerRelationToOwner(); + new VRage.Game.MyRelationsBetweenPlayerAndBlock GetPlayerRelationToOwner(); /// /// /// /// Id of player to check relation with (not steam id!) /// Relation of defined player to the block - VRage.Game.MyRelationsBetweenPlayerAndBlock GetUserRelationToOwner(long playerId); + new VRage.Game.MyRelationsBetweenPlayerAndBlock GetUserRelationToOwner(long playerId); //Sandbox.Game.Entities.MyIDModule IDModule { get; } @@ -106,38 +106,38 @@ public interface IMyCubeBlock : Ingame.IMyCubeBlock, IMyEntity void Init(MyObjectBuilder_CubeBlock builder, IMyCubeGrid cubeGrid); - bool IsBeingHacked { get; } + new bool IsBeingHacked { get; } /// /// True if integrity is above breaking threshold /// - bool IsFunctional { get; } + new bool IsFunctional { get; } /// /// True if block is able to do its work depening on block type (is functional, powered, enabled, etc...) /// - bool IsWorking { get; } + new bool IsWorking { get; } //event Action IsWorkingChanged; //TODO: use Event set for this /// /// Maximum coordinates of grid cells occupied by this block /// - VRageMath.Vector3I Max { get; } + new VRageMath.Vector3I Max { get; } /// /// Block mass /// - float Mass { get; } + new float Mass { get; } /// /// Minimum coordinates of grid cells occupied by this block /// - VRageMath.Vector3I Min { get; } + new VRageMath.Vector3I Min { get; } /// /// Order in which were the blocks of same type added to grid /// Used in default display name /// - int NumberInGrid { get; set; } + new int NumberInGrid { get; set; } /// /// Method called when a block has been built (after adding to the grid). @@ -176,17 +176,17 @@ public interface IMyCubeBlock : Ingame.IMyCubeBlock, IMyEntity /// /// Returns block orientation in base 6 directions /// - VRageMath.MyBlockOrientation Orientation { get; } + new VRageMath.MyBlockOrientation Orientation { get; } /// /// Id of player owning block (not steam Id) /// - long OwnerId { get; } + new long OwnerId { get; } /// /// Position in grid coordinates /// - VRageMath.Vector3I Position { get; } + new VRageMath.Vector3I Position { get; } /// /// Gets the name of interactive object intersected by defined line @@ -206,12 +206,12 @@ public interface IMyCubeBlock : Ingame.IMyCubeBlock, IMyEntity /// /// Force refresh working state. Call if you change block state that could affect its working status. /// - void UpdateIsWorking(); + new void UpdateIsWorking(); /// /// Updates block visuals (ie. block emissivity) /// - void UpdateVisual(); + new void UpdateVisual(); /// /// Start or stop dammage effect on cube block diff --git a/Sources/VRage.Game/ModAPI/IMyCubeGrid.cs b/Sources/VRage.Game/ModAPI/IMyCubeGrid.cs index 2bf0a3a105..638121d569 100644 --- a/Sources/VRage.Game/ModAPI/IMyCubeGrid.cs +++ b/Sources/VRage.Game/ModAPI/IMyCubeGrid.cs @@ -54,7 +54,7 @@ public interface IMyCubeGrid : IMyEntity, Ingame.IMyCubeGrid /// /// Returns true if there is any block occupying given position /// - bool CubeExists(VRageMath.Vector3I pos); + new bool CubeExists(VRageMath.Vector3I pos); /// /// Clamps fractional grid position to nearest cell (prefers neighboring occupied cell before empty) @@ -76,7 +76,7 @@ public interface IMyCubeGrid : IMyEntity, Ingame.IMyCubeGrid /// /// Block position /// Block or null if none is present at given position - IMySlimBlock GetCubeBlock(VRageMath.Vector3I pos); + new IMySlimBlock GetCubeBlock(VRageMath.Vector3I pos); /// /// Returns point of intersection with line @@ -95,22 +95,22 @@ public interface IMyCubeGrid : IMyEntity, Ingame.IMyCubeGrid /// /// Converts grid coordinates to world space /// - VRageMath.Vector3D GridIntegerToWorld(VRageMath.Vector3I gridCoords); + new VRageMath.Vector3D GridIntegerToWorld(VRageMath.Vector3I gridCoords); /// /// Grid size in meters /// - float GridSize { get; } + new float GridSize { get; } /// /// Grid size enumeration /// - MyCubeSize GridSizeEnum { get; set; } + new MyCubeSize GridSizeEnum { get; set; } /// /// Station = static /// - bool IsStatic { get; } + new bool IsStatic { get; } /// /// Finds out if given area has any neighboring block @@ -128,7 +128,7 @@ public interface IMyCubeGrid : IMyEntity, Ingame.IMyCubeGrid /// /// Maximum coordinates of blocks in grid /// - VRageMath.Vector3I Max { get; } + new VRageMath.Vector3I Max { get; } /// /// Determines if merge between grids is possible with given offset @@ -159,7 +159,7 @@ public interface IMyCubeGrid : IMyEntity, Ingame.IMyCubeGrid /// /// Minimum coordinates of blocks in grid /// - VRageMath.Vector3I Min { get; } + new VRageMath.Vector3I Min { get; } /// /// Returns cell with block intersecting given line @@ -243,7 +243,7 @@ public interface IMyCubeGrid : IMyEntity, Ingame.IMyCubeGrid event Action OnBlockOwnershipChanged; void UpdateOwnership(long ownerId, bool isFunctional); - VRageMath.Vector3I WorldToGridInteger(VRageMath.Vector3D coords); + new VRageMath.Vector3I WorldToGridInteger(VRageMath.Vector3D coords); /// /// Add a cubeblock to the grid diff --git a/Sources/VRage.Game/ModAPI/IMySlimBlock.cs b/Sources/VRage.Game/ModAPI/IMySlimBlock.cs index 25613cc8d6..63f256e12e 100644 --- a/Sources/VRage.Game/ModAPI/IMySlimBlock.cs +++ b/Sources/VRage.Game/ModAPI/IMySlimBlock.cs @@ -5,54 +5,54 @@ namespace VRage.Game.ModAPI { public interface IMySlimBlock : Ingame.IMySlimBlock { - float AccumulatedDamage { get; } + new float AccumulatedDamage { get; } void AddNeighbours(); void ApplyAccumulatedDamage(bool addDirtyParts = true); - float BuildIntegrity { get; } - float BuildLevelRatio { get; } + new float BuildIntegrity { get; } + new float BuildLevelRatio { get; } string CalculateCurrentModel(out VRageMath.Matrix orientation); //bool CanContinueBuild(Sandbox.Game.MyInventory sourceInventory); //void ClearConstructionStockpile(Sandbox.Game.MyInventory outputInventory); void ComputeScaledCenter(out VRageMath.Vector3D scaledCenter); void ComputeScaledHalfExtents(out VRageMath.Vector3 scaledHalfExtents); void ComputeWorldCenter(out VRageMath.Vector3D worldCenter); - float CurrentDamage { get; } - float DamageRatio { get; } + new float CurrentDamage { get; } + new float DamageRatio { get; } //void DecreaseMountLevel(float grinderAmount, Sandbox.Game.MyInventory outputInventory); //void DoDamage(float damage, Sandbox.Game.Weapons.MyStringHash damageType, bool addDirtyParts = true); - IMyCubeBlock FatBlock { get; } + new IMyCubeBlock FatBlock { get; } void FixBones(float oldDamage, float maxAllowedBoneMovement); void FullyDismount(IMyInventory outputInventory); //int GetConstructionStockpileItemAmount(Sandbox.Definitions.MyDefinitionId id); MyObjectBuilder_CubeBlock GetCopyObjectBuilder(); - void GetMissingComponents(System.Collections.Generic.Dictionary addToDictionary); + new void GetMissingComponents(System.Collections.Generic.Dictionary addToDictionary); MyObjectBuilder_CubeBlock GetObjectBuilder(); - bool HasDeformation { get; } + new bool HasDeformation { get; } //void IncreaseMountLevel(float welderMountAmount, long welderOwnerPlayerId, Sandbox.Game.MyInventory outputInventory = null, float maxAllowedBoneMovement = 0.0f); //void Init(Sandbox.Common.ObjectBuilders.MyObjectBuilder_CubeBlock objectBuilder, Sandbox.Game.Entities.MyCubeGrid cubeGrid, Sandbox.Game.Entities.MyCubeBlock fatBlock); void InitOrientation(ref VRageMath.Vector3I forward, ref VRageMath.Vector3I up); void InitOrientation(VRageMath.Base6Directions.Direction Forward, VRageMath.Base6Directions.Direction Up); void InitOrientation(VRageMath.MyBlockOrientation orientation); - bool IsDestroyed { get; } - bool IsFullIntegrity { get; } - bool IsFullyDismounted { get; } - float MaxDeformation { get; } - float MaxIntegrity { get; } - float Mass { get; } + new bool IsDestroyed { get; } + new bool IsFullIntegrity { get; } + new bool IsFullyDismounted { get; } + new float MaxDeformation { get; } + new float MaxIntegrity { get; } + new float Mass { get; } //void MoveFirstItemToConstructionStockpile(Sandbox.Game.MyInventory fromInventory); void MoveItemsFromConstructionStockpile(IMyInventory toInventory, MyItemFlags flags = MyItemFlags.None); //void MoveItemsToConstructionStockpile(Sandbox.Game.MyInventory fromInventory); //void PlayConstructionSound(Sandbox.Game.Entities.MyCubeGrid.MyIntegrityChangeEnum integrityChangeType, bool deconstruction = false); void RemoveNeighbours(); void SetToConstructionSite(); - bool ShowParts { get; } + new bool ShowParts { get; } void SpawnConstructionStockpile(); void SpawnFirstItemInConstructionStockpile(); - bool StockpileAllocated { get; } - bool StockpileEmpty { get; } - void UpdateVisual(); - Vector3I Position { get; set; } - IMyCubeGrid CubeGrid { get; } + new bool StockpileAllocated { get; } + new bool StockpileEmpty { get; } + new void UpdateVisual(); + new Vector3I Position { get; set; } + new IMyCubeGrid CubeGrid { get; } VRageMath.Vector3 GetColorMask(); } } diff --git a/Sources/VRage.Game/ModAPI/Ingame/IMyInventoryItem.cs b/Sources/VRage.Game/ModAPI/Ingame/IMyInventoryItem.cs index 044e920b32..12c3e51de7 100644 --- a/Sources/VRage.Game/ModAPI/Ingame/IMyInventoryItem.cs +++ b/Sources/VRage.Game/ModAPI/Ingame/IMyInventoryItem.cs @@ -1,6 +1,4 @@ -using VRage.Game; -using VRage.Game; -using VRage.ObjectBuilders; +using VRage.ObjectBuilders; namespace VRage.Game.ModAPI.Ingame { diff --git a/Sources/VRage.Game/ObjectBuilders/Definitions/MyObjectBuilder_PlanetGeneratorDefinition.cs b/Sources/VRage.Game/ObjectBuilders/Definitions/MyObjectBuilder_PlanetGeneratorDefinition.cs index 5200027995..eb583c3565 100644 --- a/Sources/VRage.Game/ObjectBuilders/Definitions/MyObjectBuilder_PlanetGeneratorDefinition.cs +++ b/Sources/VRage.Game/ObjectBuilders/Definitions/MyObjectBuilder_PlanetGeneratorDefinition.cs @@ -62,7 +62,7 @@ public string FirstOrDefault } } - public object Clone() + public virtual object Clone() { MyPlanetMaterialDefinition clone = new MyPlanetMaterialDefinition(); clone.Material = Material; @@ -133,7 +133,7 @@ public bool Check(float height, float latitude, float slope) && Slope.ValueBetween(slope); } - public object Clone() + public override object Clone() { MyPlanetMaterialPlacementRule clonedRule = new MyPlanetMaterialPlacementRule(this); return clonedRule; diff --git a/Sources/VRage.Game/ObjectBuilders/VRageData/SerializableBlockOrientation.cs b/Sources/VRage.Game/ObjectBuilders/VRageData/SerializableBlockOrientation.cs index 1a336f33da..0fac854a65 100644 --- a/Sources/VRage.Game/ObjectBuilders/VRageData/SerializableBlockOrientation.cs +++ b/Sources/VRage.Game/ObjectBuilders/VRageData/SerializableBlockOrientation.cs @@ -1,6 +1,7 @@ using System.Xml.Serialization; using ProtoBuf; using VRageMath; +using System; namespace VRage.Game { @@ -52,6 +53,17 @@ public static implicit operator SerializableBlockOrientation(MyBlockOrientation return a.Forward != b.Forward || a.Up != b.Up; } + public override bool Equals(object obj) + { + if (obj is SerializableBlockOrientation) + return (this == (SerializableBlockOrientation)obj); + else + return false; + } + public override int GetHashCode() + { + return ((int)Forward) | ((int)Up << 8); + } } } diff --git a/Sources/VRage.Library/Profiler/MyProfiler.cs b/Sources/VRage.Library/Profiler/MyProfiler.cs index 6dd027ea0b..307d683c1f 100644 --- a/Sources/VRage.Library/Profiler/MyProfiler.cs +++ b/Sources/VRage.Library/Profiler/MyProfiler.cs @@ -148,7 +148,7 @@ public MyProfiler(bool memoryProfiling, string name, string axisName) if (ENABLE_PROFILER_LOG) m_logWriter = new StreamWriter(@"c:\keenswh\profiler" + Thread.CurrentThread.ManagedThreadId + "_" + m_customName + ".csv"); - for (int i = 0; i < 2000; i++) + for (int i = 0; i < INITIAL_PROFILER_BLOCK_COUNT; i++) { blockPool.Add(new MyProfilerBlock()); } diff --git a/Sources/VRage.Render/Cockpit/MyCockpitGlass.cs b/Sources/VRage.Render/Cockpit/MyCockpitGlass.cs index 625314e2d3..257507370e 100644 --- a/Sources/VRage.Render/Cockpit/MyCockpitGlass.cs +++ b/Sources/VRage.Render/Cockpit/MyCockpitGlass.cs @@ -21,9 +21,6 @@ public override int GetID() return (int)MyRenderComponentID.CockpitGlass; } - //Bounding sphere used to calculate nearby lights - static BoundingSphereD m_boundingSphereForLights = new BoundingSphereD(); - private static MyInterpolationQueue m_interpolation = new MyInterpolationQueue(8, MatrixD.Slerp); private static MatrixD m_playerHeadForCockpit; diff --git a/Sources/VRage.Render/Decals/MyDecals.cs b/Sources/VRage.Render/Decals/MyDecals.cs index 7a48f437f6..1df4eca3f5 100644 --- a/Sources/VRage.Render/Decals/MyDecals.cs +++ b/Sources/VRage.Render/Decals/MyDecals.cs @@ -41,7 +41,7 @@ class MyDecalTriangle public int RemainingTrianglesOfThisDecal; // This number tells us how many triangles of one decal are in the buffer after this triangleVertexes. If zero, this is the last triangleVertexes of a decal. public float RandomOffset; - public MyRenderLight Light; + //public MyRenderLight Light; public float Emissivity; public Vector3D Position; @@ -285,14 +285,14 @@ public static float UpdateDecalEmissivity(MyDecalTriangle decalTriangle, float a 1.5f * emisivity, 0); - if (decalTriangle.Light != null) - { - decalTriangle.Light.Color = color; - decalTriangle.Light.SetPosition(position); + //if (decalTriangle.Light != null) + //{ + // decalTriangle.Light.Color = color; + // decalTriangle.Light.SetPosition(position); - float range = Math.Max(3 * emisivity * alpha, 0.1f); - decalTriangle.Light.Range = range; - } + // float range = Math.Max(3 * emisivity * alpha, 0.1f); + // decalTriangle.Light.Range = range; + //} } } diff --git a/Sources/VRage.Render/Decals/MyDecalsForVoxels.cs b/Sources/VRage.Render/Decals/MyDecalsForVoxels.cs index f896279153..943f4acea5 100644 --- a/Sources/VRage.Render/Decals/MyDecalsForVoxels.cs +++ b/Sources/VRage.Render/Decals/MyDecalsForVoxels.cs @@ -101,8 +101,6 @@ public int GetHashCode(MyDecalsForVoxelsDictionaryKey obj) #endregion } - MyDecalForVoxelsState m_status; - int m_fadingOutStartTime; int m_capacity; int m_fadingOutStartLimit; int m_fadingOutBuffersCount; @@ -115,7 +113,6 @@ public int GetHashCode(MyDecalsForVoxelsDictionaryKey obj) public MyDecalsForVoxels(int capacity) { - m_status = MyDecalForVoxelsState.READY; m_capacity = capacity; m_fadingOutStartLimit = (int)(m_capacity * MyDecalsConstants.TEXTURE_LARGE_FADING_OUT_START_LIMIT_PERCENT); m_fadingOutBuffersCount = (int)(m_capacity * MyDecalsConstants.TEXTURE_LARGE_FADING_OUT_MINIMAL_TRIANGLE_COUNT_PERCENT); diff --git a/Sources/VRage.Render/Effects/MyEffectModelsDNS.cs b/Sources/VRage.Render/Effects/MyEffectModelsDNS.cs index b9c93f5571..17b22eb010 100644 --- a/Sources/VRage.Render/Effects/MyEffectModelsDNS.cs +++ b/Sources/VRage.Render/Effects/MyEffectModelsDNS.cs @@ -51,7 +51,6 @@ class MyEffectModelsDNS : MyEffectBase bool m_diffuseTextureSet = false; bool m_normalTextureSet = false; - bool m_specularTextureSet = false; //Techniques EffectHandle m_lowTechnique; diff --git a/Sources/VRage.Render/Impostors/MyVoxelMapImpostors.cs b/Sources/VRage.Render/Impostors/MyVoxelMapImpostors.cs index 42cea23f0a..cfc7264b24 100644 --- a/Sources/VRage.Render/Impostors/MyVoxelMapImpostors.cs +++ b/Sources/VRage.Render/Impostors/MyVoxelMapImpostors.cs @@ -55,7 +55,6 @@ class MyVoxelMapImpostorGroup VertexBuffer m_vertexBuffer; int m_trianglesCount; MyVertexFormatPositionTextureColor[] m_vertices; - List m_voxelMapImpostors; Vector4 m_animationTime = Vector4.Zero; public void LoadContent() diff --git a/Sources/VRage.Render/MyRender-3D.cs b/Sources/VRage.Render/MyRender-3D.cs index 2d8a00c3eb..2eb30bb6a8 100644 --- a/Sources/VRage.Render/MyRender-3D.cs +++ b/Sources/VRage.Render/MyRender-3D.cs @@ -134,7 +134,7 @@ internal class MyRenderSetup public MyRenderCallerEnum? CallerID; public Texture[] RenderTargets; - public Texture DepthTarget; + public Texture DepthTarget = null; //TODO public Vector3D? CameraPosition; @@ -421,9 +421,6 @@ internal static MyRenderSetup CurrentRenderSetup private static List m_hemiLights = new List(128); // just references - private static bool m_enableEnvironmentMapAmbient = true; - private static bool m_enableEnvironmentMapReflection = true; - static readonly BaseTexture[] m_renderTargets = new BaseTexture[Enum.GetValues(typeof(MyRenderTargets)).GetLength(0)]; static readonly BaseTexture[] m_spotShadowRenderTargets = new BaseTexture[MyRenderConstants.SPOT_SHADOW_RENDER_TARGET_COUNT]; static readonly BaseTexture[] m_spotShadowRenderTargetsZBuffers = new BaseTexture[MyRenderConstants.SPOT_SHADOW_RENDER_TARGET_COUNT]; diff --git a/Sources/VRage.Render/MyRender-Debug.cs b/Sources/VRage.Render/MyRender-Debug.cs index 15e1903f4e..66a3f67e62 100644 --- a/Sources/VRage.Render/MyRender-Debug.cs +++ b/Sources/VRage.Render/MyRender-Debug.cs @@ -48,52 +48,52 @@ private static void DebugDrawLights() { return; //Debug draw lights - foreach (MyRenderLight light in m_renderLightsForDraw) - { - //if (light.LightOn && light.Glare.Type == TransparentGeometry.MyLightGlare.GlareTypeEnum.Distant) - { - if ((light.LightType & LightTypeEnum.PointLight) != 0) - { - MyDebugDraw.DrawSphereWireframe(MatrixD.CreateScale(light.Range) * MatrixD.CreateTranslation(light.PositionWithOffset), Color.Red, 1); - MyDebugDraw.DrawAxis(MatrixD.CreateWorld(light.Position, light.ReflectorDirection, light.ReflectorUp), 2, 1, false); - // MyDebugDraw.DrawText(light.PositionWithOffset, new System.Text.StringBuilder(light.ID.ToString()), Color.White, 1); - } - //if ((light.LightType & LightTypeEnum.Hemisphere) != 0) - //{ - // Matrix rotationHotfix = Matrix.CreateFromAxisAngle(Vector3.UnitX, MathHelper.PiOver2); - // Matrix world = Matrix.CreateScale(light.Range) * rotationHotfix * Matrix.CreateWorld(light.Position, light.ReflectorDirection, light.ReflectorUp); - // MyDebugDraw.DrawHemisphereWireframe(world, new Vector3(1, 0, 0), 1); - //} - if ((light.LightType & LightTypeEnum.Spotlight) != 0) - { - // Uncomment to show sphere for spot light - //MyDebugDraw.DrawSphereWireframe(Matrix.CreateScale(light.ReflectorRange) * Matrix.CreateTranslation(light.Position), new Vector3(color.X, color.Y, color.Z), 0.25f); - - //MyDebugDraw.DrawCapsule(light.Position, light.Position + light.ReflectorDirection * light.ReflectorRange, 1, new Color(color.X, color.Y, color.Z), false); - - //float reflectorConeAngle = (float)System.Math.Acos(1 - light.ReflectorConeMaxAngleCos); - //float reflectorRadius = (float)System.Math.Tan(reflectorConeAngle) * light.ReflectorRange; - //MyDebugDraw.DrawCylinder(light.Position, light.Position + light.ReflectorDirection * light.ReflectorRange, 0, reflectorRadius, new Color(color.X, color.Y, color.Z), false); - -// MyDebugDraw.DrawText(light.Position, new System.Text.StringBuilder(light.ShadowMapIndex.ToString() + " (" + (light.SpotQuery != null ? light.QueryPixels.ToString() : "") + ")" ), Color.Yellow, 0.8f, false); - - MyDebugDraw.DrawText(light.Position, new System.Text.StringBuilder(Vector3D.Distance(MyRenderCamera.Position, light.Position).ToString()), Color.Yellow, 0.8f, false); - - MyStateObjects.WireframeClockwiseRasterizerState.Apply(); - DepthStencilState.None.Apply(); - - - - MyDebugDraw.DrawModel(MyDebugDraw.ModelCone, light.SpotWorld, Color.White, false); - } - - //just glare - if (light.LightType == LightTypeEnum.None) - { - MyDebugDraw.DrawSphereWireframe(MatrixD.CreateScale(light.Range) * MatrixD.CreateTranslation(light.PositionWithOffset), Color.Red, 1); - } - } - } +// foreach (MyRenderLight light in m_renderLightsForDraw) +// { +// //if (light.LightOn && light.Glare.Type == TransparentGeometry.MyLightGlare.GlareTypeEnum.Distant) +// { +// if ((light.LightType & LightTypeEnum.PointLight) != 0) +// { +// MyDebugDraw.DrawSphereWireframe(MatrixD.CreateScale(light.Range) * MatrixD.CreateTranslation(light.PositionWithOffset), Color.Red, 1); +// MyDebugDraw.DrawAxis(MatrixD.CreateWorld(light.Position, light.ReflectorDirection, light.ReflectorUp), 2, 1, false); +// // MyDebugDraw.DrawText(light.PositionWithOffset, new System.Text.StringBuilder(light.ID.ToString()), Color.White, 1); +// } +// //if ((light.LightType & LightTypeEnum.Hemisphere) != 0) +// //{ +// // Matrix rotationHotfix = Matrix.CreateFromAxisAngle(Vector3.UnitX, MathHelper.PiOver2); +// // Matrix world = Matrix.CreateScale(light.Range) * rotationHotfix * Matrix.CreateWorld(light.Position, light.ReflectorDirection, light.ReflectorUp); +// // MyDebugDraw.DrawHemisphereWireframe(world, new Vector3(1, 0, 0), 1); +// //} +// if ((light.LightType & LightTypeEnum.Spotlight) != 0) +// { +// // Uncomment to show sphere for spot light +// //MyDebugDraw.DrawSphereWireframe(Matrix.CreateScale(light.ReflectorRange) * Matrix.CreateTranslation(light.Position), new Vector3(color.X, color.Y, color.Z), 0.25f); + +// //MyDebugDraw.DrawCapsule(light.Position, light.Position + light.ReflectorDirection * light.ReflectorRange, 1, new Color(color.X, color.Y, color.Z), false); + +// //float reflectorConeAngle = (float)System.Math.Acos(1 - light.ReflectorConeMaxAngleCos); +// //float reflectorRadius = (float)System.Math.Tan(reflectorConeAngle) * light.ReflectorRange; +// //MyDebugDraw.DrawCylinder(light.Position, light.Position + light.ReflectorDirection * light.ReflectorRange, 0, reflectorRadius, new Color(color.X, color.Y, color.Z), false); + +//// MyDebugDraw.DrawText(light.Position, new System.Text.StringBuilder(light.ShadowMapIndex.ToString() + " (" + (light.SpotQuery != null ? light.QueryPixels.ToString() : "") + ")" ), Color.Yellow, 0.8f, false); + +// MyDebugDraw.DrawText(light.Position, new System.Text.StringBuilder(Vector3D.Distance(MyRenderCamera.Position, light.Position).ToString()), Color.Yellow, 0.8f, false); + +// MyStateObjects.WireframeClockwiseRasterizerState.Apply(); +// DepthStencilState.None.Apply(); + + + +// MyDebugDraw.DrawModel(MyDebugDraw.ModelCone, light.SpotWorld, Color.White, false); +// } + +// //just glare +// if (light.LightType == LightTypeEnum.None) +// { +// MyDebugDraw.DrawSphereWireframe(MatrixD.CreateScale(light.Range) * MatrixD.CreateTranslation(light.PositionWithOffset), Color.Red, 1); +// } +// } +// } } internal static void DrawDebugEnvironmentRenderTargets() @@ -190,7 +190,7 @@ internal static void DrawDebug() GetRenderProfiler().EndProfilingBlock(); } - class MyTypeStats + /* class MyTypeStats { public int Count; public int Tris; @@ -205,7 +205,7 @@ public static void ClearEnhancedStats() { m_typesStats.Clear(); m_prefabStats.Clear(); - } + }*/ /* static private void ShowEnhancedRenderStats() { @@ -335,7 +335,7 @@ static public List> SortByValue(Dictionary> SortByCount(Dictionary stats) + /*static List> SortByCount(Dictionary stats) { List> statsList = stats.ToList(); statsList.Sort( @@ -347,7 +347,7 @@ static List> SortByCount(Dictionary @@ -234,6 +236,7 @@ enum MyDrawCommandEnum struct MyDrawSubmesh_2 { +#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value internal int Count; internal int Start; internal int BaseVertex; @@ -241,6 +244,7 @@ struct MyDrawSubmesh_2 internal MyMaterialProxyId MaterialId; internal int[] BonesMapping; +#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value // possible optimization - pooling for 1-4 length array allocations (used a LOT) internal static readonly MyDrawSubmesh_2[] EmptyList = new MyDrawSubmesh_2[0]; diff --git a/Sources/VRage.Render11/GeometryStage/Geometry/MyAssetMesh.cs b/Sources/VRage.Render11/GeometryStage/Geometry/MyAssetMesh.cs index dfb11bdefe..0eeb97c63c 100644 --- a/Sources/VRage.Render11/GeometryStage/Geometry/MyAssetMesh.cs +++ b/Sources/VRage.Render11/GeometryStage/Geometry/MyAssetMesh.cs @@ -356,7 +356,7 @@ MyRenderMeshInfo LoadMesh(string assetName, out MyLODDescriptor[] LodDescriptors } //indexBuffer.SetDebugName(assetName + " index buffer"); - int c = 0; + //int c = 0; //vertexBuffers.ForEach(x => x.SetDebugName(assetName + " vertex buffer " + c++)); // @@ -377,7 +377,7 @@ MyRenderMeshInfo LoadMesh(string assetName, out MyLODDescriptor[] LodDescriptors importer.Clear(); return result; } - catch(Exception e) + catch (Exception) { return MyAssetsLoader.GetDebugMesh().LODs[0].m_meshInfo; } diff --git a/Sources/VRage.Render11/GeometryStage/Geometry/MyDynamicMesh.cs b/Sources/VRage.Render11/GeometryStage/Geometry/MyDynamicMesh.cs index 68b7670d83..81ad7f15b7 100644 --- a/Sources/VRage.Render11/GeometryStage/Geometry/MyDynamicMesh.cs +++ b/Sources/VRage.Render11/GeometryStage/Geometry/MyDynamicMesh.cs @@ -95,7 +95,6 @@ internal static void GenerateVertexData(ref Vector3D worldPointA, ref Vector3D w Vector3* points = stackalloc Vector3[2]; points[0] = pointA; points[1] = pointB; - int vertexCounter = 0; for (int i = 0; i < 2; ++i) { int baseVertex = i * 4; diff --git a/Sources/VRage.Render11/GeometryStage/Geometry/MyMergeInstancing.cs b/Sources/VRage.Render11/GeometryStage/Geometry/MyMergeInstancing.cs index b119261464..b643c9d2cd 100644 --- a/Sources/VRage.Render11/GeometryStage/Geometry/MyMergeInstancing.cs +++ b/Sources/VRage.Render11/GeometryStage/Geometry/MyMergeInstancing.cs @@ -26,7 +26,9 @@ struct MyPerInstanceData internal Vector4 Row1; internal Vector4 Row2; internal uint DepthBias; +#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value internal Vector3 __padding; +#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value internal static MyPerInstanceData FromWorldMatrix(ref MatrixD matrix, uint depthBias) { diff --git a/Sources/VRage.Render11/GeometryStage/Geometry/MyMeshTableSRV.cs b/Sources/VRage.Render11/GeometryStage/Geometry/MyMeshTableSRV.cs index 0842fd4ebc..54d8af58b5 100644 --- a/Sources/VRage.Render11/GeometryStage/Geometry/MyMeshTableSRV.cs +++ b/Sources/VRage.Render11/GeometryStage/Geometry/MyMeshTableSRV.cs @@ -5,12 +5,12 @@ namespace VRageRender { - struct MyDraw - { - internal int Indices; - internal int StartI; - internal int BaseV; - } + //struct MyDraw + //{ + // internal int Indices; + // internal int StartI; + // internal int BaseV; + //} struct MyMeshTableSRV_Entry { diff --git a/Sources/VRage.Render11/GeometryStage/Geometry/MyMeshes.cs b/Sources/VRage.Render11/GeometryStage/Geometry/MyMeshes.cs index cd43e48b1c..edf0eea3b8 100644 --- a/Sources/VRage.Render11/GeometryStage/Geometry/MyMeshes.cs +++ b/Sources/VRage.Render11/GeometryStage/Geometry/MyMeshes.cs @@ -44,6 +44,19 @@ public int GetHashCode(MeshId meshId) { return x.Index != y.Index; } + + public override bool Equals(object obj) + { + if (obj is MeshId) + return (this == (MeshId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } #endregion internal static readonly MeshId NULL = new MeshId { Index = -1 }; @@ -79,6 +92,19 @@ public int GetHashCode(LodMeshId lodMeshId) { return x.Index != y.Index; } + + public override bool Equals(object obj) + { + if (obj is LodMeshId) + return (this == (LodMeshId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } #endregion internal static readonly LodMeshId NULL = new LodMeshId { Index = -1 }; @@ -177,6 +203,19 @@ public int GetHashCode(MeshPartId meshPartId) { return x.Index != y.Index; } + + public override bool Equals(object obj) + { + if (obj is MeshPartId) + return (this == (MeshPartId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } #endregion internal static readonly MeshPartId NULL = new MeshPartId { Index = -1 }; @@ -262,6 +301,19 @@ public int GetHashCode(VoxelPartId voxelPartId) { return x.Index != y.Index; } + + public override bool Equals(object obj) + { + if (obj is VoxelPartId) + return (this == (VoxelPartId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } #endregion internal static readonly VoxelPartId NULL = new VoxelPartId { Index = -1 }; @@ -363,11 +415,13 @@ public int GetHashCode(MyMergedLodMeshInfo obj) internal MyMeshRawData Data; +#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value internal BoundingBox? BoundingBox; internal HashSet PendingLodMeshes; internal HashSet MergedLodMeshes; internal bool NullMesh; +#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value } struct MyMeshInfo @@ -398,6 +452,19 @@ struct MyMeshBuffers return left.VB0 != right.VB0 || left.VB1 != right.VB1 || left.IB == right.IB; } + public override bool Equals(object obj) + { + if (obj is MyMeshBuffers) + return (this == (MyMeshBuffers)obj); + else + return false; + } + + public override int GetHashCode() + { + throw new InvalidOperationException("GetHashCode and Equals must be overridden"); + } + internal static readonly MyMeshBuffers Empty = new MyMeshBuffers { IB = IndexBufferId.NULL, VB0 = VertexBufferId.NULL, VB1 = VertexBufferId.NULL }; } diff --git a/Sources/VRage.Render11/GeometryStage/Geometry/MyRenderMesh.cs b/Sources/VRage.Render11/GeometryStage/Geometry/MyRenderMesh.cs index df91e89794..63eefddd91 100644 --- a/Sources/VRage.Render11/GeometryStage/Geometry/MyRenderMesh.cs +++ b/Sources/VRage.Render11/GeometryStage/Geometry/MyRenderMesh.cs @@ -52,7 +52,7 @@ class MyRenderMeshInfo internal MyVertexInputLayout VertexLayout; internal VertexBufferId[] VB; internal IndexBufferId IB = IndexBufferId.NULL; - internal int Id; + //internal int Id; internal Dictionary Parts = new Dictionary(); internal Dictionary PartsMetadata = new Dictionary(); // well, we need this too after all internal int PartsNum { get { return Parts.Count; } } @@ -156,7 +156,7 @@ class MyAssetsLoader static Dictionary m_meshes = new Dictionary(); internal static Dictionary ModelRemap = new Dictionary(); - internal static MyAssetMesh m_debugMesh; + //internal static MyAssetMesh m_debugMesh; internal static MyAssetMesh GetModel(string assetName) { @@ -171,7 +171,9 @@ internal static MyAssetMesh GetModel(string assetName) if (LOG_MESH_STATISTICS) { +#pragma warning disable CS0162 // Unreachable code detected model.DebugWriteInfo(); +#pragma warning restore CS0162 // Unreachable code detected } m_meshes[assetName] = model; diff --git a/Sources/VRage.Render11/GeometryStage/Materials/Materials.cs b/Sources/VRage.Render11/GeometryStage/Materials/Materials.cs index a1f86a0610..3f9a24bcc5 100644 --- a/Sources/VRage.Render11/GeometryStage/Materials/Materials.cs +++ b/Sources/VRage.Render11/GeometryStage/Materials/Materials.cs @@ -31,6 +31,19 @@ struct MyMaterialProxyId return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is MyMaterialProxyId) + return (this == (MyMaterialProxyId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly MyMaterialProxyId NULL = new MyMaterialProxyId { Index = -1 }; } diff --git a/Sources/VRage.Render11/GeometryStage/Materials/MeshMaterial.cs b/Sources/VRage.Render11/GeometryStage/Materials/MeshMaterial.cs index 8bbf969acc..0d39fed1be 100644 --- a/Sources/VRage.Render11/GeometryStage/Materials/MeshMaterial.cs +++ b/Sources/VRage.Render11/GeometryStage/Materials/MeshMaterial.cs @@ -42,7 +42,20 @@ struct MyMeshMaterialId return x.Index != y.Index; } - internal static readonly MyMeshMaterialId NULL = new MyMeshMaterialId { Index = -1 }; + public override bool Equals(object obj) + { + if (obj is MyMeshMaterialId) + return (this == (MyMeshMaterialId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + + internal static readonly MyMeshMaterialId NULL = new MyMeshMaterialId { Index = -1 }; internal MyMeshMaterialInfo Info { get { return MyMeshMaterials1.Table[Index]; } } } diff --git a/Sources/VRage.Render11/GeometryStage/MyInstancing.cs b/Sources/VRage.Render11/GeometryStage/MyInstancing.cs index 1854a66977..3465df8fdf 100644 --- a/Sources/VRage.Render11/GeometryStage/MyInstancing.cs +++ b/Sources/VRage.Render11/GeometryStage/MyInstancing.cs @@ -30,6 +30,19 @@ struct InstancingId return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is InstancingId) + return (this == (InstancingId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + public class MyInstancingIdComparerType : IEqualityComparer { public bool Equals(InstancingId left, InstancingId right) diff --git a/Sources/VRage.Render11/GeometryStage/MyRenderingPass.cs b/Sources/VRage.Render11/GeometryStage/MyRenderingPass.cs index b6113402e2..662ecad79f 100644 --- a/Sources/VRage.Render11/GeometryStage/MyRenderingPass.cs +++ b/Sources/VRage.Render11/GeometryStage/MyRenderingPass.cs @@ -246,6 +246,7 @@ internal virtual void End() { if (VRage.MyCompilationSymbols.PerformanceProfiling) { +#pragma warning disable CS0162 // Unreachable code detected if (m_currentProfilingBlock_renderableType != -1) { // close material @@ -253,6 +254,7 @@ internal virtual void End() // close type RC.EndProfilingBlock(); } +#pragma warning restore CS0162 // Unreachable code detected } } diff --git a/Sources/VRage.Render11/GeometryStage/MyVertexInput.cs b/Sources/VRage.Render11/GeometryStage/MyVertexInput.cs index 4b60e371eb..a212ce19b0 100644 --- a/Sources/VRage.Render11/GeometryStage/MyVertexInput.cs +++ b/Sources/VRage.Render11/GeometryStage/MyVertexInput.cs @@ -112,13 +112,21 @@ struct VertexLayoutId return x.Index != y.Index; } - internal static readonly VertexLayoutId NULL = new VertexLayoutId { Index = -1 }; + public override bool Equals(object obj) + { + if (obj is VertexLayoutId) + return (this == (VertexLayoutId)obj); + else + return false; + } public override int GetHashCode() { return Index; } + internal static readonly VertexLayoutId NULL = new VertexLayoutId { Index = -1 }; + internal InputElement[] Elements { get { return MyVertexLayouts.GetElements(this); } } internal MyVertexLayoutInfo Info { get { return MyVertexLayouts.Layouts.Data[Index]; } } internal bool HasBonesInfo { get { return MyVertexLayouts.Layouts.Data[Index].HasBonesInfo; } } diff --git a/Sources/VRage.Render11/LightingStage/EnvironmentProve/MyEnvProbeProcessing.cs b/Sources/VRage.Render11/LightingStage/EnvironmentProve/MyEnvProbeProcessing.cs index cb2851023d..3627d5906d 100644 --- a/Sources/VRage.Render11/LightingStage/EnvironmentProve/MyEnvProbeProcessing.cs +++ b/Sources/VRage.Render11/LightingStage/EnvironmentProve/MyEnvProbeProcessing.cs @@ -25,7 +25,9 @@ struct AtmosphereConstants internal float AtmosphereScaleFactor; internal float Intensity; internal float FogIntensity; +#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value internal Vector2 __padding; +#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value } static PixelShaderId m_ps; @@ -34,7 +36,7 @@ struct AtmosphereConstants static ComputeShaderId m_prefilter; static ComputeShaderId m_blend; - internal static void Init() + internal static new void Init() { m_ps = MyShaders.CreatePs("ForwardPostprocess.hlsl"); m_atmosphere = MyShaders.CreatePs("AtmospherePostprocess.hlsl"); diff --git a/Sources/VRage.Render11/LightingStage/MyAAEdgeMarking.cs b/Sources/VRage.Render11/LightingStage/MyAAEdgeMarking.cs index fac03c1ea4..1df695cb0b 100644 --- a/Sources/VRage.Render11/LightingStage/MyAAEdgeMarking.cs +++ b/Sources/VRage.Render11/LightingStage/MyAAEdgeMarking.cs @@ -13,7 +13,7 @@ class MyAAEdgeMarking : MyScreenPass { static PixelShaderId m_ps; - internal static void Init() + internal static new void Init() { m_ps = MyShaders.CreatePs("edge_detection.hlsl"); } diff --git a/Sources/VRage.Render11/LightingStage/MyAtmosphere.cs b/Sources/VRage.Render11/LightingStage/MyAtmosphere.cs index 5d5671129f..ed4800d247 100644 --- a/Sources/VRage.Render11/LightingStage/MyAtmosphere.cs +++ b/Sources/VRage.Render11/LightingStage/MyAtmosphere.cs @@ -45,7 +45,9 @@ struct AtmospherePrecomputeConstants internal float PlanetScaleFactor; internal float AtmosphereScaleFactor; internal float Intensity; +#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value internal Vector3 __padding; +#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value } struct AtmosphereConstants @@ -62,7 +64,9 @@ struct AtmosphereConstants internal float AtmosphereScaleFactor; internal float Intensity; internal float FogIntensity; +#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value internal Vector2 __padding; +#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value } public class MyAtmosphereRenderer diff --git a/Sources/VRage.Render11/LightingStage/MyClouds.cs b/Sources/VRage.Render11/LightingStage/MyClouds.cs index ebd36b2d75..57b39beeb9 100644 --- a/Sources/VRage.Render11/LightingStage/MyClouds.cs +++ b/Sources/VRage.Render11/LightingStage/MyClouds.cs @@ -50,12 +50,14 @@ struct CloudsConstants struct FogConstants { +#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value internal float LayerAltitude; internal float CameraAltitude; internal float LayerThickness; internal uint CameraTexelX; internal uint CameraTexelY; internal Vector3 _padding; +#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value } public class MyCloudRenderer diff --git a/Sources/VRage.Render11/LightingStage/MyDepthResolve.cs b/Sources/VRage.Render11/LightingStage/MyDepthResolve.cs index 6bc349adf6..f27f75d8af 100644 --- a/Sources/VRage.Render11/LightingStage/MyDepthResolve.cs +++ b/Sources/VRage.Render11/LightingStage/MyDepthResolve.cs @@ -13,7 +13,7 @@ class MyDepthResolve : MyScreenPass { static PixelShaderId m_ps; - internal static void Init() + internal static new void Init() { m_ps = MyShaders.CreatePs("depth_resolve.hlsl"); } diff --git a/Sources/VRage.Render11/LightingStage/MyGbuffer.cs b/Sources/VRage.Render11/LightingStage/MyGbuffer.cs index ad48e2c60b..b8d5efe8e9 100644 --- a/Sources/VRage.Render11/LightingStage/MyGbuffer.cs +++ b/Sources/VRage.Render11/LightingStage/MyGbuffer.cs @@ -125,9 +125,9 @@ internal void Clear() internal static MyGBuffer Main; } - class MyCubemapRenderer - { - internal MyGBuffer m_faceGbuffer; + //class MyCubemapRenderer + //{ + // internal MyGBuffer m_faceGbuffer; - } + //} } diff --git a/Sources/VRage.Render11/LightingStage/MyLight.cs b/Sources/VRage.Render11/LightingStage/MyLight.cs index 5d85526ba7..1603d26cf9 100644 --- a/Sources/VRage.Render11/LightingStage/MyLight.cs +++ b/Sources/VRage.Render11/LightingStage/MyLight.cs @@ -32,11 +32,14 @@ struct MyLightInfo internal int ParentGID; internal bool UsedInForward; internal bool CastsShadows; +#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value internal bool CastsShadowsThisFrame; +#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value } struct MyPointlightInfo { +#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value internal bool Enabled; internal float Range; internal Vector3 Color; @@ -48,6 +51,7 @@ struct MyPointlightInfo internal int BvhProxyId; internal TexId StaticShadowTexture; +#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value } struct MySpotlightInfo @@ -70,15 +74,15 @@ struct MySpotlightInfo internal bool ViewProjectionDirty; } - struct MyHemisphericalLightInfo - { - internal float Range; - internal Vector3 Color; - internal float Falloff; - internal float SphereRadius; - internal Vector3 Direction; - internal Vector3 Up; - } + //struct MyHemisphericalLightInfo + //{ + // internal float Range; + // internal Vector3 Color; + // internal float Falloff; + // internal float SphereRadius; + // internal Vector3 Direction; + // internal Vector3 Up; + //} struct MyGlareDesc { @@ -119,6 +123,19 @@ struct LightId return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is LightId) + return (this == (LightId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly LightId NULL = new LightId { Index = -1 }; internal Vector3D SpotPosition { get { return MyLights.Lights.Data[Index].SpotPosition; } } diff --git a/Sources/VRage.Render11/LightingStage/MyLightRendering.cs b/Sources/VRage.Render11/LightingStage/MyLightRendering.cs index 7d44d5574c..879162fae2 100644 --- a/Sources/VRage.Render11/LightingStage/MyLightRendering.cs +++ b/Sources/VRage.Render11/LightingStage/MyLightRendering.cs @@ -44,9 +44,9 @@ struct SpotlightConstants class MyLightRendering : MyImmediateRC { internal static ConstantsBufferId m_pointlightsConstants; - internal static int m_activePointlights; + //internal static int m_activePointlights; internal static ConstantsBufferId m_spotlightsConstants; - internal static int m_activeSpotlights; + //internal static int m_activeSpotlights; internal static ConstantsBufferId m_sunlightConstants; static PixelShaderId DirectionalEnvironmentLight_NoShadow = PixelShaderId.NULL; diff --git a/Sources/VRage.Render11/LightingStage/Shadows/MyShadowCascades.cs b/Sources/VRage.Render11/LightingStage/Shadows/MyShadowCascades.cs index e8b22656ae..3d4b1e6700 100644 --- a/Sources/VRage.Render11/LightingStage/Shadows/MyShadowCascades.cs +++ b/Sources/VRage.Render11/LightingStage/Shadows/MyShadowCascades.cs @@ -316,7 +316,9 @@ internal unsafe void PrepareQueries(List appendShadowmapQuerie // draw cascade bounding primtiive if (VISUALIZE_DEBUG) { +#pragma warning disable CS0162 // Unreachable code detected var oldInvView = MatrixD.Invert(m_oldView); + Vector3D.Transform(m_frustumVerticesWS, ref oldInvView, m_frustumVerticesWS); var verticesF = new Vector3[8]; @@ -332,6 +334,7 @@ internal unsafe void PrepareQueries(List appendShadowmapQuerie batch.AddBoundingBox(bb, Color.OrangeRed); batch.Commit(); +#pragma warning restore CS0162 // Unreachable code detected } continue; @@ -406,7 +409,9 @@ internal unsafe void PrepareQueries(List appendShadowmapQuerie } if (VISUALIZE_DEBUG) +#pragma warning disable CS0162 // Unreachable code detected DebugDrawFrozen(cascadesMatrices); +#pragma warning restore CS0162 // Unreachable code detected FillConstantBuffer(m_csmConstants); diff --git a/Sources/VRage.Render11/LightingStage/Shadows/MyShadows.cs b/Sources/VRage.Render11/LightingStage/Shadows/MyShadows.cs index 16ba62a9cf..d2a360c624 100644 --- a/Sources/VRage.Render11/LightingStage/Shadows/MyShadows.cs +++ b/Sources/VRage.Render11/LightingStage/Shadows/MyShadows.cs @@ -7,11 +7,11 @@ namespace VRageRender { - struct MyViewTransformation - { - internal Matrix View3x3; - internal Vector3D CameraPosition; - } + //struct MyViewTransformation + //{ + // internal Matrix View3x3; + // internal Vector3D CameraPosition; + //} partial class MyRender11 { @@ -38,7 +38,9 @@ internal struct MyShadowmapQuery internal MyFrustumEnum QueryType; internal int CascadeIndex; +#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value internal HashSet IgnoredEntities; +#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value } class MyLightsCameraDistanceComparer : IComparer { @@ -120,45 +122,45 @@ private void PrepareSpotlights() if (MyLightRendering.VisibleSpotlights.Count == 0) OtherShadowsTriangleCounter = 0; return; - MyLightRendering.VisibleSpotlights.Sort(m_spotlightCastersComparer); - MyArrayHelpers.Reserve(ref MyLightRendering.Spotlights, MyLightRendering.VisibleSpotlights.Count); - - int index = 0; - int casterIndex = 0; - var worldMatrix = MatrixD.CreateTranslation(MyEnvironment.CameraPosition); - foreach (var id in MyLightRendering.VisibleSpotlights) - { - if (id.CastsShadows && casterIndex < MAX_SPOTLIGHT_SHADOWCASTERS) - { - if(ShadowmapsPool.Count <= casterIndex) - ShadowmapsPool.Add(MyRwTextures.CreateShadowmap(SpotlightShadowmapSize, SpotlightShadowmapSize)); - - MyLights.Lights.Data[id.Index].CastsShadowsThisFrame = true; - - MatrixD viewProjection = MyLights.GetSpotlightViewProjection(id); - var query = new MyShadowmapQuery - { - DepthBuffer = ShadowmapsPool[casterIndex].Dsv, - Viewport = new MyViewport(SpotlightShadowmapSize, SpotlightShadowmapSize), - QueryType = MyFrustumEnum.ShadowProjection, - ProjectionInfo = new MyProjectionInfo - { - WorldCameraOffsetPosition = MyEnvironment.CameraPosition, - WorldToProjection = viewProjection, - LocalToProjection = worldMatrix * viewProjection - }, - IgnoredEntities = MyLights.IgnoredEntitites.ContainsKey(id) ? MyLights.IgnoredEntitites[id] : null, - }; - m_shadowmapQueries.Add(query); - ++casterIndex; - } - else - { - MyLights.Lights.Data[id.Index].CastsShadowsThisFrame = false; - } - - index++; - } + //MyLightRendering.VisibleSpotlights.Sort(m_spotlightCastersComparer); + //MyArrayHelpers.Reserve(ref MyLightRendering.Spotlights, MyLightRendering.VisibleSpotlights.Count); + + //int index = 0; + //int casterIndex = 0; + //var worldMatrix = MatrixD.CreateTranslation(MyEnvironment.CameraPosition); + //foreach (var id in MyLightRendering.VisibleSpotlights) + //{ + // if (id.CastsShadows && casterIndex < MAX_SPOTLIGHT_SHADOWCASTERS) + // { + // if(ShadowmapsPool.Count <= casterIndex) + // ShadowmapsPool.Add(MyRwTextures.CreateShadowmap(SpotlightShadowmapSize, SpotlightShadowmapSize)); + + // MyLights.Lights.Data[id.Index].CastsShadowsThisFrame = true; + + // MatrixD viewProjection = MyLights.GetSpotlightViewProjection(id); + // var query = new MyShadowmapQuery + // { + // DepthBuffer = ShadowmapsPool[casterIndex].Dsv, + // Viewport = new MyViewport(SpotlightShadowmapSize, SpotlightShadowmapSize), + // QueryType = MyFrustumEnum.ShadowProjection, + // ProjectionInfo = new MyProjectionInfo + // { + // WorldCameraOffsetPosition = MyEnvironment.CameraPosition, + // WorldToProjection = viewProjection, + // LocalToProjection = worldMatrix * viewProjection + // }, + // IgnoredEntities = MyLights.IgnoredEntitites.ContainsKey(id) ? MyLights.IgnoredEntitites[id] : null, + // }; + // m_shadowmapQueries.Add(query); + // ++casterIndex; + // } + // else + // { + // MyLights.Lights.Data[id.Index].CastsShadowsThisFrame = false; + // } + + // index++; + //} } } } diff --git a/Sources/VRage.Render11/PostprocessStage/MyBlendTargets.cs b/Sources/VRage.Render11/PostprocessStage/MyBlendTargets.cs index 67cc55dcff..9de8e96990 100644 --- a/Sources/VRage.Render11/PostprocessStage/MyBlendTargets.cs +++ b/Sources/VRage.Render11/PostprocessStage/MyBlendTargets.cs @@ -8,7 +8,7 @@ class MyBlendTargets : MyScreenPass static PixelShaderId m_stencilTestPixelShader = PixelShaderId.NULL; static PixelShaderId m_stencilInverseTestPixelShader = PixelShaderId.NULL; - internal static void Init() + internal static new void Init() { m_copyPixelShader = MyShaders.CreatePs("postprocess_copy.hlsl"); m_stencilTestPixelShader = MyShaders.CreatePs("postprocess_copy_stencil.hlsl"); diff --git a/Sources/VRage.Render11/PostprocessStage/MyBlur.cs b/Sources/VRage.Render11/PostprocessStage/MyBlur.cs index 22d50f0a34..1b2fab55a7 100644 --- a/Sources/VRage.Render11/PostprocessStage/MyBlur.cs +++ b/Sources/VRage.Render11/PostprocessStage/MyBlur.cs @@ -24,7 +24,10 @@ private struct BlurConstants { internal float DistributionWeight; internal int StencilRef; + +#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value internal Vector2 _padding; + #pragma warning restore CS0649 // Field is never assigned to, and will always have its default value } private static ConstantsBufferId m_blurConstantBuffer; @@ -32,7 +35,7 @@ private struct BlurConstants // Item1 is horizontal, Item2 is vertical pass private static Dictionary> m_blurShaders = null; - internal static unsafe void Init() + internal static unsafe new void Init() { int typeCount = Enum.GetValues(typeof(MyBlurDensityFunctionType)).Length; m_blurShaders = new Dictionary>(); diff --git a/Sources/VRage.Render11/PostprocessStage/MyOutline.cs b/Sources/VRage.Render11/PostprocessStage/MyOutline.cs index 30a6e0daf5..0ca241e84b 100644 --- a/Sources/VRage.Render11/PostprocessStage/MyOutline.cs +++ b/Sources/VRage.Render11/PostprocessStage/MyOutline.cs @@ -12,7 +12,7 @@ namespace VRageRender { struct MyOutlineDesc { - internal MyStringId Material; + //internal MyStringId Material; internal int SectionIndex; internal Color Color; internal float Thickness; diff --git a/Sources/VRage.Render11/PostprocessStage/MyPlanetBlur.cs b/Sources/VRage.Render11/PostprocessStage/MyPlanetBlur.cs index e3ab619426..7074423431 100644 --- a/Sources/VRage.Render11/PostprocessStage/MyPlanetBlur.cs +++ b/Sources/VRage.Render11/PostprocessStage/MyPlanetBlur.cs @@ -61,7 +61,7 @@ internal static void Run(MyBindableResource dst1, MyBindableResource dst2, MyBin // MyBlendTargets.Run(MyGBuffer.Main.Get(MyGbufferSlot.LBuffer), MyScreenDependants.m_planetBlur2, MyRender11.BlendPlanetBlur); } - internal static void Init() + internal static new void Init() { Settings = MyPlanetBlurSettings.Defaults(); MyRender11.RegisterSettingsChangedListener(new OnSettingsChangedDelegate(RecreateShadersForSettings)); diff --git a/Sources/VRage.Render11/PostprocessStage/MySSAO.cs b/Sources/VRage.Render11/PostprocessStage/MySSAO.cs index dc8679813e..4e0c616171 100644 --- a/Sources/VRage.Render11/PostprocessStage/MySSAO.cs +++ b/Sources/VRage.Render11/PostprocessStage/MySSAO.cs @@ -122,7 +122,7 @@ internal static void Run(MyBindableResource dst, MyGBuffer gbuffer, MyBindableRe DrawFullscreenQuad(); } - internal static void Init() + internal static new void Init() { MyRender11.RegisterSettingsChangedListener(new OnSettingsChangedDelegate(RecreateShadersForSettings)); } diff --git a/Sources/VRage.Render11/PostprocessStage/MySaveExportedTextures.cs b/Sources/VRage.Render11/PostprocessStage/MySaveExportedTextures.cs index 4dac8ae161..64cf38ea7f 100644 --- a/Sources/VRage.Render11/PostprocessStage/MySaveExportedTextures.cs +++ b/Sources/VRage.Render11/PostprocessStage/MySaveExportedTextures.cs @@ -16,7 +16,7 @@ class MySaveExportedTextures : MyScreenPass static bool m_initialized; - private unsafe static void Init() + private unsafe static new void Init() { m_ps = MyShaders.CreatePs("postprocess_colorize_exported_texture.hlsl"); m_cb = MyHwBuffers.CreateConstantsBuffer(sizeof(Vector4), "ExportedTexturesColor"); diff --git a/Sources/VRage.Render11/Render/MyQuery.cs b/Sources/VRage.Render11/Render/MyQuery.cs index bb68a92160..9280609fc7 100644 --- a/Sources/VRage.Render11/Render/MyQuery.cs +++ b/Sources/VRage.Render11/Render/MyQuery.cs @@ -30,7 +30,7 @@ static class MyQueryFactory internal static MyConcurrentPool m_disjointQueries; internal static MyConcurrentPool m_timestampQueries; - internal static List m_pool; + internal static List m_pool = null; static MyQueryFactory() { diff --git a/Sources/VRage.Render11/Render/MyRender-Content.cs b/Sources/VRage.Render11/Render/MyRender-Content.cs index 5589bc2dcd..7c04c851c9 100644 --- a/Sources/VRage.Render11/Render/MyRender-Content.cs +++ b/Sources/VRage.Render11/Render/MyRender-Content.cs @@ -142,7 +142,9 @@ internal static void UnloadData() MyScene.DynamicRenderablesDBVH.Clear(); if (MyScene.SeparateGeometry) +#pragma warning disable CS0162 // Unreachable code detected MyScene.StaticRenderablesDBVH.Clear(); +#pragma warning restore CS0162 // Unreachable code detected MyScene.GroupsDBVH.Clear(); MyScene.FoliageDBVH.Clear(); MyClipmapFactory.RemoveAll(); diff --git a/Sources/VRage.Render11/Render/MyRender-Device.cs b/Sources/VRage.Render11/Render/MyRender-Device.cs index a8acc91e9a..5d8d3f5222 100644 --- a/Sources/VRage.Render11/Render/MyRender-Device.cs +++ b/Sources/VRage.Render11/Render/MyRender-Device.cs @@ -46,11 +46,13 @@ static private void InitDebugOutput() { if (VRage.MyCompilationSymbols.DX11Debug && VRage.MyCompilationSymbols.DX11DebugOutput) { +#pragma warning disable CS0162 // Unreachable code detected DebugInfoQueue = Device.QueryInterface(); DebugInfoQueue.SetBreakOnSeverity(MessageSeverity.Corruption, true); DebugInfoQueue.SetBreakOnSeverity(MessageSeverity.Error, true); DebugInfoQueue.MessageCountLimit = 4096; DebugInfoQueue.ClearStorageFilter(); +#pragma warning restore CS0162 // Unreachable code detected } } private static long m_lastSkippedCount; @@ -217,7 +219,9 @@ private static MyRenderDeviceSettings CreateDeviceInternal(IntPtr windowHandle, #if DEBUG if (VRage.MyCompilationSymbols.DX11Debug) +#pragma warning disable CS0162 // Unreachable code detected flags |= DeviceCreationFlags.Debug; +#pragma warning restore CS0162 // Unreachable code detected #endif WinApi.DEVMODE mode = new WinApi.DEVMODE(); @@ -376,9 +380,11 @@ internal static void DisposeDevice() #if DEBUG if (VRage.MyCompilationSymbols.DX11Debug) { +#pragma warning disable CS0162 // Unreachable code detected var deviceDebug = new DeviceDebug(Device); deviceDebug.ReportLiveDeviceObjects(ReportingLevel.Detail | ReportingLevel.Summary); deviceDebug.Dispose(); +#pragma warning restore CS0162 // Unreachable code detected } #endif diff --git a/Sources/VRage.Render11/Render/MyRender-Draw.cs b/Sources/VRage.Render11/Render/MyRender-Draw.cs index 78fd0096b0..ce7b8bea3e 100644 --- a/Sources/VRage.Render11/Render/MyRender-Draw.cs +++ b/Sources/VRage.Render11/Render/MyRender-Draw.cs @@ -28,7 +28,7 @@ partial class MyRender11 { static Queue m_drawQueue = new Queue(); static Queue m_debugDrawMessages = new Queue(); - static bool m_reloadShaders; + //static bool m_reloadShaders; static MyScreenshot? m_screenshot; diff --git a/Sources/VRage.Render11/Render/MyRender-DrawScene.cs b/Sources/VRage.Render11/Render/MyRender-DrawScene.cs index a704e3d1ba..161aee8a85 100644 --- a/Sources/VRage.Render11/Render/MyRender-DrawScene.cs +++ b/Sources/VRage.Render11/Render/MyRender-DrawScene.cs @@ -38,7 +38,9 @@ internal static void Init() { DynamicGeometryRenderer = new MyGeometryRenderer(MyScene.DynamicRenderablesDBVH, DynamicShadows); if (MyScene.SeparateGeometry) +#pragma warning disable CS0162 // Unreachable code detected StaticGeometryRenderer = new MyGeometryRenderer(MyScene.StaticRenderablesDBVH, StaticShadows); +#pragma warning restore CS0162 // Unreachable code detected m_foliageGenerator = new MyFoliageGeneratingPass(); m_foliageRenderer = new MyFoliageRenderingPass(); @@ -54,9 +56,11 @@ private static void InitShadowCascadeUpdateIntervals(int cascadeCount) if (MyScene.SeparateGeometry) { - StaticShadows.ShadowCascades.SetCascadeUpdateInterval(cascadeIndex, +#pragma warning disable CS0162 // Unreachable code detected + StaticShadows.ShadowCascades.SetCascadeUpdateInterval(cascadeIndex, MyShadowCascades.VoxelShadowCascadeUpdateIntervals[cascadeIndex].Item1, MyShadowCascades.VoxelShadowCascadeUpdateIntervals[cascadeIndex].Item2); +#pragma warning restore CS0162 // Unreachable code detected } } } @@ -75,7 +79,9 @@ private static void ResetShadows(int cascadeCount, int cascadeResolution) if (StaticShadows != null) StaticShadows.Reset(cascadeCount, cascadeResolution); else if(MyScene.SeparateGeometry) +#pragma warning disable CS0162 // Unreachable code detected StaticShadows = new MyShadows(cascadeCount, cascadeResolution); +#pragma warning restore CS0162 // Unreachable code detected InitShadowCascadeUpdateIntervals(cascadeCount); } @@ -306,7 +312,9 @@ private static MyBindableResource DrawGameScene(MyBindableResource renderTarget) Debug.Assert(m_commandLists.Count == 0, "Not all command lists executed last frame!"); DynamicGeometryRenderer.Render(m_commandLists, true); if (MyScene.SeparateGeometry) +#pragma warning disable CS0162 // Unreachable code detected StaticGeometryRenderer.Render(m_commandLists, false); +#pragma warning restore CS0162 // Unreachable code detected SendGlobalOutputMessages(); ExecuteCommandLists(m_commandLists); @@ -356,7 +364,9 @@ private static MyBindableResource DrawGameScene(MyBindableResource renderTarget) MyGpuProfiler.IC_BeginBlock("Shadows"); if (MyScene.SeparateGeometry) { +#pragma warning disable CS0162 // Unreachable code detected MyShadowCascadesPostProcess.Combine(MyShadowCascades.CombineShadowmapArray, DynamicShadows.ShadowCascades, StaticShadows.ShadowCascades); +#pragma warning restore CS0162 // Unreachable code detected DynamicShadows.ShadowCascades.PostProcess(MyRender11.PostProcessedShadows, MyShadowCascades.CombineShadowmapArray); } else diff --git a/Sources/VRage.Render11/Render/MyRender-MessageSwitch.cs b/Sources/VRage.Render11/Render/MyRender-MessageSwitch.cs index b563f25f58..79bb5b4f06 100644 --- a/Sources/VRage.Render11/Render/MyRender-MessageSwitch.cs +++ b/Sources/VRage.Render11/Render/MyRender-MessageSwitch.cs @@ -36,12 +36,12 @@ static partial class MyRender11 internal static Vector3 ColorFromMask(Vector3 hsv) { return hsv; - if (hsv != new Vector3(0, -1, 0) && hsv != new Vector3(0, 0, 0)) - { - var rgb = new Vector3(hsv.X, MathExt.Saturate(1 + hsv.Y), MathExt.Saturate(1 + hsv.Z)).HSVtoColor().ToVector3(); - return rgb; - } - return Vector3.One; + //if (hsv != new Vector3(0, -1, 0) && hsv != new Vector3(0, 0, 0)) + //{ + // var rgb = new Vector3(hsv.X, MathExt.Saturate(1 + hsv.Y), MathExt.Saturate(1 + hsv.Z)).HSVtoColor().ToVector3(); + // return rgb; + //} + //return Vector3.One; } private static void ProcessMessage(MyRenderMessageBase message) @@ -1405,7 +1405,7 @@ private static void ProcessMessageInternal(MyRenderMessageBase message) case MyRenderMessageEnum.ReloadEffects: { - m_reloadShaders = true; + //m_reloadShaders = true; //MyShaderBundleFactory.ClearCache(); //MyShaderMaterial.ClearCache(); diff --git a/Sources/VRage.Render11/Render/MyRender-SwapChain.cs b/Sources/VRage.Render11/Render/MyRender-SwapChain.cs index 55f0147302..080a88d500 100644 --- a/Sources/VRage.Render11/Render/MyRender-SwapChain.cs +++ b/Sources/VRage.Render11/Render/MyRender-SwapChain.cs @@ -100,7 +100,9 @@ public static int MipmapsToSkip(this MyTextureQuality quality, int width, int he { if (MyRender11Options.NsightDebugging) { +#pragma warning disable CS0162 // Unreachable code detected return (int)Math.Max(0, (((uint)Math.Log(Math.Min(width, height), 2)) - 3)); +#pragma warning restore CS0162 // Unreachable code detected } switch( quality) diff --git a/Sources/VRage.Render11/Render/MyVertexFormats.cs b/Sources/VRage.Render11/Render/MyVertexFormats.cs index bb039ba59d..322cc75617 100644 --- a/Sources/VRage.Render11/Render/MyVertexFormats.cs +++ b/Sources/VRage.Render11/Render/MyVertexFormats.cs @@ -203,10 +203,12 @@ unsafe struct MyVertexFormatCubeInstance unsafe struct MyVertexFormatGenericInstance { +#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value internal HalfVector4 row0; internal HalfVector4 row1; internal HalfVector4 row2; internal HalfVector4 colorMaskHSV; +#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value internal static int STRIDE = sizeof(MyVertexFormatGenericInstance); } diff --git a/Sources/VRage.Render11/Render/Utils/MyDebugRenderer.cs b/Sources/VRage.Render11/Render/Utils/MyDebugRenderer.cs index 43a1949cdb..0b3a13f0db 100644 --- a/Sources/VRage.Render11/Render/Utils/MyDebugRenderer.cs +++ b/Sources/VRage.Render11/Render/Utils/MyDebugRenderer.cs @@ -300,8 +300,10 @@ internal static void Draw(MyBindableResource renderTarget) DrawCascades(MyRender11.DynamicShadows.ShadowCascades, 100, 100, 200); if (MyScene.SeparateGeometry) { +#pragma warning disable CS0162 // Unreachable code detected DrawCascades(MyRender11.StaticShadows.ShadowCascades, 100, 300, 200); DrawCombinedCascades(100, 500, 200); +#pragma warning restore CS0162 // Unreachable code detected } } @@ -312,6 +314,7 @@ internal static void Draw(MyBindableResource renderTarget) if (false) { +#pragma warning disable CS0162 // Unreachable code detected var batch = MyLinesRenderer.CreateBatch(); foreach (var light in MyLightRendering.VisiblePointlights) @@ -319,6 +322,7 @@ internal static void Draw(MyBindableResource renderTarget) batch.AddSphereRing(new BoundingSphere(light.PointPosition, 0.5f), Color.White, Matrix.Identity); } batch.Commit(); +#pragma warning restore CS0162 // Unreachable code detected } // draw terrain lods @@ -386,6 +390,7 @@ internal static void Draw(MyBindableResource renderTarget) // draw lods if(false) { +#pragma warning disable CS0162 // Unreachable code detected var batch = MyLinesRenderer.CreateBatch(); //foreach (var renderable in MyComponentFactory.GetAll().Where(x => ((x.GetMesh() as MyVoxelMesh) == null))) @@ -398,6 +403,7 @@ internal static void Draw(MyBindableResource renderTarget) //} batch.Commit(); +#pragma warning restore CS0162 // Unreachable code detected } } @@ -521,10 +527,6 @@ private static void TransformRay(ref Ray ray, ref Matrix matrix) ray.Direction = ray.Direction - ray.Position; } - static Matrix m_proj; - static Matrix m_vp; - static Matrix m_invvp; - internal static void DrawSceneDebug() { //if(true) @@ -606,9 +608,10 @@ internal static void DrawSceneDebug() // if (false) { +#pragma warning disable CS0162 // Unreachable code detected MyLinesBatch batch = MyLinesRenderer.CreateBatch(); - foreach(var r in MyComponentFactory.GetAll()) + foreach (var r in MyComponentFactory.GetAll()) { if(r.Owner.GetInstanceLod() != null) { @@ -617,12 +620,14 @@ internal static void DrawSceneDebug() } batch.Commit(); +#pragma warning restore CS0162 // Unreachable code detected } if (false) { +#pragma warning disable CS0162 // Unreachable code detected MyLinesBatch batch = MyLinesRenderer.CreateBatch(); - //var radius = new [] { 0, 40, 72, 128, 256 , 512 }; + //var radius = new [] { 0, 40, 72, 128, 256 , 512 }; var radius = new[] { 0, 50, 80, 128, 256, 512 }; float cellSize = 8; @@ -691,6 +696,7 @@ internal static void DrawSceneDebug() batch.Commit(); } +#pragma warning restore CS0162 // Unreachable code detected } } } diff --git a/Sources/VRage.Render11/Resources/MyResource.cs b/Sources/VRage.Render11/Resources/MyResource.cs index a8aefa65a1..b6bad61918 100644 --- a/Sources/VRage.Render11/Resources/MyResource.cs +++ b/Sources/VRage.Render11/Resources/MyResource.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; @@ -151,6 +151,19 @@ struct ConstantsBufferId return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is ConstantsBufferId) + return (this == (ConstantsBufferId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly ConstantsBufferId NULL = new ConstantsBufferId { Index = -1 }; // @@ -175,6 +188,19 @@ struct VertexBufferId return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is VertexBufferId) + return (this == (VertexBufferId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly VertexBufferId NULL = new VertexBufferId { Index = -1 }; @@ -201,6 +227,19 @@ struct IndexBufferId return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is IndexBufferId) + return (this == (IndexBufferId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly IndexBufferId NULL = new IndexBufferId { Index = -1 }; @@ -225,6 +264,19 @@ struct StructuredBufferId : IShaderResourceBindable return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is StructuredBufferId) + return (this == (StructuredBufferId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly StructuredBufferId NULL = new StructuredBufferId { Index = -1 }; internal Buffer Buffer { get { return MyHwBuffers.GetBuffer(this); } } @@ -832,6 +884,19 @@ struct RasterizerId return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is RasterizerId) + return (this == (RasterizerId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly RasterizerId NULL = new RasterizerId { Index = -1 }; @@ -857,6 +922,19 @@ struct SamplerId return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is SamplerId) + return (this == (SamplerId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly SamplerId NULL = new SamplerId { Index = -1 }; @@ -901,7 +979,20 @@ public int Index { return x.Index != y.Index || x.Init != y.Init; } - + + public override bool Equals(object obj) + { + if (obj is BlendId) + return (this == (BlendId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + public static implicit operator BlendState(BlendId id) { return MyPipelineStates.GetBlend(id); @@ -927,6 +1018,19 @@ private bool Init get { return m_Init; } } + public override bool Equals(object obj) + { + if (obj is DepthStencilId) + return (this == (DepthStencilId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + public int Index { get { return m_Index; } diff --git a/Sources/VRage.Render11/Resources/MyTextures.cs b/Sources/VRage.Render11/Resources/MyTextures.cs index 30b9922030..45ec51c27f 100644 --- a/Sources/VRage.Render11/Resources/MyTextures.cs +++ b/Sources/VRage.Render11/Resources/MyTextures.cs @@ -39,6 +39,19 @@ struct TexId : IShaderResourceBindable return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is TexId) + return (this == (TexId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly TexId NULL = new TexId { Index = -1 }; public ShaderResourceView SRV { get { return MyTextures.Views[Index]; } } @@ -808,6 +821,19 @@ public int GetHashCode(RwTexId rwTexId) { return x.Index != y.Index; } + + public override bool Equals(object obj) + { + if (obj is RwTexId) + return (this == (RwTexId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } #endregion internal static readonly RwTexId NULL = new RwTexId { Index = -1 }; @@ -857,6 +883,14 @@ public int GetHashCode(MySubresourceId subresourceId) x.Subresource != y.Subresource; } + public override bool Equals(object obj) + { + if (obj is MySubresourceId) + return (this == (MySubresourceId)obj); + else + return false; + } + public override int GetHashCode() { return Id.Index * 397 ^ Subresource; diff --git a/Sources/VRage.Render11/Shader/MyMaterialShaders.cs b/Sources/VRage.Render11/Shader/MyMaterialShaders.cs index a13b9257cb..729d3faf3a 100644 --- a/Sources/VRage.Render11/Shader/MyMaterialShaders.cs +++ b/Sources/VRage.Render11/Shader/MyMaterialShaders.cs @@ -57,6 +57,19 @@ struct MyMaterialShadersBundleId return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is MyMaterialShadersBundleId) + return (this == (MyMaterialShadersBundleId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly MyMaterialShadersBundleId NULL = new MyMaterialShadersBundleId { Index = -1 }; internal InputLayout IL { get { return MyMaterialShaders.Bundles[Index].IL; } } @@ -298,7 +311,7 @@ static void InitBundle(MyMaterialShadersBundleId id, bool invalidateCache = fals Bundles[id.Index].PS = new PixelShader(MyRender11.Device, psBytecode); Bundles[id.Index].IL = info.Layout.Elements.Length > 0 ? new InputLayout(MyRender11.Device, vsBytecode, info.Layout.Elements) : null; } - catch (SharpDXException e) + catch (SharpDXException) { if (!invalidateCache) { diff --git a/Sources/VRage.Render11/Shader/MyShaderCacheGenerator.cs b/Sources/VRage.Render11/Shader/MyShaderCacheGenerator.cs index 793647eef2..dea923883d 100644 --- a/Sources/VRage.Render11/Shader/MyShaderCacheGenerator.cs +++ b/Sources/VRage.Render11/Shader/MyShaderCacheGenerator.cs @@ -296,7 +296,6 @@ private static void PreCompile(string source, List macros, MyShader var compiled = MyShaders.Compile(source, macrosArray, profile, descriptor, true, false, out wasCached, out compileLog); if (onShaderCacheProgress != null) { - string message = ""; if (wasCached) onShaderCacheProgress(progress, descriptor + vertexLayoutString, MyShadersDefines.ProfileToString(profile), vertexLayoutString, macrosArray.GetString(), "skipped", false); else if (compileLog != null) diff --git a/Sources/VRage.Render11/Shader/MyShaders.cs b/Sources/VRage.Render11/Shader/MyShaders.cs index a9fc5b8a45..9fb2673f23 100644 --- a/Sources/VRage.Render11/Shader/MyShaders.cs +++ b/Sources/VRage.Render11/Shader/MyShaders.cs @@ -36,6 +36,19 @@ struct ShaderBytecodeId return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is ShaderBytecodeId) + return (this == (ShaderBytecodeId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly ShaderBytecodeId NULL = new ShaderBytecodeId { Index = -1 }; } @@ -53,6 +66,19 @@ struct InputLayoutId return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is InputLayoutId) + return (this == (InputLayoutId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly InputLayoutId NULL = new InputLayoutId { Index = -1 }; @@ -76,6 +102,19 @@ struct VertexShaderId return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is VertexShaderId) + return (this == (VertexShaderId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly VertexShaderId NULL = new VertexShaderId { Index = -1 }; public static implicit operator VertexShader(VertexShaderId id) @@ -100,6 +139,19 @@ public struct PixelShaderId return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is PixelShaderId) + return (this == (PixelShaderId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly PixelShaderId NULL = new PixelShaderId { Index = -1 }; public static implicit operator PixelShader(PixelShaderId id) @@ -122,6 +174,19 @@ struct ComputeShaderId return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is ComputeShaderId) + return (this == (ComputeShaderId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly ComputeShaderId NULL = new ComputeShaderId { Index = -1 }; public static implicit operator ComputeShader(ComputeShaderId id) @@ -148,6 +213,19 @@ struct GeometryShaderId return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is GeometryShaderId) + return (this == (GeometryShaderId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly GeometryShaderId NULL = new GeometryShaderId { Index = -1 }; public static implicit operator GeometryShader(GeometryShaderId id) @@ -436,6 +514,7 @@ internal static byte[] Compile(string source, ShaderMacro[] macros, MyShadersDef if (DUMP_CODE) { +#pragma warning disable CS0162 // Unreachable code detected var disassembly = compilationResult.Bytecode.Disassemble(DisassemblyFlags.EnableColorCode | DisassemblyFlags.EnableInstructionNumbering); string asmPath; @@ -452,6 +531,7 @@ internal static byte[] Compile(string source, ShaderMacro[] macros, MyShadersDef { writer.Write(disassembly); } +#pragma warning restore CS0162 // Unreachable code detected } if (compilationResult.Message != null) @@ -531,7 +611,7 @@ internal static void InitVs(VertexShaderId id) { VsObjects[id.Index] = new VertexShader(MyRender11.Device, GetBytecode(bytecodeId)); } - catch (SharpDXException e) + catch (SharpDXException) { Compile(bytecodeId, true); VsObjects[id.Index] = new VertexShader(MyRender11.Device, GetBytecode(bytecodeId)); @@ -552,7 +632,7 @@ internal static void InitPs(PixelShaderId id) { PsObjects[id.Index] = new PixelShader(MyRender11.Device, GetBytecode(bytecodeId)); } - catch (SharpDXException e) + catch (SharpDXException) { Compile(bytecodeId, true); PsObjects[id.Index] = new PixelShader(MyRender11.Device, GetBytecode(bytecodeId)); @@ -573,7 +653,7 @@ internal static void InitCs(ComputeShaderId id) { CsObjects[id.Index] = new ComputeShader(MyRender11.Device, GetBytecode(bytecodeId)); } - catch (SharpDXException e) + catch (SharpDXException) { Compile(bytecodeId, true); CsObjects[id.Index] = new ComputeShader(MyRender11.Device, GetBytecode(bytecodeId)); @@ -605,7 +685,7 @@ internal static void InitGs(GeometryShaderId id) GsObjects[id.Index] = new GeometryShader(MyRender11.Device, GetBytecode(bytecodeId)); } } - catch (SharpDXException e) + catch (SharpDXException) { Compile(bytecodeId, true); @@ -745,7 +825,7 @@ private static string PreprocessShader(string source, ShaderMacro[] macros) var includes = new MyIncludeProcessor(Path.Combine(MyFileSystem.ContentPath, MyShadersDefines.ShadersContentPath)); return ShaderBytecode.Preprocess(source, macros, includes); } - catch (CompilationException e) + catch (CompilationException) { return null; } @@ -783,7 +863,7 @@ private static string ExtendedErrorMessage(string originalCode, string errorMsg) code = reader.ReadToEnd(); } } - catch (Exception ex) + catch (Exception) { return ""; } diff --git a/Sources/VRage.Render11/TransparentStage/MyGPUEmitters.cs b/Sources/VRage.Render11/TransparentStage/MyGPUEmitters.cs index 184ef56cd0..ef568d99dc 100644 --- a/Sources/VRage.Render11/TransparentStage/MyGPUEmitters.cs +++ b/Sources/VRage.Render11/TransparentStage/MyGPUEmitters.cs @@ -55,6 +55,19 @@ struct GPUEmitterId return x.Index != y.Index; } + public override bool Equals(object obj) + { + if (obj is GPUEmitterId) + return (this == (GPUEmitterId)obj); + else + return false; + } + + public override int GetHashCode() + { + return Index; + } + internal static readonly GPUEmitterId NULL = new GPUEmitterId { Index = -1 }; #region Equals diff --git a/Sources/VRage.Render11/TransparentStage/MyGPUParticleRenderer.cs b/Sources/VRage.Render11/TransparentStage/MyGPUParticleRenderer.cs index d71d1f8e6d..6a55ad21ba 100644 --- a/Sources/VRage.Render11/TransparentStage/MyGPUParticleRenderer.cs +++ b/Sources/VRage.Render11/TransparentStage/MyGPUParticleRenderer.cs @@ -12,14 +12,18 @@ internal class MyGPUParticleRenderer : MyImmediateRC // GPUParticle structure is split into two sections for better cache efficiency - could even be SOA but would require creating more vertex buffers. private struct Particle { +#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value public Vector4 Params1, Params2, Params3, Params4; +#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value }; private unsafe static readonly int PARTICLE_STRIDE = sizeof(Particle); private struct EmitterConstantBuffer { +#pragma warning disable CS0649 // Field is never assigned to, and will always have its default value public int EmittersCount; public Vector3 Pad; +#pragma warning restore CS0649 // Field is never assigned to, and will always have its default value }; public unsafe static readonly int EMITTERCONSTANTBUFFER_SIZE = sizeof(EmitterConstantBuffer); public unsafe static readonly int EMITTERDATA_SIZE = sizeof(MyGPUEmitterData); @@ -47,12 +51,14 @@ private struct EmitterConstantBuffer #if DEBUG private static MyReadStructuredBuffer m_debugCounterBuffer; -#endif +#pragma warning disable CS0169 // The field is never used private static int m_numDeadParticlesOnInit; private static int m_numDeadParticlesAfterEmit; private static int m_numDeadParticlesAfterSimulation; private static int m_numActiveParticlesAfterSimulation; +#pragma warning restore CS0169 // The field is never used +#endif private static MyGPUEmitterData[] m_emitterData = new MyGPUEmitterData[MyGPUEmitters.MAX_LIVE_EMITTERS]; private static SharpDX.Direct3D11.ShaderResourceView[] m_emitterTextures = new SharpDX.Direct3D11.ShaderResourceView[MyGPUEmitters.MAX_LIVE_EMITTERS];