Build a small tool to check all ANX classes about their Development attributes and generate an html report.

Added Development attributes to all PackedVector classes and Audio classes.
This commit is contained in:
SND\AstrorEnales_cp 2012-09-30 11:14:44 +00:00 committed by Konstantin Koch
parent 41061f8b12
commit 6f759ae509
42 changed files with 584 additions and 604 deletions

View File

@ -195,6 +195,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ANX.RenderSystem.Windows.DX
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ANX.InputDevices.Windows.ModernUI", "InputSystems\ANX.InputDevices.Windows.ModernUI\ANX.InputDevices.Windows.ModernUI.csproj", "{628AB80A-B1B9-4878-A810-7A58D4840F60}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OnlineStatusGenerator", "Tools\OnlineStatusGenerator\OnlineStatusGenerator.csproj", "{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -980,6 +982,20 @@ Global
{628AB80A-B1B9-4878-A810-7A58D4840F60}.Release|x64.Build.0 = Release|x64
{628AB80A-B1B9-4878-A810-7A58D4840F60}.Release|x86.ActiveCfg = Release|x86
{628AB80A-B1B9-4878-A810-7A58D4840F60}.Release|x86.Build.0 = Release|x86
{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}.Debug|Any CPU.ActiveCfg = Debug|x86
{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}.Debug|ARM.ActiveCfg = Debug|x86
{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}.Debug|Mixed Platforms.Build.0 = Debug|x86
{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}.Debug|x64.ActiveCfg = Debug|x86
{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}.Debug|x86.ActiveCfg = Debug|x86
{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}.Debug|x86.Build.0 = Debug|x86
{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}.Release|Any CPU.ActiveCfg = Release|x86
{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}.Release|ARM.ActiveCfg = Release|x86
{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}.Release|Mixed Platforms.ActiveCfg = Release|x86
{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}.Release|Mixed Platforms.Build.0 = Release|x86
{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}.Release|x64.ActiveCfg = Release|x86
{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}.Release|x86.ActiveCfg = Release|x86
{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -995,6 +1011,7 @@ Global
{938D5F88-B888-4B04-BEEE-EE701FBA51EF} = {B24A8593-562A-4A25-BB08-46C163F10F3F}
{14B39F89-C9B0-407E-877A-B515C985E96E} = {B24A8593-562A-4A25-BB08-46C163F10F3F}
{45DD7B40-C498-4DD2-A16B-FD6C4E6991B3} = {B24A8593-562A-4A25-BB08-46C163F10F3F}
{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01} = {B24A8593-562A-4A25-BB08-46C163F10F3F}
{B30DE9C2-0926-46B6-8351-9AF276C472D5} = {D421509A-9AE3-4D7E-881B-EAFED598B028}
{FF0AB665-2796-4354-9630-76C2751DB3C2} = {D421509A-9AE3-4D7E-881B-EAFED598B028}
{2B71A7C2-0D18-4E3D-AE5A-320641D1162A} = {D421509A-9AE3-4D7E-881B-EAFED598B028}

View File

@ -8,7 +8,8 @@ using ANX.Framework.NonXNA.Development;
namespace ANX.Framework.Audio
{
[PercentageComplete(30)]
[PercentageComplete(30)]
[TestState(TestStateAttribute.TestState.Untested)]
public struct AudioCategory : IEquatable<AudioCategory>
{
#region Internal helper enums

View File

@ -1,4 +1,5 @@
using System;
using ANX.Framework.NonXNA.Development;
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
@ -7,6 +8,9 @@
namespace ANX.Framework.Audio
{
[Flags]
[PercentageComplete(100)]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.Tested)]
public enum AudioChannels
{
Mono = 1,

View File

@ -8,81 +8,47 @@ using ANX.Framework.NonXNA.Development;
namespace ANX.Framework.Audio
{
[PercentageComplete(100)]
public class AudioEmitter
{
#region Private
private IAudioEmitter nativeEmitter;
#endregion
[PercentageComplete(100)]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.Untested)]
public class AudioEmitter
{
private readonly IAudioEmitter nativeEmitter;
#region Public
public float DopplerScale
{
get
{
return nativeEmitter.DopplerScale;
}
set
{
nativeEmitter.DopplerScale = value;
}
}
public float DopplerScale
{
get { return nativeEmitter.DopplerScale; }
set { nativeEmitter.DopplerScale = value; }
}
public Vector3 Forward
{
get
{
return nativeEmitter.Forward;
}
set
{
nativeEmitter.Forward = value;
}
}
public Vector3 Forward
{
get { return nativeEmitter.Forward; }
set { nativeEmitter.Forward = value; }
}
public Vector3 Position
{
get
{
return nativeEmitter.Position;
}
set
{
nativeEmitter.Position = value;
}
}
public Vector3 Position
{
get { return nativeEmitter.Position; }
set { nativeEmitter.Position = value; }
}
public Vector3 Up
{
get
{
return nativeEmitter.Up;
}
set
{
nativeEmitter.Up = value;
}
}
public Vector3 Up
{
get { return nativeEmitter.Up; }
set { nativeEmitter.Up = value; }
}
public Vector3 Velocity
{
get
{
return nativeEmitter.Velocity;
}
set
{
nativeEmitter.Velocity = value;
}
}
#endregion
public Vector3 Velocity
{
get { return nativeEmitter.Velocity; }
set { nativeEmitter.Velocity = value; }
}
#region Constructor
public AudioEmitter()
{
var creator = AddInSystemFactory.Instance.GetDefaultCreator<ISoundSystemCreator>();
nativeEmitter = creator.CreateAudioEmitter();
}
#endregion
}
public AudioEmitter()
{
var creator = AddInSystemFactory.Instance.GetDefaultCreator<ISoundSystemCreator>();
nativeEmitter = creator.CreateAudioEmitter();
}
}
}

View File

@ -13,7 +13,9 @@ using ANX.Framework.NonXNA.PlatformSystem;
namespace ANX.Framework.Audio
{
[PercentageComplete(50)]
[PercentageComplete(50)]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.Untested)]
public class AudioEngine : IDisposable
{
#region Constants

View File

@ -1,6 +1,6 @@
using ANX.Framework.NonXNA;
using ANX.Framework.NonXNA.SoundSystem;
using ANX.Framework.NonXNA.Development;
using ANX.Framework.NonXNA.SoundSystem;
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
@ -8,69 +8,41 @@ using ANX.Framework.NonXNA.Development;
namespace ANX.Framework.Audio
{
[PercentageComplete(100)]
public class AudioListener
{
#region Private
private IAudioListener nativeListener;
#endregion
[PercentageComplete(100)]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.Untested)]
public class AudioListener
{
private readonly IAudioListener nativeListener;
#region Public
public Vector3 Forward
{
get
{
return nativeListener.Forward;
}
set
{
nativeListener.Forward = value;
}
}
public Vector3 Forward
{
get { return nativeListener.Forward; }
set { nativeListener.Forward = value; }
}
public Vector3 Position
{
get
{
return nativeListener.Position;
}
set
{
nativeListener.Position = value;
}
}
public Vector3 Position
{
get { return nativeListener.Position; }
set { nativeListener.Position = value; }
}
public Vector3 Up
{
get
{
return nativeListener.Up;
}
set
{
nativeListener.Up = value;
}
}
public Vector3 Up
{
get { return nativeListener.Up; }
set { nativeListener.Up = value; }
}
public Vector3 Velocity
{
get
{
return nativeListener.Velocity;
}
set
{
nativeListener.Velocity = value;
}
}
#endregion
public Vector3 Velocity
{
get { return nativeListener.Velocity; }
set { nativeListener.Velocity = value; }
}
#region Constructor
public AudioListener()
{
var creator = AddInSystemFactory.Instance.GetDefaultCreator<ISoundSystemCreator>();
nativeListener = creator.CreateAudioListener();
}
#endregion
}
public AudioListener()
{
var creator = AddInSystemFactory.Instance.GetDefaultCreator<ISoundSystemCreator>();
nativeListener = creator.CreateAudioListener();
}
}
}

