OSDN Git Service

#23559 Risky時、ゲージの側に残りMiss回数を表示するよう追加
authoryyagi <yyagi@16f42ceb-6dc6-49c8-ba94-f2d53467949d>
Sat, 30 Jul 2011 15:17:30 +0000 (15:17 +0000)
committeryyagi <yyagi@16f42ceb-6dc6-49c8-ba94-f2d53467949d>
Sat, 30 Jul 2011 15:17:30 +0000 (15:17 +0000)
git-svn-id: http://svn.osdn.jp/svnroot/dtxmania/trunk@233 16f42ceb-6dc6-49c8-ba94-f2d53467949d

DTXManiaプロジェクト/コード/ステージ/07.演奏/CAct演奏ゲージ共通.cs
DTXManiaプロジェクト/コード/ステージ/07.演奏/ギター画面/CAct演奏Guitarゲージ.cs
DTXManiaプロジェクト/コード/ステージ/07.演奏/ドラム画面/CAct演奏Drumsゲージ.cs
DTXManiaプロジェクト/コード/ステージ/CActLVLNFont.cs [new file with mode: 0644]

index c02d30d..4526338 100644 (file)
@@ -12,8 +12,20 @@ namespace DTXMania
        /// <summary>\r
        /// CAct演奏Drumsゲージ と CAct演奏Gutiarゲージ のbaseクラス。ダメージ計算やDanger/Failed判断もこのクラスで行う。\r
        /// </summary>\r
-       public class CAct演奏ゲージ共通 : CActivity\r
+       internal class CAct演奏ゲージ共通 : CActivity\r
        {\r
+               // プロパティ\r
+               public CActLVLNFont actLVLNFont { get; protected set; }\r
+\r
+               // コンストラクタ\r
+               public CAct演奏ゲージ共通()\r
+               {\r
+                       actLVLNFont = new CActLVLNFont();\r
+                       actLVLNFont.On活性化();\r
+               }\r
+\r
+               \r
+               \r
                const double GAUGE_MAX = 1.0;\r
                const double GAUGE_INITIAL =  2.0 / 3;\r
                const double GAUGE_MIN = -0.1;\r
index e38b4f4..7dd05cf 100644 (file)
@@ -135,6 +135,12 @@ namespace DTXMania
                                                this.txゲージ.b加算合成 = true;\r
                                                this.txゲージ.t2D描画( CDTXMania.app.Device, x, 8, rectangle );\r
                                        }\r
+                                       if (this.bRisky && this.actLVLNFont != null)            // #23599 2011.7.30 yyagi Risky残りMiss回数表示\r
+                                       {\r
+                                               CActLVLNFont.EFontColor efc = this.IsDanger( E楽器パート.GUITAR ) ?\r
+                                                       CActLVLNFont.EFontColor.Red : CActLVLNFont.EFontColor.Yellow;\r
+                                               actLVLNFont.t文字列描画( 196, 6, nRiskyTimes.ToString(), efc, CActLVLNFont.EFontAlign.Left );\r
+                                       }\r
                                }\r
                                #endregion\r
 \r
@@ -199,6 +205,12 @@ namespace DTXMania
                                                this.txゲージ.b加算合成 = true;\r
                                                this.txゲージ.t2D描画( CDTXMania.app.Device, num11, 8, rectangle2 );\r
                                        }\r
+                                       if (this.bRisky && this.actLVLNFont != null)            // #23599 2011.7.30 yyagi Risky残りMiss回数表示\r
+                                       {\r
+                                               CActLVLNFont.EFontColor efc = this.IsDanger( E楽器パート.GUITAR ) ?\r
+                                                       CActLVLNFont.EFontColor.Red : CActLVLNFont.EFontColor.Yellow;\r
+                                               actLVLNFont.t文字列描画( 445, 6, nRiskyTimes.ToString(), efc, CActLVLNFont.EFontAlign.Right);\r
+                                       }\r
                                }\r
                                #endregion\r
                        }\r
index 2182254..27695ee 100644 (file)
@@ -3,6 +3,7 @@ using System.Collections.Generic;
 using System.Text;\r
 using System.Runtime.InteropServices;\r
 using System.Drawing;\r
+using System.Diagnostics;\r
 using SlimDX;\r
 using FDK;\r
 \r
