Пример #1
0
        public override int On進行描画()
        {
            string str;

            if (base.b活性化してない)
            {
                return(0);
            }

            #region [ 初めての進行描画 ]
            //-----------------------------
            if (base.b初めての進行描画)
            {
                Cスコア cスコア1 = TJAPlayer4.stage選曲.r確定されたスコア;
                if (this.sd読み込み音 != null)
                {
                    if (TJAPlayer4.Skin.sound曲読込開始音.b排他 && (CSkin.Cシステムサウンド.r最後に再生した排他システムサウンド != null))
                    {
                        CSkin.Cシステムサウンド.r最後に再生した排他システムサウンド.t停止する();
                    }
                    this.sd読み込み音.t再生を開始する();
                    this.nBGM再生開始時刻   = CSound管理.rc演奏用タイマ.n現在時刻;
                    this.nBGMの総再生時間ms = this.sd読み込み音.n総演奏時間ms;
                }
                else
                {
                    TJAPlayer4.Skin.sound曲読込開始音.t再生する();
                    this.nBGM再生開始時刻   = CSound管理.rc演奏用タイマ.n現在時刻;
                    this.nBGMの総再生時間ms = TJAPlayer4.Skin.sound曲読込開始音.n長さ_現在のサウンド;
                }
                //this.actFI.tフェードイン開始();							// #27787 2012.3.10 yyagi 曲読み込み画面のフェードインの省略
                base.eフェーズID   = CStage.Eフェーズ.共通_フェードイン;
                base.b初めての進行描画 = false;

                nWAVcount        = 1;
                bitmapFilename   = new Bitmap(640, 24);
                graphicsFilename = Graphics.FromImage(bitmapFilename);
                graphicsFilename.TextRenderingHint = TextRenderingHint.AntiAlias;
                ftFilename = new Font("MS UI Gothic", 24f, FontStyle.Bold, GraphicsUnit.Pixel);
            }
            //-----------------------------
            #endregion
            this.ct待機.t進行();



            #region [ ESC押下時は選曲画面に戻る ]
            if (tキー入力())
            {
                if (this.sd読み込み音 != null)
                {
                    this.sd読み込み音.tサウンドを停止する();
                    this.sd読み込み音.t解放する();
                }
                return((int)E曲読込画面の戻り値.読込中止);
            }
            #endregion

            #region [ 背景、音符+タイトル表示 ]
            //-----------------------------
            this.ct曲名表示.t進行();
            if (this.tx背景 != null)
            {
                this.tx背景.t2D描画(TJAPlayer4.app.Device, 0, 0);
            }
            //CDTXMania.act文字コンソール.tPrint( 0, 0, C文字コンソール.Eフォント種別.灰, this.ct曲名表示.n現在の値.ToString() );

            if (TJAPlayer4.Tx.SongLoading_Plate != null)
            {
                TJAPlayer4.Tx.SongLoading_Plate.bスクリーン合成 = TJAPlayer4.Skin.SongLoading_Plate_ScreenBlend; //あまりにも出番が無い
                TJAPlayer4.Tx.SongLoading_Plate.Opacity  = C変換.nParsentTo255((this.ct曲名表示.n現在の値 / 30.0));
                if (TJAPlayer4.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Left)
                {
                    TJAPlayer4.Tx.SongLoading_Plate.t2D描画(TJAPlayer4.app.Device, TJAPlayer4.Skin.SongLoading_Plate_X, TJAPlayer4.Skin.SongLoading_Plate_Y - (TJAPlayer4.Tx.SongLoading_Plate.sz画像サイズ.Height / 2));
                }
                else if (TJAPlayer4.Skin.SongLoading_Plate_ReferencePoint == CSkin.ReferencePoint.Right)
                {
                    TJAPlayer4.Tx.SongLoading_Plate.t2D描画(TJAPlayer4.app.Device, TJAPlayer4.Skin.SongLoading_Plate_X - TJAPlayer4.Tx.SongLoading_Plate.sz画像サイズ.Width, TJAPlayer4.Skin.SongLoading_Plate_Y - (TJAPlayer4.Tx.SongLoading_Plate.sz画像サイズ.Height / 2));
                }
                else
                {
                    TJAPlayer4.Tx.SongLoading_Plate.t2D描画(TJAPlayer4.app.Device, TJAPlayer4.Skin.SongLoading_Plate_X - (TJAPlayer4.Tx.SongLoading_Plate.sz画像サイズ.Width / 2), TJAPlayer4.Skin.SongLoading_Plate_Y - (TJAPlayer4.Tx.SongLoading_Plate.sz画像サイズ.Height / 2));
                }
            }
            //CDTXMania.act文字コンソール.tPrint( 0, 16, C文字コンソール.Eフォント種別.灰, C変換.nParsentTo255( ( this.ct曲名表示.n現在の値 / 30.0 ) ).ToString() );


            int y = 720 - 45;
            if (this.txタイトル != null)
            {
                int nサブタイトル補正 = string.IsNullOrEmpty(TJAPlayer4.stage選曲.r確定されたスコア.譜面情報.strサブタイトル) ? 15 : 0;

                this.txタイトル.Opacity = C変換.nParsentTo255((this.ct曲名表示.n現在の値 / 30.0));
                if (TJAPlayer4.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Left)
                {
                    this.txタイトル.t2D描画(TJAPlayer4.app.Device, TJAPlayer4.Skin.SongLoading_Title_X, TJAPlayer4.Skin.SongLoading_Title_Y - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正);
                }
                else if (TJAPlayer4.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right)
                {
                    this.txタイトル.t2D描画(TJAPlayer4.app.Device, TJAPlayer4.Skin.SongLoading_Title_X - (this.txタイトル.sz画像サイズ.Width * txタイトル.vc拡大縮小倍率.X), TJAPlayer4.Skin.SongLoading_Title_Y - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正);
                }
                else
                {
                    this.txタイトル.t2D描画(TJAPlayer4.app.Device, (TJAPlayer4.Skin.SongLoading_Title_X - ((this.txタイトル.sz画像サイズ.Width * txタイトル.vc拡大縮小倍率.X) / 2)), TJAPlayer4.Skin.SongLoading_Title_Y - (this.txタイトル.sz画像サイズ.Height / 2) + nサブタイトル補正);
                }
            }
            if (this.txサブタイトル != null)
            {
                this.txサブタイトル.Opacity = C変換.nParsentTo255((this.ct曲名表示.n現在の値 / 30.0));
                if (TJAPlayer4.Skin.SongLoading_SubTitle_ReferencePoint == CSkin.ReferencePoint.Left)
                {
                    this.txサブタイトル.t2D描画(TJAPlayer4.app.Device, TJAPlayer4.Skin.SongLoading_SubTitle_X, TJAPlayer4.Skin.SongLoading_SubTitle_Y - (this.txサブタイトル.sz画像サイズ.Height / 2));
                }
                else if (TJAPlayer4.Skin.SongLoading_Title_ReferencePoint == CSkin.ReferencePoint.Right)
                {
                    this.txサブタイトル.t2D描画(TJAPlayer4.app.Device, TJAPlayer4.Skin.SongLoading_SubTitle_X - (this.txサブタイトル.sz画像サイズ.Width * txタイトル.vc拡大縮小倍率.X), TJAPlayer4.Skin.SongLoading_SubTitle_Y - (this.txサブタイトル.sz画像サイズ.Height / 2));
                }
                else
                {
                    this.txサブタイトル.t2D描画(TJAPlayer4.app.Device, (TJAPlayer4.Skin.SongLoading_SubTitle_X - ((this.txサブタイトル.sz画像サイズ.Width * txサブタイトル.vc拡大縮小倍率.X) / 2)), TJAPlayer4.Skin.SongLoading_SubTitle_Y - (this.txサブタイトル.sz画像サイズ.Height / 2));
                }
            }
            //-----------------------------
            #endregion

            switch (base.eフェーズID)
            {
            case CStage.Eフェーズ.共通_フェードイン:
                //if( this.actFI.On進行描画() != 0 )			    // #27787 2012.3.10 yyagi 曲読み込み画面のフェードインの省略
                // 必ず一度「CStaeg.Eフェーズ.共通_フェードイン」フェーズを経由させること。
                // さもないと、曲読み込みが完了するまで、曲読み込み画面が描画されない。
                base.eフェーズID = CStage.Eフェーズ.NOWLOADING_DTXファイルを読み込む;
                return((int)E曲読込画面の戻り値.継続);

            case CStage.Eフェーズ.NOWLOADING_DTXファイルを読み込む:
            {
                timeBeginLoad = DateTime.Now;
                TimeSpan span;
                str = null;
                if (!TJAPlayer4.bコンパクトモード)
                {
                    str = TJAPlayer4.stage選曲.r確定されたスコア.ファイル情報.ファイルの絶対パス;
                }
                else
                {
                    str = TJAPlayer4.strコンパクトモードファイル;
                }

                CScoreIni ini = new CScoreIni(str + ".score.ini");
                ini.t全演奏記録セクションの整合性をチェックし不整合があればリセットする();

                if ((TJAPlayer4.DTX[0] != null) && TJAPlayer4.DTX[0].b活性化してる)
                {
                    TJAPlayer4.DTX[0].On非活性化();
                }

                //if( CDTXMania.DTX == null )
                {
                    TJAPlayer4.DTX[0] = new CDTX(str, false, 1.0, ini.stファイル.BGMAdjust, 0, 0, true);
                    if (TJAPlayer4.ConfigIni.nPlayerCount == 2)
                    {
                        TJAPlayer4.DTX[1] = new CDTX(str, false, 1.0, ini.stファイル.BGMAdjust, 0, 1, true);
                    }
                    if (File.Exists(TJAPlayer4.DTX[0].strフォルダ名 + @"\\set.def"))
                    {
                        TJAPlayer4.DTX[0] = new CDTX(str, false, 1.0, ini.stファイル.BGMAdjust, 0, 1, true);
                        if (TJAPlayer4.ConfigIni.nPlayerCount == 2)
                        {
                            TJAPlayer4.DTX[1] = new CDTX(str, false, 1.0, ini.stファイル.BGMAdjust, 0, 1, true);
                        }
                    }

                    Trace.TraceInformation("----曲情報-----------------");
                    Trace.TraceInformation("TITLE: {0}", TJAPlayer4.DTX[0].TITLE);
                    Trace.TraceInformation("FILE: {0}", TJAPlayer4.DTX[0].strファイル名の絶対パス);
                    Trace.TraceInformation("---------------------------");

                    span = (TimeSpan)(DateTime.Now - timeBeginLoad);
                    Trace.TraceInformation("DTX読込所要時間:           {0}", span.ToString());

                    // 段位認定モード用。
                    if (TJAPlayer4.stage選曲.n確定された曲の難易度[0] == (int)Difficulty.Dan && TJAPlayer4.DTX[0].List_DanSongs != null)
                    {
                        var pfTitle    = new CPrivateFont();
                        var pfSubTitle = new CPrivateFont();
                        if (!string.IsNullOrEmpty(TJAPlayer4.ConfigIni.FontName))
                        {
                            pfTitle    = new CPrivateFont(new FontFamily(TJAPlayer4.ConfigIni.FontName), 30);
                            pfSubTitle = new CPrivateFont(new FontFamily(TJAPlayer4.ConfigIni.FontName), 22);
                        }
                        else
                        {
                            pfTitle    = new CPrivateFont(new FontFamily("MS UI Gothic"), 30);
                            pfSubTitle = new CPrivateFont(new FontFamily("MS UI Gothic"), 22);
                        }

                        var titleForeColor    = TJAPlayer4.Skin.Game_DanC_Title_ForeColor;
                        var titleBackColor    = TJAPlayer4.Skin.Game_DanC_Title_BackColor;
                        var subtitleForeColor = TJAPlayer4.Skin.Game_DanC_SubTitle_ForeColor;
                        var subtitleBackColor = TJAPlayer4.Skin.Game_DanC_SubTitle_BackColor;

                        for (int i = 0; i < TJAPlayer4.DTX[0].List_DanSongs.Count; i++)
                        {
                            if (!string.IsNullOrEmpty(TJAPlayer4.DTX[0].List_DanSongs[i].Title))
                            {
                                using (var bmpSongTitle = pfTitle.DrawPrivateFont(TJAPlayer4.DTX[0].List_DanSongs[i].Title, titleForeColor, titleBackColor))
                                {
                                    TJAPlayer4.DTX[0].List_DanSongs[i].TitleTex            = TJAPlayer4.tテクスチャの生成(bmpSongTitle, false);
                                    TJAPlayer4.DTX[0].List_DanSongs[i].TitleTex.vc拡大縮小倍率.X = TJAPlayer4.GetSongNameXScaling(ref TJAPlayer4.DTX[0].List_DanSongs[i].TitleTex, 710);
                                }
                            }

                            if (!string.IsNullOrEmpty(TJAPlayer4.DTX[0].List_DanSongs[i].SubTitle))
                            {
                                using (var bmpSongSubTitle = pfSubTitle.DrawPrivateFont(TJAPlayer4.DTX[0].List_DanSongs[i].SubTitle, subtitleForeColor, subtitleBackColor))
                                {
                                    TJAPlayer4.DTX[0].List_DanSongs[i].SubTitleTex            = TJAPlayer4.tテクスチャの生成(bmpSongSubTitle, false);
                                    TJAPlayer4.DTX[0].List_DanSongs[i].SubTitleTex.vc拡大縮小倍率.X = TJAPlayer4.GetSongNameXScaling(ref TJAPlayer4.DTX[0].List_DanSongs[i].SubTitleTex, 710);
                                }
                            }
                        }

                        pfTitle?.Dispose();
                        pfSubTitle?.Dispose();
                    }
                }

                //2017.01.28 DD Config.iniに反映しないように変更

                /*
                 * switch( CDTXMania.DTX.nScoreModeTmp )
                 * {
                 *  case 0:
                 *      CDTXMania.ConfigIni.nScoreMode = 0;
                 *      break;
                 *  case 1:
                 *      CDTXMania.ConfigIni.nScoreMode = 1;
                 *      break;
                 *  case 2:
                 *      CDTXMania.ConfigIni.nScoreMode = 2;
                 *      break;
                 *  case -1:
                 *      CDTXMania.ConfigIni.nScoreMode = 1;
                 *      break;
                 * }
                 */

                base.eフェーズID     = CStage.Eフェーズ.NOWLOADING_WAV読み込み待機;
                timeBeginLoadWAV = DateTime.Now;
                return((int)E曲読込画面の戻り値.継続);
            }

            case CStage.Eフェーズ.NOWLOADING_WAV読み込み待機:
            {
                if (this.ct待機.n現在の値 > 260)
                {
                    base.eフェーズID = CStage.Eフェーズ.NOWLOADING_WAVファイルを読み込む;
                }
                return((int)E曲読込画面の戻り値.継続);
            }

            case CStage.Eフェーズ.NOWLOADING_WAVファイルを読み込む:
            {
                if (nWAVcount == 1 && TJAPlayer4.DTX[0].listWAV.Count > 0)                                                      // #28934 2012.7.7 yyagi (added checking Count)
                {
                    ShowProgressByFilename(TJAPlayer4.DTX[0].listWAV[nWAVcount].strファイル名);
                }
                int looptime = (TJAPlayer4.ConfigIni.b垂直帰線待ちを行う)? 3 : 1;                                        // VSyncWait=ON時は1frame(1/60s)あたり3つ読むようにする
                for (int i = 0; i < looptime && nWAVcount <= TJAPlayer4.DTX[0].listWAV.Count; i++)
                {
                    if (TJAPlayer4.DTX[0].listWAV[nWAVcount].listこのWAVを使用するチャンネル番号の集合.Count > 0)                                                // #28674 2012.5.8 yyagi
                    {
                        TJAPlayer4.DTX[0].tWAVの読み込み(TJAPlayer4.DTX[0].listWAV[nWAVcount]);
                    }
                    nWAVcount++;
                }
                if (nWAVcount <= TJAPlayer4.DTX[0].listWAV.Count)
                {
                    ShowProgressByFilename(TJAPlayer4.DTX[0].listWAV[nWAVcount].strファイル名);
                }
                if (nWAVcount > TJAPlayer4.DTX[0].listWAV.Count)
                {
                    TimeSpan span = ( TimeSpan )(DateTime.Now - timeBeginLoadWAV);
                    Trace.TraceInformation("WAV読込所要時間({0,4}):     {1}", TJAPlayer4.DTX[0].listWAV.Count, span.ToString());
                    timeBeginLoadWAV = DateTime.Now;

                    if (TJAPlayer4.ConfigIni.bDynamicBassMixerManagement)
                    {
                        TJAPlayer4.DTX[0].PlanToAddMixerChannel();
                    }
                    for (int nPlayer = 0; nPlayer < TJAPlayer4.ConfigIni.nPlayerCount; nPlayer++)
                    {
                        TJAPlayer4.DTX[nPlayer].t太鼓チップのランダム化(TJAPlayer4.ConfigIni.eRandom[nPlayer].Taiko);
                        //太鼓チップをランダム化する際、1P後2Pの処理をすぐに行うと、
                        //1Pと酷似した、もしくは全く同じチップが流れてしまうので、
                        //1Pのランダム化後、ある程度時間を空ける。
                        Stopwatch sw = new Stopwatch();
                        sw.Start();
                        for (int i = 0; i < 1;)
                        {
                            if (sw.ElapsedMilliseconds >= 500)
                            {
                                sw.Reset();
                                i++;
                            }
                        }
                    }
                    TJAPlayer4.stage演奏ドラム画面.On活性化();

                    span = (TimeSpan)(DateTime.Now - timeBeginLoadWAV);

                    base.eフェーズID = CStage.Eフェーズ.NOWLOADING_BMPファイルを読み込む;
                }
                return((int)E曲読込画面の戻り値.継続);
            }

            case CStage.Eフェーズ.NOWLOADING_BMPファイルを読み込む:
            {
                TimeSpan span;
                DateTime timeBeginLoadBMPAVI = DateTime.Now;

                if (TJAPlayer4.ConfigIni.bAVI有効)
                {
                    TJAPlayer4.DTX[0].tAVIの読み込み();
                }
                span = ( TimeSpan )(DateTime.Now - timeBeginLoadBMPAVI);

                span = ( TimeSpan )(DateTime.Now - timeBeginLoad);
                Trace.TraceInformation("総読込時間:                {0}", span.ToString());

                if (TJAPlayer4.ConfigIni.FastRender)
                {
                    var fastRender = new FastRender();
                    fastRender.Render();
                    fastRender = null;
                }


                if (bitmapFilename != null)
                {
                    bitmapFilename.Dispose();
                    bitmapFilename = null;
                }
                if (graphicsFilename != null)
                {
                    graphicsFilename.Dispose();
                    graphicsFilename = null;
                }
                if (ftFilename != null)
                {
                    ftFilename.Dispose();
                    ftFilename = null;
                }
                TJAPlayer4.Timer.t更新();
                //CSound管理.rc演奏用タイマ.t更新();
                base.eフェーズID = CStage.Eフェーズ.NOWLOADING_システムサウンドBGMの完了を待つ;
                return((int)E曲読込画面の戻り値.継続);
            }

            case CStage.Eフェーズ.NOWLOADING_システムサウンドBGMの完了を待つ:
            {
                long nCurrentTime = TJAPlayer4.Timer.n現在時刻;
                if (nCurrentTime < this.nBGM再生開始時刻)
                {
                    this.nBGM再生開始時刻 = nCurrentTime;
                }

//						if ( ( nCurrentTime - this.nBGM再生開始時刻 ) > ( this.nBGMの総再生時間ms - 1000 ) )
                if ((nCurrentTime - this.nBGM再生開始時刻) >= (this.nBGMの総再生時間ms))                                            // #27787 2012.3.10 yyagi 1000ms == フェードイン分の時間
                {
                    if (!TJAPlayer4.DTXVmode.Enabled)
                    {
                    }
                    base.eフェーズID = CStage.Eフェーズ.共通_フェードアウト;
                }
                return((int)E曲読込画面の戻り値.継続);
            }

            case CStage.Eフェーズ.共通_フェードアウト:
                if (this.ct待機.b終了値に達してない)                                       // DTXVモード時は、フェードアウト省略
                {
                    return((int)E曲読込画面の戻り値.継続);
                }

                if (txFilename != null)
                {
                    txFilename.Dispose();
                }
                if (this.sd読み込み音 != null)
                {
                    this.sd読み込み音.t解放する();
                }
                return((int)E曲読込画面の戻り値.読込完了);
            }
            return((int)E曲読込画面の戻り値.継続);
        }
        private bool t背景画像があればその一部からプレビュー画像を構築する()
        {
            Cスコア cスコア = TJAPlayer4.stage選曲.r現在選択中のスコア;

            if ((cスコア == null) || string.IsNullOrEmpty(cスコア.譜面情報.Backgound))
            {
                return(false);
            }
            string path = cスコア.ファイル情報.フォルダの絶対パス + cスコア.譜面情報.Backgound;

            if (!path.Equals(this.str現在のファイル名))
            {
                if (!File.Exists(path))
                {
                    Trace.TraceWarning("ファイルが存在しません。({0})", new object[] { path });
                    return(false);
                }
                TJAPlayer4.tテクスチャの解放(ref this.txプレビュー画像);
                this.str現在のファイル名 = path;
                Bitmap image   = null;
                Bitmap bitmap2 = null;
                Bitmap bitmap3 = null;
                try
                {
                    image   = new Bitmap(this.str現在のファイル名);
                    bitmap2 = new Bitmap(SampleFramework.GameWindowSize.Width, SampleFramework.GameWindowSize.Height);
                    Graphics graphics = Graphics.FromImage(bitmap2);
                    int      x        = 0;
                    for (int i = 0; i < SampleFramework.GameWindowSize.Height; i += image.Height)
                    {
                        for (x = 0; x < SampleFramework.GameWindowSize.Width; x += image.Width)
                        {
                            graphics.DrawImage(image, x, i, image.Width, image.Height);
                        }
                    }
                    graphics.Dispose();
                    bitmap3  = new Bitmap(0xcc, 0x10d);
                    graphics = Graphics.FromImage(bitmap3);
                    graphics.DrawImage(bitmap2, 5, 5, new Rectangle(0x157, 0x6d, 0xcc, 0x10d), GraphicsUnit.Pixel);
                    graphics.Dispose();
                    this.txプレビュー画像    = new CTexture(TJAPlayer4.app.Device, bitmap3, TJAPlayer4.TextureFormat);
                    this.r表示するプレビュー画像 = this.txプレビュー画像;
                }
                catch (Exception e)
                {
                    Trace.TraceError(e.ToString());
                    Trace.TraceError("背景画像の読み込みに失敗しました。({0})", new object[] { this.str現在のファイル名 });
                    this.r表示するプレビュー画像 = this.txプレビュー画像がないときの画像;
                    return(false);
                }
                finally
                {
                    if (image != null)
                    {
                        image.Dispose();
                    }
                    if (bitmap2 != null)
                    {
                        bitmap2.Dispose();
                    }
                    if (bitmap3 != null)
                    {
                        bitmap3.Dispose();
                    }
                }
            }
            return(true);
        }
        /// <summary>
        /// 一時的に使用禁止。
        /// </summary>
        private void t描画処理_ジャンル文字列()
        {
            C曲リストノード c曲リストノード = TJAPlayer4.stage選曲.r現在選択中の曲;
            Cスコア     cスコア     = TJAPlayer4.stage選曲.r現在選択中のスコア;

            if ((c曲リストノード != null) && (cスコア != null))
            {
                string str = "";
                switch (c曲リストノード.eノード種別)
                {
                case C曲リストノード.Eノード種別.SCORE:
                    if ((c曲リストノード.strジャンル == null) || (c曲リストノード.strジャンル.Length <= 0))
                    {
                        if ((cスコア.譜面情報.ジャンル != null) && (cスコア.譜面情報.ジャンル.Length > 0))
                        {
                            str = cスコア.譜面情報.ジャンル;
                        }
#if false       // #32644 2013.12.21 yyagi "Unknown"なジャンル表示を削除。DTX/BMSなどの種別表示もしない。
                        else
                        {
                            switch (cスコア.譜面情報.曲種別)
                            {
                            case CDTX.E種別.DTX:
                                str = "DTX";
                                break;

                            case CDTX.E種別.GDA:
                                str = "GDA";
                                break;

                            case CDTX.E種別.G2D:
                                str = "G2D";
                                break;

                            case CDTX.E種別.BMS:
                                str = "BMS";
                                break;

                            case CDTX.E種別.BME:
                                str = "BME";
                                break;
                            }
                            str = "Unknown";
                        }
#endif
                        break;
                    }
                    str = c曲リストノード.strジャンル;
                    break;

                case C曲リストノード.Eノード種別.SCORE_MIDI:
                    str = "MIDI";
                    break;

                case C曲リストノード.Eノード種別.BOX:
                    str = "MusicBox";
                    break;

                case C曲リストノード.Eノード種別.BACKBOX:
                    str = "BackBox";
                    break;

                case C曲リストノード.Eノード種別.RANDOM:
                    str = "Random";
                    break;

                default:
                    str = "Unknown";
                    break;
                }
                TJAPlayer4.act文字コンソール.tPrint(this.n本体X + 0x12, this.n本体Y - 1, C文字コンソール.Eフォント種別.赤細, str);
            }
        }
