\82ªã\83\97ã\82·ã\83§ã\83³ã\83\91ã\83\8dã\83«.cs - RSS feed" href="/view?p=dtxmania/dtxmania.git;a=rss;f=DTXMania/%E3%82%B3%E3%83%BC%E3%83%89/%E3%82%B9%E3%83%86%E3%83%BC%E3%82%B8/CAct%C3%A3%C2%82%C2%AA%C3%A3%C2%83%C2%97%C3%A3%C2%82%C2%B7%C3%A3%C2%83%C2%A7%C3%A3%C2%83%C2%B3%C3%A3%C2%83%C2%91%C3%A3%C2%83%C2%8D%C3%A3%C2%83%C2%AB.cs" type="application/rss+xml" /> \82ªã\83\97ã\82·ã\83§ã\83³ã\83\91ã\83\8dã\83«.cs - RSS feed (no merges)" href="/view?p=dtxmania/dtxmania.git;a=rss;f=DTXMania/%E3%82%B3%E3%83%BC%E3%83%89/%E3%82%B9%E3%83%86%E3%83%BC%E3%82%B8/CAct%C3%A3%C2%82%C2%AA%C3%A3%C2%83%C2%97%C3%A3%C2%82%C2%B7%C3%A3%C2%83%C2%A7%C3%A3%C2%83%C2%B3%C3%A3%C2%83%C2%91%C3%A3%C2%83%C2%8D%C3%A3%C2%83%C2%AB.cs;opt=--no-merges" type="application/rss+xml" /> \82ªã\83\97ã\82·ã\83§ã\83³ã\83\91ã\83\8dã\83«.cs - Atom feed" href="/view?p=dtxmania/dtxmania.git;a=atom;f=DTXMania/%E3%82%B3%E3%83%BC%E3%83%89/%E3%82%B9%E3%83%86%E3%83%BC%E3%82%B8/CAct%C3%A3%C2%82%C2%AA%C3%A3%C2%83%C2%97%C3%A3%C2%82%C2%B7%C3%A3%C2%83%C2%A7%C3%A3%C2%83%C2%B3%C3%A3%C2%83%C2%91%C3%A3%C2%83%C2%8D%C3%A3%C2%83%C2%AB.cs" type="application/atom+xml" /> \82ªã\83\97ã\82·ã\83§ã\83³ã\83\91ã\83\8dã\83«.cs - Atom feed (no merges)" href="/view?p=dtxmania/dtxmania.git;a=atom;f=DTXMania/%E3%82%B3%E3%83%BC%E3%83%89/%E3%82%B9%E3%83%86%E3%83%BC%E3%82%B8/CAct%C3%A3%C2%82%C2%AA%C3%A3%C2%83%C2%97%C3%A3%C2%82%C2%B7%C3%A3%C2%83%C2%A7%C3%A3%C2%83%C2%B3%C3%A3%C2%83%C2%91%C3%A3%C2%83%C2%8D%C3%A3%C2%83%C2%AB.cs;opt=--no-merges" type="application/atom+xml" />

OSDN Git Service

