OSDN Git Service

DTXMania089リリースに際してのtag付け。
[dtxmania/dtxmania.git] / 110401(DTXMania089) / DTXManiaプロジェクト / コード / ステージ / 05.選曲 / CActSelectInformation.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 CActSelectInformation : CActivity\r
11         {\r
12                 // コンストラクタ\r
13 \r
14                 public CActSelectInformation()\r
15                 {\r
16                         base.b活性化してない = true;\r
17                 }\r
18 \r
19 \r
20                 // CActivity 実装\r
21 \r
22                 public override void On活性化()\r
23                 {\r
24                         this.n画像Index上 = -1;\r
25                         this.n画像Index下 = 0;\r
26                         base.On活性化();\r
27                 }\r
28                 public override void On非活性化()\r
29                 {\r
30                         this.ctスクロール用 = null;\r
31                         base.On非活性化();\r
32                 }\r
33                 public override void OnManagedリソースの作成()\r
34                 {\r
35                         if( !base.b活性化してない )\r
36                         {\r
37                                 this.txInfo[ 0 ] = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenSelect information 1.png" ), false );\r
38                                 this.txInfo[ 1 ] = CDTXMania.tテクスチャの生成( CSkin.Path( @"Graphics\ScreenSelect information 2.png" ), false );\r
39                                 base.OnManagedリソースの作成();\r
40                         }\r
41                 }\r
42                 public override void OnManagedリソースの解放()\r
43                 {\r
44                         if( !base.b活性化してない )\r
45                         {\r
46                                 CDTXMania.tテクスチャの解放( ref this.txInfo[ 0 ] );\r
47                                 CDTXMania.tテクスチャの解放( ref this.txInfo[ 1 ] );\r
48                                 base.OnManagedリソースの解放();\r
49                         }\r
50                 }\r
51                 public override int On進行描画()\r
52                 {\r
53                         if( !base.b活性化してない )\r
54                         {\r
55                                 if( base.b初めての進行描画 )\r
56                                 {\r
57                                         this.ctスクロール用 = new CCounter( 0, 0x1770, 1, CDTXMania.Timer );\r
58                                         base.b初めての進行描画 = false;\r
59                                 }\r
60                                 this.ctスクロール用.t進行();\r
61                                 if( this.ctスクロール用.b終了値に達した )\r
62                                 {\r
63                                         this.n画像Index上 = this.n画像Index下;\r
64                                         this.n画像Index下 = ( this.n画像Index下 + 1 ) % 8;\r
65                                         this.ctスクロール用.n現在の値 = 0;\r
66                                 }\r
67                                 int num = this.ctスクロール用.n現在の値;\r
68                                 if( num <= 250 )\r
69                                 {\r
70                                         double num2 = ( (double) num ) / 250.0;\r
71                                         if( this.n画像Index上 >= 0 )\r
72                                         {\r
73                                                 STINFO stinfo = this.stInfo[ this.n画像Index上 ];\r
74                                                 Rectangle rectangle = new Rectangle( stinfo.pt左上座標.X, stinfo.pt左上座標.Y + ( (int) ( 45.0 * num2 ) ), 0xdd, 0x2d );\r
75                                                 if( this.txInfo[ stinfo.nTexture番号 ] != null )\r
76                                                 {\r
77                                                         this.txInfo[ stinfo.nTexture番号 ].t2D描画( CDTXMania.app.Device, 0x73, 6, rectangle );\r
78                                                 }\r
79                                         }\r
80                                         if( this.n画像Index下 >= 0 )\r
81                                         {\r
82                                                 STINFO stinfo2 = this.stInfo[ this.n画像Index下 ];\r
83                                                 Rectangle rectangle2 = new Rectangle( stinfo2.pt左上座標.X, stinfo2.pt左上座標.Y, 0xdd, (int) ( 45.0 * num2 ) );\r
84                                                 if( this.txInfo[ stinfo2.nTexture番号 ] != null )\r
85                                                 {\r
86                                                         this.txInfo[ stinfo2.nTexture番号 ].t2D描画( CDTXMania.app.Device, 0x73, 6 + ( (int) ( 45.0 * ( 1.0 - num2 ) ) ), rectangle2 );\r
87                                                 }\r
88                                         }\r
89                                 }\r
90                                 else\r
91                                 {\r
92                                         STINFO stinfo3 = this.stInfo[ this.n画像Index下 ];\r
93                                         Rectangle rectangle3 = new Rectangle( stinfo3.pt左上座標.X, stinfo3.pt左上座標.Y, 0xdd, 0x2d );\r
94                                         if( this.txInfo[ stinfo3.nTexture番号 ] != null )\r
95                                         {\r
96                                                 this.txInfo[ stinfo3.nTexture番号 ].t2D描画( CDTXMania.app.Device, 0x73, 6, rectangle3 );\r
97                                         }\r
98                                 }\r
99                         }\r
100                         return 0;\r
101                 }\r
102 \r
103 \r
104                 // その他\r
105 \r
106                 #region [ private ]\r
107                 //-----------------\r
108                 [StructLayout( LayoutKind.Sequential )]\r
109                 private struct STINFO\r
110                 {\r
111                         public int nTexture番号;\r
112                         public Point pt左上座標;\r
113                         public STINFO( int nTexture番号, int x, int y )\r
114                         {\r
115                                 this.nTexture番号 = nTexture番号;\r
116                                 this.pt左上座標 = new Point( x, y );\r
117                         }\r
118                 }\r
119 \r
120                 private CCounter ctスクロール用;\r
121                 private const int nINFO数 = 8;\r
122                 private int n画像Index下;\r
123                 private int n画像Index上;\r
124                 private readonly STINFO[] stInfo = new STINFO[] { new STINFO( 0, 0, 0 ), new STINFO( 0, 0, 0x31 ), new STINFO( 0, 0, 0x62 ), new STINFO( 0, 0, 0x93 ), new STINFO( 0, 0, 0xc4 ), new STINFO( 1, 0, 0 ), new STINFO( 1, 0, 0x31 ), new STINFO( 1, 0, 0x62 ) };\r
125                 private CTexture[] txInfo = new CTexture[ 2 ];\r
126                 //-----------------\r
127                 #endregion\r
128         }\r
129 }\r