diff --git a/ANX.Framework.TestCenter/ANX.Framework.TestCenter.csproj b/ANX.Framework.TestCenter/ANX.Framework.TestCenter.csproj index 2c448b5a..923ebbf5 100644 --- a/ANX.Framework.TestCenter/ANX.Framework.TestCenter.csproj +++ b/ANX.Framework.TestCenter/ANX.Framework.TestCenter.csproj @@ -116,7 +116,6 @@ - diff --git a/ANX.Framework.TestCenter/ANX.Framework.TestCenter_Linux.csproj b/ANX.Framework.TestCenter/ANX.Framework.TestCenter_Linux.csproj index d807ebd9..f513cd14 100644 --- a/ANX.Framework.TestCenter/ANX.Framework.TestCenter_Linux.csproj +++ b/ANX.Framework.TestCenter/ANX.Framework.TestCenter_Linux.csproj @@ -116,7 +116,6 @@ - diff --git a/ANX.Framework.TestCenter/ANX.Framework.TestCenter_PSVita.csproj b/ANX.Framework.TestCenter/ANX.Framework.TestCenter_PSVita.csproj index 50b31cdf..fe527913 100644 --- a/ANX.Framework.TestCenter/ANX.Framework.TestCenter_PSVita.csproj +++ b/ANX.Framework.TestCenter/ANX.Framework.TestCenter_PSVita.csproj @@ -117,7 +117,6 @@ - diff --git a/ANX.Framework.TestCenter/ANX.Framework.TestCenter_WindowsMetro.csproj b/ANX.Framework.TestCenter/ANX.Framework.TestCenter_WindowsMetro.csproj index 0463abe5..1164e88e 100644 --- a/ANX.Framework.TestCenter/ANX.Framework.TestCenter_WindowsMetro.csproj +++ b/ANX.Framework.TestCenter/ANX.Framework.TestCenter_WindowsMetro.csproj @@ -118,7 +118,6 @@ - diff --git a/ANX.Framework/Design/ANXFieldDescriptor.cs b/ANX.Framework/Design/ANXFieldDescriptor.cs index ba324348..4ab6ac44 100644 --- a/ANX.Framework/Design/ANXFieldDescriptor.cs +++ b/ANX.Framework/Design/ANXFieldDescriptor.cs @@ -11,6 +11,7 @@ namespace ANX.Framework.Design { #if !WINDOWSMETRO [Developer("AstrorEnales")] + [TestState(TestStateAttribute.TestState.Untested)] public class ANXFieldDescriptor : PropertyDescriptor { private FieldInfo field; diff --git a/ANX.Framework/Design/ANXPropertyDescriptor.cs b/ANX.Framework/Design/ANXPropertyDescriptor.cs index 97c5655d..c351fe2e 100644 --- a/ANX.Framework/Design/ANXPropertyDescriptor.cs +++ b/ANX.Framework/Design/ANXPropertyDescriptor.cs @@ -11,6 +11,7 @@ namespace ANX.Framework.Design { #if !WINDOWSMETRO [Developer("AstrorEnales")] + [TestState(TestStateAttribute.TestState.Untested)] public class ANXPropertyDescriptor : PropertyDescriptor { private PropertyInfo property; diff --git a/ANX.Framework/Design/BoundingBoxConverter.cs b/ANX.Framework/Design/BoundingBoxConverter.cs index 7e03bf43..b69f10f9 100644 --- a/ANX.Framework/Design/BoundingBoxConverter.cs +++ b/ANX.Framework/Design/BoundingBoxConverter.cs @@ -12,6 +12,7 @@ namespace ANX.Framework.Design { #if !WINDOWSMETRO //TODO: search replacement for Win8 [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Tested)] public class BoundingBoxConverter : MathTypeConverter { public BoundingBoxConverter() diff --git a/ANX.Framework/Design/BoundingSphereConverter.cs b/ANX.Framework/Design/BoundingSphereConverter.cs index cc7c8cc4..38b3aba7 100644 --- a/ANX.Framework/Design/BoundingSphereConverter.cs +++ b/ANX.Framework/Design/BoundingSphereConverter.cs @@ -12,6 +12,7 @@ namespace ANX.Framework.Design { #if !WINDOWSMETRO //TODO: search replacement for Win8 [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Tested)] public class BoundingSphereConverter : MathTypeConverter { public BoundingSphereConverter() diff --git a/ANX.Framework/Design/ColorConverter.cs b/ANX.Framework/Design/ColorConverter.cs index c031565c..bf421246 100644 --- a/ANX.Framework/Design/ColorConverter.cs +++ b/ANX.Framework/Design/ColorConverter.cs @@ -12,6 +12,7 @@ namespace ANX.Framework.Design { #if !WINDOWSMETRO //TODO: search replacement for Win8 [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Tested)] public class ColorConverter : MathTypeConverter { public ColorConverter() diff --git a/ANX.Framework/Design/MathTypeConverter.cs b/ANX.Framework/Design/MathTypeConverter.cs index 9b912a39..841d9dba 100644 --- a/ANX.Framework/Design/MathTypeConverter.cs +++ b/ANX.Framework/Design/MathTypeConverter.cs @@ -19,6 +19,7 @@ namespace ANX.Framework.Design { #if !WINDOWSMETRO //TODO: search replacement for Win8 [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Untested)] public class MathTypeConverter : ExpandableObjectConverter { protected PropertyDescriptorCollection propertyDescriptions; diff --git a/ANX.Framework/Design/MatrixConverter.cs b/ANX.Framework/Design/MatrixConverter.cs index e53fa3da..99fb1988 100644 --- a/ANX.Framework/Design/MatrixConverter.cs +++ b/ANX.Framework/Design/MatrixConverter.cs @@ -12,6 +12,7 @@ namespace ANX.Framework.Design { #if !WINDOWSMETRO //TODO: search replacement for Win8 [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Tested)] public class MatrixConverter : MathTypeConverter { public MatrixConverter() diff --git a/ANX.Framework/Design/PlaneConverter.cs b/ANX.Framework/Design/PlaneConverter.cs index b84a252e..499285bc 100644 --- a/ANX.Framework/Design/PlaneConverter.cs +++ b/ANX.Framework/Design/PlaneConverter.cs @@ -12,6 +12,7 @@ namespace ANX.Framework.Design { #if !WINDOWSMETRO //TODO: search replacement for Win8 [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Tested)] public class PlaneConverter : MathTypeConverter { public PlaneConverter() diff --git a/ANX.Framework/Design/PointConverter.cs b/ANX.Framework/Design/PointConverter.cs index bc4c917b..d56d29af 100644 --- a/ANX.Framework/Design/PointConverter.cs +++ b/ANX.Framework/Design/PointConverter.cs @@ -12,6 +12,7 @@ namespace ANX.Framework.Design { #if !WINDOWSMETRO //TODO: search replacement for Win8 [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Tested)] public class PointConverter : MathTypeConverter { public PointConverter() diff --git a/ANX.Framework/Design/QuaternionConverter.cs b/ANX.Framework/Design/QuaternionConverter.cs index d7887a17..a23fd765 100644 --- a/ANX.Framework/Design/QuaternionConverter.cs +++ b/ANX.Framework/Design/QuaternionConverter.cs @@ -12,6 +12,7 @@ namespace ANX.Framework.Design { #if !WINDOWSMETRO //TODO: search replacement for Win8 [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Tested)] public class QuaternionConverter : MathTypeConverter { public QuaternionConverter() diff --git a/ANX.Framework/Design/RayConverter.cs b/ANX.Framework/Design/RayConverter.cs index ee830c1a..1f0187c4 100644 --- a/ANX.Framework/Design/RayConverter.cs +++ b/ANX.Framework/Design/RayConverter.cs @@ -12,6 +12,7 @@ namespace ANX.Framework.Design { #if !WINDOWSMETRO //TODO: search replacement for Win8 [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Tested)] public class RayConverter : MathTypeConverter { public RayConverter() diff --git a/ANX.Framework/Design/RectangleConverter.cs b/ANX.Framework/Design/RectangleConverter.cs index af700326..a33bc467 100644 --- a/ANX.Framework/Design/RectangleConverter.cs +++ b/ANX.Framework/Design/RectangleConverter.cs @@ -12,6 +12,7 @@ namespace ANX.Framework.Design { #if !WINDOWSMETRO //TODO: search replacement for Win8 [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Tested)] public class RectangleConverter : MathTypeConverter { public RectangleConverter() diff --git a/ANX.Framework/Design/Vector2Converter.cs b/ANX.Framework/Design/Vector2Converter.cs index 5678361a..5687a5e3 100644 --- a/ANX.Framework/Design/Vector2Converter.cs +++ b/ANX.Framework/Design/Vector2Converter.cs @@ -12,6 +12,7 @@ namespace ANX.Framework.Design { #if !WINDOWSMETRO //TODO: search replacement for Win8 [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Tested)] public class Vector2Converter : MathTypeConverter { public Vector2Converter() diff --git a/ANX.Framework/Design/Vector3Converter.cs b/ANX.Framework/Design/Vector3Converter.cs index 86d37624..d3a596d9 100644 --- a/ANX.Framework/Design/Vector3Converter.cs +++ b/ANX.Framework/Design/Vector3Converter.cs @@ -12,6 +12,7 @@ namespace ANX.Framework.Design { #if !WINDOWSMETRO //TODO: search replacement for Win8 [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Tested)] public class Vector3Converter : MathTypeConverter { public Vector3Converter() diff --git a/ANX.Framework/Design/Vector4Converter.cs b/ANX.Framework/Design/Vector4Converter.cs index eaf68711..7631be27 100644 --- a/ANX.Framework/Design/Vector4Converter.cs +++ b/ANX.Framework/Design/Vector4Converter.cs @@ -12,6 +12,7 @@ namespace ANX.Framework.Design { #if !WINDOWSMETRO //TODO: search replacement for Win8 [Developer("GinieDP")] + [TestState(TestStateAttribute.TestState.Tested)] public class Vector4Converter : MathTypeConverter { public Vector4Converter() diff --git a/ANX.Framework/Graphics/GraphicsDevice.cs b/ANX.Framework/Graphics/GraphicsDevice.cs index b97c8e01..3728741b 100644 --- a/ANX.Framework/Graphics/GraphicsDevice.cs +++ b/ANX.Framework/Graphics/GraphicsDevice.cs @@ -600,14 +600,8 @@ namespace ANX.Framework.Graphics public Rectangle ScissorRectangle { - get - { - throw new NotImplementedException(); - } - set - { - throw new NotImplementedException(); - } + get { return NativeDevice.ScissorRectangle; } + set { NativeDevice.ScissorRectangle = value; } } public GraphicsDeviceStatus GraphicsDeviceStatus diff --git a/ANX.Framework/Graphics/RenderTarget2D.cs b/ANX.Framework/Graphics/RenderTarget2D.cs index 91fcd58d..0968ef51 100644 --- a/ANX.Framework/Graphics/RenderTarget2D.cs +++ b/ANX.Framework/Graphics/RenderTarget2D.cs @@ -31,8 +31,8 @@ namespace ANX.Framework.Graphics OneOverWidth = 1f / width; OneOverHeight = 1f / height; - base.levelCount = 1; - base.format = SurfaceFormat.Color; + base.LevelCount = 1; + base.Format = SurfaceFormat.Color; this.DepthStencilFormat = DepthFormat.None; this.MultiSampleCount = 0; @@ -53,8 +53,8 @@ namespace ANX.Framework.Graphics OneOverWidth = 1f / width; OneOverHeight = 1f / height; - base.levelCount = 1; - base.format = preferredFormat; + base.LevelCount = 1; + base.Format = preferredFormat; this.DepthStencilFormat = preferredDepthFormat; this.MultiSampleCount = 0; @@ -76,8 +76,8 @@ namespace ANX.Framework.Graphics OneOverWidth = 1f / width; OneOverHeight = 1f / height; - base.levelCount = 1; - base.format = preferredFormat; + base.LevelCount = 1; + base.Format = preferredFormat; this.DepthStencilFormat = preferredDepthFormat; this.MultiSampleCount = preferredMultiSampleCount; diff --git a/ANX.Framework/Graphics/Texture.cs b/ANX.Framework/Graphics/Texture.cs index f3d6aa1a..f71424e5 100644 --- a/ANX.Framework/Graphics/Texture.cs +++ b/ANX.Framework/Graphics/Texture.cs @@ -11,27 +11,12 @@ namespace ANX.Framework.Graphics [TestState(TestStateAttribute.TestState.Untested)] public abstract class Texture : GraphicsResource { - protected internal int levelCount; - protected internal SurfaceFormat format; - protected internal INativeTexture nativeTexture; + internal INativeTexture nativeTexture; - public int LevelCount - { - get - { - return this.levelCount; - } - } + public int LevelCount { get; internal set; } + public SurfaceFormat Format { get; internal set; } - public SurfaceFormat Format - { - get - { - return this.format; - } - } - - internal INativeTexture NativeTexture + internal INativeTexture NativeTexture { get { @@ -44,7 +29,7 @@ namespace ANX.Framework.Graphics } } - public Texture(GraphicsDevice graphicsDevice) + internal Texture(GraphicsDevice graphicsDevice) : base(graphicsDevice) { base.GraphicsDevice.ResourceCreated += GraphicsDevice_ResourceCreated; diff --git a/ANX.Framework/Graphics/Texture2D.cs b/ANX.Framework/Graphics/Texture2D.cs index fdcff028..a925474c 100644 --- a/ANX.Framework/Graphics/Texture2D.cs +++ b/ANX.Framework/Graphics/Texture2D.cs @@ -75,8 +75,8 @@ namespace ANX.Framework.Graphics OneOverWidth = 1f / width; OneOverHeight = 1f / height; - base.levelCount = 1; - base.format = SurfaceFormat.Color; + base.LevelCount = 1; + base.Format = SurfaceFormat.Color; CreateNativeTextureSurface(); } @@ -91,8 +91,8 @@ namespace ANX.Framework.Graphics OneOverHeight = 1f / height; // TODO: pass the mipmap parameter to the creation of the texture to let the graphics card generate mipmaps! - base.levelCount = 1; - base.format = format; + base.LevelCount = 1; + base.Format = format; CreateNativeTextureSurface(); } @@ -105,8 +105,8 @@ namespace ANX.Framework.Graphics OneOverWidth = 1f / width; OneOverHeight = 1f / height; - base.levelCount = mipCount; - base.format = format; + base.LevelCount = mipCount; + base.Format = format; CreateNativeTextureSurface(); } @@ -196,7 +196,7 @@ namespace ANX.Framework.Graphics private void CreateNativeTextureSurface() { var creator = AddInSystemFactory.Instance.GetDefaultCreator(); - nativeTexture2D = creator.CreateTexture(GraphicsDevice, format, width, height, levelCount); + nativeTexture2D = creator.CreateTexture(GraphicsDevice, Format, width, height, LevelCount); base.nativeTexture = nativeTexture2D; } #endregion diff --git a/ANX.Framework/Graphics/VertexBufferBinding.cs b/ANX.Framework/Graphics/VertexBufferBinding.cs index c3a42996..d37bb814 100644 --- a/ANX.Framework/Graphics/VertexBufferBinding.cs +++ b/ANX.Framework/Graphics/VertexBufferBinding.cs @@ -7,6 +7,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Graphics { [PercentageComplete(100)] + [TestState(TestStateAttribute.TestState.Untested)] public struct VertexBufferBinding { #region Private diff --git a/ANX.Framework/NonXNA/PlatformSystem/INativeStorageDevice.cs b/ANX.Framework/NonXNA/PlatformSystem/INativeStorageDevice.cs index 292d9d30..12f36c9d 100644 --- a/ANX.Framework/NonXNA/PlatformSystem/INativeStorageDevice.cs +++ b/ANX.Framework/NonXNA/PlatformSystem/INativeStorageDevice.cs @@ -1,5 +1,4 @@ using System; -using ANX.Framework.Storage; // This file is part of the ANX.Framework created by the // "ANX.Framework developer group" and released under the Ms-PL license. @@ -9,21 +8,11 @@ namespace ANX.Framework.NonXNA.PlatformSystem { public interface INativeStorageDevice { - long FreeSpace - { - get; - } + long FreeSpace { get; } + long TotalSpace { get; } + bool IsConnected { get; } + string StoragePath { get; } - long TotalSpace - { - get; - } - - bool IsConnected - { - get; - } - - void DeleteContainer(string titleName); + void DeleteContainer(string titleName); } } diff --git a/ANX.Framework/NonXNA/RenderSystem/INativeGraphicsDevice.cs b/ANX.Framework/NonXNA/RenderSystem/INativeGraphicsDevice.cs index 217c45de..81edbfd6 100644 --- a/ANX.Framework/NonXNA/RenderSystem/INativeGraphicsDevice.cs +++ b/ANX.Framework/NonXNA/RenderSystem/INativeGraphicsDevice.cs @@ -47,5 +47,6 @@ namespace ANX.Framework.NonXNA void ResizeBuffers(PresentationParameters presentationParameters); bool VSync { get; set; } + Rectangle ScissorRectangle { get; set; } } } diff --git a/ANX.Framework/Storage/StorageContainer.cs b/ANX.Framework/Storage/StorageContainer.cs index 9e782931..5c31de96 100644 --- a/ANX.Framework/Storage/StorageContainer.cs +++ b/ANX.Framework/Storage/StorageContainer.cs @@ -9,6 +9,7 @@ using ANX.Framework.NonXNA.PlatformSystem; namespace ANX.Framework.Storage { + [PercentageComplete(100)] [Developer("AstrorEnales")] [TestState(TestStateAttribute.TestState.Untested)] public class StorageContainer : IDisposable @@ -18,17 +19,17 @@ namespace ANX.Framework.Storage #region Public public event EventHandler Disposing; - public string DisplayName { get; protected set; } - public StorageDevice StorageDevice { get; protected set; } - public bool IsDisposed { get; protected set; } + public string DisplayName { get; private set; } + public StorageDevice StorageDevice { get; private set; } + public bool IsDisposed { get; private set; } + internal PlayerIndex PlayerIndex { get; private set; } #endregion internal StorageContainer(StorageDevice device, PlayerIndex player, string displayName) { StorageDevice = device; DisplayName = displayName; - - // TODO: player! + PlayerIndex = player; nativeImplementation = PlatformSystem.Instance.CreateStorageContainer(this); } @@ -98,8 +99,7 @@ namespace ANX.Framework.Storage return OpenFile(file, fileMode, fileAccess, FileShare.None); } - public Stream OpenFile(string file, FileMode fileMode, FileAccess fileAccess, - FileShare fileShare) + public Stream OpenFile(string file, FileMode fileMode, FileAccess fileAccess, FileShare fileShare) { return nativeImplementation.OpenFile(file, fileMode, fileAccess, fileShare); } diff --git a/ANX.Framework/Storage/StorageDevice.cs b/ANX.Framework/Storage/StorageDevice.cs index 85a57c0d..09becc29 100644 --- a/ANX.Framework/Storage/StorageDevice.cs +++ b/ANX.Framework/Storage/StorageDevice.cs @@ -9,15 +9,17 @@ using ANX.Framework.NonXNA.PlatformSystem; namespace ANX.Framework.Storage { + [PercentageComplete(100)] [Developer("AstrorEnales")] [TestState(TestStateAttribute.TestState.Untested)] public sealed class StorageDevice { - #region Private - private INativeStorageDevice nativeImplementation; + #region Private + private readonly PlayerIndex playerIndex; + private readonly INativeStorageDevice nativeImplementation; - private static Func openDeviceDelegate = null; - private Func openContainerDelegate = null; + private static Func openDeviceDelegate; + private Func openContainerDelegate; #endregion #region Public @@ -25,57 +27,40 @@ namespace ANX.Framework.Storage public static event EventHandler DeviceChanged; #pragma warning restore 0067 - public long FreeSpace - { - get - { - return nativeImplementation.FreeSpace; - } - } + public long FreeSpace + { + get { return nativeImplementation.FreeSpace; } + } - public bool IsConnected - { - get - { - return nativeImplementation.IsConnected; - } - } + public bool IsConnected + { + get { return nativeImplementation.IsConnected; } + } - public long TotalSpace - { - get - { - return nativeImplementation.TotalSpace; - } - } + public long TotalSpace + { + get { return nativeImplementation.TotalSpace; } + } - internal string StoragePath - { - get; - private set; - } - - internal PlayerIndex PlayerIndex - { - get; - private set; - } - #endregion + internal string StoragePath + { + get { return nativeImplementation.StoragePath; } + } + #endregion #region Constructor internal StorageDevice(PlayerIndex player, int sizeInBytes, int directoryCount) { + playerIndex = player; nativeImplementation = PlatformSystem.Instance.CreateStorageDevice(this, player, sizeInBytes, directoryCount); } #endregion #region BeginOpenContainer - public IAsyncResult BeginOpenContainer(string displayName, - AsyncCallback callback, Object state) + public IAsyncResult BeginOpenContainer(string displayName, AsyncCallback callback, Object state) { if (openContainerDelegate != null) - throw new InvalidOperationException( - "There is currently a StorageContainer request pending. " + + throw new InvalidOperationException("There is currently a StorageContainer request pending. " + "Please let this request finish."); openContainerDelegate = OpenStorageContainer; @@ -88,35 +73,26 @@ namespace ANX.Framework.Storage { return BeginShowSelector(PlayerIndex.One, 0, 0, callback, state); } - #endregion - #region BeginShowSelector - public static IAsyncResult BeginShowSelector(int sizeInBytes, int directoryCount, - AsyncCallback callback, Object state) + public static IAsyncResult BeginShowSelector(int sizeInBytes, int directoryCount, AsyncCallback callback, Object state) { - return BeginShowSelector(PlayerIndex.One, sizeInBytes, directoryCount, - callback, state); + return BeginShowSelector(PlayerIndex.One, sizeInBytes, directoryCount, callback, state); } - #endregion - #region BeginShowSelector - public static IAsyncResult BeginShowSelector(PlayerIndex player, - AsyncCallback callback, Object state) + public static IAsyncResult BeginShowSelector(PlayerIndex player, AsyncCallback callback, Object state) { return BeginShowSelector(player, 0, 0, callback, state); } - #endregion - #region BeginShowSelector - public static IAsyncResult BeginShowSelector(PlayerIndex player, - int sizeInBytes, int directoryCount, AsyncCallback callback, Object state) + public static IAsyncResult BeginShowSelector(PlayerIndex player, int sizeInBytes, int directoryCount, + AsyncCallback callback, Object state) { if (openDeviceDelegate != null) - throw new InvalidOperationException("There is currently a StorageDevice request pending. Please let this request finish."); + throw new InvalidOperationException( + "There is currently a StorageDevice request pending. Please let this request finish."); openDeviceDelegate = OpenStorageDevice; - return openDeviceDelegate.BeginInvoke(player, sizeInBytes, directoryCount, - callback, state); + return openDeviceDelegate.BeginInvoke(player, sizeInBytes, directoryCount, callback, state); } #endregion @@ -162,8 +138,7 @@ namespace ANX.Framework.Storage #endregion #region OpenStorageDevice - private static StorageDevice OpenStorageDevice(PlayerIndex player, - int sizeInBytes, int directoryCount) + private static StorageDevice OpenStorageDevice(PlayerIndex player, int sizeInBytes, int directoryCount) { return new StorageDevice(player, sizeInBytes, directoryCount); } @@ -172,7 +147,7 @@ namespace ANX.Framework.Storage #region OpenStorageContainer private StorageContainer OpenStorageContainer(string displayName) { - return new StorageContainer(this, PlayerIndex, displayName); + return new StorageContainer(this, playerIndex, displayName); } #endregion } diff --git a/ANX.Framework/Storage/StorageDeviceNotConnectedException.cs b/ANX.Framework/Storage/StorageDeviceNotConnectedException.cs index 64c377cc..78dc2bad 100644 --- a/ANX.Framework/Storage/StorageDeviceNotConnectedException.cs +++ b/ANX.Framework/Storage/StorageDeviceNotConnectedException.cs @@ -12,6 +12,7 @@ using ANX.Framework.NonXNA.Development; namespace ANX.Framework.Storage { + [PercentageComplete(95)] [Developer("AstrorEnales")] [TestState(TestStateAttribute.TestState.Untested)] public class StorageDeviceNotConnectedException : ExternalException diff --git a/PlatformSystems/ANX.PlatformSystem.Linux/LinuxStorageContainer.cs b/PlatformSystems/ANX.PlatformSystem.Linux/LinuxStorageContainer.cs index 12156781..96f3cd32 100644 --- a/PlatformSystems/ANX.PlatformSystem.Linux/LinuxStorageContainer.cs +++ b/PlatformSystems/ANX.PlatformSystem.Linux/LinuxStorageContainer.cs @@ -1,6 +1,8 @@ using System; using System.Collections.Generic; using System.IO; +using System.Reflection; +using ANX.Framework; using ANX.Framework.NonXNA.PlatformSystem; using ANX.Framework.Storage; @@ -12,21 +14,56 @@ namespace ANX.PlatformSystem.Linux { public class LinuxStorageContainer : INativeStorageContainer { - private StorageContainer parent; - private DirectoryInfo baseDirectory; + private readonly StorageContainer parent; + private readonly DirectoryInfo baseDirectory; public LinuxStorageContainer(StorageContainer setParent) { parent = setParent; - - string fullPath = Path.Combine(parent.StorageDevice.StoragePath, - parent.DisplayName); - baseDirectory = new DirectoryInfo(fullPath); + baseDirectory = new DirectoryInfo(GetDirectoryForContainer()); // fails silently if directory exists baseDirectory.Create(); } - #region CreateDirectory + private string GetDirectoryForContainer() + { + // TODO: check if Environment.GetFolderPath returns something useful under linux! + string result = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "SavedGames"); + result = Path.Combine(result, GetGameTitle()); + result = Path.Combine(result, parent.DisplayName); + string playerSubDir; + switch (parent.PlayerIndex) + { + case PlayerIndex.One: + playerSubDir = "Player1"; + break; + case PlayerIndex.Two: + playerSubDir = "Player2"; + break; + case PlayerIndex.Three: + playerSubDir = "Player3"; + break; + case PlayerIndex.Four: + playerSubDir = "Player4"; + break; + default: + playerSubDir = "AllPlayers"; + break; + } + + return Path.Combine(result, playerSubDir); + } + + private static string GetGameTitle() + { + var entryAssembly = Assembly.GetEntryAssembly(); + if (entryAssembly != null) + return Path.GetFileNameWithoutExtension(entryAssembly.Location); + + throw new InvalidOperationException(); + } + + #region CreateDirectory public void CreateDirectory(string directory) { baseDirectory.CreateSubdirectory(directory); diff --git a/PlatformSystems/ANX.PlatformSystem.Linux/LinuxStorageDevice.cs b/PlatformSystems/ANX.PlatformSystem.Linux/LinuxStorageDevice.cs index 0281dea5..a9646951 100644 --- a/PlatformSystems/ANX.PlatformSystem.Linux/LinuxStorageDevice.cs +++ b/PlatformSystems/ANX.PlatformSystem.Linux/LinuxStorageDevice.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Reflection; using ANX.Framework; using ANX.Framework.NonXNA.PlatformSystem; using ANX.Framework.Storage; @@ -15,9 +16,8 @@ namespace ANX.PlatformSystem.Linux /// public class LinuxStorageDevice : INativeStorageDevice { - private string storagePath; - private StorageDevice parent; - private DriveInfo storageDrive; + private readonly StorageDevice parent; + private readonly DriveInfo storageDrive; #region Public public long FreeSpace @@ -50,55 +50,62 @@ namespace ANX.PlatformSystem.Linux } } - public bool IsConnected + public bool IsConnected + { + get { return storageDrive.IsReady; } + } + + public string StoragePath { get; private set; } + #endregion + + public LinuxStorageDevice(StorageDevice setParent, PlayerIndex player, int sizeInBytes, int directoryCount) { - get - { - return storageDrive.IsReady; - } - } - #endregion + parent = setParent; + StoragePath = GetDirectoryForContainer(player); + storageDrive = new DriveInfo(Path.GetPathRoot(StoragePath).Substring(0, 1)); + } - #region Constructor - public LinuxStorageDevice(StorageDevice setParent, PlayerIndex player, - int sizeInBytes, int directoryCount) - { - parent = setParent; + private string GetDirectoryForContainer(PlayerIndex player) + { + // TODO: check if Environment.GetFolderPath returns something useful under linux! + string result = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "SavedGames"); + result = Path.Combine(result, GetGameTitle()); + //result = Path.Combine(result, StorageContainer.DisplayName); + string playerSubDir; + switch (player) + { + case PlayerIndex.One: + playerSubDir = "Player1"; + break; + case PlayerIndex.Two: + playerSubDir = "Player2"; + break; + case PlayerIndex.Three: + playerSubDir = "Player3"; + break; + case PlayerIndex.Four: + playerSubDir = "Player4"; + break; + default: + playerSubDir = "AllPlayers"; + break; + } - string playerPath; - switch (player) - { - case PlayerIndex.One: - playerPath = "Player1"; - break; - case PlayerIndex.Two: - playerPath = "Player2"; - break; - case PlayerIndex.Three: - playerPath = "Player3"; - break; - case PlayerIndex.Four: - playerPath = "Player4"; - break; - default: - playerPath = "AllPlayers"; - break; - } + return Path.Combine(result, playerSubDir); + } - // TODO: find the correct linux location for this stuff! - string myDocsPath = Environment.GetFolderPath( - Environment.SpecialFolder.MyDocuments); - storagePath = Path.Combine(myDocsPath, "SavedGames", playerPath); - storagePath = Path.GetFullPath(storagePath); - storageDrive = new DriveInfo(Path.GetPathRoot(myDocsPath).Substring(0, 1)); - } - #endregion + private static string GetGameTitle() + { + var entryAssembly = Assembly.GetEntryAssembly(); + if (entryAssembly != null) + return Path.GetFileNameWithoutExtension(entryAssembly.Location); + + throw new InvalidOperationException(); + } - #region DeleteContainer public void DeleteContainer(string titleName) { Directory.Delete(Path.Combine(parent.StoragePath, titleName), true); } - #endregion } } diff --git a/PlatformSystems/ANX.PlatformSystem.Metro/MetroStorageDevice.cs b/PlatformSystems/ANX.PlatformSystem.Metro/MetroStorageDevice.cs index b319c9c1..c39810be 100644 --- a/PlatformSystems/ANX.PlatformSystem.Metro/MetroStorageDevice.cs +++ b/PlatformSystems/ANX.PlatformSystem.Metro/MetroStorageDevice.cs @@ -33,9 +33,14 @@ namespace ANX.PlatformSystem.Metro } } + public string StoragePath + { + get { throw new NotImplementedException(); } + } + public void DeleteContainer(string titleName) { throw new NotImplementedException(); } - } + } } diff --git a/PlatformSystems/ANX.PlatformSystem.PsVita/PsVitaStorageDevice.cs b/PlatformSystems/ANX.PlatformSystem.PsVita/PsVitaStorageDevice.cs index 33440697..f8d6a592 100644 --- a/PlatformSystems/ANX.PlatformSystem.PsVita/PsVitaStorageDevice.cs +++ b/PlatformSystems/ANX.PlatformSystem.PsVita/PsVitaStorageDevice.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Reflection; using ANX.Framework; using ANX.Framework.NonXNA.PlatformSystem; using ANX.Framework.Storage; @@ -12,9 +13,8 @@ namespace ANX.PlatformSystem.PsVita { public class PsVitaStorageDevice : INativeStorageDevice { - private string storagePath; - private StorageDevice parent; - private DriveInfo storageDrive; + private readonly StorageDevice parent; + private readonly DriveInfo storageDrive; #region Public public long FreeSpace @@ -47,55 +47,61 @@ namespace ANX.PlatformSystem.PsVita } } - public bool IsConnected + public bool IsConnected + { + get { return storageDrive.IsReady; } + } + + public string StoragePath { get; private set; } + #endregion + + public PsVitaStorageDevice(StorageDevice setParent, PlayerIndex player, int sizeInBytes, int directoryCount) { - get - { - return storageDrive.IsReady; - } - } - #endregion + parent = setParent; + StoragePath = GetDirectoryForContainer(player); + storageDrive = new DriveInfo(Path.GetPathRoot(StoragePath).Substring(0, 1)); + } - #region Constructor - public PsVitaStorageDevice(StorageDevice setParent, PlayerIndex player, - int sizeInBytes, int directoryCount) - { - parent = setParent; + private string GetDirectoryForContainer(PlayerIndex player) + { + string result = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "SavedGames"); + result = Path.Combine(result, GetGameTitle()); + //result = Path.Combine(result, StorageContainer.DisplayName); + string playerSubDir; + switch (player) + { + case PlayerIndex.One: + playerSubDir = "Player1"; + break; + case PlayerIndex.Two: + playerSubDir = "Player2"; + break; + case PlayerIndex.Three: + playerSubDir = "Player3"; + break; + case PlayerIndex.Four: + playerSubDir = "Player4"; + break; + default: + playerSubDir = "AllPlayers"; + break; + } - string playerPath; - switch (player) - { - case PlayerIndex.One: - playerPath = "Player1"; - break; - case PlayerIndex.Two: - playerPath = "Player2"; - break; - case PlayerIndex.Three: - playerPath = "Player3"; - break; - case PlayerIndex.Four: - playerPath = "Player4"; - break; - default: - playerPath = "AllPlayers"; - break; - } + return Path.Combine(result, playerSubDir); + } - // TODO: find the correct PsVita location for this stuff! - string myDocsPath = Environment.GetFolderPath( - Environment.SpecialFolder.MyDocuments); - storagePath = Path.Combine(myDocsPath, "SavedGames", playerPath); - storagePath = Path.GetFullPath(storagePath); - storageDrive = new DriveInfo(Path.GetPathRoot(myDocsPath).Substring(0, 1)); - } - #endregion + private static string GetGameTitle() + { + var entryAssembly = Assembly.GetEntryAssembly(); + if (entryAssembly != null) + return Path.GetFileNameWithoutExtension(entryAssembly.Location); + + throw new InvalidOperationException(); + } - #region DeleteContainer public void DeleteContainer(string titleName) { Directory.Delete(Path.Combine(parent.StoragePath, titleName), true); } - #endregion } } diff --git a/PlatformSystems/ANX.PlatformSystem.Windows/WindowsStorageContainer.cs b/PlatformSystems/ANX.PlatformSystem.Windows/WindowsStorageContainer.cs index 114f63ef..ad7a866d 100644 --- a/PlatformSystems/ANX.PlatformSystem.Windows/WindowsStorageContainer.cs +++ b/PlatformSystems/ANX.PlatformSystem.Windows/WindowsStorageContainer.cs @@ -12,19 +12,16 @@ namespace ANX.PlatformSystem.Windows { public class WindowsStorageContainer : INativeStorageContainer { - private StorageContainer parent; - private DirectoryInfo baseDirectory; + private readonly StorageContainer parent; + private readonly DirectoryInfo baseDirectory; public WindowsStorageContainer(StorageContainer setParent) { parent = setParent; - - string fullPath = Path.Combine(parent.StorageDevice.StoragePath, - parent.DisplayName); - baseDirectory = new DirectoryInfo(fullPath); + baseDirectory = new DirectoryInfo(parent.StorageDevice.StoragePath); // fails silently if directory exists baseDirectory.Create(); - } + } #region CreateDirectory public void CreateDirectory(string directory) diff --git a/PlatformSystems/ANX.PlatformSystem.Windows/WindowsStorageDevice.cs b/PlatformSystems/ANX.PlatformSystem.Windows/WindowsStorageDevice.cs index 5e73fcd1..77f95d42 100644 --- a/PlatformSystems/ANX.PlatformSystem.Windows/WindowsStorageDevice.cs +++ b/PlatformSystems/ANX.PlatformSystem.Windows/WindowsStorageDevice.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Reflection; using ANX.Framework; using ANX.Framework.NonXNA.PlatformSystem; using ANX.Framework.Storage; @@ -12,9 +13,8 @@ namespace ANX.PlatformSystem.Windows { public class WindowsStorageDevice : INativeStorageDevice { - private string storagePath; - private StorageDevice parent; - private DriveInfo storageDrive; + private readonly StorageDevice parent; + private readonly DriveInfo storageDrive; #region Public public long FreeSpace @@ -47,54 +47,61 @@ namespace ANX.PlatformSystem.Windows } } - public bool IsConnected - { - get - { - return storageDrive.IsReady; - } - } - #endregion + public bool IsConnected + { + get { return storageDrive.IsReady; } + } - #region Constructor - public WindowsStorageDevice(StorageDevice setParent, PlayerIndex player, - int sizeInBytes, int directoryCount) + public string StoragePath { get; private set; } + #endregion + + public WindowsStorageDevice(StorageDevice setParent, PlayerIndex player, int sizeInBytes, int directoryCount) { parent = setParent; - - string playerPath; - switch (player) - { - case PlayerIndex.One: - playerPath = "Player1"; - break; - case PlayerIndex.Two: - playerPath = "Player2"; - break; - case PlayerIndex.Three: - playerPath = "Player3"; - break; - case PlayerIndex.Four: - playerPath = "Player4"; - break; - default: - playerPath = "AllPlayers"; - break; - } - - string myDocsPath = Environment.GetFolderPath( - Environment.SpecialFolder.MyDocuments); - storagePath = Path.Combine(myDocsPath, "SavedGames", playerPath); - storagePath = Path.GetFullPath(storagePath); - storageDrive = new DriveInfo(Path.GetPathRoot(myDocsPath).Substring(0, 1)); + StoragePath = GetDirectoryForContainer(player); + storageDrive = new DriveInfo(Path.GetPathRoot(StoragePath).Substring(0, 1)); } - #endregion - #region DeleteContainer + private string GetDirectoryForContainer(PlayerIndex player) + { + string result = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "SavedGames"); + result = Path.Combine(result, GetGameTitle()); + //result = Path.Combine(result, StorageContainer.DisplayName); + string playerSubDir; + switch (player) + { + case PlayerIndex.One: + playerSubDir = "Player1"; + break; + case PlayerIndex.Two: + playerSubDir = "Player2"; + break; + case PlayerIndex.Three: + playerSubDir = "Player3"; + break; + case PlayerIndex.Four: + playerSubDir = "Player4"; + break; + default: + playerSubDir = "AllPlayers"; + break; + } + + return Path.Combine(result, playerSubDir); + } + + private static string GetGameTitle() + { + var entryAssembly = Assembly.GetEntryAssembly(); + if (entryAssembly != null) + return Path.GetFileNameWithoutExtension(entryAssembly.Location); + + throw new InvalidOperationException(); + } + public void DeleteContainer(string titleName) { Directory.Delete(Path.Combine(parent.StoragePath, titleName), true); } - #endregion - } + } } diff --git a/RenderSystems/ANX.Framework.GL3/GraphicsDeviceWindowsGL3.cs b/RenderSystems/ANX.Framework.GL3/GraphicsDeviceWindowsGL3.cs index 334a850f..77c0aa9b 100644 --- a/RenderSystems/ANX.Framework.GL3/GraphicsDeviceWindowsGL3.cs +++ b/RenderSystems/ANX.Framework.GL3/GraphicsDeviceWindowsGL3.cs @@ -53,6 +53,18 @@ namespace ANX.RenderSystem.GL3 get { return nativeContext.VSync; } set { nativeContext.VSync = value; } } + + public Rectangle ScissorRectangle + { + get + { + // TODO: test + var boxParams = new int[4]; + GL.GetInteger(GetPName.ScissorBox, boxParams); + return new Rectangle(boxParams[0], boxParams[1], boxParams[2], boxParams[3]); + } + set { GL.Scissor(value.X, value.Y, value.Width, value.Height); } + } #endregion #region Constructor diff --git a/RenderSystems/ANX.RenderSystem.PsVita/PsVitaGraphicsDevice.cs b/RenderSystems/ANX.RenderSystem.PsVita/PsVitaGraphicsDevice.cs index 52251087..e329cde6 100644 --- a/RenderSystems/ANX.RenderSystem.PsVita/PsVitaGraphicsDevice.cs +++ b/RenderSystems/ANX.RenderSystem.PsVita/PsVitaGraphicsDevice.cs @@ -29,17 +29,22 @@ namespace ANX.RenderSystem.PsVita #endregion #region Public - public bool VSync - { - get - { - return true; - } - set - { - } - } - #endregion + public bool VSync + { + get { return true; } + set { } + } + + public Rectangle ScissorRectangle + { + get + { + var rect = NativeContext.GetScissor(); + return new Rectangle(rect.X, rect.Y, rect.Width, rect.Height); + } + set { NativeContext.SetScissor(value.X, value.Y, value.Width, value.Height); } + } + #endregion #region Constructor public PsVitaGraphicsDevice(PresentationParameters presentationParameters) diff --git a/RenderSystems/ANX.RenderSystem.Windows.DX10/GraphicsDeviceDX.cs b/RenderSystems/ANX.RenderSystem.Windows.DX10/GraphicsDeviceDX.cs index c68936a2..c60e3373 100644 --- a/RenderSystems/ANX.RenderSystem.Windows.DX10/GraphicsDeviceDX.cs +++ b/RenderSystems/ANX.RenderSystem.Windows.DX10/GraphicsDeviceDX.cs @@ -613,5 +613,11 @@ namespace ANX.RenderSystem.Windows.DX10 return this.nativeDevice; } } - } + + public Rectangle ScissorRectangle + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } + } } diff --git a/RenderSystems/ANX.RenderSystem.Windows.DX11/GraphicsDeviceDX.cs b/RenderSystems/ANX.RenderSystem.Windows.DX11/GraphicsDeviceDX.cs index 25756d44..b8efbb78 100644 --- a/RenderSystems/ANX.RenderSystem.Windows.DX11/GraphicsDeviceDX.cs +++ b/RenderSystems/ANX.RenderSystem.Windows.DX11/GraphicsDeviceDX.cs @@ -628,5 +628,11 @@ namespace ANX.RenderSystem.Windows.DX11 return this.nativeDevice; } } + + public Rectangle ScissorRectangle + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } } } diff --git a/RenderSystems/ANX.RenderSystem.Windows.Metro/GraphicsDeviceWindowsMetro.cs b/RenderSystems/ANX.RenderSystem.Windows.Metro/GraphicsDeviceWindowsMetro.cs index cf293c97..e4f5ccef 100644 --- a/RenderSystems/ANX.RenderSystem.Windows.Metro/GraphicsDeviceWindowsMetro.cs +++ b/RenderSystems/ANX.RenderSystem.Windows.Metro/GraphicsDeviceWindowsMetro.cs @@ -44,6 +44,12 @@ namespace ANX.RenderSystem.Windows.Metro this.vSyncEnabled = value; } } + + public Rectangle ScissorRectangle + { + get { throw new NotImplementedException(); } + set { throw new NotImplementedException(); } + } #endregion #region Constructor