OSDN Git Service

ef510144cbb3a7bb156f0b414fda4eae9605cd95
[dtxmania/dtxmania.git] / DTXManiaプロジェクト / コード / ステージ / 07.演奏 / CAct演奏チップファイアGB.cs
1 using System;\r
2 using System.Collections.Generic;\r
3 using System.Text;\r
4 using System.Drawing;\r
5 using SlimDX;\r
6 using FDK;\r
7 \r
8 namespace DTXMania\r
9 {\r
10         internal abstract class CAct演奏チップファイアGB : CActivity\r
11         {\r
12                 // コンストラクタ\r
13 \r
14                 public CAct演奏チップファイアGB()\r
15                 {\r
16                         base.b活性化してない = true;\r
17                 }\r
18 \r
19 \r
20                 // メソッド\r
21 \r
22                 public virtual void Start( int nLane, int n中央X, int n中央Y )\r
23                 {\r
24                         if( ( nLane >= 0 ) || ( nLane <= 5 ) )\r
25                         {\r
26                                 this.pt中央位置[ nLane ].X = n中央X;\r
27                                 this.pt中央位置[ nLane ].Y = n中央Y;\r
28                                 this.ct進行[ nLane ].t開始( 24, 0x38, 8, CDTXMania.Timer );         // 2011.2.17 yyagi: (0, 0x38, 4,..) -> (24, 0x38, 8) に変更 ギターチップの光り始めを早くするため\r
29                         }\r
30                 }\r
31 \r
32                 public abstract void Start( int nLane );\r
33 \r
34                 // CActivity 実装\r
35 \r
36                 public override void On活性化()\r
37                 {\r
38                         for( int i = 0; i < 6; i++ )\r
39                         {\r
40                                 this.pt中央位置[ i ] = new Point( 0, 0 );\r
41                                 this.ct進行[ i ] = new CCounter();\r
42                         }\r
43                         base.On活性化();\r
44                 }\r
45                 public override void On非活性化()\r
46                 {\r
47                         for( int i = 0; i < 6; i++ )\r
48                         {\r
49                                 this.ct進行[ i ] = null;\r
50                         }\r
51                         base.On非活性化();\r
52                 }\r
53                 public override void OnManagedリソースの作成()\r
54                 {\r
55                         if( !base.b活性化してない )\r
56                         {\r
57                                 this.tx火花[ 0 ] = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenPlay chip fire red.png" ) );\r
58                                 if( this.tx火花[ 0 ] != null )\r
59                                 {\r
60                                         this.tx火花[ 0 ].b加算合成 = true;\r
61                                 }\r
62                                 this.tx火花[ 1 ] = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenPlay chip fire green.png" ) );\r
63                                 if( this.tx火花[ 1 ] != null )\r
64                                 {\r
65                                         this.tx火花[ 1 ].b加算合成 = true;\r
66                                 }\r
67                                 this.tx火花[ 2 ] = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenPlay chip fire blue.png" ) );\r
68                                 if( this.tx火花[ 2 ] != null )\r
69                                 {\r
70                                         this.tx火花[ 2 ].b加算合成 = true;\r
71                                 }\r
72                                 base.OnManagedリソースの作成();\r
73                         }\r
74                 }\r
75                 public override void OnManagedリソースの解放()\r
76                 {\r
77                         if( !base.b活性化してない )\r
78                         {\r
79                                 CDTXMania.tテクスチャの解放( ref this.tx火花[ 0 ] );\r
80                                 CDTXMania.tテクスチャの解放( ref this.tx火花[ 1 ] );\r
81                                 CDTXMania.tテクスチャの解放( ref this.tx火花[ 2 ] );\r
82                                 base.OnManagedリソースの解放();\r
83                         }\r
84                 }\r
85                 public override int On進行描画()\r
86                 {\r
87                         if( !base.b活性化してない )\r
88                         {\r
89                                 for( int i = 0; i < 6; i++ )\r
90                                 {\r
91                                         this.ct進行[ i ].t進行();\r
92                                         if( this.ct進行[ i ].b終了値に達した )\r
93                                         {\r
94                                                 this.ct進行[ i ].t停止();\r
95                                         }\r
96                                 }\r
97                                 for( int j = 0; j < 6; j++ )\r
98                                 {\r
99                                         if( ( this.ct進行[ j ].n現在の経過時間ms != -1 ) && ( this.tx火花[ j % 3 ] != null ) )\r
100                                         {\r
101                                                 float x = (float) ( 3.0 * Math.Cos( ( 3.1415926535897931 * ( 90.0 - ( 90.0 * ( ( (double) this.ct進行[ j ].n現在の値 ) / 56.0 ) ) ) ) / 180.0 ) );\r
102                                                 int num4 = this.pt中央位置[ j ].X - ( (int) ( ( this.tx火花[ j % 3 ].sz画像サイズ.Width * x ) / 2f ) );\r
103                                                 int y = this.pt中央位置[ j ].Y - ( (int) ( ( this.tx火花[ j % 3 ].sz画像サイズ.Height * x ) / 2f ) );\r
104                                                 this.tx火花[ j % 3 ].n透明度 = ( this.ct進行[ j ].n現在の値 < 0x1c ) ? 0xff : ( 0xff - ( (int) ( 255.0 * Math.Cos( ( 3.1415926535897931 * ( 90.0 - ( 90.0 * ( ( (double) ( this.ct進行[ j ].n現在の値 - 0x1c ) ) / 28.0 ) ) ) ) / 180.0 ) ) ) );\r
105                                                 this.tx火花[ j % 3 ].vc拡大縮小倍率 = new Vector3( x, x, 1f );\r
106                                                 this.tx火花[ j % 3 ].t2D描画( CDTXMania.app.Device, num4, y );\r
107                                         }\r
108                                 }\r
109                         }\r
110                         return 0;\r
111                 }\r
112 \r
113 \r
114                 // その他\r
115 \r
116                 #region [ private ]\r
117                 //-----------------\r
118                 private CCounter[] ct進行 = new CCounter[ 6 ];\r
119                 private Point[] pt中央位置 = new Point[ 6 ];\r
120                 private CTexture[] tx火花 = new CTexture[ 3 ];\r
121                 //-----------------\r
122                 #endregion\r
123         }\r
124 }\r