OSDN Git Service

#24609 まずはランク更新or演奏型スキル更新の時に、dtxファイル名.yyMMddHHmmss_DRUMS_SS.png という形式でリザルト画像を当該DTXデータ...
authoryyagi <yyagi@16f42ceb-6dc6-49c8-ba94-f2d53467949d>
Tue, 22 Mar 2011 15:46:52 +0000 (15:46 +0000)
committeryyagi <yyagi@16f42ceb-6dc6-49c8-ba94-f2d53467949d>
Tue, 22 Mar 2011 15:46:52 +0000 (15:46 +0000)
git-svn-id: http://svn.osdn.jp/svnroot/dtxmania/trunk@139 16f42ceb-6dc6-49c8-ba94-f2d53467949d

DTXManiaプロジェクト/コード/ステージ/08.結果/CStage結果.cs

index 38fdf00..d2b3c73 100644 (file)
@@ -1,8 +1,10 @@
 using System;\r
 using System.Collections.Generic;\r
+using System.IO;\r
 using System.Text;\r
 using System.Diagnostics;\r
 using FDK;\r
+using SlimDX.Direct3D9;\r
 \r
 namespace DTXMania\r
 {\r
@@ -31,11 +33,9 @@ namespace DTXMania
 \r
                public CStage結果()\r
                {\r
-//                     STDGBVALUE<CScoreIni.C演奏記録> stdgbvalue = new STDGBVALUE<CScoreIni.C演奏記録>();\r
                        this.st演奏記録.Drums = new CScoreIni.C演奏記録();\r
                        this.st演奏記録.Guitar = new CScoreIni.C演奏記録();\r
                        this.st演奏記録.Bass = new CScoreIni.C演奏記録();\r
-//                     this.st演奏記録 = stdgbvalue;\r
                        this.r空うちドラムチップ = new CDTX.CChip[ 10 ];\r
                        this.n総合ランク値 = -1;\r
                        this.nチャンネル0Atoレーン07 = new int[] { 1, 2, 3, 4, 5, 7, 6, 1, 7, 0 };\r
@@ -64,6 +64,7 @@ namespace DTXMania
                                //---------------------\r
                                this.eフェードアウト完了時の戻り値 = E戻り値.継続;\r
                                this.bアニメが完了 = false;\r
+                               this.bIsCheckedWhetherResultScreenShouldSaveOrNot = false;                              // #24609 2011.3.14 yyagi\r
                                this.n最後に再生したHHのWAV番号 = -1;\r
                                this.n最後に再生したHHのチャンネル番号 = 0;\r
                                for( int i = 0; i < 3; i++ )\r
@@ -106,11 +107,6 @@ namespace DTXMania
                                                this.bオート[ i ] = bIsAutoPlay;     // #23596 10.11.16 add ikanick そのパートがオートなら1\r
                                                                                                                        //        10.11.17 change (int to bool) ikanick\r
                                                this.nランク値[ i ] = CScoreIni.tランク値を計算して返す( part );\r
-//Debug.WriteLine( "rank[" + i + "]=" + this.nランク値[ i ] );\r
-//if ( this.nランク値[ i ] != -1 )\r
-//{\r
-//     this.n総合ランク値 = Math.Min( this.n総合ランク値, this.nランク値[ i ] );\r
-//}\r
                                        }\r
                                }\r
                                this.n総合ランク値 = CScoreIni.t総合ランク値を計算して返す( this.st演奏記録.Drums, this.st演奏記録.Guitar, this.st演奏記録.Bass );\r
@@ -130,11 +126,13 @@ namespace DTXMania
                                        \r
                                        b今までにフルコンボしたことがある[ i ] = ini.stセクション[ i * 2 ].bフルコンボである | ini.stセクション[ i * 2 + 1 ].bフルコンボである;\r
 \r
+                                       #region [deleted by #24459]\r
                        //              if( this.nランク値[ i ] <= CScoreIni.tランク値を計算して返す( ini.stセクション[ ( i * 2 ) + 1 ] ) )\r
                        //              {\r
                        //                      this.b新記録ランク[ i ] = true;\r
-                       //              }\r
-                                       // 上記の条件だと[HiSkill.***]でのランクしかチェックしていないので、BestRankと比較するよう変更\r
+                                       //              }\r
+                                       #endregion\r
+                                       // #24459 上記の条件だと[HiSkill.***]でのランクしかチェックしていないので、BestRankと比較するよう変更。\r
                                        if ( this.nランク値[ i ] >= 0 && ini.stファイル.BestRank[ i ] > this.nランク値[ i ] )               // #24459 2011.3.1 yyagi update BestRank\r
                                        {\r
                                                this.b新記録ランク[ i ] = true;\r
@@ -378,6 +376,28 @@ namespace DTXMania
                                {\r
                                        return (int) this.eフェードアウト完了時の戻り値;\r
                                }\r
+                               #region [ #24609 ランク更新or演奏型スキル更新時、リザルト画像をpngで保存する ]\r
+                               if ( this.bアニメが完了 == true && this.bIsCheckedWhetherResultScreenShouldSaveOrNot == false )   // #24609 2011.3.14 yyagi; to save result screen in case BestRank or HiSkill.\r
+                               {\r
+                                       // http://www.gamedev.net/topic/594369-dx9slimdxati-incorrect-saving-surface-to-file/\r
+                                       using ( Surface pSurface = CDTXMania.app.Device.GetRenderTarget( 0 ) )\r
+                                       {\r
+                                               string path = Path.GetDirectoryName( CDTXMania.DTX.strファイル名の絶対パス);\r
+                                               string datetime = DateTime.Now.ToString("yyyyMMddHHmmss");\r
+                                               for ( int i = 0; i < 3; i++ )\r
+                                               {\r
+                                                       if ( this.b新記録ランク[ i ] == true || this.b新記録スキル[i] == true )\r
+                                                       {\r
+                                                               string strPart = ( (E楽器パート)(i)).ToString();\r
+                                                               string strRank = ( (CScoreIni.ERANK) ( this.nランク値[ i ] ) ).ToString();\r
+                                                               string strFullPath = CDTXMania.DTX.strファイル名の絶対パス + "." + datetime + "_" + strPart + "_" + strRank + ".png";\r
+                                                               Surface.ToFile( pSurface, strFullPath, ImageFileFormat.Png );\r
+                                                       }\r
+                                               }\r
+                                       }\r
+                                       bIsCheckedWhetherResultScreenShouldSaveOrNot = true;\r
+                               }\r
+                               #endregion\r
 \r
                                // キー入力\r
 \r
@@ -503,6 +523,7 @@ namespace DTXMania
                private CActResultImage actResultImage;\r
                private CActResultSongBar actSongBar;\r
                private bool bアニメが完了;\r
+               private bool bIsCheckedWhetherResultScreenShouldSaveOrNot;                              // #24509 2011.3.14 yyagi\r
                private readonly int[] nチャンネル0Atoレーン07;\r
                private int n最後に再生したHHのWAV番号;\r
                private int n最後に再生したHHのチャンネル番号;\r