Пример #4
0
        public void t選択曲が変更された()
        {
            Cスコア cスコア = TJAPlayer4.stage選曲.r現在選択中のスコア;

            if (cスコア != null)
            {
                Bitmap image = new Bitmap(1, 1);
                TJAPlayer4.tテクスチャの解放(ref this.txArtist);
                this.strArtist = cスコア.譜面情報.アーティスト名;
                if ((this.strArtist != null) && (this.strArtist.Length > 0))
                {
                    Graphics graphics = Graphics.FromImage(image);
                    graphics.PageUnit = GraphicsUnit.Pixel;
                    SizeF ef = graphics.MeasureString(this.strArtist, this.ft描画用フォント);
                    graphics.Dispose();
                    if (ef.Width > SampleFramework.GameWindowSize.Width)
                    {
                        ef.Width = SampleFramework.GameWindowSize.Width;
                    }
                    try
                    {
                        Bitmap bitmap2 = new Bitmap((int)Math.Ceiling((double)ef.Width), (int)Math.Ceiling((double)this.ft描画用フォント.Size));
                        graphics = Graphics.FromImage(bitmap2);
                        graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
                        graphics.DrawString(this.strArtist, this.ft描画用フォント, Brushes.White, ( float )0f, ( float )0f);
                        graphics.Dispose();
                        this.txArtist          = new CTexture(TJAPlayer4.app.Device, bitmap2, TJAPlayer4.TextureFormat);
                        this.txArtist.vc拡大縮小倍率 = new Vector3(0.5f, 0.5f, 1f);
                        bitmap2.Dispose();
                    }
                    catch (CTextureCreateFailedException e)
                    {
                        Trace.TraceError(e.ToString());
                        Trace.TraceError("ARTISTテクスチャの生成に失敗しました。");
                        this.txArtist = null;
                    }
                }
                TJAPlayer4.tテクスチャの解放(ref this.txComment);
                //this.strComment = cスコア.譜面情報.コメント;
                this.strComment = cスコア.譜面情報.ジャンル;
                if ((this.strComment != null) && (this.strComment.Length > 0))
                {
                    Graphics graphics2 = Graphics.FromImage(image);
                    graphics2.PageUnit = GraphicsUnit.Pixel;
                    SizeF ef2  = graphics2.MeasureString(this.strComment, this.ft描画用フォント);
                    Size  size = new Size((int)Math.Ceiling((double)ef2.Width), (int)Math.Ceiling((double)ef2.Height));
                    graphics2.Dispose();
                    this.nテクスチャの最大幅 = TJAPlayer4.app.Device.Capabilities.MaxTextureWidth;
                    int    maxTextureHeight = TJAPlayer4.app.Device.Capabilities.MaxTextureHeight;
                    Bitmap bitmap3          = new Bitmap(size.Width, (int)Math.Ceiling((double)this.ft描画用フォント.Size));
                    graphics2 = Graphics.FromImage(bitmap3);
                    graphics2.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
                    graphics2.DrawString(this.strComment, this.ft描画用フォント, Brushes.White, ( float )0f, ( float )0f);
                    graphics2.Dispose();
                    this.nComment行数    = 1;
                    this.nComment最終行の幅 = size.Width;
                    while (this.nComment最終行の幅 > this.nテクスチャの最大幅)
                    {
                        this.nComment行数++;
                        this.nComment最終行の幅 -= this.nテクスチャの最大幅;
                    }
                    while ((this.nComment行数 * ((int)Math.Ceiling((double)this.ft描画用フォント.Size))) > maxTextureHeight)
                    {
                        this.nComment行数--;
                        this.nComment最終行の幅 = this.nテクスチャの最大幅;
                    }
                    Bitmap bitmap4 = new Bitmap((this.nComment行数 > 1) ? this.nテクスチャの最大幅 : this.nComment最終行の幅, this.nComment行数 * ((int)Math.Ceiling((double)this.ft描画用フォント.Size)));
                    graphics2 = Graphics.FromImage(bitmap4);
                    Rectangle srcRect  = new Rectangle();
                    Rectangle destRect = new Rectangle();
                    for (int i = 0; i < this.nComment行数; i++)
                    {
                        srcRect.X       = i * this.nテクスチャの最大幅;
                        srcRect.Y       = 0;
                        srcRect.Width   = ((i + 1) == this.nComment行数) ? this.nComment最終行の幅 : this.nテクスチャの最大幅;
                        srcRect.Height  = bitmap3.Height;
                        destRect.X      = 0;
                        destRect.Y      = i * bitmap3.Height;
                        destRect.Width  = srcRect.Width;
                        destRect.Height = srcRect.Height;
                        graphics2.DrawImage(bitmap3, destRect, srcRect, GraphicsUnit.Pixel);
                    }
                    graphics2.Dispose();
                    try
                    {
                        this.txComment          = new CTexture(TJAPlayer4.app.Device, bitmap4, TJAPlayer4.TextureFormat);
                        this.txComment.vc拡大縮小倍率 = new Vector3(0.5f, 0.5f, 1f);
                    }
                    catch (CTextureCreateFailedException e)
                    {
                        Trace.TraceError(e.ToString());
                        Trace.TraceError("COMMENTテクスチャの生成に失敗しました。");
                        this.txComment = null;
                    }
                    bitmap4.Dispose();
                    bitmap3.Dispose();
                }
                image.Dispose();
                if (this.txComment != null)
                {
                    this.ctComment = new CCounter(-740, (int)((((this.nComment行数 - 1) * this.nテクスチャの最大幅) + this.nComment最終行の幅) * this.txComment.vc拡大縮小倍率.X), 10, TJAPlayer4.Timer);
                }
            }
        }