View File

@ -1,12 +1,17 @@
// This file is part of the ANX.Framework created by the
using ANX.Framework.NonXNA.Development;
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Audio
{
public enum AudioStopOptions
{
AsAuthored,
Immediate
}
[PercentageComplete(100)]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.Tested)]
public enum AudioStopOptions
{
AsAuthored,
Immediate
}
}

View File

@ -7,7 +7,8 @@ using ANX.Framework.NonXNA.Development;
namespace ANX.Framework.Audio
{
[PercentageComplete(5)]
[PercentageComplete(5)]
[TestState(TestStateAttribute.TestState.Untested)]
public sealed class Cue : IDisposable
{
#region Events

View File

@ -10,8 +10,8 @@ using ANX.Framework.NonXNA.SoundSystem;
namespace ANX.Framework.Audio
{
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.Untested)]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.Untested)]
public sealed class DynamicSoundEffectInstance : SoundEffectInstance
{
private IDynamicSoundEffectInstance nativeDynamicInstance;

View File

@ -11,10 +11,11 @@ namespace ANX.Framework.Audio
#if !WINDOWSMETRO //TODO: search replacement for Win8
[Serializable]
#endif
[PercentageComplete(100)]
[PercentageComplete(99)]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.Tested)]
public sealed class InstancePlayLimitException : ExternalException
{
#region Constructor
public InstancePlayLimitException()
{
}
@ -28,6 +29,5 @@ namespace ANX.Framework.Audio
: base(message, innerException)
{
}
#endregion
}
}

View File

