From 4a04b4da83f388851caf7b2b140ebb0a47d21264 Mon Sep 17 00:00:00 2001 From: yyagi Date: Sat, 30 Jul 2011 15:17:30 +0000 Subject: [PATCH] =?utf8?q?#23559=20Risky=E6=99=82=E3=80=81=E3=82=B2?= =?utf8?q?=E3=83=BC=E3=82=B8=E3=81=AE=E5=81=B4=E3=81=AB=E6=AE=8B=E3=82=8AM?= =?utf8?q?iss=E5=9B=9E=E6=95=B0=E3=82=92=E8=A1=A8=E7=A4=BA=E3=81=99?= =?utf8?q?=E3=82=8B=E3=82=88=E3=81=86=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.osdn.jp/svnroot/dtxmania/trunk@233 16f42ceb-6dc6-49c8-ba94-f2d53467949d --- .../07.演奏/CAct演奏ゲージ共通.cs | 14 ++- .../ギター画面/CAct演奏Guitarゲージ.cs | 12 ++ .../ドラム画面/CAct演奏Drumsゲージ.cs | 15 ++- .../コード/ステージ/CActLVLNFont.cs | 126 +++++++++++++++++++++ 4 files changed, 163 insertions(+), 4 deletions(-) create mode 100644 DTXManiaプロジェクト/コード/ステージ/CActLVLNFont.cs diff --git a/DTXManiaプロジェクト/コード/ステージ/07.演奏/CAct演奏ゲージ共通.cs b/DTXManiaプロジェクト/コード/ステージ/07.演奏/CAct演奏ゲージ共通.cs index c02d30d8..45263383 100644 --- a/DTXManiaプロジェクト/コード/ステージ/07.演奏/CAct演奏ゲージ共通.cs +++ b/DTXManiaプロジェクト/コード/ステージ/07.演奏/CAct演奏ゲージ共通.cs @@ -12,8 +12,20 @@ namespace DTXMania /// /// CAct演奏Drumsゲージ と CAct演奏Gutiarゲージ のbaseクラス。ダメージ計算やDanger/Failed判断もこのクラスで行う。 /// - public class CAct演奏ゲージ共通 : CActivity + internal class CAct演奏ゲージ共通 : CActivity { + // プロパティ + public CActLVLNFont actLVLNFont { get; protected set; } + + // コンストラクタ + public CAct演奏ゲージ共通() + { + actLVLNFont = new CActLVLNFont(); + actLVLNFont.On活性化(); + } + + + const double GAUGE_MAX = 1.0; const double GAUGE_INITIAL = 2.0 / 3; const double GAUGE_MIN = -0.1; diff --git a/DTXManiaプロジェクト/コード/ステージ/07.演奏/ギター画面/CAct演奏Guitarゲージ.cs b/DTXManiaプロジェクト/コード/ステージ/07.演奏/ギター画面/CAct演奏Guitarゲージ.cs index e38b4f4a..7dd05cfd 100644 --- a/DTXManiaプロジェクト/コード/ステージ/07.演奏/ギター画面/CAct演奏Guitarゲージ.cs +++ b/DTXManiaプロジェクト/コード/ステージ/07.演奏/ギター画面/CAct演奏Guitarゲージ.cs @@ -135,6 +135,12 @@ namespace DTXMania this.txゲージ.b加算合成 = true; this.txゲージ.t2D描画( CDTXMania.app.Device, x, 8, rectangle ); } + if (this.bRisky && this.actLVLNFont != null) // #23599 2011.7.30 yyagi Risky残りMiss回数表示 + { + CActLVLNFont.EFontColor efc = this.IsDanger( E楽器パート.GUITAR ) ? + CActLVLNFont.EFontColor.Red : CActLVLNFont.EFontColor.Yellow; + actLVLNFont.t文字列描画( 196, 6, nRiskyTimes.ToString(), efc, CActLVLNFont.EFontAlign.Left ); + } } #endregion @@ -199,6 +205,12 @@ namespace DTXMania this.txゲージ.b加算合成 = true; this.txゲージ.t2D描画( CDTXMania.app.Device, num11, 8, rectangle2 ); } + if (this.bRisky && this.actLVLNFont != null) // #23599 2011.7.30 yyagi Risky残りMiss回数表示 + { + CActLVLNFont.EFontColor efc = this.IsDanger( E楽器パート.GUITAR ) ? + CActLVLNFont.EFontColor.Red : CActLVLNFont.EFontColor.Yellow; + actLVLNFont.t文字列描画( 445, 6, nRiskyTimes.ToString(), efc, CActLVLNFont.EFontAlign.Right); + } } #endregion } diff --git a/DTXManiaプロジェクト/コード/ステージ/07.演奏/ドラム画面/CAct演奏Drumsゲージ.cs b/DTXManiaプロジェクト/コード/ステージ/07.演奏/ドラム画面/CAct演奏Drumsゲージ.cs index 21822548..27695ee9 100644 --- a/DTXManiaプロジェクト/コード/ステージ/07.演奏/ドラム画面/CAct演奏Drumsゲージ.cs +++ b/DTXManiaプロジェクト/コード/ステージ/07.演奏/ドラム画面/CAct演奏Drumsゲージ.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Drawing; +using System.Diagnostics; using SlimDX; using FDK; @@ -73,9 +74,9 @@ namespace DTXMania } public override int On進行描画() { - if( !base.b活性化してない ) + if ( !base.b活性化してない ) { - if( base.b初めての進行描画 ) + if ( base.b初めての進行描画 ) { for( int k = 0; k < 0x18; k++ ) { @@ -90,6 +91,14 @@ namespace DTXMania } this.ct本体移動.t進行Loop(); this.ct本体振動.t進行Loop(); + + if ( this.bRisky && this.actLVLNFont != null ) // #23599 2011.7.30 yyagi Risky残りMiss回数表示 + { + CActLVLNFont.EFontColor efc = this.IsDanger( E楽器パート.DRUMS ) ? + CActLVLNFont.EFontColor.Red : CActLVLNFont.EFontColor.Yellow; + actLVLNFont.t文字列描画( 15, 408, nRiskyTimes.ToString(), efc, CActLVLNFont.EFontAlign.Right ); + } + 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 ) ) ) ) ); if( num2 <= 0 ) { @@ -178,7 +187,7 @@ namespace DTXMania { this.txゲージ.b加算合成 = true; } - for( int j = 0; j < 0x18; j++ ) + for( int j = 0; j < 24; j++ ) { this.st白い星[ j ].ct進行.t進行Loop(); int x = 6 + this.st白い星[ j ].x; diff --git a/DTXManiaプロジェクト/コード/ステージ/CActLVLNFont.cs b/DTXManiaプロジェクト/コード/ステージ/CActLVLNFont.cs new file mode 100644 index 00000000..7f8a2a42 --- /dev/null +++ b/DTXManiaプロジェクト/コード/ステージ/CActLVLNFont.cs @@ -0,0 +1,126 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices; +using System.Drawing; +using System.Diagnostics; +using SlimDX; +using FDK; + +namespace DTXMania +{ + public class CActLVLNFont : CActivity + { + // コンストラクタ + + const int numWidth = 15; + const int numHeight = 19; + + public CActLVLNFont() + { + string numChars = "0123456789?-"; + st数字 = new ST数字[12, 4]; + + for (int j = 0; j < 4; j++) + { + for (int i = 0; i < 12; i++) + { + this.st数字[i, j].ch = numChars[i]; + this.st数字[i, j].rc = new Rectangle( + (i % 4) * numWidth + (j % 2) * 64, + (i / 4) * numHeight + (j / 2) * 64, + numWidth, + numHeight + ); + } + } + } + + + // メソッド + public void t文字列描画(int x, int y, string str) + { + this.t文字列描画(x, y, str, EFontColor.White, EFontAlign.Right); + } + public void t文字列描画(int x, int y, string str, EFontColor efc, EFontAlign efa) + { + if (!base.b活性化してない && !string.IsNullOrEmpty(str)) + { + if (this.tx数値 != null) + { + bool bRightAlign = (efa == EFontAlign.Right); + + if (bRightAlign) // 右詰なら文字列反転して右から描画 + { + char[] chars = str.ToCharArray(); + Array.Reverse(chars); + str = new string(chars); + } + + foreach (char ch in str) + { + int p = (ch == '-' ? 11 : ch - '0'); + ST数字 s = st数字[p, (int)efc]; + int sw = s.rc.Width; + int delta = bRightAlign ? 0 : -sw; + this.tx数値.t2D描画(CDTXMania.app.Device, x + delta, y, s.rc); + x += bRightAlign ? -sw : sw; + } + } + } + } + + + // CActivity 実装 + + public override void OnManagedリソースの作成() + { + if (!base.b活性化してない) + { + this.tx数値 = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\ScreenSelect level numbers.png")); + base.OnManagedリソースの作成(); + } + } + public override void OnManagedリソースの解放() + { + if (!base.b活性化してない) + { + if (this.tx数値 != null) + { + this.tx数値.Dispose(); + this.tx数値 = null; + } + base.OnManagedリソースの解放(); + } + } + + + // その他 + + #region [ private ] + //----------------- + [StructLayout(LayoutKind.Sequential)] + private struct ST数字 + { + public char ch; + public Rectangle rc; + } + + public enum EFontColor + { + Red = 0, + Yellow = 1, + Orange = 2, + White = 3 + } + public enum EFontAlign + { + Left, + Right + } + private ST数字[,] st数字; + private CTexture tx数値; + //----------------- + #endregion + } +} -- 2.11.0