Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/DTXManiaプロジェクト/コード/ステージ/08.結果/CActResultRank.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 574 - (show annotations) (download)
Fri Apr 26 15:19:46 2019 UTC (4 years, 11 months ago) by kairera0467
File size: 16611 byte(s)
#35379 テクスチャの致命的な解放漏れを修正
#xxxxx 曲選択画面で選択中の曲を移動した時に一部の変数が初期化されていなかったのを修正
#xxxxx DTXMania rev:693bf14b0d83efc770235c788117190d08a4e531の変更(CTextureの解放漏れログ)を取り込み
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using System.Drawing;
5 using System.IO;
6 using SlimDX;
7 using FDK;
8
9 namespace DTXMania
10 {
11 internal class CActResultRank : CActivity
12 {
13
14 // コンストラクタ
15
16 public CActResultRank()
17 {
18 base.b活性化してない = true;
19 }
20
21 // メソッド
22
23 public void tアニメを完了させる()
24 {
25 this.ctランク表示.n現在の値 = this.ctランク表示.n終了値;
26 this.ct表示用.n現在の値 = this.ct表示用.n終了値;
27 }
28
29 // CActivity 実装
30
31 public override void On活性化()
32 {
33
34 #region [ 本体位置 ]
35
36 int nX = 138;
37 int nY = 8;
38
39 int nX = 850;
40 int nY = 420;
41
42 this.n本体X[0] = 0;
43 this.n本体Y[0] = 0;
44
45 this.n本体X[1] = 0;
46 this.n本体Y[1] = 0;
47
48 this.n本体X[2] = 0;
49 this.n本体Y[2] = 0;
50
51 if (CDTXMania.ConfigIni.bDrums有効)
52 {
53 this.n本体X[0] = nX;
54 this.n本体Y[0] = nY;
55 }
56 else if (CDTXMania.ConfigIni.bGuitar有効)
57 {
58 if (CDTXMania.DTX.bチップがある.Guitar)
59 {
60 if (CDTXMania.ConfigIni.bIsSwappedGuitarBass)
61 {
62 this.n本体X[1] = nX;
63 this.n本体Y[1] = nY;
64 }
65 else
66 {
67 this.n本体X[1] = nX;
68 this.n本体Y[1] = nY;
69 }
70 }
71
72 if (CDTXMania.DTX.bチップがある.Bass)
73 {
74 if (CDTXMania.ConfigIni.bIsSwappedGuitarBass)
75 {
76 this.n本体X[2] = nX;
77 this.n本体Y[2] = nY;
78 }
79 else
80 {
81 this.n本体X[2] = nX;
82 this.n本体Y[2] = nY;
83 }
84 }
85
86 }
87 #endregion
88
89 this.b全オ.Drums = CDTXMania.ConfigIni.bドラムが全部オトプレイである;
90 this.b全オ.Guitar = CDTXMania.ConfigIni.bギタが全部オトプレイである;
91 this.b全オ.Bass = CDTXMania.ConfigIni.bスが全部オトプレイである;
92
93 this.sdDTXで指定されたフルコンボ音 = null;
94 this.bフルコンボ音再生済み = false;
95 this.bエクセレント音再生済み = false;
96 base.On活性化();
97 }
98 public override void On非活性化()
99 {
100 if( this.ctランク表示 != null )
101 {
102 this.ctランク表示 = null;
103 }
104 if (this.ct表示用 != null)
105 {
106 this.ct表示用 = null;
107 }
108 if (this.sdDTXで指定されたフルコンボ音 != null)
109 {
110 CDTXMania.Sound管理.tサウンドを破棄する(this.sdDTXで指定されたフルコンボ音);
111 this.sdDTXで指定されたフルコンボ音 = null;
112 }
113 base.On非活性化();
114 }
115 public override void OnManagedリソスの作成()
116 {
117 if( !base.b活性化してない )
118 {
119
120 this.txFullCombo = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\ScreenResult fullcombo.png"));
121 this.txExcellent = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\ScreenResult Excellent.png"));
122
123 for (int j = 0; j < 3; j++)
124 {
125 switch (CDTXMania.stage結果.nランク値[j])
126 {
127 case 0:
128 this.txランク文字[j] = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankSS.png"));
129 break;
130
131 case 1:
132 this.txランク文字[j] = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankS.png"));
133 break;
134
135 case 2:
136 this.txランク文字[j] = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankA.png"));
137 break;
138
139 case 3:
140 this.txランク文字[j] = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankB.png"));
141 break;
142
143 case 4:
144 this.txランク文字[j] = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankC.png"));
145 break;
146
147 case 5:
148 this.txランク文字[j] = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankD.png"));
149 break;
150
151 case 6:
152 case 99: // #23534 2010.10.28 yyagi: 演奏チップが0個のときは、rankEと見なす
153 this.txランク文字[j] = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankE.png"));
154 if (this.b全オ[j])
155 this.txランク文字[j] = CDTXMania.tテクスチャの生成(CSkin.Path(@"Graphics\8_rankSS.png"));
156 break;
157
158 default:
159 this.txランク文字[j] = null;
160 break;
161 }
162 }
163 base.OnManagedリソスの作成();
164 }
165 }
166 public override void OnManagedリソスの解放()
167 {
168 if( !base.b活性化してない )
169 {
170 CDTXMania.tテクスチャの解放( ref this.txFullCombo );
171 CDTXMania.tテクスチャの解放( ref this.txExcellent );
172 CDTXMania.t安全にDisposeする( ref this.txランク文字.Drums );
173 CDTXMania.t安全にDisposeする( ref this.txランク文字.Guitar );
174 CDTXMania.t安全にDisposeする( ref this.txランク文字.Bass );
175 base.OnManagedリソスの解放();
176 }
177 }
178 public override int On進行描画()
179 {
180 if( base.b活性化してない )
181 {
182 return 0;
183 }
184 if( base.b初めての進行描画 )
185 {
186 this.ctランク表示 = new CCounter(0, 0x3e8, 2, CDTXMania.Timer);
187 this.ct表示用 = new CCounter(0, 1000, 3, CDTXMania.Timer);
188 base.b初めての進行描画 = false;
189 }
190 this.ctランク表示.t進行();
191 this.ct表示用.t進行();
192
193 if ((CDTXMania.Input管理.Keyboard.bが押されている(0x3c)))
194 {
195 //F7
196 //CDTXMania.stage演奏ドラム画面.actGauge.db現在のゲージ値.Drums = 1.0;
197 //CDTXMania.stage演奏ドラム画面.actAVI.LivePoint = 300.0;
198 //CDTXMania.stage演奏ドラム画面.actGraph.dbグラフ値現在_渡 = 100.0;
199 //CDTXMania.ConfigIni.nヒット範囲ms.Perfect = 1000;
200 this.ct表示用.n現在の値 = 0;
201
202 //CDTXMania.stage結果.st演奏記録.Drums.db演奏型スキル値 = 80.0;
203 }
204
205 if (this.ctランク表示.n現在の値 >= 500)
206 {
207 double num2 = ( (double) ( this.ctランク表示.n現在の値 - 500 ) ) / 500.0;
208 for (int j = 0; j < 3; j++)
209 {
210 if (this.txランク文字[j] != null && this.n本体X[j] != 0)
211 {
212 this.txランク文字[j].t2D描画(CDTXMania.app.Device, this.n本体X[j], this.n本体Y[j], new Rectangle(0, 0, (int)((double)txランク文字[j].sz画像サイズ.Width * num2), this.txランク文字[j].sz画像サイズ.Height));
213 }
214 }
215 }
216
217 #region [ フルコンボ ]
218 for (int j = 0; j < 3; j++)
219 {
220 int num14 = 82 + this.n本体X[j];
221 int num15 = 152 + this.n本体Y[j];
222 if (this.ct表示用.n現在の値 >= 0)
223 {
224 if (this.n本体X[j] != 0)
225 {
226 if (CDTXMania.stage結果.st演奏記録[j].nPerfect == CDTXMania.stage結果.st演奏記録[j].n全チップ数)
227 {
228 if (this.ct表示用.b終了値に達した)
229 {
230 if (this.txExcellent != null)
231 {
232 if( this.ct表示用.n現在の値 >= 900 )
233 this.txExcellent.t2D描画(CDTXMania.app.Device, num14, num15);
234 }
235 if (!this.bエクセレント音再生済み)
236 {
237 if (((CDTXMania.DTX.SOUND_FULLCOMBO != null) && (CDTXMania.DTX.SOUND_FULLCOMBO.Length > 0)) && File.Exists(CDTXMania.DTX.strフォルダ名 + CDTXMania.DTX.SOUND_FULLCOMBO))
238 {
239 try
240 {
241 if (this.sdDTXで指定されたフルコンボ音 != null)
242 {
243 CDTXMania.Sound管理.tサウンドを破棄する(this.sdDTXで指定されたフルコンボ音);
244 this.sdDTXで指定されたフルコンボ音 = null;
245 }
246 this.sdDTXで指定されたフルコンボ音 = CDTXMania.Sound管理.tサウンドを生成する(CDTXMania.DTX.strフォルダ名 + CDTXMania.DTX.SOUND_FULLCOMBO);
247 if (this.sdDTXで指定されたフルコンボ音 != null)
248 {
249 this.sdDTXで指定されたフルコンボ音.t再生を開始する();
250 }
251 }
252 catch
253 {
254 }
255 }
256 else
257 {
258 CDTXMania.Skin.soundエクセレント音.t再生する();
259 }
260 this.bエクセレント音再生済み = true;
261 }
262 }
263 else
264 {
265 double num12 = ((double)(this.ct表示用.n現在の値 - 900)) / 100.0;
266 float num13 = (float)(1.1 - 0.1);
267 if (this.txExcellent != null)
268 {
269 this.txExcellent.vc拡大縮小倍率 = new Vector3(num13, num13, 1f);
270 this.txExcellent.n透明度 = (int)(255.0 * num12);
271 if( this.ct表示用.n現在の値 >= 900 )
272 this.txExcellent.t2D描画(CDTXMania.app.Device, num14, num15);
273 }
274 }
275 }
276 else if (CDTXMania.stage結果.st演奏記録[j].bフルコンボである && CDTXMania.stage結果.st演奏記録[j].nPerfect != CDTXMania.stage結果.st演奏記録[j].n全チップ数)
277 {
278 if (this.ct表示用.b終了値に達した)
279 {
280 if (this.txFullCombo != null)
281 {
282 if( this.ct表示用.n現在の値 >= 900 )
283 this.txFullCombo.t2D描画(CDTXMania.app.Device, num14, num15);
284 }
285 if (!this.bフルコンボ音再生済み)
286 {
287 if (((CDTXMania.DTX.SOUND_FULLCOMBO != null) && (CDTXMania.DTX.SOUND_FULLCOMBO.Length > 0)) && File.Exists(CDTXMania.DTX.strフォルダ名 + CDTXMania.DTX.SOUND_FULLCOMBO))
288 {
289 try
290 {
291 if (this.sdDTXで指定されたフルコンボ音 != null)
292 {
293 CDTXMania.Sound管理.tサウンドを破棄する(this.sdDTXで指定されたフルコンボ音);
294 this.sdDTXで指定されたフルコンボ音 = null;
295 }
296 this.sdDTXで指定されたフルコンボ音 = CDTXMania.Sound管理.tサウンドを生成する(CDTXMania.DTX.strフォルダ名 + CDTXMania.DTX.SOUND_FULLCOMBO);
297 if (this.sdDTXで指定されたフルコンボ音 != null)
298 {
299 this.sdDTXで指定されたフルコンボ音.t再生を開始する();
300 }
301 }
302 catch
303 {
304 }
305 }
306 else
307 {
308 CDTXMania.Skin.soundフルコンボ音.t再生する();
309 }
310 this.bフルコンボ音再生済み = true;
311 }
312 }
313 else
314 {
315 double num12 = ((double)(this.ct表示用.n現在の値 - 900)) / 100.0;
316 float num13 = (float)(1.1 - 0.1);
317 //num14 = this.n本体X[j] + ((int)((this.txFullCombo.sz画像サイズ.Width * (1f - num13)) / 2f));
318 //num15 = this.n本体Y[j] + ((int)((this.txFullCombo.sz画像サイズ.Height * (1f - num13)) / 2f));
319 if (this.txFullCombo != null)
320 {
321 this.txFullCombo.vc拡大縮小倍率 = new Vector3(num13, num13, 1f);
322 this.txFullCombo.n透明度 = (int)(255.0 * num12);
323
324 if( this.ct表示用.n現在の値 >= 900 )
325 this.txFullCombo.t2D描画(CDTXMania.app.Device, num14, num15);
326 }
327 }
328 }
329 }
330 }
331 }
332 #endregion
333
334 if( !this.ctランク表示.b終了値に達した )
335 {
336 return 0;
337 }
338 return 1;
339 }
340
341
342 // その他
343
344 #region [ private ]
345 //-----------------
346 private bool bフルコンボ音再生済み;
347 private bool bエクセレント音再生済み;
348 private CCounter ctランク表示;
349 private CCounter ct表示用;
350 private STDGBVALUE<int> n本体X;
351 private STDGBVALUE<int> n本体Y;
352 private STDGBVALUE<bool> b全オ;
353 private CSound sdDTXで指定されたフルコンボ音;
354 private STDGBVALUE<CTexture> txランク文字;
355 private CTexture txExcellent;
356 private CTexture txFullCombo;
357 //-----------------
358 #endregion
359
360 }
361 }

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26