#37961 PCとMIDI機器をつなぐケーブルとして「MIDI2.0-USB」を使用している場合に警告を表示する機能を追加。このケーブルを通すと、PCからのMIDI出力...
[dtxmania/dtxmania.git] / DTXMania / コード / ステージ / CActã\82ªã\83\97ã\82·ã\83§ã\83³ã\83\91ã\83\8dã\83«.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using System.Drawing;
5 using SharpDX.Direct3D9;
6 using FDK;
7 using DTXMania.Coordinates;
8
9 namespace DTXMania
10 {
11         internal class CActオプションパネル : CActivity
12         {
13                 public STDGBSValue<CXY> Pos;
14
15                 EOptionPanelDirection direction;
16                 Rectangle rect;
17
18                 readonly Point[] ptDark = new Point[] { new Point(1, 0), new Point(1, 1), new Point(1, 7) };
19                 /// <summary>
20                 /// Off, Hid, Sud, HidSud, SInv, FInv
21                 /// </summary>
22                 readonly Point[] ptSudHidInv = new Point[] { new Point( 0, 0 ), new Point( 0, 2 ), new Point( 0, 1 ), new Point( 0, 3 ), new Point( 4, 7 ), new Point( 5, 7 ) };
23                 readonly Point[] ptLight = new Point[] { new Point(5, 4), new Point(5, 5) };
24                 readonly Point[] ptRandom = new Point[] { new Point(3, 4), new Point(3, 5), new Point(3, 6), new Point(3, 7) };
25                 readonly Point[] ptReverse = new Point[] { new Point(1, 2), new Point(1, 3) };
26                 readonly Point[] ptTight = new Point[] { new Point(4, 4), new Point(4, 5) };
27                 readonly Point[] ptScrollSpeed = new Point[]
28                 {
29                         new Point(2, 0), new Point(2, 1), new Point(2, 2), new Point(2, 3),
30                         new Point(3, 0), new Point(3, 1), new Point(3, 2), new Point(3, 3),
31                         new Point(4, 0), new Point(4, 1), new Point(4, 2), new Point(4, 3),
32                         new Point(5, 0), new Point(5, 1), new Point(5, 2), new Point(5, 3)
33                 };
34
35                 private CTexture txオプションパネル;
36
37                 public CActオプションパネル(EOptionPanelDirection dir)
38                 {
39                         direction = dir;
40                         rect = new Rectangle();
41                 }
42
43                 public override void On非活性化()
44                 {
45                         if (base.b活性化してる)
46                         {
47                                 TextureFactory.tテクスチャの解放(ref this.txオプションパネル);
48                                 base.On非活性化();
49                         }
50                 }
51
52                 public override void OnManagedリソースの作成()
53                 {
54                         if (base.b活性化してる)
55                         {
56                                 this.txオプションパネル = TextureFactory.tテクスチャの生成(CSkin.Path(@"Graphics\Screen option panels.png"), false);
57                                 base.OnManagedリソースの作成();
58                         }
59                 }
60
61                 public override void OnManagedリソースの解放()
62                 {
63                         if (base.b活性化してる)
64                         {
65                                 TextureFactory.tテクスチャの解放(ref txオプションパネル);
66                                 base.OnManagedリソースの解放();
67                         }
68                 }
69
70                 private void IncrementXY(ref int x, ref int y)
71                 {
72                         if (direction == EOptionPanelDirection.Horizontal)
73                         {
74                                 x += rect.Width;
75                         }
76                         else if (direction == EOptionPanelDirection.Vertical)
77                         {
78                                 y += rect.Height;
79                         }
80                 }
81
82                 private void DrawOption(int idx, Point[] pts, int x, int y)
83                 {
84                         if (idx >= pts.Length)
85                         {
86                                 idx = pts.Length - 1;
87                         }
88                         if (idx < 0)
89                         {
90                                 idx = 0;
91                         }
92                         Point p = pts[idx];
93                         rect.X = p.X * rect.Width;
94                         rect.Y = p.Y * rect.Height;
95                         txオプションパネル.t2D描画(CDTXMania.Instance.Device, x, y, rect);
96                 }
97
98                 public override int On進行描画()
99                 {
100                         if (base.b活性化してる)
101                         {
102                                 if (this.txオプションパネル != null)
103                                 {
104
105                                         for (EPart part = EPart.Drums; part <= EPart.Bass; ++part)
106                                         {
107                                                 if ( CDTXMania.Instance.ConfigIni.b楽器有効(part) &&
108                                                         (
109                                                         (CDTXMania.Instance.r現在のステージ == CDTXMania.Instance.stage演奏画面 && 
110                                                          CDTXMania.Instance.DTX != null && CDTXMania.Instance.DTX.bチップがある[part]) ||
111                                                          CDTXMania.Instance.r現在のステージ != CDTXMania.Instance.stage演奏画面
112                                                         )
113                                                         )
114                                                 {
115                                                         int x = Pos[part].X;
116                                                         int y = Pos[part].Y;
117
118                                                         rect.Width = CDTXMania.Instance.Coordinates.ImgOptionPanel.W;
119                                                         rect.Height = CDTXMania.Instance.Coordinates.ImgOptionPanel.H;
120
121                                                         // Dark
122                                                         DrawOption((int)CDTXMania.Instance.ConfigIni.eDark.Value, ptDark, x, y);
123                                                         IncrementXY(ref x, ref y);
124
125                                                         // ScrollSpeed
126                                                         DrawOption(CDTXMania.Instance.ConfigIni.nScrollSpeed[part] - 1, ptScrollSpeed, x, y);
127                                                         IncrementXY(ref x, ref y);
128
129                                                         // Sud Hid Inv
130                                                         DrawOption((int)CDTXMania.Instance.ConfigIni.eSudHidInv[part].Value, ptSudHidInv, x, y);
131                                                         IncrementXY(ref x, ref y);
132
133                                                         // Reverse
134                                                         DrawOption(CDTXMania.Instance.ConfigIni.bReverse[part] ? 1 : 0, ptReverse, x, y);
135                                                         IncrementXY(ref x, ref y);
136
137                                                         if (part == EPart.Drums)
138                                                         {
139                                                                 // Tight
140                                                                 DrawOption(CDTXMania.Instance.ConfigIni.bTight ? 1 : 0, ptTight, x, y);
141                                                                 IncrementXY(ref x, ref y);
142                                                         }
143
144                                                         if (part == EPart.Guitar || part == EPart.Bass)
145                                                         {
146                                                                 // Random
147                                                                 DrawOption((int)CDTXMania.Instance.ConfigIni.eRandom[part].Value, ptRandom, x, y);
148                                                                 IncrementXY(ref x, ref y);
149
150                                                                 // Light
151                                                                 DrawOption(CDTXMania.Instance.ConfigIni.bLight[part].Value ? 1 : 0, ptLight, x, y);
152                                                                 IncrementXY(ref x, ref y);
153                                                         }
154                                                 }
155                                         }
156                                 }
157                         }
158                         return 0;
159                 }
160         }
161 }