@ -1,8 +1,8 @@
using System;
using System.Collections.ObjectModel;
using ANX.Framework.NonXNA.SoundSystem;
using ANX.Framework.NonXNA;
using ANX.Framework.NonXNA.Development;
using ANX.Framework.NonXNA.SoundSystem;
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
@ -10,14 +10,14 @@ using ANX.Framework.NonXNA.Development;
namespace ANX.Framework.Audio
{
[PercentageComplete(90)]
[PercentageComplete(100)]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.Untested)]
public sealed class Microphone
{
#region Private
private static int defaultMicrophone;
private static ReadOnlyCollection<Microphone> allMicrophones;
private IMicrophone nativeMicrophone;
private static readonly int defaultMicrophone;
private IMicrophone nativeMicrophone;
#endregion
#region Events
@ -25,67 +25,43 @@ namespace ANX.Framework.Audio
#endregion
#region Public
public static ReadOnlyCollection<Microphone> All
{
get
{
return allMicrophones;
}
}
public static ReadOnlyCollection<Microphone> All { get; private set; }
public static Microphone Default
{
get
{
return allMicrophones[defaultMicrophone];
}
}
public static Microphone Default
{
get { return All[defaultMicrophone]; }
}
public readonly string Name;
public readonly string Name;
public TimeSpan BufferDuration
{
get
{
return nativeMicrophone.BufferDuration;
}
set
{
nativeMicrophone.BufferDuration = value;
}
}
public TimeSpan BufferDuration
{
get { return nativeMicrophone.BufferDuration; }
set { nativeMicrophone.BufferDuration = value; }
}
public bool IsHeadset
{
get
{
return nativeMicrophone.IsHeadset;
}
}
public bool IsHeadset
{
get { return nativeMicrophone.IsHeadset; }
}
public int SampleRate
{
get
{
return nativeMicrophone.SampleRate;
}
}
public int SampleRate
{
get { return nativeMicrophone.SampleRate; }
}
public MicrophoneState State
{
get
{
return nativeMicrophone.State;
}
}
#endregion
public MicrophoneState State
{
get { return nativeMicrophone.State; }
}
#endregion
#region Constructor
static Microphone()
{
var creator = AddInSystemFactory.Instance.GetDefaultCreator<ISoundSystemCreator>();
allMicrophones = creator.GetAllMicrophones();
defaultMicrophone = creator.GetDefaultMicrophone(allMicrophones);
All = creator.GetAllMicrophones();
defaultMicrophone = creator.GetDefaultMicrophone(All);
}
internal Microphone(string setName)
@ -93,15 +69,17 @@ namespace ANX.Framework.Audio
Name = setName;
var creator = AddInSystemFactory.Instance.GetDefaultCreator<ISoundSystemCreator>();
nativeMicrophone = creator.CreateMicrophone(this);
nativeMicrophone.BufferReady += BufferReady;
}
~Microphone()
{
if (nativeMicrophone != null)
{
nativeMicrophone.Dispose();
nativeMicrophone = null;
}
if (nativeMicrophone == null)
return;
nativeMicrophone.BufferReady -= BufferReady;
nativeMicrophone.Dispose();
nativeMicrophone = null;
}
#endregion
@ -138,9 +116,7 @@ namespace ANX.Framework.Audio
{
return nativeMicrophone.GetData(buffer);
}
#endregion
#region GetData
public int GetData(byte[] buffer, int offset, int count)
{
return nativeMicrophone.GetData(buffer, offset, count);

View File

@ -1,12 +1,17 @@
// This file is part of the ANX.Framework created by the
using ANX.Framework.NonXNA.Development;
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
// For details see: http://anxframework.codeplex.com/license
namespace ANX.Framework.Audio
{
public enum MicrophoneState
{
Started,
Stopped,
}
[PercentageComplete(100)]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.Tested)]
public enum MicrophoneState
{
Started,
Stopped,
}
}

View File

