2 using System.Collections.Generic;
\r
3 using System.Globalization;
\r
5 using System.Windows.Forms;
\r
6 using System.Drawing;
\r
7 using System.Diagnostics;
\r
8 using System.Runtime.InteropServices;
\r
10 using System.Threading;
\r
11 using System.Runtime.Serialization.Formatters.Binary;
\r
13 using SlimDX.Direct3D9;
\r
15 using SampleFramework;
\r
16 using System.Runtime.Serialization;
\r
22 internal class CDTXMania : Game
\r
25 #region [ properties ]
\r
26 public static readonly string VERSION = "107(161001)";
\r
27 public static readonly string SLIMDXDLL = "c_net20x86_Jun2010";
\r
28 public static readonly string D3DXDLL = "d3dx9_43.dll"; // June 2010
\r
29 //public static readonly string D3DXDLL = "d3dx9_42.dll"; // February 2010
\r
30 //public static readonly string D3DXDLL = "d3dx9_41.dll"; // March 2009
\r
31 private static CDTXMania instance = new CDTXMania();
\r
33 public static CDTXMania Instance
\r
40 public C文字コンソール act文字コンソール { get; private set; }
\r
41 public bool bコンパクトモード { get; private set; }
\r
42 public CConfigXml ConfigIni;
\r
43 public CResources Resources;
\r
53 if ((dtx != null) && (Instance != null))
\r
56 Instance.listトップレベルActivities.Remove(dtx);
\r
59 if ((dtx != null) && (Instance != null))
\r
61 Instance.listトップレベルActivities.Add(dtx);
\r
65 public CFPS FPS { get; private set; }
\r
66 public CInput管理 Input管理 { get; private set; }
\r
68 public int nPerfect範囲ms
\r
72 if (stage選曲.r確定された曲 != null)
\r
74 C曲リストノード c曲リストノード = stage選曲.r確定された曲.r親ノード;
\r
75 if (((c曲リストノード != null) && (c曲リストノード.eノード種別 == C曲リストノード.Eノード種別.BOX)) && (c曲リストノード.nPerfect範囲ms >= 0))
\r
77 return c曲リストノード.nPerfect範囲ms;
\r
80 return ConfigIni.nHitRange.Perfect;
\r
83 public int nGreat範囲ms
\r
87 if (stage選曲.r確定された曲 != null)
\r
89 C曲リストノード c曲リストノード = stage選曲.r確定された曲.r親ノード;
\r
90 if (((c曲リストノード != null) && (c曲リストノード.eノード種別 == C曲リストノード.Eノード種別.BOX)) && (c曲リストノード.nGreat範囲ms >= 0))
\r
92 return c曲リストノード.nGreat範囲ms;
\r
95 return ConfigIni.nHitRange.Great;
\r
98 public int nGood範囲ms
\r
102 if (stage選曲.r確定された曲 != null)
\r
104 C曲リストノード c曲リストノード = stage選曲.r確定された曲.r親ノード;
\r
105 if (((c曲リストノード != null) && (c曲リストノード.eノード種別 == C曲リストノード.Eノード種別.BOX)) && (c曲リストノード.nGood範囲ms >= 0))
\r
107 return c曲リストノード.nGood範囲ms;
\r
110 return ConfigIni.nHitRange.Good;
\r
113 public int nPoor範囲ms
\r
117 if (stage選曲.r確定された曲 != null)
\r
119 C曲リストノード c曲リストノード = stage選曲.r確定された曲.r親ノード;
\r
120 if (((c曲リストノード != null) && (c曲リストノード.eノード種別 == C曲リストノード.Eノード種別.BOX)) && (c曲リストノード.nPoor範囲ms >= 0))
\r
122 return c曲リストノード.nPoor範囲ms;
\r
125 return ConfigIni.nHitRange.Poor;
\r
129 public CPad Pad { get; private set; }
\r
130 public Random Random { get; private set; }
\r
131 public CSkin Skin { get; private set; }
\r
132 public CSongs管理 Songs管理 { get; set; }// 2012.1.26 yyagi private解除 CStage起動でのdesirialize読み込みのため
\r
133 public CEnumSongs EnumSongs { get; private set; }
\r
134 public CActEnumSongs actEnumSongs { get; private set; }
\r
135 public CActFlushGPU actFlushGPU { get; private set; }
\r
137 public CSound管理 Sound管理 { get; private set; }
\r
138 public CStage起動 stage起動 { get; private set; }
\r
139 public CStageタイトル stageタイトル { get; private set; }
\r
140 public CStageコンフィグ stageコンフィグ { get; private set; }
\r
141 public CStage選曲 stage選曲 { get; private set; }
\r
142 public CStage曲読み込み stage曲読み込み { get; private set; }
\r
143 public CStage演奏画面共通 stage演奏画面 { get; private set; }
\r
144 public CStage結果 stage結果 { get; private set; }
\r
145 public CStageChangeSkin stageChangeSkin { get; private set; }
\r
146 public CStage終了 stage終了 { get; private set; }
\r
147 public CStage r現在のステージ = null;
\r
148 public CStage r直前のステージ = null;
\r
149 public string strEXEのあるフォルダ { get; private set; }
\r
150 public string strコンパクトモードファイル { get; private set; }
\r
151 public CTimer Timer { get; private set; }
\r
152 public Format TextureFormat = Format.A8R8G8B8;
\r
153 internal IPluginActivity act現在入力を占有中のプラグイン = null;
\r
154 public bool bApplicationActive { get; private set; }
\r
155 public bool b次のタイミングで垂直帰線同期切り替えを行う { get; set; }
\r
156 public bool b次のタイミングで全画面_ウィンドウ切り替えを行う { get; set; }
\r
157 public Coordinates.CCoordinates Coordinates;
\r
158 public Device Device
\r
162 return base.GraphicsDeviceManager.Direct3D9.Device;
\r
165 public CPluginHost PluginHost { get; private set; }
\r
166 public List<STPlugin> listプラグイン = new List<STPlugin>();
\r
168 private Size currentClientSize { get; set; } // #23510 2010.10.27 add yyagi to keep current window size
\r
169 // public static CTimer ct;
\r
170 public IntPtr WindowHandle // 2012.10.24 yyagi; to add ASIO support
\r
174 return base.Window.Handle;
\r
177 public CDTXVmode DTXVmode { get; set; }// #28821 2014.1.23 yyagi
\r
182 private CDTXMania()
\r
186 public void InitializeInstance()
\r
188 #region [ strEXEのあるフォルダを決定する ]
\r
189 // BEGIN #23629 2010.11.13 from: デバッグ時は Application.ExecutablePath が ($SolutionDir)/bin/x86/Debug/ などになり System/ の読み込みに失敗するので、カレントディレクトリを採用する。(プロジェクトのプロパティ→デバッグ→作業ディレクトリが有効になる)
\r
191 strEXEのあるフォルダ = Environment.CurrentDirectory + @"\";
\r
192 //strEXEのあるフォルダ = Path.GetDirectoryName( Environment.GetCommandLineArgs()[ 0 ] ) + @"\";
\r
194 strEXEのあるフォルダ = Path.GetDirectoryName(Application.ExecutablePath) + @"\"; // #23629 2010.11.9 yyagi: set correct pathname where DTXManiaGR.exe is.
\r
196 // END #23629 2010.11.13 from
\r
199 #region [ 言語リソースの初期化 ]
\r
200 Trace.TraceInformation( "言語リソースの初期化を行います。" );
\r
204 Resources = new CResources();
\r
205 Resources.LoadResources( "" );
\r
206 Trace.TraceInformation( "言語リソースの初期化を完了しました。" );
\r
214 #region [ Config.ini の読込み ]
\r
215 ConfigIni = new CConfigXml();
\r
216 CDTXMania.Instance.LoadConfig();
\r
217 // #28200 2011.5.1 yyagi
\r
218 this.Window.EnableSystemMenu = CDTXMania.Instance.ConfigIni.bIsEnabledSystemMenu;
\r
219 // 2012.8.22 Config.iniが無いときに初期値が適用されるよう、この設定行をifブロック外に移動
\r
224 Coordinates = new Coordinates.CCoordinates();
\r
228 Trace.AutoFlush = true;
\r
229 if (ConfigIni.bLog)
\r
233 Trace.Listeners.Add(new CTraceLogListener(new StreamWriter(System.IO.Path.Combine(strEXEのあるフォルダ, "DTXManiaLog.txt"), false, Encoding.GetEncoding("utf-16"))));
\r
235 catch (System.UnauthorizedAccessException) // #24481 2011.2.20 yyagi
\r
237 int c = (CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "ja") ? 0 : 1;
\r
238 string[] mes_writeErr = {
\r
239 "DTXManiaLog.txtへの書き込みができませんでした。書き込みできるようにしてから、再度起動してください。",
\r
240 "Failed to write DTXManiaLog.txt. Please set it writable and try again."
\r
242 MessageBox.Show(mes_writeErr[c], "DTXMania boot error", MessageBoxButtons.OK, MessageBoxIcon.Error);
\r
243 Environment.Exit(1);
\r
246 Trace.WriteLine("");
\r
247 Trace.WriteLine("DTXMania powered by YAMAHA Silent Session Drums");
\r
248 Trace.WriteLine(string.Format("Release: {0}", VERSION));
\r
249 Trace.WriteLine("");
\r
250 Trace.TraceInformation("----------------------");
\r
251 Trace.TraceInformation("■ アプリケーションの初期化");
\r
252 Trace.TraceInformation("OS Version: " + Environment.OSVersion);
\r
253 Trace.TraceInformation("ProcessorCount: " + Environment.ProcessorCount.ToString());
\r
254 Trace.TraceInformation("CLR Version: " + Environment.Version.ToString());
\r
258 Trace.TraceInformation( "言語情報の読み込みを開始します。" );
\r
259 //Debug.WriteLine( "language=" + Resources.Language );
\r
260 //Debug.WriteLine( "settings=" + instance.ConfigIni.strLanguage );
\r
261 Resources.Language = instance.ConfigIni.strLanguage;
\r
262 Trace.TraceInformation( "言語を{0}に設定しました。", Resources.Language );
\r
267 #region [ DTXVmodeクラス の初期化 ]
\r
268 //Trace.TraceInformation( "DTXVモードの初期化を行います。" );
\r
272 DTXVmode = new CDTXVmode();
\r
273 DTXVmode.Enabled = false;
\r
274 //Trace.TraceInformation( "DTXVモードの初期化を完了しました。" );
\r
278 //Trace.Unindent();
\r
281 #region [ コンパクトモードスイッチの有無、もしくは、DTXViewerとしての起動 ]
\r
283 strコンパクトモードファイル = "";
\r
284 string[] commandLineArgs = Environment.GetCommandLineArgs();
\r
285 if ((commandLineArgs != null) && (commandLineArgs.Length > 1))
\r
290 for (int i = 1; i < commandLineArgs.Length; i++)
\r
294 arg += " " + "\"" + commandLineArgs[i] + "\"";
\r
298 arg += commandLineArgs[i];
\r
301 DTXVmode.ParseArguments(arg);
\r
302 if (DTXVmode.Enabled)
\r
304 DTXVmode.Refreshed = false; // 初回起動時は再読み込みに走らせない
\r
305 strコンパクトモードファイル = DTXVmode.filename;
\r
306 switch (DTXVmode.soundDeviceType) // サウンド再生方式の設定
\r
308 case ESoundDeviceType.DirectSound:
\r
309 ConfigIni.nSoundDeviceType.Value = ESoundDeviceTypeForConfig.DSound;
\r
311 case ESoundDeviceType.ExclusiveWASAPI:
\r
312 ConfigIni.nSoundDeviceType.Value = ESoundDeviceTypeForConfig.WASAPI;
\r
314 case ESoundDeviceType.ASIO:
\r
315 ConfigIni.nSoundDeviceType.Value = ESoundDeviceTypeForConfig.ASIO;
\r
316 ConfigIni.strASIODevice.Index = DTXVmode.nASIOdevice;
\r
320 CDTXMania.Instance.ConfigIni.bVSyncWait.Value = DTXVmode.VSyncWait;
\r
321 CDTXMania.Instance.ConfigIni.bTimeStretch.Value = DTXVmode.TimeStretch;
\r
322 if (DTXVmode.GRmode)
\r
324 CDTXMania.Instance.ConfigIni.eActiveInst.Value = EActiveInstrument.GBOnly;
\r
328 CDTXMania.Instance.ConfigIni.eActiveInst.Value = EActiveInstrument.Both;
\r
331 CDTXMania.Instance.ConfigIni.bFullScreen.Value = false;
\r
332 CDTXMania.Instance.ConfigIni.rcWindow_backup = CDTXMania.Instance.ConfigIni.rcWindow; // #36612 2016.9.12 yyagi
\r
333 CDTXMania.Instance.ConfigIni.rcWindow.W = CDTXMania.Instance.ConfigIni.rcViewerWindow.W;
\r
334 CDTXMania.Instance.ConfigIni.rcWindow.H = CDTXMania.Instance.ConfigIni.rcViewerWindow.H;
\r
335 CDTXMania.Instance.ConfigIni.rcWindow.X = CDTXMania.Instance.ConfigIni.rcViewerWindow.X;
\r
336 CDTXMania.Instance.ConfigIni.rcWindow.Y = CDTXMania.Instance.ConfigIni.rcViewerWindow.Y;
\r
338 else // 通常のコンパクトモード
\r
340 strコンパクトモードファイル = commandLineArgs[1];
\r
343 if (!File.Exists(strコンパクトモードファイル)) // #32985 2014.1.23 yyagi
\r
345 Trace.TraceError("コンパクトモードで指定されたファイルが見つかりません。DTXManiaを終了します。[{0}]", strコンパクトモードファイル);
\r
347 Environment.Exit(-1);
\r
349 if (strコンパクトモードファイル == "") // DTXMania未起動状態で、DTXCで再生停止ボタンを押した場合は、何もせず終了
\r
351 Environment.Exit(-1);
\r
355 throw new FileNotFoundException("コンパクトモードで指定されたファイルが見つかりません。DTXManiaを終了します。", strコンパクトモードファイル);
\r
359 if (DTXVmode.Enabled)
\r
361 Trace.TraceInformation("DTXVモードで起動します。[{0}]", strコンパクトモードファイル);
\r
365 Trace.TraceInformation("コンパクトモードで起動します。[{0}]", strコンパクトモードファイル);
\r
370 Trace.TraceInformation( "通常モードで起動します。" );
\r
374 #region [ Input管理 の初期化 ]
\r
375 Trace.TraceInformation("DirectInput, MIDI入力の初期化を行います。");
\r
379 bool bUseMIDIIn = !DTXVmode.Enabled;
\r
380 Input管理 = new CInput管理(base.Window.Handle, bUseMIDIIn);
\r
381 foreach (IInputDevice device in Input管理.list入力デバイス)
\r
383 if ((device.e入力デバイス種別 == E入力デバイス種別.Joystick) && !ConfigIni.dicJoystick.Value.ContainsValue(device.GUID))
\r
386 while (ConfigIni.dicJoystick.Value.ContainsKey(key))
\r
390 ConfigIni.dicJoystick.Value.Add(key, device.GUID);
\r
393 foreach (IInputDevice device2 in Input管理.list入力デバイス)
\r
395 if (device2.e入力デバイス種別 == E入力デバイス種別.Joystick)
\r
397 foreach (KeyValuePair<int, string> pair in ConfigIni.dicJoystick.Value)
\r
399 if (device2.GUID.Equals(pair.Value))
\r
401 ((CInputJoystick)device2).SetID(pair.Key);
\r
408 Trace.TraceInformation("DirectInput の初期化を完了しました。");
\r
410 catch (Exception exception2)
\r
412 Trace.TraceError(exception2.Message);
\r
413 Trace.TraceError("DirectInput, MIDI入力の初期化に失敗しました。");
\r
415 int c = (CultureInfo.CurrentCulture.TwoLetterISOLanguageName == "ja") ? 0 : 1;
\r
416 string[] mes_writeErr = {
\r
417 "DirectInputまたはMIDI入力の初期化に失敗しました。DTXManiaGRを終了します。",
\r
418 "Failed to initialize DirectInput (or MIDI-IN)."
\r
420 MessageBox.Show(mes_writeErr[c], "DTXMania boot error", MessageBoxButtons.OK, MessageBoxIcon.Error);
\r
421 Environment.Exit(1);
\r
429 #region [ ウィンドウ初期化 ]
\r
430 // #30675 2013.02.04 ikanick add
\r
431 base.Window.StartPosition = FormStartPosition.Manual;
\r
432 base.Window.Location = new Point(ConfigIni.rcWindow.X, ConfigIni.rcWindow.Y);
\r
433 // 事前にDTXVmodeの実体を作っておくこと
\r
434 base.Window.Text = this.strWindowTitle;
\r
435 //base.Window.StartPosition = FormStartPosition.Manual;
\r
436 //base.Window.Location = new Point(ConfigIni.rcWindow.X, ConfigIni.rcWindow.Y);
\r
438 // #34510 yyagi 2010.10.31 to change window size got from Config.ini
\r
439 base.Window.ClientSize = new Size(ConfigIni.rcWindow.W, ConfigIni.rcWindow.H);
\r
440 #if !WindowedFullscreen
\r
441 if (!ConfigIni.bウィンドウモード) // #23510 2010.11.02 yyagi: add; to recover window size in case bootup with fullscreen mode
\r
442 { // #30666 2013.02.02 yyagi: currentClientSize should be always made
\r
444 currentClientSize = new Size(ConfigIni.rcWindow.W, ConfigIni.rcWindow.H);
\r
445 #if !WindowedFullscreen
\r
448 // #23510 2010.11.04 yyagi: to support maximizing window
\r
449 base.Window.MaximizeBox = true;
\r
450 // #23510 2010.10.27 yyagi: changed from FixedDialog to Sizable, to support window resize
\r
451 base.Window.FormBorderStyle = FormBorderStyle.Sizable;
\r
452 // #30666 2013.02.02 yyagi: moved the code to t全画面・ウインドウモード切り替え()
\r
453 base.Window.ShowIcon = true;
\r
454 base.Window.Icon = Properties.Resources.dtx;
\r
455 base.Window.KeyDown += new KeyEventHandler(this.Window_KeyDown);
\r
456 base.Window.MouseUp += new MouseEventHandler(this.Window_MouseUp);
\r
457 // #23510 2010.11.13 yyagi: to go fullscreen mode
\r
458 base.Window.MouseDoubleClick += new MouseEventHandler(this.Window_MouseDoubleClick);
\r
459 // #23510 2010.11.20 yyagi: to set resized window size in Config.ini
\r
460 base.Window.ResizeEnd += new EventHandler(this.Window_ResizeEnd);
\r
461 base.Window.ApplicationActivated += new EventHandler(this.Window_ApplicationActivated);
\r
462 base.Window.ApplicationDeactivated += new EventHandler(this.Window_ApplicationDeactivated);
\r
463 base.Window.MouseMove += new MouseEventHandler(this.Window_MouseMove);
\r
466 #region [ Direct3D9Exを使うかどうか判定 ]
\r
469 #region [ Direct3D9 デバイスの生成 ]
\r
470 DeviceSettings settings = new DeviceSettings();
\r
471 #if WindowedFullscreen
\r
472 // #30666 2013.2.2 yyagi: Fullscreenmode is "Maximized window" mode
\r
473 settings.Windowed = true;
\r
475 settings.Windowed = ConfigIni.bウィンドウモード;
\r
477 settings.BackBufferWidth = SampleFramework.GameWindowSize.Width;
\r
478 settings.BackBufferHeight = SampleFramework.GameWindowSize.Height;
\r
479 // settings.BackBufferCount = 3;
\r
480 settings.EnableVSync = ConfigIni.bVSyncWait;
\r
481 // settings.BackBufferFormat = Format.A8R8G8B8;
\r
482 // settings.MultisampleType = MultisampleType.FourSamples;
\r
483 // settings.MultisampleQuality = 4;
\r
484 // settings.MultisampleType = MultisampleType.None;
\r
485 // settings.MultisampleQuality = 0;
\r
486 settings.Multithreaded = true;
\r
490 base.GraphicsDeviceManager.ChangeDevice(settings);
\r
492 catch (DeviceCreationException e)
\r
494 Trace.TraceError(e.ToString());
\r
495 MessageBox.Show(e.Message + e.ToString(), "DTXMania failed to boot: DirectX9 Initialize Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
\r
496 Environment.Exit(-1);
\r
498 Trace.TraceInformation("DeviceCaps = " + base.GraphicsDeviceManager.Direct3D9.Device.Capabilities.DeviceCaps.ToString());
\r
499 Trace.TraceInformation("DeviceCaps2 = " + base.GraphicsDeviceManager.Direct3D9.Device.Capabilities.DeviceCaps2.ToString());
\r
500 Trace.TraceInformation("MaxTextureWidth = " + base.GraphicsDeviceManager.Direct3D9.Device.Capabilities.MaxTextureWidth);
\r
501 Trace.TraceInformation("MaxTextureHeight = " + base.GraphicsDeviceManager.Direct3D9.Device.Capabilities.MaxTextureHeight);
\r
502 Trace.TraceInformation("TextureCaps = " + base.GraphicsDeviceManager.Direct3D9.Device.Capabilities.TextureCaps.ToString());
\r
504 base.IsFixedTimeStep = false;
\r
505 // base.TargetElapsedTime = TimeSpan.FromTicks( 10000000 / 75 );
\r
506 // #23510 2010.10.31 yyagi: to recover window size. width and height are able to get from Config.ini.
\r
507 base.Window.ClientSize = new Size(ConfigIni.rcWindow.W, ConfigIni.rcWindow.H);
\r
508 // #23568 2010.11.3 yyagi: to support valiable sleep value when !IsActive
\r
509 base.InactiveSleepTime = TimeSpan.FromMilliseconds((float)(ConfigIni.nSleepUnfocusMs));
\r
510 // #23568 2010.11.4 ikanick changed ( 1 -> ConfigIni )
\r
511 #if WindowedFullscreen
\r
512 // #30666 2013.2.2 yyagi: finalize settings for "Maximized window mode"
\r
513 this.t全画面_ウィンドウモード切り替え();
\r
515 actFlushGPU = new CActFlushGPU();
\r
520 #region [ Skin の初期化 ]
\r
521 Trace.TraceInformation("スキンの初期化を行います。");
\r
526 CDTXMania.Instance.ConfigIni.strSystemSkinSubfolderPath,
\r
527 CDTXMania.Instance.ConfigIni.bUseBoxDefSkin);
\r
528 // 旧指定のSkinフォルダが消滅していた場合に備える
\r
529 CDTXMania.Instance.ConfigIni.strSystemSkinSubfolderPath.Value = CDTXMania.Instance.Skin.GetCurrentSkinSubfolderFullName(true);
\r
530 Trace.TraceInformation("スキンの初期化を完了しました。");
\r
534 Trace.TraceInformation("スキンの初期化に失敗しました。");
\r
543 #region [ Timer の初期化 ]
\r
544 Trace.TraceInformation("タイマの初期化を行います。");
\r
548 Timer = new CTimer(CTimer.E種別.MultiMedia);
\r
549 Trace.TraceInformation("タイマの初期化を完了しました。");
\r
557 #region [ マウス消去用のタイマーを初期化 ]
\r
558 ccMouseShow = new CCounter();
\r
561 #region [ FPS カウンタの初期化 ]
\r
562 Trace.TraceInformation("FPSカウンタの初期化を行います。");
\r
567 Trace.TraceInformation("FPSカウンタを生成しました。");
\r
575 #region [ act文字コンソールの初期化 ]
\r
576 Trace.TraceInformation("文字コンソールの初期化を行います。");
\r
580 act文字コンソール = new C文字コンソール();
\r
581 Trace.TraceInformation("文字コンソールを生成しました。");
\r
582 act文字コンソール.On活性化();
\r
583 Trace.TraceInformation("文字コンソールを活性化しました。");
\r
584 Trace.TraceInformation("文字コンソールの初期化を完了しました。");
\r
586 catch (Exception exception)
\r
588 Trace.TraceError(exception.Message);
\r
589 Trace.TraceError("文字コンソールの初期化に失敗しました。");
\r
597 #region [ Pad の初期化 ]
\r
598 Trace.TraceInformation("パッドの初期化を行います。");
\r
603 Trace.TraceInformation("パッドの初期化を完了しました。");
\r
605 catch (Exception exception3)
\r
607 Trace.TraceError(exception3.Message);
\r
608 Trace.TraceError("パッドの初期化に失敗しました。");
\r
616 #region [ Sound管理 の初期化 ]
\r
617 Trace.TraceInformation("サウンドデバイスの初期化を行います。");
\r
621 ESoundDeviceType soundDeviceType;
\r
622 switch (CDTXMania.Instance.ConfigIni.nSoundDeviceType.Value)
\r
624 case ESoundDeviceTypeForConfig.DSound:
\r
625 soundDeviceType = ESoundDeviceType.DirectSound;
\r
627 case ESoundDeviceTypeForConfig.ASIO:
\r
628 soundDeviceType = ESoundDeviceType.ASIO;
\r
630 case ESoundDeviceTypeForConfig.WASAPI:
\r
631 soundDeviceType = ESoundDeviceType.ExclusiveWASAPI;
\r
634 soundDeviceType = ESoundDeviceType.Unknown;
\r
637 Sound管理 = new CSound管理(base.Window.Handle,
\r
639 CDTXMania.Instance.ConfigIni.nWASAPIBufferSizeMs,
\r
640 CDTXMania.instance.ConfigIni.bEventDrivenWASAPI,
\r
642 CDTXMania.Instance.ConfigIni.strASIODevice.Index,
\r
643 CDTXMania.Instance.ConfigIni.bUseOSTimer
\r
645 //Sound管理 = FDK.CSound管理.Instance;
\r
646 //Sound管理.t初期化( soundDeviceType, 0, 0, CDTXMania.Instance.ConfigIni.nASIODevice, base.Window.Handle );
\r
648 ShowWindowTitleWithSoundType();
\r
649 FDK.CSound管理.bIsTimeStretch = CDTXMania.Instance.ConfigIni.bTimeStretch;
\r
650 Sound管理.nMasterVolume = CDTXMania.Instance.ConfigIni.nMasterVolume;
\r
651 //FDK.CSound管理.bIsMP3DecodeByWindowsCodec = CDTXMania.Instance.ConfigIni.bNoMP3Streaming;
\r
652 Trace.TraceInformation("サウンドデバイスの初期化を完了しました。");
\r
654 catch (Exception e)
\r
656 Trace.TraceError(e.Message);
\r
665 #region [ Songs管理 の初期化 ]
\r
666 //---------------------
\r
667 Trace.TraceInformation("曲リストの初期化を行います。");
\r
671 Songs管理 = new CSongs管理();
\r
672 // Songs管理_裏読 = new CSongs管理();
\r
673 EnumSongs = new CEnumSongs();
\r
674 actEnumSongs = new CActEnumSongs();
\r
675 Trace.TraceInformation("曲リストの初期化を完了しました。");
\r
677 catch (Exception e)
\r
679 Trace.TraceError(e.Message);
\r
680 Trace.TraceError("曲リストの初期化に失敗しました。");
\r
686 //---------------------
\r
689 #region [ CAvi の初期化 ]
\r
693 #region [ Random の初期化 ]
\r
694 Random = new Random((int)Timer.nシステム時刻);
\r
697 #region [ ステージの初期化 ]
\r
700 stage起動 = new CStage起動();
\r
701 stageタイトル = new CStageタイトル();
\r
702 stageコンフィグ = new CStageコンフィグ();
\r
703 stage選曲 = new CStage選曲();
\r
704 stage曲読み込み = new CStage曲読み込み();
\r
705 stage演奏画面 = new CStage演奏画面共通();
\r
706 stage結果 = new CStage結果();
\r
707 stageChangeSkin = new CStageChangeSkin();
\r
708 stage終了 = new CStage終了();
\r
710 this.listトップレベルActivities = new List<CActivity>();
\r
711 this.listトップレベルActivities.Add(actEnumSongs);
\r
712 this.listトップレベルActivities.Add(act文字コンソール);
\r
713 this.listトップレベルActivities.Add(stage起動);
\r
714 this.listトップレベルActivities.Add(stageタイトル);
\r
715 this.listトップレベルActivities.Add(stageコンフィグ);
\r
716 this.listトップレベルActivities.Add(stage選曲);
\r
717 this.listトップレベルActivities.Add(stage曲読み込み);
\r
718 this.listトップレベルActivities.Add(stage演奏画面);
\r
719 this.listトップレベルActivities.Add(stage結果);
\r
720 this.listトップレベルActivities.Add(stageChangeSkin);
\r
721 this.listトップレベルActivities.Add(stage終了);
\r
722 this.listトップレベルActivities.Add(actFlushGPU);
\r
725 #region [ プラグインの検索と生成 ]
\r
726 PluginHost = new CPluginHost();
\r
728 Trace.TraceInformation("プラグインの検索と生成を行います。");
\r
732 this.tプラグイン検索と生成();
\r
733 Trace.TraceInformation("プラグインの検索と生成を完了しました。");
\r
741 #region [ プラグインの初期化 ]
\r
742 if (this.listプラグイン != null && this.listプラグイン.Count > 0)
\r
744 Trace.TraceInformation("プラグインの初期化を行います。");
\r
748 foreach (STPlugin st in this.listプラグイン)
\r
750 Directory.SetCurrentDirectory(st.strプラグインフォルダ);
\r
751 st.plugin.On初期化(this.PluginHost);
\r
752 st.plugin.OnManagedリソースの作成();
\r
753 st.plugin.OnUnmanagedリソースの作成();
\r
754 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
756 Trace.TraceInformation("すべてのプラグインの初期化を完了しました。");
\r
760 Trace.TraceError("プラグインのどれかの初期化に失敗しました。");
\r
771 Trace.TraceInformation("アプリケーションの初期化を完了しました。");
\r
773 #region [ 最初のステージの起動 ]
\r
774 Trace.TraceInformation("----------------------");
\r
775 Trace.TraceInformation("■ 起動");
\r
777 if (CDTXMania.Instance.bコンパクトモード)
\r
779 r現在のステージ = stage曲読み込み;
\r
783 r現在のステージ = stage起動;
\r
789 public void t全画面_ウィンドウモード切り替え()
\r
791 #if WindowedFullscreen
\r
792 if (ConfigIni != null)
\r
794 DeviceSettings settings = base.GraphicsDeviceManager.CurrentSettings.Clone();
\r
795 if ( ( ConfigIni != null ) && ( ConfigIni.bウィンドウモード != settings.Windowed ) )
\r
798 #if !WindowedFullscreen
\r
799 settings.Windowed = ConfigIni.bウィンドウモード;
\r
801 if (ConfigIni.bウィンドウモード == false) // #23510 2010.10.27 yyagi: backup current window size before going fullscreen mode
\r
803 currentClientSize = this.Window.ClientSize;
\r
804 ConfigIni.rcWindow.W = this.Window.ClientSize.Width;
\r
805 ConfigIni.rcWindow.H = this.Window.ClientSize.Height;
\r
806 // FDK.CTaskBar.ShowTaskBar( false );
\r
808 #if !WindowedFullscreen
\r
809 base.GraphicsDeviceManager.ChangeDevice( settings );
\r
811 if (ConfigIni.bウィンドウモード == true) // #23510 2010.10.27 yyagi: to resume window size from backuped value
\r
813 #if WindowedFullscreen
\r
814 // #30666 2013.2.2 yyagi Don't use Fullscreen mode becasue NVIDIA GeForce is
\r
815 // tend to delay drawing on Fullscreen mode. So DTXMania uses Maximized window
\r
816 // in spite of using fullscreen mode.
\r
817 Instance.Window.WindowState = FormWindowState.Normal;
\r
818 Instance.Window.FormBorderStyle = FormBorderStyle.Sizable;
\r
819 Instance.Window.WindowState = FormWindowState.Normal;
\r
821 base.Window.ClientSize =
\r
822 new Size(currentClientSize.Width, currentClientSize.Height);
\r
823 // FDK.CTaskBar.ShowTaskBar( true );
\r
825 #if WindowedFullscreen
\r
828 Instance.Window.WindowState = FormWindowState.Normal;
\r
829 Instance.Window.FormBorderStyle = FormBorderStyle.None;
\r
830 Instance.Window.WindowState = FormWindowState.Maximized;
\r
832 if (ConfigIni.bウィンドウモード)
\r
834 if (!this.bマウスカーソル表示中)
\r
837 this.bマウスカーソル表示中 = true;
\r
840 else if (this.bマウスカーソル表示中)
\r
843 this.bマウスカーソル表示中 = false;
\r
849 #region [ #24609 リザルト画像をpngで保存する ] // #24609 2011.3.14 yyagi; to save result screen in case BestRank or HiSkill.
\r
851 /// リザルト画像のキャプチャと保存。
\r
853 /// <param name="strFilename">保存するファイル名(フルパス)</param>
\r
854 public bool SaveResultScreen(string strFullPath)
\r
856 string strSavePath = Path.GetDirectoryName(strFullPath);
\r
857 if (!Directory.Exists(strSavePath))
\r
861 Directory.CreateDirectory(strSavePath);
\r
869 // http://www.gamedev.net/topic/594369-dx9slimdxati-incorrect-saving-surface-to-file/
\r
870 using (Surface pSurface = CDTXMania.Instance.Device.GetRenderTarget(0))
\r
872 Surface.ToFile(pSurface, strFullPath, ImageFileFormat.Png);
\r
880 protected override void Initialize()
\r
884 //swlist1 = new List<int>( 8192 );
\r
885 //swlist2 = new List<int>( 8192 );
\r
886 //swlist3 = new List<int>( 8192 );
\r
887 //swlist4 = new List<int>( 8192 );
\r
888 //swlist5 = new List<int>( 8192 );
\r
889 if (this.listトップレベルActivities != null)
\r
891 foreach (CActivity activity in this.listトップレベルActivities)
\r
892 activity.OnManagedリソースの作成();
\r
895 foreach (STPlugin st in this.listプラグイン)
\r
897 Directory.SetCurrentDirectory(st.strプラグインフォルダ);
\r
898 st.plugin.OnManagedリソースの作成();
\r
899 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
902 #region [ 現在の電源プランをバックアップし、HighPerformanceに変更 ]
\r
903 CPowerPlan.BackupCurrentPowerPlan();
\r
904 if ( CDTXMania.Instance.ConfigIni.bForceHighPowerPlan )
\r
906 CPowerPlan.ChangeHighPerformance();
\r
911 #if GPUFlushAfterPresent
\r
912 FrameEnd += dtxmania_FrameEnd;
\r
915 #if GPUFlushAfterPresent
\r
916 void dtxmania_FrameEnd( object sender, EventArgs e ) // GraphicsDeviceManager.game_FrameEnd()後に実行される
\r
917 { // → Present()直後にGPUをFlushする
\r
918 // → 画面のカクツキが頻発したため、ここでのFlushは行わない
\r
919 actFlushGPU.On進行描画(); // Flush GPU
\r
922 protected override void LoadContent()
\r
924 if (ConfigIni.bウィンドウモード)
\r
926 if (!this.bマウスカーソル表示中)
\r
929 this.bマウスカーソル表示中 = true;
\r
932 else if (this.bマウスカーソル表示中)
\r
935 this.bマウスカーソル表示中 = false;
\r
937 this.Device.SetTransform(TransformState.View, Matrix.LookAtLH(new Vector3(0f, 0f, (float)(-SampleFramework.GameWindowSize.Height / 2 * Math.Sqrt(3.0))), new Vector3(0f, 0f, 0f), new Vector3(0f, 1f, 0f)));
\r
938 this.Device.SetTransform(TransformState.Projection, Matrix.PerspectiveFovLH(C変換.DegreeToRadian((float)60f), ((float)this.Device.Viewport.Width) / ((float)this.Device.Viewport.Height), -100f, 100f));
\r
939 this.Device.SetRenderState(RenderState.Lighting, false);
\r
940 this.Device.SetRenderState(RenderState.ZEnable, false);
\r
941 this.Device.SetRenderState(RenderState.AntialiasedLineEnable, false);
\r
942 this.Device.SetRenderState(RenderState.AlphaTestEnable, true);
\r
943 this.Device.SetRenderState(RenderState.AlphaRef, 10);
\r
945 this.Device.SetRenderState(RenderState.MultisampleAntialias, true);
\r
946 this.Device.SetSamplerState(0, SamplerState.MinFilter, TextureFilter.Linear);
\r
947 this.Device.SetSamplerState(0, SamplerState.MagFilter, TextureFilter.Linear);
\r
949 this.Device.SetRenderState<Compare>(RenderState.AlphaFunc, Compare.Greater);
\r
950 this.Device.SetRenderState(RenderState.AlphaBlendEnable, true);
\r
951 this.Device.SetRenderState<Blend>(RenderState.SourceBlend, Blend.SourceAlpha);
\r
952 this.Device.SetRenderState<Blend>(RenderState.DestinationBlend, Blend.InverseSourceAlpha);
\r
953 this.Device.SetTextureStageState(0, TextureStage.AlphaOperation, TextureOperation.Modulate);
\r
954 this.Device.SetTextureStageState(0, TextureStage.AlphaArg1, 2);
\r
955 this.Device.SetTextureStageState(0, TextureStage.AlphaArg2, 1);
\r
957 if (this.listトップレベルActivities != null)
\r
959 foreach (CActivity activity in this.listトップレベルActivities)
\r
960 activity.OnUnmanagedリソースの作成();
\r
963 foreach (STPlugin st in this.listプラグイン)
\r
965 Directory.SetCurrentDirectory(st.strプラグインフォルダ);
\r
966 st.plugin.OnUnmanagedリソースの作成();
\r
967 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
970 protected override void UnloadContent()
\r
972 if (this.listトップレベルActivities != null)
\r
974 foreach (CActivity activity in this.listトップレベルActivities)
\r
975 activity.OnUnmanagedリソースの解放();
\r
978 foreach (STPlugin st in this.listプラグイン)
\r
980 Directory.SetCurrentDirectory(st.strプラグインフォルダ);
\r
981 st.plugin.OnUnmanagedリソースの解放();
\r
982 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
985 protected override void OnExiting(EventArgs e)
\r
987 CPowerPlan.RestoreCurrentPowerPlan(); // 電源プランを元のものに戻す
\r
988 CPowerManagement.tEnableMonitorSuspend(); // スリープ抑止状態を解除
\r
992 protected override void Update(GameTime gameTime)
\r
995 protected override void Draw(GameTime gameTime)
\r
997 Sound管理.t再生中の処理をする();
\r
1001 if (CSound管理.rc演奏用タイマ != null)
\r
1002 CSound管理.rc演奏用タイマ.t更新();
\r
1004 if (Input管理 != null)
\r
1005 Input管理.tポーリング(this.bApplicationActive, CDTXMania.Instance.ConfigIni.bBufferedInput);
\r
1010 //if( Pad != null ) ポーリング時にクリアしたらダメ!曲の開始時に1回だけクリアする。(2010.9.11)
\r
1011 // Pad.st検知したデバイス.Clear();
\r
1013 if (this.Device == null)
\r
1016 if (this.bApplicationActive) // DTXMania本体起動中の本体/モニタの省電力モード移行を抑止
\r
1017 CPowerManagement.tDisableMonitorSuspend();
\r
1019 // #xxxxx 2013.4.8 yyagi; sleepの挿入位置を、EndScnene~Present間から、BeginScene前に移動。描画遅延を小さくするため。
\r
1021 if (ConfigIni.nSleepPerFrameMs >= 0) // #xxxxx 2011.11.27 yyagi
\r
1023 Thread.Sleep(ConfigIni.nSleepPerFrameMs);
\r
1027 #region [ DTXCreatorからの指示 ]
\r
1028 if (this.Window.IsReceivedMessage) // ウインドウメッセージで、
\r
1030 string strMes = this.Window.strMessage;
\r
1031 this.Window.IsReceivedMessage = false;
\r
1033 if (strMes != null)
\r
1035 DTXVmode.ParseArguments(strMes);
\r
1037 if (DTXVmode.Enabled)
\r
1040 strコンパクトモードファイル = DTXVmode.filename;
\r
1041 if (DTXVmode.Command == CDTXVmode.ECommand.Preview)
\r
1043 // preview soundの再生
\r
1044 string strPreviewFilename = DTXVmode.previewFilename;
\r
1045 //Trace.TraceInformation( "Preview Filename=" + DTXVmode.previewFilename );
\r
1048 if (this.previewSound != null)
\r
1050 this.previewSound.tサウンドを停止する();
\r
1051 this.previewSound.Dispose();
\r
1052 this.previewSound = null;
\r
1054 this.previewSound = CDTXMania.Instance.Sound管理.tサウンドを生成する(strPreviewFilename);
\r
1055 this.previewSound.n音量 = DTXVmode.previewVolume;
\r
1056 this.previewSound.n位置 = DTXVmode.previewPan;
\r
1057 this.previewSound.t再生を開始する();
\r
1058 Trace.TraceInformation("DTXCからの指示で、サウンドを生成しました。({0})", strPreviewFilename);
\r
1062 Trace.TraceError("DTXCからの指示での、サウンドの生成に失敗しました。({0})", strPreviewFilename);
\r
1063 if (this.previewSound != null)
\r
1065 this.previewSound.Dispose();
\r
1067 this.previewSound = null;
\r
1075 this.Device.BeginScene();
\r
1076 this.Device.Clear(ClearFlags.ZBuffer | ClearFlags.Target, Color.Black, 1f, 0);
\r
1078 if (r現在のステージ != null)
\r
1080 this.n進行描画の戻り値 = (r現在のステージ != null) ? r現在のステージ.On進行描画() : 0;
\r
1082 #region [ プラグインの進行描画 ]
\r
1083 //---------------------
\r
1084 foreach (STPlugin sp in this.listプラグイン)
\r
1086 Directory.SetCurrentDirectory(sp.strプラグインフォルダ);
\r
1088 if (CDTXMania.Instance.act現在入力を占有中のプラグイン == null || CDTXMania.Instance.act現在入力を占有中のプラグイン == sp.plugin)
\r
1089 sp.plugin.On進行描画(CDTXMania.Instance.Pad, CDTXMania.Instance.Input管理.Keyboard);
\r
1091 sp.plugin.On進行描画(null, null);
\r
1093 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1095 //---------------------
\r
1099 CScoreIni scoreIni = null;
\r
1101 if (Control.IsKeyLocked(Keys.CapsLock)) // #30925 2013.3.11 yyagi; capslock=ON時は、EnumSongsしないようにして、起動負荷とASIOの音切れの関係を確認する
\r
1103 // → songs.db等の書き込み時だと音切れするっぽい
\r
1104 actEnumSongs.On非活性化();
\r
1105 EnumSongs.SongListEnumCompletelyDone();
\r
1106 CDTXMania.Instance.stage選曲.bIsEnumeratingSongs = false;
\r
1108 #region [ 曲検索スレッドの起動/終了 ここに"Enumerating Songs..."表示を集約 ]
\r
1109 if (!CDTXMania.Instance.bコンパクトモード)
\r
1111 actEnumSongs.On進行描画(); // "Enumerating Songs..."アイコンの描画
\r
1113 switch (r現在のステージ.eステージID)
\r
1115 case CStage.Eステージ.タイトル:
\r
1116 case CStage.Eステージ.コンフィグ:
\r
1117 case CStage.Eステージ.選曲:
\r
1118 case CStage.Eステージ.曲読み込み:
\r
1119 if (EnumSongs != null)
\r
1121 #region [ (特定条件時) 曲検索スレッドの起動・開始 ]
\r
1122 if (r現在のステージ.eステージID == CStage.Eステージ.タイトル &&
\r
1123 r直前のステージ.eステージID == CStage.Eステージ.起動 &&
\r
1124 this.n進行描画の戻り値 == (int)CStageタイトル.E戻り値.継続 &&
\r
1125 !EnumSongs.IsSongListEnumStarted)
\r
1127 actEnumSongs.On活性化();
\r
1128 CDTXMania.Instance.stage選曲.bIsEnumeratingSongs = true;
\r
1129 EnumSongs.Init(CDTXMania.Instance.Songs管理.listSongsDB, CDTXMania.Instance.Songs管理.nSongsDBから取得できたスコア数); // songs.db情報と、取得した曲数を、新インスタンスにも与える
\r
1130 EnumSongs.StartEnumFromDisk(); // 曲検索スレッドの起動・開始
\r
1131 if (CDTXMania.Instance.Songs管理.nSongsDBから取得できたスコア数 == 0) // もし初回起動なら、検索スレッドのプライオリティをLowestでなくNormalにする
\r
1133 EnumSongs.ChangeEnumeratePriority(ThreadPriority.Normal);
\r
1138 #region [ 曲検索の中断と再開 ]
\r
1139 if (r現在のステージ.eステージID == CStage.Eステージ.選曲 && !EnumSongs.IsSongListEnumCompletelyDone)
\r
1141 switch (this.n進行描画の戻り値)
\r
1144 //if ( CDTXMania.Instance.stage選曲.bIsEnumeratingSongs )
\r
1145 if (!CDTXMania.Instance.stage選曲.bIsPlayingPremovie)
\r
1147 EnumSongs.Resume(); // #27060 2012.2.6 yyagi 中止していたバックグランド曲検索を再開
\r
1148 EnumSongs.IsSlowdown = false;
\r
1152 // EnumSongs.Suspend(); // #27060 2012.3.2 yyagi #PREMOVIE再生中は曲検索を低速化
\r
1153 EnumSongs.IsSlowdown = true;
\r
1155 actEnumSongs.On活性化();
\r
1159 EnumSongs.Suspend(); // #27060 バックグラウンドの曲検索を一時停止
\r
1160 actEnumSongs.On非活性化();
\r
1166 #region [ 曲探索中断待ち待機 ]
\r
1167 if (r現在のステージ.eステージID == CStage.Eステージ.曲読み込み && !EnumSongs.IsSongListEnumCompletelyDone &&
\r
1168 EnumSongs.thDTXFileEnumerate != null) // #28700 2012.6.12 yyagi; at Compact mode, enumerating thread does not exist.
\r
1170 EnumSongs.WaitUntilSuspended(); // 念のため、曲検索が一時中断されるまで待機
\r
1174 #region [ 曲検索が完了したら、実際の曲リストに反映する ]
\r
1175 // CStage選曲.On活性化() に回した方がいいかな?
\r
1176 if (EnumSongs.IsSongListEnumerated)
\r
1178 actEnumSongs.On非活性化();
\r
1179 CDTXMania.Instance.stage選曲.bIsEnumeratingSongs = false;
\r
1181 bool bRemakeSongTitleBar = (r現在のステージ.eステージID == CStage.Eステージ.選曲) ? true : false;
\r
1182 CDTXMania.Instance.stage選曲.Refresh(EnumSongs.Songs管理, bRemakeSongTitleBar);
\r
1183 EnumSongs.SongListEnumCompletelyDone();
\r
1191 switch (r現在のステージ.eステージID)
\r
1193 case CStage.Eステージ.何もしない:
\r
1196 case CStage.Eステージ.起動:
\r
1198 //-----------------------------
\r
1199 if (this.n進行描画の戻り値 != 0)
\r
1203 r現在のステージ.On非活性化();
\r
1204 Trace.TraceInformation("----------------------");
\r
1205 Trace.TraceInformation("■ タイトル");
\r
1206 stageタイトル.On活性化();
\r
1207 r直前のステージ = r現在のステージ;
\r
1208 r現在のステージ = stageタイトル;
\r
1212 r現在のステージ.On非活性化();
\r
1213 Trace.TraceInformation("----------------------");
\r
1214 Trace.TraceInformation("■ 曲読み込み");
\r
1215 stage曲読み込み.On活性化();
\r
1216 r直前のステージ = r現在のステージ;
\r
1217 r現在のステージ = stage曲読み込み;
\r
1220 foreach (STPlugin pg in this.listプラグイン)
\r
1222 Directory.SetCurrentDirectory(pg.strプラグインフォルダ);
\r
1223 pg.plugin.Onステージ変更();
\r
1224 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1227 this.tガベージコレクションを実行する();
\r
1229 //-----------------------------
\r
1233 case CStage.Eステージ.タイトル:
\r
1235 //-----------------------------
\r
1236 switch (this.n進行描画の戻り値)
\r
1238 case (int)CStageタイトル.E戻り値.GAMESTART:
\r
1240 //-----------------------------
\r
1241 r現在のステージ.On非活性化();
\r
1242 Trace.TraceInformation("----------------------");
\r
1243 Trace.TraceInformation("■ 選曲");
\r
1245 r直前のステージ = r現在のステージ;
\r
1246 r現在のステージ = stage選曲;
\r
1247 //-----------------------------
\r
1251 #region [ OPTION: 廃止済 ]
\r
1252 // case 2: // #24525 OPTIONとCONFIGの統合に伴い、OPTIONは廃止
\r
1253 // #region [ *** ]
\r
1254 // //-----------------------------
\r
1255 // r現在のステージ.On非活性化();
\r
1256 // Trace.TraceInformation( "----------------------" );
\r
1257 // Trace.TraceInformation( "■ オプション" );
\r
1258 // stageオプション.On活性化();
\r
1259 // r直前のステージ = r現在のステージ;
\r
1260 // r現在のステージ = stageオプション;
\r
1261 // //-----------------------------
\r
1266 case (int)CStageタイトル.E戻り値.CONFIG:
\r
1268 //-----------------------------
\r
1269 r現在のステージ.On非活性化();
\r
1270 Trace.TraceInformation("----------------------");
\r
1271 Trace.TraceInformation("■ コンフィグ");
\r
1272 stageコンフィグ.On活性化();
\r
1273 r直前のステージ = r現在のステージ;
\r
1274 r現在のステージ = stageコンフィグ;
\r
1275 //-----------------------------
\r
1279 case (int)CStageタイトル.E戻り値.EXIT:
\r
1281 //-----------------------------
\r
1282 r現在のステージ.On非活性化();
\r
1283 Trace.TraceInformation("----------------------");
\r
1284 Trace.TraceInformation("■ 終了");
\r
1286 r直前のステージ = r現在のステージ;
\r
1287 r現在のステージ = stage終了;
\r
1288 //-----------------------------
\r
1293 foreach (STPlugin pg in this.listプラグイン)
\r
1295 Directory.SetCurrentDirectory(pg.strプラグインフォルダ);
\r
1296 pg.plugin.Onステージ変更();
\r
1297 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1300 //this.tガベージコレクションを実行する(); // #31980 2013.9.3 yyagi タイトル画面でだけ、毎フレームGCを実行して重くなっていた問題の修正
\r
1301 //-----------------------------
\r
1305 case CStage.Eステージ.コンフィグ:
\r
1307 //-----------------------------
\r
1308 if (this.n進行描画の戻り値 != 0)
\r
1310 switch (r直前のステージ.eステージID)
\r
1312 case CStage.Eステージ.タイトル:
\r
1314 //-----------------------------
\r
1315 r現在のステージ.On非活性化();
\r
1316 Trace.TraceInformation("----------------------");
\r
1317 Trace.TraceInformation("■ タイトル");
\r
1318 stageタイトル.On活性化();
\r
1319 r直前のステージ = r現在のステージ;
\r
1320 r現在のステージ = stageタイトル;
\r
1322 foreach (STPlugin pg in this.listプラグイン)
\r
1324 Directory.SetCurrentDirectory(pg.strプラグインフォルダ);
\r
1325 pg.plugin.Onステージ変更();
\r
1326 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1329 this.tガベージコレクションを実行する();
\r
1331 //-----------------------------
\r
1334 case CStage.Eステージ.選曲:
\r
1336 //-----------------------------
\r
1337 r現在のステージ.On非活性化();
\r
1338 Trace.TraceInformation("----------------------");
\r
1339 Trace.TraceInformation("■ 選曲");
\r
1341 r直前のステージ = r現在のステージ;
\r
1342 r現在のステージ = stage選曲;
\r
1344 foreach (STPlugin pg in this.listプラグイン)
\r
1346 Directory.SetCurrentDirectory(pg.strプラグインフォルダ);
\r
1347 pg.plugin.Onステージ変更();
\r
1348 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1351 this.tガベージコレクションを実行する();
\r
1353 //-----------------------------
\r
1357 //-----------------------------
\r
1361 case CStage.Eステージ.選曲:
\r
1363 //-----------------------------
\r
1364 switch (this.n進行描画の戻り値)
\r
1366 case (int)CStage選曲.E戻り値.タイトルに戻る:
\r
1368 //-----------------------------
\r
1369 r現在のステージ.On非活性化();
\r
1370 Trace.TraceInformation("----------------------");
\r
1371 Trace.TraceInformation("■ タイトル");
\r
1372 stageタイトル.On活性化();
\r
1373 r直前のステージ = r現在のステージ;
\r
1374 r現在のステージ = stageタイトル;
\r
1376 foreach (STPlugin pg in this.listプラグイン)
\r
1378 Directory.SetCurrentDirectory(pg.strプラグインフォルダ);
\r
1379 pg.plugin.Onステージ変更();
\r
1380 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1383 this.tガベージコレクションを実行する();
\r
1385 //-----------------------------
\r
1388 case (int)CStage選曲.E戻り値.選曲した:
\r
1390 //-----------------------------
\r
1391 r現在のステージ.On非活性化();
\r
1392 Trace.TraceInformation("----------------------");
\r
1393 Trace.TraceInformation("■ 曲読み込み");
\r
1394 stage曲読み込み.On活性化();
\r
1395 r直前のステージ = r現在のステージ;
\r
1396 r現在のステージ = stage曲読み込み;
\r
1398 foreach (STPlugin pg in this.listプラグイン)
\r
1400 Directory.SetCurrentDirectory(pg.strプラグインフォルダ);
\r
1401 pg.plugin.Onステージ変更();
\r
1402 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1405 this.tガベージコレクションを実行する();
\r
1407 //-----------------------------
\r
1410 case (int)CStage選曲.E戻り値.コンフィグ呼び出し:
\r
1412 //-----------------------------
\r
1413 r現在のステージ.On非活性化();
\r
1414 Trace.TraceInformation("----------------------");
\r
1415 Trace.TraceInformation("■ コンフィグ");
\r
1416 stageコンフィグ.On活性化();
\r
1417 r直前のステージ = r現在のステージ;
\r
1418 r現在のステージ = stageコンフィグ;
\r
1420 foreach (STPlugin pg in this.listプラグイン)
\r
1422 Directory.SetCurrentDirectory(pg.strプラグインフォルダ);
\r
1423 pg.plugin.Onステージ変更();
\r
1424 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1427 this.tガベージコレクションを実行する();
\r
1429 //-----------------------------
\r
1432 case (int)CStage選曲.E戻り値.スキン変更:
\r
1435 //-----------------------------
\r
1436 r現在のステージ.On非活性化();
\r
1437 Trace.TraceInformation("----------------------");
\r
1438 Trace.TraceInformation("■ スキン切り替え");
\r
1439 stageChangeSkin.On活性化();
\r
1440 r直前のステージ = r現在のステージ;
\r
1441 r現在のステージ = stageChangeSkin;
\r
1443 //-----------------------------
\r
1446 //-----------------------------
\r
1450 case CStage.Eステージ.曲読み込み:
\r
1452 //-----------------------------
\r
1453 DTXVmode.Refreshed = false; // 曲のリロード中に発生した再リロードは、無視する。
\r
1454 if (this.n進行描画の戻り値 != 0)
\r
1456 CDTXMania.Instance.Pad.st検知したデバイス.Clear(); // 入力デバイスフラグクリア(2010.9.11)
\r
1457 r現在のステージ.On非活性化();
\r
1458 #region [ ESC押下時は、曲の読み込みを中止して選曲画面に戻る ]
\r
1459 if (this.n進行描画の戻り値 == (int)E曲読込画面の戻り値.読込中止)
\r
1461 //DTX.t全チップの再生停止();
\r
1463 Trace.TraceInformation("曲の読み込みを中止しました。");
\r
1464 this.tガベージコレクションを実行する();
\r
1465 Trace.TraceInformation("----------------------");
\r
1466 Trace.TraceInformation("■ 選曲");
\r
1468 r直前のステージ = r現在のステージ;
\r
1469 r現在のステージ = stage選曲;
\r
1470 foreach (STPlugin pg in this.listプラグイン)
\r
1472 Directory.SetCurrentDirectory(pg.strプラグインフォルダ);
\r
1473 pg.plugin.Onステージ変更();
\r
1474 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1480 Trace.TraceInformation("----------------------");
\r
1481 Trace.TraceInformation("■ 演奏(ドラム画面)");
\r
1482 r直前のステージ = r現在のステージ;
\r
1483 r現在のステージ = stage演奏画面;
\r
1485 foreach (STPlugin pg in this.listプラグイン)
\r
1487 Directory.SetCurrentDirectory(pg.strプラグインフォルダ);
\r
1488 pg.plugin.Onステージ変更();
\r
1489 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1492 this.tガベージコレクションを実行する();
\r
1494 //-----------------------------
\r
1498 case CStage.Eステージ.演奏:
\r
1500 //-----------------------------
\r
1501 //long n1 = FDK.CSound管理.rc演奏用タイマ.nシステム時刻ms;
\r
1502 //long n2 = FDK.CSound管理.SoundDevice.n経過時間ms;
\r
1503 //long n3 = FDK.CSound管理.SoundDevice.tmシステムタイマ.nシステム時刻ms;
\r
1504 //long n4 = FDK.CSound管理.rc演奏用タイマ.n現在時刻;
\r
1505 //long n5 = FDK.CSound管理.SoundDevice.n経過時間を更新したシステム時刻ms;
\r
1507 //swlist1.Add( Convert.ToInt32(n1) );
\r
1508 //swlist2.Add( Convert.ToInt32(n2) );
\r
1509 //swlist3.Add( Convert.ToInt32( n3 ) );
\r
1510 //swlist4.Add( Convert.ToInt32( n4 ) );
\r
1511 //swlist5.Add( Convert.ToInt32( n5 ) );
\r
1513 #region [ DTXVモード中にDTXCreatorから指示を受けた場合の処理 ]
\r
1514 if (DTXVmode.Enabled && DTXVmode.Refreshed)
\r
1516 DTXVmode.Refreshed = false;
\r
1518 if (DTXVmode.Command == CDTXVmode.ECommand.Stop)
\r
1520 CDTXMania.Instance.stage演奏画面.t停止();
\r
1522 if (previewSound != null)
\r
1524 this.previewSound.tサウンドを停止する();
\r
1525 this.previewSound.Dispose();
\r
1526 this.previewSound = null;
\r
1531 // for ( int i = 0; i < swlist1.Count; i++ )
\r
1533 // int d1 = swlist1[ i ];
\r
1534 // int d2 = swlist2[ i ];
\r
1535 // int d3 = swlist3[ i ];
\r
1536 // int d4 = swlist4[ i ];
\r
1537 // int d5 = swlist5[ i ];
\r
1539 // int dif = d1 - lastd;
\r
1541 // if ( 16 <= dif && dif <= 17 )
\r
1548 // Trace.TraceInformation( "frame {0:D4}: {1:D3} ( {2:D3}, {3:D3} - {7:D3}, {4:D3} ) {5}, n現在時刻={6}", f, dif, d1, d2, d3, s, d4, d5 );
\r
1552 // swlist1.Clear();
\r
1553 // swlist2.Clear();
\r
1554 // swlist3.Clear();
\r
1555 // swlist4.Clear();
\r
1556 // swlist5.Clear();
\r
1560 else if (DTXVmode.Command == CDTXVmode.ECommand.Play)
\r
1562 if (DTXVmode.NeedReload)
\r
1564 CDTXMania.Instance.stage演奏画面.t再読込();
\r
1565 if (DTXVmode.GRmode)
\r
1567 CDTXMania.Instance.ConfigIni.eActiveInst.Value = EActiveInstrument.GBOnly;
\r
1571 CDTXMania.Instance.ConfigIni.eActiveInst.Value = EActiveInstrument.Both;
\r
1573 CDTXMania.Instance.ConfigIni.bTimeStretch.Value = DTXVmode.TimeStretch;
\r
1574 CSound管理.bIsTimeStretch = DTXVmode.TimeStretch;
\r
1575 if (CDTXMania.Instance.ConfigIni.bVSyncWait != DTXVmode.VSyncWait)
\r
1577 CDTXMania.Instance.ConfigIni.bVSyncWait.Value = DTXVmode.VSyncWait;
\r
1578 CDTXMania.Instance.b次のタイミングで垂直帰線同期切り替えを行う = true;
\r
1583 CDTXMania.Instance.stage演奏画面.t演奏位置の変更(CDTXMania.Instance.DTXVmode.nStartBar);
\r
1589 switch (this.n進行描画の戻り値)
\r
1591 case (int)E演奏画面の戻り値.再読込_再演奏:
\r
1592 #region [ DTXファイルを再読み込みして、再演奏 ]
\r
1595 r現在のステージ.On非活性化();
\r
1596 stage曲読み込み.On活性化();
\r
1597 r直前のステージ = r現在のステージ;
\r
1598 r現在のステージ = stage曲読み込み;
\r
1599 this.tガベージコレクションを実行する();
\r
1603 //case (int) E演奏画面の戻り値.再演奏:
\r
1604 #region [ 再読み込み無しで、再演奏 ]
\r
1608 case (int)E演奏画面の戻り値.継続:
\r
1611 case (int)E演奏画面の戻り値.演奏中断:
\r
1612 #region [ 演奏キャンセル ]
\r
1613 //-----------------------------
\r
1614 scoreIni = this.tScoreIniへBGMAdjustとHistoryとPlayCountを更新("Play canceled");
\r
1615 if (CDTXMania.Instance.ConfigIni.bIsSwappedGuitarBass) // #35417 2015.8.18 yyagi Gt/Bsを入れ替えていたなら、演奏設定を元に戻す
\r
1617 //CDTXMania.Instance.DTX.SwapGuitarBassInfos(); // 譜面情報も元に戻す (現在は再演奏機能なしのため、元に戻す必要はない)
\r
1622 //for (int i = 0; i < swlist1.Count; i++)
\r
1624 // int d1 = swlist1[ i ];
\r
1625 // int d2 = swlist2[ i ];
\r
1626 // int d3 = swlist3[ i ];
\r
1627 // int d4 = swlist4[ i ];
\r
1629 // int dif = d1 - lastd;
\r
1631 // if ( 16 <= dif && dif <= 17 )
\r
1638 // Trace.TraceInformation( "frame {0:D4}: {1:D3} ( {2:D3}, {3:D3}, {4:D3} ) {5}, n現在時刻={6}", f, dif, d1, d2, d3, s, d4 );
\r
1642 //swlist1.Clear();
\r
1643 //swlist2.Clear();
\r
1644 //swlist3.Clear();
\r
1645 //swlist4.Clear();
\r
1647 #region [ プラグイン On演奏キャンセル() の呼び出し ]
\r
1648 //---------------------
\r
1649 foreach (STPlugin pg in this.listプラグイン)
\r
1651 Directory.SetCurrentDirectory(pg.strプラグインフォルダ);
\r
1652 pg.plugin.On演奏キャンセル(scoreIni);
\r
1653 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1655 //---------------------
\r
1660 r現在のステージ.On非活性化();
\r
1663 base.Window.Close();
\r
1667 Trace.TraceInformation("----------------------");
\r
1668 Trace.TraceInformation("■ 選曲");
\r
1670 r直前のステージ = r現在のステージ;
\r
1671 r現在のステージ = stage選曲;
\r
1673 #region [ プラグイン Onステージ変更() の呼び出し ]
\r
1674 //---------------------
\r
1675 foreach (STPlugin pg in this.listプラグイン)
\r
1677 Directory.SetCurrentDirectory(pg.strプラグインフォルダ);
\r
1678 pg.plugin.Onステージ変更();
\r
1679 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1681 //---------------------
\r
1684 this.tガベージコレクションを実行する();
\r
1687 //-----------------------------
\r
1690 case (int)E演奏画面の戻り値.ステージ失敗:
\r
1691 #region [ 演奏失敗(StageFailed) ]
\r
1692 //-----------------------------
\r
1693 scoreIni = this.tScoreIniへBGMAdjustとHistoryとPlayCountを更新("Stage failed");
\r
1695 #region [ プラグイン On演奏失敗() の呼び出し ]
\r
1696 //---------------------
\r
1697 foreach (STPlugin pg in this.listプラグイン)
\r
1699 Directory.SetCurrentDirectory(pg.strプラグインフォルダ);
\r
1700 pg.plugin.On演奏失敗(scoreIni);
\r
1701 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1703 //---------------------
\r
1708 r現在のステージ.On非活性化();
\r
1711 base.Window.Close();
\r
1715 Trace.TraceInformation("----------------------");
\r
1716 Trace.TraceInformation("■ 選曲");
\r
1718 r直前のステージ = r現在のステージ;
\r
1719 r現在のステージ = stage選曲;
\r
1721 #region [ プラグイン Onステージ変更() の呼び出し ]
\r
1722 //---------------------
\r
1723 foreach (STPlugin pg in this.listプラグイン)
\r
1725 Directory.SetCurrentDirectory(pg.strプラグインフォルダ);
\r
1726 pg.plugin.Onステージ変更();
\r
1727 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1729 //---------------------
\r
1732 this.tガベージコレクションを実行する();
\r
1735 //-----------------------------
\r
1738 case (int)E演奏画面の戻り値.ステージクリア:
\r
1740 //-----------------------------
\r
1741 STDGBSValue<CScoreIni.C演奏記録> record;
\r
1742 record = stage演奏画面.Record;
\r
1744 double playskill = 0.0;
\r
1746 for (EPart inst = EPart.Drums; inst <= EPart.Bass; ++inst)
\r
1748 if (!record[inst].b全AUTOである && record[inst].n全チップ数 > 0)
\r
1750 playskill = record[inst].db演奏型スキル値;
\r
1754 string str = "Cleared";
\r
1755 switch (CScoreIni.t総合ランク値を計算して返す(record))
\r
1757 case CScoreIni.ERANK.SS:
\r
1758 str = string.Format("Cleared (SS: {0:F2})", playskill);
\r
1761 case CScoreIni.ERANK.S:
\r
1762 str = string.Format("Cleared (S: {0:F2})", playskill);
\r
1765 case CScoreIni.ERANK.A:
\r
1766 str = string.Format("Cleared (A: {0:F2})", playskill);
\r
1769 case CScoreIni.ERANK.B:
\r
1770 str = string.Format("Cleared (B: {0:F2})", playskill);
\r
1773 case CScoreIni.ERANK.C:
\r
1774 str = string.Format("Cleared (C: {0:F2})", playskill);
\r
1777 case CScoreIni.ERANK.D:
\r
1778 str = string.Format("Cleared (D: {0:F2})", playskill);
\r
1781 case CScoreIni.ERANK.E:
\r
1782 str = string.Format("Cleared (E: {0:F2})", playskill);
\r
1785 case CScoreIni.ERANK.UNKNOWN: // #23534 2010.10.28 yyagi add: 演奏チップが0個のとき
\r
1786 str = "Cleared (No chips)";
\r
1790 scoreIni = this.tScoreIniへBGMAdjustとHistoryとPlayCountを更新(str);
\r
1792 #region [ プラグイン On演奏クリア() の呼び出し ]
\r
1793 //---------------------
\r
1794 foreach (STPlugin pg in this.listプラグイン)
\r
1796 Directory.SetCurrentDirectory(pg.strプラグインフォルダ);
\r
1797 pg.plugin.On演奏クリア(scoreIni);
\r
1798 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1800 //---------------------
\r
1803 r現在のステージ.On非活性化();
\r
1804 Trace.TraceInformation("----------------------");
\r
1805 Trace.TraceInformation("■ 結果");
\r
1806 stage結果.st演奏記録 = record;
\r
1807 stage結果.r空うちドラムチップ = stage演奏画面.GetNoChipDrums();
\r
1809 r直前のステージ = r現在のステージ;
\r
1810 r現在のステージ = stage結果;
\r
1812 #region [ プラグイン Onステージ変更() の呼び出し ]
\r
1813 //---------------------
\r
1814 foreach (STPlugin pg in this.listプラグイン)
\r
1816 Directory.SetCurrentDirectory(pg.strプラグインフォルダ);
\r
1817 pg.plugin.Onステージ変更();
\r
1818 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1820 //---------------------
\r
1824 //-----------------------------
\r
1827 //-----------------------------
\r
1831 case CStage.Eステージ.結果:
\r
1833 //-----------------------------
\r
1834 if (this.n進行描画の戻り値 != 0)
\r
1836 // #35417 2015.08.30 chnmr0 changed : ステージクリア処理で入れ替えるため元に戻した
\r
1837 // #35417 2015.8.18 yyagi: AUTO系のフラグ入れ替えは削除可能!?。以後AUTOフラグに全くアクセスしておらず、意味がないため。
\r
1838 if (CDTXMania.Instance.ConfigIni.bIsSwappedGuitarBass) // #24415 2011.2.27 yyagi Gt/Bsを入れ替えていたなら、Auto状態をリザルト画面終了後に元に戻す
\r
1840 CDTXMania.Instance.ConfigIni.SwapGuitarBassInfos_AutoFlags(); // Auto入れ替え
\r
1843 DTX.t全チップの再生一時停止();
\r
1845 r現在のステージ.On非活性化();
\r
1848 Trace.TraceInformation("----------------------");
\r
1849 Trace.TraceInformation("■ 選曲");
\r
1851 r直前のステージ = r現在のステージ;
\r
1852 r現在のステージ = stage選曲;
\r
1854 foreach (STPlugin pg in this.listプラグイン)
\r
1856 Directory.SetCurrentDirectory(pg.strプラグインフォルダ);
\r
1857 pg.plugin.Onステージ変更();
\r
1858 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
1861 this.tガベージコレクションを実行する();
\r
1865 base.Window.Close();
\r
1868 //-----------------------------
\r
1872 case CStage.Eステージ.ChangeSkin:
\r
1874 //-----------------------------
\r
1875 if (this.n進行描画の戻り値 != 0)
\r
1877 r現在のステージ.On非活性化();
\r
1878 Trace.TraceInformation("----------------------");
\r
1879 Trace.TraceInformation("■ 選曲");
\r
1881 r直前のステージ = r現在のステージ;
\r
1882 r現在のステージ = stage選曲;
\r
1883 this.tガベージコレクションを実行する();
\r
1885 //-----------------------------
\r
1889 case CStage.Eステージ.終了:
\r
1891 //-----------------------------
\r
1892 if (this.n進行描画の戻り値 != 0)
\r
1896 //-----------------------------
\r
1901 this.Device.EndScene();
\r
1902 // Present()は game.csのOnFrameEnd()に登録された、GraphicsDeviceManager.game_FrameEnd() 内で実行されるので不要
\r
1903 // (つまり、Present()は、Draw()完了後に実行される)
\r
1904 #if !GPUFlushAfterPresent
\r
1905 actFlushGPU.On進行描画(); // Flush GPU // EndScene()~Present()間 (つまりVSync前) でFlush実行
\r
1907 if (Sound管理.GetCurrentSoundDeviceType() != "DirectSound")
\r
1909 Sound管理.t再生中の処理をする(); // サウンドバッファの更新; 画面描画と同期させることで、スクロールをスムーズにする
\r
1912 #region [ マウスカーソル消去制御 ]
\r
1913 ccMouseShow.t進行();
\r
1914 if (bマウスカーソル表示中 && ccMouseShow.b終了値に達した)
\r
1917 bマウスカーソル表示中 = false;
\r
1920 #region [ 全画面・ウインドウ切り替え ]
\r
1921 if (this.b次のタイミングで全画面_ウィンドウ切り替えを行う)
\r
1923 // ConfigIni.bFullScreen.Value = !ConfigIni.bFullScreen;
\r
1924 Instance.t全画面_ウィンドウモード切り替え();
\r
1925 this.b次のタイミングで全画面_ウィンドウ切り替えを行う = false;
\r
1928 #region [ 垂直基線同期切り替え ]
\r
1929 if (this.b次のタイミングで垂直帰線同期切り替えを行う)
\r
1931 bool bIsMaximized = this.Window.IsMaximized; // #23510 2010.11.3 yyagi: to backup current window mode before changing VSyncWait
\r
1932 currentClientSize = this.Window.ClientSize; // #23510 2010.11.3 yyagi: to backup current window size before changing VSyncWait
\r
1933 DeviceSettings currentSettings = Instance.GraphicsDeviceManager.CurrentSettings;
\r
1934 currentSettings.EnableVSync = ConfigIni.bVSyncWait;
\r
1935 Instance.GraphicsDeviceManager.ChangeDevice(currentSettings);
\r
1936 this.b次のタイミングで垂直帰線同期切り替えを行う = false;
\r
1937 base.Window.ClientSize = new Size(currentClientSize.Width, currentClientSize.Height); // #23510 2010.11.3 yyagi: to resume window size after changing VSyncWait
\r
1940 this.Window.WindowState = FormWindowState.Maximized; // #23510 2010.11.3 yyagi: to resume window mode after changing VSyncWait
\r
1945 GC.Collect( 0, GCCollectionMode.Optimized, false ); // Rel105で処理が重くなっていることに対する、暫定処置。
\r
1946 // 重くなっている原因に対する適切な処置をして、処理が104程度に軽くなったら、
\r
1951 /// XML ファイルからオブジェクトを生成します。
\r
1953 /// <param name="xmlfile">オブジェクトが記述される XML のパス。これは DataContract によってシリアライズされていなければなりません。</param>
\r
1954 /// <returns>生成したオブジェクト。正しく生成できなかった場合 null 。</returns>
\r
1955 public static object DeserializeXML(string xmlpath, Type t)
\r
1957 object ret = null;
\r
1960 if (File.Exists(xmlpath))
\r
1962 using (XmlReader xr = XmlReader.Create(xmlpath))
\r
1964 DataContractSerializer serializer = new DataContractSerializer(t);
\r
1965 ret = serializer.ReadObject(xr);
\r
1977 /// オブジェクトから XML ファイルを生成します。
\r
1979 /// <param name="xmlfile">XML ファイルのパス。</param>
\r
1980 /// <param name="obj">XML としてシリアライズするオブジェクト。DataContract 属性を持つクラスからインスタンス化されたオブジェクトです。</param>
\r
1981 public static void SerializeXML(string xmlpath, object obj)
\r
1983 XmlWriterSettings settings = new XmlWriterSettings();
\r
1984 settings.IndentChars = " ";
\r
1985 settings.Indent = true;
\r
1986 settings.NewLineChars = Environment.NewLine;
\r
1987 settings.Encoding = new System.Text.UTF8Encoding(false);
\r
1988 using (XmlWriter xw = XmlWriter.Create(xmlpath, settings))
\r
1990 DataContractSerializer serializer = new DataContractSerializer(obj.GetType());
\r
1991 serializer.WriteObject(xw, obj);
\r
1995 public void SaveConfig()
\r
1997 #region [ Skinパスの絶対パス→相対パス変換 ]
\r
1998 string _strSystemSkinSubfolderPath = ConfigIni.strSystemSkinSubfolderPath.Value;
\r
1999 Uri uriRoot = new Uri( System.IO.Path.Combine( this.strEXEのあるフォルダ, "System" + System.IO.Path.DirectorySeparatorChar ) );
\r
2000 if ( ConfigIni.strSystemSkinSubfolderPath.Value != null && ConfigIni.strSystemSkinSubfolderPath.Value.Length == 0 )
\r
2002 // Config.iniが空の状態でDTXManiaをViewerとして起動・終了すると、strSystemSkinSubfolderFullName が空の状態でここに来る。
\r
2003 // → 初期値として Default/ を設定する。
\r
2004 ConfigIni.strSystemSkinSubfolderPath.Value = System.IO.Path.Combine( this.strEXEのあるフォルダ, "System" + System.IO.Path.DirectorySeparatorChar + "Default" + System.IO.Path.DirectorySeparatorChar );
\r
2007 // 起動直後は(Loadの前にSaveを通るため)Skinパスには初期値の相対パスが入っている場合がある。
\r
2008 // そのため、以下の処理を通すために、いったん絶対パスに変換
\r
2009 if ( !System.IO.Path.IsPathRooted( ConfigIni.strSystemSkinSubfolderPath.Value ) )
\r
2011 ConfigIni.strSystemSkinSubfolderPath.Value =
\r
2012 Path.Combine( Path.Combine( this.strEXEのあるフォルダ, "System" ), ConfigIni.strSystemSkinSubfolderPath );
\r
2015 Uri uriPath = new Uri( System.IO.Path.Combine( ConfigIni.strSystemSkinSubfolderPath.Value, "." + System.IO.Path.DirectorySeparatorChar ) );
\r
2016 string relPath = uriRoot.MakeRelativeUri( uriPath ).ToString(); // 相対パスを取得
\r
2017 relPath = System.Web.HttpUtility.UrlDecode( relPath ); // デコードする
\r
2018 relPath = relPath.Replace( '/', System.IO.Path.DirectorySeparatorChar ); // 区切り文字が\ではなく/なので置換する
\r
2019 ConfigIni.strSystemSkinSubfolderPath.Value = relPath;
\r
2021 ConfigIni.strDTXManiaVersion.Value = CDTXMania.VERSION;
\r
2023 CDTXMania.SerializeXML( strEXEのあるフォルダ + "Config.xml", ConfigIni );
\r
2026 ConfigIni.strSystemSkinSubfolderPath.Value = _strSystemSkinSubfolderPath;
\r
2029 public void LoadConfig()
\r
2031 string path = strEXEのあるフォルダ + "Config.xml";
\r
2033 if (!File.Exists(path))
\r
2037 if (File.Exists(path))
\r
2039 ConfigIni = (CConfigXml)CDTXMania.DeserializeXML(path, typeof(CConfigXml));
\r
2040 if (ConfigIni == null)
\r
2042 ConfigIni = new CConfigXml();
\r
2045 // Skinパスの相対パスを、絶対パスに変換
\r
2046 if ( !System.IO.Path.IsPathRooted( ConfigIni.strSystemSkinSubfolderPath.Value ) )
\r
2048 ConfigIni.strSystemSkinSubfolderPath.Value =
\r
2049 Path.Combine( Path.Combine( this.strEXEのあるフォルダ, "System" ), ConfigIni.strSystemSkinSubfolderPath );
\r
2054 public void ShowWindowTitleWithSoundType()
\r
2056 string delay = "";
\r
2057 if (Sound管理.GetCurrentSoundDeviceType() != "DirectSound")
\r
2059 delay = "(" + Sound管理.GetSoundDelay() + "ms)";
\r
2061 base.Window.Text = strWindowTitle + " (" + Sound管理.GetCurrentSoundDeviceType() + delay + ")";
\r
2064 #region [ private ]
\r
2065 //-----------------
\r
2066 private bool bマウスカーソル表示中 = true;
\r
2067 private bool b終了処理完了済み;
\r
2068 private static CDTX dtx;
\r
2069 private List<CActivity> listトップレベルActivities;
\r
2070 private int n進行描画の戻り値;
\r
2071 private MouseButtons mb = System.Windows.Forms.MouseButtons.Left;
\r
2072 private string strWindowTitle
\r
2076 if (DTXVmode.Enabled)
\r
2078 return "DTXViewer release " + VERSION;
\r
2082 return "DTXMania .NET style release " + VERSION;
\r
2086 private CSound previewSound;
\r
2087 private CCounter ccMouseShow;
\r
2089 private void t終了処理()
\r
2091 if (!this.b終了処理完了済み)
\r
2093 Trace.TraceInformation("----------------------");
\r
2094 Trace.TraceInformation("■ アプリケーションの終了");
\r
2095 #region [ 曲検索の終了処理 ]
\r
2096 //---------------------
\r
2097 if (actEnumSongs != null)
\r
2099 Trace.TraceInformation("曲検索actの終了処理を行います。");
\r
2103 actEnumSongs.On非活性化();
\r
2104 actEnumSongs = null;
\r
2105 Trace.TraceInformation("曲検索actの終了処理を完了しました。");
\r
2107 catch (Exception e)
\r
2109 Trace.TraceError(e.Message);
\r
2110 Trace.TraceError("曲検索actの終了処理に失敗しました。");
\r
2117 //---------------------
\r
2119 #region [ 現在のステージの終了処理 ]
\r
2120 //---------------------
\r
2121 if (CDTXMania.Instance.r現在のステージ != null && CDTXMania.Instance.r現在のステージ.b活性化してる) // #25398 2011.06.07 MODIFY FROM
\r
2123 Trace.TraceInformation("現在のステージを終了します。");
\r
2127 r現在のステージ.On非活性化();
\r
2128 Trace.TraceInformation("現在のステージの終了処理を完了しました。");
\r
2135 //---------------------
\r
2138 #region [ 選曲ステージの終了処理 ]
\r
2142 #region [ プラグインの終了処理 ]
\r
2143 //---------------------
\r
2144 if (this.listプラグイン != null && this.listプラグイン.Count > 0)
\r
2146 Trace.TraceInformation("すべてのプラグインを終了します。");
\r
2150 foreach (STPlugin st in this.listプラグイン)
\r
2152 Directory.SetCurrentDirectory(st.strプラグインフォルダ);
\r
2153 st.plugin.OnUnmanagedリソースの解放();
\r
2154 st.plugin.OnManagedリソースの解放();
\r
2156 Directory.SetCurrentDirectory(CDTXMania.Instance.strEXEのあるフォルダ);
\r
2158 PluginHost = null;
\r
2159 Trace.TraceInformation("すべてのプラグインの終了処理を完了しました。");
\r
2166 //---------------------
\r
2168 #region [ 曲リストの終了処理 ]
\r
2169 //---------------------
\r
2170 if (Songs管理 != null)
\r
2172 Trace.TraceInformation("曲リストの終了処理を行います。");
\r
2177 Trace.TraceInformation("曲リストの終了処理を完了しました。");
\r
2179 catch (Exception exception)
\r
2181 Trace.TraceError(exception.Message);
\r
2182 Trace.TraceError("曲リストの終了処理に失敗しました。");
\r
2190 //---------------------
\r
2192 #region [ スキンの終了処理 ]
\r
2193 //---------------------
\r
2196 Trace.TraceInformation("スキンの終了処理を行います。");
\r
2202 Trace.TraceInformation("スキンの終了処理を完了しました。");
\r
2204 catch (Exception exception2)
\r
2206 Trace.TraceError(exception2.Message);
\r
2207 Trace.TraceError("スキンの終了処理に失敗しました。");
\r
2214 //---------------------
\r
2216 #region [ DirectSoundの終了処理 ]
\r
2217 //---------------------
\r
2218 if (Sound管理 != null)
\r
2220 Trace.TraceInformation("DirectSound の終了処理を行います。");
\r
2224 Sound管理.Dispose();
\r
2226 Trace.TraceInformation("DirectSound の終了処理を完了しました。");
\r
2228 catch (Exception exception3)
\r
2230 Trace.TraceError(exception3.Message);
\r
2231 Trace.TraceError("DirectSound の終了処理に失敗しました。");
\r
2238 //---------------------
\r
2240 #region [ パッドの終了処理 ]
\r
2241 //---------------------
\r
2244 Trace.TraceInformation("パッドの終了処理を行います。");
\r
2249 Trace.TraceInformation("パッドの終了処理を完了しました。");
\r
2251 catch (Exception exception4)
\r
2253 Trace.TraceError(exception4.Message);
\r
2254 Trace.TraceError("パッドの終了処理に失敗しました。");
\r
2261 //---------------------
\r
2263 #region [ DirectInput, MIDI入力の終了処理 ]
\r
2264 //---------------------
\r
2265 if (Input管理 != null)
\r
2267 Trace.TraceInformation("DirectInput, MIDI入力の終了処理を行います。");
\r
2271 Input管理.Dispose();
\r
2273 Trace.TraceInformation("DirectInput, MIDI入力の終了処理を完了しました。");
\r
2275 catch (Exception exception5)
\r
2277 Trace.TraceError(exception5.Message);
\r
2278 Trace.TraceError("DirectInput, MIDI入力の終了処理に失敗しました。");
\r
2285 //---------------------
\r
2287 #region [ 文字コンソールの終了処理 ]
\r
2288 //---------------------
\r
2289 if (act文字コンソール != null)
\r
2291 Trace.TraceInformation("文字コンソールの終了処理を行います。");
\r
2295 act文字コンソール.On非活性化();
\r
2296 act文字コンソール = null;
\r
2297 Trace.TraceInformation("文字コンソールの終了処理を完了しました。");
\r
2299 catch (Exception exception6)
\r
2301 Trace.TraceError(exception6.Message);
\r
2302 Trace.TraceError("文字コンソールの終了処理に失敗しました。");
\r
2309 //---------------------
\r
2311 #region [ FPSカウンタの終了処理 ]
\r
2312 //---------------------
\r
2313 Trace.TraceInformation("FPSカウンタの終了処理を行います。");
\r
2321 Trace.TraceInformation("FPSカウンタの終了処理を完了しました。");
\r
2327 //---------------------
\r
2329 #region [ タイマの終了処理 ]
\r
2330 //---------------------
\r
2331 Trace.TraceInformation("タイマの終了処理を行います。");
\r
2335 if (Timer != null)
\r
2339 Trace.TraceInformation("タイマの終了処理を完了しました。");
\r
2343 Trace.TraceInformation("タイマは使用されていません。");
\r
2350 //---------------------
\r
2352 #region [ Config.iniの出力 ]
\r
2353 //---------------------
\r
2354 Trace.TraceInformation("Config.xml を出力します。");
\r
2355 // if ( ConfigIni.bIsSwappedGuitarBass ) // #24063 2011.1.16 yyagi ギターベースがスワップしているときは元に戻す
\r
2356 if (ConfigIni.bIsSwappedGuitarBass_AutoFlagsAreSwapped) // #24415 2011.2.21 yyagi FLIP中かつ演奏中にalt-f4で終了したときは、AUTOのフラグをswapして戻す
\r
2358 ConfigIni.SwapGuitarBassInfos_AutoFlags();
\r
2361 if (ConfigIni.bIsSwappedGuitarBass_PlaySettingsAreSwapped) // #35417 2015/8/18 yyagi FLIP中かつ演奏中にalt-f4で終了したときは、演奏設定のフラグをswapして戻す
\r
2363 ConfigIni.SwapGuitarBassInfos_PlaySettings();
\r
2366 string str = strEXEのあるフォルダ + "Config.ini";
\r
2370 if (DTXVmode.Enabled)
\r
2372 DTXVmode.tUpdateConfigIni();
\r
2373 Trace.TraceInformation("DTXVモードの設定情報を、Config.xmlに保存しました。");
\r
2377 CDTXMania.Instance.SaveConfig();
\r
2378 Trace.TraceInformation("保存しました。({0})", str);
\r
2381 catch (Exception e)
\r
2383 Trace.TraceError(e.Message);
\r
2384 Trace.TraceError("Config.xml の出力に失敗しました。({0})", str);
\r
2390 //---------------------
\r
2392 #region [ DTXVmodeの終了処理 ]
\r
2393 //---------------------
\r
2394 //Trace.TraceInformation( "DTXVモードの終了処理を行います。" );
\r
2398 if (DTXVmode != null)
\r
2401 //Trace.TraceInformation( "DTXVモードの終了処理を完了しました。" );
\r
2405 //Trace.TraceInformation( "DTXVモードは使用されていません。" );
\r
2410 //Trace.Unindent();
\r
2412 //---------------------
\r
2414 #region [ DirectXの終了処理 ]
\r
2415 //---------------------
\r
2416 base.GraphicsDeviceManager.Dispose();
\r
2417 //---------------------
\r
2419 Trace.TraceInformation( "アプリケーションの終了処理を完了しました。" );
\r
2422 this.b終了処理完了済み = true;
\r
2425 private CScoreIni tScoreIniへBGMAdjustとHistoryとPlayCountを更新(string str新ヒストリ行)
\r
2427 STDGBSValue<bool> isUpdated = new STDGBSValue<bool>();
\r
2428 string strFilename = DTX.strファイル名の絶対パス + ".score.ini";
\r
2429 CScoreIni ini = new CScoreIni(strFilename);
\r
2430 if (!File.Exists(strFilename))
\r
2432 ini.stファイル.Title = DTX.TITLE;
\r
2433 ini.stファイル.Name = DTX.strファイル名;
\r
2434 ini.stファイル.Hash = CScoreIni.tファイルのMD5を求めて返す(DTX.strファイル名の絶対パス);
\r
2435 for (EPart i = EPart.Drums; i <= EPart.Bass; ++i)
\r
2437 ini.stセクション.HiScore[i].nPerfectになる範囲ms = nPerfect範囲ms;
\r
2438 ini.stセクション.HiScore[i].nGreatになる範囲ms = nGreat範囲ms;
\r
2439 ini.stセクション.HiScore[i].nGoodになる範囲ms = nGood範囲ms;
\r
2440 ini.stセクション.HiScore[i].nPoorになる範囲ms = nPoor範囲ms;
\r
2442 ini.stセクション.HiSkill[i].nPerfectになる範囲ms = nPerfect範囲ms;
\r
2443 ini.stセクション.HiSkill[i].nGreatになる範囲ms = nGreat範囲ms;
\r
2444 ini.stセクション.HiSkill[i].nGoodになる範囲ms = nGood範囲ms;
\r
2445 ini.stセクション.HiSkill[i].nPoorになる範囲ms = nPoor範囲ms;
\r
2447 ini.stセクション.LastPlay[i].nPerfectになる範囲ms = nPerfect範囲ms;
\r
2448 ini.stセクション.LastPlay[i].nGreatになる範囲ms = nGreat範囲ms;
\r
2449 ini.stセクション.LastPlay[i].nGoodになる範囲ms = nGood範囲ms;
\r
2450 ini.stセクション.LastPlay[i].nPoorになる範囲ms = nPoor範囲ms;
\r
2453 ini.stファイル.BGMAdjust = DTX.nBGMAdjust;
\r
2454 isUpdated = CScoreIni.t更新条件を取得する();
\r
2455 if (isUpdated.Drums || isUpdated.Guitar || isUpdated.Bass)
\r
2457 if (isUpdated.Drums)
\r
2459 ini.stファイル.PlayCountDrums++;
\r
2461 if (isUpdated.Guitar)
\r
2463 ini.stファイル.PlayCountGuitar++;
\r
2465 if (isUpdated.Bass)
\r
2467 ini.stファイル.PlayCountBass++;
\r
2469 ini.tヒストリを追加する(str新ヒストリ行);
\r
2472 stage選曲.r現在選択中のスコア.譜面情報.演奏回数.Drums = ini.stファイル.PlayCountDrums;
\r
2473 stage選曲.r現在選択中のスコア.譜面情報.演奏回数.Guitar = ini.stファイル.PlayCountGuitar;
\r
2474 stage選曲.r現在選択中のスコア.譜面情報.演奏回数.Bass = ini.stファイル.PlayCountBass;
\r
2475 for (int j = 0; j < ini.stファイル.History.Length; j++)
\r
2477 stage選曲.r現在選択中のスコア.譜面情報.演奏履歴[j] = ini.stファイル.History[j];
\r
2481 if (ConfigIni.bScoreIni)
\r
2483 ini.t書き出し(strFilename);
\r
2488 private void tガベージコレクションを実行する()
\r
2491 GC.WaitForPendingFinalizers();
\r
2493 GC.WaitForPendingFinalizers();
\r
2495 private void tプラグイン検索と生成()
\r
2497 this.listプラグイン = new List<STPlugin>();
\r
2499 string strIPluginActivityの名前 = typeof(IPluginActivity).FullName;
\r
2500 string strプラグインフォルダパス = strEXEのあるフォルダ + "Plugins\\";
\r
2502 this.t指定フォルダ内でのプラグイン検索と生成(strプラグインフォルダパス, strIPluginActivityの名前);
\r
2504 if (this.listプラグイン.Count > 0)
\r
2505 Trace.TraceInformation(this.listプラグイン.Count + " 個のプラグインを読み込みました。");
\r
2508 private System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
\r
2510 var domain = (AppDomain)sender;
\r
2512 foreach (var assembly in domain.GetAssemblies())
\r
2514 if (assembly.FullName == args.Name)
\r
2519 private void t指定フォルダ内でのプラグイン検索と生成(string strプラグインフォルダパス, string strプラグイン型名)
\r
2521 // 指定されたパスが存在しないとエラー
\r
2522 if (!Directory.Exists(strプラグインフォルダパス))
\r
2524 Trace.TraceWarning("プラグインフォルダが存在しません。(" + strプラグインフォルダパス + ")");
\r
2528 AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
\r
2531 // (1) すべての *.dll について…
\r
2532 string[] strDLLs = System.IO.Directory.GetFiles(strプラグインフォルダパス, "*.dll");
\r
2533 foreach (string dllName in strDLLs)
\r
2535 if (Path.GetExtension(dllName).ToLower() != "dll")
\r
2541 // (1-1) dll をアセンブリとして読み込む。
\r
2542 System.Reflection.Assembly asm = System.Reflection.Assembly.LoadFrom(dllName);
\r
2544 // (1-2) アセンブリ内のすべての型について、プラグインとして有効か調べる
\r
2545 foreach (Type t in asm.GetTypes())
\r
2547 // (1-3) ↓クラスであり↓Publicであり↓抽象クラスでなく↓IPlugin型のインスタンスが作れる 型を持っていれば有効
\r
2548 if (t.IsClass && t.IsPublic && !t.IsAbstract && t.GetInterface(strプラグイン型名) != null)
\r
2550 // (1-4) クラス名からインスタンスを作成する
\r
2551 var st = new STPlugin()
\r
2553 plugin = (IPluginActivity)asm.CreateInstance(t.FullName),
\r
2554 strプラグインフォルダ = Path.GetDirectoryName(dllName),
\r
2555 strアセンブリ簡易名 = asm.GetName().Name,
\r
2556 Version = asm.GetName().Version,
\r
2559 // (1-5) プラグインリストへ登録
\r
2560 this.listプラグイン.Add(st);
\r
2561 Trace.TraceInformation("プラグイン {0} ({1}, {2}, {3}) を読み込みました。", t.FullName, Path.GetFileName(dllName), st.strアセンブリ簡易名, st.Version.ToString());
\r
2565 catch (System.Reflection.ReflectionTypeLoadException e)
\r
2567 Trace.TraceInformation(dllName + " からプラグインを生成することに失敗しました。スキップします。");
\r
2568 Trace.TraceInformation(e.ToString());
\r
2569 Trace.TraceInformation(e.Message);
\r
2571 StringBuilder sb = new StringBuilder();
\r
2572 foreach (Exception exSub in e.LoaderExceptions)
\r
2574 sb.AppendLine(exSub.Message);
\r
2575 FileNotFoundException exFileNotFound = exSub as FileNotFoundException;
\r
2576 if (exFileNotFound != null)
\r
2578 if (!string.IsNullOrEmpty(exFileNotFound.FusionLog))
\r
2580 sb.AppendLine("Fusion Log:");
\r
2581 sb.AppendLine(exFileNotFound.FusionLog);
\r
2586 string errorMessage = sb.ToString();
\r
2587 //Display or log the error based on your application.
\r
2588 Trace.TraceInformation(errorMessage);
\r
2591 catch (Exception e)
\r
2593 Trace.TraceInformation(dllName + " からプラグインを生成することに失敗しました。スキップします。");
\r
2594 Trace.TraceInformation(e.ToString());
\r
2595 Trace.TraceInformation(e.Message);
\r
2599 // (2) サブフォルダがあれば再帰する
\r
2600 string[] strDirs = Directory.GetDirectories(strプラグインフォルダパス, "*");
\r
2601 foreach (string dir in strDirs)
\r
2602 this.t指定フォルダ内でのプラグイン検索と生成(dir + "\\", strプラグイン型名);
\r
2604 //-----------------
\r
2605 #region [ Windowイベント処理 ]
\r
2606 private void Window_ApplicationActivated( object sender, EventArgs e )
\r
2608 this.bApplicationActive = true;
\r
2610 private void Window_ApplicationDeactivated(object sender, EventArgs e)
\r
2612 this.bApplicationActive = false;
\r
2614 private void Window_KeyDown(object sender, KeyEventArgs e)
\r
2616 if (e.KeyCode == Keys.Menu)
\r
2619 e.SuppressKeyPress = true;
\r
2621 else if ((e.KeyCode == Keys.Return) && e.Alt)
\r
2623 if (ConfigIni != null)
\r
2625 ConfigIni.bウィンドウモード = !ConfigIni.bウィンドウモード;
\r
2626 this.t全画面_ウィンドウモード切り替え();
\r
2629 e.SuppressKeyPress = true;
\r
2633 for (int i = 0; i < CConfigXml.AssignableCodes; i++)
\r
2635 if (ConfigIni.KeyAssign[EPad.Capture][i].コード > 0 &&
\r
2636 e.KeyCode == DeviceConstantConverter.KeyToKeyCode((SlimDX.DirectInput.Key)ConfigIni.KeyAssign[EPad.Capture][i].コード))
\r
2638 // Debug.WriteLine( "capture: " + string.Format( "{0:2x}", (int) e.KeyCode ) + " " + (int) e.KeyCode );
\r
2639 string strFullPath =
\r
2640 Path.Combine(CDTXMania.Instance.strEXEのあるフォルダ, "Capture_img");
\r
2641 strFullPath = Path.Combine(strFullPath, DateTime.Now.ToString("yyyyMMddHHmmss") + ".png");
\r
2642 SaveResultScreen(strFullPath);
\r
2647 private void Window_MouseUp(object sender, MouseEventArgs e)
\r
2652 private void Window_MouseDoubleClick(object sender, MouseEventArgs e) // #23510 2010.11.13 yyagi: to go full screen mode
\r
2654 if (mb.Equals(MouseButtons.Left) && ConfigIni.bIsAllowedDoubleClickFullscreen) // #26752 2011.11.27 yyagi
\r
2656 ConfigIni.bウィンドウモード = false;
\r
2657 this.t全画面_ウィンドウモード切り替え();
\r
2660 private void Window_MouseMove(object sender, MouseEventArgs e)
\r
2662 if (ConfigIni.bウィンドウモード == true && this.bマウスカーソル表示中 == false) // #36168 2016.3.19 yyagi: do not to show mouse cursor in full screen mode
\r
2665 this.bマウスカーソル表示中 = true;
\r
2667 ccMouseShow.t開始(0, 1, 2000, Timer);
\r
2670 private void Window_ResizeEnd(object sender, EventArgs e) // #23510 2010.11.20 yyagi: to get resized window size
\r
2672 if (ConfigIni.bウィンドウモード)
\r
2674 ConfigIni.rcWindow.X = base.Window.Location.X; // #30675 2013.02.04 ikanick add
\r
2675 ConfigIni.rcWindow.Y = base.Window.Location.Y; //
\r
2678 ConfigIni.rcWindow.W = (ConfigIni.bウィンドウモード) ? base.Window.ClientSize.Width : currentClientSize.Width; // #23510 2010.10.31 yyagi add
\r
2679 ConfigIni.rcWindow.H = (ConfigIni.bウィンドウモード) ? base.Window.ClientSize.Height : currentClientSize.Height;
\r
2683 //Stopwatch sw = new Stopwatch();
\r
2684 //List<int> swlist1, swlist2, swlist3, swlist4, swlist5;
\r