diff --git a/FDK19/FDK19.csproj b/FDK19/FDK19.csproj index 077af8c2..fd4bab3c 100644 --- a/FDK19/FDK19.csproj +++ b/FDK19/FDK19.csproj @@ -116,7 +116,6 @@ - @@ -208,8 +207,11 @@ 4.2.0 - - 4.0.13.44 + + 4.2.0 + + + 4.2.0 diff --git a/FDK19/コード/00.共通/C変換.cs b/FDK19/コード/00.共通/C変換.cs index 4e8b5ef3..6da79999 100644 --- a/FDK19/コード/00.共通/C変換.cs +++ b/FDK19/コード/00.共通/C変換.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Text; +using SharpDX; namespace FDK { @@ -230,13 +231,18 @@ namespace FDK return (int)(100.0 / num); } - public static SlimDX.Color4 n255ToColor4( int nR, int nG, int nB ) + public static Color4 n255ToColor4( int nR, int nG, int nB ) { float fR = n255ToParsent( nR ); float fG = n255ToParsent( nG ); float fB = n255ToParsent( nB ); - return new SlimDX.Color4( fR, fG, fB ); + return new Color4( fR, fG, fB, 1f ); + } + + public static Color4 ColorToColor4(System.Drawing.Color col) + { + return new Color4(col.ToArgb()); } #region [ private ] diff --git a/FDK19/コード/01.フレームワーク/Core/Game.cs b/FDK19/コード/01.フレームワーク/Core/Game.cs index 64932ff0..f5838333 100644 --- a/FDK19/コード/01.フレームワーク/Core/Game.cs +++ b/FDK19/コード/01.フレームワーク/Core/Game.cs @@ -23,8 +23,8 @@ using System; using System.ComponentModel; using System.Threading; using System.Windows.Forms; -using SlimDX; -using SlimDX.Direct3D9; +using SharpDX; +using SharpDX.Direct3D9; using System.Collections.ObjectModel; namespace SampleFramework @@ -182,15 +182,15 @@ namespace SampleFramework static Game() { // configure SlimDX - Configuration.ThrowOnError = true; - Configuration.AddResultWatch(ResultCode.DeviceLost, ResultWatchFlags.AlwaysIgnore); - Configuration.AddResultWatch(ResultCode.WasStillDrawing, ResultWatchFlags.AlwaysIgnore); + //Configuration.ThrowOnError = true; + //Configuration.AddResultWatch(ResultCode.DeviceLost, ResultWatchFlags.AlwaysIgnore); + //Configuration.AddResultWatch(ResultCode.WasStillDrawing, ResultWatchFlags.AlwaysIgnore); #if DEBUG - Configuration.DetectDoubleDispose = true; + //Configuration.DetectDoubleDispose = true; Configuration.EnableObjectTracking = true; #else - Configuration.DetectDoubleDispose = false; + //Configuration.DetectDoubleDispose = false; Configuration.EnableObjectTracking = false; #endif diff --git a/FDK19/コード/01.フレームワーク/DeviceSettings/ConversionMethods.cs b/FDK19/コード/01.フレームワーク/DeviceSettings/ConversionMethods.cs index 60915b37..88a35e92 100644 --- a/FDK19/コード/01.フレームワーク/DeviceSettings/ConversionMethods.cs +++ b/FDK19/コード/01.フレームワーク/DeviceSettings/ConversionMethods.cs @@ -19,9 +19,9 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -using SlimDX; -using SlimDX.Direct3D9; -using DXGI = SlimDX.DXGI; +using SharpDX; +using SharpDX.Direct3D9; +using DXGI = SharpDX.DXGI; namespace SampleFramework { @@ -111,39 +111,39 @@ namespace SampleFramework { switch (format) { - case SlimDX.DXGI.Format.R32G32B32A32_Float: - case SlimDX.DXGI.Format.R32G32B32A32_SInt: - case SlimDX.DXGI.Format.R32G32B32A32_Typeless: - case SlimDX.DXGI.Format.R32G32B32A32_UInt: - case SlimDX.DXGI.Format.R32G32B32_Float: - case SlimDX.DXGI.Format.R32G32B32_SInt: - case SlimDX.DXGI.Format.R32G32B32_Typeless: - case SlimDX.DXGI.Format.R32G32B32_UInt: + case DXGI.Format.R32G32B32A32_Float: + case DXGI.Format.R32G32B32A32_SInt: + case DXGI.Format.R32G32B32A32_Typeless: + case DXGI.Format.R32G32B32A32_UInt: + case DXGI.Format.R32G32B32_Float: + case DXGI.Format.R32G32B32_SInt: + case DXGI.Format.R32G32B32_Typeless: + case DXGI.Format.R32G32B32_UInt: return 32; - case SlimDX.DXGI.Format.R16G16B16A16_Float: - case SlimDX.DXGI.Format.R16G16B16A16_SInt: - case SlimDX.DXGI.Format.R16G16B16A16_SNorm: - case SlimDX.DXGI.Format.R16G16B16A16_Typeless: - case SlimDX.DXGI.Format.R16G16B16A16_UInt: - case SlimDX.DXGI.Format.R16G16B16A16_UNorm: + case DXGI.Format.R16G16B16A16_Float: + case DXGI.Format.R16G16B16A16_SInt: + case DXGI.Format.R16G16B16A16_SNorm: + case DXGI.Format.R16G16B16A16_Typeless: + case DXGI.Format.R16G16B16A16_UInt: + case DXGI.Format.R16G16B16A16_UNorm: return 16; - case SlimDX.DXGI.Format.R10G10B10A2_Typeless: - case SlimDX.DXGI.Format.R10G10B10A2_UInt: - case SlimDX.DXGI.Format.R10G10B10A2_UNorm: + case DXGI.Format.R10G10B10A2_Typeless: + case DXGI.Format.R10G10B10A2_UInt: + case DXGI.Format.R10G10B10A2_UNorm: return 10; - case SlimDX.DXGI.Format.R8G8B8A8_SInt: - case SlimDX.DXGI.Format.R8G8B8A8_SNorm: - case SlimDX.DXGI.Format.R8G8B8A8_Typeless: - case SlimDX.DXGI.Format.R8G8B8A8_UInt: - case SlimDX.DXGI.Format.R8G8B8A8_UNorm: - case SlimDX.DXGI.Format.R8G8B8A8_UNorm_SRGB: + case DXGI.Format.R8G8B8A8_SInt: + case DXGI.Format.R8G8B8A8_SNorm: + case DXGI.Format.R8G8B8A8_Typeless: + case DXGI.Format.R8G8B8A8_UInt: + case DXGI.Format.R8G8B8A8_UNorm: + case DXGI.Format.R8G8B8A8_UNorm_SRgb: return 8; - case SlimDX.DXGI.Format.B5G5R5A1_UNorm: - case SlimDX.DXGI.Format.B5G6R5_UNorm: + case DXGI.Format.B5G5R5A1_UNorm: + case DXGI.Format.B5G6R5_UNorm: return 5; default: @@ -160,40 +160,40 @@ namespace SampleFramework { switch (format) { - case SlimDX.DXGI.Format.R8G8B8A8_UNorm: + case DXGI.Format.R8G8B8A8_UNorm: return Format.A8R8G8B8; - case SlimDX.DXGI.Format.B5G6R5_UNorm: + case DXGI.Format.B5G6R5_UNorm: return Format.R5G6B5; - case SlimDX.DXGI.Format.B5G5R5A1_UNorm: + case DXGI.Format.B5G5R5A1_UNorm: return Format.A1R5G5B5; - case SlimDX.DXGI.Format.A8_UNorm: + case DXGI.Format.A8_UNorm: return Format.A8; - case SlimDX.DXGI.Format.R10G10B10A2_UNorm: + case DXGI.Format.R10G10B10A2_UNorm: return Format.A2B10G10R10; - case SlimDX.DXGI.Format.B8G8R8A8_UNorm: + case DXGI.Format.B8G8R8A8_UNorm: return Format.A8B8G8R8; - case SlimDX.DXGI.Format.R16G16_UNorm: + case DXGI.Format.R16G16_UNorm: return Format.G16R16; - case SlimDX.DXGI.Format.R16G16B16A16_UNorm: + case DXGI.Format.R16G16B16A16_UNorm: return Format.A16B16G16R16; - case SlimDX.DXGI.Format.R16_Float: + case DXGI.Format.R16_Float: return Format.R16F; - case SlimDX.DXGI.Format.R16G16_Float: + case DXGI.Format.R16G16_Float: return Format.G16R16F; - case SlimDX.DXGI.Format.R16G16B16A16_Float: + case DXGI.Format.R16G16B16A16_Float: return Format.A16B16G16R16F; - case SlimDX.DXGI.Format.R32_Float: + case DXGI.Format.R32_Float: return Format.R32F; - case SlimDX.DXGI.Format.R32G32_Float: + case DXGI.Format.R32G32_Float: return Format.G32R32F; - case SlimDX.DXGI.Format.R32G32B32A32_Float: + case DXGI.Format.R32G32B32A32_Float: return Format.A32B32G32R32F; } return Format.Unknown; } - public static float ToFloat(Rational rational) + public static float ToFloat(DXGI.Rational rational) { float denom = 1; if (rational.Denominator != 0) diff --git a/FDK19/コード/01.フレームワーク/DeviceSettings/DeviceSettings.cs b/FDK19/コード/01.フレームワーク/DeviceSettings/DeviceSettings.cs index 80063121..efeb5a5d 100644 --- a/FDK19/コード/01.フレームワーク/DeviceSettings/DeviceSettings.cs +++ b/FDK19/コード/01.フレームワーク/DeviceSettings/DeviceSettings.cs @@ -20,7 +20,7 @@ * THE SOFTWARE. */ using System; -using SlimDX.Direct3D9; +using SharpDX.Direct3D9; namespace SampleFramework { /// diff --git a/FDK19/コード/01.フレームワーク/DeviceSettings/Direct3D9Settings.cs b/FDK19/コード/01.フレームワーク/DeviceSettings/Direct3D9Settings.cs index b44a3aac..147428cb 100644 --- a/FDK19/コード/01.フレームワーク/DeviceSettings/Direct3D9Settings.cs +++ b/FDK19/コード/01.フレームワーク/DeviceSettings/Direct3D9Settings.cs @@ -21,7 +21,7 @@ */ using System; using System.Collections.Generic; -using SlimDX.Direct3D9; +using SharpDX.Direct3D9; namespace SampleFramework { @@ -54,24 +54,27 @@ namespace SampleFramework public PresentParameters PresentParameters { get; - private set; + set; } public Direct3D9Settings() { - PresentParameters = new PresentParameters(); DeviceType = DeviceType.Hardware; - PresentParameters.Windowed = true; AdapterFormat = Format.Unknown; CreationFlags = CreateFlags.HardwareVertexProcessing; - PresentParameters.BackBufferFormat = Format.Unknown; - PresentParameters.BackBufferCount = 1; - PresentParameters.Multisample = MultisampleType.None; - PresentParameters.SwapEffect = SwapEffect.Discard; - PresentParameters.EnableAutoDepthStencil = true; - PresentParameters.AutoDepthStencilFormat = Format.Unknown; - PresentParameters.PresentFlags = PresentFlags.DiscardDepthStencil; - PresentParameters.PresentationInterval = PresentInterval.Default; + + var pp = new PresentParameters(); + pp.Windowed = true; + pp.BackBufferFormat = Format.Unknown; + pp.BackBufferCount = 1; + pp.MultiSampleType = MultisampleType.None; + pp.SwapEffect = SwapEffect.Discard; + pp.EnableAutoDepthStencil = true; + pp.AutoDepthStencilFormat = Format.Unknown; + pp.PresentFlags = PresentFlags.DiscardDepthStencil; + pp.PresentationInterval = PresentInterval.Default; + + this.PresentParameters = pp; } public Direct3D9Settings Clone() @@ -81,7 +84,7 @@ namespace SampleFramework clone.AdapterOrdinal = AdapterOrdinal; clone.CreationFlags = CreationFlags; clone.DeviceType = DeviceType; - clone.PresentParameters = PresentParameters.Clone(); + clone.PresentParameters = PresentParameters; return clone; } @@ -95,16 +98,17 @@ namespace SampleFramework { DisplayMode desktopMode = GraphicsDeviceManager.Direct3D9Object.GetAdapterDisplayMode(0); Direct3D9Settings optimal = new Direct3D9Settings(); + var pp = optimal.PresentParameters; optimal.AdapterOrdinal = settings.AdapterOrdinal; optimal.DeviceType = settings.DeviceType; - optimal.PresentParameters.Windowed = settings.Windowed; - optimal.PresentParameters.BackBufferCount = settings.BackBufferCount; - optimal.PresentParameters.Multisample = settings.MultisampleType; - optimal.PresentParameters.MultisampleQuality = settings.MultisampleQuality; - optimal.PresentParameters.FullScreenRefreshRateInHertz = settings.RefreshRate; + pp.Windowed = settings.Windowed; + pp.BackBufferCount = settings.BackBufferCount; + pp.MultiSampleType = settings.MultisampleType; + pp.MultiSampleQuality = settings.MultisampleQuality; + pp.FullScreenRefreshRateInHz = settings.RefreshRate; - if(settings.Multithreaded) + if (settings.Multithreaded) optimal.CreationFlags |= CreateFlags.Multithreaded; if(optimal.PresentParameters.Windowed || ConversionMethods.GetColorBits(desktopMode.Format) >= 8) @@ -116,39 +120,40 @@ namespace SampleFramework { if(optimal.PresentParameters.Windowed) { - optimal.PresentParameters.BackBufferWidth = 640; - optimal.PresentParameters.BackBufferHeight = 480; + pp.BackBufferWidth = 640; + pp.BackBufferHeight = 480; } else { - optimal.PresentParameters.BackBufferWidth = desktopMode.Width; - optimal.PresentParameters.BackBufferHeight = desktopMode.Height; + pp.BackBufferWidth = desktopMode.Width; + pp.BackBufferHeight = desktopMode.Height; } } else { - optimal.PresentParameters.BackBufferWidth = settings.BackBufferWidth; - optimal.PresentParameters.BackBufferHeight = settings.BackBufferHeight; + pp.BackBufferWidth = settings.BackBufferWidth; + pp.BackBufferHeight = settings.BackBufferHeight; } if(settings.BackBufferFormat == Format.Unknown) - optimal.PresentParameters.BackBufferFormat = optimal.AdapterFormat; + pp.BackBufferFormat = optimal.AdapterFormat; else - optimal.PresentParameters.BackBufferFormat = settings.BackBufferFormat; + pp.BackBufferFormat = settings.BackBufferFormat; if(settings.DepthStencilFormat == Format.Unknown) { if(ConversionMethods.GetColorBits(optimal.PresentParameters.BackBufferFormat) >= 8) - optimal.PresentParameters.AutoDepthStencilFormat = Format.D32; + pp.AutoDepthStencilFormat = Format.D32; else - optimal.PresentParameters.AutoDepthStencilFormat = Format.D16; + pp.AutoDepthStencilFormat = Format.D16; } else - optimal.PresentParameters.AutoDepthStencilFormat = settings.DepthStencilFormat; + pp.AutoDepthStencilFormat = settings.DepthStencilFormat; if(!settings.EnableVSync) - optimal.PresentParameters.PresentationInterval = PresentInterval.Immediate; + pp.PresentationInterval = PresentInterval.Immediate; + optimal.PresentParameters = pp; return optimal; } @@ -229,7 +234,7 @@ namespace SampleFramework MultisampleType type = combo.MultisampleTypes[i]; int quality = combo.MultisampleQualities[i]; - if(type == optimal.PresentParameters.Multisample && quality == optimal.PresentParameters.MultisampleQuality) + if(type == optimal.PresentParameters.MultiSampleType && quality == optimal.PresentParameters.MultiSampleQuality) { ranking += 1.0f; break; @@ -242,7 +247,7 @@ namespace SampleFramework foreach(DisplayMode displayMode in combo.AdapterInfo.DisplayModes) { if(displayMode.Format == combo.AdapterFormat && - displayMode.RefreshRate == optimal.PresentParameters.FullScreenRefreshRateInHertz) + displayMode.RefreshRate == optimal.PresentParameters.FullScreenRefreshRateInHz) { ranking += 1.0f; break; @@ -258,14 +263,16 @@ namespace SampleFramework public static Direct3D9Settings BuildValidSettings(SettingsCombo9 combo, Direct3D9Settings input) { Direct3D9Settings settings = new Direct3D9Settings(); + var pp = settings.PresentParameters; settings.AdapterOrdinal = combo.AdapterOrdinal; settings.DeviceType = combo.DeviceType; - settings.PresentParameters.Windowed = combo.Windowed; settings.AdapterFormat = combo.AdapterFormat; - settings.PresentParameters.BackBufferFormat = combo.BackBufferFormat; - settings.PresentParameters.SwapEffect = input.PresentParameters.SwapEffect; - settings.PresentParameters.PresentFlags = input.PresentParameters.PresentFlags | PresentFlags.DiscardDepthStencil; + + pp.Windowed = combo.Windowed; + pp.BackBufferFormat = combo.BackBufferFormat; + pp.SwapEffect = input.PresentParameters.SwapEffect; + pp.PresentFlags = input.PresentParameters.PresentFlags | PresentFlags.DiscardDepthStencil; settings.CreationFlags = input.CreationFlags; if((combo.DeviceInfo.Capabilities.DeviceCaps & DeviceCaps.HWTransformAndLight) == 0 && @@ -288,19 +295,19 @@ namespace SampleFramework } DisplayMode bestDisplayMode = FindValidResolution(combo, input); - settings.PresentParameters.BackBufferWidth = bestDisplayMode.Width; - settings.PresentParameters.BackBufferHeight = bestDisplayMode.Height; + pp.BackBufferWidth = bestDisplayMode.Width; + pp.BackBufferHeight = bestDisplayMode.Height; - settings.PresentParameters.BackBufferCount = input.PresentParameters.BackBufferCount; - if(settings.PresentParameters.BackBufferCount > 3) - settings.PresentParameters.BackBufferCount = 3; - if(settings.PresentParameters.BackBufferCount < 1) - settings.PresentParameters.BackBufferCount = 1; + pp.BackBufferCount = input.PresentParameters.BackBufferCount; + if(pp.BackBufferCount > 3) + pp.BackBufferCount = 3; + if(pp.BackBufferCount < 1) + pp.BackBufferCount = 1; if(input.PresentParameters.SwapEffect != SwapEffect.Discard) { - settings.PresentParameters.Multisample = MultisampleType.None; - settings.PresentParameters.MultisampleQuality = 0; + pp.MultiSampleType = MultisampleType.None; + pp.MultiSampleQuality = 0; } else { @@ -310,18 +317,18 @@ namespace SampleFramework for(int i = 0; i < combo.MultisampleTypes.Count; i++) { MultisampleType type = combo.MultisampleTypes[i]; - int quality = combo.MultisampleQualities[0]; + int quality = combo.MultisampleQualities[i]; - if(Math.Abs(type - input.PresentParameters.Multisample) < Math.Abs(bestType - - input.PresentParameters.Multisample)) + if(Math.Abs(type - input.PresentParameters.MultiSampleType) < Math.Abs(bestType - + input.PresentParameters.MultiSampleType)) { bestType = type; - bestQuality = Math.Min(quality - 1, input.PresentParameters.MultisampleQuality); + bestQuality = Math.Min(quality - 1, input.PresentParameters.MultiSampleQuality); } } - settings.PresentParameters.Multisample = bestType; - settings.PresentParameters.MultisampleQuality = bestQuality; + pp.MultiSampleType = bestType; + pp.MultiSampleQuality = bestQuality; } List rankings = new List(); @@ -348,20 +355,20 @@ namespace SampleFramework if(bestIndex >= 0) { - settings.PresentParameters.AutoDepthStencilFormat = combo.DepthStencilFormats[bestIndex]; - settings.PresentParameters.EnableAutoDepthStencil = true; + pp.AutoDepthStencilFormat = combo.DepthStencilFormats[bestIndex]; + pp.EnableAutoDepthStencil = true; } else { - settings.PresentParameters.AutoDepthStencilFormat = Format.Unknown; - settings.PresentParameters.EnableAutoDepthStencil = false; + pp.AutoDepthStencilFormat = Format.Unknown; + pp.EnableAutoDepthStencil = false; } if(combo.Windowed) - settings.PresentParameters.FullScreenRefreshRateInHertz = 0; + pp.FullScreenRefreshRateInHz = 0; else { - int match = input.PresentParameters.FullScreenRefreshRateInHertz; + int match = input.PresentParameters.FullScreenRefreshRateInHz; bestDisplayMode.RefreshRate = 0; if(match != 0) { @@ -386,14 +393,15 @@ namespace SampleFramework } } - settings.PresentParameters.FullScreenRefreshRateInHertz = bestDisplayMode.RefreshRate; + pp.FullScreenRefreshRateInHz = bestDisplayMode.RefreshRate; } if(combo.PresentIntervals.Contains(input.PresentParameters.PresentationInterval)) - settings.PresentParameters.PresentationInterval = input.PresentParameters.PresentationInterval; + pp.PresentationInterval = input.PresentParameters.PresentationInterval; else - settings.PresentParameters.PresentationInterval = PresentInterval.Default; + pp.PresentationInterval = PresentInterval.Default; + settings.PresentParameters = pp; return settings; } diff --git a/FDK19/コード/01.フレームワーク/Enumeration/Enumeration9.cs b/FDK19/コード/01.フレームワーク/Enumeration/Enumeration9.cs index 0aa8f41d..e4aab85c 100644 --- a/FDK19/コード/01.フレームワーク/Enumeration/Enumeration9.cs +++ b/FDK19/コード/01.フレームワーク/Enumeration/Enumeration9.cs @@ -21,7 +21,7 @@ */ using System.Collections.Generic; using System.Globalization; -using SlimDX.Direct3D9; +using SharpDX.Direct3D9; namespace SampleFramework { @@ -315,7 +315,7 @@ namespace SampleFramework if (deviceInfo.DeviceSettings.Count > 0) info.Devices.Add(deviceInfo); } - catch (Direct3D9Exception) + catch { // #23681 2010.11.17 yyagi: GetDeviceCaps()で例外が発生するモニタに対しては、enumerateをスキップする。 } diff --git a/FDK19/コード/01.フレームワーク/Rendering/DeviceCache.cs b/FDK19/コード/01.フレームワーク/Rendering/DeviceCache.cs deleted file mode 100644 index 3a3dd8fe..00000000 --- a/FDK19/コード/01.フレームワーク/Rendering/DeviceCache.cs +++ /dev/null @@ -1,200 +0,0 @@ -using System; -using System.Drawing; -using SlimDX; -using SlimDX.Direct3D9; - -namespace SampleFramework -{ - public sealed class DeviceCache - { - private readonly Device _device; - - public DeviceCache(Device device) - { - _device = device; - } - - public Device UnderlyingDevice => _device; - - public void Dispose() - { - _device.Dispose(); - } - - public object Tag - { - get => _device.Tag; - set => _device.Tag = value; - } - - public Result TestCooperativeLevel() - { - return _device.TestCooperativeLevel(); - } - - public Result Reset(PresentParameters presentParameters) - { - return _device.Reset(presentParameters); - } - - public Result Clear(ClearFlags clearFlags, in Color4 color, float zdepth, int stencil) - { - return _device.Clear(clearFlags, color, zdepth, stencil); - } - - public Result BeginScene() - { - return _device.BeginScene(); - } - - public Result EndScene() - { - return _device.EndScene(); - } - - public Result Present() - { - return _device.Present(); - } - - public Surface GetBackBuffer(int swapChain, int backBuffer) - { - return _device.GetBackBuffer(swapChain, backBuffer); - } - - public Surface GetRenderTarget(int index) - { - return _device.GetRenderTarget(index); - } - - public Result SetRenderState(RenderState state, T value) where T : Enum - { - return _device.SetRenderState(state, value); - } - - private BlendOperation? _lastBlendOperation; - public void SetRenderState(RenderState state, BlendOperation value) - { - if (state == RenderState.BlendOperation) - { - if (_lastBlendOperation == value) - { - return; - } - - _lastBlendOperation = value; - } - - _device.SetRenderState(state, value); - } - - private Blend? _lastSourceBlend; - private Blend? _lastDestinationBlend; - public void SetRenderState(RenderState state, Blend value) - { - if (state == RenderState.SourceBlend) - { - if (_lastSourceBlend == value) - { - return; - } - - _lastSourceBlend = value; - } - else if (state == RenderState.DestinationBlend) - { - if (_lastDestinationBlend == value) - { - return; - } - - _lastDestinationBlend = value; - } - - _device.SetRenderState(state, value); - } - - public Result SetRenderState(RenderState state, bool value) - { - return _device.SetRenderState(state, value); - } - - public Result SetRenderState(RenderState state, int value) - { - return _device.SetRenderState(state, value); - } - - public Result SetTextureStageState(int stage, TextureStage type, TextureOperation textureOperation) - { - return _device.SetTextureStageState(stage, type, textureOperation); - } - - public Result SetTextureStageState(int stage, TextureStage type, int value) - { - return _device.SetTextureStageState(stage, type, value); - } - - public Result SetSamplerState(int sampler, SamplerState type, TextureFilter textureFilter) - { - return _device.SetSamplerState(sampler, type, textureFilter); - } - - public Result SetTransform(TransformState state, in Matrix value) - { - return _device.SetTransform(state, value); - } - - private int? _lastSetTextureSampler; - private object _lastSetTextureTexture; - public void SetTexture(int sampler, BaseTexture texture) - { - if ( ReferenceEquals(_lastSetTextureTexture, texture) && _lastSetTextureSampler == sampler) - { - return; - } - - _lastSetTextureSampler = sampler; - _lastSetTextureTexture = texture; - _device.SetTexture(sampler, texture); - } - - public Result SetRenderTarget(int targetIndex, Surface target) - { - return _device.SetRenderTarget(targetIndex, target); - } - - public Result DrawUserPrimitives(PrimitiveType primitiveType, int startIndex, int primitiveCount, in T[] data) where T : struct//, new() - { - return _device.DrawUserPrimitives(primitiveType, startIndex, primitiveCount, data); - } - - public Result DrawUserPrimitives(PrimitiveType primitiveType, int primitiveCount, in T[] data) where T : struct//, new() - { - return _device.DrawUserPrimitives(primitiveType, primitiveCount, data); - } - - public Result StretchRectangle(Surface source, Surface destination, TextureFilter filter) - { - return _device.StretchRectangle(source, destination, filter); - } - - public Result UpdateSurface(Surface source, in Rectangle sourceRectangle, Surface destination, in Point destinationPoint) - { - return _device.UpdateSurface(source, sourceRectangle, destination, destinationPoint); - } - - public Viewport Viewport - { - get => _device.Viewport; - set => _device.Viewport = value; - } - - public VertexFormat VertexFormat - { - get => _device.VertexFormat; - set => _device.VertexFormat = value; - } - - public Capabilities Capabilities => _device.Capabilities; - } -} \ No newline at end of file diff --git a/FDK19/コード/01.フレームワーク/Rendering/Direct3D9Manager.cs b/FDK19/コード/01.フレームワーク/Rendering/Direct3D9Manager.cs index f7cf7b85..354d904e 100644 --- a/FDK19/コード/01.フレームワーク/Rendering/Direct3D9Manager.cs +++ b/FDK19/コード/01.フレームワーク/Rendering/Direct3D9Manager.cs @@ -24,8 +24,8 @@ using System.Collections.Generic; using System.Reflection; using System.Runtime.InteropServices; using System.Security.Permissions; -using SlimDX; -using SlimDX.Direct3D9; +using SharpDX; +using SharpDX.Direct3D9; namespace SampleFramework { @@ -43,7 +43,7 @@ namespace SampleFramework #if TEST_Direct3D9Ex public DeviceEx Device //yyagi #else - public DeviceCache Device + public Device Device #endif { get; @@ -121,7 +121,7 @@ namespace SampleFramework } elements.Add(VertexElement.VertexDeclarationEnd); - return new VertexDeclaration(Device.UnderlyingDevice, elements.ToArray()); + return new VertexDeclaration(Device, elements.ToArray()); } /// @@ -132,7 +132,7 @@ namespace SampleFramework /// The newly created render target surface. public Texture CreateRenderTarget(int width, int height) { - return new Texture(Device.UnderlyingDevice, width, height, 1, Usage.RenderTarget, manager.CurrentSettings.BackBufferFormat, Pool.Default); + return new Texture(Device, width, height, 1, Usage.RenderTarget, manager.CurrentSettings.BackBufferFormat, Pool.Default); } /// @@ -141,7 +141,7 @@ namespace SampleFramework /// The newly created resolve target. public Texture CreateResolveTarget() { - return new Texture(Device.UnderlyingDevice, manager.ScreenWidth, manager.ScreenHeight, 1, Usage.RenderTarget, manager.CurrentSettings.BackBufferFormat, Pool.Default); + return new Texture(Device, manager.ScreenWidth, manager.ScreenHeight, 1, Usage.RenderTarget, manager.CurrentSettings.BackBufferFormat, Pool.Default); } /// @@ -163,30 +163,33 @@ namespace SampleFramework public void ResolveBackBuffer(Texture target, int backBufferIndex) { // disable exceptions for this method - bool storedThrow = Configuration.ThrowOnError; - Configuration.ThrowOnError = false; + //bool storedThrow = Configuration.ThrowOnError; + //Configuration.ThrowOnError = false; Surface destination = null; try { // grab the current back buffer Surface backBuffer = Device.GetBackBuffer(0, backBufferIndex); - if (backBuffer == null || Result.Last.IsFailure) + if (backBuffer == null || Result.GetResultFromWin32Error(Marshal.GetLastWin32Error()).Failure) throw new InvalidOperationException("Could not obtain back buffer surface."); // grab the destination surface destination = target.GetSurfaceLevel(0); - if (destination == null || Result.Last.IsFailure) + if (destination == null || Result.GetResultFromWin32Error(Marshal.GetLastWin32Error()).Failure) throw new InvalidOperationException("Could not obtain resolve target surface."); // first try to copy using linear filtering - if (Device.StretchRectangle(backBuffer, destination, TextureFilter.Linear).IsFailure) + Device.StretchRectangle(backBuffer, destination, TextureFilter.Linear); + if (Result.GetResultFromWin32Error(Marshal.GetLastWin32Error()).Failure) { // that failed, so try with no filtering - if (Device.StretchRectangle(backBuffer, destination, TextureFilter.None).IsFailure) + Device.StretchRectangle(backBuffer, destination, TextureFilter.None); + if (Result.GetResultFromWin32Error(Marshal.GetLastWin32Error()).Failure) { // that failed as well, so the last thing we can try is a load surface call - if (Surface.FromSurface(destination, backBuffer, Filter.Default, 0).IsFailure) + Surface.FromSurface(destination, backBuffer, Filter.Default, 0); + if (Result.GetResultFromWin32Error(Marshal.GetLastWin32Error()).Failure) throw new InvalidOperationException("Could not copy surfaces."); } } @@ -195,7 +198,7 @@ namespace SampleFramework { if (destination != null) destination.Dispose(); - Configuration.ThrowOnError = storedThrow; + //Configuration.ThrowOnError = storedThrow; } } diff --git a/FDK19/コード/01.フレームワーク/Rendering/GraphicsDeviceManager.cs b/FDK19/コード/01.フレームワーク/Rendering/GraphicsDeviceManager.cs index 55dc16bc..afb1bb91 100644 --- a/FDK19/コード/01.フレームワーク/Rendering/GraphicsDeviceManager.cs +++ b/FDK19/コード/01.フレームワーク/Rendering/GraphicsDeviceManager.cs @@ -25,11 +25,12 @@ using System.Drawing; using System.Text; using System.Threading; using System.Windows.Forms; -using SlimDX; -using SlimDX.Direct3D9; -using SlimDX.DXGI; +using SharpDX; +using SharpDX.Direct3D9; using System.Diagnostics; +using Rectangle = System.Drawing.Rectangle; + namespace SampleFramework { /// @@ -129,7 +130,9 @@ namespace SampleFramework DeviceSettings validSettings = DeviceSettings.FindValidSettings( settings ); - validSettings.Direct3D9.PresentParameters.DeviceWindowHandle = game.Window.Handle; + var pp = validSettings.Direct3D9.PresentParameters; + pp.DeviceWindowHandle = game.Window.Handle; + validSettings.Direct3D9.PresentParameters = pp; CreateDevice( validSettings ); } @@ -252,14 +255,14 @@ namespace SampleFramework } // check if the device can be reset, or if we need to completely recreate it - Result result = SlimDX.Direct3D9.ResultCode.Success; + Result result = ResultCode.Success; bool canReset = CanDeviceBeReset(oldSettings, settings); if (canReset) result = ResetDevice(); - if (result == SlimDX.Direct3D9.ResultCode.DeviceLost) + if (result == ResultCode.DeviceLost) deviceLost = true; - else if (!canReset || result.IsFailure) + else if (!canReset || result.Failure) { if (oldSettings != null) ReleaseDevice(); @@ -346,10 +349,12 @@ namespace SampleFramework newSettings.BackBufferWidth = 0; newSettings.BackBufferHeight = 0; if (newSettings.Direct3D9 != null) - { - newSettings.Direct3D9.PresentParameters.BackBufferWidth = GameWindowSize.Width; // #23510 2010.10.31 add yyagi: to avoid setting BackBufferSize=ClientSize - newSettings.Direct3D9.PresentParameters.BackBufferHeight = GameWindowSize.Height; // #23510 2010.10.31 add yyagi: to avoid setting BackBufferSize=ClientSize - } + { + var pp = newSettings.Direct3D9.PresentParameters; + pp.BackBufferWidth = GameWindowSize.Width; // #23510 2010.10.31 add yyagi: to avoid setting BackBufferSize=ClientSize + pp.BackBufferHeight = GameWindowSize.Height; // #23510 2010.10.31 add yyagi: to avoid setting BackBufferSize=ClientSize + newSettings.Direct3D9.PresentParameters = pp; + } CreateDevice(newSettings); } @@ -381,8 +386,10 @@ namespace SampleFramework { newSettings.BackBufferWidth = 0; newSettings.BackBufferHeight = 0; - newSettings.Direct3D9.PresentParameters.BackBufferWidth = GameWindowSize.Width; // #23510 2010.10.31 add yyagi: to avoid setting BackBufferSize=ClientSize - newSettings.Direct3D9.PresentParameters.BackBufferHeight = GameWindowSize.Height; // + var pp = newSettings.Direct3D9.PresentParameters; + pp.BackBufferWidth = GameWindowSize.Width; // #23510 2010.10.31 add yyagi: to avoid setting BackBufferSize=ClientSize + pp.BackBufferHeight = GameWindowSize.Height; // #23510 2010.10.31 add yyagi: to avoid setting BackBufferSize=ClientSize + newSettings.Direct3D9.PresentParameters = pp; CreateDevice( newSettings ); } } @@ -400,25 +407,27 @@ namespace SampleFramework newSettings.Direct3D9.AdapterOrdinal = adapterOrdinal; newSettings.BackBufferWidth = 0; // #23510 2010.11.1 add yyagi to avoid to reset to 640x480 for the first time in XP. - newSettings.BackBufferHeight = 0; // - newSettings.Direct3D9.PresentParameters.BackBufferWidth = GameWindowSize.Width; // - newSettings.Direct3D9.PresentParameters.BackBufferHeight = GameWindowSize.Height; // + newSettings.BackBufferHeight = 0; // + var pp = newSettings.Direct3D9.PresentParameters; + pp.BackBufferWidth = GameWindowSize.Width; // #23510 2010.10.31 add yyagi: to avoid setting BackBufferSize=ClientSize + pp.BackBufferHeight = GameWindowSize.Height; // #23510 2010.10.31 add yyagi: to avoid setting BackBufferSize=ClientSize + newSettings.Direct3D9.PresentParameters = pp; CreateDevice(newSettings); } void game_FrameEnd( object sender, EventArgs e ) { - Result result = SlimDX.Direct3D9.ResultCode.Success; + Result result = ResultCode.Success; try { - result = Direct3D9.Device.Present(); + Direct3D9.Device.Present(); } - catch (Direct3D9Exception) // #23842 2011.1.6 yyagi: catch D3D9Exception to avoid unexpected termination by changing VSyncWait in fullscreen. + catch // #23842 2011.1.6 yyagi: catch D3D9Exception to avoid unexpected termination by changing VSyncWait in fullscreen. { deviceLost = true; } - if( result == SlimDX.Direct3D9.ResultCode.DeviceLost ) + if( result == ResultCode.DeviceLost ) deviceLost = true; } void game_FrameStart(object sender, CancelEventArgs e) @@ -438,7 +447,7 @@ namespace SampleFramework if (deviceLost) { Result result = Direct3D9.Device.TestCooperativeLevel(); - if (result == SlimDX.Direct3D9.ResultCode.DeviceLost) + if (result == ResultCode.DeviceLost) { e.Cancel = true; return; @@ -459,7 +468,7 @@ namespace SampleFramework } result = ResetDevice(); - if (result.IsFailure) + if (result.Failure) { e.Cancel = true; return; @@ -515,11 +524,15 @@ namespace SampleFramework } Direct3D9.Device.MaximumFrameLatency = 1; #else - Direct3D9.Device = new DeviceCache( new SlimDX.Direct3D9.Device( Direct3D9Object, CurrentSettings.Direct3D9.AdapterOrdinal, - CurrentSettings.Direct3D9.DeviceType, game.Window.Handle, - CurrentSettings.Direct3D9.CreationFlags, CurrentSettings.Direct3D9.PresentParameters ) ); + Direct3D9.Device = new Device( + Direct3D9Object, + CurrentSettings.Direct3D9.AdapterOrdinal, + CurrentSettings.Direct3D9.DeviceType, + game.Window.Handle, + CurrentSettings.Direct3D9.CreationFlags, + CurrentSettings.Direct3D9.PresentParameters); #endif - if ( Result.Last == SlimDX.Direct3D9.ResultCode.DeviceLost ) + if ( Result.GetResultFromWin32Error(System.Runtime.InteropServices.Marshal.GetLastWin32Error()) == ResultCode.DeviceLost ) { deviceLost = true; return; @@ -545,15 +558,18 @@ namespace SampleFramework { game.UnloadContent(); - Result result = Direct3D9.Device.Reset( CurrentSettings.Direct3D9.PresentParameters ); - if( result == SlimDX.Direct3D9.ResultCode.DeviceLost ) + Direct3D9.Device.Reset(CurrentSettings.Direct3D9.PresentParameters); + + var result = Result.GetResultFromWin32Error(System.Runtime.InteropServices.Marshal.GetLastWin32Error()); + + if (result == ResultCode.DeviceLost) return result; PropogateSettings(); UpdateDeviceStats(); game.LoadContent(); - return Result.Last; + return result; } void ReleaseDevice() @@ -594,9 +610,9 @@ namespace SampleFramework CurrentSettings.BackBufferFormat = CurrentSettings.Direct3D9.PresentParameters.BackBufferFormat; CurrentSettings.DepthStencilFormat = CurrentSettings.Direct3D9.PresentParameters.AutoDepthStencilFormat; CurrentSettings.DeviceType = CurrentSettings.Direct3D9.DeviceType; - CurrentSettings.MultisampleQuality = CurrentSettings.Direct3D9.PresentParameters.MultisampleQuality; - CurrentSettings.MultisampleType = CurrentSettings.Direct3D9.PresentParameters.Multisample; - CurrentSettings.RefreshRate = CurrentSettings.Direct3D9.PresentParameters.FullScreenRefreshRateInHertz; + CurrentSettings.MultisampleQuality = CurrentSettings.Direct3D9.PresentParameters.MultiSampleQuality; + CurrentSettings.MultisampleType = CurrentSettings.Direct3D9.PresentParameters.MultiSampleType; + CurrentSettings.RefreshRate = CurrentSettings.Direct3D9.PresentParameters.FullScreenRefreshRateInHz; CurrentSettings.Windowed = CurrentSettings.Direct3D9.PresentParameters.Windowed; } @@ -654,18 +670,18 @@ namespace SampleFramework builder.AppendFormat( " ({0}x{1}), ", CurrentSettings.Direct3D9.PresentParameters.BackBufferWidth, CurrentSettings.Direct3D9.PresentParameters.BackBufferHeight ); if( CurrentSettings.Direct3D9.AdapterFormat == CurrentSettings.Direct3D9.PresentParameters.BackBufferFormat ) - builder.Append( Enum.GetName( typeof( SlimDX.Direct3D9.Format ), CurrentSettings.Direct3D9.AdapterFormat ) ); + builder.Append( Enum.GetName( typeof( Format ), CurrentSettings.Direct3D9.AdapterFormat ) ); else builder.AppendFormat( "backbuf {0}, adapter {1}", - Enum.GetName( typeof( SlimDX.Direct3D9.Format ), CurrentSettings.Direct3D9.AdapterFormat ), - Enum.GetName( typeof( SlimDX.Direct3D9.Format ), CurrentSettings.Direct3D9.PresentParameters.BackBufferFormat ) ); + Enum.GetName( typeof( Format ), CurrentSettings.Direct3D9.AdapterFormat ), + Enum.GetName( typeof( Format ), CurrentSettings.Direct3D9.PresentParameters.BackBufferFormat ) ); - builder.AppendFormat( " ({0})", Enum.GetName( typeof( SlimDX.Direct3D9.Format ), CurrentSettings.Direct3D9.PresentParameters.AutoDepthStencilFormat ) ); + builder.AppendFormat( " ({0})", Enum.GetName( typeof( Format ), CurrentSettings.Direct3D9.PresentParameters.AutoDepthStencilFormat ) ); - if( CurrentSettings.Direct3D9.PresentParameters.Multisample == MultisampleType.NonMaskable ) + if( CurrentSettings.Direct3D9.PresentParameters.MultiSampleType == MultisampleType.NonMaskable ) builder.Append( " (Nonmaskable Multisample)" ); - else if( CurrentSettings.Direct3D9.PresentParameters.Multisample != MultisampleType.None ) - builder.AppendFormat( " ({0}x Multisample)", (int) CurrentSettings.Direct3D9.PresentParameters.Multisample ); + else if( CurrentSettings.Direct3D9.PresentParameters.MultiSampleType != MultisampleType.None ) + builder.AppendFormat( " ({0}x Multisample)", (int) CurrentSettings.Direct3D9.PresentParameters.MultiSampleType ); DeviceStatistics = builder.ToString(); } diff --git a/FDK19/コード/01.フレームワーク/Rendering/VertexElementAttribute.cs b/FDK19/コード/01.フレームワーク/Rendering/VertexElementAttribute.cs index cd598321..acbe0229 100644 --- a/FDK19/コード/01.フレームワーク/Rendering/VertexElementAttribute.cs +++ b/FDK19/コード/01.フレームワーク/Rendering/VertexElementAttribute.cs @@ -20,7 +20,7 @@ * THE SOFTWARE. */ using System; -using SlimDX.Direct3D9; +using SharpDX.Direct3D9; namespace SampleFramework { diff --git a/FDK19/コード/01.フレームワーク/Utilities/Camera.cs b/FDK19/コード/01.フレームワーク/Utilities/Camera.cs index a5651b66..1ad88c7f 100644 --- a/FDK19/コード/01.フレームワーク/Utilities/Camera.cs +++ b/FDK19/コード/01.フレームワーク/Utilities/Camera.cs @@ -19,7 +19,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -using SlimDX; +using SharpDX; namespace SampleFramework { diff --git a/FDK19/コード/01.フレームワーク/Utilities/TransformedColoredTexturedVertex.cs b/FDK19/コード/01.フレームワーク/Utilities/TransformedColoredTexturedVertex.cs index 44299168..269a54fe 100644 --- a/FDK19/コード/01.フレームワーク/Utilities/TransformedColoredTexturedVertex.cs +++ b/FDK19/コード/01.フレームワーク/Utilities/TransformedColoredTexturedVertex.cs @@ -22,8 +22,8 @@ using System; using System.Globalization; using System.Runtime.InteropServices; -using SlimDX; -using SlimDX.Direct3D9; +using SharpDX; +using SharpDX.Direct3D9; namespace SampleFramework { diff --git a/FDK19/コード/01.フレームワーク/Utilities/TransformedColoredVertex.cs b/FDK19/コード/01.フレームワーク/Utilities/TransformedColoredVertex.cs index 92d92566..4658aefc 100644 --- a/FDK19/コード/01.フレームワーク/Utilities/TransformedColoredVertex.cs +++ b/FDK19/コード/01.フレームワーク/Utilities/TransformedColoredVertex.cs @@ -22,8 +22,8 @@ using System; using System.Globalization; using System.Runtime.InteropServices; -using SlimDX; -using SlimDX.Direct3D9; +using SharpDX; +using SharpDX.Direct3D9; namespace SampleFramework { diff --git a/FDK19/コード/03.サウンド/CSoundDeviceDirectSound.cs b/FDK19/コード/03.サウンド/CSoundDeviceDirectSound.cs index 13a27965..01038378 100644 --- a/FDK19/コード/03.サウンド/CSoundDeviceDirectSound.cs +++ b/FDK19/コード/03.サウンド/CSoundDeviceDirectSound.cs @@ -4,7 +4,6 @@ using System.Text; using System.Diagnostics; using System.IO; using System.Threading; -using SlimDX; using SharpDX.DirectSound; namespace FDK diff --git a/FDK19/コード/04.グラフィック/CAero.cs b/FDK19/コード/04.グラフィック/CAero.cs index 98765b2e..f811e099 100644 --- a/FDK19/コード/04.グラフィック/CAero.cs +++ b/FDK19/コード/04.グラフィック/CAero.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Drawing; -using SlimDX; namespace FDK { diff --git a/FDK19/コード/04.グラフィック/CAvi.cs b/FDK19/コード/04.グラフィック/CAvi.cs index 9e8244f4..8a12132b 100644 --- a/FDK19/コード/04.グラフィック/CAvi.cs +++ b/FDK19/コード/04.グラフィック/CAvi.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Drawing; -using SlimDX; +using SharpDX; namespace FDK { diff --git a/FDK19/コード/04.グラフィック/CTexture.cs b/FDK19/コード/04.グラフィック/CTexture.cs index 7975124a..bc86bff1 100644 --- a/FDK19/コード/04.グラフィック/CTexture.cs +++ b/FDK19/コード/04.グラフィック/CTexture.cs @@ -5,10 +5,13 @@ using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Diagnostics; -using SlimDX; -using SlimDX.Direct3D9; +using SharpDX; +using SharpDX.Direct3D9; -using Device = SampleFramework.DeviceCache; +using Rectangle = System.Drawing.Rectangle; +using RectangleF = System.Drawing.RectangleF; +using Point = System.Drawing.Point; +using Color = System.Drawing.Color; namespace FDK { @@ -136,7 +139,7 @@ namespace FDK bitmap.Save(stream, ImageFormat.Bmp); stream.Seek(0L, SeekOrigin.Begin); int colorKey = unchecked((int)0xFF000000); - this.texture = Texture.FromStream(device.UnderlyingDevice, stream, this.szテクスチャサイズ.Width, this.szテクスチャサイズ.Height, 1, Usage.None, format, poolvar, Filter.Point, Filter.None, colorKey); + this.texture = Texture.FromStream(device, stream, this.szテクスチャサイズ.Width, this.szテクスチャサイズ.Height, 1, Usage.None, format, poolvar, Filter.Point, Filter.None, colorKey); } } catch (Exception e) @@ -229,7 +232,7 @@ namespace FDK pool = poolvar; #endif // 中で更にメモリ読み込みし直していて無駄なので、Streamを使うのは止めたいところ - this.texture = Texture.FromStream(device.UnderlyingDevice, stream, n幅, n高さ, 1, usage, format, pool, Filter.Point, Filter.None, 0); + this.texture = Texture.FromStream(device, stream, n幅, n高さ, 1, usage, format, pool, Filter.Point, Filter.None, 0); } } } @@ -288,7 +291,7 @@ namespace FDK // lock ( lockobj ) // { //Trace.TraceInformation( "CTexture() start: " ); - this.texture = Texture.FromMemory(device.UnderlyingDevice, txData, this.sz画像サイズ.Width, this.sz画像サイズ.Height, 1, Usage.None, format, pool, Filter.Point, Filter.None, colorKey); + this.texture = Texture.FromMemory(device, txData, this.sz画像サイズ.Width, this.sz画像サイズ.Height, 1, Usage.None, format, pool, Filter.Point, Filter.None, colorKey); //Trace.TraceInformation( "CTexture() end: " ); // } } @@ -329,7 +332,7 @@ namespace FDK #if TEST_Direct3D9Ex this.texture = new Texture( device, tw, this.sz画像サイズ.Height, 1, Usage.Dynamic, format, Pool.Default ); #else - this.texture = new Texture(device.UnderlyingDevice, this.sz画像サイズ.Width, this.sz画像サイズ.Height, 1, Usage.None, format, pool); + this.texture = new Texture(device, this.sz画像サイズ.Width, this.sz画像サイズ.Height, 1, Usage.None, format, pool); #endif BitmapData srcBufData = bitmap.LockBits(new Rectangle(0, 0, this.sz画像サイズ.Width, this.sz画像サイズ.Height), ImageLockMode.ReadOnly, PixelFormat.Format32bppArgb); DataRectangle destDataRectangle = texture.LockRectangle(0, LockFlags.Discard); // None @@ -350,7 +353,8 @@ namespace FDK } #else IntPtr src_scan0 = (IntPtr)((Int64)srcBufData.Scan0); - destDataRectangle.Data.WriteRange(src_scan0, this.sz画像サイズ.Width * 4 * this.sz画像サイズ.Height); + //destDataRectangle.Data.WriteRange(src_scan0, this.sz画像サイズ.Width * 4 * this.sz画像サイズ.Height); + Buffer.MemoryCopy(src_scan0.ToPointer(), destDataRectangle.DataPointer.ToPointer(), this.sz画像サイズ.Width * 4 * this.sz画像サイズ.Height, srcBufData.Width * 4 * srcBufData.Height); #endif texture.UnlockRectangle(0); bitmap.UnlockBits(srcBufData); @@ -550,7 +554,7 @@ namespace FDK float f上V値 = ((float)rc画像内の描画領域.Top) / ((float)this.szテクスチャサイズ.Height); float f下V値 = ((float)rc画像内の描画領域.Bottom) / ((float)this.szテクスチャサイズ.Height); this.color4.Alpha = ((float)this._opacity) / 255f; - int color = this.color4.ToArgb(); + int color = ToArgb(this.color4); if (this.cvTransformedColoredVertexies == null) this.cvTransformedColoredVertexies = new TransformedColoredTexturedVertex[4]; @@ -591,7 +595,7 @@ namespace FDK device.SetTexture(0, this.texture); device.VertexFormat = TransformedColoredTexturedVertex.Format; - device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 0, 2, in this.cvTransformedColoredVertexies); + device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 0, 2, this.cvTransformedColoredVertexies); //----------------- #endregion } @@ -608,7 +612,7 @@ namespace FDK float f上V値 = ((float)rc画像内の描画領域.Top) / ((float)this.szテクスチャサイズ.Height); float f下V値 = ((float)rc画像内の描画領域.Bottom) / ((float)this.szテクスチャサイズ.Height); this.color4.Alpha = ((float)this._opacity) / 255f; - int color = this.color4.ToArgb(); + int color = ToArgb(this.color4); if (this.cvPositionColoredVertexies == null) this.cvPositionColoredVertexies = new PositionColoredTexturedVertex[4]; @@ -654,7 +658,7 @@ namespace FDK device.SetTexture(0, this.texture); device.VertexFormat = PositionColoredTexturedVertex.Format; - device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, in this.cvPositionColoredVertexies); + device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, this.cvPositionColoredVertexies); //----------------- #endregion } @@ -679,7 +683,7 @@ namespace FDK float f上V値 = ((float)rc画像内の描画領域.Top) / ((float)this.szテクスチャサイズ.Height); float f下V値 = ((float)rc画像内の描画領域.Bottom) / ((float)this.szテクスチャサイズ.Height); this.color4.Alpha = ((float)this._opacity) / 255f; - int color = this.color4.ToArgb(); + int color = ToArgb(this.color4); if (this.cvTransformedColoredVertexies == null) this.cvTransformedColoredVertexies = new TransformedColoredTexturedVertex[4]; @@ -720,7 +724,7 @@ namespace FDK device.SetTexture(0, this.texture); device.VertexFormat = TransformedColoredTexturedVertex.Format; - device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 0, 2, in this.cvTransformedColoredVertexies); + device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 0, 2, this.cvTransformedColoredVertexies); //----------------- #endregion } @@ -737,7 +741,7 @@ namespace FDK float f上V値 = ((float)rc画像内の描画領域.Top) / ((float)this.szテクスチャサイズ.Height); float f下V値 = ((float)rc画像内の描画領域.Bottom) / ((float)this.szテクスチャサイズ.Height); this.color4.Alpha = ((float)this._opacity) / 255f; - int color = this.color4.ToArgb(); + int color = ToArgb(this.color4); if (this.cvPositionColoredVertexies == null) this.cvPositionColoredVertexies = new PositionColoredTexturedVertex[4]; @@ -783,7 +787,7 @@ namespace FDK device.SetTexture(0, this.texture); device.VertexFormat = PositionColoredTexturedVertex.Format; - device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, in this.cvPositionColoredVertexies); + device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, this.cvPositionColoredVertexies); //----------------- #endregion } @@ -824,7 +828,7 @@ namespace FDK float f上V値 = ((float)rc画像内の描画領域.Top) / ((float)this.szテクスチャサイズ.Height); float f下V値 = ((float)rc画像内の描画領域.Bottom) / ((float)this.szテクスチャサイズ.Height); this.color4.Alpha = ((float)this._opacity) / 255f; - int color = this.color4.ToArgb(); + int color = ToArgb(this.color4); if (this.cvTransformedColoredVertexies == null) @@ -884,7 +888,7 @@ namespace FDK float f上V値 = ((float)rc画像内の描画領域.Top) / ((float)this.szテクスチャサイズ.Height); float f下V値 = ((float)rc画像内の描画領域.Bottom) / ((float)this.szテクスチャサイズ.Height); this.color4.Alpha = ((float)this._opacity) / 255f; - int color = this.color4.ToArgb(); + int color = ToArgb(this.color4); if (this.cvTransformedColoredVertexies == null) this.cvTransformedColoredVertexies = new TransformedColoredTexturedVertex[4]; @@ -925,7 +929,7 @@ namespace FDK device.SetTexture(0, this.texture); device.VertexFormat = TransformedColoredTexturedVertex.Format; - device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, in this.cvTransformedColoredVertexies); + device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, this.cvTransformedColoredVertexies); } public void t2D上下反転描画(Device device, Point pt) { @@ -984,7 +988,7 @@ namespace FDK float f上V値 = ((float)rc画像内の描画領域.Top) / ((float)this.szテクスチャサイズ.Height); float f下V値 = ((float)rc画像内の描画領域.Bottom) / ((float)this.szテクスチャサイズ.Height); this.color4.Alpha = ((float)this._opacity) / 255f; - int color = this.color4.ToArgb(); + int color = ToArgb(this.color4); if (this.cvPositionColoredVertexies == null) this.cvPositionColoredVertexies = new PositionColoredTexturedVertex[4]; @@ -1024,7 +1028,7 @@ namespace FDK device.SetTransform(TransformState.World, mat); device.SetTexture(0, this.texture); device.VertexFormat = PositionColoredTexturedVertex.Format; - device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, in this.cvPositionColoredVertexies); + device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, this.cvPositionColoredVertexies); } public void t3D左上基準描画(Device device, Matrix mat) @@ -1051,7 +1055,7 @@ namespace FDK float f上V値 = ((float)rc画像内の描画領域.Top) / ((float)this.szテクスチャサイズ.Height); float f下V値 = ((float)rc画像内の描画領域.Bottom) / ((float)this.szテクスチャサイズ.Height); this.color4.Alpha = ((float)this._opacity) / 255f; - int color = this.color4.ToArgb(); + int color = ToArgb(this.color4); if (this.cvPositionColoredVertexies == null) this.cvPositionColoredVertexies = new PositionColoredTexturedVertex[4]; @@ -1091,7 +1095,7 @@ namespace FDK device.SetTransform(TransformState.World, mat); device.SetTexture(0, this.texture); device.VertexFormat = PositionColoredTexturedVertex.Format; - device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, in this.cvPositionColoredVertexies); + device.DrawUserPrimitives(PrimitiveType.TriangleStrip, 2, this.cvPositionColoredVertexies); } #region [ IDisposable 実装 ] @@ -1145,34 +1149,34 @@ namespace FDK { if (this.b加算合成) { - device.SetRenderState(RenderState.SourceBlend, SlimDX.Direct3D9.Blend.SourceAlpha); // 5 - device.SetRenderState(RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.One); // 2 + device.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha); // 5 + device.SetRenderState(RenderState.DestinationBlend, Blend.One); // 2 } else if (this.b乗算合成) { //参考:http://sylphylunar.seesaa.net/article/390331341.html //C++から引っ張ってきたのでちょっと不安。 - device.SetRenderState(RenderState.SourceBlend, SlimDX.Direct3D9.Blend.DestinationColor); - device.SetRenderState(RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.Zero); + device.SetRenderState(RenderState.SourceBlend, Blend.DestinationColor); + device.SetRenderState(RenderState.DestinationBlend, Blend.Zero); } else if (this.b減算合成) { //参考:http://www3.pf-x.net/~chopper/home2/DirectX/MD20.html - device.SetRenderState(RenderState.BlendOperation, SlimDX.Direct3D9.BlendOperation.Subtract); - device.SetRenderState(RenderState.SourceBlend, SlimDX.Direct3D9.Blend.One); - device.SetRenderState(RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.One); + device.SetRenderState(RenderState.BlendOperation, BlendOperation.Subtract); + device.SetRenderState(RenderState.SourceBlend, Blend.One); + device.SetRenderState(RenderState.DestinationBlend, Blend.One); } else if (this.bスクリーン合成) { //参考:http://sylphylunar.seesaa.net/article/390331341.html //C++から引っ張ってきたのでちょっと不安。 - device.SetRenderState(RenderState.SourceBlend, SlimDX.Direct3D9.Blend.InverseDestinationColor); - device.SetRenderState(RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.One); + device.SetRenderState(RenderState.SourceBlend, Blend.InverseDestinationColor); + device.SetRenderState(RenderState.DestinationBlend, Blend.One); } else { - device.SetRenderState(RenderState.SourceBlend, SlimDX.Direct3D9.Blend.SourceAlpha); // 5 - device.SetRenderState(RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.InverseSourceAlpha); // 6 + device.SetRenderState(RenderState.SourceBlend, Blend.SourceAlpha); // 5 + device.SetRenderState(RenderState.DestinationBlend, Blend.InverseSourceAlpha); // 6 } } private Size t指定されたサイズを超えない最適なテクスチャサイズを返す(Device device, Size sz指定サイズ) @@ -1229,6 +1233,21 @@ namespace FDK return szサイズ; } + private int ToArgb(Color4 col4) + { + uint a = (uint)(col4.Alpha * 255.0f) & 255; + uint r = (uint)(col4.Red * 255.0f) & 255; + uint g = (uint)(col4.Green * 255.0f) & 255; + uint b = (uint)(col4.Blue * 255.0f) & 255; + + uint value = b; + value |= g << 8; + value |= r << 16; + value |= a << 24; + + return (int)value; + } + // 2012.3.21 さらなる new の省略作戦 diff --git a/FDK19/コード/04.グラフィック/CTextureAutofold.cs b/FDK19/コード/04.グラフィック/CTextureAutofold.cs index 34566f82..ef3c73e9 100644 --- a/FDK19/コード/04.グラフィック/CTextureAutofold.cs +++ b/FDK19/コード/04.グラフィック/CTextureAutofold.cs @@ -5,10 +5,12 @@ using System.Drawing; using System.Drawing.Imaging; using System.IO; using System.Diagnostics; -using SlimDX; -using SlimDX.Direct3D9; +using SharpDX; +using SharpDX.Direct3D9; -using Device = SampleFramework.DeviceCache; +using Rectangle = System.Drawing.Rectangle; +using Point = System.Drawing.Point; +using Color = System.Drawing.Color; namespace FDK { diff --git a/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/ColoredVertex.cs b/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/ColoredVertex.cs index 9bfe05d9..2ce32838 100644 --- a/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/ColoredVertex.cs +++ b/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/ColoredVertex.cs @@ -24,7 +24,7 @@ using System; using System.Globalization; using System.Runtime.InteropServices; -using SlimDX; +using SharpDX; namespace FDK { /// diff --git a/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/PositionColoredTexturedVertex.cs b/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/PositionColoredTexturedVertex.cs index ea0110cb..a2cc7d59 100644 --- a/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/PositionColoredTexturedVertex.cs +++ b/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/PositionColoredTexturedVertex.cs @@ -3,8 +3,8 @@ using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Globalization; -using SlimDX; -using SlimDX.Direct3D9; +using SharpDX; +using SharpDX.Direct3D9; namespace FDK { diff --git a/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/TexturedVertex.cs b/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/TexturedVertex.cs index 22356fdc..ecdaf8c7 100644 --- a/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/TexturedVertex.cs +++ b/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/TexturedVertex.cs @@ -24,7 +24,7 @@ using System; using System.Globalization; using System.Runtime.InteropServices; -using SlimDX; +using SharpDX; namespace FDK { /// diff --git a/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/TransformedColoredTexturedVertex.cs b/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/TransformedColoredTexturedVertex.cs index 44ad7770..a23a82d7 100644 --- a/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/TransformedColoredTexturedVertex.cs +++ b/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/TransformedColoredTexturedVertex.cs @@ -3,8 +3,8 @@ using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Globalization; -using SlimDX; -using SlimDX.Direct3D9; +using SharpDX; +using SharpDX.Direct3D9; namespace FDK { diff --git a/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/TransformedColoredVertex.cs b/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/TransformedColoredVertex.cs index 71bd1a7d..6459f0ad 100644 --- a/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/TransformedColoredVertex.cs +++ b/FDK19/コード/04.グラフィック/頂点フォーマット(Vertex)/TransformedColoredVertex.cs @@ -24,7 +24,7 @@ using System; using System.Globalization; using System.Runtime.InteropServices; -using SlimDX; +using SharpDX; namespace FDK { /// diff --git a/FDK19/コード/05.DirectShow/CDirectShow.cs b/FDK19/コード/05.DirectShow/CDirectShow.cs index b7ca2f2d..2138997b 100644 --- a/FDK19/コード/05.DirectShow/CDirectShow.cs +++ b/FDK19/コード/05.DirectShow/CDirectShow.cs @@ -6,8 +6,8 @@ using System.IO; using System.Drawing; using System.Drawing.Imaging; using System.Threading; -using SlimDX; -using SlimDX.Direct3D9; +using SharpDX; +using SharpDX.Direct3D9; using SharpDX.Multimedia; using DirectShowLib; @@ -502,7 +502,7 @@ namespace FDK { #region [ (A) ピッチが合うので、テクスチャに直接転送する。] //----------------- - hr = this.memoryRenderer.GetCurrentBuffer( dr.Data.DataPointer, this.nデータサイズbyte ); + hr = this.memoryRenderer.GetCurrentBuffer( dr.DataPointer, this.nデータサイズbyte ); DsError.ThrowExceptionForHR( hr ); //----------------- #endregion @@ -546,7 +546,7 @@ namespace FDK this.ptrSnap = (byte*) this.ip.ToPointer(); var ptr = stackalloc UInt32*[ CDirectShow.n並列度 ]; // stackalloc(GC対象外、メソッド終了時に自動開放)は、スタック変数相手にしか使えない。 - ptr[ 0 ] = (UInt32*) dr.Data.DataPointer.ToPointer(); // ↓ + ptr[ 0 ] = (UInt32*) dr.DataPointer.ToPointer(); // ↓ for( int i = 1; i < CDirectShow.n並列度; i++ ) // スタック変数で確保、初期化して… ptr[ i ] = ptr[ i - 1 ] + this.n幅px; // ↓ this.ptrTexture = ptr; // スタック変数をクラスメンバに渡す(これならOK)。 diff --git a/README-EN.md b/README-EN.md index d2bb2210..1b9778a7 100644 --- a/README-EN.md +++ b/README-EN.md @@ -122,13 +122,6 @@ Rename character config files to "CharaConfig.txt". If you do not want characters, make "(Skin name)/Graphics/11_Characters/0" empty. ``` -- OpenTaiko does not start. - -``` -Download SlimDX again from https://code.google.com/archive/p/slimdx/downloads\. -("Runtime for .NET 4.0 x86" or "Runtime for .NET 2.0 x86") -``` - ## Update history
diff --git a/README.md b/README.md index 4de8bafb..11e498d1 100644 --- a/README.md +++ b/README.md @@ -125,13 +125,6 @@ v0.5.2から11_Charactersにキャラクターに関してファイルが読み キャラクター使用が不希望なら「(スキン名)/Graphics/11_Characters/0」を空っぽでご生成ください。 ``` -- OpenTaikoが起動しません - -``` -SlimDXを改めてダウンロードしてください:https://code.google.com/archive/p/slimdx/downloads -(「Runtime for .NET 4.0 x86」又は「Runtime for .NET 2.0 x86」) -``` - ## 更新記録
diff --git a/TJAPlayer3/Common/CActFlushGPU.cs b/TJAPlayer3/Common/CActFlushGPU.cs index ee28d54b..63c074fc 100644 --- a/TJAPlayer3/Common/CActFlushGPU.cs +++ b/TJAPlayer3/Common/CActFlushGPU.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; using System.Diagnostics; -using SlimDX.Direct3D9; +using SharpDX.Direct3D9; using FDK; namespace TJAPlayer3 @@ -23,7 +23,7 @@ namespace TJAPlayer3 { try // #xxxxx 2012.12.31 yyagi: to prepare flush, first of all, I create q queue to the GPU. { - IDirect3DQuery9 = new Query(TJAPlayer3.app.Device.UnderlyingDevice, QueryType.Occlusion); + IDirect3DQuery9 = new Query(TJAPlayer3.app.Device, QueryType.Occlusion); } catch ( Exception e ) { @@ -45,7 +45,7 @@ namespace TJAPlayer3 { IDirect3DQuery9.Issue( Issue.End ); DWM.Flush(); - IDirect3DQuery9.GetData( true ); // flush GPU queue + IDirect3DQuery9.GetData( out int _, true ); // flush GPU queue } return 0; } diff --git a/TJAPlayer3/Common/CPrivateFont.cs b/TJAPlayer3/Common/CPrivateFont.cs index 6917df8e..a25f10bf 100644 --- a/TJAPlayer3/Common/CPrivateFont.cs +++ b/TJAPlayer3/Common/CPrivateFont.cs @@ -6,7 +6,6 @@ using System.Runtime.InteropServices; using System.Drawing; using System.Drawing.Drawing2D; using System.Diagnostics; -using SlimDX; using FDK; using System.Linq; diff --git a/TJAPlayer3/Common/CVeirticalSongNameFont.cs b/TJAPlayer3/Common/CVeirticalSongNameFont.cs index ef110efb..7f999ed5 100644 --- a/TJAPlayer3/Common/CVeirticalSongNameFont.cs +++ b/TJAPlayer3/Common/CVeirticalSongNameFont.cs @@ -6,7 +6,6 @@ using System.Runtime.InteropServices; using System.Drawing; using System.Drawing.Drawing2D; using System.Diagnostics; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Common/TJAPlayer3.cs b/TJAPlayer3/Common/TJAPlayer3.cs index e4698bf9..0be06de4 100644 --- a/TJAPlayer3/Common/TJAPlayer3.cs +++ b/TJAPlayer3/Common/TJAPlayer3.cs @@ -9,13 +9,17 @@ using System.IO; using System.Threading; using System.Net.NetworkInformation; using System.Runtime.Serialization.Formatters.Binary; -using SlimDX; -using SlimDX.Direct3D9; +using SharpDX; +using SharpDX.Direct3D9; using FDK; using SampleFramework; using System.Reflection; using System.Threading.Tasks; using System.Linq; + +using Rectangle = System.Drawing.Rectangle; +using Point = System.Drawing.Point; +using Color = System.Drawing.Color; namespace TJAPlayer3 { @@ -364,7 +368,7 @@ namespace TJAPlayer3 get; set; } - public DeviceCache Device + public Device Device { get { return base.GraphicsDeviceManager.Direct3D9.Device; } } @@ -702,7 +706,7 @@ namespace TJAPlayer3 #endregion this.Device.BeginScene(); - this.Device.Clear( ClearFlags.ZBuffer | ClearFlags.Target, Color.Black, 1f, 0 ); + this.Device.Clear( ClearFlags.ZBuffer | ClearFlags.Target, SharpDX.Color.Black, 1f, 0 ); if( r現在のステージ != null ) { diff --git a/TJAPlayer3/Plugins/CPluginHost.cs b/TJAPlayer3/Plugins/CPluginHost.cs index 80710234..ba517c74 100644 --- a/TJAPlayer3/Plugins/CPluginHost.cs +++ b/TJAPlayer3/Plugins/CPluginHost.cs @@ -3,8 +3,7 @@ using System.Collections.Generic; using System.Text; using System.IO; using System.Drawing; -using SlimDX; -using SlimDX.Direct3D9; +using SharpDX.Direct3D9; using FDK; namespace TJAPlayer3 @@ -27,7 +26,7 @@ namespace TJAPlayer3 } public Device D3D9Device { - get { return (TJAPlayer3.app != null ) ? TJAPlayer3.app.Device.UnderlyingDevice : null; } + get { return (TJAPlayer3.app != null ) ? TJAPlayer3.app.Device : null; } } public Format TextureFormat { diff --git a/TJAPlayer3/Plugins/IPluginHost.cs b/TJAPlayer3/Plugins/IPluginHost.cs index 7e47436a..7789b528 100644 --- a/TJAPlayer3/Plugins/IPluginHost.cs +++ b/TJAPlayer3/Plugins/IPluginHost.cs @@ -1,4 +1,6 @@ -namespace TJAPlayer3 +using SharpDX.Direct3D9; + +namespace TJAPlayer3 { /// /// プラグインホスト情報提供インターフェース。 @@ -16,7 +18,7 @@ /// Direct3D9 デバイスオブジェクト。 /// ロストしたりリセットしたりすることがあるので、常に同じ値であるとは保証されません。 /// - SlimDX.Direct3D9.Device D3D9Device { get; } + Device D3D9Device { get; } /// /// DirectSound の管理クラス。 diff --git a/TJAPlayer3/Stages/02.Title/CActEnumSongs.cs b/TJAPlayer3/Stages/02.Title/CActEnumSongs.cs index 332a82c1..bcea917a 100644 --- a/TJAPlayer3/Stages/02.Title/CActEnumSongs.cs +++ b/TJAPlayer3/Stages/02.Title/CActEnumSongs.cs @@ -8,8 +8,7 @@ using System.Drawing; using System.Threading; using System.Globalization; using System.Runtime.Serialization.Formatters.Binary; -using SlimDX; -using SlimDX.Direct3D9; +using SharpDX; using FDK; using SampleFramework; diff --git a/TJAPlayer3/Stages/02.Title/CEnumSongs.cs b/TJAPlayer3/Stages/02.Title/CEnumSongs.cs index 7e0a3ce4..dbd19a0f 100644 --- a/TJAPlayer3/Stages/02.Title/CEnumSongs.cs +++ b/TJAPlayer3/Stages/02.Title/CEnumSongs.cs @@ -6,10 +6,6 @@ using System.Runtime.InteropServices; using System.IO; using System.Threading; using System.Runtime.Serialization.Formatters.Binary; -using SlimDX; -using SlimDX.Direct3D9; -using FDK; -using SampleFramework; namespace TJAPlayer3 { diff --git a/TJAPlayer3/Stages/02.Title/CStageタイトル.cs b/TJAPlayer3/Stages/02.Title/CStageタイトル.cs index eccc600c..57e3a5ea 100644 --- a/TJAPlayer3/Stages/02.Title/CStageタイトル.cs +++ b/TJAPlayer3/Stages/02.Title/CStageタイトル.cs @@ -600,17 +600,17 @@ namespace TJAPlayer3 if (restricted1p[i] == true && TJAPlayer3.ConfigIni.nPlayerCount > 1) { - TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].color4 = Color.DarkGray; - TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(idxToTex(i)).color4 = Color.DarkGray; - this.stModeBar[i].BarTexture.color4 = Color.DarkGray; - TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(this.ttkBoxText[i]).color4 = Color.DarkGray; + TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].color4 = C変換.ColorToColor4(Color.DarkGray); + TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(idxToTex(i)).color4 = C変換.ColorToColor4(Color.DarkGray); + this.stModeBar[i].BarTexture.color4 = C変換.ColorToColor4(Color.DarkGray); + TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(this.ttkBoxText[i]).color4 = C変換.ColorToColor4(Color.DarkGray); } else { - TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].color4 = Color.White; - TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(idxToTex(i)).color4 = Color.White; - this.stModeBar[i].BarTexture.color4 = Color.White; - TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(this.ttkBoxText[i]).color4 = Color.White; + TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].color4 = C変換.ColorToColor4(Color.White); + TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(idxToTex(i)).color4 = C変換.ColorToColor4(Color.White); + this.stModeBar[i].BarTexture.color4 = C変換.ColorToColor4(Color.White); + TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(this.ttkBoxText[i]).color4 = C変換.ColorToColor4(Color.White); } #endregion @@ -688,15 +688,15 @@ namespace TJAPlayer3 if (restricted1p[i] == true && TJAPlayer3.ConfigIni.nPlayerCount > 1) { - TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].color4 = Color.DarkGray; - TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(idxToTex(i)).color4 = Color.DarkGray; - this.stModeBar[i].BarTexture.color4 = Color.DarkGray; + TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].color4 = C変換.ColorToColor4(Color.DarkGray); + TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(idxToTex(i)).color4 = C変換.ColorToColor4(Color.DarkGray); + this.stModeBar[i].BarTexture.color4 = C変換.ColorToColor4(Color.DarkGray); } else { - TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].color4 = Color.White; - TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(idxToTex(i)).color4 = Color.White; - this.stModeBar[i].BarTexture.color4 = Color.White; + TJAPlayer3.Tx.ModeSelect_Bar_Chara[i].color4 = C変換.ColorToColor4(Color.White); + TJAPlayer3.stage選曲.act曲リスト.ResolveTitleTexture(idxToTex(i)).color4 = C変換.ColorToColor4(Color.White); + this.stModeBar[i].BarTexture.color4 = C変換.ColorToColor4(Color.White); } #endregion diff --git a/TJAPlayer3/Stages/04.Config/CActConfigList.cs b/TJAPlayer3/Stages/04.Config/CActConfigList.cs index 397676c2..a4f9b9b4 100644 --- a/TJAPlayer3/Stages/04.Config/CActConfigList.cs +++ b/TJAPlayer3/Stages/04.Config/CActConfigList.cs @@ -4,7 +4,6 @@ using System.Diagnostics; using System.Text; using System.Drawing; using System.Threading; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/05.DaniSelect/CActSelect段位リスト.cs b/TJAPlayer3/Stages/05.DaniSelect/CActSelect段位リスト.cs index 89a4d303..5a8dc043 100644 --- a/TJAPlayer3/Stages/05.DaniSelect/CActSelect段位リスト.cs +++ b/TJAPlayer3/Stages/05.DaniSelect/CActSelect段位リスト.cs @@ -181,11 +181,11 @@ namespace TJAPlayer3 Color tickColor = stバー情報[currentSong].cDanTickColor; TJAPlayer3.Tx.Dani_Plate.Opacity = 255; - TJAPlayer3.Tx.Dani_Plate.color4 = tickColor; + TJAPlayer3.Tx.Dani_Plate.color4 = C変換.ColorToColor4(tickColor); TJAPlayer3.Tx.Dani_Plate.t2D拡大率考慮上中央基準描画(TJAPlayer3.app.Device, xPos, yPos, new Rectangle(tickWidth * tick, 0, tickWidth, tickHeight)); // Reset color for plate flash - TJAPlayer3.Tx.Dani_Plate.color4 = Color.White; + TJAPlayer3.Tx.Dani_Plate.color4 = C変換.ColorToColor4(Color.White); #endregion @@ -303,7 +303,7 @@ namespace TJAPlayer3 if (TJAPlayer3.Tx.Dani_DanPlates != null) { TJAPlayer3.Tx.Dani_DanPlates.Opacity = 255; - TJAPlayer3.Tx.Dani_DanPlates.color4 = danTickColor; + TJAPlayer3.Tx.Dani_DanPlates.color4 = C変換.ColorToColor4(danTickColor); } TJAPlayer3.Tx.Dani_DanPlates?.t2D中心基準描画(TJAPlayer3.app.Device, x, y, new Rectangle( unit * danTick, @@ -350,7 +350,7 @@ namespace TJAPlayer3 else { int unit = TJAPlayer3.Tx.Dani_DanSides.szテクスチャサイズ.Width / 6; - TJAPlayer3.Tx.Dani_DanSides.color4 = danTickColor; + TJAPlayer3.Tx.Dani_DanSides.color4 = C変換.ColorToColor4(danTickColor); TJAPlayer3.Tx.Dani_Bar_Center.t2D描画(TJAPlayer3.app.Device, scroll + Anime, 0); diff --git a/TJAPlayer3/Stages/05.DaniSelect/CActSelect段位挑戦選択画面.cs b/TJAPlayer3/Stages/05.DaniSelect/CActSelect段位挑戦選択画面.cs index 9e583aff..dfa192af 100644 --- a/TJAPlayer3/Stages/05.DaniSelect/CActSelect段位挑戦選択画面.cs +++ b/TJAPlayer3/Stages/05.DaniSelect/CActSelect段位挑戦選択画面.cs @@ -6,7 +6,6 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using FDK; -using SlimDX.DirectInput; namespace TJAPlayer3 { @@ -52,7 +51,7 @@ namespace TJAPlayer3 if (ctBarIn.b終了値に達した && !TJAPlayer3.stage段位選択.b選択した) { - if (TJAPlayer3.Input管理.Keyboard.bキーが押された((int)Key.RightArrow) || + if (TJAPlayer3.Input管理.Keyboard.bキーが押された((int)SlimDXKeys.Key.RightArrow) || TJAPlayer3.Pad.b押された(E楽器パート.DRUMS, Eパッド.RBlue)) { if (n現在の選択行 - 1 >= 0) @@ -62,7 +61,7 @@ namespace TJAPlayer3 } } - if (TJAPlayer3.Input管理.Keyboard.bキーが押された((int)Key.LeftArrow) || + if (TJAPlayer3.Input管理.Keyboard.bキーが押された((int)SlimDXKeys.Key.LeftArrow) || TJAPlayer3.Pad.b押された(E楽器パート.DRUMS, Eパッド.LBlue)) { if (n現在の選択行 + 1 <= 2) @@ -72,7 +71,7 @@ namespace TJAPlayer3 } } - if (TJAPlayer3.Input管理.Keyboard.bキーが押された((int)Key.Return) || + if (TJAPlayer3.Input管理.Keyboard.bキーが押された((int)SlimDXKeys.Key.Return) || TJAPlayer3.Pad.b押された(E楽器パート.DRUMS, Eパッド.LRed) || TJAPlayer3.Pad.b押された(E楽器パート.DRUMS, Eパッド.RRed)) { diff --git a/TJAPlayer3/Stages/05.DaniSelect/CStage段位選択.cs b/TJAPlayer3/Stages/05.DaniSelect/CStage段位選択.cs index 32cf7f4c..4edea7ba 100644 --- a/TJAPlayer3/Stages/05.DaniSelect/CStage段位選択.cs +++ b/TJAPlayer3/Stages/05.DaniSelect/CStage段位選択.cs @@ -5,7 +5,6 @@ using System.Text; using System.Threading.Tasks; using System.Drawing; using FDK; -using SlimDX.DirectInput; using static TJAPlayer3.CActSelect曲リスト; namespace TJAPlayer3 @@ -147,19 +146,19 @@ namespace TJAPlayer3 if (!this.段位リスト.bスクロール中 && !b選択した && !bDifficultyIn) { - if (TJAPlayer3.Input管理.Keyboard.bキーが押されている((int)Key.RightArrow) || + if (TJAPlayer3.Input管理.Keyboard.bキーが押されている((int)SlimDXKeys.Key.RightArrow) || TJAPlayer3.Pad.b押された(E楽器パート.DRUMS, Eパッド.RBlue)) { this.段位リスト.t右に移動(); } - if (TJAPlayer3.Input管理.Keyboard.bキーが押されている((int)Key.LeftArrow) || + if (TJAPlayer3.Input管理.Keyboard.bキーが押されている((int)SlimDXKeys.Key.LeftArrow) || TJAPlayer3.Pad.b押された(E楽器パート.DRUMS, Eパッド.LBlue)) { this.段位リスト.t左に移動(); } - if (TJAPlayer3.Input管理.Keyboard.bキーが押された((int)Key.Return) || + if (TJAPlayer3.Input管理.Keyboard.bキーが押された((int)SlimDXKeys.Key.Return) || TJAPlayer3.Pad.b押された(E楽器パート.DRUMS, Eパッド.LRed) || TJAPlayer3.Pad.b押された(E楽器パート.DRUMS, Eパッド.RRed)) { @@ -169,7 +168,7 @@ namespace TJAPlayer3 this.段位挑戦選択画面.ctBarIn.t開始(0, 255, 1, TJAPlayer3.Timer); } - if(TJAPlayer3.Input管理.Keyboard.bキーが押された((int)Key.Escape)) + if(TJAPlayer3.Input管理.Keyboard.bキーが押された((int)SlimDXKeys.Key.Escape)) { TJAPlayer3.Skin.soundDanSelectBGM.t停止する(); TJAPlayer3.Skin.sound取消音.t再生する(); diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelectArtistComment.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelectArtistComment.cs index f136cfb8..2d65e152 100644 --- a/TJAPlayer3/Stages/05.SongSelect/CActSelectArtistComment.cs +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelectArtistComment.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Text; using System.Drawing; using System.Diagnostics; -using SlimDX; +using SharpDX; using FDK; +using Rectangle = System.Drawing.Rectangle; + namespace TJAPlayer3 { internal class CActSelectArtistComment : CActivity diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelectPreimageパネル.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelectPreimageパネル.cs index 8bf51c1c..63a1d115 100644 --- a/TJAPlayer3/Stages/05.SongSelect/CActSelectPreimageパネル.cs +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelectPreimageパネル.cs @@ -4,10 +4,13 @@ using System.Text; using System.Drawing; using System.IO; using System.Diagnostics; -using SlimDX; -using SlimDX.Direct3D9; +using SharpDX; +using SharpDX.Direct3D9; using FDK; +using Rectangle = System.Drawing.Rectangle; +using Point = System.Drawing.Point; + namespace TJAPlayer3 { internal class CActSelectPreimageパネル : CActivity @@ -63,7 +66,7 @@ namespace TJAPlayer3 //this.txセンサ光 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\5_sensor light.png" ), false ); this.txプレビュー画像 = null; this.txプレビュー画像がないときの画像 = TJAPlayer3.tテクスチャの生成( CSkin.Path( @"Graphics\5_preimage default.png" ), false ); - this.sfAVI画像 = Surface.CreateOffscreenPlain( TJAPlayer3.app.Device.UnderlyingDevice, 0xcc, 0x10d, TJAPlayer3.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.SystemMemory ); + this.sfAVI画像 = Surface.CreateOffscreenPlain( TJAPlayer3.app.Device, 0xcc, 0x10d, TJAPlayer3.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.SystemMemory ); this.nAVI再生開始時刻 = -1; this.n前回描画したフレーム番号 = -1; this.b動画フレームを作成した = false; @@ -183,8 +186,8 @@ namespace TJAPlayer3 private unsafe void tサーフェイスをクリアする( Surface sf ) { DataRectangle rectangle = sf.LockRectangle( LockFlags.None ); - DataStream data = rectangle.Data; - switch( ( rectangle.Pitch / sf.Description.Width ) ) + DataStream data = new DataStream(rectangle.DataPointer, sf.Description.Width * rectangle.Pitch, true, false); + switch ( ( rectangle.Pitch / sf.Description.Width ) ) { case 4: { @@ -524,7 +527,7 @@ namespace TJAPlayer3 if( this.b動画フレームを作成した && ( this.pAVIBmp != IntPtr.Zero ) ) { DataRectangle rectangle = this.sfAVI画像.LockRectangle( LockFlags.None ); - DataStream data = rectangle.Data; + DataStream data = new DataStream(rectangle.DataPointer, this.sfAVI画像.Description.Width * rectangle.Pitch, true, false); ; int num5 = rectangle.Pitch / this.sfAVI画像.Description.Width; BitmapUtil.BITMAPINFOHEADER* pBITMAPINFOHEADER = (BitmapUtil.BITMAPINFOHEADER*) this.pAVIBmp.ToPointer(); if( pBITMAPINFOHEADER->biBitCount == 0x18 ) @@ -547,7 +550,7 @@ namespace TJAPlayer3 { try { - TJAPlayer3.app.Device.UpdateSurface( this.sfAVI画像, new Rectangle( 0, 0, this.sfAVI画像.Description.Width, this.sfAVI画像.Description.Height ), surface, new Point( x, y ) ); + TJAPlayer3.app.Device.UpdateSurface( this.sfAVI画像, new SharpDX.Rectangle( 0, 0, this.sfAVI画像.Description.Width, this.sfAVI画像.Description.Height ), surface, new SharpDX.Point( x, y ) ); } catch( Exception e ) // #32335 2013.10.26 yyagi: codecがないと、D3DERR_INVALIDCALLが発生する場合がある { diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelectQuickConfig.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelectQuickConfig.cs index 8d5165d7..ba8b7f1c 100644 --- a/TJAPlayer3/Stages/05.SongSelect/CActSelectQuickConfig.cs +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelectQuickConfig.cs @@ -4,7 +4,6 @@ using System.Diagnostics; using System.Text; using System.Drawing; using System.IO; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelectShowCurrentPosition.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelectShowCurrentPosition.cs index 714adb6a..168cd012 100644 --- a/TJAPlayer3/Stages/05.SongSelect/CActSelectShowCurrentPosition.cs +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelectShowCurrentPosition.cs @@ -4,7 +4,6 @@ using System.Text; using System.Drawing; using System.Diagnostics; using System.IO; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelect曲リスト.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelect曲リスト.cs index 294fc284..ce75097d 100644 --- a/TJAPlayer3/Stages/05.SongSelect/CActSelect曲リスト.cs +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelect曲リスト.cs @@ -8,9 +8,14 @@ using System.Drawing.Imaging; using System.Diagnostics; using System.Drawing.Text; using System.Threading.Tasks; -using SlimDX; +using SharpDX; using FDK; using System.Linq; + +using Rectangle = System.Drawing.Rectangle; +using Point = System.Drawing.Point; +using Color = System.Drawing.Color; +using RectangleF = System.Drawing.RectangleF; namespace TJAPlayer3 { @@ -1462,7 +1467,7 @@ namespace TJAPlayer3 if (!stバー情報[nパネル番号].BoxTypeChanged) boxType = nStrジャンルtoNum(stバー情報[nパネル番号].strジャンル); - TJAPlayer3.Tx.SongSelect_Bar_Genre[boxType].color4 = stバー情報[nパネル番号].BoxColor; + TJAPlayer3.Tx.SongSelect_Bar_Genre[boxType].color4 = C変換.ColorToColor4(stバー情報[nパネル番号].BoxColor); TJAPlayer3.Tx.SongSelect_Bar_Genre[boxType].vc拡大縮小倍率.X = 1.0f; TJAPlayer3.Tx.SongSelect_Bar_Genre_Overlay.vc拡大縮小倍率.X = 1.0f; @@ -1574,7 +1579,7 @@ namespace TJAPlayer3 if (!r現在選択中の曲.isChangedBoxType) boxType = nStrジャンルtoNum(r現在選択中の曲.strジャンル); - TJAPlayer3.Tx.SongSelect_Bar_Genre[boxType].color4 = r現在選択中の曲.BoxColor; + TJAPlayer3.Tx.SongSelect_Bar_Genre[boxType].color4 = C変換.ColorToColor4(r現在選択中の曲.BoxColor); if (ctBoxOpen.n現在の値 >= 1300 && ctBoxOpen.n現在の値 <= 1940) { @@ -1680,7 +1685,7 @@ namespace TJAPlayer3 if (!r現在選択中の曲.isChangedBoxType) boxType = nStrジャンルtoNum(r現在選択中の曲.strジャンル); - TJAPlayer3.Tx.SongSelect_Bar_Genre[boxType].color4 = r現在選択中の曲.BoxColor; + TJAPlayer3.Tx.SongSelect_Bar_Genre[boxType].color4 = C変換.ColorToColor4(r現在選択中の曲.BoxColor); if (ctBoxOpen.n現在の値 >= 1300 && ctBoxOpen.n現在の値 <= 1940) { @@ -1798,9 +1803,9 @@ namespace TJAPlayer3 bool avaliable = TJAPlayer3.stage選曲.r現在選択中のスコア.譜面情報.nレベル[i] >= 0; if (avaliable) - TJAPlayer3.Tx.SongSelect_Frame_Score[0].color4 = new Color4(1f, 1f, 1f); + TJAPlayer3.Tx.SongSelect_Frame_Score[0].color4 = new Color4(1f, 1f, 1f, 1f); else - TJAPlayer3.Tx.SongSelect_Frame_Score[0].color4 = new Color4(0.5f, 0.5f, 0.5f); + TJAPlayer3.Tx.SongSelect_Frame_Score[0].color4 = new Color4(0.5f, 0.5f, 0.5f, 1f); #endregion @@ -1876,9 +1881,9 @@ namespace TJAPlayer3 bool avaliable = TJAPlayer3.stage選曲.r現在選択中のスコア.譜面情報.nレベル[diff] >= 0; if (avaliable) - TJAPlayer3.Tx.SongSelect_Frame_Score[1].color4 = new Color4(1f, 1f, 1f); + TJAPlayer3.Tx.SongSelect_Frame_Score[1].color4 = new Color4(1f, 1f, 1f, 1f); else - TJAPlayer3.Tx.SongSelect_Frame_Score[1].color4 = new Color4(0.5f, 0.5f, 0.5f); + TJAPlayer3.Tx.SongSelect_Frame_Score[1].color4 = new Color4(0.5f, 0.5f, 0.5f, 1f); #endregion diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelect演奏履歴パネル.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelect演奏履歴パネル.cs index a7afaa13..295cd5ce 100644 --- a/TJAPlayer3/Stages/05.SongSelect/CActSelect演奏履歴パネル.cs +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelect演奏履歴パネル.cs @@ -4,9 +4,13 @@ using System.Text; using System.Diagnostics; using System.Drawing; using System.Runtime.InteropServices; -using SlimDX; +using SharpDX; using FDK; +using Rectangle = System.Drawing.Rectangle; +using Point = System.Drawing.Point; +using Color = System.Drawing.Color; + namespace TJAPlayer3 { internal class CActSelect演奏履歴パネル : CActivity diff --git a/TJAPlayer3/Stages/05.SongSelect/CActSelect難易度選択画面.cs b/TJAPlayer3/Stages/05.SongSelect/CActSelect難易度選択画面.cs index 07c828ed..5d1b375d 100644 --- a/TJAPlayer3/Stages/05.SongSelect/CActSelect難易度選択画面.cs +++ b/TJAPlayer3/Stages/05.SongSelect/CActSelect難易度選択画面.cs @@ -8,9 +8,13 @@ using System.Drawing.Imaging; using System.Diagnostics; using System.Drawing.Text; -using SlimDX; +using SharpDX; using FDK; +using Rectangle = System.Drawing.Rectangle; +using RectangleF = System.Drawing.RectangleF; +using Color = System.Drawing.Color; + namespace TJAPlayer3 { /// @@ -312,7 +316,7 @@ namespace TJAPlayer3 TJAPlayer3.Tx.SongSelect_ScoreRank.Opacity = (TJAPlayer3.stage選曲.act曲リスト.ctDifficultyIn.n現在の値 - 1255); TJAPlayer3.Tx.Difficulty_Star.Opacity = (TJAPlayer3.stage選曲.act曲リスト.ctDifficultyIn.n現在の値 - 1255); - TJAPlayer3.Tx.Difficulty_Back[boxType].color4 = TJAPlayer3.stage選曲.r現在選択中の曲.BoxColor; + TJAPlayer3.Tx.Difficulty_Back[boxType].color4 = C変換.ColorToColor4(TJAPlayer3.stage選曲.r現在選択中の曲.BoxColor); TJAPlayer3.Tx.Difficulty_Back[boxType].t2D中心基準描画(TJAPlayer3.app.Device, 640, 290); @@ -322,7 +326,7 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Difficulty_Select_Bar[i].t2D描画(TJAPlayer3.app.Device, (float)this.BarX[n現在の選択行[i]], 242, new RectangleF(0, (n現在の選択行[i] >= 2 ? 114 : 387), 259, 275 - (n現在の選択行[i] >= 2 ? 0 : 164))); } - TJAPlayer3.Tx.Difficulty_Bar.color4 = new Color4(1.0f, 1.0f, 1.0f); + TJAPlayer3.Tx.Difficulty_Bar.color4 = new Color4(1.0f, 1.0f, 1.0f, 1.0f); TJAPlayer3.Tx.Difficulty_Bar.t2D描画(TJAPlayer3.app.Device, 255, 270, new RectangleF(0, 0, 171, 236)); //閉じる、演奏オプション @@ -338,9 +342,9 @@ namespace TJAPlayer3 bool avaliable = TJAPlayer3.stage選曲.r現在選択中のスコア.譜面情報.nレベル[i] > 0; if (avaliable) - TJAPlayer3.Tx.Difficulty_Bar.color4 = new Color4(1.0f, 1.0f, 1.0f); + TJAPlayer3.Tx.Difficulty_Bar.color4 = new Color4(1.0f, 1.0f, 1.0f, 1.0f); else - TJAPlayer3.Tx.Difficulty_Bar.color4 = new Color4(0.5f, 0.5f, 0.5f); + TJAPlayer3.Tx.Difficulty_Bar.color4 = new Color4(0.5f, 0.5f, 0.5f, 1.0f); TJAPlayer3.Tx.Difficulty_Bar.t2D描画(TJAPlayer3.app.Device, 255 + 171 + 143 * screenPos, 270, new RectangleF(171 + 143 * i, 0, 138, 236)); @@ -382,12 +386,12 @@ namespace TJAPlayer3 { if (level > g + 10) { - TJAPlayer3.Tx.Difficulty_Star.color4 = new Color4(1f, 0.2f, 0.2f); + TJAPlayer3.Tx.Difficulty_Star.color4 = new Color4(1f, 0.2f, 0.2f, 1.0f); TJAPlayer3.Tx.Difficulty_Star?.t2D描画(TJAPlayer3.app.Device, 444 + screenPos * 143 + g * 10, 459); } else if (level > g) { - TJAPlayer3.Tx.Difficulty_Star.color4 = new Color4(1f, 1f, 1f); + TJAPlayer3.Tx.Difficulty_Star.color4 = new Color4(1f, 1f, 1f, 1.0f); TJAPlayer3.Tx.Difficulty_Star?.t2D描画(TJAPlayer3.app.Device, 444 + screenPos * 143 + g * 10, 459); } diff --git a/TJAPlayer3/Stages/05.SongSelect/CStage選曲.cs b/TJAPlayer3/Stages/05.SongSelect/CStage選曲.cs index fcf9f8f1..749929f7 100644 --- a/TJAPlayer3/Stages/05.SongSelect/CStage選曲.cs +++ b/TJAPlayer3/Stages/05.SongSelect/CStage選曲.cs @@ -6,7 +6,6 @@ using System.Drawing; using System.IO; using System.Runtime.InteropServices; using System.Text; -using SlimDX; namespace TJAPlayer3 { @@ -395,13 +394,13 @@ namespace TJAPlayer3 { if (TJAPlayer3.Tx.SongSelect_GenreBack[nGenreBack] != null) { - TJAPlayer3.Tx.SongSelect_GenreBack[nGenreBack].color4 = this.NowBgColor; + TJAPlayer3.Tx.SongSelect_GenreBack[nGenreBack].color4 = C変換.ColorToColor4(this.NowBgColor); TJAPlayer3.Tx.SongSelect_GenreBack[nGenreBack].Opacity = 255; TJAPlayer3.Tx.SongSelect_GenreBack[nGenreBack].t2D描画(TJAPlayer3.app.Device, -(int)ct背景スクロール用タイマー.n現在の値 + TJAPlayer3.Tx.SongSelect_Background.szテクスチャサイズ.Width * i, 0); } if (TJAPlayer3.Tx.SongSelect_GenreBack[nOldGenreBack] != null) { - TJAPlayer3.Tx.SongSelect_GenreBack[nOldGenreBack].color4 = this.OldBgColor; + TJAPlayer3.Tx.SongSelect_GenreBack[nOldGenreBack].color4 = C変換.ColorToColor4(this.OldBgColor); TJAPlayer3.Tx.SongSelect_GenreBack[nOldGenreBack].Opacity = 600 - ctBackgroundFade.n現在の値; TJAPlayer3.Tx.SongSelect_GenreBack[nOldGenreBack].t2D描画(TJAPlayer3.app.Device, -(int)ct背景スクロール用タイマー.n現在の値 + TJAPlayer3.Tx.SongSelect_Background.szテクスチャサイズ.Width * i, 0); } @@ -935,7 +934,7 @@ namespace TJAPlayer3 int displayedScore = 0; int table = 0; - TJAPlayer3.Tx.SongSelect_High_Score.t2D中心基準描画(TJAPlayer3.app.Device, posx, this.ptBoardNumber[11].Y); + TJAPlayer3.Tx.SongSelect_High_Score?.t2D中心基準描画(TJAPlayer3.app.Device, posx, this.ptBoardNumber[11].Y); if (this.n現在選択中の曲の難易度 > (int)Difficulty.Edit) table = 0; diff --git a/TJAPlayer3/Stages/06.SongLoading/CStage曲読み込み.cs b/TJAPlayer3/Stages/06.SongLoading/CStage曲読み込み.cs index 459ec3be..883ad0ca 100644 --- a/TJAPlayer3/Stages/06.SongLoading/CStage曲読み込み.cs +++ b/TJAPlayer3/Stages/06.SongLoading/CStage曲読み込み.cs @@ -4,9 +4,12 @@ using System.Text; using System.Diagnostics; using System.Drawing; using System.IO; -using SlimDX; +using SharpDX; using System.Drawing.Text; using FDK; + +using RectangleF = System.Drawing.RectangleF; +using Color = System.Drawing.Color; namespace TJAPlayer3 { diff --git a/TJAPlayer3/Stages/07.Game/CAct演奏AVI.cs b/TJAPlayer3/Stages/07.Game/CAct演奏AVI.cs index 36355be0..79eaacb0 100644 --- a/TJAPlayer3/Stages/07.Game/CAct演奏AVI.cs +++ b/TJAPlayer3/Stages/07.Game/CAct演奏AVI.cs @@ -2,11 +2,15 @@ using System.Collections.Generic; using System.Text; using System.Drawing; -using SlimDX; -using SlimDX.Direct3D9; +using SharpDX; +using SharpDX.Direct3D9; using FDK; using DirectShowLib; +using Rectangle = System.Drawing.Rectangle; +using Point = System.Drawing.Point; +using Color = System.Drawing.Color; + namespace TJAPlayer3 { internal class CAct演奏AVI : CActivity @@ -399,8 +403,8 @@ namespace TJAPlayer3 if ( this.bフレームを作成した && ( this.pBmp != IntPtr.Zero ) ) { DataRectangle rectangle3 = this.tx描画用.texture.LockRectangle( 0, LockFlags.None ); - DataStream data = rectangle3.Data; - int num14 = rectangle3.Pitch / this.tx描画用.szテクスチャサイズ.Width; + DataStream data = new DataStream(rectangle3.DataPointer, this.tx描画用.szテクスチャサイズ.Width * rectangle3.Pitch, true, false); + int num14 = rectangle3.Pitch / this.tx描画用.szテクスチャサイズ.Width; BitmapUtil.BITMAPINFOHEADER* pBITMAPINFOHEADER = (BitmapUtil.BITMAPINFOHEADER*) this.pBmp.ToPointer(); if ( pBITMAPINFOHEADER->biBitCount == 0x18 ) { diff --git a/TJAPlayer3/Stages/07.Game/CAct演奏Combo共通.cs b/TJAPlayer3/Stages/07.Game/CAct演奏Combo共通.cs index 6c1ebcae..4a8f8388 100644 --- a/TJAPlayer3/Stages/07.Game/CAct演奏Combo共通.cs +++ b/TJAPlayer3/Stages/07.Game/CAct演奏Combo共通.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Drawing; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/07.Game/CAct演奏PauseMenu.cs b/TJAPlayer3/Stages/07.Game/CAct演奏PauseMenu.cs index 8d38ff82..90fffa0a 100644 --- a/TJAPlayer3/Stages/07.Game/CAct演奏PauseMenu.cs +++ b/TJAPlayer3/Stages/07.Game/CAct演奏PauseMenu.cs @@ -4,7 +4,6 @@ using System.Diagnostics; using System.Text; using System.Drawing; using System.IO; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/07.Game/CAct演奏ゲージ共通.cs b/TJAPlayer3/Stages/07.Game/CAct演奏ゲージ共通.cs index d7a61442..01d6bb58 100644 --- a/TJAPlayer3/Stages/07.Game/CAct演奏ゲージ共通.cs +++ b/TJAPlayer3/Stages/07.Game/CAct演奏ゲージ共通.cs @@ -4,7 +4,6 @@ using System.Text; using System.Runtime.InteropServices; using System.Drawing; using System.Diagnostics; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/07.Game/CAct演奏チップファイアGB.cs b/TJAPlayer3/Stages/07.Game/CAct演奏チップファイアGB.cs index 7dcd825c..97b91731 100644 --- a/TJAPlayer3/Stages/07.Game/CAct演奏チップファイアGB.cs +++ b/TJAPlayer3/Stages/07.Game/CAct演奏チップファイアGB.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Text; using System.Drawing; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/07.Game/CAct演奏パネル文字列.cs b/TJAPlayer3/Stages/07.Game/CAct演奏パネル文字列.cs index 851e43c7..a0ccf782 100644 --- a/TJAPlayer3/Stages/07.Game/CAct演奏パネル文字列.cs +++ b/TJAPlayer3/Stages/07.Game/CAct演奏パネル文字列.cs @@ -3,10 +3,12 @@ using System.Collections.Generic; using System.Text; using System.Drawing; using System.Diagnostics; -using SlimDX; +using SharpDX; using FDK; using static TJAPlayer3.CActSelect曲リスト; +using Color = System.Drawing.Color; + namespace TJAPlayer3 { @@ -128,7 +130,7 @@ namespace TJAPlayer3 } else { - this.txGENRE.color4 = stageColor; + this.txGENRE.color4 = C変換.ColorToColor4(stageColor); } if (!string.IsNullOrEmpty(TJAPlayer3.ConfigIni.FontName)) diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏DrumsMtaiko.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏DrumsMtaiko.cs index eaa9811f..a181a560 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏DrumsMtaiko.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏DrumsMtaiko.cs @@ -4,6 +4,9 @@ using System.Text; using System.Drawing; using System.Runtime.InteropServices; using FDK; +using SharpDX; + +using Rectangle = System.Drawing.Rectangle; namespace TJAPlayer3 { @@ -184,9 +187,9 @@ namespace TJAPlayer3 fScale = 1.0f; } - SlimDX.Matrix mat = SlimDX.Matrix.Identity; - mat *= SlimDX.Matrix.Scaling( fScale, fScale, 1.0f ); - mat *= SlimDX.Matrix.Translation( -329, fY[ i ], 0 ); + Matrix mat = Matrix.Identity; + mat *= Matrix.Scaling( fScale, fScale, 1.0f ); + mat *= Matrix.Translation( -329, fY[ i ], 0 ); if( this.After[ i ] - this.Before[ i ] >= 0 ) { //レベルアップ diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsグラフ.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsグラフ.cs index 267642d0..2f382ce9 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsグラフ.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsグラフ.cs @@ -4,7 +4,6 @@ using System.Text; using System.Runtime.InteropServices; using System.Drawing; using System.IO; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsゲージ.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsゲージ.cs index 116aa820..92c89ca4 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsゲージ.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsゲージ.cs @@ -4,7 +4,6 @@ using System.Text; using System.Runtime.InteropServices; using System.Drawing; using System.Diagnostics; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsゲームモード.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsゲームモード.cs index 9ca8646d..4436efc5 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsゲームモード.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsゲームモード.cs @@ -5,6 +5,11 @@ using System.Linq; using System.Text; using System.Runtime.InteropServices; using FDK; +using SharpDX; + +using Rectangle = System.Drawing.Rectangle; +using Point = System.Drawing.Point; +using Color = System.Drawing.Color; namespace TJAPlayer3 { @@ -477,15 +482,15 @@ namespace TJAPlayer3 if( this.st叩ききりまショー.b加算アニメ中 == true ) fRotate = C変換.DegreeToRadian( 360.0f * ( this.st叩ききりまショー.ct針アニメ.n現在の値 / (float)this.st叩ききりまショー.n延長アニメ速度 ) ); - SlimDX.Matrix mat = SlimDX.Matrix.Identity; + Matrix mat = Matrix.Identity; if( this.st叩ききりまショー.b最初のチップが叩かれた ) { - mat *= SlimDX.Matrix.RotationZ( fRotate ); - mat *= SlimDX.Matrix.Translation( 280 - 640, -( 134 - 360 ), 0 ); + mat *= Matrix.RotationZ( fRotate ); + mat *= Matrix.Translation( 280 - 640, -( 134 - 360 ), 0 ); } else { - mat *= SlimDX.Matrix.Translation( 280 - 640, -( 134 - 360 ), 0 ); + mat *= Matrix.Translation( 280 - 640, -( 134 - 360 ), 0 ); } TJAPlayer3.Tx.GameMode_Timer_Tick.t3D描画( TJAPlayer3.app.Device, mat ); diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsコンボ吹き出し.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsコンボ吹き出し.cs index d7327486..60dc6b95 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsコンボ吹き出し.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsコンボ吹き出し.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Text; using System.Drawing; using System.Runtime.InteropServices; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsチップエフェクト.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsチップエフェクト.cs index 0cfbce74..de187a1d 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsチップエフェクト.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsチップエフェクト.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Text; using System.Drawing; using System.Runtime.InteropServices; -using SlimDX; +using SharpDX; using FDK; +using Rectangle = System.Drawing.Rectangle; + namespace TJAPlayer3 { internal class CAct演奏Drumsチップエフェクト : CActivity @@ -93,13 +95,13 @@ namespace TJAPlayer3 if (this.st[i].ctChipEffect.n現在の値 < 12) { - TJAPlayer3.Tx.ChipEffect.color4 = new Color4(1.0f, 1.0f, 0.0f); + TJAPlayer3.Tx.ChipEffect.color4 = new Color4(1.0f, 1.0f, 0.0f, 1.0f); TJAPlayer3.Tx.ChipEffect.Opacity = (int)(this.st[i].ctChipEffect.n現在の値 * (float)(225 / 11)); TJAPlayer3.Tx.ChipEffect.t2D中心基準描画(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[st[i].nプレイヤー], TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[st[i].nプレイヤー], new Rectangle(st[i].Lane * 130, 0, 130, 130)); } if (this.st[i].ctChipEffect.n現在の値 > 12 && this.st[i].ctChipEffect.n現在の値 < 24) { - TJAPlayer3.Tx.ChipEffect.color4 = new Color4(1.0f, 1.0f, 1.0f); + TJAPlayer3.Tx.ChipEffect.color4 = new Color4(1.0f, 1.0f, 1.0f, 1.0f); TJAPlayer3.Tx.ChipEffect.Opacity = 255 - (int)((this.st[i].ctChipEffect.n現在の値 - 10) * (float)(255 / 14)); TJAPlayer3.Tx.ChipEffect.t2D中心基準描画(TJAPlayer3.app.Device, TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_X[st[i].nプレイヤー], TJAPlayer3.Skin.Game_Effect_FlyingNotes_EndPoint_Y[st[i].nプレイヤー], new Rectangle(st[i].Lane * 130, 0, 130, 130)); } diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏DrumsチップファイアD.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏DrumsチップファイアD.cs index 2dd70757..0950b541 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏DrumsチップファイアD.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏DrumsチップファイアD.cs @@ -3,9 +3,13 @@ using System.Collections.Generic; using System.Text; using System.Drawing; using System.Runtime.InteropServices; -using SlimDX; +using SharpDX; using FDK; +using Rectangle = System.Drawing.Rectangle; +using Point = System.Drawing.Point; +using Color = System.Drawing.Color; + namespace TJAPlayer3 { internal class CAct演奏DrumsチップファイアD : CActivity diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsレーン太鼓.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsレーン太鼓.cs index 7b4f9cbf..2843a1b3 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsレーン太鼓.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drumsレーン太鼓.cs @@ -4,9 +4,13 @@ using System.Text; using System.Drawing; using System.Runtime.InteropServices; using System.Diagnostics; -using SlimDX; +using SharpDX; using FDK; +using Rectangle = System.Drawing.Rectangle; +using Point = System.Drawing.Point; +using Color = System.Drawing.Color; + namespace TJAPlayer3 { internal class CAct演奏Drumsレーン太鼓 : CActivity diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums判定文字列.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums判定文字列.cs index eef63793..8b8a2433 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums判定文字列.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums判定文字列.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Diagnostics; using System.Text; using System.Runtime.InteropServices; -using SlimDX; using FDK; using System.Drawing; diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums演奏終了演出.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums演奏終了演出.cs index 77c83d86..fa692c42 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums演奏終了演出.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums演奏終了演出.cs @@ -4,6 +4,11 @@ using System.Text; using System.Runtime.InteropServices; using System.Drawing; using FDK; +using SharpDX; + +using Rectangle = System.Drawing.Rectangle; +using Point = System.Drawing.Point; +using Color = System.Drawing.Color; namespace TJAPlayer3 { @@ -295,10 +300,10 @@ namespace TJAPlayer3 //2016.07.16 kairera0467 またも原始的... float[] fRet = new float[] { 1.0f, 0.99f, 0.98f, 0.97f, 0.96f, 0.95f, 0.96f, 0.97f, 0.98f, 0.99f, 1.0f }; TJAPlayer3.Tx.End_Clear_L[0].t2D描画(TJAPlayer3.app.Device, 466, y[i] - 30); - TJAPlayer3.Tx.End_Clear_L[0].vc拡大縮小倍率 = new SlimDX.Vector3(fRet[this.ct進行メイン.n現在の値 - 36], 1.0f, 1.0f); + TJAPlayer3.Tx.End_Clear_L[0].vc拡大縮小倍率 = new Vector3(fRet[this.ct進行メイン.n現在の値 - 36], 1.0f, 1.0f); //CDTXMania.Tx.End_Clear_R[ 0 ].t2D描画( CDTXMania.app.Device, 956 + (( this.ct進行メイン.n現在の値 - 36 ) / 2), 180 ); TJAPlayer3.Tx.End_Clear_R[0].t2D描画(TJAPlayer3.app.Device, 1136 - 180 * fRet[this.ct進行メイン.n現在の値 - 36], y[i] - 30); - TJAPlayer3.Tx.End_Clear_R[0].vc拡大縮小倍率 = new SlimDX.Vector3(fRet[this.ct進行メイン.n現在の値 - 36], 1.0f, 1.0f); + TJAPlayer3.Tx.End_Clear_R[0].vc拡大縮小倍率 = new Vector3(fRet[this.ct進行メイン.n現在の値 - 36], 1.0f, 1.0f); } } else if (this.ct進行メイン.n現在の値 <= 49) diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums背景.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums背景.cs index 83aa412b..07576efc 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums背景.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums背景.cs @@ -1,9 +1,12 @@ using System; using FDK; using System.Drawing; -using SlimDX; +using SharpDX; using static TJAPlayer3.CActSelect曲リスト; +using Color = System.Drawing.Color; +using Rectangle = System.Drawing.Rectangle; + namespace TJAPlayer3 { // Small static class which refers to the Tower mode important informations @@ -253,9 +256,9 @@ namespace TJAPlayer3 { float colorTmp = 0.5f + (1f - currentFloorPositionMax140) * 0.5f; - TJAPlayer3.Tx.Background_Up_Tower[1].color4 = new Color4(colorTmp, colorTmp, colorTmp); - TJAPlayer3.Tx.Background_Up_Tower[2].color4 = new Color4(colorTmp, colorTmp, colorTmp); - TJAPlayer3.Tx.Background_Up_Tower[3].color4 = new Color4(colorTmp, colorTmp, colorTmp); + TJAPlayer3.Tx.Background_Up_Tower[1].color4 = new Color4(colorTmp, colorTmp, colorTmp, 1f); + TJAPlayer3.Tx.Background_Up_Tower[2].color4 = new Color4(colorTmp, colorTmp, colorTmp, 1f); + TJAPlayer3.Tx.Background_Up_Tower[3].color4 = new Color4(colorTmp, colorTmp, colorTmp, 1f); TJAPlayer3.Tx.Background_Up_Tower[1].Opacity = (int)(255f * colorTmp); TJAPlayer3.Tx.Background_Up_Tower[2].Opacity = (int)(255f * colorTmp); @@ -309,7 +312,7 @@ namespace TJAPlayer3 int digitLength = TJAPlayer3.Tx.Taiko_Combo[0].szテクスチャサイズ.Width / 10; - TJAPlayer3.Tx.Taiko_Combo[0].color4 = new Color4(1f, 0.6f, 0.2f); + TJAPlayer3.Tx.Taiko_Combo[0].color4 = new Color4(1f, 0.6f, 0.2f, 1f); TJAPlayer3.Tx.Taiko_Combo[0].vc拡大縮小倍率.X = 1.4f; TJAPlayer3.Tx.Taiko_Combo[0].vc拡大縮小倍率.Y = 1.4f; @@ -350,9 +353,9 @@ namespace TJAPlayer3 bool lifeSpecialCase = CFloorManagement.CurrentNumberOfLives == 1 && CFloorManagement.MaxNumberOfLives != 1; float lifeRatio = CFloorManagement.CurrentNumberOfLives / (float)CFloorManagement.MaxNumberOfLives; - Color4 lifeColor = (lifeRatio > 0.5f && !lifeSpecialCase) ? new Color4(0.2f, 1f, 0.2f) - : ((lifeRatio >= 0.2f && !lifeSpecialCase) ? new Color4(1f, 1f, 0.2f) - : new Color4(1f, 0.2f, 0.2f)); + Color4 lifeColor = (lifeRatio > 0.5f && !lifeSpecialCase) ? new Color4(0.2f, 1f, 0.2f, 1f) + : ((lifeRatio >= 0.2f && !lifeSpecialCase) ? new Color4(1f, 1f, 0.2f, 1f) + : new Color4(1f, 0.2f, 0.2f, 1f)); TJAPlayer3.Tx.Taiko_Combo[0].color4 = lifeColor; TJAPlayer3.Tx.Taiko_Combo[0].vc拡大縮小倍率.X = 1.1f; @@ -368,7 +371,7 @@ namespace TJAPlayer3 digitLength, TJAPlayer3.Tx.Taiko_Combo[0].szテクスチャサイズ.Height)); } - TJAPlayer3.Tx.Taiko_Combo[0].color4 = new Color4(1f, 1f, 1f); + TJAPlayer3.Tx.Taiko_Combo[0].color4 = new Color4(1f, 1f, 1f, 1f); #endregion diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums連打.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums連打.cs index beb5a77a..7f9946ff 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums連打.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums連打.cs @@ -4,7 +4,6 @@ using System.Text; using System.Drawing; using System.Diagnostics; using System.Runtime.InteropServices; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums連打キャラ.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums連打キャラ.cs index cbc24aee..85294139 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums連打キャラ.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums連打キャラ.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Text; using System.Drawing; using System.Runtime.InteropServices; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums風船.cs b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums風船.cs index fe51d6a9..3f0dd931 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums風船.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CAct演奏Drums風船.cs @@ -4,7 +4,6 @@ using System.Text; using System.Drawing; using System.Diagnostics; using System.Runtime.InteropServices; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/07.Game/Taiko/CStage演奏ドラム画面.cs b/TJAPlayer3/Stages/07.Game/Taiko/CStage演奏ドラム画面.cs index f13ee8d6..d27ba520 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/CStage演奏ドラム画面.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/CStage演奏ドラム画面.cs @@ -7,10 +7,12 @@ using System.Drawing.Imaging; using System.IO; using System.Diagnostics; using System.Threading; -using SlimDX; -using SlimDX.Direct3D9; +using SharpDX; using FDK; -using TJAPlayer3; + +using Rectangle = System.Drawing.Rectangle; +using Point = System.Drawing.Point; +using Color = System.Drawing.Color; namespace TJAPlayer3 { @@ -1924,8 +1926,8 @@ namespace TJAPlayer3 } float f減少するカラー = 1.0f - ((0.95f / 100) * pChip.RollEffectLevel); - var effectedColor = new Color4(1.0f, f減少するカラー, f減少するカラー); - var normalColor = new Color4(1.0f, 1.0f, 1.0f); + var effectedColor = new Color4(1.0f, f減少するカラー, f減少するカラー, 1f); + var normalColor = new Color4(1.0f, 1.0f, 1.0f, 1f); float f末端ノーツのテクスチャ位置調整 = 65f; if (pChip.nチャンネル番号 == 0x15 && pChip.bShow) //連打(小) @@ -2207,7 +2209,7 @@ namespace TJAPlayer3 string strNull = "Found"; - if (TJAPlayer3.Input管理.Keyboard.bキーが押された((int)SlimDX.DirectInput.Key.F1)) + if (TJAPlayer3.Input管理.Keyboard.bキーが押された((int)SlimDXKeys.Key.F1)) { if (!this.actPauseMenu.bIsActivePopupMenu && this.bPAUSE == false) { diff --git a/TJAPlayer3/Stages/07.Game/Taiko/Dan_Cert.cs b/TJAPlayer3/Stages/07.Game/Taiko/Dan_Cert.cs index 053267ba..6c8c2141 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/Dan_Cert.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/Dan_Cert.cs @@ -4,10 +4,14 @@ using System.Text; using System.Drawing; using System.Runtime.InteropServices; using FDK; +using SharpDX; using System.IO; -using TJAPlayer3; using System.Linq; using static TJAPlayer3.CActSelect曲リスト; + +using Rectangle = System.Drawing.Rectangle; +using RectangleF = System.Drawing.RectangleF; +using Color = System.Drawing.Color; namespace TJAPlayer3 { @@ -991,13 +995,13 @@ namespace TJAPlayer3 if (value == 0) { - TJAPlayer3.Tx.DanC_Number.color4 = Color.Gray; - TJAPlayer3.Tx.DanC_Small_Number.color4 = Color.Gray; + TJAPlayer3.Tx.DanC_Number.color4 = C変換.ColorToColor4(Color.Gray); + TJAPlayer3.Tx.DanC_Small_Number.color4 = C変換.ColorToColor4(Color.Gray); } else { - TJAPlayer3.Tx.DanC_Number.color4 = Color.White; - TJAPlayer3.Tx.DanC_Small_Number.color4 = Color.White; + TJAPlayer3.Tx.DanC_Number.color4 = C変換.ColorToColor4(Color.White); + TJAPlayer3.Tx.DanC_Small_Number.color4 = C変換.ColorToColor4(Color.White); } if (bBig) @@ -1169,7 +1173,7 @@ namespace TJAPlayer3 [StructLayout(LayoutKind.Sequential)] struct ChallengeStatus { - public SlimDX.Color4 Color; + public Color4 Color; public CCounter Timer_Gauge; public CCounter Timer_Amount; public CCounter Timer_Failed; diff --git a/TJAPlayer3/Stages/07.Game/Taiko/FireWorks.cs b/TJAPlayer3/Stages/07.Game/Taiko/FireWorks.cs index 1e120eee..52f8a5cc 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/FireWorks.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/FireWorks.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Text; using System.Drawing; using System.Runtime.InteropServices; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/07.Game/Taiko/FlyingNotes.cs b/TJAPlayer3/Stages/07.Game/Taiko/FlyingNotes.cs index 6c85c25c..c378656c 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/FlyingNotes.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/FlyingNotes.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Text; using System.Drawing; using System.Runtime.InteropServices; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/07.Game/Taiko/PuchiChara.cs b/TJAPlayer3/Stages/07.Game/Taiko/PuchiChara.cs index 7b706a55..9b65a710 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/PuchiChara.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/PuchiChara.cs @@ -5,6 +5,9 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Text; +using SharpDX; + +using Rectangle = System.Drawing.Rectangle; namespace TJAPlayer3 { @@ -75,7 +78,7 @@ namespace TJAPlayer3 // TJAPlayer3.act文字コンソール.tPrint(700, 580, C文字コンソール.Eフォント種別.白, sineY.ToString()); - TJAPlayer3.Tx.PuchiChara.vc拡大縮小倍率 = new SlimDX.Vector3((isBalloon ? TJAPlayer3.Skin.Game_PuchiChara_Scale[1] : TJAPlayer3.Skin.Game_PuchiChara_Scale[0])); + TJAPlayer3.Tx.PuchiChara.vc拡大縮小倍率 = new Vector3((isBalloon ? TJAPlayer3.Skin.Game_PuchiChara_Scale[1] : TJAPlayer3.Skin.Game_PuchiChara_Scale[0])); TJAPlayer3.Tx.PuchiChara.Opacity = alpha; // (isGrowing ? TJAPlayer3.Skin.Game_PuchiChara[1] : 0) => Height diff --git a/TJAPlayer3/Stages/07.Game/Taiko/Rainbow.cs b/TJAPlayer3/Stages/07.Game/Taiko/Rainbow.cs index 60c0da4f..c8bc2e50 100644 --- a/TJAPlayer3/Stages/07.Game/Taiko/Rainbow.cs +++ b/TJAPlayer3/Stages/07.Game/Taiko/Rainbow.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Text; using System.Drawing; using System.Runtime.InteropServices; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/08.Result/CActResultImage.cs b/TJAPlayer3/Stages/08.Result/CActResultImage.cs index 422abe4b..e55d4e1b 100644 --- a/TJAPlayer3/Stages/08.Result/CActResultImage.cs +++ b/TJAPlayer3/Stages/08.Result/CActResultImage.cs @@ -4,8 +4,6 @@ using System.Text; using System.Diagnostics; using System.IO; using System.Drawing; -using SlimDX; -using SlimDX.Direct3D9; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/08.Result/CActResultParameterPanel.cs b/TJAPlayer3/Stages/08.Result/CActResultParameterPanel.cs index 4cee2e33..6cc02c72 100644 --- a/TJAPlayer3/Stages/08.Result/CActResultParameterPanel.cs +++ b/TJAPlayer3/Stages/08.Result/CActResultParameterPanel.cs @@ -4,7 +4,6 @@ using System.Text; using System.Runtime.InteropServices; using System.Drawing; using System.IO; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/08.Result/CActResultRank.cs b/TJAPlayer3/Stages/08.Result/CActResultRank.cs index 45c94a7d..c7ef97e9 100644 --- a/TJAPlayer3/Stages/08.Result/CActResultRank.cs +++ b/TJAPlayer3/Stages/08.Result/CActResultRank.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Text; using System.Drawing; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/08.Result/CActResultSongBar.cs b/TJAPlayer3/Stages/08.Result/CActResultSongBar.cs index 75f183bd..eef37b52 100644 --- a/TJAPlayer3/Stages/08.Result/CActResultSongBar.cs +++ b/TJAPlayer3/Stages/08.Result/CActResultSongBar.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Text; using System.Drawing; using System.Diagnostics; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/08.Result/CStage結果.cs b/TJAPlayer3/Stages/08.Result/CStage結果.cs index ec3a93c2..6fcfd15b 100644 --- a/TJAPlayer3/Stages/08.Result/CStage結果.cs +++ b/TJAPlayer3/Stages/08.Result/CStage結果.cs @@ -5,7 +5,6 @@ using FDK; using System.Linq; using System.Drawing; using System.Collections.Generic; -using SlimDX.DirectInput; using static TJAPlayer3.CActSelect曲リスト; namespace TJAPlayer3 @@ -1456,9 +1455,9 @@ namespace TJAPlayer3 #endregion } - if (TJAPlayer3.Input管理.Keyboard.bキーが押されている((int)Key.LeftArrow) || + if (TJAPlayer3.Input管理.Keyboard.bキーが押されている((int)SlimDXKeys.Key.LeftArrow) || TJAPlayer3.Pad.b押された(E楽器パート.DRUMS, Eパッド.LBlue) || - TJAPlayer3.Input管理.Keyboard.bキーが押されている((int)Key.RightArrow) || + TJAPlayer3.Input管理.Keyboard.bキーが押されている((int)SlimDXKeys.Key.RightArrow) || TJAPlayer3.Pad.b押された(E楽器パート.DRUMS, Eパッド.RBlue)) { if (TJAPlayer3.stage選曲.n確定された曲の難易度[0] == (int)Difficulty.Dan) diff --git a/TJAPlayer3/Stages/09.Ending/CStage終了.cs b/TJAPlayer3/Stages/09.Ending/CStage終了.cs index 4667b381..ed56a326 100644 --- a/TJAPlayer3/Stages/09.Ending/CStage終了.cs +++ b/TJAPlayer3/Stages/09.Ending/CStage終了.cs @@ -2,8 +2,6 @@ using System.Collections.Generic; using System.Text; using System.Diagnostics; -using DirectShowLib; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/11.Heya/CStageHeya.cs b/TJAPlayer3/Stages/11.Heya/CStageHeya.cs index e3af82da..a1aaade5 100644 --- a/TJAPlayer3/Stages/11.Heya/CStageHeya.cs +++ b/TJAPlayer3/Stages/11.Heya/CStageHeya.cs @@ -5,9 +5,13 @@ using System.Text; using System.Threading.Tasks; using System.Drawing; using FDK; -using SlimDX.DirectInput; +using SharpDX; using static TJAPlayer3.CActSelectȃXg; +using Rectangle = System.Drawing.Rectangle; +using RectangleF = System.Drawing.RectangleF; +using Color = System.Drawing.Color; + namespace TJAPlayer3 { class CStageHeya : CStage @@ -186,13 +190,13 @@ namespace TJAPlayer3 if (iCurrentMenu != -1 || iMainMenuCurrent != i) { - tmpTex.color4 = Color.DarkGray; - TJAPlayer3.Tx.Heya_Side_Menu.color4 = Color.DarkGray; + tmpTex.color4 = Cϊ.ColorToColor4(Color.DarkGray); + TJAPlayer3.Tx.Heya_Side_Menu.color4 = Cϊ.ColorToColor4(Color.DarkGray); } else { - tmpTex.color4 = Color.White; - TJAPlayer3.Tx.Heya_Side_Menu.color4 = Color.White; + tmpTex.color4 = Cϊ.ColorToColor4(Color.White); + TJAPlayer3.Tx.Heya_Side_Menu.color4 = Cϊ.ColorToColor4(Color.White); } TJAPlayer3.Tx.Heya_Side_Menu.t2Dg嗦l㒆`(TJAPlayer3.app.Device, 164, 26 + 80 * i); @@ -211,13 +215,13 @@ namespace TJAPlayer3 if (i != 0) { - TJAPlayer3.Tx.PuchiChara.color4 = Color.DarkGray; - TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot.color4 = Color.DarkGray; + TJAPlayer3.Tx.PuchiChara.color4 = Cϊ.ColorToColor4(Color.DarkGray); + TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot.color4 = Cϊ.ColorToColor4(Color.DarkGray); } else { - TJAPlayer3.Tx.PuchiChara.color4 = Color.White; - TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot.color4 = Color.White; + TJAPlayer3.Tx.PuchiChara.color4 = Cϊ.ColorToColor4(Color.White); + TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot.color4 = Cϊ.ColorToColor4(Color.White); } TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot.t2Dg嗦l㒆`(TJAPlayer3.app.Device, 620 + 302 * i, 200); @@ -231,7 +235,7 @@ namespace TJAPlayer3 TJAPlayer3.Skin.Game_PuchiChara[0], TJAPlayer3.Skin.Game_PuchiChara[1])); - TJAPlayer3.Tx.PuchiChara.color4 = Color.White; + TJAPlayer3.Tx.PuchiChara.color4 = Cϊ.ColorToColor4(Color.White); if (ttkPuchiCharaNames[pos] != null) { @@ -263,14 +267,14 @@ namespace TJAPlayer3 if (i != 0) { if (TJAPlayer3.Tx.Characters_Heya_Preview[pos] != null) - TJAPlayer3.Tx.Characters_Heya_Preview[pos].color4 = Color.DarkGray; - TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot.color4 = Color.DarkGray; + TJAPlayer3.Tx.Characters_Heya_Preview[pos].color4 = Cϊ.ColorToColor4(Color.DarkGray); + TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot.color4 = Cϊ.ColorToColor4(Color.DarkGray); } else { if (TJAPlayer3.Tx.Characters_Heya_Preview[pos] != null) - TJAPlayer3.Tx.Characters_Heya_Preview[pos].color4 = Color.White; - TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot.color4 = Color.White; + TJAPlayer3.Tx.Characters_Heya_Preview[pos].color4 = Cϊ.ColorToColor4(Color.White); + TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot.color4 = Cϊ.ColorToColor4(Color.White); } TJAPlayer3.Tx.Heya_Center_Menu_Box_Slot.t2Dg嗦l㒆`(TJAPlayer3.app.Device, 620 + 302 * i, 200); @@ -278,7 +282,7 @@ namespace TJAPlayer3 TJAPlayer3.Tx.Characters_Heya_Preview[pos]?.t2Dg嗦l`(TJAPlayer3.app.Device, 620 + 302 * i, 320); if (TJAPlayer3.Tx.Characters_Heya_Preview[pos] != null) - TJAPlayer3.Tx.Characters_Heya_Preview[pos].color4 = Color.White; + TJAPlayer3.Tx.Characters_Heya_Preview[pos].color4 = Cϊ.ColorToColor4(Color.White); } } @@ -296,15 +300,15 @@ namespace TJAPlayer3 if (i != 0) { - tmpTex.color4 = Color.DarkGray; - TJAPlayer3.Tx.Heya_Side_Menu.color4 = Color.DarkGray; - TJAPlayer3.Tx.NamePlateBase.color4 = Color.DarkGray; + tmpTex.color4 = Cϊ.ColorToColor4(Color.DarkGray); + TJAPlayer3.Tx.Heya_Side_Menu.color4 = Cϊ.ColorToColor4(Color.DarkGray); + TJAPlayer3.Tx.NamePlateBase.color4 = Cϊ.ColorToColor4(Color.DarkGray); } else { - tmpTex.color4 = Color.White; - TJAPlayer3.Tx.Heya_Side_Menu.color4 = Color.White; - TJAPlayer3.Tx.NamePlateBase.color4 = Color.White; + tmpTex.color4 = Cϊ.ColorToColor4(Color.White); + TJAPlayer3.Tx.Heya_Side_Menu.color4 = Cϊ.ColorToColor4(Color.White); + TJAPlayer3.Tx.NamePlateBase.color4 = Cϊ.ColorToColor4(Color.White); } int danGrade = 0; @@ -319,7 +323,7 @@ namespace TJAPlayer3 718 + -10 * Math.Abs(i), 331 + 70 * i, new RectangleF(0, (8 + danGrade) * 54, 220, 54)); - TJAPlayer3.Tx.NamePlateBase.color4 = Color.White; + TJAPlayer3.Tx.NamePlateBase.color4 = Cϊ.ColorToColor4(Color.White); tmpTex.t2Dg嗦l㒆`(TJAPlayer3.app.Device, 730 + -10 * Math.Abs(i), 354 + 70 * i); @@ -341,13 +345,13 @@ namespace TJAPlayer3 if (i != 0) { - tmpTex.color4 = Color.DarkGray; - TJAPlayer3.Tx.Heya_Side_Menu.color4 = Color.DarkGray; + tmpTex.color4 = Cϊ.ColorToColor4(Color.DarkGray); + TJAPlayer3.Tx.Heya_Side_Menu.color4 = Cϊ.ColorToColor4(Color.DarkGray); } else { - tmpTex.color4 = Color.White; - TJAPlayer3.Tx.Heya_Side_Menu.color4 = Color.White; + tmpTex.color4 = Cϊ.ColorToColor4(Color.White); + TJAPlayer3.Tx.Heya_Side_Menu.color4 = Cϊ.ColorToColor4(Color.White); } TJAPlayer3.Tx.Heya_Side_Menu.t2Dg嗦l㒆`(TJAPlayer3.app.Device, 730 + -10 * Math.Abs(i), 340 + 70 * i); @@ -412,7 +416,7 @@ namespace TJAPlayer3 #region [ L[֘A ] - if (TJAPlayer3.InputǗ.Keyboard.bL[ꂽ((int)Key.RightArrow) || + if (TJAPlayer3.InputǗ.Keyboard.bL[ꂽ((int)SlimDXKeys.Key.RightArrow) || TJAPlayer3.Pad.bꂽ(Eyp[g.DRUMS, Epbh.RBlue)) { if (this.tMove(1)) @@ -421,7 +425,7 @@ namespace TJAPlayer3 } } - else if (TJAPlayer3.InputǗ.Keyboard.bL[ꂽ((int)Key.LeftArrow) || + else if (TJAPlayer3.InputǗ.Keyboard.bL[ꂽ((int)SlimDXKeys.Key.LeftArrow) || TJAPlayer3.Pad.bꂽ(Eyp[g.DRUMS, Epbh.LBlue)) { if (this.tMove(-1)) @@ -430,7 +434,7 @@ namespace TJAPlayer3 } } - else if (TJAPlayer3.InputǗ.Keyboard.bL[ꂽ((int)Key.Return) || + else if (TJAPlayer3.InputǗ.Keyboard.bL[ꂽ((int)SlimDXKeys.Key.Return) || TJAPlayer3.Pad.bꂽ(Eyp[g.DRUMS, Epbh.LRed) || TJAPlayer3.Pad.bꂽ(Eyp[g.DRUMS, Epbh.RRed)) { @@ -543,7 +547,7 @@ namespace TJAPlayer3 #endregion } - else if (TJAPlayer3.InputǗ.Keyboard.bL[ꂽ((int)Key.Escape)) + else if (TJAPlayer3.InputǗ.Keyboard.bL[ꂽ((int)SlimDXKeys.Key.Escape)) { TJAPlayer3.Skin.sound.tĐ(); diff --git a/TJAPlayer3/Stages/CActDFPFont.cs b/TJAPlayer3/Stages/CActDFPFont.cs index 08167722..365d88cc 100644 --- a/TJAPlayer3/Stages/CActDFPFont.cs +++ b/TJAPlayer3/Stages/CActDFPFont.cs @@ -3,9 +3,11 @@ using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Drawing; -using SlimDX; +using SharpDX; using FDK; +using Rectangle = System.Drawing.Rectangle; + namespace TJAPlayer3 { internal class CActDFPFont : CActivity diff --git a/TJAPlayer3/Stages/CActLVLNFont.cs b/TJAPlayer3/Stages/CActLVLNFont.cs index 33af9ff6..f7226ed7 100644 --- a/TJAPlayer3/Stages/CActLVLNFont.cs +++ b/TJAPlayer3/Stages/CActLVLNFont.cs @@ -4,7 +4,6 @@ using System.Text; using System.Runtime.InteropServices; using System.Drawing; using System.Diagnostics; -using SlimDX; using FDK; namespace TJAPlayer3 diff --git a/TJAPlayer3/Stages/CActオプションパネル.cs b/TJAPlayer3/Stages/CActオプションパネル.cs index eb0ec0a2..7f633256 100644 --- a/TJAPlayer3/Stages/CActオプションパネル.cs +++ b/TJAPlayer3/Stages/CActオプションパネル.cs @@ -2,10 +2,8 @@ using System.Collections.Generic; using System.Text; using System.Drawing; -using SlimDX.Direct3D9; using FDK; - -using Device = SampleFramework.DeviceCache; +using SharpDX.Direct3D9; namespace TJAPlayer3 { diff --git a/TJAPlayer3/TJAPlayer3.csproj b/TJAPlayer3/TJAPlayer3.csproj index df3c0ab7..931e8345 100644 --- a/TJAPlayer3/TJAPlayer3.csproj +++ b/TJAPlayer3/TJAPlayer3.csproj @@ -367,6 +367,9 @@ 4.2.0 + + 4.2.0 + 4.5.0 diff --git a/Test/Licenses/SlimDX/CodeLicense.txt b/Test/Licenses/SlimDX/CodeLicense.txt deleted file mode 100644 index 52863fa8..00000000 --- a/Test/Licenses/SlimDX/CodeLicense.txt +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2007-2010 SlimDX Group - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/Test/Licenses/SlimDX/MediaLicense.txt b/Test/Licenses/SlimDX/MediaLicense.txt deleted file mode 100644 index cf0aa70c..00000000 --- a/Test/Licenses/SlimDX/MediaLicense.txt +++ /dev/null @@ -1,20 +0,0 @@ -All of the SlimDX media is covered by the Creative Commons Attribution-Share Alike 3.0 License: -http://creativecommons.org/licenses/by-sa/3.0/us/ - -You are free: -* To Share to copy, distribute, display, and perform the work -* To Remix to make derivative works - -Under the following conditions: -* Attribution - You must attribute the work in the manner specified by the author or -licensor (but not in any way that suggests that they endorse you or your use of the work). -* Share Alike - If you alter, transform, or build upon this work, you may distribute -the resulting work only under the same, similar or a compatible license. - -For any reuse or distribution, you must make clear to others the license terms of this work. -The best way to do this is with a link to the above web page. - -Any of the above conditions can be waived if you get permission from the copyright holder. - -Apart from the remix rights granted under this license, nothing in this license impairs or -restricts the author's moral rights. \ No newline at end of file