--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>\r
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
+ <PropertyGroup>\r
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>\r
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>\r
+ <ProductVersion>9.0.30729</ProductVersion>\r
+ <SchemaVersion>2.0</SchemaVersion>\r
+ <ProjectGuid>{BCD40908-F3E2-4707-BFAA-1DD99DF6357D}</ProjectGuid>\r
+ <OutputType>Library</OutputType>\r
+ <AppDesignerFolder>Properties</AppDesignerFolder>\r
+ <RootNamespace>FDK</RootNamespace>\r
+ <AssemblyName>FDK</AssemblyName>\r
+ <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>\r
+ <FileAlignment>512</FileAlignment>\r
+ <TargetFrameworkSubset>\r
+ </TargetFrameworkSubset>\r
+ <SignAssembly>false</SignAssembly>\r
+ <AssemblyOriginatorKeyFile>\r
+ </AssemblyOriginatorKeyFile>\r
+ <ApplicationIcon>\r
+ </ApplicationIcon>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">\r
+ <PlatformTarget>x86</PlatformTarget>\r
+ <OutputPath>bin\x86\Debug\</OutputPath>\r
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
+ <DocumentationFile>\r
+ </DocumentationFile>\r
+ <UseVSHostingProcess>false</UseVSHostingProcess>\r
+ <NoWarn>0219</NoWarn>\r
+ <DefineConstants>TRACE;DEBUG;TEST_Direct3D9Ex TEST_CancelEnterCodeInAltEnter2</DefineConstants>\r
+ </PropertyGroup>\r
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">\r
+ <PlatformTarget>x86</PlatformTarget>\r
+ <OutputPath>bin\x86\Release\</OutputPath>\r
+ <AllowUnsafeBlocks>true</AllowUnsafeBlocks>\r
+ <DocumentationFile>\r
+ </DocumentationFile>\r
+ <UseVSHostingProcess>false</UseVSHostingProcess>\r
+ <NoWarn>0219</NoWarn>\r
+ </PropertyGroup>\r
+ <ItemGroup>\r
+ <Reference Include="SlimDXc_net20x86_Jun2010, Version=1002.0.10.43, Culture=neutral, PublicKeyToken=53d0e4ef1f1579f5, processorArchitecture=x86">\r
+ <SpecificVersion>False</SpecificVersion>\r
+ <HintPath>..\SlimDXc_Jun2010(VC++2008)\build\x86\Public\SlimDXc_net20x86_Jun2010.dll</HintPath>\r
+ </Reference>\r
+ <Reference Include="System" />\r
+ <Reference Include="System.Data" />\r
+ <Reference Include="System.Drawing" />\r
+ <Reference Include="System.Windows.Forms" />\r
+ <Reference Include="System.Xml" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <Compile Include="コード\01.フレームワーク\Core\Game.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Core\GameClock.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Core\GameTime.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Core\GameWindow.cs">\r
+ <SubType>Form</SubType>\r
+ </Compile>\r
+ <Compile Include="コード\01.フレームワーク\DeviceSettings\ConversionMethods.cs" />\r
+ <Compile Include="コード\01.フレームワーク\DeviceSettings\DeviceSettings.cs" />\r
+ <Compile Include="コード\01.フレームワーク\DeviceSettings\Direct3D9Settings.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Enumeration\Enumeration9.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Properties\Resources.Designer.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Rendering\DeviceCreationException.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Rendering\Direct3D9Manager.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Rendering\Enums.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Rendering\GraphicsDeviceManager.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Rendering\NoCompatibleDevicesException.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Rendering\VertexElementAttribute.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Utilities\Camera.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Utilities\TransformedColoredTexturedVertex.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Utilities\TransformedColoredVertex.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Win32\NativeMethods.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Win32\NativeStructures.cs" />\r
+ <Compile Include="コード\01.フレームワーク\Win32\WindowConstants.cs" />\r
+ <Compile Include="コード\02.入力\CInputJoystick.cs" />\r
+ <Compile Include="コード\02.入力\CInputKeyboard.cs" />\r
+ <Compile Include="コード\02.入力\CInputMIDI.cs" />\r
+ <Compile Include="コード\02.入力\CInputMouse.cs" />\r
+ <Compile Include="コード\02.入力\CInput管理.cs" />\r
+ <Compile Include="コード\02.入力\DeviceConstantConverter.cs" />\r
+ <Compile Include="コード\02.入力\E入力デバイス種別.cs" />\r
+ <Compile Include="コード\02.入力\IInputDevice.cs" />\r
+ <Compile Include="コード\02.入力\STInputEvent.cs" />\r
+ <Compile Include="コード\03.サウンド\CSound.cs" />\r
+ <Compile Include="コード\03.サウンド\CSoundMp3.cs" />\r
+ <Compile Include="コード\03.サウンド\CSoundOggVorbis.cs" />\r
+ <Compile Include="コード\03.サウンド\CSoundRiffWave.cs" />\r
+ <Compile Include="コード\03.サウンド\CSoundXA.cs" />\r
+ <Compile Include="コード\03.サウンド\CSound管理.cs" />\r
+ <Compile Include="コード\04.グラフィック\BitmapUtil.cs" />\r
+ <Compile Include="コード\04.グラフィック\CAero.cs" />\r
+ <Compile Include="コード\04.グラフィック\CAvi.cs" />\r
+ <Compile Include="コード\04.グラフィック\頂点フォーマット%28Vertex%29\ColoredVertex.cs" />\r
+ <Compile Include="コード\04.グラフィック\CTexture.cs" />\r
+ <Compile Include="コード\04.グラフィック\CTextureCreateFailedException.cs" />\r
+ <Compile Include="コード\04.グラフィック\頂点フォーマット%28Vertex%29\PositionColoredTexturedVertex.cs" />\r
+ <Compile Include="コード\04.グラフィック\頂点フォーマット%28Vertex%29\TexturedVertex.cs" />\r
+ <Compile Include="コード\04.グラフィック\頂点フォーマット%28Vertex%29\TransformedColoredTexturedVertex.cs" />\r
+ <Compile Include="コード\04.グラフィック\頂点フォーマット%28Vertex%29\TransformedColoredVertex.cs" />\r
+ <Compile Include="Properties\AssemblyInfo.cs" />\r
+ <Compile Include="コード\00.共通\CActivity.cs" />\r
+ <Compile Include="コード\00.共通\CCounter.cs" />\r
+ <Compile Include="コード\00.共通\CFPS.cs" />\r
+ <Compile Include="コード\00.共通\CIniFile.cs" />\r
+ <Compile Include="コード\00.共通\CTimer.cs" />\r
+ <Compile Include="コード\00.共通\CTraceLogListener.cs" />\r
+ <Compile Include="コード\00.共通\CWin32.cs" />\r
+ <Compile Include="コード\00.共通\C変換.cs" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <EmbeddedResource Include="コード\01.フレームワーク\Properties\Resources.resx" />\r
+ </ItemGroup>\r
+ <ItemGroup>\r
+ <Content Include="コード\01.フレームワーク\Resources\sdx_icon_black.ico" />\r
+ </ItemGroup>\r
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />\r
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it. \r
+ Other similar extension points exist, see Microsoft.Common.targets.\r
+ <Target Name="BeforeBuild">\r
+ </Target>\r
+ <Target Name="AfterBuild">\r
+ </Target>\r
+ -->\r
+ <PropertyGroup>\r
+ <PostBuildEvent>copy /Y "$(TargetPath)" "$(SolutionDir)..\実行時フォルダ"\r
+copy /Y "$(TargetPath)" "$(SolutionDir)..\実行時フォルダ(DTXCreator)"</PostBuildEvent>\r
+ </PropertyGroup>\r
+</Project>
\ No newline at end of file
{\r
bitmap.Save( stream, ImageFormat.Bmp );\r
stream.Seek( 0L, SeekOrigin.Begin );\r
- int colorKey = 0;\r
- colorKey = -16777216;\r
-#if TEST_Direct3D9Ex\r
- this.texture = Texture.FromStream( device, stream, this.szテクスチャサイズ.Width, this.szテクスチャサイズ.Height, 1, Usage.None, format, Pool.Default, Filter.Point, Filter.None, colorKey );\r
-#else\r
- this.texture = Texture.FromStream( device, stream, this.szテクスチャサイズ.Width, this.szテクスチャサイズ.Height, 1, Usage.None, format, Pool.Managed, Filter.Point, Filter.None, colorKey );\r
-#endif\r
+ unchecked\r
+ {\r
+ int colorKey = (int) 0xFF000000; // -16777216;\r
+ this.texture = Texture.FromStream( device, stream, this.szテクスチャサイズ.Width, this.szテクスチャサイズ.Height, 1, Usage.None, format, poolvar, Filter.Point, Filter.None, colorKey );\r
+ }\r
}\r
this.t頂点バッファの作成( device );\r
}\r
/// <param name="pool">テクスチャの管理方法。</param>\r
/// <exception cref="CTextureCreateFailedException">テクスチャの作成に失敗しました。</exception>\r
public CTexture( Device device, int n幅, int n高さ, Format format, Pool pool )\r
+ : this( device, n幅, n高さ, format, pool, Usage.None )\r
+ {\r
+ }\r
+ public CTexture( Device device, int n幅, int n高さ, Format format, Pool pool, Usage usage )\r
: this()\r
{\r
try\r
{\r
this.sz画像サイズ = new Size( n幅, n高さ );\r
this.szテクスチャサイズ = this.t指定されたサイズを超えない最適なテクスチャサイズを返す( device, this.sz画像サイズ );\r
- using( Bitmap bitmap = new Bitmap( 1, 1 ) )\r
+ using ( Bitmap bitmap = new Bitmap( 1, 1 ) )\r
{\r
- using( Graphics graphics = Graphics.FromImage( bitmap ) )\r
+ using ( Graphics graphics = Graphics.FromImage( bitmap ) )\r
{\r
graphics.FillRectangle( Brushes.Black, 0, 0, 1, 1 );\r
}\r
- using( MemoryStream stream = new MemoryStream() )\r
+ using ( MemoryStream stream = new MemoryStream() )\r
{\r
bitmap.Save( stream, ImageFormat.Bmp );\r
stream.Seek( 0L, SeekOrigin.Begin );\r
#if TEST_Direct3D9Ex\r
- this.texture = Texture.FromStream( device, stream, n幅, n高さ, 1, Usage.None, format, Pool.Default, Filter.Point, Filter.None, 0 );\r
-#else\r
- this.texture = Texture.FromStream( device, stream, n幅, n高さ, 1, Usage.None, format, pool, Filter.Point, Filter.None, 0 );\r
+ pool = poolvar;\r
#endif\r
+ // 中で更にメモリ読み込みし直していて無駄なので、Streamを使うのは止めたいところ\r
+ this.texture = Texture.FromStream( device, stream, n幅, n高さ, 1, usage, format, pool, Filter.Point, Filter.None, 0 );\r
}\r
}\r
this.t頂点バッファの作成( device );\r
this.sz画像サイズ = new Size( information.Width, information.Height );\r
this.szテクスチャサイズ = this.t指定されたサイズを超えない最適なテクスチャサイズを返す( device, this.sz画像サイズ );\r
#if TEST_Direct3D9Ex\r
- this.texture = Texture.FromFile( device, strファイル名, this.sz画像サイズ.Width, this.sz画像サイズ.Height, 1, Usage.None, format, Pool.Default, Filter.Point, Filter.None, b黒を透過する ? -16777216 : 0 );\r
-#else\r
- this.texture = Texture.FromFile( device, strファイル名, this.sz画像サイズ.Width, this.sz画像サイズ.Height, 1, Usage.None, format, pool, Filter.Point, Filter.None, b黒を透過する ? -16777216 : 0 );\r
+ pool = poolvar;\r
#endif\r
+ this.texture = Texture.FromFile( device, strファイル名, this.sz画像サイズ.Width, this.sz画像サイズ.Height, 1, Usage.None, format, pool, Filter.Point, Filter.None, b黒を透過する ? -16777216 : 0 );\r
this.t頂点バッファの作成( device );\r
}\r
catch\r
float num6 = ( (float) rc画像内の描画領域.Right ) / ( (float) this.szテクスチャサイズ.Width );\r
float num7 = ( (float) rc画像内の描画領域.Top ) / ( (float) this.szテクスチャサイズ.Height );\r
float num8 = ( (float) rc画像内の描画領域.Bottom ) / ( (float) this.szテクスチャサイズ.Height );\r
- int num9 = new Color4( ( (float) this._透明度 ) / 255f, 1f, 1f, 1f ).ToArgb();\r
+ int color4 = new Color4( ( (float) this._透明度 ) / 255f, 1f, 1f, 1f ).ToArgb();\r
if( this.cvTransformedColoredVertexies == null )\r
{\r
this.cvTransformedColoredVertexies = new TransformedColoredTexturedVertex[ 4 ];\r
}\r
this.cvTransformedColoredVertexies[ 0 ].Position = new Vector4( x + num, y + num2, depth, 1f );\r
- this.cvTransformedColoredVertexies[ 0 ].Color = num9;\r
+ this.cvTransformedColoredVertexies[ 0 ].Color = color4;\r
this.cvTransformedColoredVertexies[ 0 ].TextureCoordinates = new Vector2( num5, num7 );\r
this.cvTransformedColoredVertexies[ 1 ].Position = new Vector4( ( x + ( width * this.vc拡大縮小倍率.X ) ) + num, y + num2, depth, 1f );\r
- this.cvTransformedColoredVertexies[ 1 ].Color = num9;\r
+ this.cvTransformedColoredVertexies[ 1 ].Color = color4;\r
this.cvTransformedColoredVertexies[ 1 ].TextureCoordinates = new Vector2( num6, num7 );\r
this.cvTransformedColoredVertexies[ 2 ].Position = new Vector4( x + num, ( y + ( height * this.vc拡大縮小倍率.Y ) ) + num2, depth, 1f );\r
- this.cvTransformedColoredVertexies[ 2 ].Color = num9;\r
+ this.cvTransformedColoredVertexies[ 2 ].Color = color4;\r
this.cvTransformedColoredVertexies[ 2 ].TextureCoordinates = new Vector2( num5, num8 );\r
this.cvTransformedColoredVertexies[ 3 ].Position = new Vector4( ( x + ( width * this.vc拡大縮小倍率.X ) ) + num, ( y + ( height * this.vc拡大縮小倍率.Y ) ) + num2, depth, 1f );\r
- this.cvTransformedColoredVertexies[ 3 ].Color = num9;\r
+ this.cvTransformedColoredVertexies[ 3 ].Color = color4;\r
this.cvTransformedColoredVertexies[ 3 ].TextureCoordinates = new Vector2( num6, num8 );\r
device.SetTexture( 0, this.texture );\r
device.VertexFormat = TransformedColoredTexturedVertex.Format;\r
float num15 = ( (float) rc画像内の描画領域.Right ) / ( (float) this.szテクスチャサイズ.Width );\r
float num16 = ( (float) rc画像内の描画領域.Top ) / ( (float) this.szテクスチャサイズ.Height );\r
float num17 = ( (float) rc画像内の描画領域.Bottom ) / ( (float) this.szテクスチャサイズ.Height );\r
- int num18 = new Color4( ( (float) this._透明度 ) / 255f, 1f, 1f, 1f ).ToArgb();\r
+ int color4 = new Color4( ( (float) this._透明度 ) / 255f, 1f, 1f, 1f ).ToArgb();\r
if( this.cvPositionColoredVertexies == null )\r
{\r
this.cvPositionColoredVertexies = new PositionColoredTexturedVertex[ 4 ];\r
}\r
this.cvPositionColoredVertexies[ 0 ].Position = new Vector3( -num12 + num10, num13 + num11, depth );\r
- this.cvPositionColoredVertexies[ 0 ].Color = num18;\r
+ this.cvPositionColoredVertexies[ 0 ].Color = color4;\r
this.cvPositionColoredVertexies[ 0 ].TextureCoordinates = new Vector2( num14, num16 );\r
this.cvPositionColoredVertexies[ 1 ].Position = new Vector3( num12 + num10, num13 + num11, depth );\r
- this.cvPositionColoredVertexies[ 1 ].Color = num18;\r
+ this.cvPositionColoredVertexies[ 1 ].Color = color4;\r
this.cvPositionColoredVertexies[ 1 ].TextureCoordinates = new Vector2( num15, num16 );\r
this.cvPositionColoredVertexies[ 2 ].Position = new Vector3( -num12 + num10, -num13 + num11, depth );\r
- this.cvPositionColoredVertexies[ 2 ].Color = num18;\r
+ this.cvPositionColoredVertexies[ 2 ].Color = color4;\r
this.cvPositionColoredVertexies[ 2 ].TextureCoordinates = new Vector2( num14, num17 );\r
this.cvPositionColoredVertexies[ 3 ].Position = new Vector3( num12 + num10, -num13 + num11, depth );\r
- this.cvPositionColoredVertexies[ 3 ].Color = num18;\r
+ this.cvPositionColoredVertexies[ 3 ].Color = color4;\r
this.cvPositionColoredVertexies[ 3 ].TextureCoordinates = new Vector2( num15, num17 );\r
- using( DataStream stream = this.vbPositionColoredVertexBuffer.Lock( 0, 0, LockFlags.None ) )\r
+ using( DataStream stream = this.vbPositionColoredVertexBuffer.Lock( 0, 0, LockFlags.NoOverwrite ) ) // LockFlags.None\r
{\r
stream.WriteRange<PositionColoredTexturedVertex>( this.cvPositionColoredVertexies );\r
this.vbPositionColoredVertexBuffer.Unlock();\r
float num4 = ( (float) rc画像内の描画領域.Right ) / ( (float) this.szテクスチャサイズ.Width );\r
float num5 = ( (float) rc画像内の描画領域.Top ) / ( (float) this.szテクスチャサイズ.Height );\r
float num6 = ( (float) rc画像内の描画領域.Bottom ) / ( (float) this.szテクスチャサイズ.Height );\r
- int num7 = new Color4( ( (float) this._透明度 ) / 255f, 1f, 1f, 1f ).ToArgb();\r
+ int color4 = new Color4( ( (float) this._透明度 ) / 255f, 1f, 1f, 1f ).ToArgb();\r
if( this.cvPositionColoredVertexies == null )\r
{\r
this.cvPositionColoredVertexies = new PositionColoredTexturedVertex[ 4 ];\r
}\r
float z = 0f;\r
this.cvPositionColoredVertexies[ 0 ].Position = new Vector3( -x, y, z );\r
- this.cvPositionColoredVertexies[ 0 ].Color = num7;\r
+ this.cvPositionColoredVertexies[ 0 ].Color = color4;\r
this.cvPositionColoredVertexies[ 0 ].TextureCoordinates = new Vector2( num3, num5 );\r
this.cvPositionColoredVertexies[ 1 ].Position = new Vector3( x, y, z );\r
- this.cvPositionColoredVertexies[ 1 ].Color = num7;\r
+ this.cvPositionColoredVertexies[ 1 ].Color = color4;\r
this.cvPositionColoredVertexies[ 1 ].TextureCoordinates = new Vector2( num4, num5 );\r
this.cvPositionColoredVertexies[ 2 ].Position = new Vector3( -x, -y, z );\r
- this.cvPositionColoredVertexies[ 2 ].Color = num7;\r
+ this.cvPositionColoredVertexies[ 2 ].Color = color4;\r
this.cvPositionColoredVertexies[ 2 ].TextureCoordinates = new Vector2( num3, num6 );\r
this.cvPositionColoredVertexies[ 3 ].Position = new Vector3( x, -y, z );\r
- this.cvPositionColoredVertexies[ 3 ].Color = num7;\r
+ this.cvPositionColoredVertexies[ 3 ].Color = color4;\r
this.cvPositionColoredVertexies[ 3 ].TextureCoordinates = new Vector2( num4, num6 );\r
- using( DataStream stream = this.vbPositionColoredVertexBuffer.Lock( 0, 0, LockFlags.None ) )\r
+ using( DataStream stream = this.vbPositionColoredVertexBuffer.Lock( 0, 0, LockFlags.NoOverwrite ) ) // LockFlags.None\r
{\r
stream.WriteRange<PositionColoredTexturedVertex>( this.cvPositionColoredVertexies );\r
this.vbPositionColoredVertexBuffer.Unlock();\r
private PositionColoredTexturedVertex[] cvPositionColoredVertexies;\r
private TransformedColoredTexturedVertex[] cvTransformedColoredVertexies;\r
private VertexBuffer vbPositionColoredVertexBuffer;\r
+ private const Pool poolvar = // 2011.4.25 yyagi\r
+#if TEST_Direct3D9Ex\r
+ Pool.Default;\r
+#else\r
+ Pool.Managed;\r
+#endif\r
+\r
\r
private void tレンダリングステートの設定( Device device )\r
{\r
if( this.b加算合成 )\r
{\r
device.SetRenderState( RenderState.AlphaBlendEnable, true );\r
- device.SetRenderState( RenderState.SourceBlend, 5 );\r
- device.SetRenderState( RenderState.DestinationBlend, 2 );\r
+ device.SetRenderState( RenderState.SourceBlend, SlimDX.Direct3D9.Blend.SourceAlpha ); // 5\r
+ device.SetRenderState( RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.One ); // 2\r
}\r
else\r
{\r
device.SetRenderState( RenderState.AlphaBlendEnable, true );\r
- device.SetRenderState( RenderState.SourceBlend, 5 );\r
- device.SetRenderState( RenderState.DestinationBlend, 6 );\r
+ device.SetRenderState( RenderState.SourceBlend, SlimDX.Direct3D9.Blend.SourceAlpha ); // 5\r
+ device.SetRenderState( RenderState.DestinationBlend, SlimDX.Direct3D9.Blend.InverseSourceAlpha ); // 6\r
}\r
}\r
private Size t指定されたサイズを超えない最適なテクスチャサイズを返す( Device device, Size sz指定サイズ )\r
}\r
private void t頂点バッファの作成( Device device )\r
{\r
-#if TEST_Direct3D9Ex\r
- this.vbPositionColoredVertexBuffer = new VertexBuffer( device, 4 * PositionColoredTexturedVertex.SizeInBytes, Usage.WriteOnly, VertexFormat.None, Pool.Default );\r
-#else\r
- this.vbPositionColoredVertexBuffer = new VertexBuffer( device, 4 * PositionColoredTexturedVertex.SizeInBytes, Usage.WriteOnly, VertexFormat.None, Pool.Managed );\r
-#endif\r
+ this.vbPositionColoredVertexBuffer = new VertexBuffer( device, 4 * PositionColoredTexturedVertex.SizeInBytes, Usage.WriteOnly, VertexFormat.None, poolvar );\r
}\r
//-----------------\r
#endregion\r