OSDN Git Service

TEST_SHOWLAG マクロを定義してビルドすると、判定文字列(Perfect, Great,...)の下にジャストタイミングからのズレ時間(ms)を表示するようにした。
[dtxmania/dtxmania.git] / DTXManiaプロジェクト / コード / ステージ / 07.演奏 / CAct演奏判定文字列共通.cs
1 using System;\r
2 using System.Collections.Generic;\r
3 using System.Text;\r
4 using System.Runtime.InteropServices;\r
5 using System.Drawing;\r
6 using FDK;\r
7 \r
8 namespace DTXMania\r
9 {\r
10         internal class CAct演奏判定文字列共通 : CActivity\r
11         {\r
12                 // プロパティ\r
13 \r
14                 protected STSTATUS[] st状態 = new STSTATUS[ 12 ];\r
15                 [StructLayout( LayoutKind.Sequential )]\r
16                 protected struct STSTATUS\r
17                 {\r
18                         public CCounter ct進行;\r
19                         public E判定 judge;\r
20                         public float fX方向拡大率;\r
21                         public float fY方向拡大率;\r
22                         public int n相対X座標;\r
23                         public int n相対Y座標;\r
24                         public int n透明度;\r
25                         public int nLag;                                                                // 2011.2.1 yyagi\r
26                 }\r
27 \r
28                 protected readonly ST判定文字列[] st判定文字列;\r
29                 [StructLayout( LayoutKind.Sequential )]\r
30                 protected struct ST判定文字列\r
31                 {\r
32                         public int n画像番号;\r
33                         public Rectangle rc;\r
34                 }\r
35 \r
36                 protected readonly STlag数値[] stLag数値;                   // 2011.2.1 yyagi\r
37                 [StructLayout( LayoutKind.Sequential )]\r
38                 protected struct STlag数値\r
39                 {\r
40                         public Rectangle rc;\r
41                 }\r
42 \r
43                 \r
44                 protected CTexture[] tx判定文字列 = new CTexture[ 3 ];\r
45                 protected CTexture txlag数値 = new CTexture();                // 2011.2.1 yyagi\r
46 \r
47 \r
48                 // コンストラクタ\r
49 \r
50                 public CAct演奏判定文字列共通()\r
51                 {\r
52                         this.st判定文字列 = new ST判定文字列[ 7 ];\r
53                         Rectangle[] r = new Rectangle[] {\r
54                                 new Rectangle( 0, 0,    0x80, 0x2a ),\r
55                                 new Rectangle( 0, 0x2b, 0x80, 0x2a ),\r
56                                 new Rectangle( 0, 0x56, 0x80, 0x2a ),\r
57                                 new Rectangle( 0, 0,    0x80, 0x2a ),\r
58                                 new Rectangle( 0, 0x2b, 0x80, 0x2a ),\r
59                                 new Rectangle( 0, 0x56, 0x80, 0x2a ),\r
60                                 new Rectangle( 0, 0,    0x80, 0x2a )\r
61                         };\r
62                         for ( int i = 0; i < 7; i++ )\r
63                         {\r
64                                 this.st判定文字列[ i ] = new ST判定文字列();\r
65                                 this.st判定文字列[ i ].n画像番号 = i / 3;\r
66                                 this.st判定文字列[ i ].rc = r[i];\r
67                         }\r
68 \r
69                         this.stLag数値 = new STlag数値[ 12 * 2 ];           // 2011.2.1 yyagi\r
70                         for ( int i = 0; i < 12; i++ )\r
71                         {\r
72                                 this.stLag数値[ i      ].rc = new Rectangle( ( i % 4 ) * 15     , ( i / 4 ) * 19     , 15, 19 );\r
73                                 this.stLag数値[ i + 12 ].rc = new Rectangle( ( i % 4 ) * 15 + 64, ( i / 4 ) * 19 + 64, 15, 19 );\r
74                         }\r
75                         base.b活性化してない = true;\r
76                 }\r
77 \r
78 \r
79                 // メソッド\r
80 \r
81                 public virtual void Start( int nLane, E判定 judge, int lag )\r
82                 {\r
83                         if( ( nLane < 0 ) || ( nLane > 11 ) )\r
84                         {\r
85                                 throw new IndexOutOfRangeException( "有効範囲は 0~11 です。" );\r
86                         }\r
87                         if( ( ( nLane >= 8 ) || ( ( (E判定文字表示位置) CDTXMania.ConfigIni.判定文字表示位置.Drums ) != E判定文字表示位置.表示OFF ) ) && ( ( ( nLane != 10 ) || ( ( (E判定文字表示位置) CDTXMania.ConfigIni.判定文字表示位置.Guitar ) != E判定文字表示位置.表示OFF ) ) && ( ( nLane != 11 ) || ( ( (E判定文字表示位置) CDTXMania.ConfigIni.判定文字表示位置.Bass ) != E判定文字表示位置.表示OFF ) ) ) )\r
88                         {\r
89                                 this.st状態[ nLane ].ct進行 = new CCounter( 0, 300, 1, CDTXMania.Timer );\r
90                                 this.st状態[ nLane ].judge = judge;\r
91                                 this.st状態[ nLane ].fX方向拡大率 = 1f;\r
92                                 this.st状態[ nLane ].fY方向拡大率 = 1f;\r
93                                 this.st状態[ nLane ].n相対X座標 = 0;\r
94                                 this.st状態[ nLane ].n相対Y座標 = 0;\r
95                                 this.st状態[ nLane ].n透明度 = 0xff;\r
96                                 this.st状態[ nLane ].nLag = lag;\r
97                         }\r
98                 }\r
99 \r
100 \r
101                 // CActivity 実装\r
102 \r
103                 public override void On活性化()\r
104                 {\r
105                         for( int i = 0; i < 12; i++ )\r
106                         {\r
107                                 this.st状態[ i ].ct進行 = new CCounter();\r
108                         }\r
109                         base.On活性化();\r
110                 }\r
111                 public override void On非活性化()\r
112                 {\r
113                         for( int i = 0; i < 12; i++ )\r
114                         {\r
115                                 this.st状態[ i ].ct進行 = null;\r
116                         }\r
117                         base.On非活性化();\r
118                 }\r
119                 public override void OnManagedリソースの作成()\r
120                 {\r
121                         if( !base.b活性化してない )\r
122                         {\r
123                                 this.tx判定文字列[ 0 ] = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenPlay judge strings 1.png" ) );\r
124                                 this.tx判定文字列[ 1 ] = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenPlay judge strings 2.png" ) );\r
125                                 this.tx判定文字列[ 2 ] = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenPlay judge strings 3.png" ) );\r
126                                 this.txlag数値 = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenSelect level numbers.png" ) );\r
127                                 base.OnManagedリソースの作成();\r
128                         }\r
129                 }\r
130                 public override void OnManagedリソースの解放()\r
131                 {\r
132                         if( !base.b活性化してない )\r
133                         {\r
134                                 CDTXMania.tテクスチャの解放( ref this.tx判定文字列[ 0 ] );\r
135                                 CDTXMania.tテクスチャの解放( ref this.tx判定文字列[ 1 ] );\r
136                                 CDTXMania.tテクスチャの解放( ref this.tx判定文字列[ 2 ] );\r
137                                 CDTXMania.tテクスチャの解放( ref this.txlag数値 );\r
138                                 base.OnManagedリソースの解放();\r
139                         }\r
140                 }\r
141         }\r
142 }\r