@ -11,11 +11,12 @@ namespace ANX.Framework.Audio
#if !WINDOWSMETRO //TODO: search replacement for Win8
[SerializableAttribute]
#endif
[PercentageComplete(100)]
[PercentageComplete(99)]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.Tested)]
public sealed class NoAudioHardwareException : ExternalException
{
public NoAudioHardwareException()
: base()
{
}

View File

@ -7,11 +7,12 @@ using ANX.Framework.NonXNA.Development;
namespace ANX.Framework.Audio
{
[PercentageComplete(100)]
[PercentageComplete(100)]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.Tested)]
public sealed class NoMicrophoneConnectedException : Exception
{
public NoMicrophoneConnectedException()
: base()
{
}

View File

@ -7,12 +7,14 @@ using ANX.Framework.NonXNA.Development;
namespace ANX.Framework.Audio
{
[PercentageComplete(100)]
[PercentageComplete(100)]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct RendererDetail
{
#region Private
private string friendlyName;
private string rendererId;
private readonly string friendlyName;
private readonly string rendererId;
#endregion
#region Public
@ -38,24 +40,11 @@ namespace ANX.Framework.Audio
#region GetHashCode
public override int GetHashCode()
{
int hash1 = String.IsNullOrEmpty(friendlyName) ?
0 :
friendlyName.GetHashCode();
int hash2 = String.IsNullOrEmpty(rendererId) ?
0 :
rendererId.GetHashCode();
int hash1 = String.IsNullOrEmpty(friendlyName) ? 0 : friendlyName.GetHashCode();
int hash2 = String.IsNullOrEmpty(rendererId) ? 0 : rendererId.GetHashCode();
return hash1 ^ hash2;
}
#endregion
#region ToString
public override string ToString()
{
return base.ToString();
}
#endregion
#region Equality
public override bool Equals(object obj)

View File

@ -1,4 +1,5 @@
using System;
using ANX.Framework.NonXNA.Development;
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
@ -6,6 +7,8 @@
namespace ANX.Framework.Audio
{
[PercentageComplete(0)]
[TestState(TestStateAttribute.TestState.Untested)]
public class SoundBank : IDisposable
{
#region Events
@ -13,20 +16,13 @@ namespace ANX.Framework.Audio
#endregion
#region Public
public bool IsDisposed
{
get;
private set;
}
public bool IsDisposed { get; private set; }
public bool IsInUse
{
get
{
throw new NotImplementedException();
}
}
#endregion
public bool IsInUse
{
get { throw new NotImplementedException(); }
}
#endregion
#region Constructor
public SoundBank(AudioEngine audioEngine, string filename)

View File

@ -12,8 +12,8 @@ using ANX.Framework.NonXNA.SoundSystem;
namespace ANX.Framework.Audio
{
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.InProgress)]
[Developer("AstrorEnales")]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.InProgress)]
public sealed class SoundEffect : IDisposable
{
#region Static

View File

@ -10,8 +10,8 @@ using ANX.Framework.NonXNA.SoundSystem;
namespace ANX.Framework.Audio
{
[PercentageComplete(100)]
[TestState(TestStateAttribute.TestState.InProgress)]
[Developer("AstrorEnales")]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.InProgress)]
public class SoundEffectInstance : IDisposable
{
#region Private

View File

@ -1,4 +1,5 @@
using System;
using ANX.Framework.NonXNA.Development;
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
@ -6,11 +7,14 @@
namespace ANX.Framework.Audio
{
[Flags]
public enum SoundState
{
Playing = 0,
Paused = 1,
Stopped = 2,
}
[Flags]
[PercentageComplete(100)]
[Developer("AstrorEnales")]
[TestState(TestStateAttribute.TestState.Tested)]
public enum SoundState
{
Playing = 0,
Paused = 1,
Stopped = 2,
}
}

View File

@ -1,4 +1,5 @@
using System;
using ANX.Framework.NonXNA.Development;
// This file is part of the ANX.Framework created by the
// "ANX.Framework developer group" and released under the Ms-PL license.
@ -6,6 +7,8 @@
namespace ANX.Framework.Audio
{
[PercentageComplete(0)]
[TestState(TestStateAttribute.TestState.Untested)]
public class WaveBank : IDisposable
{
#region Events

View File

@ -1,6 +1,7 @@
#region Using Statements
using System;
using System.Globalization;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -10,12 +11,18 @@ using System.Globalization;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct Alpha8 : IPackedVector<byte>, IEquatable<Alpha8>, IPackedVector
{
#region Private Members
private byte packedValue;
#endregion // Private Members
public byte PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
public Alpha8(float alpha)
{
@ -32,25 +39,13 @@ namespace ANX.Framework.Graphics.PackedVector
public float ToAlpha()
{
float value = (float)(packedValue & 255);
float value = packedValue & 255;
return value / 255f;
}
Vector4 IPackedVector.ToVector4()
{
return new Vector4(0f, 0f, 0f, this.ToAlpha());
}
public byte PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
return new Vector4(0f, 0f, 0f, ToAlpha());
}
public override string ToString()
@ -65,22 +60,22 @@ namespace ANX.Framework.Graphics.PackedVector
public override bool Equals(object obj)
{
return ((obj is Alpha8) && this.Equals((Alpha8)obj));
return obj is Alpha8 && this == (Alpha8)obj;
}
public bool Equals(Alpha8 other)
{
return this.packedValue.Equals(other.packedValue);
return this.packedValue == other.packedValue;
}
public static bool operator ==(Alpha8 a, Alpha8 b)
public static bool operator ==(Alpha8 lhs, Alpha8 rhs)
{
return a.Equals(b);
return lhs.packedValue == rhs.packedValue;
}
public static bool operator !=(Alpha8 a, Alpha8 b)
public static bool operator !=(Alpha8 lhs, Alpha8 rhs)
{
return !a.Equals(b);
return lhs.packedValue != rhs.packedValue;
}
}
}

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -9,10 +10,19 @@ using System;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct Bgr565 : IPackedVector<UInt16>, IEquatable<Bgr565>, IPackedVector
{
private UInt16 packedValue;
public ushort PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
public Bgr565(float x, float y, float z)
{
uint r = (uint)(MathHelper.Clamp(x, 0f, 1f) * 31.0f) << 11;
@ -31,18 +41,6 @@ namespace ANX.Framework.Graphics.PackedVector
this.packedValue = (ushort)((r | g) | b);
}
public ushort PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
}
public Vector3 ToVector3()
{
return new Vector3( ((packedValue >> 11) & 31) / 31.0f,
@ -61,17 +59,12 @@ namespace ANX.Framework.Graphics.PackedVector
Vector4 IPackedVector.ToVector4()
{
return new Vector4(this.ToVector3(), 1f);
return new Vector4(ToVector3(), 1f);
}
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == this.GetType())
{
return this == (Bgr565)obj;
}
return false;
return obj is Bgr565 && this == (Bgr565)obj;
}
public bool Equals(Bgr565 other)

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -9,10 +10,19 @@ using System;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct Bgra4444 : IPackedVector<UInt16>, IEquatable<Bgra4444>, IPackedVector
{
private UInt16 packedValue;
public ushort PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
public Bgra4444(float x, float y, float z, float w)
{
uint r = (uint)(MathHelper.Clamp(x, 0f, 1f) * 15.0f) << 8;
@ -33,18 +43,6 @@ namespace ANX.Framework.Graphics.PackedVector
this.packedValue = (ushort)(r | g | b | a);
}
public ushort PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
}
void IPackedVector.PackFromVector4(Vector4 vector)
{
uint r = (uint)(MathHelper.Clamp(vector.X, 0f, 1f) * 31.0f) << 10;
@ -65,12 +63,7 @@ namespace ANX.Framework.Graphics.PackedVector
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == this.GetType())
{
return this == (Bgra4444)obj;
}
return false;
return obj is Bgra4444 && this == (Bgra4444)obj;
}
public bool Equals(Bgra4444 other)

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -9,10 +10,19 @@ using System;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct Bgra5551 : IPackedVector<UInt16>, IEquatable<Bgra5551>, IPackedVector
{
private UInt16 packedValue;
public ushort PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
public Bgra5551(float x, float y, float z, float w)
{
uint r = (uint)(MathHelper.Clamp(x, 0f, 1f) * 31.0f) << 10;
@ -33,18 +43,6 @@ namespace ANX.Framework.Graphics.PackedVector
this.packedValue = (ushort)(r | g | b | a);
}
public ushort PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
}
void IPackedVector.PackFromVector4(Vector4 vector)
{
uint r = (uint)(MathHelper.Clamp(vector.X, 0f, 1f) * 31.0f) << 10;
@ -65,12 +63,7 @@ namespace ANX.Framework.Graphics.PackedVector
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == this.GetType())
{
return this == (Bgra5551)obj;
}
return false;
return obj is Bgra5551 && this == (Bgra5551)obj;
}
public bool Equals(Bgra5551 other)

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -9,10 +10,19 @@ using System;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct Byte4 : IPackedVector<uint>, IEquatable<Byte4>, IPackedVector
{
private uint packedValue;
public uint PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
public Byte4(float x, float y, float z, float w)
{
uint b1 = (uint)MathHelper.Clamp(x, 0f, 255f) << 0;
@ -33,18 +43,6 @@ namespace ANX.Framework.Graphics.PackedVector
this.packedValue = (uint)(b1 | b2 | b3 | b4);
}
public uint PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
}
void IPackedVector.PackFromVector4(Vector4 vector)
{
uint b1 = (uint)MathHelper.Clamp(vector.X, 0f, 255f) << 0;
@ -65,13 +63,7 @@ namespace ANX.Framework.Graphics.PackedVector
public override bool Equals(object obj)
{
if (obj != null &&
obj is Byte4)
{
return this == (Byte4)obj;
}
return false;
return obj is Byte4 && this == (Byte4)obj;
}
public bool Equals(Byte4 other)

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -9,27 +10,24 @@ using System;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct HalfSingle : IPackedVector<UInt16>, IEquatable<HalfSingle>, IPackedVector
{
UInt16 packedValue;
public ushort PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
public HalfSingle(float single)
{
packedValue = HalfTypeHelper.convert(single);
}
public ushort PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
}
public float ToSingle()
{
return HalfTypeHelper.convert(this.packedValue);
@ -47,12 +45,7 @@ namespace ANX.Framework.Graphics.PackedVector
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == this.GetType())
{
return this == (HalfSingle)obj;
}
return false;
return obj is HalfSingle && this == (HalfSingle)obj;
}
public bool Equals(HalfSingle other)

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -9,10 +10,19 @@ using System;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct HalfVector2 : IPackedVector<uint>, IEquatable<HalfVector2>, IPackedVector
{
private uint packedValue;
public uint PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
public HalfVector2(float x, float y)
{
packedValue = HalfTypeHelper.convert(x) | (uint)HalfTypeHelper.convert(y) << 16;
@ -23,18 +33,6 @@ namespace ANX.Framework.Graphics.PackedVector
packedValue = HalfTypeHelper.convert(vector.X) | (uint)HalfTypeHelper.convert(vector.Y) << 16;
}
public uint PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
}
public Vector2 ToVector2()
{
return new Vector2(HalfTypeHelper.convert((ushort)this.packedValue), HalfTypeHelper.convert((ushort)(this.packedValue >> 16)));
@ -53,12 +51,7 @@ namespace ANX.Framework.Graphics.PackedVector
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == this.GetType())
{
return this == (HalfVector2)obj;
}
return false;
return obj is HalfVector2 && this == (HalfVector2)obj;
}
public bool Equals(HalfVector2 other)

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -9,10 +10,19 @@ using System;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct HalfVector4 : IPackedVector<ulong>, IEquatable<HalfVector4>, IPackedVector
{
private ulong packedValue;
public ulong PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
public HalfVector4(float x, float y, float z, float w)
{
this.packedValue = (ulong)HalfTypeHelper.convert(x)
@ -29,18 +39,6 @@ namespace ANX.Framework.Graphics.PackedVector
| (ulong)HalfTypeHelper.convert(vector.W) << 48;
}
public ulong PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
}
public Vector4 ToVector4()
{
return new Vector4(HalfTypeHelper.convert((ushort)this.packedValue),
@ -57,12 +55,7 @@ namespace ANX.Framework.Graphics.PackedVector
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == this.GetType())
{
return this == (HalfVector4)obj;
}
return false;
return obj is HalfVector4 && this == (HalfVector4)obj;
}
public bool Equals(HalfVector4 other)

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -9,13 +10,22 @@ using System;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct NormalizedByte2 : IPackedVector<ushort>, IEquatable<NormalizedByte2>, IPackedVector
{
private ushort packedValue;
private const float max = (float)(255 >> 1);
public ushort PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
private const float max = 255 >> 1;
private const float oneOverMax = 1f / max;
private const uint mask = (uint)(256 >> 1);
private const uint mask = 256 >> 1;
public NormalizedByte2(float x, float y)
{
@ -33,18 +43,6 @@ namespace ANX.Framework.Graphics.PackedVector
this.packedValue = (UInt16)(b1 | b2);
}
public ushort PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
}
public Vector2 ToVector2()
{
Vector2 vector;
@ -87,12 +85,7 @@ namespace ANX.Framework.Graphics.PackedVector
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == this.GetType())
{
return this == (NormalizedByte2)obj;
}
return false;
return obj is NormalizedByte2 && this == (NormalizedByte2)obj;
}
public bool Equals(NormalizedByte2 other)

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -9,13 +10,22 @@ using System;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct NormalizedByte4 : IPackedVector<uint>, IEquatable<NormalizedByte4>, IPackedVector
{
private uint packedValue;
private const float max = (float)(255 >> 1);
public uint PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
private const float max = 255 >> 1;
private const float oneOverMax = 1f / max;
private const uint mask = (uint)(256 >> 1);
private const uint mask = 256 >> 1;
public NormalizedByte4(float x, float y, float z, float w)
{
@ -37,18 +47,6 @@ namespace ANX.Framework.Graphics.PackedVector
this.packedValue = (uint)(b1 | b2 | b3 | b4);
}
public uint PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
}
public Vector4 ToVector4()
{
Vector4 vector;
@ -94,12 +92,7 @@ namespace ANX.Framework.Graphics.PackedVector
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == this.GetType())
{
return this == (NormalizedByte4)obj;
}
return false;
return obj is NormalizedByte4 && this == (NormalizedByte4)obj;
}
public bool Equals(NormalizedByte4 other)

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -9,13 +10,22 @@ using System;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct NormalizedShort2 : IPackedVector<uint>, IEquatable<NormalizedShort2>, IPackedVector
{
private uint packedValue;
private const float max = (float)(65535 >> 1);
public uint PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
private const float max = 65535 >> 1;
private const float oneOverMax = 1f / max;
private const uint mask = (uint)(65536 >> 1);
private const uint mask = 65536 >> 1;
public NormalizedShort2(float x, float y)
{
@ -33,18 +43,6 @@ namespace ANX.Framework.Graphics.PackedVector
this.packedValue = (uint)(b1 | b2);
}
public uint PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
}
public Vector2 ToVector2()
{
Vector2 vector;
@ -87,12 +85,7 @@ namespace ANX.Framework.Graphics.PackedVector
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == this.GetType())
{
return this == (NormalizedShort2)obj;
}
return false;
return obj is NormalizedShort2 && this == (NormalizedShort2)obj;
}
public bool Equals(NormalizedShort2 other)

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -9,13 +10,22 @@ using System;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct NormalizedShort4 : IPackedVector<ulong>, IEquatable<NormalizedShort4>, IPackedVector
{
private ulong packedValue;
private const float max = (float)(65535 >> 1);
public ulong PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
private const float max = 65535 >> 1;
private const float oneOverMax = 1f / max;
private const uint mask = (uint)(65536 >> 1);
private const uint mask = 65536 >> 1;
public NormalizedShort4(float x, float y, float z, float w)
{
@ -37,18 +47,6 @@ namespace ANX.Framework.Graphics.PackedVector
this.packedValue = (ulong)(b1 | b2 | b3 | b4);
}
public ulong PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
}
public Vector4 ToVector4()
{
Vector4 vector;
@ -94,12 +92,7 @@ namespace ANX.Framework.Graphics.PackedVector
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == this.GetType())
{
return this == (NormalizedShort4)obj;
}
return false;
return obj is NormalizedShort4 && this == (NormalizedShort4)obj;
}
public bool Equals(NormalizedShort4 other)

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -9,16 +10,25 @@ using System;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct Rg32 : IPackedVector<uint>, IEquatable<Rg32>, IPackedVector
{
private uint packedValue;
public uint PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
public Rg32(float x, float y)
{
uint r = (uint)(MathHelper.Clamp(x, 0f, 1f) * 65535.0f) << 0;
uint g = (uint)(MathHelper.Clamp(y, 0f, 1f) * 65535.0f) << 16;
this.packedValue = (uint)r | g;
this.packedValue = r | g;
}
public Rg32(Vector2 vector)
@ -26,19 +36,7 @@ namespace ANX.Framework.Graphics.PackedVector
uint r = (uint)(MathHelper.Clamp(vector.X, 0f, 1f) * 65535.0f) << 0;
uint g = (uint)(MathHelper.Clamp(vector.Y, 0f, 1f) * 65535.0f) << 16;
this.packedValue = (uint)r | g;
}
public uint PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
this.packedValue = r | g;
}
public Vector2 ToVector2()
@ -49,8 +47,7 @@ namespace ANX.Framework.Graphics.PackedVector
Vector4 IPackedVector.ToVector4()
{
Vector2 val = this.ToVector2();
return new Vector4(val.X, val.Y, 0f, 1f);
return new Vector4(ToVector2(), 0f, 1f);
}
void IPackedVector.PackFromVector4(Vector4 vector)
@ -60,12 +57,7 @@ namespace ANX.Framework.Graphics.PackedVector
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == this.GetType())
{
return this == (Rg32)obj;
}
return false;
return obj is Rg32 && this == (Rg32)obj;
}
public bool Equals(Rg32 other)

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -9,10 +10,19 @@ using System;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct Rgba1010102 : IPackedVector<uint>, IEquatable<Rgba1010102>, IPackedVector
{
private uint packedValue;
public uint PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
public Rgba1010102(float x, float y, float z, float w)
{
uint r = (uint)(MathHelper.Clamp(x, 0f, 1f) * 1023f);
@ -20,7 +30,7 @@ namespace ANX.Framework.Graphics.PackedVector
uint b = (uint)(MathHelper.Clamp(z, 0f, 1f) * 1023f) << 20;
uint a = (uint)(MathHelper.Clamp(w, 0f, 1f) * 3f) << 30;
this.packedValue = (uint)(r | g | b | a);
this.packedValue = r | g | b | a;
}
public Rgba1010102(Vector4 vector)
@ -30,19 +40,7 @@ namespace ANX.Framework.Graphics.PackedVector
uint b = (uint)(MathHelper.Clamp(vector.Z, 0f, 1f) * 1023f) << 20;
uint a = (uint)(MathHelper.Clamp(vector.W, 0f, 1f) * 3f) << 30;
this.packedValue = (uint)(r | g | b | a);
}
public uint PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
this.packedValue = r | g | b | a;
}
public Vector4 ToVector4()
@ -60,17 +58,12 @@ namespace ANX.Framework.Graphics.PackedVector
uint b = (uint)(MathHelper.Clamp(vector.Z, 0f, 1f) * 1023f) << 20;
uint a = (uint)(MathHelper.Clamp(vector.W, 0f, 1f) * 3f) << 30;
this.packedValue = (uint)(r | g | b | a);
this.packedValue = r | g | b | a;
}
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == this.GetType())
{
return this == (Rgba1010102)obj;
}
return false;
return obj is Rgba1010102 && this == (Rgba1010102)obj;
}
public bool Equals(Rgba1010102 other)

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -9,10 +10,19 @@ using System;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct Rgba64 : IPackedVector<ulong>, IEquatable<Rgba64>, IPackedVector
{
private ulong packedValue;
public ulong PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
public Rgba64(float x, float y, float z, float w)
{
ulong r = (ulong)(MathHelper.Clamp(x, 0f, 1f) * 65535f) << 0;
@ -20,7 +30,7 @@ namespace ANX.Framework.Graphics.PackedVector
ulong b = (ulong)(MathHelper.Clamp(z, 0f, 1f) * 65535f) << 32;
ulong a = (ulong)(MathHelper.Clamp(w, 0f, 1f) * 65535f) << 48;
this.packedValue = (ulong)(r | g | b | a);
this.packedValue = r | g | b | a;
}
public Rgba64(Vector4 vector)
@ -30,19 +40,7 @@ namespace ANX.Framework.Graphics.PackedVector
ulong b = (ulong)(MathHelper.Clamp(vector.Z, 0f, 1f) * 65535f) << 32;
ulong a = (ulong)(MathHelper.Clamp(vector.W, 0f, 1f) * 65535f) << 48;
this.packedValue = (ulong)(r | g | b | a);
}
public ulong PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
this.packedValue = r | g | b | a;
}
public Vector4 ToVector4()
@ -60,17 +58,12 @@ namespace ANX.Framework.Graphics.PackedVector
ulong b = (ulong)(MathHelper.Clamp(vector.Z, 0f, 1f) * 65535f) << 32;
ulong a = (ulong)(MathHelper.Clamp(vector.W, 0f, 1f) * 65535f) << 48;
this.packedValue = (ulong)(r | g | b | a);
this.packedValue = r | g | b | a;
}
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == this.GetType())
{
return this == (Rgba64)obj;
}
return false;
return obj is Rgba64 && this == (Rgba64)obj;
}
public bool Equals(Rgba64 other)

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -9,21 +10,28 @@ using System;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct Short2 : IPackedVector<uint>, IEquatable<Short2>, IPackedVector
{
private uint packedValue;
private const float max = (float)(65535 >> 1);
public uint PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
private const float max = 65535 >> 1;
private const float min = -max - 1f;
private const float oneOverMax = 1f / max;
private const uint mask = (uint)(65536 >> 1);
public Short2(float x, float y)
{
uint b1 = (uint)(((int)MathHelper.Clamp(x, min, max) & 65535) << 0);
uint b2 = (uint)(((int)MathHelper.Clamp(y, min, max) & 65535) << 16);
this.packedValue = (uint)(b1 | b2);
this.packedValue = b1 | b2;
}
public Short2(Vector2 vector)
@ -31,19 +39,7 @@ namespace ANX.Framework.Graphics.PackedVector
uint b1 = (uint)(((int)MathHelper.Clamp(vector.X, min, max) & 65535) << 0);
uint b2 = (uint)(((int)MathHelper.Clamp(vector.Y, min, max) & 65535) << 16);
this.packedValue = (uint)(b1 | b2);
}
public uint PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
this.packedValue = b1 | b2;
}
public Vector2 ToVector2()
@ -59,7 +55,7 @@ namespace ANX.Framework.Graphics.PackedVector
uint b1 = (uint)(((int)MathHelper.Clamp(vector.X, min, max) & 65535) << 0);
uint b2 = (uint)(((int)MathHelper.Clamp(vector.Y, min, max) & 65535) << 16);
this.packedValue = (uint)(b1 | b2);
this.packedValue = b1 | b2;
}
Vector4 IPackedVector.ToVector4()
@ -70,12 +66,7 @@ namespace ANX.Framework.Graphics.PackedVector
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == this.GetType())
{
return this == (Short2)obj;
}
return false;
return obj is Short2 && this == (Short2)obj;
}
public bool Equals(Short2 other)

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -9,14 +10,21 @@ using System;
namespace ANX.Framework.Graphics.PackedVector
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Untested)]
public struct Short4 : IPackedVector<ulong>, IEquatable<Short4>, IPackedVector
{
private ulong packedValue;
private const float max = (float)(65535 >> 1);
public ulong PackedValue
{
get { return packedValue; }
set { packedValue = value; }
}
private const float max = 65535 >> 1;
private const float min = -max - 1f;
private const float oneOverMax = 1f / max;
private const uint mask = (uint)(65536 >> 1);
public Short4(float x, float y, float z, float w)
{
@ -25,7 +33,7 @@ namespace ANX.Framework.Graphics.PackedVector
ulong b3 = (ulong)(((long)MathHelper.Clamp(z, min, max) & 65535) << 32);
ulong b4 = (ulong)(((long)MathHelper.Clamp(w, min, max) & 65535) << 48);
this.packedValue = (ulong)(b1 | b2 | b3 | b4);
this.packedValue = b1 | b2 | b3 | b4;
}
public Short4(Vector4 vector)
@ -35,19 +43,7 @@ namespace ANX.Framework.Graphics.PackedVector
ulong b3 = (ulong)(((long)MathHelper.Clamp(vector.Z, min, max) & 65535) << 32);
ulong b4 = (ulong)(((long)MathHelper.Clamp(vector.W, min, max) & 65535) << 48);
this.packedValue = (ulong)(b1 | b2 | b3 | b4);
}
public ulong PackedValue
{
get
{
return this.packedValue;
}
set
{
this.packedValue = value;
}
this.packedValue = b1 | b2 | b3 | b4;
}
public Vector4 ToVector4()
@ -67,7 +63,7 @@ namespace ANX.Framework.Graphics.PackedVector
ulong b3 = (ulong)(((long)MathHelper.Clamp(vector.Z, -max, max) & 65535) << 32);
ulong b4 = (ulong)(((long)MathHelper.Clamp(vector.W, -max, max) & 65535) << 48);
this.packedValue = (ulong)(b1 | b2 | b3 | b4);
this.packedValue = b1 | b2 | b3 | b4;
}
Vector4 IPackedVector.ToVector4()
@ -77,12 +73,7 @@ namespace ANX.Framework.Graphics.PackedVector
public override bool Equals(object obj)
{
if (obj != null && obj.GetType() == this.GetType())
{
return this == (Short4)obj;
}
return false;
return obj is Short4 && this == (Short4)obj;
}
public bool Equals(Short4 other)

