2 using System.Collections.Generic;
\r
4 using System.Runtime.InteropServices;
\r
5 using System.Drawing;
\r
11 internal class CAct演奏Drumsグラフ : CActivity
\r
13 // #24074 2011.01.23 ikanick グラフの描画
\r
16 // ・基準線(60,70,80,90,100%)を超えると線が黄色くなる(元は白)
\r
20 // ・グラフを波打たせるなどの視覚の向上→実装済
\r
26 public double dbグラフ値現在_渡
\r
30 return this.dbグラフ値現在;
\r
34 this.dbグラフ値現在 = value;
\r
37 public double dbグラフ値目標_渡
\r
41 return this.dbグラフ値目標;
\r
45 this.dbグラフ値目標 = value;
\r
51 public CAct演奏Drumsグラフ()
\r
53 base.b活性化してない = true;
\r
59 public override void On活性化()
\r
61 this.dbグラフ値目標 = 80f;
\r
65 public override void On非活性化()
\r
69 public override void OnManagedリソースの作成()
\r
71 if( !base.b活性化してない )
\r
73 this.txグラフ = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\ScreenPlay graph.png"));
\r
74 base.OnManagedリソースの作成();
\r
77 public override void OnManagedリソースの解放()
\r
79 if( !base.b活性化してない )
\r
81 CDTXMania.tテクスチャの解放( ref this.txグラフ );
\r
82 base.OnManagedリソースの解放();
\r
85 public override int On進行描画()
\r
87 if( !base.b活性化してない )
\r
89 if( base.b初めての進行描画 )
\r
91 for( int k = 0; k < 64; k++ )
\r
93 this.stキラキラ[ k ].x = 0 + CDTXMania.Random.Next( 8 );
\r
94 this.stキラキラ[ k ].fScale = 1f + ( CDTXMania.Random.Next( 9 ) * 0.2f );
\r
95 this.stキラキラ[ k ].Trans = 0 + CDTXMania.Random.Next( 32 ) ;
\r
98 this.stキラキラ[ k ].ct進行 = new CCounter(0, 230, 10 + CDTXMania.Random.Next(20), CDTXMania.Timer);
\r
102 this.stキラキラ[ k ].ct進行 = new CCounter(0, 230, 20 + CDTXMania.Random.Next(50), CDTXMania.Timer);
\r
104 this.stキラキラ[ k ].ct進行.n現在の値 = CDTXMania.Random.Next(230);
\r
106 for( int k = 0; k < 16; k++ )
\r
108 this.stフラッシュ[ k ].y = -1;
\r
109 this.stフラッシュ[ k ].Trans = 0;
\r
111 base.b初めての進行描画 = false;
\r
114 Rectangle rectangle = new Rectangle(22, 0, 1, 1);
\r
115 if (this.txグラフ != null)
\r
117 this.txグラフ.vc拡大縮小倍率 = new Vector3(38f, 230f, 1f);
\r
118 this.txグラフ.n透明度 = 128;
\r
119 this.txグラフ.t2D描画(CDTXMania.app.Device, 345, 88, rectangle);
\r
123 rectangle = new Rectangle(20, 0, 1, 1);
\r
124 if (this.txグラフ != null)
\r
126 this.txグラフ.n透明度 = 32;
\r
127 this.txグラフ.vc拡大縮小倍率 = new Vector3(38f, 1f, 1f);
\r
128 for (int i = 0; i < 20; i++)
\r
130 this.txグラフ.t2D描画(CDTXMania.app.Device, 345, 88 + (int)(11.5 * i), rectangle);
\r
132 this.txグラフ.vc拡大縮小倍率 = new Vector3(1f, 230f, 1f);
\r
133 for (int i = 0; i < 2; i++)
\r
135 this.txグラフ.t2D描画(CDTXMania.app.Device, 349 + i * 18, 88 , rectangle);
\r
136 this.txグラフ.t2D描画(CDTXMania.app.Device, 360 + i * 18, 88 , rectangle);
\r
139 if (this.txグラフ != null)
\r
141 this.txグラフ.vc拡大縮小倍率 = new Vector3(38f, 1f, 1f);
\r
143 for (int i = 0; i < 5; i++)
\r
146 if (this.dbグラフ値現在 >= (100 - i * 10))
\r
148 rectangle = new Rectangle(21, 0, 1, 1);//黄色
\r
149 this.txグラフ.n透明度 = 224;
\r
153 rectangle = new Rectangle(20, 0, 1, 1);
\r
154 this.txグラフ.n透明度 = 160;
\r
157 if (this.txグラフ != null)
\r
159 this.txグラフ.t2D描画(CDTXMania.app.Device, 345, 88 + i * 23, rectangle);
\r
164 if (this.dbグラフ値現在_表示 < this.dbグラフ値現在)
\r
166 this.dbグラフ値現在_表示 += (this.dbグラフ値現在 - this.dbグラフ値現在_表示) / 5 + 0.01;
\r
168 if (this.dbグラフ値現在_表示 >= this.dbグラフ値現在)
\r
170 this.dbグラフ値現在_表示 = this.dbグラフ値現在;
\r
172 rectangle = new Rectangle(0, 0, 10, (int)(230f * this.dbグラフ値現在_表示 / 100));
\r
173 if (this.txグラフ != null)
\r
175 this.txグラフ.vc拡大縮小倍率 = new Vector3(1f, 1f, 1f);
\r
176 this.txグラフ.n透明度 = 192;
\r
177 this.txグラフ.t2D描画(CDTXMania.app.Device, 350, 318 - (int)(230f * this.dbグラフ値現在_表示 / 100), rectangle);
\r
179 for( int k = 0; k < 32; k++ )
\r
181 rectangle = new Rectangle(20, 0, 1, 1);
\r
182 if (this.txグラフ != null)
\r
184 this.stキラキラ[ k ].ct進行.t進行Loop();
\r
185 int num1 = (int)this.stキラキラ[ k ].x;
\r
186 int num2 = this.stキラキラ[ k ].ct進行.n現在の値;
\r
187 this.txグラフ.vc拡大縮小倍率 = new Vector3(this.stキラキラ[ k ].fScale, this.stキラキラ[ k ].fScale, this.stキラキラ[ k ].fScale);
\r
188 this.txグラフ.n透明度 = 138 - 2 * this.stキラキラ[ k ].Trans;
\r
189 if ( num2 < (2.3f * this.dbグラフ値現在_表示) )
\r
191 this.txグラフ.t2D描画(CDTXMania.app.Device, 350+num1, 318-num2, rectangle);
\r
196 if (this.dbグラフ値直前 != this.dbグラフ値現在)
\r
198 this.stフラッシュ[ nグラフフラッシュct ].y = 0;
\r
199 this.stフラッシュ[ nグラフフラッシュct ].Trans = 224;
\r
201 if (nグラフフラッシュct >= 16)
\r
206 this.dbグラフ値直前 = this.dbグラフ値現在;
\r
207 for (int m = 0; m < 16; m++)
\r
209 rectangle = new Rectangle(20, 0, 1, 1);
\r
210 if ((this.stフラッシュ[ m ].y >= 0) && (this.stフラッシュ[ m ].y+3 < (int)(230f * this.dbグラフ値現在_表示 / 100)) && (this.txグラフ != null))
\r
212 this.txグラフ.vc拡大縮小倍率 = new Vector3(10f, 1f, 1f);
\r
213 this.txグラフ.n透明度 = this.stフラッシュ[ m ].Trans;
\r
214 this.txグラフ.t2D描画(CDTXMania.app.Device, 350, this.stフラッシュ[ m ].y + (318 - (int)(230f * this.dbグラフ値現在_表示 / 100)), rectangle);
\r
215 this.txグラフ.n透明度 = this.stフラッシュ[ m ].Trans;
\r
216 this.txグラフ.t2D描画(CDTXMania.app.Device, 350, this.stフラッシュ[ m ].y + 2 + (318 - (int)(230f * this.dbグラフ値現在_表示 / 100)), rectangle);
\r
218 this.stフラッシュ[ m ].y += 4;
\r
219 this.stフラッシュ[ m ].Trans -= 4;
\r
222 rectangle = new Rectangle(0, 0, 10, (int)(230f * this.dbグラフ値現在_表示 / 100));
\r
223 if ((dbグラフ値現在 >= dbグラフ値目標) && (this.txグラフ != null))
\r
225 this.txグラフ.vc拡大縮小倍率 = new Vector3(1.4f, 1f, 1f);
\r
226 this.txグラフ.n透明度 = 128;
\r
227 this.txグラフ.b加算合成 = true;
\r
228 this.txグラフ.t2D描画(CDTXMania.app.Device, 348, 318 - (int)(230f * this.dbグラフ値現在_表示 / 100), rectangle);
\r
229 this.txグラフ.b加算合成 = false;
\r
232 if (this.dbグラフ値目標_表示 < this.dbグラフ値目標)
\r
234 this.dbグラフ値目標_表示 += (this.dbグラフ値目標 - this.dbグラフ値目標_表示) / 5 + 0.01;
\r
236 if (this.dbグラフ値目標_表示 >= this.dbグラフ値目標)
\r
238 this.dbグラフ値目標_表示 = this.dbグラフ値目標;
\r
240 rectangle = new Rectangle(10, 0, 10, (int)(230f * this.dbグラフ値目標_表示 / 100));
\r
241 if (this.txグラフ != null)
\r
243 this.txグラフ.vc拡大縮小倍率 = new Vector3(1f, 1f, 1f);
\r
244 this.txグラフ.n透明度 = 192;
\r
245 this.txグラフ.t2D描画(CDTXMania.app.Device, 368, 318 - (int)(230f * this.dbグラフ値目標_表示 / 100), rectangle);
\r
246 this.txグラフ.vc拡大縮小倍率 = new Vector3(1.4f, 1f, 1f);
\r
247 this.txグラフ.n透明度 = 48;
\r
248 this.txグラフ.b加算合成 = true;
\r
249 this.txグラフ.t2D描画(CDTXMania.app.Device, 366, 318 - (int)(230f * this.dbグラフ値目標_表示 / 100), rectangle);
\r
250 this.txグラフ.b加算合成 = false;
\r
252 for( int k = 32; k < 64; k++ )
\r
254 rectangle = new Rectangle(20, 0, 1, 1);
\r
255 if (this.txグラフ != null)
\r
257 this.stキラキラ[ k ].ct進行.t進行Loop();
\r
258 int num1 = (int)this.stキラキラ[ k ].x;
\r
259 int num2 = this.stキラキラ[ k ].ct進行.n現在の値;
\r
260 this.txグラフ.vc拡大縮小倍率 = new Vector3(this.stキラキラ[ k ].fScale, this.stキラキラ[ k ].fScale, this.stキラキラ[ k ].fScale);
\r
261 this.txグラフ.n透明度 = 138 - 2 * this.stキラキラ[ k ].Trans;
\r
262 if ( num2 < (2.3f * this.dbグラフ値目標_表示) )
\r
264 this.txグラフ.t2D描画(CDTXMania.app.Device, 368+num1, 318-num2, rectangle);
\r
276 #region [ private ]
\r
278 [StructLayout( LayoutKind.Sequential )]
\r
279 private struct STキラキラ
\r
283 public float fScale;
\r
285 public CCounter ct進行;
\r
287 private STキラキラ[] stキラキラ = new STキラキラ[ 64 ];
\r
288 private STキラキラ[] stフラッシュ = new STキラキラ[ 16 ];
\r
290 private double dbグラフ値目標;
\r
291 private double dbグラフ値目標_表示;
\r
292 private double dbグラフ値現在;
\r
293 private double dbグラフ値現在_表示;
\r
294 private double dbグラフ値直前;
\r
295 private int nグラフフラッシュct;
\r
297 private CTexture txグラフ;
\r
298 //-----------------
\r