2 using System.Collections.Generic;
\r
4 using System.Runtime.InteropServices;
\r
5 using System.Drawing;
\r
12 internal class CAct演奏Drumsグラフ : CActivity
\r
14 // #24074 2011.01.23 ikanick グラフの描画
\r
17 // ・基準線(60,70,80,90,100%)を超えると線が黄色くなる(元は白)
\r
21 // ・グラフを波打たせるなどの視覚の向上→実装済
\r
25 private int XPos = 3 * 345;
\r
26 private int YPos = 200;
\r
27 private int DispHeight = 400;
\r
28 private int DispWidth = 60;
\r
29 private CCounter counterYposInImg = null;
\r
30 private readonly int slices = 10;
\r
34 public double dbグラフ値現在_渡
\r
38 return this.dbグラフ値現在;
\r
42 this.dbグラフ値現在 = value;
\r
45 public double dbグラフ値目標_渡
\r
49 return this.dbグラフ値目標;
\r
53 this.dbグラフ値目標 = value;
\r
59 public CAct演奏Drumsグラフ()
\r
61 base.b活性化してない = true;
\r
67 public override void On活性化()
\r
69 this.dbグラフ値目標 = 80f;
\r
73 public override void On非活性化()
\r
77 public override void OnManagedリソースの作成()
\r
81 string pathグラフ = CSkin.Path(@"Graphics\ScreenPlay graph.png");
\r
82 if (File.Exists(pathグラフ))
\r
84 this.txグラフ = TextureFactory.tテクスチャの生成(pathグラフ);
\r
86 base.OnManagedリソースの作成();
\r
89 public override void OnManagedリソースの解放()
\r
93 TextureFactory.tテクスチャの解放(ref this.txグラフ);
\r
94 base.OnManagedリソースの解放();
\r
97 public override int On進行描画()
\r
101 if (base.b初めての進行描画)
\r
103 /* #35804 エフェクトを変更しました。
\r
104 for( int k = 0; k < 64; k++ )
\r
106 this.stキラキラ[ k ].x = CDTXMania.app.Random.Next( 30 );
\r
107 this.stキラキラ[ k ].fScale = 1f + ( CDTXMania.app.Random.Next( 9 ) * 0.2f );
\r
108 this.stキラキラ[ k ].Trans = 0 + CDTXMania.app.Random.Next( 32 ) ;
\r
111 this.stキラキラ[ k ].ct進行 = new CCounter(0, DispHeight, 10 + CDTXMania.app.Random.Next(20), CDTXMania.app.Timer);
\r
115 this.stキラキラ[ k ].ct進行 = new CCounter(0, DispHeight, 20 + CDTXMania.app.Random.Next(50), CDTXMania.app.Timer);
\r
117 this.stキラキラ[ k ].ct進行.n現在の値 = CDTXMania.app.Random.Next(DispHeight);
\r
119 for( int k = 0; k < 16; k++ )
\r
121 this.stフラッシュ[ k ].y = -1;
\r
122 this.stフラッシュ[ k ].Trans = 0;
\r
125 base.b初めての進行描画 = false;
\r
126 counterYposInImg = new CCounter(0, 35, 16, CDTXMania.app.Timer);
\r
129 counterYposInImg.t進行Loop();
\r
130 int stYposInImg = counterYposInImg.n現在の値;
\r
133 if (CDTXMania.app.ConfigIni.eドラムレーン表示位置 == Eドラムレーン表示位置.Center)
\r
139 if (this.txグラフ != null)
\r
141 this.txグラフ.vc拡大縮小倍率 = new Vector3(DispWidth, DispHeight, 1f);
\r
142 this.txグラフ.n透明度 = 128;
\r
144 CDTXMania.app.Device,
\r
147 new Rectangle(62, 0, 1, 1)
\r
153 if (this.txグラフ != null)
\r
155 this.txグラフ.n透明度 = 128;
\r
156 this.txグラフ.vc拡大縮小倍率 = new Vector3(DispWidth, 1f, 1f);
\r
157 for (int i = 0; i < slices; i++)
\r
160 CDTXMania.app.Device,
\r
162 YPos + DispHeight * i / slices,
\r
163 new Rectangle(60, 0, 1, 1)
\r
166 /* #35804 chnmr0 縦線は非表示にしました。
\r
167 this.txグラフ.vc拡大縮小倍率 = new Vector3(1f, DispHeight, 1f);
\r
168 for (int i = 0; i < 2; i++)
\r
171 CDTXMania.app.Device,
\r
172 (XPos + 12 + i * 54),
\r
177 CDTXMania.app.Device,
\r
178 (45 + XPos + i * 54),
\r
186 if (this.txグラフ != null)
\r
188 this.txグラフ.vc拡大縮小倍率 = new Vector3(DispWidth, 1f, 1f);
\r
190 for (int i = 0; i < 5; i++)
\r
192 Rectangle rectangle;
\r
194 if (this.dbグラフ値現在 >= (100 - i * slices))
\r
196 rectangle = new Rectangle(61, 0, 1, 1); //黄色
\r
197 if (this.txグラフ != null)
\r
199 this.txグラフ.n透明度 = 224;
\r
204 rectangle = new Rectangle(60, 0, 1, 1);
\r
205 if (this.txグラフ != null)
\r
207 this.txグラフ.n透明度 = 160;
\r
211 if (this.txグラフ != null)
\r
214 CDTXMania.app.Device,
\r
216 YPos + i * DispHeight / slices,
\r
223 if (this.dbグラフ値現在_表示 < this.dbグラフ値現在)
\r
225 this.dbグラフ値現在_表示 += (this.dbグラフ値現在 - this.dbグラフ値現在_表示) / 5 + 0.01;
\r
227 if (this.dbグラフ値現在_表示 >= this.dbグラフ値現在)
\r
229 this.dbグラフ値現在_表示 = this.dbグラフ値現在;
\r
231 int ar = (int)(DispHeight * this.dbグラフ値現在_表示 / 100.0);
\r
233 if (this.txグラフ != null)
\r
235 this.txグラフ.vc拡大縮小倍率 = new Vector3(1f, 1f, 1f);
\r
236 this.txグラフ.n透明度 = 255;
\r
238 CDTXMania.app.Device,
\r
240 YPos + DispHeight - ar,
\r
241 new Rectangle(0, 5 + stYposInImg, 30, ar)
\r
243 this.txグラフ.t2D描画( // 上部白いバー
\r
244 CDTXMania.app.Device,
\r
246 YPos + DispHeight - ar,
\r
247 new Rectangle(0, 0, 30, 5)
\r
251 for( int k = 0; k < 32; k++ )
\r
253 rectangle = new Rectangle(60,0,1,1);
\r
254 if (this.txグラフ != null)
\r
256 this.stキラキラ[ k ].ct進行.t進行Loop();
\r
257 int num1 = (int)this.stキラキラ[ k ].x;
\r
258 int num2 = this.stキラキラ[ k ].ct進行.n現在の値;
\r
259 this.txグラフ.vc拡大縮小倍率 = new Vector3(this.stキラキラ[ k ].fScale, this.stキラキラ[ k ].fScale, this.stキラキラ[ k ].fScale);
\r
260 this.txグラフ.n透明度 = 138 - 2 * this.stキラキラ[ k ].Trans;
\r
261 if ( num2 < (2.3f * this.dbグラフ値現在_表示) )
\r
264 CDTXMania.app.Device,
\r
266 YPos + DispHeight - num2,
\r
276 if (this.dbグラフ値直前 != this.dbグラフ値現在)
\r
278 this.stフラッシュ[ nグラフフラッシュct ].y = 0;
\r
279 this.stフラッシュ[ nグラフフラッシュct ].Trans = 224;
\r
281 if (nグラフフラッシュct >= 16)
\r
286 this.dbグラフ値直前 = this.dbグラフ値現在;
\r
288 for (int m = 0; m < 16; m++)
\r
290 rectangle = new Rectangle(60,0,1,1);
\r
292 if ((this.stフラッシュ[ m ].y >= 0) &&
\r
293 (this.stフラッシュ[ m ].y+3 < ar) &&
\r
294 (this.txグラフ != null))
\r
296 // this.txグラフ.vc拡大縮小倍率 = new Vector3(1f, 1f, 1f);
\r
297 this.txグラフ.n透明度 = this.stフラッシュ[ m ].Trans;
\r
299 CDTXMania.app.Device,
\r
301 (this.stフラッシュ[ m ].y + YPos + DispHeight - ar),
\r
304 this.txグラフ.n透明度 = this.stフラッシュ[ m ].Trans;
\r
306 CDTXMania.app.Device,
\r
308 (this.stフラッシュ[ m ].y + 2 + YPos + DispHeight - ar),
\r
312 this.stフラッシュ[ m ].y += 4;
\r
313 this.stフラッシュ[ m ].Trans -= 4;
\r
318 if ((dbグラフ値現在 >= dbグラフ値目標) && (this.txグラフ != null))
\r
320 // this.txグラフ.vc拡大縮小倍率 = new Vector3(1.4f, 1f, 1f);
\r
321 this.txグラフ.n透明度 = 128;
\r
322 this.txグラフ.b加算合成 = true;
\r
324 CDTXMania.app.Device,
\r
326 YPos + DispHeight - ar,
\r
327 new Rectangle(0, 5 + stYposInImg, 30, ar)
\r
329 this.txグラフ.b加算合成 = false;
\r
332 if (this.dbグラフ値目標_表示 < this.dbグラフ値目標)
\r
334 this.dbグラフ値目標_表示 += (this.dbグラフ値目標 - this.dbグラフ値目標_表示) / 5 + 0.01;
\r
336 if (this.dbグラフ値目標_表示 >= this.dbグラフ値目標)
\r
338 this.dbグラフ値目標_表示 = this.dbグラフ値目標;
\r
340 ar = (int)(DispHeight * this.dbグラフ値目標_表示 / 100.0);
\r
342 if (this.txグラフ != null)
\r
344 // this.txグラフ.vc拡大縮小倍率 = new Vector3(1f, 1f, 1f);
\r
345 // this.txグラフ.n透明度 = 192;
\r
347 CDTXMania.app.Device,
\r
349 YPos + DispHeight - ar,
\r
350 new Rectangle(30, 5 + stYposInImg, 30, ar)
\r
352 this.txグラフ.n透明度 = 255;
\r
353 this.txグラフ.t2D描画( // 上部白いバー
\r
354 CDTXMania.app.Device,
\r
356 YPos + DispHeight - ar,
\r
357 new Rectangle(30, 0, 30, 5)
\r
360 // this.txグラフ.vc拡大縮小倍率 = new Vector3(1.4f, 1f, 1f);
\r
361 this.txグラフ.n透明度 = 48;
\r
362 this.txグラフ.b加算合成 = true;
\r
364 CDTXMania.app.Device,
\r
366 YPos + DispHeight - ar,
\r
369 this.txグラフ.b加算合成 = false;
\r
373 for( int k = 32; k < 64; k++ )
\r
375 rectangle = new Rectangle(60,0,1,1);
\r
376 if (this.txグラフ != null)
\r
378 this.stキラキラ[ k ].ct進行.t進行Loop();
\r
379 int num1 = (int)this.stキラキラ[ k ].x;
\r
380 int num2 = this.stキラキラ[ k ].ct進行.n現在の値;
\r
381 this.txグラフ.vc拡大縮小倍率 = new Vector3(this.stキラキラ[ k ].fScale, this.stキラキラ[ k ].fScale, this.stキラキラ[ k ].fScale);
\r
382 this.txグラフ.n透明度 = 138 - 2 * this.stキラキラ[ k ].Trans;
\r
383 if ( num2 < (2.3f * this.dbグラフ値目標_表示) )
\r
386 CDTXMania.app.Device,
\r
387 (XPos + 69 + 3 * num1),
\r
388 YPos + DispHeight - num2,
\r
403 #region [ private ]
\r
406 [StructLayout( LayoutKind.Sequential )]
\r
407 private struct STキラキラ
\r
411 public float fScale;
\r
413 public CCounter ct進行;
\r
416 // private STキラキラ[] stキラキラ = new STキラキラ[ 64 ];
\r
417 // private STキラキラ[] stフラッシュ = new STキラキラ[ 16 ];
\r
419 private double dbグラフ値目標;
\r
420 private double dbグラフ値目標_表示;
\r
421 private double dbグラフ値現在;
\r
422 private double dbグラフ値現在_表示;
\r
423 // private double dbグラフ値直前;
\r
424 // private int nグラフフラッシュct;
\r
426 private CTexture txグラフ;
\r
427 //-----------------
\r