OSDN Git Service

rev154(Direct3D9Ex対応)の続き。
authoryyagi <yyagi@16f42ceb-6dc6-49c8-ba94-f2d53467949d>
Mon, 25 Apr 2011 17:05:36 +0000 (17:05 +0000)
committeryyagi <yyagi@16f42ceb-6dc6-49c8-ba94-f2d53467949d>
Mon, 25 Apr 2011 17:05:36 +0000 (17:05 +0000)
DTXManiaプロジェクトとFDKプロジェクトの両方に対してマクロ TEST_Direct3D9Ex をつけてビルドすると、AeroOFFで起動しDirect3D9Exを使うようになる。
SetMaximumFrameLatency()でキューイングフレーム数を0にしたり、Texture描画時のLock条件を変更したりすることで、従来より描画性能向上、描画遅延減少。
なおまだ実験段階なので、このマクロつきでビルドすると、XPでの起動不可、フルスクリーンでの起動不可(ウインドウで起動してフルスクリーンに切り替えるのはOK)など、
数々の制限事項あり。

git-svn-id: http://svn.osdn.jp/svnroot/dtxmania/trunk@164 16f42ceb-6dc6-49c8-ba94-f2d53467949d

DTXManiaプロジェクト/DTXManiaプロジェクト.csproj
DTXManiaプロジェクト/コード/ステージ/07.演奏/CAct演奏AVI.cs
DTXManiaプロジェクト/コード/全体/Program.cs
FDK17プロジェクト/FDK19.csproj [new file with mode: 0644]
FDK17プロジェクト/コード/04.グラフィック/CAero.cs
FDK17プロジェクト/コード/04.グラフィック/CTexture.cs

index d755af2..db13b6e 100644 (file)
@@ -39,7 +39,7 @@
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">\r
     <DebugSymbols>true</DebugSymbols>\r
     <OutputPath>bin\x86\Debug\</OutputPath>\r
-    <DefineConstants>TRACE;DEBUG;_TEST_SHOWLAG TEST_ENGLISH_</DefineConstants>\r
+    <DefineConstants>TRACE;DEBUG;TEST_SHOWLAG_ TEST_ENGLISH_ TEST_Direct3D9Ex</DefineConstants>\r
     <DebugType>full</DebugType>\r
     <PlatformTarget>x86</PlatformTarget>\r
     <ErrorReport>prompt</ErrorReport>\r
index de48615..bf9f5c5 100644 (file)
@@ -271,7 +271,11 @@ namespace DTXMania
                {\r
                        if( !base.b活性化してない )\r
                        {\r
-                               this.tx描画用 = new CTexture( CDTXMania.app.Device, 0x116, 0x163, CDTXMania.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.Managed );\r
+#if TEST_Direct3D9Ex\r
+                               this.tx描画用 = new CTexture( CDTXMania.app.Device, 320, 355, CDTXMania.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.Default, Usage.Dynamic );\r
+#else\r
+                               this.tx描画用 = new CTexture( CDTXMania.app.Device, 278, 355, CDTXMania.app.GraphicsDeviceManager.CurrentSettings.BackBufferFormat, Pool.Managed );\r
+#endif\r
                                base.OnManagedリソースの作成();\r
                        }\r
                }\r
index 6e2651d..e264e81 100644 (file)
@@ -36,9 +36,6 @@ namespace DTXMania
 \r
                [DllImport( "kernel32", CharSet = CharSet.Unicode, SetLastError = true )]\r
                internal static extern IntPtr LoadLibrary( string lpFileName );\r
-\r
-//             [DllImport("dwmapi.dll", PreserveSig = false)]\r
-               //              public static extern int DwmEnableComposition(bool fEnable);\r
                #endregion\r
                //-----------------------------\r
                #endregion\r
@@ -81,7 +78,7 @@ namespace DTXMania
                                        Thread.CurrentThread.CurrentCulture = new CultureInfo( "en-US" );\r
 #endif\r
 \r
-                                       DWM.EnableComposition(false);\r
+                                       DWM.EnableComposition(false);   // Disable AeroGrass temporally\r
 \r
                                        // BEGIN #23670 2010.11.13 from: キャッチされない例外は放出せずに、ログに詳細を出力する。\r
                                        // BEGIM #24606 2011.03.08 from: DEBUG 時は例外発生箇所を直接デバッグできるようにするため、例外をキャッチしないようにする。\r
diff --git a/FDK17プロジェクト/FDK19.csproj b/FDK17プロジェクト/FDK19.csproj
new file mode 100644 (file)
index 0000000..24b3468
--- /dev/null
@@ -0,0 +1,130 @@
+<?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
index 959a15a..72b8ccc 100644 (file)
@@ -18,6 +18,8 @@ namespace FDK
 \r
                [DllImport( "dwmapi.dll", EntryPoint = "DwmEnableComposition" )]\r
                extern static uint DwmEnableComposition( uint compositionAction );\r
+//             [DllImport( "dwmapi.dll", EntryPoint = "DwmEnableMMCSS" )]\r
+//             extern static int DwmEnableMMCSS( bool fEnableMMCSS );\r
 \r
                /// <summary>  \r
                /// Enable/Disable DWM composition (aka Aero)  \r
@@ -26,6 +28,7 @@ namespace FDK
                /// <returns>True if the operation was successful.</returns>  \r
                public static bool EnableComposition( bool bIsAeroEnabled )\r
                {\r
+//                     DwmEnableMMCSS( true );\r
 #if TEST_Direct3D9Ex\r
                        try\r
                        {\r
index bccddd0..1761fbf 100644 (file)
@@ -100,13 +100,11 @@ namespace FDK
                                {\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
@@ -164,27 +162,31 @@ namespace FDK
                /// <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
@@ -218,10 +220,9 @@ namespace FDK
                                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
@@ -263,22 +264,22 @@ namespace FDK
                                        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
@@ -296,24 +297,24 @@ namespace FDK
                                        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
@@ -352,25 +353,25 @@ namespace FDK
                                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
@@ -419,20 +420,27 @@ namespace FDK
                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
@@ -484,11 +492,7 @@ namespace FDK
                }\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