@@ -73,9 +74,9 @@ namespace DTXMania
                }\r
                public override int On進行描画()\r
                {\r
-                       if( !base.b活性化してない )\r
+                       if ( !base.b活性化してない )\r
                        {\r
-                               if( base.b初めての進行描画 )\r
+                               if ( base.b初めての進行描画 )\r
                                {\r
                                        for( int k = 0; k < 0x18; k++ )\r
                                        {\r
@@ -90,6 +91,14 @@ namespace DTXMania
                                }\r
                                this.ct本体移動.t進行Loop();\r
                                this.ct本体振動.t進行Loop();\r
+\r
+                               if ( this.bRisky && this.actLVLNFont != null )          // #23599 2011.7.30 yyagi Risky残りMiss回数表示\r
+                               {\r
+                                       CActLVLNFont.EFontColor efc = this.IsDanger( E楽器パート.DRUMS ) ?\r
+                                               CActLVLNFont.EFontColor.Red : CActLVLNFont.EFontColor.Yellow;\r
+                                       actLVLNFont.t文字列描画( 15, 408, nRiskyTimes.ToString(), efc, CActLVLNFont.EFontAlign.Right );\r
+                               }\r
+\r
                                int num2 = ( this.dbゲージ値 == 1.0 ) ? ( (int) ( 352.0 * this.dbゲージ値 ) ) : ( (int) ( ( 352.0 * this.dbゲージ値 ) + ( 2.0 * Math.Sin( Math.PI * 2 * ( ( (double) this.ct本体振動.n現在の値 ) / 360.0 ) ) ) ) );\r
                                if( num2 <= 0 )\r
                                {\r
@@ -178,7 +187,7 @@ namespace DTXMania
                                {\r
                                        this.txゲージ.b加算合成 = true;\r
                                }\r
-                               for( int j = 0; j < 0x18; j++ )\r
+                               for( int j = 0; j < 24; j++ )\r
                                {\r
                                        this.st白い星[ j ].ct進行.t進行Loop();\r
                                        int x = 6 + this.st白い星[ j ].x;\r
diff --git a/DTXManiaプロジェクト/コード/ステージ/CActLVLNFont.cs b/DTXManiaプロジェクト/コード/ステージ/CActLVLNFont.cs
new file mode 100644 (file)
index 0000000..7f8a2a4
--- /dev/null
@@ -0,0 +1,126 @@
+using System;\r
+using System.Collections.Generic;\r
+using System.Text;\r
+using System.Runtime.InteropServices;\r
+using System.Drawing;\r
+using System.Diagnostics;\r
+using SlimDX;\r
+using FDK;\r
+\r
+namespace DTXMania\r
+{\r
+       public class CActLVLNFont : CActivity\r
+       {\r
+               // コンストラクタ\r
+\r
+               const int numWidth = 15;\r
+               const int numHeight = 19;\r
+\r
+               public CActLVLNFont()\r
+               {\r
+                       string numChars = "0123456789?-";\r
+                       st数字 = new ST数字[12, 4];\r
+\r
+                       for (int j = 0; j < 4; j++)\r
+                       {\r
+                               for (int i = 0; i < 12; i++)\r
+                               {\r
+                                       this.st数字[i, j].ch = numChars[i];\r
+                                       this.st数字[i, j].rc = new Rectangle(\r
+                                                                                               (i % 4) * numWidth + (j % 2) * 64,\r
+                                                                                               (i / 4) * numHeight + (j / 2) * 64,\r
+                                                                                               numWidth,\r
+                                                                                               numHeight\r
+                                       );\r
+                               }\r
+                       }\r
+               }\r
+\r
+\r
+               // メソッド\r
+               public void t文字列描画(int x, int y, string str)\r
+               {\r
+                       this.t文字列描画(x, y, str, EFontColor.White, EFontAlign.Right);\r
+               }\r
+               public void t文字列描画(int x, int y, string str, EFontColor efc, EFontAlign efa)\r
+               {\r
+                       if (!base.b活性化してない && !string.IsNullOrEmpty(str))\r
+                       {\r
+                               if (this.tx数値 != null)\r
+                               {\r
+                                       bool bRightAlign = (efa == EFontAlign.Right);\r
+\r
+                                       if (bRightAlign)                                                        // 右詰なら文字列反転して右から描画\r
+                                       {\r
+                                               char[] chars = str.ToCharArray();\r
+                                               Array.Reverse(chars);\r
+                                               str = new string(chars);\r
+                                       }\r
+\r
+                                       foreach (char ch in str)\r
+                                       {\r
+                                               int p = (ch == '-' ? 11 : ch - '0');\r
+                                               ST数字 s = st数字[p, (int)efc];\r
+                                               int sw = s.rc.Width;\r
+                                               int delta = bRightAlign ? 0 : -sw;\r
+                                               this.tx数値.t2D描画(CDTXMania.app.Device, x + delta, y, s.rc);\r
+                                               x += bRightAlign ? -sw : sw;\r
+                                       }\r
+                               }\r
+                       }\r
+               }\r
+\r
+\r
+               // CActivity 実装\r
+\r
+               public override void OnManagedリソースの作成()\r
+               {\r
+                       if (!base.b活性化してない)\r
+                       {\r
+                               this.tx数値 = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\ScreenSelect level numbers.png"));\r
+                               base.OnManagedリソースの作成();\r
+                       }\r
+               }\r
+               public override void OnManagedリソースの解放()\r
+               {\r
+                       if (!base.b活性化してない)\r
+                       {\r
+                               if (this.tx数値 != null)\r
+                               {\r
+                                       this.tx数値.Dispose();\r
+                                       this.tx数値 = null;\r
+                               }\r
+                               base.OnManagedリソースの解放();\r
+                       }\r
+               }\r
+\r
+\r
+               // その他\r
+\r
+               #region [ private ]\r
+               //-----------------\r
+               [StructLayout(LayoutKind.Sequential)]\r
+               private struct ST数字\r
+               {\r
+                       public char ch;\r
+                       public Rectangle rc;\r
+               }\r
+\r
+               public enum EFontColor\r
+               {\r
+                       Red = 0,\r
+                       Yellow = 1,\r
+                       Orange = 2,\r
+                       White = 3\r
+               }\r
+               public enum EFontAlign\r
+               {\r
+                       Left,\r
+                       Right\r
+               }\r
+               private ST数字[,] st数字;\r
+               private CTexture tx数値;\r
+               //-----------------\r
+               #endregion\r
+       }\r
+}\r