{
Debug.Assert( null == this.デバイスリソース ); // 解放された後である。
+ #region " ステージを終了し、解放する。"
+ //----------------
+ this.現在のステージ.非活性化する( this.デバイスリソース );
+ this.最初のダミーステージ = null;
+ this.起動ステージ = null;
+ this.タイトルステージ = null;
+ //----------------
+ #endregion
#region " MIDI入力 を解放する。"
//-----------------
FDK.Log.Info( "MIDI入力デバイスを解放します。" );
//-----------------
#endregion
}
+
public override void シーンを描画する()
{
#region " 描画を準備する。"
break;
case nameof( ステージ.起動.起動ステージ ):
+ #region " 終了 → タイトルステージへ。"
+ //---------------
+ if( this.起動ステージ.現在のフェーズ == ステージ.起動.起動ステージ.フェーズ.終了 )
+ {
+ this.現在のステージ.非活性化する( this.デバイスリソース );
+ this.現在のステージ = this.タイトルステージ;
+ this.現在のステージ.活性化する( this.デバイスリソース );
+ }
+ //---------------
+ #endregion
+ break;
+
+ case nameof( ステージ.タイトル.タイトルステージ ):
#region " *** "
//----------------
//----------------
// 各ステージの、唯一のインスタンス。
protected SST.ステージ.ステージ 最初のダミーステージ = new ステージ.ステージ();
protected SST.ステージ.起動.起動ステージ 起動ステージ = new ステージ.起動.起動ステージ();
+ protected SST.ステージ.タイトル.タイトルステージ タイトルステージ = new ステージ.タイトル.タイトルステージ();
private SST.ステージ.ステージ 現在のステージ = null;
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ステージ\ステージ.cs" />
+ <Compile Include="ステージ\タイトル\タイトルステージ.cs" />
<Compile Include="ステージ\汎用\フェードアウト.cs" />
<Compile Include="ステージ\汎用\フェードイン.cs" />
<Compile Include="ステージ\起動\起動ステージ.cs" />
--- /dev/null
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using FDK.メディア;
+
+namespace SST.ステージ.タイトル
+{
+ class タイトルステージ : SST.ステージ.ステージ
+ {
+ public enum フェーズ
+ {
+ 初期状態,
+ 表示中,
+ 確定,
+ キャンセル,
+ }
+ public フェーズ 現在のフェーズ { get; protected set; } = フェーズ.初期状態;
+
+ public タイトルステージ()
+ {
+ }
+ protected override void On活性化( デバイスリソース dr )
+ {
+ FDK.Log.Info( "タイトルステージを開始します。" );
+ this.背景画像.活性化する( dr );
+ this.現在のフェーズ = フェーズ.表示中;
+ }
+ protected override void On非活性化( デバイスリソース dr )
+ {
+ FDK.Log.Info( "タイトルステージを終了します。" );
+ this.背景画像.非活性化する( dr );
+ }
+ public override void 進行描画する( デバイスリソース dr )
+ {
+ if( this.現在のフェーズ != フェーズ.表示中 )
+ return;
+
+ // 進行・描画。
+ this.背景画像.進行描画する( dr, 0.0f, 0.0f );
+
+ // 入力。
+
+ StrokeStyleT.すべての入力デバイスをポーリングする();
+
+ // Enter 押下 → 確定&ステージ終了
+ if( StrokeStyleT.キーボード入力.キーが押された( SharpDX.DirectInput.Key.Return ) )
+ {
+ this.現在のフェーズ = フェーズ.確定;
+ }
+ // Esc 押下 → キャンセル&ステージ終了
+ else if( StrokeStyleT.キーボード入力.キーが押された( SharpDX.DirectInput.Key.Escape ) )
+ {
+ this.現在のフェーズ = フェーズ.キャンセル;
+ }
+ }
+
+ protected readonly FDK.メディア.画像 背景画像 = new 画像( @"$(Static)\images\タイトル画面.jpg" );
+ }
+}