View File

@ -1,5 +1,6 @@
#region Using Statements
using System;
using ANX.Framework.NonXNA.Development;
#endregion // Using Statements
@ -36,6 +37,9 @@ SOFTWARE.
namespace ANX.Framework
{
[PercentageComplete(100)]
[Developer("???")]
[TestState(TestStateAttribute.TestState.Tested)]
public static class MathHelper
{
public const float E = (float)Math.E;
@ -111,8 +115,8 @@ namespace ANX.Framework
// It is expected that 0 < amount < 1
// If amount < 0, return value1
// If amount > 1, return value2
float result = MathHelper.Clamp(amount, 0f, 1f);
result = MathHelper.Hermite(value1, 0f, value2, 0f, result);
float result = Clamp(amount, 0f, 1f);
result = Hermite(value1, 0f, value2, 0f, result);
return result;
}

View File

@ -14,6 +14,8 @@ namespace ANX.Framework.NonXNA.SoundSystem
bool IsHeadset { get; }
TimeSpan BufferDuration { get; set; }
event EventHandler<EventArgs> BufferReady;
void Stop();
void Start();

View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>OnlineStatusGenerator</RootNamespace>
<AssemblyName>OnlineStatusGenerator</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\ANX.Framework\ANX.Framework.csproj">
<Project>{6899F0C9-70B9-4EB0-9DD3-E598D4BE3E35}</Project>
<Name>ANX.Framework</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.IO;
using ANX.Framework.NonXNA.Development;
namespace OnlineStatusGenerator
{
class Program
{
static void Main(string[] args)
{
var assembly = Assembly.LoadFile(Path.GetFullPath("ANX.Framework.dll"));
Type[] allTypes = assembly.GetTypes();
var namespaces = new Dictionary<string, List<Type>>();
foreach (Type type in allTypes)
{
if (type.Namespace.Contains("NonXNA") || type.IsPublic == false)
continue;
if (namespaces.ContainsKey(type.Namespace) == false)
namespaces.Add(type.Namespace, new List<Type>());
namespaces[type.Namespace].Add(type);
}
var sortedKeys = new List<string>(namespaces.Keys);
sortedKeys.Sort();
string result = "<table border=1 cellspacing=0>";
foreach (string space in sortedKeys)
{
result += "\n<tr><td style=\"background-color: silver;\"><strong>" + space + "</strong></td><td style=\"background-color: silver;\" align=center>%</td><td style=\"background-color: silver;\" align=center>Developer</td><td style=\"background-color: silver;\" align=center>Test State</td></tr>";
foreach (Type type in namespaces[space])
{
result += "\n<tr><td>" + type.Name + "</td>";
object[] percentageAttributes = type.GetCustomAttributes(typeof(PercentageCompleteAttribute), false);
var percentageAttribute = percentageAttributes.Length > 0 ?
percentageAttributes[0] as PercentageCompleteAttribute : null;
result += "<td align=center>" + (percentageAttribute != null ? percentageAttribute.Percentage.ToString() : "---") + "</td>";
object[] developerAttributes = type.GetCustomAttributes(typeof(DeveloperAttribute), false);
var developerAttribute = developerAttributes.Length > 0 ?
developerAttributes[0] as DeveloperAttribute : null;
result += "<td align=center>" + (developerAttribute != null ? developerAttribute.Developer : "---") + "</td>";
object[] testAttributes = type.GetCustomAttributes(typeof(TestStateAttribute), false);
var testAttribute = testAttributes.Length > 0 ?
testAttributes[0] as TestStateAttribute : null;
result += "<td align=center>" + (testAttribute != null ? testAttribute.State.ToString() : "---") + "</td>";
result += "</tr>";
}
}
result += "</table>";
File.WriteAllText("Report.html", result);
System.Diagnostics.Process.Start("Report.html");
}
}
}

View File

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die mit einer Assembly verknüpft sind.
[assembly: AssemblyTitle("OnlineStatusGenerator")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("ANX Developer Team")]
[assembly: AssemblyProduct("OnlineStatusGenerator")]
[assembly: AssemblyCopyright("Copyright © ANX Developer Team 2012")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von
// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest.
[assembly: ComVisible(false)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[assembly: Guid("f4ff1926-fa21-406e-b6af-af73b14503ae")]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]