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:
parent
41061f8b12
commit
6f759ae509
@ -195,6 +195,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ANX.RenderSystem.Windows.DX
|
|||||||
EndProject
|
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}"
|
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
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OnlineStatusGenerator", "Tools\OnlineStatusGenerator\OnlineStatusGenerator.csproj", "{6119ADEE-7047-4E29-BEC2-00F8D6D0EA01}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
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|x64.Build.0 = Release|x64
|
||||||
{628AB80A-B1B9-4878-A810-7A58D4840F60}.Release|x86.ActiveCfg = Release|x86
|
{628AB80A-B1B9-4878-A810-7A58D4840F60}.Release|x86.ActiveCfg = Release|x86
|
||||||
{628AB80A-B1B9-4878-A810-7A58D4840F60}.Release|x86.Build.0 = 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
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@ -995,6 +1011,7 @@ Global
|
|||||||
{938D5F88-B888-4B04-BEEE-EE701FBA51EF} = {B24A8593-562A-4A25-BB08-46C163F10F3F}
|
{938D5F88-B888-4B04-BEEE-EE701FBA51EF} = {B24A8593-562A-4A25-BB08-46C163F10F3F}
|
||||||
{14B39F89-C9B0-407E-877A-B515C985E96E} = {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}
|
{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}
|
{B30DE9C2-0926-46B6-8351-9AF276C472D5} = {D421509A-9AE3-4D7E-881B-EAFED598B028}
|
||||||
{FF0AB665-2796-4354-9630-76C2751DB3C2} = {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}
|
{2B71A7C2-0D18-4E3D-AE5A-320641D1162A} = {D421509A-9AE3-4D7E-881B-EAFED598B028}
|
||||||
|
@ -8,7 +8,8 @@ using ANX.Framework.NonXNA.Development;
|
|||||||
|
|
||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
[PercentageComplete(30)]
|
[PercentageComplete(30)]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct AudioCategory : IEquatable<AudioCategory>
|
public struct AudioCategory : IEquatable<AudioCategory>
|
||||||
{
|
{
|
||||||
#region Internal helper enums
|
#region Internal helper enums
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
// This file is part of the ANX.Framework created by the
|
// This file is part of the ANX.Framework created by the
|
||||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||||
@ -7,6 +8,9 @@
|
|||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
[Flags]
|
[Flags]
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("AstrorEnales")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Tested)]
|
||||||
public enum AudioChannels
|
public enum AudioChannels
|
||||||
{
|
{
|
||||||
Mono = 1,
|
Mono = 1,
|
||||||
|
@ -8,81 +8,47 @@ using ANX.Framework.NonXNA.Development;
|
|||||||
|
|
||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
[PercentageComplete(100)]
|
[PercentageComplete(100)]
|
||||||
public class AudioEmitter
|
[Developer("AstrorEnales")]
|
||||||
{
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
#region Private
|
public class AudioEmitter
|
||||||
private IAudioEmitter nativeEmitter;
|
{
|
||||||
#endregion
|
private readonly IAudioEmitter nativeEmitter;
|
||||||
|
|
||||||
#region Public
|
public float DopplerScale
|
||||||
public float DopplerScale
|
{
|
||||||
{
|
get { return nativeEmitter.DopplerScale; }
|
||||||
get
|
set { nativeEmitter.DopplerScale = value; }
|
||||||
{
|
}
|
||||||
return nativeEmitter.DopplerScale;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
nativeEmitter.DopplerScale = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector3 Forward
|
public Vector3 Forward
|
||||||
{
|
{
|
||||||
get
|
get { return nativeEmitter.Forward; }
|
||||||
{
|
set { nativeEmitter.Forward = value; }
|
||||||
return nativeEmitter.Forward;
|
}
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
nativeEmitter.Forward = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector3 Position
|
public Vector3 Position
|
||||||
{
|
{
|
||||||
get
|
get { return nativeEmitter.Position; }
|
||||||
{
|
set { nativeEmitter.Position = value; }
|
||||||
return nativeEmitter.Position;
|
}
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
nativeEmitter.Position = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector3 Up
|
public Vector3 Up
|
||||||
{
|
{
|
||||||
get
|
get { return nativeEmitter.Up; }
|
||||||
{
|
set { nativeEmitter.Up = value; }
|
||||||
return nativeEmitter.Up;
|
}
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
nativeEmitter.Up = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector3 Velocity
|
public Vector3 Velocity
|
||||||
{
|
{
|
||||||
get
|
get { return nativeEmitter.Velocity; }
|
||||||
{
|
set { nativeEmitter.Velocity = value; }
|
||||||
return nativeEmitter.Velocity;
|
}
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
nativeEmitter.Velocity = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Constructor
|
public AudioEmitter()
|
||||||
public AudioEmitter()
|
{
|
||||||
{
|
var creator = AddInSystemFactory.Instance.GetDefaultCreator<ISoundSystemCreator>();
|
||||||
var creator = AddInSystemFactory.Instance.GetDefaultCreator<ISoundSystemCreator>();
|
nativeEmitter = creator.CreateAudioEmitter();
|
||||||
nativeEmitter = creator.CreateAudioEmitter();
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,9 @@ using ANX.Framework.NonXNA.PlatformSystem;
|
|||||||
|
|
||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
[PercentageComplete(50)]
|
[PercentageComplete(50)]
|
||||||
|
[Developer("AstrorEnales")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public class AudioEngine : IDisposable
|
public class AudioEngine : IDisposable
|
||||||
{
|
{
|
||||||
#region Constants
|
#region Constants
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
using ANX.Framework.NonXNA;
|
using ANX.Framework.NonXNA;
|
||||||
using ANX.Framework.NonXNA.SoundSystem;
|
|
||||||
using ANX.Framework.NonXNA.Development;
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
using ANX.Framework.NonXNA.SoundSystem;
|
||||||
|
|
||||||
// This file is part of the ANX.Framework created by the
|
// This file is part of the ANX.Framework created by the
|
||||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||||
@ -8,69 +8,41 @@ using ANX.Framework.NonXNA.Development;
|
|||||||
|
|
||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
[PercentageComplete(100)]
|
[PercentageComplete(100)]
|
||||||
public class AudioListener
|
[Developer("AstrorEnales")]
|
||||||
{
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
#region Private
|
public class AudioListener
|
||||||
private IAudioListener nativeListener;
|
{
|
||||||
#endregion
|
private readonly IAudioListener nativeListener;
|
||||||
|
|
||||||
#region Public
|
public Vector3 Forward
|
||||||
public Vector3 Forward
|
{
|
||||||
{
|
get { return nativeListener.Forward; }
|
||||||
get
|
set { nativeListener.Forward = value; }
|
||||||
{
|
}
|
||||||
return nativeListener.Forward;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
nativeListener.Forward = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector3 Position
|
public Vector3 Position
|
||||||
{
|
{
|
||||||
get
|
get { return nativeListener.Position; }
|
||||||
{
|
set { nativeListener.Position = value; }
|
||||||
return nativeListener.Position;
|
}
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
nativeListener.Position = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector3 Up
|
public Vector3 Up
|
||||||
{
|
{
|
||||||
get
|
get { return nativeListener.Up; }
|
||||||
{
|
set { nativeListener.Up = value; }
|
||||||
return nativeListener.Up;
|
}
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
nativeListener.Up = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector3 Velocity
|
public Vector3 Velocity
|
||||||
{
|
{
|
||||||
get
|
get { return nativeListener.Velocity; }
|
||||||
{
|
set { nativeListener.Velocity = value; }
|
||||||
return nativeListener.Velocity;
|
}
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
nativeListener.Velocity = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Constructor
|
public AudioListener()
|
||||||
public AudioListener()
|
{
|
||||||
{
|
var creator = AddInSystemFactory.Instance.GetDefaultCreator<ISoundSystemCreator>();
|
||||||
var creator = AddInSystemFactory.Instance.GetDefaultCreator<ISoundSystemCreator>();
|
nativeListener = creator.CreateAudioListener();
|
||||||
nativeListener = creator.CreateAudioListener();
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -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.
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||||
// For details see: http://anxframework.codeplex.com/license
|
// For details see: http://anxframework.codeplex.com/license
|
||||||
|
|
||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
public enum AudioStopOptions
|
[PercentageComplete(100)]
|
||||||
{
|
[Developer("AstrorEnales")]
|
||||||
AsAuthored,
|
[TestState(TestStateAttribute.TestState.Tested)]
|
||||||
Immediate
|
public enum AudioStopOptions
|
||||||
}
|
{
|
||||||
|
AsAuthored,
|
||||||
|
Immediate
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,8 @@ using ANX.Framework.NonXNA.Development;
|
|||||||
|
|
||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
[PercentageComplete(5)]
|
[PercentageComplete(5)]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public sealed class Cue : IDisposable
|
public sealed class Cue : IDisposable
|
||||||
{
|
{
|
||||||
#region Events
|
#region Events
|
||||||
|
@ -10,8 +10,8 @@ using ANX.Framework.NonXNA.SoundSystem;
|
|||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
[PercentageComplete(100)]
|
[PercentageComplete(100)]
|
||||||
[TestState(TestStateAttribute.TestState.Untested)]
|
|
||||||
[Developer("AstrorEnales")]
|
[Developer("AstrorEnales")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public sealed class DynamicSoundEffectInstance : SoundEffectInstance
|
public sealed class DynamicSoundEffectInstance : SoundEffectInstance
|
||||||
{
|
{
|
||||||
private IDynamicSoundEffectInstance nativeDynamicInstance;
|
private IDynamicSoundEffectInstance nativeDynamicInstance;
|
||||||
|
@ -11,10 +11,11 @@ namespace ANX.Framework.Audio
|
|||||||
#if !WINDOWSMETRO //TODO: search replacement for Win8
|
#if !WINDOWSMETRO //TODO: search replacement for Win8
|
||||||
[Serializable]
|
[Serializable]
|
||||||
#endif
|
#endif
|
||||||
[PercentageComplete(100)]
|
[PercentageComplete(99)]
|
||||||
|
[Developer("AstrorEnales")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Tested)]
|
||||||
public sealed class InstancePlayLimitException : ExternalException
|
public sealed class InstancePlayLimitException : ExternalException
|
||||||
{
|
{
|
||||||
#region Constructor
|
|
||||||
public InstancePlayLimitException()
|
public InstancePlayLimitException()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@ -28,6 +29,5 @@ namespace ANX.Framework.Audio
|
|||||||
: base(message, innerException)
|
: base(message, innerException)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using ANX.Framework.NonXNA.SoundSystem;
|
|
||||||
using ANX.Framework.NonXNA;
|
using ANX.Framework.NonXNA;
|
||||||
using ANX.Framework.NonXNA.Development;
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
using ANX.Framework.NonXNA.SoundSystem;
|
||||||
|
|
||||||
// This file is part of the ANX.Framework created by the
|
// This file is part of the ANX.Framework created by the
|
||||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||||
@ -10,14 +10,14 @@ using ANX.Framework.NonXNA.Development;
|
|||||||
|
|
||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
[PercentageComplete(90)]
|
[PercentageComplete(100)]
|
||||||
|
[Developer("AstrorEnales")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public sealed class Microphone
|
public sealed class Microphone
|
||||||
{
|
{
|
||||||
#region Private
|
#region Private
|
||||||
private static int defaultMicrophone;
|
private static readonly int defaultMicrophone;
|
||||||
private static ReadOnlyCollection<Microphone> allMicrophones;
|
private IMicrophone nativeMicrophone;
|
||||||
|
|
||||||
private IMicrophone nativeMicrophone;
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Events
|
#region Events
|
||||||
@ -25,67 +25,43 @@ namespace ANX.Framework.Audio
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Public
|
#region Public
|
||||||
public static ReadOnlyCollection<Microphone> All
|
public static ReadOnlyCollection<Microphone> All { get; private set; }
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return allMicrophones;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Microphone Default
|
public static Microphone Default
|
||||||
{
|
{
|
||||||
get
|
get { return All[defaultMicrophone]; }
|
||||||
{
|
}
|
||||||
return allMicrophones[defaultMicrophone];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public readonly string Name;
|
public readonly string Name;
|
||||||
|
|
||||||
public TimeSpan BufferDuration
|
public TimeSpan BufferDuration
|
||||||
{
|
{
|
||||||
get
|
get { return nativeMicrophone.BufferDuration; }
|
||||||
{
|
set { nativeMicrophone.BufferDuration = value; }
|
||||||
return nativeMicrophone.BufferDuration;
|
}
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
nativeMicrophone.BufferDuration = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsHeadset
|
public bool IsHeadset
|
||||||
{
|
{
|
||||||
get
|
get { return nativeMicrophone.IsHeadset; }
|
||||||
{
|
}
|
||||||
return nativeMicrophone.IsHeadset;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public int SampleRate
|
public int SampleRate
|
||||||
{
|
{
|
||||||
get
|
get { return nativeMicrophone.SampleRate; }
|
||||||
{
|
}
|
||||||
return nativeMicrophone.SampleRate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public MicrophoneState State
|
public MicrophoneState State
|
||||||
{
|
{
|
||||||
get
|
get { return nativeMicrophone.State; }
|
||||||
{
|
}
|
||||||
return nativeMicrophone.State;
|
#endregion
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Constructor
|
#region Constructor
|
||||||
static Microphone()
|
static Microphone()
|
||||||
{
|
{
|
||||||
var creator = AddInSystemFactory.Instance.GetDefaultCreator<ISoundSystemCreator>();
|
var creator = AddInSystemFactory.Instance.GetDefaultCreator<ISoundSystemCreator>();
|
||||||
allMicrophones = creator.GetAllMicrophones();
|
All = creator.GetAllMicrophones();
|
||||||
defaultMicrophone = creator.GetDefaultMicrophone(allMicrophones);
|
defaultMicrophone = creator.GetDefaultMicrophone(All);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal Microphone(string setName)
|
internal Microphone(string setName)
|
||||||
@ -93,15 +69,17 @@ namespace ANX.Framework.Audio
|
|||||||
Name = setName;
|
Name = setName;
|
||||||
var creator = AddInSystemFactory.Instance.GetDefaultCreator<ISoundSystemCreator>();
|
var creator = AddInSystemFactory.Instance.GetDefaultCreator<ISoundSystemCreator>();
|
||||||
nativeMicrophone = creator.CreateMicrophone(this);
|
nativeMicrophone = creator.CreateMicrophone(this);
|
||||||
|
nativeMicrophone.BufferReady += BufferReady;
|
||||||
}
|
}
|
||||||
|
|
||||||
~Microphone()
|
~Microphone()
|
||||||
{
|
{
|
||||||
if (nativeMicrophone != null)
|
if (nativeMicrophone == null)
|
||||||
{
|
return;
|
||||||
nativeMicrophone.Dispose();
|
|
||||||
nativeMicrophone = null;
|
nativeMicrophone.BufferReady -= BufferReady;
|
||||||
}
|
nativeMicrophone.Dispose();
|
||||||
|
nativeMicrophone = null;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -138,9 +116,7 @@ namespace ANX.Framework.Audio
|
|||||||
{
|
{
|
||||||
return nativeMicrophone.GetData(buffer);
|
return nativeMicrophone.GetData(buffer);
|
||||||
}
|
}
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region GetData
|
|
||||||
public int GetData(byte[] buffer, int offset, int count)
|
public int GetData(byte[] buffer, int offset, int count)
|
||||||
{
|
{
|
||||||
return nativeMicrophone.GetData(buffer, offset, count);
|
return nativeMicrophone.GetData(buffer, offset, count);
|
||||||
|
@ -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.
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||||
// For details see: http://anxframework.codeplex.com/license
|
// For details see: http://anxframework.codeplex.com/license
|
||||||
|
|
||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
public enum MicrophoneState
|
[PercentageComplete(100)]
|
||||||
{
|
[Developer("AstrorEnales")]
|
||||||
Started,
|
[TestState(TestStateAttribute.TestState.Tested)]
|
||||||
Stopped,
|
public enum MicrophoneState
|
||||||
}
|
{
|
||||||
|
Started,
|
||||||
|
Stopped,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,11 +11,12 @@ namespace ANX.Framework.Audio
|
|||||||
#if !WINDOWSMETRO //TODO: search replacement for Win8
|
#if !WINDOWSMETRO //TODO: search replacement for Win8
|
||||||
[SerializableAttribute]
|
[SerializableAttribute]
|
||||||
#endif
|
#endif
|
||||||
[PercentageComplete(100)]
|
[PercentageComplete(99)]
|
||||||
|
[Developer("AstrorEnales")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Tested)]
|
||||||
public sealed class NoAudioHardwareException : ExternalException
|
public sealed class NoAudioHardwareException : ExternalException
|
||||||
{
|
{
|
||||||
public NoAudioHardwareException()
|
public NoAudioHardwareException()
|
||||||
: base()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,11 +7,12 @@ using ANX.Framework.NonXNA.Development;
|
|||||||
|
|
||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
[PercentageComplete(100)]
|
[PercentageComplete(100)]
|
||||||
|
[Developer("AstrorEnales")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Tested)]
|
||||||
public sealed class NoMicrophoneConnectedException : Exception
|
public sealed class NoMicrophoneConnectedException : Exception
|
||||||
{
|
{
|
||||||
public NoMicrophoneConnectedException()
|
public NoMicrophoneConnectedException()
|
||||||
: base()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,12 +7,14 @@ using ANX.Framework.NonXNA.Development;
|
|||||||
|
|
||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
[PercentageComplete(100)]
|
[PercentageComplete(100)]
|
||||||
|
[Developer("AstrorEnales")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct RendererDetail
|
public struct RendererDetail
|
||||||
{
|
{
|
||||||
#region Private
|
#region Private
|
||||||
private string friendlyName;
|
private readonly string friendlyName;
|
||||||
private string rendererId;
|
private readonly string rendererId;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Public
|
#region Public
|
||||||
@ -38,24 +40,11 @@ namespace ANX.Framework.Audio
|
|||||||
#region GetHashCode
|
#region GetHashCode
|
||||||
public override int GetHashCode()
|
public override int GetHashCode()
|
||||||
{
|
{
|
||||||
int hash1 = String.IsNullOrEmpty(friendlyName) ?
|
int hash1 = String.IsNullOrEmpty(friendlyName) ? 0 : friendlyName.GetHashCode();
|
||||||
0 :
|
int hash2 = String.IsNullOrEmpty(rendererId) ? 0 : rendererId.GetHashCode();
|
||||||
friendlyName.GetHashCode();
|
|
||||||
|
|
||||||
int hash2 = String.IsNullOrEmpty(rendererId) ?
|
|
||||||
0 :
|
|
||||||
rendererId.GetHashCode();
|
|
||||||
|
|
||||||
return hash1 ^ hash2;
|
return hash1 ^ hash2;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region ToString
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return base.ToString();
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Equality
|
#region Equality
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
// This file is part of the ANX.Framework created by the
|
// This file is part of the ANX.Framework created by the
|
||||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||||
@ -6,6 +7,8 @@
|
|||||||
|
|
||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(0)]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public class SoundBank : IDisposable
|
public class SoundBank : IDisposable
|
||||||
{
|
{
|
||||||
#region Events
|
#region Events
|
||||||
@ -13,20 +16,13 @@ namespace ANX.Framework.Audio
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Public
|
#region Public
|
||||||
public bool IsDisposed
|
public bool IsDisposed { get; private set; }
|
||||||
{
|
|
||||||
get;
|
|
||||||
private set;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsInUse
|
public bool IsInUse
|
||||||
{
|
{
|
||||||
get
|
get { throw new NotImplementedException(); }
|
||||||
{
|
}
|
||||||
throw new NotImplementedException();
|
#endregion
|
||||||
}
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Constructor
|
#region Constructor
|
||||||
public SoundBank(AudioEngine audioEngine, string filename)
|
public SoundBank(AudioEngine audioEngine, string filename)
|
||||||
|
@ -12,8 +12,8 @@ using ANX.Framework.NonXNA.SoundSystem;
|
|||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
[PercentageComplete(100)]
|
[PercentageComplete(100)]
|
||||||
[TestState(TestStateAttribute.TestState.InProgress)]
|
[Developer("AstrorEnales")]
|
||||||
[Developer("AstrorEnales")]
|
[TestState(TestStateAttribute.TestState.InProgress)]
|
||||||
public sealed class SoundEffect : IDisposable
|
public sealed class SoundEffect : IDisposable
|
||||||
{
|
{
|
||||||
#region Static
|
#region Static
|
||||||
|
@ -10,8 +10,8 @@ using ANX.Framework.NonXNA.SoundSystem;
|
|||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
[PercentageComplete(100)]
|
[PercentageComplete(100)]
|
||||||
[TestState(TestStateAttribute.TestState.InProgress)]
|
[Developer("AstrorEnales")]
|
||||||
[Developer("AstrorEnales")]
|
[TestState(TestStateAttribute.TestState.InProgress)]
|
||||||
public class SoundEffectInstance : IDisposable
|
public class SoundEffectInstance : IDisposable
|
||||||
{
|
{
|
||||||
#region Private
|
#region Private
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
// This file is part of the ANX.Framework created by the
|
// This file is part of the ANX.Framework created by the
|
||||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||||
@ -6,11 +7,14 @@
|
|||||||
|
|
||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
[Flags]
|
[Flags]
|
||||||
public enum SoundState
|
[PercentageComplete(100)]
|
||||||
{
|
[Developer("AstrorEnales")]
|
||||||
Playing = 0,
|
[TestState(TestStateAttribute.TestState.Tested)]
|
||||||
Paused = 1,
|
public enum SoundState
|
||||||
Stopped = 2,
|
{
|
||||||
}
|
Playing = 0,
|
||||||
|
Paused = 1,
|
||||||
|
Stopped = 2,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
// This file is part of the ANX.Framework created by the
|
// This file is part of the ANX.Framework created by the
|
||||||
// "ANX.Framework developer group" and released under the Ms-PL license.
|
// "ANX.Framework developer group" and released under the Ms-PL license.
|
||||||
@ -6,6 +7,8 @@
|
|||||||
|
|
||||||
namespace ANX.Framework.Audio
|
namespace ANX.Framework.Audio
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(0)]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public class WaveBank : IDisposable
|
public class WaveBank : IDisposable
|
||||||
{
|
{
|
||||||
#region Events
|
#region Events
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -10,12 +11,18 @@ using System.Globalization;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct Alpha8 : IPackedVector<byte>, IEquatable<Alpha8>, IPackedVector
|
public struct Alpha8 : IPackedVector<byte>, IEquatable<Alpha8>, IPackedVector
|
||||||
{
|
{
|
||||||
#region Private Members
|
|
||||||
private byte packedValue;
|
private byte packedValue;
|
||||||
|
|
||||||
#endregion // Private Members
|
public byte PackedValue
|
||||||
|
{
|
||||||
|
get { return packedValue; }
|
||||||
|
set { packedValue = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public Alpha8(float alpha)
|
public Alpha8(float alpha)
|
||||||
{
|
{
|
||||||
@ -32,25 +39,13 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
|
|
||||||
public float ToAlpha()
|
public float ToAlpha()
|
||||||
{
|
{
|
||||||
float value = (float)(packedValue & 255);
|
float value = packedValue & 255;
|
||||||
return value / 255f;
|
return value / 255f;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector4 IPackedVector.ToVector4()
|
Vector4 IPackedVector.ToVector4()
|
||||||
{
|
{
|
||||||
return new Vector4(0f, 0f, 0f, this.ToAlpha());
|
return new Vector4(0f, 0f, 0f, ToAlpha());
|
||||||
}
|
|
||||||
|
|
||||||
public byte PackedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.packedValue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.packedValue = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
@ -65,22 +60,22 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
|
|
||||||
public override bool Equals(object obj)
|
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)
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -9,10 +10,19 @@ using System;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct Bgr565 : IPackedVector<UInt16>, IEquatable<Bgr565>, IPackedVector
|
public struct Bgr565 : IPackedVector<UInt16>, IEquatable<Bgr565>, IPackedVector
|
||||||
{
|
{
|
||||||
private UInt16 packedValue;
|
private UInt16 packedValue;
|
||||||
|
|
||||||
|
public ushort PackedValue
|
||||||
|
{
|
||||||
|
get { return packedValue; }
|
||||||
|
set { packedValue = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public Bgr565(float x, float y, float z)
|
public Bgr565(float x, float y, float z)
|
||||||
{
|
{
|
||||||
uint r = (uint)(MathHelper.Clamp(x, 0f, 1f) * 31.0f) << 11;
|
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);
|
this.packedValue = (ushort)((r | g) | b);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ushort PackedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.packedValue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.packedValue = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector3 ToVector3()
|
public Vector3 ToVector3()
|
||||||
{
|
{
|
||||||
return new Vector3( ((packedValue >> 11) & 31) / 31.0f,
|
return new Vector3( ((packedValue >> 11) & 31) / 31.0f,
|
||||||
@ -61,17 +59,12 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
|
|
||||||
Vector4 IPackedVector.ToVector4()
|
Vector4 IPackedVector.ToVector4()
|
||||||
{
|
{
|
||||||
return new Vector4(this.ToVector3(), 1f);
|
return new Vector4(ToVector3(), 1f);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj != null && obj.GetType() == this.GetType())
|
return obj is Bgr565 && this == (Bgr565)obj;
|
||||||
{
|
|
||||||
return this == (Bgr565)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Bgr565 other)
|
public bool Equals(Bgr565 other)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -9,10 +10,19 @@ using System;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct Bgra4444 : IPackedVector<UInt16>, IEquatable<Bgra4444>, IPackedVector
|
public struct Bgra4444 : IPackedVector<UInt16>, IEquatable<Bgra4444>, IPackedVector
|
||||||
{
|
{
|
||||||
private UInt16 packedValue;
|
private UInt16 packedValue;
|
||||||
|
|
||||||
|
public ushort PackedValue
|
||||||
|
{
|
||||||
|
get { return packedValue; }
|
||||||
|
set { packedValue = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public Bgra4444(float x, float y, float z, float w)
|
public Bgra4444(float x, float y, float z, float w)
|
||||||
{
|
{
|
||||||
uint r = (uint)(MathHelper.Clamp(x, 0f, 1f) * 15.0f) << 8;
|
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);
|
this.packedValue = (ushort)(r | g | b | a);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ushort PackedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.packedValue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.packedValue = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void IPackedVector.PackFromVector4(Vector4 vector)
|
void IPackedVector.PackFromVector4(Vector4 vector)
|
||||||
{
|
{
|
||||||
uint r = (uint)(MathHelper.Clamp(vector.X, 0f, 1f) * 31.0f) << 10;
|
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)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj != null && obj.GetType() == this.GetType())
|
return obj is Bgra4444 && this == (Bgra4444)obj;
|
||||||
{
|
|
||||||
return this == (Bgra4444)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Bgra4444 other)
|
public bool Equals(Bgra4444 other)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -9,10 +10,19 @@ using System;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct Bgra5551 : IPackedVector<UInt16>, IEquatable<Bgra5551>, IPackedVector
|
public struct Bgra5551 : IPackedVector<UInt16>, IEquatable<Bgra5551>, IPackedVector
|
||||||
{
|
{
|
||||||
private UInt16 packedValue;
|
private UInt16 packedValue;
|
||||||
|
|
||||||
|
public ushort PackedValue
|
||||||
|
{
|
||||||
|
get { return packedValue; }
|
||||||
|
set { packedValue = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public Bgra5551(float x, float y, float z, float w)
|
public Bgra5551(float x, float y, float z, float w)
|
||||||
{
|
{
|
||||||
uint r = (uint)(MathHelper.Clamp(x, 0f, 1f) * 31.0f) << 10;
|
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);
|
this.packedValue = (ushort)(r | g | b | a);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ushort PackedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.packedValue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.packedValue = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void IPackedVector.PackFromVector4(Vector4 vector)
|
void IPackedVector.PackFromVector4(Vector4 vector)
|
||||||
{
|
{
|
||||||
uint r = (uint)(MathHelper.Clamp(vector.X, 0f, 1f) * 31.0f) << 10;
|
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)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj != null && obj.GetType() == this.GetType())
|
return obj is Bgra5551 && this == (Bgra5551)obj;
|
||||||
{
|
|
||||||
return this == (Bgra5551)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Bgra5551 other)
|
public bool Equals(Bgra5551 other)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -9,10 +10,19 @@ using System;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct Byte4 : IPackedVector<uint>, IEquatable<Byte4>, IPackedVector
|
public struct Byte4 : IPackedVector<uint>, IEquatable<Byte4>, IPackedVector
|
||||||
{
|
{
|
||||||
private uint packedValue;
|
private uint packedValue;
|
||||||
|
|
||||||
|
public uint PackedValue
|
||||||
|
{
|
||||||
|
get { return packedValue; }
|
||||||
|
set { packedValue = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public Byte4(float x, float y, float z, float w)
|
public Byte4(float x, float y, float z, float w)
|
||||||
{
|
{
|
||||||
uint b1 = (uint)MathHelper.Clamp(x, 0f, 255f) << 0;
|
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);
|
this.packedValue = (uint)(b1 | b2 | b3 | b4);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint PackedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.packedValue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.packedValue = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void IPackedVector.PackFromVector4(Vector4 vector)
|
void IPackedVector.PackFromVector4(Vector4 vector)
|
||||||
{
|
{
|
||||||
uint b1 = (uint)MathHelper.Clamp(vector.X, 0f, 255f) << 0;
|
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)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj != null &&
|
return obj is Byte4 && this == (Byte4)obj;
|
||||||
obj is Byte4)
|
|
||||||
{
|
|
||||||
return this == (Byte4)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Byte4 other)
|
public bool Equals(Byte4 other)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -9,27 +10,24 @@ using System;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct HalfSingle : IPackedVector<UInt16>, IEquatable<HalfSingle>, IPackedVector
|
public struct HalfSingle : IPackedVector<UInt16>, IEquatable<HalfSingle>, IPackedVector
|
||||||
{
|
{
|
||||||
UInt16 packedValue;
|
UInt16 packedValue;
|
||||||
|
|
||||||
|
public ushort PackedValue
|
||||||
|
{
|
||||||
|
get { return packedValue; }
|
||||||
|
set { packedValue = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public HalfSingle(float single)
|
public HalfSingle(float single)
|
||||||
{
|
{
|
||||||
packedValue = HalfTypeHelper.convert(single);
|
packedValue = HalfTypeHelper.convert(single);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ushort PackedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.packedValue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.packedValue = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public float ToSingle()
|
public float ToSingle()
|
||||||
{
|
{
|
||||||
return HalfTypeHelper.convert(this.packedValue);
|
return HalfTypeHelper.convert(this.packedValue);
|
||||||
@ -47,12 +45,7 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj != null && obj.GetType() == this.GetType())
|
return obj is HalfSingle && this == (HalfSingle)obj;
|
||||||
{
|
|
||||||
return this == (HalfSingle)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(HalfSingle other)
|
public bool Equals(HalfSingle other)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -9,10 +10,19 @@ using System;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct HalfVector2 : IPackedVector<uint>, IEquatable<HalfVector2>, IPackedVector
|
public struct HalfVector2 : IPackedVector<uint>, IEquatable<HalfVector2>, IPackedVector
|
||||||
{
|
{
|
||||||
private uint packedValue;
|
private uint packedValue;
|
||||||
|
|
||||||
|
public uint PackedValue
|
||||||
|
{
|
||||||
|
get { return packedValue; }
|
||||||
|
set { packedValue = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public HalfVector2(float x, float y)
|
public HalfVector2(float x, float y)
|
||||||
{
|
{
|
||||||
packedValue = HalfTypeHelper.convert(x) | (uint)HalfTypeHelper.convert(y) << 16;
|
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;
|
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()
|
public Vector2 ToVector2()
|
||||||
{
|
{
|
||||||
return new Vector2(HalfTypeHelper.convert((ushort)this.packedValue), HalfTypeHelper.convert((ushort)(this.packedValue >> 16)));
|
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)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj != null && obj.GetType() == this.GetType())
|
return obj is HalfVector2 && this == (HalfVector2)obj;
|
||||||
{
|
|
||||||
return this == (HalfVector2)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(HalfVector2 other)
|
public bool Equals(HalfVector2 other)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -9,10 +10,19 @@ using System;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct HalfVector4 : IPackedVector<ulong>, IEquatable<HalfVector4>, IPackedVector
|
public struct HalfVector4 : IPackedVector<ulong>, IEquatable<HalfVector4>, IPackedVector
|
||||||
{
|
{
|
||||||
private ulong packedValue;
|
private ulong packedValue;
|
||||||
|
|
||||||
|
public ulong PackedValue
|
||||||
|
{
|
||||||
|
get { return packedValue; }
|
||||||
|
set { packedValue = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public HalfVector4(float x, float y, float z, float w)
|
public HalfVector4(float x, float y, float z, float w)
|
||||||
{
|
{
|
||||||
this.packedValue = (ulong)HalfTypeHelper.convert(x)
|
this.packedValue = (ulong)HalfTypeHelper.convert(x)
|
||||||
@ -29,18 +39,6 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
| (ulong)HalfTypeHelper.convert(vector.W) << 48;
|
| (ulong)HalfTypeHelper.convert(vector.W) << 48;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ulong PackedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.packedValue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.packedValue = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector4 ToVector4()
|
public Vector4 ToVector4()
|
||||||
{
|
{
|
||||||
return new Vector4(HalfTypeHelper.convert((ushort)this.packedValue),
|
return new Vector4(HalfTypeHelper.convert((ushort)this.packedValue),
|
||||||
@ -57,12 +55,7 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj != null && obj.GetType() == this.GetType())
|
return obj is HalfVector4 && this == (HalfVector4)obj;
|
||||||
{
|
|
||||||
return this == (HalfVector4)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(HalfVector4 other)
|
public bool Equals(HalfVector4 other)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -9,13 +10,22 @@ using System;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct NormalizedByte2 : IPackedVector<ushort>, IEquatable<NormalizedByte2>, IPackedVector
|
public struct NormalizedByte2 : IPackedVector<ushort>, IEquatable<NormalizedByte2>, IPackedVector
|
||||||
{
|
{
|
||||||
private ushort packedValue;
|
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 float oneOverMax = 1f / max;
|
||||||
private const uint mask = (uint)(256 >> 1);
|
private const uint mask = 256 >> 1;
|
||||||
|
|
||||||
public NormalizedByte2(float x, float y)
|
public NormalizedByte2(float x, float y)
|
||||||
{
|
{
|
||||||
@ -33,18 +43,6 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
this.packedValue = (UInt16)(b1 | b2);
|
this.packedValue = (UInt16)(b1 | b2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ushort PackedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.packedValue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.packedValue = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector2 ToVector2()
|
public Vector2 ToVector2()
|
||||||
{
|
{
|
||||||
Vector2 vector;
|
Vector2 vector;
|
||||||
@ -87,12 +85,7 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj != null && obj.GetType() == this.GetType())
|
return obj is NormalizedByte2 && this == (NormalizedByte2)obj;
|
||||||
{
|
|
||||||
return this == (NormalizedByte2)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(NormalizedByte2 other)
|
public bool Equals(NormalizedByte2 other)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -9,13 +10,22 @@ using System;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct NormalizedByte4 : IPackedVector<uint>, IEquatable<NormalizedByte4>, IPackedVector
|
public struct NormalizedByte4 : IPackedVector<uint>, IEquatable<NormalizedByte4>, IPackedVector
|
||||||
{
|
{
|
||||||
private uint packedValue;
|
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 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)
|
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);
|
this.packedValue = (uint)(b1 | b2 | b3 | b4);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint PackedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.packedValue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.packedValue = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector4 ToVector4()
|
public Vector4 ToVector4()
|
||||||
{
|
{
|
||||||
Vector4 vector;
|
Vector4 vector;
|
||||||
@ -94,12 +92,7 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj != null && obj.GetType() == this.GetType())
|
return obj is NormalizedByte4 && this == (NormalizedByte4)obj;
|
||||||
{
|
|
||||||
return this == (NormalizedByte4)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(NormalizedByte4 other)
|
public bool Equals(NormalizedByte4 other)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -9,13 +10,22 @@ using System;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct NormalizedShort2 : IPackedVector<uint>, IEquatable<NormalizedShort2>, IPackedVector
|
public struct NormalizedShort2 : IPackedVector<uint>, IEquatable<NormalizedShort2>, IPackedVector
|
||||||
{
|
{
|
||||||
private uint packedValue;
|
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 float oneOverMax = 1f / max;
|
||||||
private const uint mask = (uint)(65536 >> 1);
|
private const uint mask = 65536 >> 1;
|
||||||
|
|
||||||
public NormalizedShort2(float x, float y)
|
public NormalizedShort2(float x, float y)
|
||||||
{
|
{
|
||||||
@ -33,18 +43,6 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
this.packedValue = (uint)(b1 | b2);
|
this.packedValue = (uint)(b1 | b2);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uint PackedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.packedValue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.packedValue = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector2 ToVector2()
|
public Vector2 ToVector2()
|
||||||
{
|
{
|
||||||
Vector2 vector;
|
Vector2 vector;
|
||||||
@ -87,12 +85,7 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj != null && obj.GetType() == this.GetType())
|
return obj is NormalizedShort2 && this == (NormalizedShort2)obj;
|
||||||
{
|
|
||||||
return this == (NormalizedShort2)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(NormalizedShort2 other)
|
public bool Equals(NormalizedShort2 other)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -9,13 +10,22 @@ using System;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct NormalizedShort4 : IPackedVector<ulong>, IEquatable<NormalizedShort4>, IPackedVector
|
public struct NormalizedShort4 : IPackedVector<ulong>, IEquatable<NormalizedShort4>, IPackedVector
|
||||||
{
|
{
|
||||||
private ulong packedValue;
|
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 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)
|
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);
|
this.packedValue = (ulong)(b1 | b2 | b3 | b4);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ulong PackedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.packedValue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.packedValue = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public Vector4 ToVector4()
|
public Vector4 ToVector4()
|
||||||
{
|
{
|
||||||
Vector4 vector;
|
Vector4 vector;
|
||||||
@ -94,12 +92,7 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj != null && obj.GetType() == this.GetType())
|
return obj is NormalizedShort4 && this == (NormalizedShort4)obj;
|
||||||
{
|
|
||||||
return this == (NormalizedShort4)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(NormalizedShort4 other)
|
public bool Equals(NormalizedShort4 other)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -9,16 +10,25 @@ using System;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct Rg32 : IPackedVector<uint>, IEquatable<Rg32>, IPackedVector
|
public struct Rg32 : IPackedVector<uint>, IEquatable<Rg32>, IPackedVector
|
||||||
{
|
{
|
||||||
private uint packedValue;
|
private uint packedValue;
|
||||||
|
|
||||||
|
public uint PackedValue
|
||||||
|
{
|
||||||
|
get { return packedValue; }
|
||||||
|
set { packedValue = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public Rg32(float x, float y)
|
public Rg32(float x, float y)
|
||||||
{
|
{
|
||||||
uint r = (uint)(MathHelper.Clamp(x, 0f, 1f) * 65535.0f) << 0;
|
uint r = (uint)(MathHelper.Clamp(x, 0f, 1f) * 65535.0f) << 0;
|
||||||
uint g = (uint)(MathHelper.Clamp(y, 0f, 1f) * 65535.0f) << 16;
|
uint g = (uint)(MathHelper.Clamp(y, 0f, 1f) * 65535.0f) << 16;
|
||||||
|
|
||||||
this.packedValue = (uint)r | g;
|
this.packedValue = r | g;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Rg32(Vector2 vector)
|
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 r = (uint)(MathHelper.Clamp(vector.X, 0f, 1f) * 65535.0f) << 0;
|
||||||
uint g = (uint)(MathHelper.Clamp(vector.Y, 0f, 1f) * 65535.0f) << 16;
|
uint g = (uint)(MathHelper.Clamp(vector.Y, 0f, 1f) * 65535.0f) << 16;
|
||||||
|
|
||||||
this.packedValue = (uint)r | g;
|
this.packedValue = r | g;
|
||||||
}
|
|
||||||
|
|
||||||
public uint PackedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.packedValue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.packedValue = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector2 ToVector2()
|
public Vector2 ToVector2()
|
||||||
@ -49,8 +47,7 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
|
|
||||||
Vector4 IPackedVector.ToVector4()
|
Vector4 IPackedVector.ToVector4()
|
||||||
{
|
{
|
||||||
Vector2 val = this.ToVector2();
|
return new Vector4(ToVector2(), 0f, 1f);
|
||||||
return new Vector4(val.X, val.Y, 0f, 1f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IPackedVector.PackFromVector4(Vector4 vector)
|
void IPackedVector.PackFromVector4(Vector4 vector)
|
||||||
@ -60,12 +57,7 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj != null && obj.GetType() == this.GetType())
|
return obj is Rg32 && this == (Rg32)obj;
|
||||||
{
|
|
||||||
return this == (Rg32)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Rg32 other)
|
public bool Equals(Rg32 other)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -9,10 +10,19 @@ using System;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct Rgba1010102 : IPackedVector<uint>, IEquatable<Rgba1010102>, IPackedVector
|
public struct Rgba1010102 : IPackedVector<uint>, IEquatable<Rgba1010102>, IPackedVector
|
||||||
{
|
{
|
||||||
private uint packedValue;
|
private uint packedValue;
|
||||||
|
|
||||||
|
public uint PackedValue
|
||||||
|
{
|
||||||
|
get { return packedValue; }
|
||||||
|
set { packedValue = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public Rgba1010102(float x, float y, float z, float w)
|
public Rgba1010102(float x, float y, float z, float w)
|
||||||
{
|
{
|
||||||
uint r = (uint)(MathHelper.Clamp(x, 0f, 1f) * 1023f);
|
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 b = (uint)(MathHelper.Clamp(z, 0f, 1f) * 1023f) << 20;
|
||||||
uint a = (uint)(MathHelper.Clamp(w, 0f, 1f) * 3f) << 30;
|
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)
|
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 b = (uint)(MathHelper.Clamp(vector.Z, 0f, 1f) * 1023f) << 20;
|
||||||
uint a = (uint)(MathHelper.Clamp(vector.W, 0f, 1f) * 3f) << 30;
|
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 uint PackedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.packedValue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.packedValue = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector4 ToVector4()
|
public Vector4 ToVector4()
|
||||||
@ -60,17 +58,12 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
uint b = (uint)(MathHelper.Clamp(vector.Z, 0f, 1f) * 1023f) << 20;
|
uint b = (uint)(MathHelper.Clamp(vector.Z, 0f, 1f) * 1023f) << 20;
|
||||||
uint a = (uint)(MathHelper.Clamp(vector.W, 0f, 1f) * 3f) << 30;
|
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)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj != null && obj.GetType() == this.GetType())
|
return obj is Rgba1010102 && this == (Rgba1010102)obj;
|
||||||
{
|
|
||||||
return this == (Rgba1010102)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Rgba1010102 other)
|
public bool Equals(Rgba1010102 other)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -9,10 +10,19 @@ using System;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct Rgba64 : IPackedVector<ulong>, IEquatable<Rgba64>, IPackedVector
|
public struct Rgba64 : IPackedVector<ulong>, IEquatable<Rgba64>, IPackedVector
|
||||||
{
|
{
|
||||||
private ulong packedValue;
|
private ulong packedValue;
|
||||||
|
|
||||||
|
public ulong PackedValue
|
||||||
|
{
|
||||||
|
get { return packedValue; }
|
||||||
|
set { packedValue = value; }
|
||||||
|
}
|
||||||
|
|
||||||
public Rgba64(float x, float y, float z, float w)
|
public Rgba64(float x, float y, float z, float w)
|
||||||
{
|
{
|
||||||
ulong r = (ulong)(MathHelper.Clamp(x, 0f, 1f) * 65535f) << 0;
|
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 b = (ulong)(MathHelper.Clamp(z, 0f, 1f) * 65535f) << 32;
|
||||||
ulong a = (ulong)(MathHelper.Clamp(w, 0f, 1f) * 65535f) << 48;
|
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)
|
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 b = (ulong)(MathHelper.Clamp(vector.Z, 0f, 1f) * 65535f) << 32;
|
||||||
ulong a = (ulong)(MathHelper.Clamp(vector.W, 0f, 1f) * 65535f) << 48;
|
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 ulong PackedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.packedValue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.packedValue = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector4 ToVector4()
|
public Vector4 ToVector4()
|
||||||
@ -60,17 +58,12 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
ulong b = (ulong)(MathHelper.Clamp(vector.Z, 0f, 1f) * 65535f) << 32;
|
ulong b = (ulong)(MathHelper.Clamp(vector.Z, 0f, 1f) * 65535f) << 32;
|
||||||
ulong a = (ulong)(MathHelper.Clamp(vector.W, 0f, 1f) * 65535f) << 48;
|
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)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj != null && obj.GetType() == this.GetType())
|
return obj is Rgba64 && this == (Rgba64)obj;
|
||||||
{
|
|
||||||
return this == (Rgba64)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Rgba64 other)
|
public bool Equals(Rgba64 other)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -9,21 +10,28 @@ using System;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct Short2 : IPackedVector<uint>, IEquatable<Short2>, IPackedVector
|
public struct Short2 : IPackedVector<uint>, IEquatable<Short2>, IPackedVector
|
||||||
{
|
{
|
||||||
private uint packedValue;
|
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 min = -max - 1f;
|
||||||
private const float oneOverMax = 1f / max;
|
|
||||||
private const uint mask = (uint)(65536 >> 1);
|
|
||||||
|
|
||||||
public Short2(float x, float y)
|
public Short2(float x, float y)
|
||||||
{
|
{
|
||||||
uint b1 = (uint)(((int)MathHelper.Clamp(x, min, max) & 65535) << 0);
|
uint b1 = (uint)(((int)MathHelper.Clamp(x, min, max) & 65535) << 0);
|
||||||
uint b2 = (uint)(((int)MathHelper.Clamp(y, min, max) & 65535) << 16);
|
uint b2 = (uint)(((int)MathHelper.Clamp(y, min, max) & 65535) << 16);
|
||||||
|
|
||||||
this.packedValue = (uint)(b1 | b2);
|
this.packedValue = b1 | b2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Short2(Vector2 vector)
|
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 b1 = (uint)(((int)MathHelper.Clamp(vector.X, min, max) & 65535) << 0);
|
||||||
uint b2 = (uint)(((int)MathHelper.Clamp(vector.Y, min, max) & 65535) << 16);
|
uint b2 = (uint)(((int)MathHelper.Clamp(vector.Y, min, max) & 65535) << 16);
|
||||||
|
|
||||||
this.packedValue = (uint)(b1 | b2);
|
this.packedValue = b1 | b2;
|
||||||
}
|
|
||||||
|
|
||||||
public uint PackedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.packedValue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.packedValue = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector2 ToVector2()
|
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 b1 = (uint)(((int)MathHelper.Clamp(vector.X, min, max) & 65535) << 0);
|
||||||
uint b2 = (uint)(((int)MathHelper.Clamp(vector.Y, min, max) & 65535) << 16);
|
uint b2 = (uint)(((int)MathHelper.Clamp(vector.Y, min, max) & 65535) << 16);
|
||||||
|
|
||||||
this.packedValue = (uint)(b1 | b2);
|
this.packedValue = b1 | b2;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector4 IPackedVector.ToVector4()
|
Vector4 IPackedVector.ToVector4()
|
||||||
@ -70,12 +66,7 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj != null && obj.GetType() == this.GetType())
|
return obj is Short2 && this == (Short2)obj;
|
||||||
{
|
|
||||||
return this == (Short2)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Short2 other)
|
public bool Equals(Short2 other)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -9,14 +10,21 @@ using System;
|
|||||||
|
|
||||||
namespace ANX.Framework.Graphics.PackedVector
|
namespace ANX.Framework.Graphics.PackedVector
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Untested)]
|
||||||
public struct Short4 : IPackedVector<ulong>, IEquatable<Short4>, IPackedVector
|
public struct Short4 : IPackedVector<ulong>, IEquatable<Short4>, IPackedVector
|
||||||
{
|
{
|
||||||
private ulong packedValue;
|
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 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)
|
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 b3 = (ulong)(((long)MathHelper.Clamp(z, min, max) & 65535) << 32);
|
||||||
ulong b4 = (ulong)(((long)MathHelper.Clamp(w, min, max) & 65535) << 48);
|
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)
|
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 b3 = (ulong)(((long)MathHelper.Clamp(vector.Z, min, max) & 65535) << 32);
|
||||||
ulong b4 = (ulong)(((long)MathHelper.Clamp(vector.W, min, max) & 65535) << 48);
|
ulong b4 = (ulong)(((long)MathHelper.Clamp(vector.W, min, max) & 65535) << 48);
|
||||||
|
|
||||||
this.packedValue = (ulong)(b1 | b2 | b3 | b4);
|
this.packedValue = b1 | b2 | b3 | b4;
|
||||||
}
|
|
||||||
|
|
||||||
public ulong PackedValue
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.packedValue;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.packedValue = value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Vector4 ToVector4()
|
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 b3 = (ulong)(((long)MathHelper.Clamp(vector.Z, -max, max) & 65535) << 32);
|
||||||
ulong b4 = (ulong)(((long)MathHelper.Clamp(vector.W, -max, max) & 65535) << 48);
|
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()
|
Vector4 IPackedVector.ToVector4()
|
||||||
@ -77,12 +73,7 @@ namespace ANX.Framework.Graphics.PackedVector
|
|||||||
|
|
||||||
public override bool Equals(object obj)
|
public override bool Equals(object obj)
|
||||||
{
|
{
|
||||||
if (obj != null && obj.GetType() == this.GetType())
|
return obj is Short4 && this == (Short4)obj;
|
||||||
{
|
|
||||||
return this == (Short4)obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(Short4 other)
|
public bool Equals(Short4 other)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#region Using Statements
|
#region Using Statements
|
||||||
using System;
|
using System;
|
||||||
|
using ANX.Framework.NonXNA.Development;
|
||||||
|
|
||||||
#endregion // Using Statements
|
#endregion // Using Statements
|
||||||
|
|
||||||
@ -36,6 +37,9 @@ SOFTWARE.
|
|||||||
|
|
||||||
namespace ANX.Framework
|
namespace ANX.Framework
|
||||||
{
|
{
|
||||||
|
[PercentageComplete(100)]
|
||||||
|
[Developer("???")]
|
||||||
|
[TestState(TestStateAttribute.TestState.Tested)]
|
||||||
public static class MathHelper
|
public static class MathHelper
|
||||||
{
|
{
|
||||||
public const float E = (float)Math.E;
|
public const float E = (float)Math.E;
|
||||||
@ -111,8 +115,8 @@ namespace ANX.Framework
|
|||||||
// It is expected that 0 < amount < 1
|
// It is expected that 0 < amount < 1
|
||||||
// If amount < 0, return value1
|
// If amount < 0, return value1
|
||||||
// If amount > 1, return value2
|
// If amount > 1, return value2
|
||||||
float result = MathHelper.Clamp(amount, 0f, 1f);
|
float result = Clamp(amount, 0f, 1f);
|
||||||
result = MathHelper.Hermite(value1, 0f, value2, 0f, result);
|
result = Hermite(value1, 0f, value2, 0f, result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,8 @@ namespace ANX.Framework.NonXNA.SoundSystem
|
|||||||
bool IsHeadset { get; }
|
bool IsHeadset { get; }
|
||||||
TimeSpan BufferDuration { get; set; }
|
TimeSpan BufferDuration { get; set; }
|
||||||
|
|
||||||
|
event EventHandler<EventArgs> BufferReady;
|
||||||
|
|
||||||
void Stop();
|
void Stop();
|
||||||
void Start();
|
void Start();
|
||||||
|
|
||||||
|
57
Tools/OnlineStatusGenerator/OnlineStatusGenerator.csproj
Normal file
57
Tools/OnlineStatusGenerator/OnlineStatusGenerator.csproj
Normal 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>
|
61
Tools/OnlineStatusGenerator/Program.cs
Normal file
61
Tools/OnlineStatusGenerator/Program.cs
Normal 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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
36
Tools/OnlineStatusGenerator/Properties/AssemblyInfo.cs
Normal file
36
Tools/OnlineStatusGenerator/Properties/AssemblyInfo.cs
Normal 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")]
|
Loading…
x
Reference in New Issue
Block a user